Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Twinkle mobile TEST adapter - sirf personal test ke liye
// Jagah: User:Bharatwiki Socrates/minerva.js (sirf Minerva skin me chalega)
// Kaam: Gadgets-definition badle bina, Twinkle ki files raw load karke
// mobile par Twinkle chalana, taaki test ho sake ki menu aur dialog
// Minerva me kaam karte hain ya nahi.
// Test pass hone par ye file hata kar asal fix Gadgets-definition
// aur ek chhote mobile CSS gadget se hoga.
( function () {
if ( mw.config.get( 'skin' ) !== 'minerva' ) {
return;
}
if ( window.twinkleMobileTestLoaded ) {
return;
}
window.twinkleMobileTestLoaded = true;
var indexPhp = mw.util.wikiScript( 'index' );
function rawUrl( title ) {
return indexPhp + '?title=' + encodeURIComponent( title ) +
'&action=raw&ctype=text/javascript';
}
function rawCss( title ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.href = indexPhp + '?title=' + encodeURIComponent( title ) +
'&action=raw&ctype=text/css';
document.head.appendChild( link );
}
function loadScript( title ) {
return $.getScript( rawUrl( title ) );
}
// Mobile par dialog screen ke andar rahe, iske liye CSS fitting
mw.util.addCSS(
'.ui-dialog { max-width: 96vw !important; left: 2vw !important; }' +
'.morebits-dialog { max-width: 96vw !important; }' +
'.morebits-dialog-content { overflow-x: auto; }' +
'.select2-container { max-width: 90vw; }' +
'#p-twinkle, .twinkle-menu { font-size: 100%; }'
);
rawCss( 'MediaWiki:Gadget-Twinkle.css' );
rawCss( 'MediaWiki:Gadget-morebits.css' );
rawCss( 'MediaWiki:Gadget-select2.min.css' );
mw.loader.using( [
'mediawiki.util', 'mediawiki.api', 'mediawiki.storage',
'mediawiki.Title', 'mediawiki.user', 'jquery.ui'
] ).then( function () {
return loadScript( 'MediaWiki:Gadget-select2.min.js' );
} ).then( function () {
return loadScript( 'MediaWiki:Gadget-morebits.js' );
} ).then( function () {
return loadScript( 'MediaWiki:Gadget-Twinkle.js' );
} ).then( function () {
mw.notify( 'Twinkle mobile test load ho gaya', { type: 'info' } );
} ).catch( function ( err ) {
mw.notify( 'Twinkle mobile test load FAIL: ' + err, { type: 'error' } );
} );
}() );