Ver código fonte

Consistency

Be consistent about formatting within 1 and the same file.
master
Lyubomir Marinov 8 anos atrás
pai
commit
8687b69167
1 arquivos alterados com 17 adições e 17 exclusões
  1. 17
    17
      modules/UI/util/UIUtil.js

+ 17
- 17
modules/UI/util/UIUtil.js Ver arquivo

@@ -54,7 +54,7 @@ const IndicatorFontSizes = {
54 54
     /**
55 55
      * Returns the available video width.
56 56
      */
57
-    getAvailableVideoWidth: function () {
57
+    getAvailableVideoWidth() {
58 58
         return window.innerWidth;
59 59
     },
60 60
 
@@ -70,7 +70,7 @@ const IndicatorFontSizes = {
70 70
      *
71 71
      * @param el the element
72 72
      */
73
-    getTextWidth: function (el) {
73
+    getTextWidth(el) {
74 74
         return (el.clientWidth + 1);
75 75
     },
76 76
 
@@ -79,7 +79,7 @@ const IndicatorFontSizes = {
79 79
      *
80 80
      * @param el the element
81 81
      */
82
-    getTextHeight: function (el) {
82
+    getTextHeight(el) {
83 83
         return (el.clientHeight + 1);
84 84
     },
85 85
 
@@ -88,14 +88,14 @@ const IndicatorFontSizes = {
88 88
      *
89 89
      * @param id the identifier of the audio element.
90 90
      */
91
-    playSoundNotification: function (id) {
91
+    playSoundNotification(id) {
92 92
         document.getElementById(id).play();
93 93
     },
94 94
 
95 95
     /**
96 96
      * Escapes the given text.
97 97
      */
98
-    escapeHtml: function (unsafeText) {
98
+    escapeHtml(unsafeText) {
99 99
         return $('<div/>').text(unsafeText).html();
100 100
     },
101 101
 
@@ -105,11 +105,11 @@ const IndicatorFontSizes = {
105 105
      * @param {string} safe string which contains escaped html
106 106
      * @returns {string} unescaped html string.
107 107
      */
108
-    unescapeHtml: function (safe) {
108
+    unescapeHtml(safe) {
109 109
         return $('<div />').html(safe).text();
110 110
     },
111 111
 
112
-    imageToGrayScale: function (canvas) {
112
+    imageToGrayScale(canvas) {
113 113
         var context = canvas.getContext('2d');
114 114
         var imgData = context.getImageData(0, 0, canvas.width, canvas.height);
115 115
         var pixels  = imgData.data;
@@ -156,7 +156,7 @@ const IndicatorFontSizes = {
156 156
      * @param key the tooltip data-i18n key
157 157
      * @param position the position of the tooltip in relation to the element
158 158
      */
159
-    setTooltip: function (element, key, position) {
159
+    setTooltip(element, key, position) {
160 160
         if (element !== null) {
161 161
             element.setAttribute('data-tooltip', TOOLTIP_POSITIONS[position]);
162 162
             element.setAttribute('data-i18n', '[content]' + key);
@@ -170,7 +170,7 @@ const IndicatorFontSizes = {
170 170
      *
171 171
      * @param element the element to remove the tooltip from
172 172
      */
173
-    removeTooltip: function (element) {
173
+    removeTooltip(element) {
174 174
         element.removeAttribute('data-tooltip', '');
175 175
         element.removeAttribute('data-i18n','');
176 176
         element.removeAttribute('content','');
@@ -183,7 +183,7 @@ const IndicatorFontSizes = {
183 183
      * @returns {string|*}
184 184
      * @private
185 185
      */
186
-    _getTooltipText: function (element) {
186
+    _getTooltipText(element) {
187 187
         let title = element.getAttribute('content');
188 188
         let shortcut = element.getAttribute('shortcut');
189 189
         if(shortcut) {
@@ -198,7 +198,7 @@ const IndicatorFontSizes = {
198 198
      * @param container the container to which new child element will be added
199 199
      * @param newChild the new element that will be inserted into the container
200 200
      */
201
-    prependChild: function (container, newChild) {
201
+    prependChild(container, newChild) {
202 202
         var firstChild = container.childNodes[0];
203 203
         if (firstChild) {
204 204
             container.insertBefore(newChild, firstChild);
@@ -214,7 +214,7 @@ const IndicatorFontSizes = {
214 214
      * @returns {boolean} {true} to indicate that the given toolbar button
215 215
      * is enabled, {false} - otherwise
216 216
      */
217
-    isButtonEnabled: function (name) {
217
+    isButtonEnabled(name) {
218 218
         return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1
219 219
                 || interfaceConfig.MAIN_TOOLBAR_BUTTONS.indexOf(name) !== -1;
220 220
     },
@@ -226,7 +226,7 @@ const IndicatorFontSizes = {
226 226
      * @returns {boolean} {true} to indicate that the given setting section
227 227
      * is enabled, {false} - otherwise
228 228
      */
229
-    isSettingEnabled: function (name) {
229
+    isSettingEnabled(name) {
230 230
         return interfaceConfig.SETTINGS_SECTIONS.indexOf(name) !== -1;
231 231
     },
232 232
 
@@ -235,7 +235,7 @@ const IndicatorFontSizes = {
235 235
      *
236 236
      * @returns {boolean}
237 237
      */
238
-    isAuthenticationEnabled: function() {
238
+    isAuthenticationEnabled() {
239 239
         return interfaceConfig.AUTHENTICATION_ENABLE;
240 240
     },
241 241
 
@@ -303,7 +303,7 @@ const IndicatorFontSizes = {
303 303
         }
304 304
     },
305 305
 
306
-    hideDisabledButtons: function (mappings) {
306
+    hideDisabledButtons(mappings) {
307 307
         var selector = Object.keys(mappings)
308 308
           .map(function (buttonName) {
309 309
                 return UIUtil.isButtonEnabled(buttonName)
@@ -313,7 +313,7 @@ const IndicatorFontSizes = {
313 313
         $(selector).hide();
314 314
     },
315 315
 
316
-    redirect (url) {
316
+    redirect(url) {
317 317
          window.location.href = url;
318 318
     },
319 319
 
@@ -368,7 +368,7 @@ const IndicatorFontSizes = {
368 368
       * @param {Object} attrs object with properties
369 369
       * @returns {String} string of html element attributes
370 370
       */
371
-     attrsToString: function (attrs) {
371
+     attrsToString(attrs) {
372 372
          return Object.keys(attrs).map(
373 373
              key => ` ${key}="${attrs[key]}"`
374 374
          ).join(' ');

Carregando…
Cancelar
Salvar