User:NBrandel/monobook.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* הרחבת שורת הלחצנים מעל לתיבת העריכה */
if (mwCustomEditButtons) {
addEditButton("wikipedia/he/c/c9/Button_strike.png", "<s>", "טקסט המסומן כמחוק", "</s>", "טקסט מחוק");
addEditButton("wikipedia/he/e/ea/Button_align_left.png", '<div style="direction: ltr;">\n', "טקסט מיושר לשמאל", "\n</div>", "יישור טקסט לשמאל");
addEditButton("wikipedia/he/5/5f/Button_center.png", '<div style="text-align: center;">\n', "טקסט ממורכז", "\n</div>", "מירכוז טקסט");
addEditButton("wikipedia/he/1/13/Button_enter.png", "<br />", "", "", "ירידת שורה");
addEditButton("wikipedia/he/8/80/Button_upper_letter.png", "<sup>", "כתב עילי", "</sup>", "כתב עילי");
addEditButton("wikipedia/he/7/70/Button_lower_letter.png", "<sub>", "כתב תחתי", "</sub>", "כתב תחתי");
addEditButton("wikipedia/he/5/58/Button_small.png", "<small>", "כתב מוקטן", "</small>", "כתב מוקטן");
addEditButton("wikipedia/he/3/34/Button_hide_comment.png", "<!-- ", "הערה מוסתרת", " -->", "הערה מוסתרת");
addEditButton("wikipedia/he/1/12/Button_gallery.png", "<gallery>\n", "תמונה:PictureFileName.jpg|כיתוב תמונה\nתמונה:PictureFileName.jpg|כיתוב תמונה", "\n</gallery>", "יצירת גלריית תמונות");
addEditButton("wikipedia/he/e/e9/Button_headline2.png", "=== ", "כותרת משנית", " ===", "יצירת כותרת ברמה 3");
addEditButton("wikipedia/he/8/8e/Button_shifting.png", ":", "", "", "הזחה לשמאל");
addEditButton("wikipedia/he/2/23/Button_code.png", '<source lang="text">\n', "טקסט", "\n<\/source>\n", "עיצוב קוד");
addEditButton("wikipedia/he/1/1e/Button_font_color.png", '<span style="color: ColorName;">', "טקסט צבוע", "</span>", "טקסט עם צבע");
addEditButton("wikipedia/he/9/93/Button_sub_link.png", "[[", "שם דף#שם כותרת|שם תצוגה", "]]", "קישור לכותרת בדף");
addEditButton("wikipedia/he/d/d3/Button_definition_list.png", "\n; ", "פריט", " : ", "רשימת הגדרות");
addEditButton("wikipedia/he/a/ac/Button_ref.PNG", "<ref>", "הזן הערת שוליים כאן", "</ref>", "הערת שוליים");
}
/* הוספת כפתור טבלה, המעלה כלי ליצירת טבלאות */
/* גרסה 0.1, נלקח מוויקיפדיה בצרפתית, נכתב במקור על־ידי Dake */
function generateTableau( nbCol, nbRow, border, styleHeader, styleLine, styleSort ) {
var code = "\n";
if ( styleHeader ) {
code += '{| class="wikitable';
if(styleSort) code += ' sortable';
code += '" border="' + border + '"\n';
} else {
code += '{| border="' + border + '"\n';
code += "|+ כותרת הטבלה\n";
}
for( var i = 0; i < nbCol; i++) {
if(i==0) code += "! כותרת " + i;
else code += " !! כותרת " + i;
}
if(nbCol>0) code+="\n";
for( var i = 0; i < nbRow; i++ ) {
if( i %2 == 1 && styleLine ) {
code += '|- style="background-color: #EFEFEF;"\n';
} else {
code += "|-\n";
}
for( var j = 0; j < nbCol; j++ ) {
if(j==0) code += "| תא " + i;
else code += " || תא " + i;
}
if(nbCol>0) code+="\n";
}
code += "|}";
insertTags( "", "", code );
}
function popupTableau() {
var popup = window.open( "", "popup", "height=240,width=250" );
popup.document.write('<html><head><title>פרמטרים לטבלה</title>');
popup.document.write('<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/skins-1.5/monobook/main.css"; @import "/skins-1.5/monobook/rtl.css"; /*]]>*/</style>');
popup.document.write('<script type="text/javascript">function insertCode() {');
popup.document.write('var row = parseInt( document.paramForm.inputRow.value ); ');
popup.document.write('var col = parseInt( document.paramForm.inputCol.value ); ');
popup.document.write('var bord = parseInt( document.paramForm.inputBorder.value ); ');
popup.document.write('var styleHeader = document.paramForm.inputHeader.checked; ');
popup.document.write('var styleLine = document.paramForm.inputLine.checked; ');
popup.document.write('var styleSort = document.paramForm.sortedTable.checked; ');
popup.document.write('window.opener.generateTableau( col, row, bord, styleHeader, styleLine, styleSort); ');
popup.document.write('}</script>');
popup.document.write('</head><body>');
popup.document.write('<p>אנא הזן/י פרמטרים לטבלה : </p>');
popup.document.write('<form name="paramForm">');
popup.document.write('מספר שורות : <input type="text" name="inputRow" maxlength="3" value="3" style=\"width:50px;\"><p>');
popup.document.write('מספר עמודות : <input type="text" name="inputCol" maxlength="3" value="3" style=\"width:50px;\"><p>');
popup.document.write('רוחב מסגרת : <input type="text" name="inputBorder" maxlength="2" value="1" style=\"width:50px;\"><p>');
popup.document.write('טבלה מעוצבת : <input type="checkbox" name="inputHeader" checked="1" ><p>');
popup.document.write('שורות אפורות לסירוגין: <input type="checkbox" name="inputLine" checked="1" ><p>');
popup.document.write('טבלה ממוינת: <input type="checkbox" name="sortedTable"><p>');
popup.document.write('</form>');
popup.document.write('<p><a href="javascript:insertCode(); self.close();"> הוספת הקוד לחלון העריכה</a></p>');
popup.document.write('<p><a href="javascript:self.close()"> סגירה</a></p>');
popup.document.write('</body></html>');
popup.document.close();
}
/* הוספת כפתור טבלאות לסרגל הכלים */
function tableButton() {
if( document.getElementById("toolbar") ) {
var tableButton = document.createElement("img");
tableButton.width = 23;
tableButton.height = 22;
tableButton.src = "http://upload.wikimedia.org/wikipedia/he/6/60/Button_insert_table.png";
tableButton.border = 0;
tableButton.alt = "הוספת טבלה";
tableButton.title = "הוספת טבלה";
tableButton.style.cursor = "pointer";
tableButton.onclick = popupTableau;
if( document.getElementById("toolbar").lastChild.id == "templatesList" ) {
document.getElementById("toolbar").insertBefore( tableButton, document.getElementById("templatesList") );
} else {
document.getElementById("toolbar").appendChild( tableButton );
}
}
}
hookEvent("load", tableButton);