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/client",
|
||||||
"wikimedia/jquery"
|
"wikimedia/jquery"
|
||||||
],
|
],
|
||||||
|
"env": {
|
||||||
|
"commonjs": true
|
||||||
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"OO": "readonly",
|
"OO": "readonly",
|
||||||
"mw": "readonly",
|
"mw": "readonly",
|
||||||
|
|
|
@ -53,6 +53,6 @@
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
M.define( 'skins.minerva.options/BackToTopOverlay', BackToTopOverlay );
|
module.exports = BackToTopOverlay;
|
||||||
|
|
||||||
}( mw.mobileFrontend ) );
|
}( mw.mobileFrontend ) );
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
( function ( M ) {
|
module.exports = function () {
|
||||||
var BackToTopOverlay = M.require( 'skins.minerva.options/BackToTopOverlay' ),
|
var BackToTopOverlay = require( './BackToTopOverlay.js' ),
|
||||||
backtotop = new BackToTopOverlay(),
|
backtotop = new BackToTopOverlay(),
|
||||||
features = mw.config.get( 'wgMinervaFeatures', {} ),
|
features = mw.config.get( 'wgMinervaFeatures', {} ),
|
||||||
|
M = mw.mobileFrontend,
|
||||||
mobile = M.require( 'mobile.startup' ),
|
mobile = M.require( 'mobile.startup' ),
|
||||||
browser = mobile.Browser.getSingleton(),
|
browser = mobile.Browser.getSingleton(),
|
||||||
eventBus = mobile.eventBusSingleton;
|
eventBus = mobile.eventBusSingleton;
|
||||||
|
@ -21,4 +22,4 @@
|
||||||
backtotop.hide();
|
backtotop.hide();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}( mw.mobileFrontend ) );
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
( function ( M ) {
|
module.exports = function () {
|
||||||
var
|
var
|
||||||
|
M = mw.mobileFrontend,
|
||||||
mobile = M.require( 'mobile.startup' ),
|
mobile = M.require( 'mobile.startup' ),
|
||||||
loader = mobile.rlModuleLoader,
|
loader = mobile.rlModuleLoader,
|
||||||
features = mw.config.get( 'wgMinervaFeatures', {} ),
|
features = mw.config.get( 'wgMinervaFeatures', {} ),
|
||||||
|
@ -56,4 +57,4 @@
|
||||||
|
|
||||||
$( initButton );
|
$( 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 ) {
|
module.exports = function () {
|
||||||
var shareIcon = M.require( 'skins.minerva.share/shareIcon' ),
|
var config = mw.config,
|
||||||
trackShare = M.require( 'skins.minerva.share/track' ),
|
shareIcon = require( './shareIcon.js' ),
|
||||||
|
trackShare = require( './trackShare.js' ),
|
||||||
features = config.get( 'wgMinervaFeatures', {} );
|
features = config.get( 'wgMinervaFeatures', {} );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,4 +26,4 @@
|
||||||
trackShare( 'shownShareButton' );
|
trackShare( 'shownShareButton' );
|
||||||
}
|
}
|
||||||
|
|
||||||
}( mw.mobileFrontend, mw.config ) );
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
( function ( M, msg, config ) {
|
( function ( M, msg, config ) {
|
||||||
var Icon = M.require( 'mobile.startup' ).Icon,
|
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
|
* 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 ) );
|
}( 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
|
* Helper function to track share button usage
|
||||||
*
|
*
|
||||||
|
@ -14,5 +14,5 @@
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
M.define( 'skins.minerva.share/track', trackShare );
|
module.exports = trackShare;
|
||||||
}( mw.mobileFrontend, mw.track, mw.user, mw.config ) );
|
}( mw.track, mw.user, mw.config ) );
|
||||||
|
|
|
@ -587,7 +587,8 @@
|
||||||
"styles": [
|
"styles": [
|
||||||
"resources/skins.minerva.options/backtotop.less"
|
"resources/skins.minerva.options/backtotop.less"
|
||||||
],
|
],
|
||||||
"scripts": [
|
"packageFiles": [
|
||||||
|
"resources/skins.minerva.options/index.js",
|
||||||
"resources/skins.minerva.options/BackToTopOverlay.js",
|
"resources/skins.minerva.options/BackToTopOverlay.js",
|
||||||
"resources/skins.minerva.options/backtotop.js",
|
"resources/skins.minerva.options/backtotop.js",
|
||||||
"resources/skins.minerva.options/categories.js",
|
"resources/skins.minerva.options/categories.js",
|
||||||
|
|
Loading…
Reference in New Issue