aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-08-13 15:07:23 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-11-25 11:07:56 +0100
commitafff310e50f2fa8419bb4242470cbde46ab54463 (patch)
tree34efda2daf8f7cdfd89ef6616a79e2222082f93a /client/src/root-helpers
parentf619de0e435f7ac3abad2ec772397486358b56e7 (diff)
downloadPeerTube-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')
-rw-r--r--client/src/root-helpers/utils.ts13
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
12function 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
13function importModule (path: string) { 25function 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
53export { 65export {
66 copyToClipboard,
54 importModule, 67 importModule,
55 objectToUrlEncoded, 68 objectToUrlEncoded,
56 wait 69 wait