Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f2aba9bf
authored
Jan 06, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
u
parent
d1f6c56f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
utils/index.ts
utils/index.ts
View file @
f2aba9bf
...
...
@@ -56,6 +56,17 @@ export function uuid() {
return
s
.
join
(
""
)
}
export
function
copyTextToClipboard
(
text
:
string
)
{
const
input
=
document
.
createElement
(
"input"
);
input
.
setAttribute
(
"readonly"
,
"readonly"
);
input
.
setAttribute
(
"value"
,
text
);
document
.
body
.
appendChild
(
input
);
input
.
select
();
const
ret
=
document
.
execCommand
(
"copy"
);
document
.
body
.
removeChild
(
input
);
return
ret
;
}
const
URL_REGEX
=
/
((?:(?:
https
?
|ftp|file
)
:
\/\/
|www
\.
|ftp
\.)(?:\([
-A-Z0-9+&@#
\/
%=~_|$?!:,.
]
*
\)
|
[
-A-Z0-9+&@#
\/
%=~_|$?!:,.
])
*
(?:\([
-A-Z0-9+&@#
\/
%=~_|$?!:,.
]
*
\)
|
[
A-Z0-9+&@#
\/
%=~_|$
]))
/gim
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment