jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382023 )

Change subject: Disable spellchecking for Firefox users on non-Mac systems
......................................................................


Disable spellchecking for Firefox users on non-Mac systems

Bug: T95104
Change-Id: I86dbee82def94a38156f090d519f969f221c72e1
---
M resources/ext.CodeMirror.js
1 file changed, 10 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Kaldari: Looks good to me, approved



diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js
index 7183450..a8139b6 100644
--- a/resources/ext.CodeMirror.js
+++ b/resources/ext.CodeMirror.js
@@ -1,6 +1,6 @@
 ( function ( mw, $ ) {
        var origTextSelection, useCodeMirror, codeMirror, api, 
originHooksTextarea,
-               wikiEditorToolbarEnabled;
+               wikiEditorToolbarEnabled, enableContentEditable = true;
 
        if ( mw.config.get( 'wgCodeEditorCurrentLanguage' ) ) { // If the 
CodeEditor is used then just exit;
                return;
@@ -16,6 +16,13 @@
        wikiEditorToolbarEnabled = !!mw.loader.getState( 'ext.wikiEditor' ) &&
                // This can be the string "0" if the user disabled the 
preference - Bug T54542#555387
                mw.user.options.get( 'usebetatoolbar' ) > 0;
+
+       // Disable spellchecking for Firefox users on non-Mac systems (Bug 
T95104)
+       if ( navigator.userAgent.indexOf( 'Firefox' ) > -1 &&
+               navigator.userAgent.indexOf( 'Mac' ) === -1
+       ) {
+               enableContentEditable = false;
+       }
 
        // T174055: Do not redefine the browser history navigation keys 
(T175378: for PC only)
        CodeMirror.keyMap.pcDefault[ 'Alt-Left' ] = false;
@@ -376,8 +383,8 @@
                                        Home: 'goLineLeft',
                                        End: 'goLineRight'
                                },
-                               inputStyle: 'contenteditable',
-                               spellcheck: true,
+                               inputStyle: enableContentEditable ? 
'contenteditable' : 'textarea',
+                               spellcheck: enableContentEditable,
                                viewportMargin: Infinity
                        } );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/382023
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I86dbee82def94a38156f090d519f969f221c72e1
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Niharika29 <[email protected]>
Gerrit-Reviewer: Fomafix <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to