מדיה ויקי:Gadget-DeleteRequest.js

מתוך אוצר הספרים היהודי השיתופי
קפיצה לניווט קפיצה לחיפוש

הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload), או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh), או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
/* הסקריפט מוסיף לשוניות "מחיקה", "הגנה" ו"חסימה" על מנת שאפשר יהיה לבקש מחיקת דפים, הגנת דפים וחסימת משתמשים באמצעות דף בקשות ממפעילים. */

function addExtraJS_Tabs()
{
    function addTab ( modelTab, type, text, title, target, section )
    {
        var newtab = modelTab.cloneNode ( true );
        newtab.id = "ca-js-" + type;
        newtab.className = "";

        var link = newtab.firstChild;
        while (link.nodeName != "A") {
                 link =link.firstChild; 
                if(link==null) return; // should never happen
        }

        link.href = "#";
        link.title = title;
        link.onclick = function() {
            var reason = prompt ( "סיבה לבקשת ה" + text );
            if ( reason )
                window.location.href = wgServer+"/w/index.php?title=" + encodeURIComponent("ויקיפדיה:בקשות_ממפעילים") +
                                       "&action=edit&section=" + section + "&ExtraJSTabReq=" + type + "&target=" + encodeURIComponent(target) +
                                       "&reason=" + encodeURIComponent(reason);
        }

        if ( link.firstChild.nodeName == "SPAN" ) link.firstChild.firstChild.nodeValue = text;
         else link.firstChild.nodeValue = text;

        modelTab.parentNode.insertBefore ( newtab, skin == "vector" ? modelTab : modelTab.nextSibling );
        return newtab;
    }

 try {
    var x = null;
    
    if ( document.getElementById("ca-history") )
    {
        x = addTab ( document.getElementById("ca-history"), "delete", "מחיקה", "מחיקת דף זה",
                     ( wgNamespaceNumber == 14 || wgNamespaceNumber == 6 ? ":" : "" ) + wgPageName, 1 );

        x = addTab ( x, "protect", "הגנה", "הגנה על דף זה",
                     ( wgNamespaceNumber == 14 || wgNamespaceNumber == 6 ? ":" : "" ) + wgPageName, 3 );
    }

    if ( document.getElementById("t-contributions") )
        addTab ( x || document.getElementById("ca-addsection") || document.getElementById("ca-edit") || document.getElementById("ca-nstab-user"),
                 "block", "חסימה", "חסימת משתמש זה", wgTitle, 2 );
  }
 catch (e)
  {
    return;
  }
}

if ( /&ExtraJSTabReq=/.test(location.href) ) addOnloadHook ( function () {
 try {
        if ( getParamValue("ExtraJSTabReq") == "block" )
        {
            document.getElementById("wpSummary").value += " [" + "[משתמש:" + getParamValue("target") + "]]" +
                                                          " ([" + "[שיחת משתמש:" + getParamValue("target") + "]])";
            document.getElementById("wpTextbox1").value += "\n* {" + "{לחסום|" + getParamValue("target") + "}} - " + getParamValue("reason") + " ~~" + "~~";
        }
         else
        {
            document.getElementById("wpSummary").value += " [" + "[" + getParamValue("target") + "]]";
            document.getElementById("wpTextbox1").value += "\n* [" + "[" + getParamValue("target") + "]] - " + getParamValue("reason") + " ~~" + "~~";
        }
        document.getElementById("wpSave").click();
  }
 catch (e)
  {
    return;
  }
});

if ( wgTitle != "בקשות ממפעילים" && wgNamespaceNumber >= 0 ) addOnloadHook ( addExtraJS_Tabs );