MediaWiki:Gadget-MoveNoNSCombo.js

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Note – after saving, you may have to bypass your browser’s cache to see the changes.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

See also: Special:Gadgets.


// {{documentation}}
if (mw.config.get('wgCanonicalSpecialPageName') === 'Movepage')
jQuery(document).ready(function () {
	var wgFormattedNamespaces = mw.config.get('wgFormattedNamespaces');
	
	var combo = document.getElementById('wpNewTitleNs');
	var txbox = document.getElementById('wpNewTitleMain');

	var hidden = document.createElement('input');
	hidden.type = 'hidden';
	hidden.name = combo.name;
	hidden.value = '0';
	combo.parentNode.insertBefore(hidden, combo);
	combo.parentNode.removeChild(combo);
	txbox.value = (wgFormattedNamespaces[combo.value] ? wgFormattedNamespaces[combo.value] + ':' : '') + txbox.value;
});