Jump to content

MediaWiki:Common.js/ExtraTools.js

From Wikibooks, open books for an open world
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5;
  • Konqueror: simply click the Reload button, or press F5;
  • Opera users may need to completely clear their cache in Tools→Preferences.
(function(mw, $) {
	window.add_toolbox_link = function(action, name, id) {
		var $tools = $('#p-tb ul');
		if ( !$tools.length ) return;
		if (typeof action === "string") {
			$tools.append('<li id="t-' + (id || name) + '"><a href="' + action + '">' + name + '</a></li>');
		} else if (typeof action === "function") {
			$('<li id="t-' + (id || name) + '"><a href="#">' + name + '</a></li>').appendTo($tools).click(action);
		}
	};
	mw.hook('wikibooks.panels.tools').fire(mw, $);
})(mediaWiki, jQuery);