מדיה ויקי:Gadget-DeleteRequest.js: הבדלים בין גרסאות בדף
קפיצה לניווט
קפיצה לחיפוש
מאין תקציר עריכה |
מאין תקציר עריכה |
||
שורה 20: | שורה 20: | ||
var reason = prompt ( "סיבה לבקשת ה" + text ); | var reason = prompt ( "סיבה לבקשת ה" + text ); | ||
if ( reason ) | if ( reason ) | ||
window.location.href = " | window.location.href = wgServer+"/w/index.php?title=" + encodeURIComponent("ויקיפדיה:בקשות_ממפעילים") + | ||
"&action=edit§ion=" + section + "&ExtraJSTabReq=" + type + "&target=" + encodeURIComponent(target) + | "&action=edit§ion=" + section + "&ExtraJSTabReq=" + type + "&target=" + encodeURIComponent(target) + | ||
"&reason=" + encodeURIComponent(reason); | "&reason=" + encodeURIComponent(reason); |
גרסה מ־01:50, 4 באוקטובר 2011
/* הסקריפט מוסיף לשוניות "מחיקה", "הגנה" ו"חסימה" על מנת שאפשר יהיה לבקש מחיקת דפים, הגנת דפים וחסימת משתמשים באמצעות דף בקשות ממפעילים. */
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§ion=" + 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 );