mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-09-25 03:09:40 +00:00
Merge "jshint config and fixes, FINALLY"
This commit is contained in:
commit
07a937571d
2
.jshintignore
Normal file
2
.jshintignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
resources/momentjs
|
||||
resources/ext.multimediaViewer.oojs
|
42
.jshintrc
Normal file
42
.jshintrc
Normal 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"
|
||||
]
|
||||
}
|
|
@ -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 ) );
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
this.currentIndex = start || 0;
|
||||
this.onInterfaceReady = [];
|
||||
|
||||
lightbox.iface = new LightboxInterface();
|
||||
lightbox.iface = new window.LightboxInterface();
|
||||
lightbox.interfaceReady();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue