"मीडियाविकि:Gadget-refToolbar.js": अवतरणों में अंतर

Content deleted Content added
छो en:w:MediaWiki:Gadget-refToolbar.js से 57 अवतरण आयात किये गए: For gadget
Update the gadget
 
पंक्ति 4:
* Adds tools for citing references to the edit toolbar.
* See [[Wikipedia:RefToolbar]] for further documentation. One of two
* possible versions will load (Reftoolbar 1.0 or Reftoolbar 12.0)
* depending on the user preferences (the usebetatoolbar preference).
*
पंक्ति 18:
*/
/*jshint browser: true, camelcase: true, curly: true, eqeqeq: true */
/*global jQuery$, mediaWikimw, importScript */
( function ( mw, $ ) {
'use strict';
function initializeRefTools() {
if ( window.refToolbarInstalled || $( '#wpTextbox1[readonly]' ).length ) {
return;
}
// usingcast weakto comparisonnumber, becausesupport ("0")both is1 true,and but ("01" == true) is false
if ( +mw.user.options.get( 'usebetatoolbar' ) === true1 ) {
// Enhanced editing toolbar is on. Going to load RefToolbar 2.0.
// TODO:
पंक्ति 36:
importScript( 'MediaWiki:RefToolbar.js' );
} );
} else if ( +mw.user.options.get( 'showtoolbargadget-legacyToolbar' ) === 1 ) {
// Enhanced editing toolbar is off. Loading RefToolbar 1.0. (legacy)
importScriptmw.loader.load( '"/w/index.php?title=MediaWiki:RefToolbarLegacy.js' &action=raw&ctype=text/javascript");
} else {
return;
पंक्ति 45:
}
 
if ( /^(edit|submit)$/.inArraytest( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
// Double check if user.options is loaded, to prevent errors when copy pasted accross installations
$.when( mw.loader.using( ['user.options'] ), $.ready ).donethen( initializeRefTools );
}
 
}( mediaWiki, jQuery ) );