From da100929894549d0faeec73ef8020dcf93ffcf18 Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Fri, 21 May 2021 19:06:24 +0530 Subject: [PATCH] #101 lint changes --- src/editor/dialogs/cmenuDialog.js | 9 ++++++--- src/editor/dialogs/cmenuLayersDialog.js | 6 +++--- src/editor/dialogs/editorPreferencesDialog.js | 6 +++--- src/editor/dialogs/exportDialog.js | 8 ++++---- src/editor/dialogs/imagePropertiesDialog.js | 14 +++++++++----- src/editor/dialogs/svgSourceDialog.js | 11 ++++++----- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/editor/dialogs/cmenuDialog.js b/src/editor/dialogs/cmenuDialog.js index 6586b2eb..7416fc10 100644 --- a/src/editor/dialogs/cmenuDialog.js +++ b/src/editor/dialogs/cmenuDialog.js @@ -147,8 +147,8 @@ export class SeCMenuDialog extends HTMLElement { /** * @function init * @param {any} name - * @returns {void} - */ + * @returns {void} + */ init (i18next) { this.setAttribute('tools-cut', i18next.t('tools.cut')); this.setAttribute('tools-copy', i18next.t('tools.copy')); @@ -167,7 +167,10 @@ export class SeCMenuDialog extends HTMLElement { * @returns {any} observed */ static get observedAttributes () { - return [ 'disableallmenu', 'enablemenuitems', 'disablemenuitems', 'tools-cut', 'tools-copy', 'tools-paste', 'tools-paste_in_place', 'tools-delete', 'tools-group', 'tools-ungroup', 'tools-move_front', 'tools-move_up', 'tools-move_down', 'tools-move_back' ]; + return [ 'disableallmenu', 'enablemenuitems', 'disablemenuitems', 'tools-cut', + 'tools-copy', 'tools-paste', 'tools-paste_in_place', 'tools-delete', 'tools-group', + 'tools-ungroup', 'tools-move_front', 'tools-move_up', 'tools-move_down', + 'tools-move_back' ]; } /** * @function attributeChangedCallback diff --git a/src/editor/dialogs/cmenuLayersDialog.js b/src/editor/dialogs/cmenuLayersDialog.js index 121353f8..2fb31a8a 100644 --- a/src/editor/dialogs/cmenuLayersDialog.js +++ b/src/editor/dialogs/cmenuLayersDialog.js @@ -95,14 +95,14 @@ export class SeCMenuLayerDialog extends HTMLElement { /** * @function init * @param {any} name - * @returns {void} - */ + * @returns {void} + */ init (i18next) { this.setAttribute('layers-dupe', i18next.t('layers.dupe')); this.setAttribute('layers-del', i18next.t('layers.del')); this.setAttribute('layers-merge_down', i18next.t('layers.merge_down')); this.setAttribute('layers-merge_all', i18next.t('layers.merge_all')); - } + } /** * @function observedAttributes * @returns {any} observed diff --git a/src/editor/dialogs/editorPreferencesDialog.js b/src/editor/dialogs/editorPreferencesDialog.js index 6eb220f8..3fa6db38 100644 --- a/src/editor/dialogs/editorPreferencesDialog.js +++ b/src/editor/dialogs/editorPreferencesDialog.js @@ -265,8 +265,8 @@ export class SeEditPrefsDialog extends HTMLElement { /** * @function init * @param {any} name - * @returns {void} - */ + * @returns {void} + */ init (i18next) { this.setAttribute('common-ok', i18next.t('common.ok')); this.setAttribute('common-cancel', i18next.t('common.cancel')); @@ -287,7 +287,7 @@ export class SeEditPrefsDialog extends HTMLElement { this.setAttribute('config-units_and_rulers', i18next.t('config.units_and_rulers')); this.setAttribute('config-show_rulers', i18next.t('config.show_rulers')); this.setAttribute('config-base_unit', i18next.t('config.base_unit')); - } + } /** * @function observedAttributes * @returns {any} observed diff --git a/src/editor/dialogs/exportDialog.js b/src/editor/dialogs/exportDialog.js index 1c647335..2c6ddca4 100644 --- a/src/editor/dialogs/exportDialog.js +++ b/src/editor/dialogs/exportDialog.js @@ -99,14 +99,14 @@ export class SeExportDialog extends HTMLElement { /** * @function init * @param {any} name - * @returns {void} - */ + * @returns {void} + */ init (i18next) { this.setAttribute('common-ok', i18next.t('common.ok')); this.setAttribute('common-cancel', i18next.t('common.cancel')); this.setAttribute('ui-quality', i18next.t('ui.quality')); this.setAttribute('ui-export_type_label', i18next.t('ui.export_type_label')); - } + } /** * @function observedAttributes * @returns {any} observed @@ -145,7 +145,7 @@ export class SeExportDialog extends HTMLElement { case 'ui-export_type_label': node = this._shadowRoot.querySelector('#export_select'); node.textContent = newValue; - break; + break; default: // super.attributeChangedCallback(name, oldValue, newValue); break; diff --git a/src/editor/dialogs/imagePropertiesDialog.js b/src/editor/dialogs/imagePropertiesDialog.js index cc363786..aab3bce9 100644 --- a/src/editor/dialogs/imagePropertiesDialog.js +++ b/src/editor/dialogs/imagePropertiesDialog.js @@ -143,8 +143,8 @@ export class SeImgPropDialog extends HTMLElement { /** * @function init * @param {any} name - * @returns {void} - */ + * @returns {void} + */ init (i18next) { this.setAttribute('common-ok', i18next.t('common.ok')); this.setAttribute('common-cancel', i18next.t('common.cancel')); @@ -165,7 +165,11 @@ export class SeImgPropDialog extends HTMLElement { * @returns {any} observed */ static get observedAttributes () { - return [ 'title', 'width', 'height', 'save', 'dialog', 'embed', 'common-ok', 'common-cancel', 'config-image_props', 'config-doc_title', 'config-doc_dims', 'common-width', 'common-height', 'config-select_predefined', 'tools-fit-to-content', 'config-included_images', 'config-image_opt_embed', 'config-image_opt_ref' ]; + return [ 'title', 'width', 'height', 'save', 'dialog', 'embed', 'common-ok', + 'common-cancel', 'config-image_props', 'config-doc_title', 'config-doc_dims', + 'common-width', 'common-height', 'config-select_predefined', + 'tools-fit-to-content', 'config-included_images', 'config-image_opt_embed', + 'config-image_opt_ref' ]; } /** * @function attributeChangedCallback @@ -243,7 +247,7 @@ export class SeImgPropDialog extends HTMLElement { node = this._shadowRoot.querySelector('#svginfo_title'); node.textContent = newValue; break; - case 'config-doc_dims': + case 'config-doc_dims': node = this._shadowRoot.querySelector('#svginfo_dim'); node.textContent = newValue; break; @@ -251,7 +255,7 @@ export class SeImgPropDialog extends HTMLElement { node = this._shadowRoot.querySelector('#svginfo_width'); node.textContent = newValue; break; - case 'common-height': + case 'common-height': node = this._shadowRoot.querySelector('#svginfo_height'); node.textContent = newValue; break; diff --git a/src/editor/dialogs/svgSourceDialog.js b/src/editor/dialogs/svgSourceDialog.js index 4f6c4986..39874645 100644 --- a/src/editor/dialogs/svgSourceDialog.js +++ b/src/editor/dialogs/svgSourceDialog.js @@ -97,14 +97,14 @@ export class SeSvgSourceEditorDialog extends HTMLElement { /** * @function init * @param {any} name - * @returns {void} - */ + * @returns {void} + */ init (i18next) { this.setAttribute('tools-source_save', i18next.t('tools.source_save')); this.setAttribute('common-cancel', i18next.t('common.cancel')); this.setAttribute('notification-source_dialog_note', i18next.t('notification.source_dialog_note')); this.setAttribute('config-done', i18next.t('config.done')); - } + } /** * @function observedAttributes * @returns {any} observed @@ -121,6 +121,7 @@ export class SeSvgSourceEditorDialog extends HTMLElement { */ attributeChangedCallback (name, oldValue, newValue) { if (oldValue === newValue) return; + let node; switch (name) { case 'dialog': if (newValue === 'open') { @@ -155,12 +156,12 @@ export class SeSvgSourceEditorDialog extends HTMLElement { this.$cancelBtn.textContent = newValue; break; case 'notification-source_dialog_note': - const node = this._shadowRoot.querySelector('#copy_save_note'); + node = this._shadowRoot.querySelector('#copy_save_note'); node.textContent = newValue; break; case 'config-done': this.$copyBtn.textContent = newValue; - break; + break; default: super.attributeChangedCallback(name, oldValue, newValue); break;