Toggle menu
Toggle preferences menu
Toggle personal menu
Niste prijavljeni
Your IP address will be publicly visible if you make any edits.

HIE:Gadget-PoboljsanoVracanje.js

Izvor: Hrvatska internetska enciklopedija
Inačica 563595 od 27. travanj 2025. u 06:43 koju je unio WikiSysop (razgovor | doprinosi) (Zamjena teksta - '<!--'''(.*)'''-->' u '')
(razl) ←Starija inačica | vidi trenutačnu inačicu (razl) | Novija inačica→ (razl)

Napomena: nakon snimanja, trebate očistiti memoriju svog internetskog preglednika kako biste odmah vidjeli promjene: Firefox, Google Chrome i drugi preglednici temeljeni na Chromiumu, Safari i Internet Explorer: pritisnite i držite tipku ⇧ Shift i kliknite Osvježi u alatnoj traci Vašeg preglednika.

 // Enhanced Undelete Tool
 // Stolen from Wikibooks created & Maintained by [[b:User:Darklama]] and [[b:User:Mike.lifeguard]]
 //
 // Adds a "Select All" and "Invert Selection" button to Special:Undelete. 
 // Used for administrators only.
 // adjusted for croatian projects/prilagođeno za projekte na hrvatskom jeziku ([[w:hr:User:Dalibor Bosits]])
 
 function wikipedia_enhanced_undelete() {
   if (mw.config.get('wgPageName') != "Posebno:Vrati" )
     return;
   var fi = document.getElementsByTagName("input");
   for (i = 0; i < fi.length; i++)
   {
     if (!fi[i].hasAttribute("type"))
       continue;
     if (fi[i].getAttribute("type") == "reset") {
       var sa = document.createElement("input");
       sa.setAttribute("type", "button");
       sa.setAttribute("value", "Odaberi sve");
       fi[i].parentNode.insertBefore(sa, fi[i].nextSibling);
       sa.onclick = function() {
          for (var i=0;i<fi.length;i++) {
            if (fi[i].hasAttribute("type") && fi[i].getAttribute("type") == "checkbox") {
              fi[i].checked = true;
            }
          }
       };
       
       // add invert selection button
       var inv = document.createElement("input");
       inv.setAttribute("type", "button");
       inv.setAttribute("value", "Obrnuto");
       fi[i].parentNode.insertBefore(inv, fi[i].nextSibling);
       inv.onclick=function() {
           // if a deleted edit is checked, uncheck it, and vis-versa.
           for (var i=0;i<fi.length;i++) {
               if (fi[i].hasAttribute("type") && fi[i].getAttribute("type") == "checkbox") {
                 fi[i].checked = !fi[i].checked;
               }
           }
       }
     } else if (fi[i].getAttribute("type") == "checkbox") {
       fi[i].checked = true;
     }
   }
 }
 
 if (mw.config.get('wgPageName') == "Posebno:Vrati" )
   $(wikipedia_enhanced_undelete);