Add .jshintrc file and update core.js to remove errors

Bug: 62997
Change-Id: I89d46c913994bd620ae904fbd626621be4aca170
This commit is contained in:
Prateek Saxena 2014-03-25 11:44:24 +05:30
parent 720fe09e2c
commit eb625b222d
2 changed files with 33 additions and 2 deletions

26
.jshintrc Normal file
View file

@ -0,0 +1,26 @@
{
/* 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,
// Legacy
"onevar": true,
/* Local */
"predef": [
"mediaWiki",
"jQuery"
]
}

View file

@ -2,7 +2,9 @@
* https://en.wikipedia.org/wiki/User:Yair_rand/NavPopupsRestyled.js
*/
/*global mw:false */
/* global mw: false */
/* global moment: false */
/* jslint browser: true */
(function ( $ ) {
$( document ).ready( function() {
@ -335,6 +337,10 @@
* @param {string} href
*/
function logEvent ( href ) {
if ( typeof mw.eventLog !== 'function' ) {
return false;
}
var dfd = $.Deferred(),
event = {
'duration': Math.round( elDuration ),
@ -355,7 +361,6 @@
setTimeout( dfd.reject, 1000 );
elTime = elDuration = elAction = undefined;
}
var logEvent = mw.eventLog ? mw.eventLog.logEvent : function () {};
/**
* @method getSessionId