משתמשת:אר/monobook.js

מתוך ויקיפדיה, האנציקלופדיה החופשית

הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
/* הפעלת הפונקציה להרחבת סרגל הכלים. */
window.onload = InsertButtonsToToolBar;

/* הגדרת הפונקציה להרחבת סרגל הכלים. */
function InsertButtonsToToolBar()
{
tooly = document.getElementById('toolbar');
if (tooly != null) 
{
/* הגדרת כפתור קו מחיקה. */
StrikeTextButton = "<a href=\"javascript:insertTags('<s>','</s>','טקסט מחוק');\">|<img src=\"http://upload.wikimedia.org/wikipedia/meta/c/c9/Button_strike.png\" alt=\"טקסט מחוק\"></a>";

/* הגדרת כפתור ישור לשמאל. */
  LeftTexttButton = "<a href=\"javascript:insertTags('<div style=&quot;text-align:left; direction:ltr; margin-left:1em;&quot;>\\n','\\n</div>','טקסט מיושר לשמאל');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/e/ea/Button_align_left.png\" alt=\"יישור טקסט לשמאל\"></a>";

/* הגדרת כפתור מירכוז טקסט. */
  CenterTextButton = "<a href=\"javascript:insertTags('<center>','</center>','מירכוז טקסט');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/5/5f/Button_center.png\" alt=\"מירכוז טקסט\"></a>";

/* הגדרת כפתור הוספת טבלה בסיסית. */
  TableButton = "<a href=\"javascript:insertTags('\\n{| border=1 \\n|- \\n| עמודה1 || עמודה2 \\n|- \\n| עמודה3 || עמודה4','\\n|}\\n','');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/6/60/Button_insert_table.png\" alt=\"הוספת טבלה\"></a>";

/* הגדרת כפתור הוספת תג ירידת שורה. */
  EenterButton = "<a href=\"javascript:insertTags('</br>','','');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/1/13/Button_enter.png\" alt=\"שבירת שורה\"></a>";

/* הגדרת כפתור כתב עילי. */
  UpperTextButton = "<a href=\"javascript:insertTags('<sup>','</sup>','כתב עילי');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/8/80/Button_upper_letter.png\" alt=\"כתב עילי\"></a>";

/* הגדרת כפתור כתב תחתי. */
  LowerTextlButton = "<a href=\"javascript:insertTags('<sub>','</sub>','כתב תחתי');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/7/70/Button_lower_letter.png\" alt=\"כתב תחתי\"></a>";

/* הגדרת כפתור כתב אמצעי. */
  SmallTextButton = "<a href=\"javascript:insertTags('<small>','</small>','כתב מוקטן');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/5/58/Button_small.png\" alt=\"כתב זעיר\"></a>";

/* הגדרת כפתור הערה מוסתרת. */
  CommentButton = "<a href=\"javascript:insertTags('<!--','-->','הערה מוסתרת');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/3/34/Button_hide_comment.png\" alt=\"הפיכת טקסט להערה מוסתרת\"></a>";

/* הגדרת כפתור גלריה. */
  GalleryButton = "<a href=\"javascript:insertTags('\\n<gallery>\\n','\\n</gallery>','תמונה:PictureFileName.jpg|כיתוב תמונה\\nתמונה:PictureFileName.jpg|כיתוב תמונה');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/1/12/Button_gallery.png\" alt=\"יצירת גלריית תמונות\"></a>";

/* הגדרת כפתור כותרת - דרגה 3. */
/* חוסך מאמץ של כתיבת שש תוי שווה. */
  SecondaryHeadlineButton = "<a href=\"javascript:insertTags('\\n===','===','פסקה משנית');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/e/e9/Button_headline2.png\" alt=\"כותרת - דרגה 3\"></a>";

/* הגדרת כפתור הזחה. */
  ShiftingButton = "<a href=\"javascript:insertTags(':','',':');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/8/8e/Button_shifting.png\" alt=\"הזחת משפט לשמאל\"></a>";

/*    הגדרת כפתור ציטוט.  */
  BlockQuoteButton = "<a href=\"javascript:insertTags('<blockquote style=&quot;border:1px solid blue; padding:2em;\&quot;>\\n','\\n</blockquote>','ציטוט');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/f/fd/Button_blockquote.png\" alt=\"חלונית ציטוט\"></a>";

/*  הגדרת כפתור צבע חזית.  */
  FontColorButton = "<a href=\"javascript:insertTags('<font color=&quot;ColorName&quot;>','</font>','צבע חזית');\"><img src=\"http://upload.wikimedia.org/wikipedia/he/1/1e/Button_font_color.png\" alt=\"צבע חזית גופן\"></a>";

/* הוספת כל הכפתורים לסרגל כלים. */
tooly.innerHTML = tooly.innerHTML + StrikeTextButton + LeftTexttButton + CenterTextButton + TableButton + EenterButton + UpperTextButton + LowerTextlButton + SmallTextButton + CommentButton + GalleryButton + SecondaryHeadlineButton + ShiftingButton + BlockQuoteButton + FontColorButton;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//    |—————————————————————————————————————————————————————————————————————————————————————————————————————————|    //
//    |-| I feel I am *relatively* good at JavaScript programming, so feel free to ask me questions about any |-|    //
//    |-| scripts on this page. Please note that all of these scripts are tested in and developed for Mozilla |-|    //
//    |-| Firefox ONLY!                                                                                       |-|    //
//    |—————————————————————————————————————————————————————————————————————————————————————————————————————————|    //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
//--------------------------------
// Stuff for everyone
//---------------------------------
 
//Alphabetized
importScript('User:Ais523/votesymbols.js');
importScript('User:Animum/ais523editcount.js');
importScript('User:Animum/count.js');
importScript('User:Animum/headers.js');
importScript('User:Animum/liveclock.js');
importScript('User:Animum/moveRV.js');
importScript('User:Animum/reset.js');
importScript('User:Animum/rfavote.js'); //Joke script for laughs.  Don't take it seriously.
importScript('User:Animum/twinklespeedy.js'); //Same as AzaToth's real version, but with modified summaries.
importScript('User:Animum/usergroups.js');
importScript('User:Animum/userrights.js');
var showTab = false;
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklefluff.js');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklexfd.js');
TwinkleConfig = {
deletionSummaryAd               :       "",
protectionSummaryAd             :       "",
summaryAd                       :       "",
showSharedIPNotice              :       false,
orphanBacklinksOnSpeedyDelete   :       false,
};
importScript('User:Gracenotes/amelvand.js');
importScript('User:Lupin/popups.js');
//[[User:Lupin/popups.js]]
popupHideDelay=0.1;
popupDelay=0.7;
popupAdminLinks=true;
popupsFixDabs=true;
importScript('User:Lupin/recent2.js');
importScript('User:Steel359/protection.js');
importScript('User:Tra/sidebartranslate.js');
importScript('User:Voice of All/Addtabs/monobook.js');
importScript('User:Voice of All/replacetxt.js');
importScript('User:Voice of All/Google/monobook.js');
importScript('User:Voice of All/History/monobook.js');
importScript('User:Voice of All/Adminwarnings/monobook.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); 
importScript('Wikipedia:WikiProject User scripts/Scripts/Add tab');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add toolbox link');
importScript('Wikipedia:WikiProject User scripts/Scripts/Fix lowercase first letter problem');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
 
$(function() {
if(wgAction=="edit") document.forms["editform"].wpWatchthis.checked = false;
});
 
// STATUS CHANGER
$(function (){
var subpage = "/Status";
var scheme = "/StatusTemplate";
var subpagelink = wgServer + "/wiki/User:" + wgUserName + subpage;
var logout = document.getElementById( 'pt-logout' );
//Add the links
mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=in", "in", "pt-status-in", "I'm in!", "", logout);
mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=busy", "busy", "pt-status-busy", "I'm busy!", "", logout);
mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=out", "out", "pt-status-out", "I'm out!", "", logout);
if (location.href.indexOf("?action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?
//Get new status
var statusRegExp = /\?action=edit&newstatus=(.*)/;
var status = statusRegExp.exec(location.href)[1];
//Modify the form
document.getElementById('wpTextbox1').value = "{{User:"+wgUserName+scheme+"|"+status+"}}";
document.getElementById('wpSummary').value = "Status: "+status;
document.getElementById('wpMinoredit').checked = 'checked';
//Submit it!
document.getElementById('editform').submit();
});
 
//
 
$(function() {
if( wgCanonicalNamespace == "Template" && document.getElementById("doc_editlinks") ) {
var editsection = document.getElementById("doc_editlinks");
editsection.innerHTML = '[<a href="' + wgServer + '/wiki/' + wgPageName + '/doc">view</a>]' + "&nbsp;" + '[<a href="'+ mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + wgPageName + '/doc&action=edit" title="Edit the template documentation for this page">edit</a>]';
}
});
 
var subpagename = wgPageName.split( '/' )[1];
 
$(function() {
addToolboxLink('http://en.wikipedia.org/w/index.php?title=' + wgPageName + '&action=purge', "Purge this page", '', '', '', "Purge the cache for this page.");
});
 
$(function() {
if(wgNamespaceNumber != 0 && !subpagename) {
addToolboxLink(mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=Special:Prefixindex/" + wgPageName + "/", "Subpages", '', '', '', 'View the <a href="http://en.wikipedia.org/wiki/Wikipedia:Subpages">subpages</a> of this page'); }
});
 
$(function() {
if((wgNamespaceNumber == "3" || wgNamespaceNumber == "2") && !subpagename) {
addToolboxLink("http://en.wikipedia.org/w/index.php?title=Special:DeletedContributions&target=" + wgTitle, 'Deleted Contributions', '', '', ''); }
}); 
 
$(function() {
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
addlilink(tb, '/wiki/Special:Newpages', 'New pages', 'newpages-ln');
addlilink(tb, '/wiki/Wikipedia:Usernames_for_administrator_attention', 'Usernames', 'uaa-ln');
addlilink(tb, '/wiki/Wikipedia:List_of_protected pages', 'Protected pages', 'pp-ln');
addlilink(tb, '/wiki/Wikipedia:Administrator_intervention_against_vandalism','Vandalism','aiv-ln');
addlilink(tb, '/wiki/Category:Candidates_for_speedy_deletion','Speedy deletions','speedy-ln');
addlilink(tb, '/wiki/Wikipedia:Requests for page protection','Protection requests','rfpp-ln');
addlilink(tb, '/wiki/Wikipedia:Administrators%27_noticeboard','Noticeboard','AN-ln'); 
});
 
function PortletMenu( id ) // Taken from [[User:KnowledgeOfSelf/monobook.js]]
{
this.menu = document.getElementById( id );
this.list = this.menu.getElementsByTagName( 'ul' )[ 0 ]; // bypass "<h5>Views</h5>", etc.
 
var LIs = this.list.getElementsByTagName( 'li' );
 
for ( var i = 0; i < LIs.length; i++ )
{
this[ LIs[ i ].id ] = LIs[ i ];
}
 
this.newItem = function( id, txt, url )
{ var li = document.createElement( 'li' ); li.id   = id;
var  a = document.createElement( 'a'  );  a.href = url;
 
a.appendChild( document.createTextNode( txt ) );
li.appendChild( a );
 
this[ id ] = li; // watch this!!!
 
return li;
}
 
this.append = function( id, txt, url )
{ this.list.appendChild( this.newItem( id, txt, url ) );
}
 
this.insertBefore = function( old, id, txt, url )
{ this.list.insertBefore( this.newItem( id, txt, url ), this[ old ] );
}
 
this.getText = function( id      ) { return this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data }
this.setText = function( id, txt ) {        this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data = txt }
 
this.getHref = function( id      ) { return this[ id ].getElementsByTagName( 'a' )[ 0 ].href       }
this.setHref = function( id, url ) {        this[ id ].getElementsByTagName( 'a' )[ 0 ].href = url }
 
}
 
$(function() {
usermenu = new PortletMenu('p-personal');
document.getElementById('p-personal').getElementsByTagName('ul')[0].style.textTransform = 'none';
usermenu.setText('pt-mytalk', 'talk');
usermenu.setText('pt-preferences', 'preferences');
usermenu.setText('pt-watchlist', 'watchlist');
usermenu.setText('pt-mycontris', 'contribs');
usermenu.setText('pt-logout', 'logout');
if(document.getElementById('ca-edit')) document.getElementById('ca-edit').firstChild.innerHTML = 'edit';
if(document.getElementById('ca-talk')) document.getElementById('ca-talk').firstChild.innerHTML = 'talk';
if(wgPageName == "Main_Page") document.getElementById("ca-nstab-main").firstChild.innerHTML = "Main Page";
});
 
 
//--------------------------------
// Sysop-only stuff
//--------------------------------
 
if(wgUserGroups.indexOf("sysop") != -1) {
importScript('User:Animum/easyblock.js'); //[[User:Animum/easyblock.js]]
ebPrefs = {
displayStatus : false
}
importScript('User:Animum/massdelete.js');
importScript('User:Animum/twinkledelimages.js');
if(wgNamespaceNumber == 14) importScript('User:AzaToth/twinklebatchdelete.js'); 
importScript('User:Voice of All/Deletion/monobook.js');
importScript('User:Voice of All/Protection/monobook.js');
importScript('User:Voice of All/Sleeper/monobook.js');
importScript('User:Voice of All/Specialadmin/monobook.js');
Mvaluejs_class = '';
Rvaluejs_class = '';
Uvaluejs_class = '';
importScript('Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js');
}
 
 
//--------------------------------
// Section for experimentation
//--------------------------------
$(function() {
if(wgIsArticle && location.href.search(/[?&]action\=edit/) != -1) {
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.checked = false;
checkbox.id = "wpBlpRemove";
checkbox.name = "wpBlpRemove";
getElementsByClassName(document, "div", "editOptions")[0].insertBefore(checkbox, getElementsByClassName(document, "div", "editButtons")[0]);
getElementsByClassName(document, "div", "editOptions")[0].insertBefore(document.createTextNode(" Removing BLP violation"), getElementsByClassName(document, "div", "editButtons")[0]);
window.setInterval(function() {
if(document.getElementById("wpBlpRemove").checked == true) {
if(document.forms["editform"].wpSummary.value.indexOf("Negative or contentious material must have multiple, reliable sources.") == -1) { //If this text in the summary below is changed, remember to update it here, or you'll get a very nasty error!
var ticketNum = prompt("Ticket number (leave blank to omit):");
if(!ticketNum) return;
document.forms["editform"].wpSummary.value = "[[Wikipedia:Biography of living persons|Biography of living persons]] violation - Negative or contentious material must have multiple, reliable sources." + (ticketNum.length > 0 ? " ([[WP:OTRS|OTRS]] ticket #" + ticketNum + ")" : "");
} else {
return;
}
}
}, 1000);
}
});