Úsáideoir:Moilleadóir/edittoolstest.js

Tugtar faoi deara: Tar éis duit athruithe a shábháil, caithfear gabháil thar thaisce do bhrabhsálaí chun iad a fheiceáil. Internet Explorer: cliceáil ar an gcnaipe AthnuaighAthlódáil, agus an eochair Ctrl á bhrú agat. Firefox: cliceáil ar Athlódáil, agus an eochair Iomlaoid á bhrú agat (nó brúigh Ctrl-Iomlaoid-R). Opera: caithfear d'úsáideoirí a dtaiscí a ghlanadh trí Uirlisí→Sainroghanna. Ní mór d'úsáideoirí KonquerorSafari ach cliceáil ar an gcnaipe Athlódáil.

/*
TEST OF JAVASCRIPT EDITTOOLS - ó [[w:en:User:Ilmari Karonen/edittools.test.js]] 27/6/08
Updated [[Úsáideoir:Ilmari_Karonen/edittoolstest.js]] 30/6/08
 
To try out this feature, add the following lines to your monobook.js:
 
  importScript("Úsáideoir:Moilleadóir/edittoolstest.js");
  window.testJsEdittools = true;
 
To deploy this feature sitewide, the code below should be copied to [[MediaWiki:Common.js]],
while the code at [[User:Ilmari Karonen/edittools.js]] should be moved to [[MediaWiki:Edittools.js]].
After 30 days have passed (to allow time for browser caches to purge), the #editpage-specialchars
div and everything in it in [[MediaWiki:Edittools]] should be replaced with:
 
  <div id="editpage-specialchars" class="edittools-version-0001"></div>
 
During the 30-day interval between initial and full deployment (while the class name still has "test"
in it), the code may be tested simply by setting "window.testJsEdittools = true".  It should be safe
to run this script more than once: it will only work the first time, after that it will have removed
the #editpage-specialchars div and so will no longer do anything.
*/
 
if (wgAction == 'edit' || wgAction == 'submit') hookEvent("load", function () {
    var placeholder = document.getElementById("editpage-specialchars");
    if (!placeholder || window.noDefaultEdittools) return;
 
    var match = /(?:^| )edittools-version-(\d+)(?: |$)/.exec(placeholder.className);
 
    if (!match && window.testJsEdittools)
        match = /(?:^| )edittools-version-(test\d+)(?: |$)/.exec(placeholder.className);
 
    if (!match) return;
 
//    var url = wgScript + '?title=%C3%9As%C3%A1ideoir:Ilmari_Karonen/edittools.js&action=raw&ctype=text/javascript&nocache=' + match[1];
     var url = wgScript + '?title=MediaWiki:Edittools.js&action=raw&ctype=text/javascript&nocache=' + match[1];
 
    window.editToolsImmediateSetup = true;
    mw.loader.load(url);
});