mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-14 19:14:41 +00:00
JSHint: fix the last jslint/hint failures
Change-Id: I3695d0da964ee607d91510c490793aca1ace5d58
This commit is contained in:
parent
85fdb01d00
commit
2de765b86c
18
.jshint
Normal file
18
.jshint
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
/* Common */
|
||||
|
||||
// Enforcing
|
||||
"camelcase": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonew": true,
|
||||
"quotmark": "single",
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"unused": true
|
||||
}
|
|
@ -140,8 +140,9 @@ $( function () {
|
|||
|
||||
setLanguage = function ( lang ) {
|
||||
geshiLang = lang;
|
||||
var aceLang = map[geshiLang];
|
||||
codeEditor.getSession().setMode( new (require( "ace/mode/" + aceLang ).Mode) );
|
||||
var aceLang = map[geshiLang],
|
||||
AceLangMode = require( "ace/mode/" + aceLang ).Mode;
|
||||
codeEditor.getSession().setMode( new AceLangMode() );
|
||||
};
|
||||
setLanguage( geshiLang );
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
* Sets up the iframe in place of the textarea to allow more advanced operations
|
||||
*/
|
||||
'setupCodeEditor': function () {
|
||||
var box, lang, container, editdiv, session, resize, summary;
|
||||
var box, lang, container, editdiv, session, resize, summary, AceLangMode;
|
||||
|
||||
box = context.$textarea;
|
||||
lang = mw.config.get( "wgCodeEditorCurrentLanguage" );
|
||||
|
@ -184,7 +184,8 @@
|
|||
// updated right away to actually use the new style.
|
||||
$( mw ).bind( 'LivePreviewPrepare', context.evt.codeEditorSubmit );
|
||||
|
||||
session.setMode( new (require( "ace/mode/" + lang ).Mode) );
|
||||
AceLangMode = require( "ace/mode/" + lang ).Mode;
|
||||
session.setMode( new AceLangMode() );
|
||||
|
||||
// Force the box to resize horizontally to match in future :D
|
||||
resize = function () {
|
||||
|
@ -251,7 +252,7 @@
|
|||
}
|
||||
|
||||
// Line numbers in CodeEditor are zero-based
|
||||
line = parseInt( result[1] );
|
||||
line = parseInt( result[1], 10 );
|
||||
context.codeEditor.navigateTo( line - 1, 0 );
|
||||
// Scroll up a bit to give some context
|
||||
context.codeEditor.scrollToRow( line - 4 );
|
||||
|
|
Loading…
Reference in a new issue