mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Add .jshintrc file and update core.js to remove errors
Bug: 62997 Change-Id: I89d46c913994bd620ae904fbd626621be4aca170
This commit is contained in:
parent
720fe09e2c
commit
eb625b222d
26
.jshintrc
Normal file
26
.jshintrc
Normal 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"
|
||||
]
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue