skins.minerva.options uses packageFiles
I want to remove the need for M.define in the Minerva repository. It's no longer necessary with packageFiles and will help tame a lot of the code we have here! Change-Id: If6a35a23e84a44adb965fd9c41265ba37eb8368e
This commit is contained in:
parent
61784701e2
commit
b9862d7d24
|
@ -4,6 +4,9 @@
|
|||
"wikimedia/client",
|
||||
"wikimedia/jquery"
|
||||
],
|
||||
"env": {
|
||||
"commonjs": true
|
||||
},
|
||||
"globals": {
|
||||
"OO": "readonly",
|
||||
"mw": "readonly",
|
||||
|
|
|
@ -53,6 +53,6 @@
|
|||
}
|
||||
} );
|
||||
|
||||
M.define( 'skins.minerva.options/BackToTopOverlay', BackToTopOverlay );
|
||||
module.exports = BackToTopOverlay;
|
||||
|
||||
}( mw.mobileFrontend ) );
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
( function ( M ) {
|
||||
var BackToTopOverlay = M.require( 'skins.minerva.options/BackToTopOverlay' ),
|
||||
module.exports = function () {
|
||||
var BackToTopOverlay = require( './BackToTopOverlay.js' ),
|
||||
backtotop = new BackToTopOverlay(),
|
||||
features = mw.config.get( 'wgMinervaFeatures', {} ),
|
||||
M = mw.mobileFrontend,
|
||||
mobile = M.require( 'mobile.startup' ),
|
||||
browser = mobile.Browser.getSingleton(),
|
||||
eventBus = mobile.eventBusSingleton;
|
||||
|
@ -21,4 +22,4 @@
|
|||
backtotop.hide();
|
||||
}
|
||||
} );
|
||||
}( mw.mobileFrontend ) );
|
||||
};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
( function ( M ) {
|
||||
module.exports = function () {
|
||||
var
|
||||
M = mw.mobileFrontend,
|
||||
mobile = M.require( 'mobile.startup' ),
|
||||
loader = mobile.rlModuleLoader,
|
||||
features = mw.config.get( 'wgMinervaFeatures', {} ),
|
||||
|
@ -56,4 +57,4 @@
|
|||
|
||||
$( initButton );
|
||||
|
||||
}( mw.mobileFrontend ) );
|
||||
};
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// setup back to top button
|
||||
require( './backtotop.js' )();
|
||||
// setup categories button
|
||||
require( './categories.js' )();
|
||||
// setup share button
|
||||
require( './share.js' )();
|
|
@ -1,6 +1,7 @@
|
|||
( function ( M, config ) {
|
||||
var shareIcon = M.require( 'skins.minerva.share/shareIcon' ),
|
||||
trackShare = M.require( 'skins.minerva.share/track' ),
|
||||
module.exports = function () {
|
||||
var config = mw.config,
|
||||
shareIcon = require( './shareIcon.js' ),
|
||||
trackShare = require( './trackShare.js' ),
|
||||
features = config.get( 'wgMinervaFeatures', {} );
|
||||
|
||||
/**
|
||||
|
@ -25,4 +26,4 @@
|
|||
trackShare( 'shownShareButton' );
|
||||
}
|
||||
|
||||
}( mw.mobileFrontend, mw.config ) );
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
( function ( M, msg, config ) {
|
||||
var Icon = M.require( 'mobile.startup' ).Icon,
|
||||
trackShare = M.require( 'skins.minerva.share/track' );
|
||||
trackShare = require( './trackShare.js' );
|
||||
|
||||
/**
|
||||
* Generate a mouse event that when run
|
||||
|
@ -42,5 +42,5 @@
|
|||
} );
|
||||
}
|
||||
|
||||
M.define( 'skins.minerva.share/shareIcon', shareIcon );
|
||||
module.exports = shareIcon;
|
||||
}( mw.mobileFrontend, mw.msg, mw.config ) );
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
( function ( M, track, user, config ) {
|
||||
( function ( track, user, config ) {
|
||||
/**
|
||||
* Helper function to track share button usage
|
||||
*
|
||||
|
@ -14,5 +14,5 @@
|
|||
} );
|
||||
}
|
||||
|
||||
M.define( 'skins.minerva.share/track', trackShare );
|
||||
}( mw.mobileFrontend, mw.track, mw.user, mw.config ) );
|
||||
module.exports = trackShare;
|
||||
}( mw.track, mw.user, mw.config ) );
|
||||
|
|
|
@ -587,7 +587,8 @@
|
|||
"styles": [
|
||||
"resources/skins.minerva.options/backtotop.less"
|
||||
],
|
||||
"scripts": [
|
||||
"packageFiles": [
|
||||
"resources/skins.minerva.options/index.js",
|
||||
"resources/skins.minerva.options/BackToTopOverlay.js",
|
||||
"resources/skins.minerva.options/backtotop.js",
|
||||
"resources/skins.minerva.options/categories.js",
|
||||
|
|
Loading…
Reference in New Issue