diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-08-13 15:07:23 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-25 11:07:56 +0100 |
commit | afff310e50f2fa8419bb4242470cbde46ab54463 (patch) | |
tree | 34efda2daf8f7cdfd89ef6616a79e2222082f93a /client/src/root-helpers/utils.ts | |
parent | f619de0e435f7ac3abad2ec772397486358b56e7 (diff) | |
download | PeerTube-afff310e50f2fa8419bb4242470cbde46ab54463.tar.gz PeerTube-afff310e50f2fa8419bb4242470cbde46ab54463.tar.zst PeerTube-afff310e50f2fa8419bb4242470cbde46ab54463.zip |
allow private syndication feeds via a user feedToken
Diffstat (limited to 'client/src/root-helpers/utils.ts')
-rw-r--r-- | client/src/root-helpers/utils.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/root-helpers/utils.ts b/client/src/root-helpers/utils.ts index de4e08bf5..e32187ddb 100644 --- a/client/src/root-helpers/utils.ts +++ b/client/src/root-helpers/utils.ts | |||
@@ -9,6 +9,18 @@ function objectToUrlEncoded (obj: any) { | |||
9 | return str.join('&') | 9 | return str.join('&') |
10 | } | 10 | } |
11 | 11 | ||
12 | function copyToClipboard (text: string) { | ||
13 | const el = document.createElement('textarea') | ||
14 | el.value = text | ||
15 | el.setAttribute('readonly', '') | ||
16 | el.style.position = 'absolute' | ||
17 | el.style.left = '-9999px' | ||
18 | document.body.appendChild(el) | ||
19 | el.select() | ||
20 | document.execCommand('copy') | ||
21 | document.body.removeChild(el) | ||
22 | } | ||
23 | |||
12 | // Thanks: https://github.com/uupaa/dynamic-import-polyfill | 24 | // Thanks: https://github.com/uupaa/dynamic-import-polyfill |
13 | function importModule (path: string) { | 25 | function importModule (path: string) { |
14 | return new Promise((resolve, reject) => { | 26 | return new Promise((resolve, reject) => { |
@@ -51,6 +63,7 @@ function wait (ms: number) { | |||
51 | } | 63 | } |
52 | 64 | ||
53 | export { | 65 | export { |
66 | copyToClipboard, | ||
54 | importModule, | 67 | importModule, |
55 | objectToUrlEncoded, | 68 | objectToUrlEncoded, |
56 | wait | 69 | wait |