MediaWiki:Gadget-ProveIt.js: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Update to latest version
Update docs
 
(3 revisi perantara oleh pengguna yang sama tidak ditampilkan)
Baris 1:
/**
* ProveIt is a powerful reference manager for Wikipedia and any other MediaWiki wiki
* Documentation at https://commonswww.wikimediamediawiki.org/wiki/Help:Gadget-ProveIt
*
* andThis initialization script sets the configuration options specific to this wiki
* The gadget code is loaded directly from Wikimedia Commons
* and then loads the ProveIt code directly from MediaWiki.org
* 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': 'ProveItsuntingan editProveIt', // Revision tag defined at Special:Tags (optional)
'proveit-summary': 'ReferenceReferensi editeddisunting withmenggunakan [[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://commonswww.wikimediamediawiki.org/w/indexload.php?titlemodules=MediaWiki:Gadget-ProveIt2ext.jsgadget.ProveIt&actiononly=raw&ctype=text/javascriptscripts' );
mw.loader.load( 'https://commonswww.wikimediamediawiki.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 () {;