MediaWiki:Gadget-ProveIt.js: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
Update to latest version
Baris 3:
* Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
*
* andThis script sets the configuration options specific to this wiki
* Theand loads the gadget code is loaded directly from Wikimedia Commons
* This code is just the loader with some checks to minimize requests
* and the configuration options specific to this wiki
*/
 
// Only load on some namespaces
var namespace = mw.config.get( 'wgNamespaceNumber' );
if ( namespace === 0 || namespace === 2 ) {
 
// Only load on wikitext pages (and not in common.js or common.css, for example)
var contentModel = mw.config.get( 'wgPageContentModel' );
if ( contentModel === 'wikitext' ) {
 
// Only load on wikitext editors
mw.hook( 'wikipage.editform' ).add( loadProveIt );
mw.hook( 've.activationComplete' ).add( function () {
$( '#proveit' ).remove();
if ( ve.init.target.getSurface().getMode() === 'source' ) {
loadProveIt();
}
});
mw.hook( 've.deactivationComplete' ).add( function () {
$( '#proveit' ).remove();
});
}
}
 
function loadProveIt() {
mw.config.set({
'proveit-tag': 'suntingan ProveIt', // Revision tag defined at Special:Tags (optional)
'proveit-summary': 'Referensi disunting menggunakan [[Wikipedia:ProveIt|ProveIt]]', // Automatic edit summary (optional)
'proveit-templates': [ // Citation templates with(without template data (recommendednamespace)
'Templat:Cite bookCitation',
'Templat:Cite encyclopediaarXiv',
'Templat:Cite journalAV media',
'Templat:Cite reportbook',
'Templat:Cite webbioRxiv',
'Cite comic',
'Cite encyclopedia',
'Cite episode',
'Cite interview',
'Cite journal',
'Cite magazine',
'Cite news',
'Cite paper',
'Cite press release',
'Cite report',
'Cite sign',
'Cite speech',
'Cite thesis',
'Cite tweet',
'Cite video',
'Cite video game',
'Cite web',
}],
'proveit-namespaces': [ // Supported namespaces (see https://www.mediawiki.org/wiki/Manual:Namespace_constants)
0, // Main namespace
2, // User namespace
]
});
mw.loader.load( 'https://commons.wikimedia.org/w/indexload.php?titlemodules=MediaWiki:Gadget-ProveIt2ext.jsgadget.ProveIt&actiononly=raw&ctype=text/javascriptscripts' );
mw.loader.load( 'https://commons.wikimedia.org/w/indexload.php?titlemodules=MediaWiki:Gadget-ProveIt2ext.cssgadget.ProveIt&actiononly=raw&ctype=text/cssstyles', 'text/css' );
}
 
// Only load onwhen some namespacesediting
mw.hook( 'wikipage.editform' ).add( loadProveIt );
mw.hook( 've.activationComplete' ).add( functionloadProveIt () {;