Merge "jshint config and fixes, FINALLY"

This commit is contained in:
jenkins-bot 2013-12-02 22:00:05 +00:00 committed by Gerrit Code Review
commit 07a937571d
6 changed files with 48 additions and 14 deletions

2
.jshintignore Normal file
View file

@ -0,0 +1,2 @@
resources/momentjs
resources/ext.multimediaViewer.oojs

42
.jshintrc Normal file
View file

@ -0,0 +1,42 @@
{
/* 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 */
// Enforcing
"bitwise": true,
// Relaxing
"laxbreak": true,
"smarttabs": true,
"multistr": true,
// Environment
"browser": true,
// Legacy
"nomen": true,
"predef": [
"mediaWiki",
"jQuery",
"QUnit",
"OO",
"moment",
"lightboxHooks"
]
}

View file

@ -15,8 +15,6 @@
* along with MultimediaViewer. If not, see <http://www.gnu.org/licenses/>.
*/
/* global OO, LightboxImage */
( function ( mw, $, oo, MLBImage ) {
function LightboxImage() {
MLBImage.call( this );
@ -25,4 +23,4 @@
oo.inheritClass( LightboxImage, MLBImage );
mw.LightboxImage = LightboxImage;
}( mediaWiki, jQuery, OO, LightboxImage ) );
}( mediaWiki, jQuery, OO, window.LightboxImage ) );

View file

@ -15,8 +15,6 @@
* along with MultimediaViewer. If not, see <http://www.gnu.org/licenses/>.
*/
/* global OO, LightboxInterface */
( function ( mw, $, oo, MLBInterface ) {
var LIP;
@ -389,4 +387,4 @@
};
window.LightboxInterface = LightboxInterface;
}( mediaWiki, jQuery, OO, LightboxInterface ) );
}( mediaWiki, jQuery, OO, window.LightboxInterface ) );

View file

@ -156,13 +156,7 @@
iface.autoResizeImage();
window.addEventListener( 'resize', function () {
var result = lightboxHooks.callAll( 'imageResize', iface ),
isFullScreen = (
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullScreenElement ||
document.msFullScreenElement ),
$measurement = isFullScreen ? $( window ) : iface.$image;
var result = lightboxHooks.callAll( 'imageResize', iface );
if ( result !== false ) {
iface.autoResizeImage();

View file

@ -14,7 +14,7 @@
this.currentIndex = start || 0;
this.onInterfaceReady = [];
lightbox.iface = new LightboxInterface();
lightbox.iface = new window.LightboxInterface();
lightbox.interfaceReady();
}