Bahaipedia
Bahaipedia
Menu
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Message
Discussion
View source
View history
Talk
Contributions
Create account
Log in
Navigation
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Learn more
Core topics
Bahá’í Faith
Central Figures
Teachings
Practices
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Translations

MediaWiki:Gadget-refToolbar.js

From Bahaipedia
Jump to:navigation, search

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.
/**
 * RefToolbar
 *
 * 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 2.0)
 * depending on the user preferences (the usebetatoolbar preference).
 *
 * @see: [[Wikipedia:RefToolbar]]
 * @see: [[MediaWiki:RefToolbar.js]]
 * @see: [[MediaWiki:RefToolbarConfig.js]]
 * @see: [[MediaWiki:RefToolbarLegacy.js]]
 * @see: [[MediaWiki:RefToolbarMessages-en.js]]
 * @see: [[MediaWiki:RefToolbarMessages-de.js]]
 * @see: [[MediaWiki:Gadget-refToolbarBase.js]]
 * @author: [[User:Mr.Z-man]]
 * @author: [[User:Kaldari]]
 */
( function ( mw, $ ) {
'use strict';
function initializeRefTools() {
	if( window.refToolbarInstalled || $( '#wpTextbox1[readonly]' ).length ){
		return;
	}
	if ( mw.user.options.get( 'usebetatoolbar' ) ) {
		// Enhanced editing toolbar is on. Going to load RefToolbar 2.0.
			$.getScript( '/index.php?title=MediaWiki:Gadget-refToolbarBase.js&action=raw&ctype=text/javascript', function() {
				mw.loader.using( [ 'ext.wikiEditor' ], function () {
					mw.loader.load( '/index.php?title=MediaWiki:RefToolbar.js&action=raw&ctype=text/javascript' );
				} );
			} );
	} else if ( mw.user.options.get( 'showtoolbar' ) ) {
		// Enhanced editing toolbar is off. Loading RefToolbar 1.0. (legacy)
		mw.loader.load( '/index.php?title=MediaWiki:RefToolbarLegacy.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' );
	} else {
		return;
	}
	window.refToolbarInstalled = true;
}
 
if ( $.inArray( 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 ).done( initializeRefTools );
}
 
}( mediaWiki, jQuery ) );

console.log('foo');
Retrieved from "https://bahaipedia.org/index.php?title=MediaWiki:Gadget-refToolbar.js&oldid=89100"
This page was last edited on 30 January 2021, at 04:54.
Text is available under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
Privacy policy
About Bahaipedia
Disclaimers
Powered by MediaWiki