משתמש:ברוקולי/monobook.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
wgUserScriptList=[2,6,10,13,16,17,15,29,22,32,33,34,35,50];
importUserScript(42);
importScript('משתמש:Yonidebest/monobook.js/clearSandBox.js');
importScript('משתמש:Yonidebest/monobook.js/highlightAnon.js');
// Revert tools by Lorian
// From Nir909's monobook
function getRevertMessage( where, user1, user2 ) {
// Get page name and revision ID
var title = encodeURIComponent( wgPageName );
var oldid = encodeURIComponent( getParamValue( "oldid" ) );
// Encode user names
user1 = encodeURIComponent( user1 );
user2 = encodeURIComponent( user2 );
// Get message
var message = prompt( "איזו הודעה ברצונך להשאיר?", "" );
if( !message ) {
return;
}
message = encodeURIComponent( message );
location.href = mw.config.get('wgServer') + mw.config.get('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=\"" + mw.config.get('wgServer') + mw.config.get('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=\"" + mw.config.get('wgServer') + mw.config.get('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=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User_talk:" + user2 + "&action=edit§ion=new&warn=1\">אזהרה</a>";
contentSub.innerHTML += " / ";
contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User_talk:" + user2 + "&action=edit§ion=new&warn=2\">ניסויים</a>";
contentSub.innerHTML += " / ";
contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User_talk:" + user2 + "&action=edit§ion=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();
}
}
$( revertToolsLinks );
$( revertTools );
//Made by Eran
function addDeleteOption() {
ta['del'] = ['', 'מחק דף זה'];
if (!document.getElementById) return;
var reqDel=wgPageName;
x = document.getElementById('ca-move');
if(!x) return;
y = document.createElement('li');
y.id = 'ca-move';
z = document.createElement('a');
z.href = 'http://he.wikipedia.org/w/index.php?title=ויקיפדיה:בקשות_ממפעילים&action=edit§ion=1&pleasedelete=yes&pagefordel='+reqDel;
if (x.children) {
z.appendChild(document.createTextNode('מחיקה'));
y.appendChild(z);
document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling);
} else {
z.appendChild(document.createTextNode('מחיקה'));
y.appendChild(z);
document.getElementById('p-cactions').childNodes[3].insertBefore(y,null);
}
}
$(function (){
if(location.href.match(/pleasedelete=yes/)) {
txtLoc=location.href;
reqDel=decodeURI(txtLoc.substring(txtLoc.indexOf('pagefordel=')+11,txtLoc.length));
document.getElementById('wpSummary').value = '[[' + reqDel + ']]';
document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value + '\n*[['+reqDel+']] ~~'+'~~';
document.getElementById('editform').submit();
}
});
//<syntaxhighlight lang="javascript">
// הוספת קישורים להוספת תבניות אזהרה למשתמשים מתוך דף השוואת גרסאות
// נכתב ע"י [[משתמש:Yonidebest]]. שונה ע"י [[משתמש:Mikimik]]
function initDiffWarningLinks()
{
function encodeTextToUrl ( text )
{
return encodeURIComponent(text).replace(/%2F/g,"/").replace(/%24/g,"$").replace(/%2C/g,",").replace(/%3A/g,":").replace(/%40/g,"@");
}
function createWarningLink ( user, warning )
{
var link = document.createElement("a");
link.href = "javascript:void();";
link.onclick = function()
{
window.open ( mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User Talk:" + encodeTextToUrl(user) +
"&action=edit&warning=" + encodeTextToUrl(warning) +
"&frompage=" + encodeTextToUrl((wgNamespaceNumber == 6 || wgNamespaceNumber == 14 ? ":" : "" ) + wgPageName) );
}
link.appendChild ( document.createTextNode( warning ) );
link.title = warning;
return link;
}
try {
if ( !userDiffWarnings ) var userDiffWarnings = [ "אזהרה", "ניסויים", "נמחק", "העתקה", "לך", "הסבר", "שגיאה", "טעות", "בוטל", "קישור מבוטל", "פרסומת", "חזרה על עריכה", "טעות", "נייטרליות", "נחסמת", "תודה" ];
if ( !document.getElementById("mw-diff-ntitle2") ) return;
var point = document.getElementById("mw-diff-ntitle2").getElementsByTagName("a")[0];
var user = point.firstChild.nodeValue;
if ( user == wgUserName ) return;
var span = document.createElement("span");
span.appendChild ( document.createTextNode( " (" ) );
for ( var i in userDiffWarnings )
{
span.appendChild ( createWarningLink( user, userDiffWarnings[i] ) );
span.appendChild ( document.createTextNode(" | ") );
}
span.replaceChild ( document.createTextNode( ")" ), span.lastChild );
point.parentNode.insertBefore ( span, point.nextSibling );
}
catch(e)
{
return; // lets just ignore what's happened
}
}
function postWarning()
{
try {
document.getElementById("wpTextbox1").value += "\n== [" + "[" + getParamValue("frompage").replace(/_/g," ") + "]] ==\n{" + "{" + getParamValue("warning") + "}} ~~" + "~~";
document.getElementById("wpSummary").value = getParamValue("warning");
document.getElementById("editform").submit();
}
catch(e)
{
return; // lets just ignore what's happened
}
}
if ( getParamValue("diff") ) addOnloadHook ( initDiffWarningLinks );
if ( getParamValue("warning") && getParamValue("frompage") ) addOnloadHook ( postWarning );
//</syntaxhighlight>
mw.loader.load('https://he.wikipedia.org' + wgScript + '?title=משתמש:Mikimik/js/autoStandardContent.js&action=raw&ctype=text/javascript');
importScript('משתמש:Yonidebest/monobook.js/checkVoteRights.js');
addEditButton("wikipedia/commons/6/60/Button_support.png", "* {{בעד}} ~~" + "~~","", "", "הוספת בעד");
addEditButton("wikipedia/commons/f/fc/Button_supp.png", "* {{נגד}} ~~" + "~~","", "", "הוספת נגד");
importScript('משתמש:Mikimik/js/histPatrolStatus.js');
importScript('משתמש:מתניה/vector.js/Compare link.js');
importScript('משתמש:Yonidebest/scripts/anonRecentEditors.js');