הבדלים בין גרסאות בדף "משתמש:Poxsi/monobook.js"

נוספו 8,856 בתים ,  לפני שנתיים
ביטול גרסה 9246653 של Poxsi (שיחה)
מ (לא פעיל עוד)
(ביטול גרסה 9246653 של Poxsi (שיחה))
importUserScript(2);
importUserScript(10);
importScript('משתמש:Yonidebest/monobook.js/markPatrolAjaxeditCounterTab.js');
 
importScript('משתמש:Mikimik/js/histPatrolStatus.js');
 
// Revert tools by Lorian
// From Nir909's monobook
 
function getElementsByClass(searchClass,node,tag) {
function getRevertMessage( where, user1, user2 ) {
// Function from http://www.dustindiaz.com/getelementsbyclass/
// Get page name and revision ID
var classElements = new Array();
var title = encodeURIComponent( wgPageName );
if ( node == null )
var oldid = encodeURIComponent( getParamValue( "oldid" ) );
node = document;
 
if ( tag == null )
tag// =Encode '*';user names
user1 = encodeURIComponent( user1 );
var els = node.getElementsByTagName(tag);
user2 = encodeURIComponent( user2 );
var elsLen = els.length;
 
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
// Get message
for (i = 0, j = 0; i < elsLen; i++) {
var message = prompt( "איזו הודעה ברצונך להשאיר?", "" );
if ( pattern.test(els[i].className) ) {
if( !message ) {
classElements[j] = els[i];
j++ return;
}
message = encodeURIComponent( message );
}
 
return classElements;
location.href = wgServer + wgScript + "?title=" + title + "&action=edit&oldid=" + oldid + "&" + where + "=2&user1=" + user1 + "&user2=" + user2 + "&message=" + message;
}
 
function revertToolsLinks() {
if( !getParamValue( "diff" ) ) {
return;
}
 
// Get page name and revision ID
var title = encodeURIComponent( wgPageName );
var oldid = encodeURIComponent( getParamValue( "oldid" ) );
 
// Get user names
var user1 = encodeURIComponent( document.getElementById( "mw-diff-otitle2" ).getElementsByTagName( "a" )[0].innerHTML );
var user2 = encodeURIComponent( document.getElementById( "mw-diff-ntitle2" ).getElementsByTagName( "a" )[0].innerHTML );
 
// Add revert tools links
var contentSub = document.getElementById( "contentSub" );
contentSub.innerHTML = "(";
contentSub.innerHTML += "<a href=\"" + wgServer + wgScript + "?title=" + title + "&action=edit&oldid=" + oldid + "&revert=1&user1=" + user1 + "&user2=" + user2 + "\">שחזור</a>";
contentSub.innerHTML += " / ";
contentSub.innerHTML += "<a href=\"javascript:var message = getRevertMessage( 'revert', '" + user1 + "', '" + user2 + "' );\">הודעה</a>";
contentSub.innerHTML += ") (";
contentSub.innerHTML += "<a href=\"" + wgServer + wgScript + "?title=" + title + "&action=edit&oldid=" + oldid + "&vandalism=1&user1=" + user1 + "&user2=" + user2 + "\">ונדליזם</a>";
contentSub.innerHTML += " / ";
contentSub.innerHTML += "<a href=\"javascript:var message = getRevertMessage( 'vandalism', '" + user1 + "', '" + user2 + "' );\">הודעה</a>";
contentSub.innerHTML += ") (אזהרה: ";
contentSub.innerHTML += "<a href=\"" + wgServer + wgScript + "?title=User_talk:" + user2 + "&action=edit&section=new&warn=1\">אזהרה</a>";
contentSub.innerHTML += " / ";
contentSub.innerHTML += "<a href=\"" + wgServer + wgScript + "?title=User_talk:" + user2 + "&action=edit&section=new&warn=2\">ניסויים</a>";
contentSub.innerHTML += " / ";
contentSub.innerHTML += "<a href=\"" + wgServer + wgScript + "?title=User_talk:" + user2 + "&action=edit&section=new&warn=3\">תודה</a>";
contentSub.innerHTML += ")";
}
function revertTools() {
var revert = getParamValue( "revert" );
var vandalism = getParamValue( "vandalism" );
var warn = getParamValue( "warn" );
if( revert || vandalism ) {
var term;
if( vandalism ) {
term = "שחזור השחתה";
} else {
term = "שוחזר מעריכות";
}
var oldid = getParamValue( "oldid" );
var user1 = getParamValue( "user1" );
var user2 = getParamValue( "user2" );
document.getElementById( "wpSummary" ).value = term + " של [[Special:Contributions/" + user2 + "|" + user2 + "]] לעריכה האחרונה " + " של [[Special:Contributions/" + user1 + "|" + user1 + "]]";
if( revert == "2" || vandalism == "2" ) {
document.getElementById( "wpSummary" ).value += " (" + getParamValue( "message" ) + ")";
}
document.getElementById( "editform" ).submit();
} else if( warn == "1" ) {
document.getElementById( "wpSummary" ).value = "אזהרה";
document.getElementById( "wpTextbox1" ).value = "{" + "{אזהרה}} ~~" + "~~";
document.getElementById( "editform" ).submit();
} else if( warn == "2" ) {
document.getElementById( "wpSummary" ).value = "ניסויי עריכה";
document.getElementById( "wpTextbox1" ).value = "{" + "{ניסויים}} ~~" + "~~";
document.getElementById( "editform" ).submit();
} else if( warn == "3" ) {
document.getElementById( "wpSummary" ).value = "תודה על תרומתך לוויקיפדיתנו!";
document.getElementById( "wpTextbox1" ).value = "{" + "{תודה}} ~~" + "~~";
document.getElementById( "editform" ).submit();
}
}
 
addOnloadHook( revertToolsLinks );
addOnloadHook( revertTools );
 
 
/* סקריפט להוספת קישורים להוספת תבניות אזהרה שונות למשתמשים, מאת Yonidebest */
function warningTalkPage( user, warning, refPage ) {
var url = wgServer + wgScript + "?title=" + encodeURIComponent( "שיחת_משתמש:" + user ) + "&action=edit&warning=" + encodeURIComponent( warning );
if( refPage != "null" ) {
url += "&ref_page=" + encodeURIComponent( refPage );
}
window.open( url );
}
function createWarningLink( user, warning, title, refPage ) {
// _GET code from NoGray JS Library http://www.nogray.com/new_site/
var _GETlink = new Arraydocument.createElement("a");
link.href = "javascript:void(0);";
var _uri = location.href;
link.onclick = function() {
var user = this.getAttribute( "user" );
var warning = this.getAttribute( "warning" );
var refPage = this.getAttribute( "ref_page" );
if( !refPage ) {
refPage = ( wgCanonicalNamespace == "Image" || wgCanonicalNamespace == "Category" ) ? ( ":" + wgPageName ) : wgPageName;
}
warningTalkPage( user, warning, refPage );
}
link.setAttribute( "user", user );
link.setAttribute( "warning", warning );
if( refPage ) {
link.setAttribute( "ref_page", refPage );
}
link.innerHTML = warning;
link.title = title;
return link;
}
function warningDiffLinks() {
var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");
if( !document.getElementById("mw-diff-ntitle2") ) return; // not a diff page
var link = document.getElementById("mw-diff-ntitle2").getElementsByTagName("a")[0];
var user = link.innerHTML;
if( !/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test( user ) ) return; // not an anonymous user diff page
var span = document.createElement("span");
var _temp_get_arr_1 = new Array();
span.appendChild( document.createTextNode( " (" ) );
span.appendChild( createWarningLink( user, "אזהרה", "הוספת תבנית אזהרה" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "ניסויים", "הוספת תבנית ניסויים" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "נמחק", "הוספת תבנית נמחק" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "העתקה", "הוספת תבנית העתקה" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "לך", "הוספת תבנית לך" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "הסבר", "הוספת תבנית הסבר" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "שגיאה", "הוספת תבנית שגיאה" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "טעות", "הוספת תבנית טעות" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "בוטל", "הוספת תבנית בוטל" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "פרסומת", "הוספת תבנית פרסומת" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "חזרה על עריכה", "הוספת תבנית חזרה על עריכה" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "נייטרליות", "הוספת תבנית נייטרליות" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "תודה", "הוספת תבנית תודה" ) );
span.appendChild( document.createTextNode(" | ") );
span.appendChild( createWarningLink( user, "התנחלות", "הוספת תבנית התנחלות" ) );
span.appendChild( document.createTextNode( ")" ) );
link.parentNode.insertBefore( span, link.nextSibling );
}
function postWarning() {
for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
var warning = getParamValue( "warning" );
_temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
var refPage = getParamValue( "ref_page" );
_GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]);
var text = "";
if( !warning ) return;
if( refPage ) {
refPage = refPage.replace( /_/g, " " );
text += "\n== [" + "[" + refPage + "]] ==\n";
}
text += "{" + "{" + warning + "}} ~~" + "~~";
document.getElementById("wpTextbox1").value += text;
document.getElementById("wpSummary").value = warning;
document.getElementById("editform").submit();
}
addOnloadHook(warningDiffLinks);
delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;
addOnloadHook(postWarning);
//
function getMessage (where, user1, user2) {
 
var message = prompt ('איזו הודעה ברצונך להשאיר?', '');
importUserScript(32);
window.location = 'http://he.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message;
 
importUserScript(16);
 
importScript('‏‏משתמש:Yonidebest/monobook.js/clearSandBox.js');
 
importUserScript(33);
 
importUserScript(10);
 
importScript('משתמש:Yonidebest/monobook.js/colorProtected.js');
 
// הקוד מוסיף טאב לעריכת הפתיח של הדף
var customEditSection;
 
function addEditSection0()
{
x = document.getElementById('ca-edit');
if ( !x ) return;
//ta['ca-edit-0'] = ['', 'ערוך את הפתיח'];
y = document.createElement('LI');
y.id = 'ca-edit-0';
// if is edit page and is section 0, then mark "0" as seleted and mark "עריכה" as unseleted
var isSelected = (x.className.indexOf('selected') != -1);
var isTalk = (x.className.indexOf('istalk') != -1);
var isSection0 = (/&action=edit&section=0$/.test(window.location.href));
 
if (isSelected) {
if (isSection0) {
y.className = x.className;
x.className = (isTalk) ? 'istalk' : '';
} else {
if (isTalk) y.className = 'istalk';
}
}
 
// add the "0" li element
var span = document.createElement('SPAN');
span.appendChild ( document.createTextNode( (customEditSection == undefined) ? 'פתיח' : customEditSection ) );
var z = document.createElement('A');
z.href = x.childNodes[0].href + '&section=0';
z.appendChild(span);
y.appendChild(z);
x.parentNode.insertBefore(y,x.nextSibling);
 
// add summary if editing section 0
if ( isSection0 )
document.getElementById("wpSummary").value = "/* עריכת הפתיח */ ";
}
 
addOnloadHook ( addEditSection0 );
 
 
/* הסקריפט מוסיף לשוניות "מחיקה" ו"חסימה" על מנת שאפשר יהיה לבקש מחיקת דפים וחסימת משתמשים באמצעות דף בקשות ממפעילים.
* נכתב על ידי [[משתמש:ערן]]
* נבדק בFF3.5 ובIE8
*/
 
function addDeleteOption()
{
var historyTab = document.getElementById('ca-history');
if (!historyTab ) return;
var deleteTab = document.createElement('li');
deleteTab.id = 'ca-js-delete';
var deleteLink = document.createElement('a');
deleteLink.href = '#';
deleteLink.title = 'מחיקת דף זה';
deleteLink.onclick = function(){
var reqDel = wgPageName;
if(wgNamespaceNumber==14 || wgNamespaceNumber==6){//for categories and files
reqDel =':'+reqDel;
}
var reqRes=prompt("סיבה לבקשת המחיקה");
if(reqRes) reqRes=' - '+reqRes;
else {return;}//cancel the operation
window.location.href='http://he.wikipedia.org/w/index.php?title=ויקיפדיה:בקשות_ממפעילים&action=edit&section=1&pleasedelete=yes&pagefordel=' + reqDel+'&delRes='+reqRes;
}
if (historyTab.children) {
deleteLink.appendChild(document.createTextNode('מחיקה'));
deleteTab.appendChild(deleteLink);
historyTab.parentNode.insertBefore(deleteTab,historyTab);
} else {
deleteLink.appendChild(document.createTextNode('מחיקה'));
deleteTab.appendChild(deleteLink);
document.getElementById('p-cactions').childNodes[3].insertBefore(deleteTab,null);
}
}
addOnloadHook(function (){
if (location.href.match(/diffpleasedelete=yes/)) {
var txtLoc=location.href;
// Get username of submitter
var decLoc=decodeURI(txtLoc);
var user1 = getElementsByClass('diff-otitle',null,'td'); user1 = user1[0].getElementsByTagName('a')[2].innerHTML;
var delrgx = new RegExp("pagefordel=(.*?)&delRes=(.*)");
var user2 = getElementsByClass('diff-ntitle',null,'td'); user2 = user2[0].getElementsByTagName('a')[3].innerHTML;
var m = delrgx.exec(decLoc);
document.getElementById('contentSub').innerHTML = '(<a href="http://he.wikipedia.org/w/index.php?title=' + wgPageName + '&action=edit&oldid=' + _GET['oldid'] + '&revert=1&user1='+user1+'&user2='+user2+'">שחזר</a> / <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\', \''+user2+'\');">הודעה</a>) (<a href="http://he.wikipedia.org/w/index.php?title=' + wgPageName + '&action=edit&oldid=' + _GET['oldid'] + '&vandalism=1&user1='+user1+'&user2='+user2+'">ונדליזם</a> / <a href="javascript:var message = getMessage(\'vandalism\', \''+user1+'\', \''+user2+'\');">הודעה</a>) (אזהרה: <a href="http://he.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=1">אזהרה</a> / <a href="http://he.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=2">ניסויים</a> / <a href="http://he.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=3">תודה</a>)';
if(m){
} else if (location.href.match(/revert=1/)) {
var reqDel=m[1];
document.getElementById('wpSummary').value = 'שוחזר מעריכה של [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] לגרסה ' + _GET['oldid']+' של [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']]';
var reqRes=m[2];
document.getElementById('editform').submit();
document.getElementById('wpSummary').value = '/* בקשות מחיקה */ [[' + reqDel + ']]';
} else if (location.href.match(/revert=2/)) {
document.getElementById('wpSummarywpTextbox1').value = document.getElementById('שוחזר מעריכה של [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] לגרסה wpTextbox1').value + _GET['oldid']+' של \n*[[Special:Contributions/'+_GET['user1reqDel+']+'|]'+_GET['user1']reqRes+']] (~~'+_GET['message']+')~~';
document.getElementById('editform').submit();
} else if (location.href.match(/vandalism=1/)) {
document.getElementById('wpSummary').value = 'שחזור השחתה של[[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] לגרסה ' + _GET['oldid']+' של [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']]';
document.getElementById('editform').submit();
}
} else if (location.href.match(/vandalism=2/)) {
}
document.getElementById('wpSummary').value = 'שחזור השחתה של [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] לגרסה ' + _GET['oldid']+' של [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] ('+_GET['message']+')';
document.getElementById('editform').submit();
} else if (location.href.match(/warn=1/)) {
document.getElementById('wpSummary').value = 'אזהרת השחתה';
document.getElementById('wpTextbox1').value = '{{אזהרה}} ~~'+'~~';
document.getElementById('editform').submit();
} else if (location.href.match(/warn=2/)) {
document.getElementById('wpSummary').value = 'ניסויי עריכה';
document.getElementById('wpTextbox1').value = '{{ניסויים}} ~~'+'~~';
document.getElementById('editform').submit();
} else if (location.href.match(/warn=3/)) {
document.getElementById('wpSummary').value = 'תודה על תרומתך לוויקיפדיתנו!';
document.getElementById('wpTextbox1').value = '{{תודה}} ~~'+'~~';
document.getElementById('editform').submit();
}
});
//Made by Eran
addOnloadHook(addDeleteOption);
function addDeleteOption() {
 
ta['del'] = ['', 'מחק דף זה'];
 
if (!document.getElementById) return;
function addBlockOption()
var reqDel=wgPageName;
{
x = document.getElementById('ca-move');
if (!xdocument.getElementById('ca-nstab-user')) return;
y var userTab = document.createElementgetElementById('lica-js-delete');
y.id if (!userTab) userTab = document.getElementById('ca-move');
z if (!userTab) userTab = document.createElementgetElementById('aca-history');
if (!userTab) userTab = document.getElementById('ca-addsection');
z.href = 'http://he.wikipedia.org/w/index.php?title=ויקיפדיה:בקשות_ממפעילים&action=edit&section=1&pleasedelete=yes&pagefordel='+reqDel;
if (!userTab) userTab = document.getElementById('ca-edit');
if (x.children) {
z.appendChildif (!userTab) userTab = document.createTextNodegetElementById('מחיקהca-nstab-user'));
var blockTab = document.createElement('li');
y.appendChild(z);
blockTab.id = 'ca-js-block';
document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling);
var blockLink = document.createElement('a');
blockLink.href='#';
blockLink.title = 'חסימת משתמש זה';
blockLink.onclick=function(){
var reqBlock = wgTitle;
var reqRes=prompt("סיבה לבקשת החסימה");
if(reqRes) reqRes=' - '+reqRes;
else {return;}//cancel the operation
window.location.href='http://he.wikipedia.org/w/index.php?title=ויקיפדיה:בקשות_ממפעילים&action=edit&section=2&pleaseblock=yes&userforblock=' + reqBlock+'&blockRes='+reqRes;
}
if (userTab.children) {
blockLink.appendChild(document.createTextNode('חסימה'));
blockTab.appendChild(blockLink);
userTab.parentNode.insertBefore(blockTab,userTab.nextSibling);
} else {
zblockLink.appendChild(document.createTextNode('מחיקהחסימה'));
yblockTab.appendChild(zblockLink);
document.getElementById('p-cactions').childNodes[3].insertBefore(yblockTab,null);
}
}
addOnloadHook(function (){
if(location.href.match(/pleasedeletepleaseblock=yes/)) {
var txtLoc=location.href;
reqDelvar decLoc=decodeURI(txtLoc.substring(txtLoc.indexOf('pagefordel=')+11,txtLoc.length));
var delrgx = new RegExp("userforblock=(.*?)&blockRes=(.*)");
document.getElementById('wpSummary').value = '[[' + reqDel + ']]';
var m = delrgx.exec(decLoc);
document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value + '\n*[['+reqDel+']] ~~'+'~~';
if(m){
var reqBlock=m[1];
var reqRes=m[2];
document.getElementById('wpSummary').value = '/* בקשות חסימה / הסרת חסימה */ [[משתמש:'+reqBlock+']] ([[שיחת משתמש:'+reqBlock+'|שיחה]])';
document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value + '\n* {{לחסום|'+reqBlock+'}}'+reqRes+' ~~'+'~~';
document.getElementById('editform').submit();
}
}
});
 
if(wgNamespaceNumber==2 || wgNamespaceNumber==3){
addOnloadHook(addBlockOption);
}