МедияУики:Gadget-EditToolbar.js

От Уикицитат

Забележка: За да се видят промените, необходимо е след публикуване на страницата, кешът на браузъра да бъде изтрит.

  • Firefox / Safari: Задържа се клавиш Shift и се щраква върху Презареждане (Reload) или чрез клавишната комбинация Ctrl-F5 or Ctrl-R (⌘-R за Mac);
  • Google Chrome: клавишна комбинация Ctrl-Shift-R (⌘-Shift-R за Mac)
  • Internet Explorer / Edge: Задържа се клавиш Ctrl и се щраква върху Refresh или чрез клавишната комбинация Ctrl-F5;
  • Opera: Press Ctrl-F5.
( function(w) {
	var customInsButtons = {};
	var customMiscButtons = {};

	w.setCustomInsButton = function(code, left, middle, right, shownText, title) {
		customInsButtons[code] = [left, middle, right, shownText, title];
	};

	w.setCustomMiscButton = function(code, codeToRun, shownText, title) {
		customMiscButtons[code] = [codeToRun, shownText, title];
	};

	// define fake API as fallback when core is not loaded
	w.rmCustomInsButtons =
	w.rmCustomMiscButtons =
	w.rmCustomButtons =
	w.putToolbar = function() {};
	w.customInsButtons =
	w.customMiscButtons = {};

	if ($.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1) {
		mw.loader.using('ext.gadget.EditToolbar-core', function () {
			$.extend(w.customInsButtons, customInsButtons);
			$.extend(w.customMiscButtons, customMiscButtons);
		});
	}

}(window) );