Уборка Unreachable statement. Замена === на == и !== на != в яваскриптах из-за ошибок с нестрогой типизацией при переходе на 7.4.

This commit is contained in:
2023-04-08 18:14:19 +03:00
parent 3f3ffc2114
commit cfaf82f73a
76 changed files with 2079 additions and 1918 deletions
@@ -155,7 +155,7 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
( function() {
'use strict';
var mode = ( window.location.hash.substr( 1 ) === 'advanced' ) ? 'advanced' : 'basic',
var mode = ( window.location.hash.substr( 1 ) == 'advanced' ) ? 'advanced' : 'basic',
configuratorSection = CKEDITOR.document.findOne( 'main > .grid-container.configurator' ),
basicInstruction = CKEDITOR.document.findOne( '#help-content .basic' ),
advancedInstruction = CKEDITOR.document.findOne( '#help-content .advanced' ),
@@ -166,7 +166,7 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
// Initial setup
function updateSwitcher() {
if ( mode === 'advanced' ) {
if ( mode == 'advanced' ) {
modeSwitchAdvanced.$.checked = true;
} else {
modeSwitchBasic.$.checked = true;
@@ -177,7 +177,7 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
CKEDITOR.document.getWindow().on( 'hashchange', function( e ) {
var hash = window.location.hash.substr( 1 );
if ( !( hash === 'advanced' || hash === 'basic' ) ) {
if ( !( hash == 'advanced' || hash == 'basic' ) ) {
return;
}
mode = hash;
@@ -185,18 +185,18 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
} );
CKEDITOR.document.getWindow().on( 'resize', function() {
updateToolbar( ( mode === 'basic' ? toolbarModifier : toolbarTextModifier )[ 'editorInstance' ] );
updateToolbar( ( mode == 'basic' ? toolbarModifier : toolbarTextModifier )[ 'editorInstance' ] );
} );
function onRefresh( modifier ) {
modifier = modifier || this;
if ( mode === 'basic' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
if ( mode == 'basic' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
return;
}
// CodeMirror container becomes visible, so we need to refresh and to avoid rendering problems.
if ( mode === 'advanced' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
if ( mode == 'advanced' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
modifier.codeContainer.refresh();
}
@@ -243,17 +243,17 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
toolbarTextModifier.onRefresh = onRefresh;
function onToolbarInit() {
if ( ++done === 2 ) {
if ( ++done == 2 ) {
onToolbarsDone();
positionSticky.watch( CKEDITOR.document.findOne( '.toolbar' ), function() {
return mode === 'advanced';
return mode == 'advanced';
} );
}
}
function onToolbarsDone() {
if ( mode === 'basic' ) {
if ( mode == 'basic' ) {
toggleModeBasic( false );
} else {
toggleModeAdvanced( false );
@@ -278,7 +278,7 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
}
function toggleModeBasic( callOnRefresh ) {
callOnRefresh = ( callOnRefresh !== false );
callOnRefresh = ( callOnRefresh != false );
mode = 'basic';
window.location.hash = '#basic';
toogleModeSwitch( modeSwitchBasic, modeSwitchAdvanced, toolbarModifier, toolbarTextModifier );
@@ -291,7 +291,7 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
}
function toggleModeAdvanced( callOnRefresh ) {
callOnRefresh = ( callOnRefresh !== false );
callOnRefresh = ( callOnRefresh != false );
mode = 'advanced';
window.location.hash = '#advanced';
toogleModeSwitch( modeSwitchAdvanced, modeSwitchBasic, toolbarTextModifier, toolbarModifier );
@@ -358,7 +358,7 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
var shouldBeFixed = this.shouldBeFixed( element );
// Nothing to be done.
if ( isFixed === shouldBeFixed ) {
if ( isFixed == shouldBeFixed ) {
return;
}