JSHint: fix the last jslint/hint failures

Change-Id: I3695d0da964ee607d91510c490793aca1ace5d58
This commit is contained in:
Derk-Jan Hartman 2014-01-09 22:44:01 +01:00
parent 85fdb01d00
commit 2de765b86c
3 changed files with 25 additions and 5 deletions

18
.jshint Normal file
View 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
}

View file

@ -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 );

View file

@ -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 );