מייבאים כמותיים, בדוקי עריכות אוטומטית, ביוראקראטן, אינטערפעיס רעדאקטארן, emailconfirmed, אינטערפעיס אדמיניסטראַטאָרן, מנטרים, סיסאפן, צוות טכני, מייבאים, מעדכנים, אספקלריה רעדאקטארן
102,362
רעדאגירונגען
(געשאַפן בלאַט מיט 'importUserScript(97,77,40,88); mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript');') |
(לויט הרב שווערמער'ס באגער) |
||
| שורה 1: | שורה 1: | ||
importUserScript(97,77,40,88); | importUserScript(97,77,40,88); | ||
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript'); | mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript'); | ||
/*מחיקת הפניות בעת מחיקת דף | |||
נכתב ע"י [[משתמש:גאון הירדן]] | |||
*/ | |||
if ((mw.config.get('wgAction') === 'delete') && ((($("#firstHeading").text().indexOf("הפעולה בוצעה")>-1))||($("#firstHeading").text().indexOf("די אקציע איז אויסגעפירט געווארן")>-1))){ | |||
var page = mw.config.get('wgPageName'); | |||
$.getJSON('/w/api.php?action=query&prop=linkshere&lhprop=title&lhshow=redirect&lhlimit=max&titles='+encodeURIComponent(mw.config.get('wgPageName'))+'&format=json', function(response) { | |||
if (response.query.pages['-1'].linkshere) { | |||
var allRedirs = response.query.pages['-1'].linkshere; | |||
if (confirm('לדף הזה יש הפניות. האם למחוק אותן?')){ | |||
for (var l=0 ; l < allRedirs.length; l++) { | |||
var api = new mw.Api(); | |||
api.postWithToken('delete', { | |||
"action": "delete", | |||
"format": "json", | |||
"title": allRedirs[l].title, | |||
"reason": 'הפניה לדף שנמחק' | |||
}).done(function(data){ | |||
if (data && data['delete']){ | |||
mw.notify('נמחקה הפניה'); | |||
} | |||
}).fail(function(error){ | |||
console.log(error); | |||
}); | |||
} | |||
} | |||
} | |||
}); | |||
} | |||
// עד כאן | |||
/*הצגת רשימת דפים מקושרים בעת מחיקת דף | |||
נכתב ע"י [[משתמש:גאון הירדן]] | |||
*/ | |||
if (mw.config.get('wgAction') === 'delete'){ | |||
$.getJSON('/w/api.php?action=query&prop=linkshere&lhprop=title&&lhlimit=max&titles='+encodeURIComponent(mw.config.get('wgPageName'))+'&format=json', function(response) { | |||
for (var page in response.query.pages){ | |||
var links = response.query.pages[page].linkshere; | |||
if (links){ | |||
var div = document.getElementsByClassName('warningbox plainlinks'); | |||
for (var a = 0; a < links.length; a++){ | |||
$(div).append('<ul>').append(links[a].title); | |||
} | |||
} | |||
} | |||
}); | |||
} | |||
function getOldTextFromPage(){ | |||
var UrlToRaw = | |||
"/w/index.php?title=" + | |||
"המכלול:רייניגונג פראיעקט/געמעקטע בלעטער"+ | |||
"&action=raw"; | |||
$.get(UrlToRaw, function (data, status) { | |||
var txtadd1 = mw.config.get( 'wgPageName' ); | |||
var txtadd2 = mw.config.get( 'wgUserName' ); | |||
var txtadd3 = prompt( "סיבת המחיקה", "" ); | |||
if (txtadd3 === null){ | |||
if (confirm("להמשיך ללא סיבת המחיקה")){ | |||
txtadd3 = " "; | |||
} else{ | |||
txtadd3 = prompt( "סיבת המחיקה", "" ); | |||
} | |||
} | |||
var txtadd = "|-" + "\n|" + txtadd1 + " || "+ txtadd2 + " || " + txtadd3 + "\n|}"; | |||
var newText = data.replace(/(\|\}$)/,txtadd); | |||
savaNewTextToPage(newText) | |||
}); | |||
} | |||
function savaNewTextToPage(newText){ | |||
var pageId = 41139; | |||
var summary = "עדכון מחיקת דף"; | |||
var api = new mw.Api(); | |||
api.postWithEditToken( { | |||
action: 'edit', | |||
pageid: pageId, | |||
nocreate: true, | |||
text: newText, | |||
minor: true, | |||
summary: summary | |||
} ).done( function( data ) { | |||
mw.notify('המידע נשמר '); | |||
}).fail( function( err ) { | |||
console.log(err); | |||
alert( "Error: " + err ); | |||
}); | |||
} | |||
if ((mw.config.get('wgAction') === 'delete') && ((($("#firstHeading").text().indexOf("הפעולה בוצעה")>-1))||($("#firstHeading").text().indexOf("די אקציע איז אויסגעפירט געווארן")>-1))){ | |||
getOldTextFromPage(); | |||
} | |||
רעדאגירונגען