diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-12 19:02:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-16 11:50:08 +0200 |
commit | 40e87e9ecc54e3513fb586928330a7855eb192c6 (patch) | |
tree | af1111ecba85f9cd8286811ff332a67cf21be2f6 /client/src/app/shared/misc | |
parent | d4557fd3ecc8d4ed4fb0e5c868929bc36c959ed2 (diff) | |
download | PeerTube-40e87e9ecc54e3513fb586928330a7855eb192c6.tar.gz PeerTube-40e87e9ecc54e3513fb586928330a7855eb192c6.tar.zst PeerTube-40e87e9ecc54e3513fb586928330a7855eb192c6.zip |
Implement captions/subtitles
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/utils.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index 53aff1b24..8381745f5 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts | |||
@@ -81,7 +81,7 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) { | |||
81 | } | 81 | } |
82 | 82 | ||
83 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { | 83 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { |
84 | objectToFormData(obj[ key ], fd, key) | 84 | objectToFormData(obj[ key ], fd, formKey) |
85 | } else { | 85 | } else { |
86 | fd.append(formKey, obj[ key ]) | 86 | fd.append(formKey, obj[ key ]) |
87 | } | 87 | } |
@@ -96,6 +96,11 @@ function lineFeedToHtml (obj: object, keyToNormalize: string) { | |||
96 | }) | 96 | }) |
97 | } | 97 | } |
98 | 98 | ||
99 | function removeElementFromArray <T> (arr: T[], elem: T) { | ||
100 | const index = arr.indexOf(elem) | ||
101 | if (index !== -1) arr.splice(index, 1) | ||
102 | } | ||
103 | |||
99 | export { | 104 | export { |
100 | objectToUrlEncoded, | 105 | objectToUrlEncoded, |
101 | getParameterByName, | 106 | getParameterByName, |
@@ -104,5 +109,6 @@ export { | |||
104 | dateToHuman, | 109 | dateToHuman, |
105 | immutableAssign, | 110 | immutableAssign, |
106 | objectToFormData, | 111 | objectToFormData, |
107 | lineFeedToHtml | 112 | lineFeedToHtml, |
113 | removeElementFromArray | ||
108 | } | 114 | } |