_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

MediaWiki:Gadget-refToolbar.js

Today we want to address a topic that has become very relevant today: MediaWiki:Gadget-refToolbar.js. Whether we are talking about the importance of MediaWiki:Gadget-refToolbar.js in today's society, its impact on people's lives, or even its relevance in history, this is a topic that never ceases to arouse interest. From its origins to its impact on daily life, MediaWiki:Gadget-refToolbar.js has been the subject of debate and reflection. In this article, we will explore different facets of MediaWiki:Gadget-refToolbar.js to understand its true scope and meaning in our lives.
/**
 * RefToolbar
 *
 * Adds tools for citing references to the edit toolbar.
 * See ] for further documentation. One of two
 * possible versions will load (Reftoolbar 1.0 or Reftoolbar 2.0)
 * depending on the user preferences (the usebetatoolbar preference).
 *
 * @see: ]
 * @see: ]
 * @see: ]
 * @see: ]
 * @see: ]
 * @see: ]
 * @see: ]
 * @author: ]
 * @author: ]
 */
/*jshint browser: true, camelcase: true, curly: true, eqeqeq: true */
/*global $, mw */
( function () {
'use strict';
function initializeRefTools() {
	if ( window.refToolbarInstalled || $( '#wpTextbox1' ).length ) {
		return;
	}
        // cast to number, support both 1 and "1" 
	if ( +mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
		// Enhanced editing toolbar is on. Going to load RefToolbar 2.0.
		// TODO:
		// * Explicitly declare global variables from ] using window.*
		// * Move ] to ]
		// * Create the module 'ext.gadget.refToolbarDialogs' depending on 'ext.gadget.refToolbarBase' and 'ext.wikiEditor'
		// * Replace the code below by mw.loader.load( 'ext.gadget.refToolbarDialogs' );
		mw.loader.using( , function () {
			mw.loader.load( '/w/index.php?title=MediaWiki:RefToolbar.js&action=raw&ctype=text/javascript' );
		} );
	} else if ( +mw.user.options.get( 'gadget-legacyToolbar' ) === 1 ) {
		// Enhanced editing toolbar is off. Loading RefToolbar 1.0. (legacy)
		mw.loader.load( '/w/index.php?title=MediaWiki:RefToolbarLegacy.js&action=raw&ctype=text/javascript' );
	} else {
		return;
	}
	window.refToolbarInstalled = true;
}

if ( /^(edit|submit)$/.test( mw.config.get( 'wgAction' ) ) ) {
	// Double check if user.options is loaded, to prevent errors when copy pasted accross installations
	$.when( mw.loader.using(  ), $.ready ).then( initializeRefTools );
}

}() );