מייבאים כמותיים, בדוקי עריכות אוטומטית, אינטערפעיס אדמיניסטראַטאָרן, מנטרים, מייבאים, מעדכנים, אספקלריה רעדאקטארן
3,955
רעדאגירונגען
(געשאַפן בלאַט מיט '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');') |
אין תקציר עריכה |
||
| (23 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.) | |||
| שורה 1: | שורה 1: | ||
importUserScript(97,77,40, | importUserScript(97,77,40,33,67,61); | ||
importScript('באניצער:גאון הירדן/בדיקת מילים חשודות.js'); | |||
importScript('באַניצער:צמא_לדעת/צאל-באקוקט.js'); | |||
importScript('באַניצער:צמא לדעת/sametab.js'); | |||
importScript("User:גאון הירדן/ייבוא ועדכון.js"); | |||
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))){ | |||
document.querySelectorAll('.mw-parser-output').forEach(container => { | |||
const refs = container.querySelectorAll('sup.reference'); | |||
for (let i = 1; i < refs.length; i++) { | |||
const prev = refs[i - 1]; | |||
const cur = refs[i]; | |||
// Collect text between prev and cur | |||
let betweenText = ''; | |||
let node = prev.nextSibling; | |||
while (node && node !== cur) { | |||
if (node.nodeType === Node.TEXT_NODE) betweenText += node.textContent; | |||
if (node.nodeType === Node.ELEMENT_NODE) betweenText += node.textContent; | |||
node = node.nextSibling; | |||
} | |||
// Only insert comma if nothing visible between | |||
if (betweenText.trim() === '') { | |||
cur.insertAdjacentText('beforebegin', ', '); | |||
} | |||
} | |||
}); | |||
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(); | |||
} | |||
importScript('באַניצער:צמא לדעת/sametab.js'); | |||
// אין פנים, שריי נישט הויך ווען א הערה פירט צו א "דארט" | |||
$('.mw-parser-output sup a').each(function() { | |||
var text = $(this).text(); | |||
// Check if the text follows the format '[1.2]' | |||
if (/^\[\d+\.\d+\]$/.test(text)) { | |||
var modifiedText = text.replace(/\.\d+/, ''); // Remove the dot and second number | |||
$(this).text(modifiedText); | |||
} | |||
}); | |||
importScript('משתמש:בוט גאון הירדן/ברוך הבא.js'); | |||
importScript('משתמש:איסתרק/גיבוי עריכות.js'); | |||
/** הוספת קישור להבדל בין גרסאות **/ | |||
if ($('h1#firstHeading:contains(הבדלים בין גרסאות)').length) { | |||
var oldid1 = $('#mw-diff-ntitle1 a:first').attr('href').replace(/.*oldid=/, ''), | |||
oldid2 = $('#mw-diff-otitle1 a:first').attr('href').replace(/.*oldid=/, ''), | |||
pageName = mw.config.get('wgPageName'); | |||
$('#contentSub').append('{{הבדל בין גרסאות|דף=' + pageName + '|מספר הגרסה=' + oldid1 + '|גרסה קודמת=' + oldid2 + '|כיתוב=מלל חופשי}} '); | |||
} | |||
importScript('משתמש:1Or/sandbox.js'); | |||
var summaries = [ | |||
"מחקתי", | |||
{title: "נמחק - לא מדויק", content: "מחיקת מידע שאינו מדויק"}, | |||
{title: "נמחק - סידור", content: "מחיקת במסגרת סידור מחדש, החומר יופיע במקום אחר"}, | |||
{title: 'נמחק - הז"י', content: "מחיקת קטע המפר זכויות יוצרים"} | |||
]; | |||
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript'); | |||
// [[m:User:Jon Harald Søby/diffedit.js]] | |||
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' ); | |||
רעדאגירונגען