diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/helpers | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/helpers')
-rw-r--r-- | client/src/app/helpers/locales/oc.ts | 114 | ||||
-rw-r--r-- | client/src/app/helpers/utils.ts | 10 |
2 files changed, 62 insertions, 62 deletions
diff --git a/client/src/app/helpers/locales/oc.ts b/client/src/app/helpers/locales/oc.ts index d3b2e8407..716b76df1 100644 --- a/client/src/app/helpers/locales/oc.ts +++ b/client/src/app/helpers/locales/oc.ts | |||
@@ -12,16 +12,16 @@ function plural (n: number): number { | |||
12 | 12 | ||
13 | export default [ | 13 | export default [ |
14 | 'oc', | 14 | 'oc', |
15 | [['a. m.', 'p. m.'], u, u], | 15 | [ [ 'a. m.', 'p. m.' ], u, u ], |
16 | u, | 16 | u, |
17 | [ | 17 | [ |
18 | ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], ['dg.', 'dl.', 'dm.', 'dc.', 'dj.', 'dv.', 'ds.'], | 18 | [ 'dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds' ], [ 'dg.', 'dl.', 'dm.', 'dc.', 'dj.', 'dv.', 'ds.' ], |
19 | ['dimenge', 'diluns', 'dimars', 'dimècres', 'dijòus', 'divendres', 'dissabte'], | 19 | [ 'dimenge', 'diluns', 'dimars', 'dimècres', 'dijòus', 'divendres', 'dissabte' ], |
20 | ['dg.', 'dl.', 'dm.', 'dc.', 'dj.', 'dv.', 'ds.'] | 20 | [ 'dg.', 'dl.', 'dm.', 'dc.', 'dj.', 'dv.', 'ds.' ] |
21 | ], | 21 | ], |
22 | u, | 22 | u, |
23 | [ | 23 | [ |
24 | ['GN', 'FB', 'MÇ', 'AB', 'MA', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DC'], | 24 | [ 'GN', 'FB', 'MÇ', 'AB', 'MA', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DC' ], |
25 | [ | 25 | [ |
26 | 'de gen.', 'de febr.', 'de març', 'd’abr.', 'de mai', 'de junh', 'de jul.', 'd’ag.', | 26 | 'de gen.', 'de febr.', 'de març', 'd’abr.', 'de mai', 'de junh', 'de jul.', 'd’ag.', |
27 | 'de set.', 'd’oct.', 'de nov.', 'de dec.' | 27 | 'de set.', 'd’oct.', 'de nov.', 'de dec.' |
@@ -32,7 +32,7 @@ export default [ | |||
32 | ] | 32 | ] |
33 | ], | 33 | ], |
34 | [ | 34 | [ |
35 | ['GN', 'FB', 'MÇ', 'AB', 'MA', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DC'], | 35 | [ 'GN', 'FB', 'MÇ', 'AB', 'MA', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DC' ], |
36 | [ | 36 | [ |
37 | 'gen.', 'febr.', 'març', 'abr.', 'mai', 'junh', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', | 37 | 'gen.', 'febr.', 'març', 'abr.', 'mai', 'junh', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', |
38 | 'dec.' | 38 | 'dec.' |
@@ -42,62 +42,62 @@ export default [ | |||
42 | 'novembre', 'decembre' | 42 | 'novembre', 'decembre' |
43 | ] | 43 | ] |
44 | ], | 44 | ], |
45 | [['aC', 'dC'], u, ['abans Jèsus-Crist', 'aprèp Jèsus-Crist']], | 45 | [ [ 'aC', 'dC' ], u, [ 'abans Jèsus-Crist', 'aprèp Jèsus-Crist' ] ], |
46 | 1, | 46 | 1, |
47 | [6, 0], | 47 | [ 6, 0 ], |
48 | ['d/M/yy', 'd MMM y', 'd MMMM \'de\' y', 'EEEE, d MMMM \'de\' y'], | 48 | [ 'd/M/yy', 'd MMM y', 'd MMMM \'de\' y', 'EEEE, d MMMM \'de\' y' ], |
49 | ['H:mm', 'H:mm:ss', 'H:mm:ss z', 'H:mm:ss zzzz'], | 49 | [ 'H:mm', 'H:mm:ss', 'H:mm:ss z', 'H:mm:ss zzzz' ], |
50 | ['{1} {0}', '{1}, {0}', '{1} \'a\' \'les\' {0}', u], | 50 | [ '{1} {0}', '{1}, {0}', '{1} \'a\' \'les\' {0}', u ], |
51 | [',', '.', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], | 51 | [ ',', '.', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':' ], |
52 | ['#,##0.###', '#,##0%', '#,##0.00 ¤', '#E0'], | 52 | [ '#,##0.###', '#,##0%', '#,##0.00 ¤', '#E0' ], |
53 | 'EUR', | 53 | 'EUR', |
54 | '€', | 54 | '€', |
55 | 'euro', | 55 | 'euro', |
56 | { | 56 | { |
57 | 'ARS': ['$AR', '$'], | 57 | ARS: [ '$AR', '$' ], |
58 | 'AUD': ['$AU', '$'], | 58 | AUD: [ '$AU', '$' ], |
59 | 'BEF': ['FB'], | 59 | BEF: [ 'FB' ], |
60 | 'BMD': ['$BM', '$'], | 60 | BMD: [ '$BM', '$' ], |
61 | 'BND': ['$BN', '$'], | 61 | BND: [ '$BN', '$' ], |
62 | 'BZD': ['$BZ', '$'], | 62 | BZD: [ '$BZ', '$' ], |
63 | 'CAD': ['$CA', '$'], | 63 | CAD: [ '$CA', '$' ], |
64 | 'CLP': ['$CL', '$'], | 64 | CLP: [ '$CL', '$' ], |
65 | 'CNY': [u, '¥'], | 65 | CNY: [ u, '¥' ], |
66 | 'COP': ['$CO', '$'], | 66 | COP: [ '$CO', '$' ], |
67 | 'CYP': ['£CY'], | 67 | CYP: [ '£CY' ], |
68 | 'EGP': [u, '£E'], | 68 | EGP: [ u, '£E' ], |
69 | 'FJD': ['$FJ', '$'], | 69 | FJD: [ '$FJ', '$' ], |
70 | 'FKP': ['£FK', '£'], | 70 | FKP: [ '£FK', '£' ], |
71 | 'FRF': ['F'], | 71 | FRF: [ 'F' ], |
72 | 'GBP': ['£GB', '£'], | 72 | GBP: [ '£GB', '£' ], |
73 | 'GIP': ['£GI', '£'], | 73 | GIP: [ '£GI', '£' ], |
74 | 'HKD': [u, '$'], | 74 | HKD: [ u, '$' ], |
75 | 'IEP': ['£IE'], | 75 | IEP: [ '£IE' ], |
76 | 'ILP': ['£IL'], | 76 | ILP: [ '£IL' ], |
77 | 'ITL': ['₤IT'], | 77 | ITL: [ '₤IT' ], |
78 | 'JPY': [u, '¥'], | 78 | JPY: [ u, '¥' ], |
79 | 'KMF': [u, 'FC'], | 79 | KMF: [ u, 'FC' ], |
80 | 'LBP': ['£LB', '£L'], | 80 | LBP: [ '£LB', '£L' ], |
81 | 'MTP': ['£MT'], | 81 | MTP: [ '£MT' ], |
82 | 'MXN': ['$MX', '$'], | 82 | MXN: [ '$MX', '$' ], |
83 | 'NAD': ['$NA', '$'], | 83 | NAD: [ '$NA', '$' ], |
84 | 'NIO': [u, '$C'], | 84 | NIO: [ u, '$C' ], |
85 | 'NZD': ['$NZ', '$'], | 85 | NZD: [ '$NZ', '$' ], |
86 | 'RHD': ['$RH'], | 86 | RHD: [ '$RH' ], |
87 | 'RON': [u, 'L'], | 87 | RON: [ u, 'L' ], |
88 | 'RWF': [u, 'FR'], | 88 | RWF: [ u, 'FR' ], |
89 | 'SBD': ['$SB', '$'], | 89 | SBD: [ '$SB', '$' ], |
90 | 'SGD': ['$SG', '$'], | 90 | SGD: [ '$SG', '$' ], |
91 | 'SRD': ['$SR', '$'], | 91 | SRD: [ '$SR', '$' ], |
92 | 'TOP': [u, '$T'], | 92 | TOP: [ u, '$T' ], |
93 | 'TTD': ['$TT', '$'], | 93 | TTD: [ '$TT', '$' ], |
94 | 'TWD': [u, 'NT$'], | 94 | TWD: [ u, 'NT$' ], |
95 | 'USD': ['$US', '$'], | 95 | USD: [ '$US', '$' ], |
96 | 'UYU': ['$UY', '$'], | 96 | UYU: [ '$UY', '$' ], |
97 | 'WST': ['$WS'], | 97 | WST: [ '$WS' ], |
98 | 'XCD': [u, '$'], | 98 | XCD: [ u, '$' ], |
99 | 'XPF': ['FCFP'], | 99 | XPF: [ 'FCFP' ], |
100 | 'ZMW': [u, 'Kw'] | 100 | ZMW: [ u, 'Kw' ] |
101 | }, | 101 | }, |
102 | 'ltr', | 102 | 'ltr', |
103 | plural | 103 | plural |
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts index edcaf50e0..8636f3a55 100644 --- a/client/src/app/helpers/utils.ts +++ b/client/src/app/helpers/utils.ts | |||
@@ -10,7 +10,7 @@ import { AuthService } from '../core/auth' | |||
10 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript | 10 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript |
11 | function getParameterByName (name: string, url: string) { | 11 | function getParameterByName (name: string, url: string) { |
12 | if (!url) url = window.location.href | 12 | if (!url) url = window.location.href |
13 | name = name.replace(/[\[\]]/g, '\\$&') | 13 | name = name.replace(/[[\]]/g, '\\$&') |
14 | 14 | ||
15 | const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)') | 15 | const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)') |
16 | const results = regex.exec(url) | 16 | const results = regex.exec(url) |
@@ -110,10 +110,10 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) { | |||
110 | continue | 110 | continue |
111 | } | 111 | } |
112 | 112 | ||
113 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { | 113 | if (obj[key] !== null && typeof obj[key] === 'object' && !(obj[key] instanceof File)) { |
114 | objectToFormData(obj[ key ], fd, formKey) | 114 | objectToFormData(obj[key], fd, formKey) |
115 | } else { | 115 | } else { |
116 | fd.append(formKey, obj[ key ]) | 116 | fd.append(formKey, obj[key]) |
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
@@ -159,7 +159,7 @@ function scrollToTop (behavior: 'auto' | 'smooth' = 'auto') { | |||
159 | function isInViewport (el: HTMLElement) { | 159 | function isInViewport (el: HTMLElement) { |
160 | const bounding = el.getBoundingClientRect() | 160 | const bounding = el.getBoundingClientRect() |
161 | return ( | 161 | return ( |
162 | bounding.top >= 0 && | 162 | bounding.top >= 0 && |
163 | bounding.left >= 0 && | 163 | bounding.left >= 0 && |
164 | bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | 164 | bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && |
165 | bounding.right <= (window.innerWidth || document.documentElement.clientWidth) | 165 | bounding.right <= (window.innerWidth || document.documentElement.clientWidth) |