Niharika29 has uploaded a new change for review. (
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeMirror
refs/changes/23/382023/1
diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js
index 7183450..5fa0549 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, spellcheck = 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
+ ) {
+ spellcheck = 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: spellcheck ? 'contenteditable' :
'textarea',
+ spellcheck: !!spellcheck,
viewportMargin: Infinity
} );
--
To view, visit https://gerrit.wikimedia.org/r/382023
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I86dbee82def94a38156f090d519f969f221c72e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Niharika29 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits