מדיה ויקי:Gadget-DeleteRequest.js: הבדלים בין גרסאות בדף
מראה
מ תקלדה |
כותב מחדש את כל הסקריפט. עובד במונובוק ווקטור, FF, IE8, כרום |
||
| שורה 1: | שורה 1: | ||
/* הסקריפט מוסיף לשוניות "מחיקה", "הגנה" ו"חסימה" על מנת שאפשר יהיה לבקש מחיקת דפים, הגנת דפים וחסימת משתמשים באמצעות דף בקשות ממפעילים. | /* הסקריפט מוסיף לשוניות "מחיקה", "הגנה" ו"חסימה" על מנת שאפשר יהיה לבקש מחיקת דפים, הגנת דפים וחסימת משתמשים באמצעות דף בקשות ממפעילים. */ | ||
function addExtraJS_Tabs() | |||
function | |||
{ | { | ||
function addTab ( modelTab, type, text, title, req, section ) | |||
{ | |||
var newtab = modelTab.cloneNode ( true ); | |||
newtab.id = "ca-js-" + type; | |||
newtab.className = ""; | |||
var link = newtab.firstChild; | |||
if ( link.nodeName != "A" ) return; | |||
var | |||
link.href = "#"; | |||
link.title = title; | |||
link.onclick = function() { | |||
var reason = prompt ( "סיבה לבקשת ה" + text ); | |||
if( | if ( !reason ) return; // cancel the operation | ||
// window.location.href = encodeURIComponent("http://he.wikipedia.org/w/index.php?title=ויקיפדיה:בקשות_ממפעילים&action=edit§ion=") + | |||
window.location.href= | window.location.href = "http://he.wikipedia.org/w/index.php?title=משתמש:Mikimik/ארגז חול3&action=edit§ion=" + | ||
section + "&ExtraJSTabreq=" + type + "&target=" + encodeURIComponent(req) + "&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; | |||
} | |||
var x = null; | |||
var historyTab = document.getElementById("ca-history"); | |||
if ( historyTab ) | |||
var historyTab = document.getElementById( | { | ||
if ( | var x = addTab ( historyTab , "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 ); | |||
if ( | |||
} | } | ||
if ( /&ExtraJSTabreq=/.test(location.href) ) addOnloadHook ( function () { | |||
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(); | |||
}); | }); | ||
if ( | if ( wgTitle != "בקשות ממפעילים" && wgNamespaceNumber >= 0 ) addOnloadHook ( addExtraJS_Tabs ); | ||
גרסה מ־15:10, 1 ביולי 2010
/* הסקריפט מוסיף לשוניות "מחיקה", "הגנה" ו"חסימה" על מנת שאפשר יהיה לבקש מחיקת דפים, הגנת דפים וחסימת משתמשים באמצעות דף בקשות ממפעילים. */
function addExtraJS_Tabs()
{
function addTab ( modelTab, type, text, title, req, section )
{
var newtab = modelTab.cloneNode ( true );
newtab.id = "ca-js-" + type;
newtab.className = "";
var link = newtab.firstChild;
if ( link.nodeName != "A" ) return;
link.href = "#";
link.title = title;
link.onclick = function() {
var reason = prompt ( "סיבה לבקשת ה" + text );
if ( !reason ) return; // cancel the operation
// window.location.href = encodeURIComponent("http://he.wikipedia.org/w/index.php?title=ויקיפדיה:בקשות_ממפעילים&action=edit§ion=") +
window.location.href = "http://he.wikipedia.org/w/index.php?title=משתמש:Mikimik/ארגז חול3&action=edit§ion=" +
section + "&ExtraJSTabreq=" + type + "&target=" + encodeURIComponent(req) + "&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;
}
var x = null;
var historyTab = document.getElementById("ca-history");
if ( historyTab )
{
var x = addTab ( historyTab , "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 );
}
if ( /&ExtraJSTabreq=/.test(location.href) ) addOnloadHook ( function () {
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();
});
if ( wgTitle != "בקשות ממפעילים" && wgNamespaceNumber >= 0 ) addOnloadHook ( addExtraJS_Tabs );