Consistency
Be consistent about formatting within 1 and the same file.
This commit is contained in:
parent
6c5468d904
commit
8687b69167
|
@ -54,7 +54,7 @@ const IndicatorFontSizes = {
|
||||||
/**
|
/**
|
||||||
* Returns the available video width.
|
* Returns the available video width.
|
||||||
*/
|
*/
|
||||||
getAvailableVideoWidth: function () {
|
getAvailableVideoWidth() {
|
||||||
return window.innerWidth;
|
return window.innerWidth;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ const IndicatorFontSizes = {
|
||||||
*
|
*
|
||||||
* @param el the element
|
* @param el the element
|
||||||
*/
|
*/
|
||||||
getTextWidth: function (el) {
|
getTextWidth(el) {
|
||||||
return (el.clientWidth + 1);
|
return (el.clientWidth + 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ const IndicatorFontSizes = {
|
||||||
*
|
*
|
||||||
* @param el the element
|
* @param el the element
|
||||||
*/
|
*/
|
||||||
getTextHeight: function (el) {
|
getTextHeight(el) {
|
||||||
return (el.clientHeight + 1);
|
return (el.clientHeight + 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -88,14 +88,14 @@ const IndicatorFontSizes = {
|
||||||
*
|
*
|
||||||
* @param id the identifier of the audio element.
|
* @param id the identifier of the audio element.
|
||||||
*/
|
*/
|
||||||
playSoundNotification: function (id) {
|
playSoundNotification(id) {
|
||||||
document.getElementById(id).play();
|
document.getElementById(id).play();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes the given text.
|
* Escapes the given text.
|
||||||
*/
|
*/
|
||||||
escapeHtml: function (unsafeText) {
|
escapeHtml(unsafeText) {
|
||||||
return $('<div/>').text(unsafeText).html();
|
return $('<div/>').text(unsafeText).html();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -105,11 +105,11 @@ const IndicatorFontSizes = {
|
||||||
* @param {string} safe string which contains escaped html
|
* @param {string} safe string which contains escaped html
|
||||||
* @returns {string} unescaped html string.
|
* @returns {string} unescaped html string.
|
||||||
*/
|
*/
|
||||||
unescapeHtml: function (safe) {
|
unescapeHtml(safe) {
|
||||||
return $('<div />').html(safe).text();
|
return $('<div />').html(safe).text();
|
||||||
},
|
},
|
||||||
|
|
||||||
imageToGrayScale: function (canvas) {
|
imageToGrayScale(canvas) {
|
||||||
var context = canvas.getContext('2d');
|
var context = canvas.getContext('2d');
|
||||||
var imgData = context.getImageData(0, 0, canvas.width, canvas.height);
|
var imgData = context.getImageData(0, 0, canvas.width, canvas.height);
|
||||||
var pixels = imgData.data;
|
var pixels = imgData.data;
|
||||||
|
@ -156,7 +156,7 @@ const IndicatorFontSizes = {
|
||||||
* @param key the tooltip data-i18n key
|
* @param key the tooltip data-i18n key
|
||||||
* @param position the position of the tooltip in relation to the element
|
* @param position the position of the tooltip in relation to the element
|
||||||
*/
|
*/
|
||||||
setTooltip: function (element, key, position) {
|
setTooltip(element, key, position) {
|
||||||
if (element !== null) {
|
if (element !== null) {
|
||||||
element.setAttribute('data-tooltip', TOOLTIP_POSITIONS[position]);
|
element.setAttribute('data-tooltip', TOOLTIP_POSITIONS[position]);
|
||||||
element.setAttribute('data-i18n', '[content]' + key);
|
element.setAttribute('data-i18n', '[content]' + key);
|
||||||
|
@ -170,7 +170,7 @@ const IndicatorFontSizes = {
|
||||||
*
|
*
|
||||||
* @param element the element to remove the tooltip from
|
* @param element the element to remove the tooltip from
|
||||||
*/
|
*/
|
||||||
removeTooltip: function (element) {
|
removeTooltip(element) {
|
||||||
element.removeAttribute('data-tooltip', '');
|
element.removeAttribute('data-tooltip', '');
|
||||||
element.removeAttribute('data-i18n','');
|
element.removeAttribute('data-i18n','');
|
||||||
element.removeAttribute('content','');
|
element.removeAttribute('content','');
|
||||||
|
@ -183,7 +183,7 @@ const IndicatorFontSizes = {
|
||||||
* @returns {string|*}
|
* @returns {string|*}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_getTooltipText: function (element) {
|
_getTooltipText(element) {
|
||||||
let title = element.getAttribute('content');
|
let title = element.getAttribute('content');
|
||||||
let shortcut = element.getAttribute('shortcut');
|
let shortcut = element.getAttribute('shortcut');
|
||||||
if(shortcut) {
|
if(shortcut) {
|
||||||
|
@ -198,7 +198,7 @@ const IndicatorFontSizes = {
|
||||||
* @param container the container to which new child element will be added
|
* @param container the container to which new child element will be added
|
||||||
* @param newChild the new element that will be inserted into the container
|
* @param newChild the new element that will be inserted into the container
|
||||||
*/
|
*/
|
||||||
prependChild: function (container, newChild) {
|
prependChild(container, newChild) {
|
||||||
var firstChild = container.childNodes[0];
|
var firstChild = container.childNodes[0];
|
||||||
if (firstChild) {
|
if (firstChild) {
|
||||||
container.insertBefore(newChild, firstChild);
|
container.insertBefore(newChild, firstChild);
|
||||||
|
@ -214,7 +214,7 @@ const IndicatorFontSizes = {
|
||||||
* @returns {boolean} {true} to indicate that the given toolbar button
|
* @returns {boolean} {true} to indicate that the given toolbar button
|
||||||
* is enabled, {false} - otherwise
|
* is enabled, {false} - otherwise
|
||||||
*/
|
*/
|
||||||
isButtonEnabled: function (name) {
|
isButtonEnabled(name) {
|
||||||
return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1
|
return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1
|
||||||
|| interfaceConfig.MAIN_TOOLBAR_BUTTONS.indexOf(name) !== -1;
|
|| interfaceConfig.MAIN_TOOLBAR_BUTTONS.indexOf(name) !== -1;
|
||||||
},
|
},
|
||||||
|
@ -226,7 +226,7 @@ const IndicatorFontSizes = {
|
||||||
* @returns {boolean} {true} to indicate that the given setting section
|
* @returns {boolean} {true} to indicate that the given setting section
|
||||||
* is enabled, {false} - otherwise
|
* is enabled, {false} - otherwise
|
||||||
*/
|
*/
|
||||||
isSettingEnabled: function (name) {
|
isSettingEnabled(name) {
|
||||||
return interfaceConfig.SETTINGS_SECTIONS.indexOf(name) !== -1;
|
return interfaceConfig.SETTINGS_SECTIONS.indexOf(name) !== -1;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ const IndicatorFontSizes = {
|
||||||
*
|
*
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isAuthenticationEnabled: function() {
|
isAuthenticationEnabled() {
|
||||||
return interfaceConfig.AUTHENTICATION_ENABLE;
|
return interfaceConfig.AUTHENTICATION_ENABLE;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ const IndicatorFontSizes = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
hideDisabledButtons: function (mappings) {
|
hideDisabledButtons(mappings) {
|
||||||
var selector = Object.keys(mappings)
|
var selector = Object.keys(mappings)
|
||||||
.map(function (buttonName) {
|
.map(function (buttonName) {
|
||||||
return UIUtil.isButtonEnabled(buttonName)
|
return UIUtil.isButtonEnabled(buttonName)
|
||||||
|
@ -313,7 +313,7 @@ const IndicatorFontSizes = {
|
||||||
$(selector).hide();
|
$(selector).hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
redirect (url) {
|
redirect(url) {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ const IndicatorFontSizes = {
|
||||||
* @param {Object} attrs object with properties
|
* @param {Object} attrs object with properties
|
||||||
* @returns {String} string of html element attributes
|
* @returns {String} string of html element attributes
|
||||||
*/
|
*/
|
||||||
attrsToString: function (attrs) {
|
attrsToString(attrs) {
|
||||||
return Object.keys(attrs).map(
|
return Object.keys(attrs).map(
|
||||||
key => ` ${key}="${attrs[key]}"`
|
key => ` ${key}="${attrs[key]}"`
|
||||||
).join(' ');
|
).join(' ');
|
||||||
|
|
Loading…
Reference in New Issue