jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/349345 )
Change subject: wikiEditorToolbarEnabled: Rewrite if block as statement
......................................................................
wikiEditorToolbarEnabled: Rewrite if block as statement
Change-Id: I516a8e8f1bf53dc784a2ab3ff49bd20b172dc6e8
---
M resources/ext.CodeMirror.js
1 file changed, 4 insertions(+), 7 deletions(-)
Approvals:
Pastakhov: Looks good to me, but someone else must approve
jenkins-bot: Verified
Jforrester: Looks good to me, approved
diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js
index a1c682e..91e417d 100644
--- a/resources/ext.CodeMirror.js
+++ b/resources/ext.CodeMirror.js
@@ -1,5 +1,5 @@
( function ( mw, $ ) {
- var origTextSelection, useCodeMirror, codeMirror, api,
originHooksTextarea, wikiEditorToolbarEnabled = false;
+ var origTextSelection, useCodeMirror, codeMirror, api,
originHooksTextarea, wikiEditorToolbarEnabled;
if ( mw.config.get( 'wgCodeEditorCurrentLanguage' ) ) { // If the
CodeEditor is used then just exit;
return;
@@ -11,13 +11,10 @@
useCodeMirror = mw.user.options.get( 'usecodemirror' ) > 0;
api = new mw.Api();
originHooksTextarea = $.valHooks.textarea;
-
- if ( mw.loader.getState( 'ext.wikiEditor' ) ) { // The WikiEditor
extension exists
+ // The WikiEditor extension exists the WikiEditor beta toolbar is used
by the user
+ wikiEditorToolbarEnabled = !!mw.loader.getState( 'ext.wikiEditor' ) &&
// This can be the string "0" if the user disabled the
preference - Bug T54542#555387
- if ( mw.user.options.get( 'usebetatoolbar' ) > 0 ) { // And the
WikiEditor beta toolbar is used by the user
- wikiEditorToolbarEnabled = true;
- }
- }
+ mw.user.options.get( 'usebetatoolbar' ) > 0;
// function for a textselection function for CodeMirror
function cmTextSelection( command, options ) {
--
To view, visit https://gerrit.wikimedia.org/r/349345
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I516a8e8f1bf53dc784a2ab3ff49bd20b172dc6e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Pastakhov <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits