|
|
| (400 גרסאות ביניים של 22 משתמשים אינן מוצגות) |
| שורה 1: |
שורה 1: |
| //<source lang="javascript"> | | // Global variable hints for JSHint |
| /* ערכו קובץ זה כדי להריץ סקריפטים ב־JavaScript באתר כולו. ערכו את [[מדיה ויקי:Monobook.js]] לסקריפטים שיופעלו ברקע מונובוק בלבד. */ | | /* global $, mw, importScript */ |
|
| |
|
| /* פונקציה הטוענת פונקציות בעת עליית הדף */ | | /* ייבוא סקריפטים */ |
| function addLoadEvent(event)
| |
| {
| |
| if (window.addEventListener) /* דפדפן שאינו אינטרנט אקספלורר */
| |
| {
| |
| window.addEventListener("load", event, false);
| |
| }
| |
| else if (window.attachEvent) /* אינטרנט אקספלורר */
| |
| {
| |
| window.attachEvent("onload", event);
| |
| }
| |
| }
| |
|
| |
|
| /** JSconfig ***** | | /* פונקציה לייבוא סקריפט מ[[ויקיפדיה:סקריפטים]] */ |
| * You can override these default in your [[Special:Mypage/monobook.js]]
| | function importUserScript() { |
| * templatesList gets the following parameter:
| | 'use strict'; |
| * 'toolbar' : adds the list to the toolbar (default).
| |
| * 'bottom' : adds the list to the bottom of the page, next to the summary.
| |
| * false : doesn't add the list at all.
| |
| */
| |
| var JSconfig =
| |
| { | |
| templatesList: 'toolbar'
| |
| }
| |
|
| |
|
| /* הרחבת שורת הלחצנים מעל לתיבת העריכה */
| | var args = arguments; |
| if (mwCustomEditButtons) /* רק אם המערך קיים, כלומר – אם זה דף עריכה */
| |
| {
| |
| function addEditButton(imageFile, tagOpen, sampleText, tagClose, speedTip)
| |
| {
| |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://upload.wikimedia.org/wikipedia/he/" + imageFile,
| |
| "tagOpen": tagOpen,
| |
| "sampleText": sampleText,
| |
| "tagClose": tagClose,
| |
| "speedTip": speedTip
| |
| };
| |
| }
| |
|
| |
| addEditButton("c/c9/Button_strike.png", "<s>", "טקסט המסומן כמחוק", "</s>", "טקסט מחוק");
| |
| addEditButton("e/ea/Button_align_left.png", '<div style="direction: ltr;">\n', "טקסט מיושר לשמאל", "\n</div>", "יישור טקסט לשמאל");
| |
| addEditButton("5/5f/Button_center.png", '<div style="text-align: center;">\n', "טקסט ממורכז", "\n</div>", "מירכוז טקסט");
| |
| addEditButton("1/13/Button_enter.png", "<br />", "", "", "ירידת שורה");
| |
| addEditButton("8/80/Button_upper_letter.png", "<sup>", "כתב עילי", "</sup>", "כתב עילי");
| |
| addEditButton("7/70/Button_lower_letter.png", "<sub>", "כתב תחתי", "</sub>", "כתב תחתי");
| |
| addEditButton("5/58/Button_small.png", "<small>", "כתב מוקטן", "</small>", "כתב מוקטן");
| |
| addEditButton("3/34/Button_hide_comment.png", "<!-- ", "הערה מוסתרת", " -->", "הערה מוסתרת");
| |
| addEditButton("1/12/Button_gallery.png", "<gallery>\n", "תמונה:PictureFileName.jpg|כיתוב תמונה\nתמונה:PictureFileName.jpg|כיתוב תמונה", "\n</gallery>", "יצירת גלריית תמונות");
| |
| addEditButton("e/e9/Button_headline2.png", "=== ", "כותרת משנית", " ===", "יצירת כותרת ברמה 3");
| |
| addEditButton("8/8e/Button_shifting.png", ":", "", "", "הזחה לשמאל");
| |
| addEditButton("2/23/Button_code.png", '<source lang="text">\n', "טקסט", "\n<\/source>\n", "עיצוב קוד");
| |
| addEditButton("1/1e/Button_font_color.png", '<span style="color: ColorName;">', "טקסט צבוע", "</span>", "טקסט עם צבע");
| |
| addEditButton("9/93/Button_sub_link.png", "[[", "שם דף#שם כותרת|שם תצוגה", "]]", "קישור לכותרת בדף");
| |
| addEditButton("d/d3/Button_definition_list.png", "\n; ", "פריט", " : ", "רשימת הגדרות");
| |
| addEditButton("a/ac/Button_ref.PNG", "<ref>", "הזן הערת שוליים כאן", "</ref>", "הערת שוליים");
| |
|
| |
| }
| |
|
| |
|
| /* הוספת כפתור טבלה, המעלה כלי ליצירת טבלאות */
| | mw.loader.using( 'mediawiki.util', function () { |
| /* גרסה 0.1, נלקח מוויקיפדיה בצרפתית, נכתב במקור על־ידי Dake */
| | for ( var arg = 0; arg < args.length; arg++ ) { |
| function generateTableau(nbCol, nbRow, border, styleHeader, styleLine) | | try { |
| {
| | importScript( 'MediaWiki:סקריפטים/' + args[arg] + '.js' ); |
| var code = "\n";
| | } |
| if (styleHeader==1) {
| | catch( e ) { |
| code += '{| class=\"wikitable\" border=\"' + border + '\"\n';
| | } |
| } else {
| | } |
| code += '{| border=\"' + border + '\"\n';
| | } ); |
| code += '|+ כותרת הטבלה\n';
| |
| }
| |
|
| |
| for (var i=0;i<nbCol;i++) code += '! כותרת ' + i + '\n'
| |
|
| |
| for (var j=0;j<nbRow;j++) {
| |
| if ((j+1)%2==0 && styleLine==1) {
| |
| code += '|- bgcolor=\"#EFEFEF\"\n'
| |
| } else {
| |
| code += '|-\n'
| |
| }
| |
|
| |
| for (var i=0;i<nbCol;i++) code += '| תא\n';
| |
| }
| |
|
| |
| code += '|}';
| |
| insertTags('','', code);
| |
| } | | } |
|
| |
|
| function popupTableau()
| | /* פונקציה הטוענת פונקציות בעת עליית הדף */ |
| {
| | function addLoadEvent() { |
| var popup = window.open('','name','height=240,width=250');
| | // Deprecated |
|
| |
| javaCode = '<script type=\"text\/javascript\">function insertCode(){';
| |
| javaCode += 'var row = parseInt(document.paramForm.inputRow.value); '
| |
| javaCode += 'var col = parseInt(document.paramForm.inputCol.value); '
| |
| javaCode += 'var bord = parseInt(document.paramForm.inputBorder.value); '
| |
| javaCode += 'var styleHeader = document.paramForm.inputHeader.checked; '
| |
| javaCode += 'var styleLine = document.paramForm.inputLine.checked; '
| |
| javaCode += 'window.opener.generateTableau(col,row,bord,styleHeader,styleLine); '
| |
| javaCode += '}<\/script>';
| |
|
| |
| 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?5\";@import \"/skins-1.5/monobook/rtl.css\"; /*]]>*/<\/style>');
| |
| popup.document.write(javaCode);
| |
| 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('</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();
| |
| } | | } |
|
| |
|
| /* הוספת כפתור טבלאות לסרגל הכלים */
| | mw.loader.using( 'mediawiki.util', function () { |
| function tableButton()
| | 'use strict'; |
| {
| |
| tooly = document.getElementById('toolbar');
| |
| if (tooly != null)
| |
| { | |
| /* הגדרת כפתור עם כלי להוספת טבלאות. */
| |
| 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;
| |
| tooly.appendChild(tableButton);
| |
| }
| |
| }
| |
|
| |
|
| | importScript( 'MediaWiki:Functions.js' ); // פונקציות המצויות בשימוש בסקריפטים שונים |
|
| |
|
| //************************************
| | if ( $.inArray( mw.config.get( 'wgPageName' ), [ |
| // פונקציה להוספת רשימת תבניות בסרגל הכלים
| | 'עמוד_ראשי', |
| // נכתב על ידי [[משתמש:Yonidebest]] ו[[משתמש:ערן]]
| | 'שיחה:עמוד_ראשי' |
| //
| | ] ) + 1 ) { |
| function createOptionElement(selectEl, text) {
| | importScript( 'MediaWiki:Mainpage.js' ); // שיפורים שונים בעמוד הראשי |
| oOption = document.createElement("option");
| |
| selectEl.options.add(oOption);
| |
| oOption.innerHTML = text;
| |
| oOption.title = text;
| |
| return selectEl;
| |
| }
| |
|
| |
|
| function templatesList() {
| | if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) { |
| if (!JSconfig.templatesList) return; // user doesn't want the template list
| | importScript( 'MediaWiki:Portals.js' ); // פורטלים מתחלפים בעמוד הראשי |
| if (wgAction != 'edit' && wgAction != 'submit') return; // not edit page
| | } |
| var toolbar = document.getElementById('toolbar');
| | } |
| if (!toolbar && JSconfig.templatesList == 'toolbar') return; // no toolbar
| | |
| | if ( mw.config.get( 'wgNamespaceNumber' ) === 6 ) { |
| | mw.loader.load( 'ext.gadget.ime' ); |
| | } |
|
| |
|
| tmpSelect = document.createElement('select');
| | |
| tmpSelect.id = 'templatesList';
| |
| tmpSelect.onchange = function(){insertTemplate(this.selectedIndex);this.selectedIndex=0;return false;}
| |
|
| |
|
| // array to define options titles
| | // סקריפטים עבור אנונימיים ו/או חדשיםs |
| var tempTitles=new Array('בחרו תבנית כדי להוסיף', 'קטגוריה', 'פירוש נוסף', 'בעבודה', 'לקריאה נוספת','קישורים חיצוניים', 'ראו גם', 'הודעת קצרמר', 'דף הפניה', 'פירושונים','הפניה להערת שוליים', 'כותרת הערת שוליים', 'הפרת זכויות יוצרים', 'הבהרת חשיבות', 'ערך בבדיקה', 'הוספת ציטוט');
| | if ( $.inArray( 'autoconfirmed', mw.config.get( 'wgUserGroups' ) ) === -1 ) { |
| //create options | | importScript( 'MediaWiki:Autopurge.js' ); // הוספת אפשרות לרענון אוטומטי על ידי אנונימיים, ללא מעבר בטופס |
| for(var i=0;i<16;i++) tmpSelect = createOptionElement(tmpSelect, tempTitles[i]);
| | importScript( 'MediaWiki:Navtip.js' ); // הוספת התיבה "רוצה טיפ?" בצד למשתמשים אנונימיים |
| | } |
|
| |
|
| // add list to the end of tool
| | // סקריפטים לדפי עריכה |
| if (JSconfig.templatesList == 'toolbar') // add to toolbar
| | if ( ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) + 1 ) && |
| toolbar.appendChild(tmpSelect);
| | !$( '#wpTextbox1' ).prop( 'readonly' ) |
| else { // add to the bottom of the page
| | ) { |
| var tmpltTable = document.getElementById('edit-templates').getElementsByTagName('table');
| | importScript( 'MediaWiki:Templateslist.js' ); // הצגת רשימת תבניות |
| if (tmpltTable[0]) {
| | importScript( 'MediaWiki:Nosaving.js' ); // חיוב תצוגה מקדימה למשתמשים אנונימיים |
| var nTr = document.createElement('tr');
| | importScript( 'MediaWiki:Edittools.js' ); // שיפור התווים המיוחדים שמתחת לדף העריכה |
| var nTd1 = document.createElement('td');
| | importScript( 'MediaWiki:Ref2template.js' ); //ref סקריפט שמשנה את התנהגות כפתור "הערה": הוספת תבנית הערה. במקום להוסיף תג |
| nTd1.appendChild(document.createTextNode('תבנית:'));
| | } |
| nTr.appendChild(nTd1);
| |
| var nTd2 = document.createElement('td');
| |
| nTd2.appendChild(tmpSelect);
| |
| nTr.appendChild(nTd2);
| |
| tmpltTable[0].appendChild(nTr);
| |
| }
| |
| }
| |
| } | |
|
| |
|
| function insertTemplate(index) {
| | // סקריפטים לעמודים ספציפיים |
| var templates = new Array;
| | if( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) { |
| var bracketA = "{" + "{";
| | importScript( 'MediaWiki:Licenses.js' ); // שיפורים ברשיונות ושינויים בדף ההעלאה |
| var bracketB = "}" + "}";
| | } |
|
| |
|
| templates[0] = "\n[[קטגוריה:";
| | // הופעת [[תבנית:דיון חדש במזנון]] לפני יצירת פסקה חדשה במזנון |
| templates[1] = "שם הקטגוריה";
| | if( mw.config.get( 'wgPageName' ) === 'ויקיפדיה:מזנון' ) { |
| templates[2] = "]]";
| | $( document ).ready( function() { |
| | var $addSectionLink = $( '#ca-addsection a' ), |
| | currentHref = $addSectionLink.attr( 'href' ); |
|
| |
|
| templates[3] = bracketA + "פירוש נוסף|";
| | $addSectionLink.attr( 'href', currentHref + '&editintro=תבנית:דיון_חדש_במזנון' ); |
| templates[4] = "נוכחי=|אחר=|ראו=";
| | } ); |
| templates[5] = bracketB;
| | } |
|
| |
|
| templates[6] = "\n";
| | // link to sub pages |
| templates[7] = bracketA + "בעבודה" + bracketB;
| | if ( mw.config.get( 'wgNamespaceNumber' ) > 0 && |
| templates[8] = "\n";
| | mw.config.get('wgNamespaceNumber') != 6 && |
| | mw.config.get('wgNamespaceNumber') != 14 |
| | ) { |
| | $ ( function() { |
| | var linkText = mw.config.get( 'wgUserLanguage' ) == 'he' ? 'דפי משנה' : 'Sub pages', |
| | linkTitle = mw.config.get( 'wgUserLanguage' ) == 'he' ? 'רשימת דפי המשנה של דף זה' : 'List of the sub pages of this page'; |
| | |
| | $( '#t-recentchangeslinked' ).after( $( '<li>' ).append( $( '<a>', { |
| | text: linkText, |
| | href: mw.util.getUrl( 'Special:PrefixIndex/' + mw.config.get( 'wgPageName' ) ), |
| | title: linkTitle |
| | } ) ) ); |
| | } ); |
| | } |
|
| |
|
| templates[9] = "\n== לקריאה נוספת ==\n"; | | /** WikiMiniAtlas ******************************************************* |
| templates[10] = "* שם סופר, '''שם ספר''', שם הוצאה, תאריך הוצאה.\n"; | | * |
| templates[11] = "";
| | * Description: WikiMiniAtlas is a popup click and drag world map. |
| | * This script causes all of our coordinate links to display the WikiMiniAtlas popup button. |
| | * The script itself is located on meta because it is used by many projects. |
| | * See [[Meta:WikiMiniAtlas]] for more information. |
| | * Maintainers: [[User:Dschwen]] |
| | */ |
| | ( function () { |
| | if ( $( 'a.external.text[href*=geohack], div.kmldata' ).length ) { |
| | mw.loader.load( '//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript' ); |
| | } |
| | } )(); |
|
| |
|
| templates[12] = "\n== קישורים חיצוניים ==\n";
| | /* |
| templates[13] = "* שם כותב, [Address תיאור המאמר], שם האתר\n";
| | * Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page. Used (also) in {{תב|דף אישי}}. |
| templates[14] = "";
| | * Originally created by [[:en:User:Cacycle]] |
| | */ |
| | $( function () { |
| | if ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgUserName' ) ) { |
| | var pageName = mw.config.get( 'wgPageName' ); |
| | var slash = pageName.indexOf( '/' ); |
| | var norm = pageName.substr( 0, slash ) + mw.config.get( 'wgPageName' ).substr( slash ).toLowerCase(); |
| | var test = 'משתמש:' + mw.config.get( 'wgUserName' ).replace( / /g, '_' ) + '/skin.'; |
| | var ext = null; |
|
| |
|
| templates[15] = "\n== ראו גם ==\n";
| | if ( norm === test + 'js' ) { |
| templates[16] = "* [[שם ערך]]\n";
| | ext = 'js'; |
| templates[17] = "";
| | } else if (norm === test + 'css') { |
| | ext = 'css'; |
| | } |
|
| |
|
| templates[18] = "";
| | if ( ext !== null ) { |
| templates[19] = "\n" + bracketA + "קצרמר" + bracketB;
| | window.location.href = window.location.href.replace( |
| templates[20] = "";
| | /\/skin.(css|js)/i, |
| | '/' + mw.config.get( 'skin' ) + '.' + ext |
| | ); |
| | } |
| | } |
|
| |
|
| templates[21] = "#הפניה [[";
| | // create an event when util.addPortletLink() is called, so scripts that manipulate menus ca readjust. |
| templates[22] = "שם הערך המופנה";
| | var oldFunc = mw.util.addPortletLink; |
| templates[23] = "]]";
| | if ( typeof oldFunc === 'function' ) { |
| | mw.util.addPortletLink = function () { |
| | var res = oldFunc.apply( this, arguments ); |
| | $( document ).trigger( 'new-portlet-link' ); |
|
| |
|
| templates[24] = "\n" + bracketA + "פירושונים|" + "\n";
| | return res; |
| templates[25] = "* [[ערך 1]] - הסבר קצר על מהותו של ערך 1\n* [[ערך 2]] - הסבר קצר על מהותו של ערך 2";
| | }; |
| templates[26] = "\n" + bracketB;
| | } |
| | } ); |
|
| |
|
| templates[27] = "<ref name=\"ref-name\" />";
| | if ( $.inArray( mw.config.get( 'wgPageName' ), [ |
| templates[28] = "";
| | 'ויקיפדיה:בוקמרקלטים', |
| templates[29] = "";
| | 'שיחת_ויקיפדיה:בוקמרקלטים' |
| | ] ) + 1 ) { |
| | importScript( 'MediaWiki:bookmarkletsInit.js' ); // דף הבוקמרקלטים |
| | } |
|
| |
|
| templates[30] = "\n== הערות שוליים ==";
| | if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ) { |
| templates[31] = "\n<references />";
| | importScript( 'MediaWiki:SearchEngines.js' ); // בחירה במנועי חיפוש שונים |
| templates[32] = "";
| | importScript( 'Mediawiki:Gadget-advanceSearch.js' ); |
| | } |
|
| |
|
| templates[33] = "\n" + bracketA + "הפרת זכויות יוצרים|מקור=";
| | /* |
| templates[34] = " המקור שממנו הועתק התוכן ";
| | * Adds an automatic '{{תב|מוגן}}' or '{{תב|מוגן חלקית}}' template when the page is protected. |
| templates[35] = "|זמן=" + bracketA + "ס:יום נוכחי" + bracketB + "/" + bracketA + "ס:חודש נוכחי" + bracketB + "/" + bracketA + "ס:שנה נוכחית" + bracketB + "(~~" + "~~" + "~)" + bracketB + "\n";
| | * You can use the {{תב|ללא הודעת הגנה אוטומטית}} to prevent the protection notice from being inserted. |
| | * |
| | * written by [[User:ערן]], [[User:Yonidebest]] |
| | * |
| | */ |
| | $(function(){ |
| | var restrictionEdit = mw.config.get('wgRestrictionCreate') || mw.config.get('wgRestrictionEdit'); |
| | if( restrictionEdit && |
| | restrictionEdit.length > 0 && |
| | ( |
| | restrictionEdit[0] === 'sysop' || |
| | restrictionEdit[0] === 'autoconfirmed' || |
| | restrictionEdit[0] === 'templateeditor' || |
| | restrictionEdit[0] === 'editautopatrolprotected' |
| | ) && |
| | $( '#pl-noprotectionnotice, #pl-autoconfirmed, #pl-protected' ).length === 0 && |
| | ( $.inArray( mw.config.get( 'wgAction' ), [ 'view', 'submit' ] ) + 1 ) |
| | ) { |
| | var restrictionEditMapping = { |
| | 'sysop': 'מוגן', |
| | 'templateeditor': 'הגנת ממשק', |
| | 'editautopatrolprotected': 'הגנה מוגברת', |
| | 'autoconfirmed': 'מוגן חלקית' |
| | }; |
| | |
| | $.get( mw.util.wikiScript( 'api' ), { |
| | action: 'parse', |
| | format: 'json', |
| | text: '{{' + restrictionEditMapping[restrictionEdit[0]] + '}}', |
| | prop: 'text|indicators', |
| | title: mw.config.get('wgPageName'), |
| | contentmodel: 'wikitext' |
| | }, function( data ) { |
| | $( function () { |
| | $( '.printfooter' ).before( $( '<div>', { |
| | 'class': 'plprotected', |
| | 'html': data.parse.text['*'] |
| | } ) ); |
| | |
| | var newList = []; |
| | $.each( data.parse.indicators, function ( name, indicator ) { |
| | newList.push( |
| | $( '<div>' ) |
| | .addClass( 'mw-indicator' ) |
| | .attr( 'id', mw.util.escapeIdForAttribute( 'mw-indicator-' + indicator.name ) ) |
| | .html( indicator['*'] ) |
| | .get( 0 ), |
| | // Add a whitespace between the <div>s because |
| | // they get displayed with display: inline-block |
| | document.createTextNode( '\n' ) |
| | ); |
| | } ); |
| | $( '.mw-indicators' ).append( newList ); |
| | } ); |
| | } ); |
| | } |
| | }); |
| | } ); |
|
| |
|
| templates[36] = bracketA + "ס:הבהרת חשיבות"+ bracketB;
| | // search meta-commands: make the table display clickabe keywords. |
| templates[37] = "";
| | if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ) { |
| templates[38] = "";
| | mw.hook( 'he.wikipedia.collapsetables.loaded' ).add( function () { |
| | 'use strict'; |
|
| |
|
| templates[39] = bracketA + "בבדיקה";
| | var $searchBox = $( '#searchText input' ), |
| templates[40] = "";
| | $metaStringsTable = $( '#mw-search-meta-strings' ); |
| templates[41] = "|זמן=" + bracketA + "ס:יום נוכחי" + bracketB+ "/" + bracketA + "ס:חודש נוכחי" + bracketB+ "/" + bracketA + "ס:שנה נוכחית" + bracketB+ "(~~" + "~~" + "~)" + bracketB;
| | |
| | $metaStringsTable.find( 'span.mw-search-meta-string' ).wrap( $( '<a>' ) |
| | .click( function( e ) { |
| | var currentText, newText; |
|
| |
|
| templates[42] = bracketA + "ציטוט|מרכאות=כן|תוכן=";
| | e.preventDefault(); |
| templates[43] = "הזינו ציטוט כאן";
| |
| templates[44] = bracketB;
| |
|
| |
|
| if (index > 0)
| | currentText = $searchBox.val(); |
| insertTags(templates[index * 3 - 3], templates[index * 3 - 1], templates[index * 3 - 2]);
| | newText = $( this ).text(); |
| }
| |
|
| |
|
| /* פונקציה להוספת כוכב בקישורי בינויקי לערכים מומלצים */
| | $searchBox.val( currentText + newText ); |
| function featuredInterwiki()
| | } ) |
| {
| | ); |
| // iterate over all <span>-elements
| | |
| var a;
| | // Make the table appear only after the collapsible styles are loaded, |
| for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
| | // so that it won't delay showing the search results |
| // if found a FA span
| | $metaStringsTable.css( 'display', 'table' ); |
| if(a.className == "FA") {
| | } ); |
| // iterate over all <li>-elements
| |
| for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
| |
| // if found a FA link
| |
| if(b.className == "interwiki-" + a.id) {
| |
| b.className += " FA";
| |
| b.title = "ערך מומלץ";
| |
| }
| |
| }
| |
| }
| |
| }
| |
| } | | } |
|
| |
|
| // ============================================================
| | // On demand loading of scripts and gadgets, initial version from ruwiki. |
| // BEGIN Dynamic Navigation Bars (experimantal)
| | // Detects uses of template "טען סקריפט" |
|
| | // and loads specifically-named scripts or gadgets. |
| // set up the words in your language
| | // for a gadget, its name as defined in gadgets-definition must begin with "ondemand-" |
| var NavigationBarHide = '[הסתר]';
| | if ( mw.config.get('wgCanonicalNamespace') !== 'Special' ) |
| var NavigationBarShow = '[הראה]';
| | mw.hook( 'wikipage.content' ).add( function( content ) { |
|
| | var beenthere = {}; |
| // set up max count of Navigation Bars on page,
| | $( '.executeJS', content ).each( function () { |
| // if there are more, all will be hidden
| | var gadget = $( this ).data( 'gadgetname' ); |
| // NavigationBarShowDefault = 0; // all bars will be hidden
| | if ( gadget && $.trim( gadget ) ) mw.loader.load( 'ext.gadget.ondemand-' + $.trim( gadget ) ); // np repetitions - resourceloader takes care |
| // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
| | } ); |
| var NavigationBarShowDefault = 1;
| | } ); |
|
| |
|
| |
| // shows and hides content and picture (if available) of navigation bars
| |
| // Parameters:
| |
| // indexNavigationBar: the index of navigation bar to be toggled
| |
| function toggleNavigationBar(indexNavigationBar)
| |
| {
| |
| var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
| |
| var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
| |
|
| |
| if (!NavFrame || !NavToggle) {
| |
| return;
| |
| }
| |
|
| |
| // if shown now
| |
| if (NavToggle.firstChild.data == NavigationBarHide) {
| |
| for (
| |
| var NavChild = NavFrame.firstChild;
| |
| NavChild != null;
| |
| NavChild = NavChild.nextSibling
| |
| ) {
| |
| if (NavChild.nodeName.toLowerCase() == "div") {
| |
| if (NavChild.className == 'NavPic') {
| |
| NavChild.style.display = 'none';
| |
| }
| |
| if (NavChild.className == 'NavContent') {
| |
| NavChild.style.display = 'none';
| |
| }
| |
| }
| |
| }
| |
| NavToggle.firstChild.data = NavigationBarShow;
| |
|
| |
| // if hidden now
| |
| } else if (NavToggle.firstChild.data == NavigationBarShow) {
| |
| for (
| |
| var NavChild = NavFrame.firstChild;
| |
| NavChild != null;
| |
| NavChild = NavChild.nextSibling
| |
| ) {
| |
| if (NavChild.className == 'NavPic') {
| |
| NavChild.style.display = 'block';
| |
| }
| |
| if (NavChild.className == 'NavContent') {
| |
| NavChild.style.display = 'block';
| |
| }
| |
| }
| |
| NavToggle.firstChild.data = NavigationBarHide;
| |
| }
| |
| }
| |
|
| |
| // adds show/hide-button to navigation bars
| |
| function createNavigationBarToggleButton()
| |
| {
| |
| var indexNavigationBar = 0;
| |
| var NavFrame;
| |
| // iterate over all < div >-elements
| |
| for(
| |
| var i=0;
| |
| NavFrame = document.getElementsByTagName("div")[i];
| |
| i++
| |
| ) {
| |
| // if found a navigation bar
| |
| if (NavFrame.className == "NavFrame") {
| |
|
| |
| indexNavigationBar++;
| |
| var NavToggle = document.createElement("a");
| |
| NavToggle.className = 'NavToggle';
| |
| NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
| |
| NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
| |
|
| |
| var NavToggleText = document.createTextNode(NavigationBarHide);
| |
| NavToggle.appendChild(NavToggleText);
| |
| // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
| |
| for(
| |
| var j=0;
| |
| j < NavFrame.childNodes.length;
| |
| j++
| |
| ) {
| |
| if (NavFrame.childNodes[j].nodeName.toLowerCase() == "div" && NavFrame.childNodes[j].className == "NavHead") {
| |
| NavFrame.childNodes[j].appendChild(NavToggle);
| |
| }
| |
| }
| |
| NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
| |
| }
| |
| }
| |
| // if more Navigation Bars found than Default: hide all
| |
| if (NavigationBarShowDefault < indexNavigationBar) {
| |
| for(
| |
| var i=1;
| |
| i<=indexNavigationBar;
| |
| i++
| |
| ) {
| |
| toggleNavigationBar(i);
| |
| }
| |
| }
| |
|
| |
| }
| |
|
| |
| // END Dynamic Navigation Bars
| |
| // ============================================================
| |
| | |
| /* פונקציה לבחירת כל הגרסאות בדף השחזורים כברירת מחדל */ | |
| function selectAllunDel()
| |
| {
| |
| /* בצע רק אם בדף יש טופס שחזור */
| |
| var undeleteForm = document.getElementById('undelete');
| |
| if (undeleteForm == null) return;
| |
| var unDelAll=document.createElement('input');
| |
| unDelAll.value='סימון כל הגרסאות';
| |
| unDelAll.type='button';
| |
| unDelAll.onclick=function(){
| |
| for(var j=0; a = document.getElementsByTagName("input")[j]; j++) {
| |
| if(a.type=="checkbox") a.checked=true;
| |
| }
| |
| };
| |
| undeleteForm.elements["restore"].parentNode.appendChild(unDelAll);
| |
| }
| |
| | |
| // =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
| |
| // התאמה אישית של רשימת הרישיונות בדף העלאת קובץ
| |
| | |
| function showLicenseAlert(licenseAlert)
| |
| {
| |
| licenseAlertField = document.getElementById('uploadAlertData');
| |
| | |
| switch (licenseAlert) {
| |
| case "שימוש הוגן":
| |
| licenseAlertField.innerHTML = '<b>תזכורת</b>: בשדה התיאור יש להחליף את הכיתוב "שם-הערך-בו-מותר-השימוש" בשם הערך שבגינו העלאתם את התמונה.';
| |
| document.getElementById('uploadAlert').style.display = "block";
| |
| break;
| |
| case "ויקישיתוף":
| |
| licenseAlertField.innerHTML = '<b>תזכורת</b>: תמונות חופשיות יש להעלות לוויקישיתוף (למעט תמונות שנועדו לשימוש אישי בדף משתמש).';
| |
| document.getElementById('uploadAlert').style.display = "block";
| |
| break;
| |
| case "שימוש הוגן ומקור":
| |
| licenseAlertField.innerHTML = '<b>תזכורת</b>: בשדה התיאור יש להחליף את הכיתוב "שם-הערך-בו-מותר-השימוש" בשם הערך שבגינו העלאתם את התמונה, ואת הכיתוב "מקור-התמונה" באתר האינטרנט ממנה נלקחה התמונה.';
| |
| document.getElementById('uploadAlert').style.display = "block";
| |
| break;
| |
| }
| |
| }
| |
| | |
| function showLicenseInfo(licenseName)
| |
| {
| |
| licenseViewOriginal = document.getElementById('wpUploadDescription');
| |
| if (licenseViewOriginal != null && licenseName != "disabled") {
| |
| licenseViewOriginal.focus();
| |
| var licenseView = '== רישיון ==\n{{';
| |
| var usrName = wgUserName;
| |
| switch (licenseName) {
| |
| case "מולטי ייחוס ורישיון זהה":
| |
| licenseView += 'דו-רישיוני|GFDL|cc-by-sa-2.5,2.0,1.0}}\nנוצר על ידי [[משתמש:' + usrName + ']]';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "ייחוס ורישיון זהה עצמי":
| |
| licenseView += 'cc-by-sa-2.5}}\nנוצר על ידי [[משתמש:' + usrName + ']]';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "מולטי ייחוס":
| |
| licenseView += 'דו-רישיוני|GFDL|cc-by-2.5}}\nנוצר על ידי [[משתמש:' + usrName + ']]';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "self GFDL":
| |
| licenseView += 'GFDL}}\nנוצר על ידי [[משתמש:' + usrName + ']]';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "GFDL":
| |
| licenseView += 'GFDL}}';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "רשות ציבור":
| |
| licenseView += 'שימוש חופשי|' + usrName + '}}';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "ייחוס ורישיון זהה":
| |
| licenseView += 'cc-by-sa-2.5}}';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "ייחוס":
| |
| licenseView += 'cc-by-2.5}}';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "ייחוס בלבד":
| |
| licenseView += 'ייחוס|שם משתמש=' + usrName + '}}';
| |
| showLicenseAlert("ויקישיתוף");
| |
| break;
| |
| case "שימוש הוגן":
| |
| licenseView += 'שימוש הוגן|מקור=מקור-התמונה|ערך=שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן ומקור");
| |
| break;
| |
| case "עטיפת אלבום":
| |
| licenseView += 'עטיפת אלבום|שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן");
| |
| break;
| |
| case "עטיפת ספר":
| |
| licenseView += 'עטיפת ספר|שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן");
| |
| break;
| |
| case "כרזת סרט, וידיאו או תקליטור":
| |
| licenseView += 'כרזת סרט|שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן");
| |
| break;
| |
| case "לוגו":
| |
| licenseView += 'לוגו|שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן");
| |
| break;
| |
| case "צילום מסך של אתר אינטרנט או תוכנה":
| |
| licenseView += 'צילום מסך|שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן");
| |
| break;
| |
| case "סריקה של ספר, עיתון או עצם אחר":
| |
| licenseView += 'סריקה|שם-הערך-בו-מותר-השימוש}}';
| |
| showLicenseAlert("שימוש הוגן");
| |
| break;
| |
| case "אין":
| |
| licenseView = '== רישיון ==\nאין לי מידע בקשר למצב זכויות היוצרים ולרישיון הקובץ.';
| |
| break;
| |
| case "infobox":
| |
| if (licenseViewOriginal.value=="") {
| |
| var doubletilda = '{' + '{';
| |
| licenseView = doubletilda + 'מידע|\n|תיאור=\n|מקור=\n|תאריך יצירה=\n|יוצר=\n|אישורים והיתרים=\n|גרסאות אחרות=\n}}';
| |
| }
| |
| else licenseView = "";
| |
| licenseViewOriginal.rows = 20;
| |
| break;
| |
| }
| |
| | |
| if (licenseViewOriginal.value == "") {
| |
| licenseViewOriginal.value = licenseView;
| |
| } else {
| |
| licenseViewOriginal.value = licenseViewOriginal.value + '\n' + licenseView;
| |
| }
| |
| }
| |
| }
| |
| | |
| function licenseListViewer()
| |
| {
| |
| licenseListOriginal = document.getElementById('wpLicense');
| |
| if (licenseListOriginal != null) {
| |
| licenseListOriginal.onchange = function(){showLicenseInfo(licenseListOriginal[licenseListOriginal.selectedIndex].title);licenseListOriginal.selectedIndex=0;return false;}
| |
| | |
| // remove all old options
| |
| while (licenseListOriginal.options.length != 0) {
| |
| licenseListOriginal.options[0] = null;
| |
| }
| |
|
| |
| // fair use page
| |
| if (wgUserLanguage == 'fairuse') {
| |
| // create custom options
| |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "";
| |
| oOption.title = "disabled";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "אין לי מידע בקשר לרישיון";
| |
| oOption.title = "אין";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "------- שימוש הוגן -------";
| |
| oOption.title = "disabled";
| |
| oOption.disabled = "disabled";
| |
| oOption.style.color = "red";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "שימוש הוגן";
| |
| oOption.title = "שימוש הוגן";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "לוגו";
| |
| oOption.title = "לוגו";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "עטיפת ספר";
| |
| oOption.title = "עטיפת ספר";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "עטיפת אלבום";
| |
| oOption.title = "עטיפת אלבום";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "כרזת סרט, וידיאו או תקליטור";
| |
| oOption.title = "כרזת סרט, וידיאו או תקליטור";
| |
|
| |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "סריקה של ספר, עיתון או עצם אחר";
| |
| oOption.title = "סריקה של ספר, עיתון או עצם אחר";
| |
|
| |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "צילום מסך של אתר אינטרנט או תוכנה";
| |
| oOption.title = "צילום מסך של אתר אינטרנט או תוכנה";
| |
|
| |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "אין לי מידע בקשר לרישיון";
| |
| oOption.title = "אין";
| |
| } else { // normal upload page
| |
| // create custom options
| |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "";
| |
| oOption.title = "disabled";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "אין לי מידע בקשר לרישיון";
| |
| oOption.title = "אין";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "------- אני יצרתי... -------";
| |
| oOption.title = "disabled";
| |
| oOption.disabled = "disabled";
| |
| oOption.style.color = "red";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ואני דורש ייחוס ליוצר כולל הפצת נגזרות תחת רישיון זהה (דו־רישיוני: GFDL ו־CC-BY-SA-2.5 (כולל רישיונות ישנים 2.0 ו־1.0)";
| |
| oOption.title = "מולטי ייחוס ורישיון זהה";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ואני דורש ייחוס ליוצר כולל הפצת נגזרות תחת רישיון זהה (CC-BY-SA-2.5)";
| |
| oOption.title = "ייחוס ורישיון זהה עצמי";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ואני דורש ייחוס ליוצר (דו־רישיוני: GFDL ו־CC-BY-2.5)";
| |
| oOption.title = "מולטי ייחוס";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ואני דורש ייחוס ליוצר בלבד";
| |
| oOption.title = "ייחוס בלבד";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ואני מפיץ אותו תחת GFDL";
| |
| oOption.title = "self GFDL";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ואני משחרר אותו לרשות הציבור";
| |
| oOption.title = "רשות ציבור";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "------- לא אני יצרתי, אבל יוצר התמונה מרשה הפצה תחת: -------";
| |
| oOption.title = "disabled";
| |
| oOption.disabled = "disabled";
| |
| oOption.style.color = "red";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "GFDL";
| |
| oOption.title = "GFDL";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ייחוס ליוצר, הפצת נגזרות תחת רישיון זהה (CC-BY-SA-2.5)";
| |
| oOption.title = "ייחוס ורישיון זהה";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "ייחוס ליוצר (CC-BY-2.5)";
| |
| oOption.title = "ייחוס";
| |
| | |
| oOption = document.createElement("OPTION");
| |
| licenseListOriginal.options.add(oOption);
| |
| oOption.innerHTML = "אין לי מידע בקשר לרישיון";
| |
| oOption.title = "אין";
| |
| }
| |
|
| |
| //add the מידע template to description box
| |
| showLicenseInfo("infobox");
| |
| }
| |
| }
| |
| | |
| // סוף התאמה אישית של רשימת הרישיונות בדף העלאת קובץ
| |
| // =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
| |
| | |
| /* הסתרת הכותרת בעמוד הראשי; מבוסס על ויקי האנגלית. + הסתרת המילים "שונה לאחרונה" בתחתית העמוד. */
| |
| var mpTitle = "עמוד ראשי";
| |
| var isMainPage = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle);
| |
| var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1));
| |
| | |
| if (isMainPage && !isDiff)
| |
| {
| |
| document.write('<style type="text/css">/*<![CDATA[*/ #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
| |
| addOnloadHook( mainPageFixLastModified );
| |
| }
| |
| | |
| function mainPageFixLastModified() {
| |
| document.getElementById("Lastmodified").innerHTML = "דף זה מעודכן אוטומטית מדי יום.";
| |
| }
| |
| | |
| /* החלפת הלשונית ערך בלשונית "עמוד ראשי". לקוח מוויקיפדיה האנגלית. */
| |
| function mainPageRenameNamespaceTab() { | |
| try {
| |
| var Node = document.getElementById( 'ca-nstab-main' ).firstChild;
| |
| if ( Node.textContent ) { // Per DOM Level 3
| |
| Node.textContent = 'עמוד ראשי';
| |
| } else if ( Node.innerText ) { // IE doesn't handle .textContent
| |
| Node.innerText = 'עמוד ראשי';
| |
| } else { // Fallback
| |
| Node.replaceChild( Node.firstChild, document.createTextNode( 'עמוד ראשי' ) );
| |
| }
| |
| } catch(e) {
| |
| // bailing out!
| |
| }
| |
| }
| |
| if ( wgTitle == 'עמוד ראשי' && ( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) ) {
| |
| addOnloadHook( mainPageRenameNamespaceTab );
| |
| }
| |
| | |
| /* פונקציה שמשמשת לאיפשור ניקוד ב[[מדיה ויקי:edittools]] */
| |
| function nikud(){
| |
| if (document.getElementById('edit-templates')!=null){
| |
| for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
| |
| if(a.className == "nikud") {
| |
| a.onclick=function(){insertTags('', this.title, '');return false;};
| |
| }
| |
| }
| |
| }
| |
| }
| |
| | |
| | |
| //============================================================
| |
| //
| |
| // תווים מיוחדים
| |
| //
| |
| //============================================================
| |
| | |
| /**
| |
| * סקריפט מוויקיפדיה הצרפתית להוסף רשימת תווים מיוחדים
| |
| * הערה הסדר ברשימה להלן צריך להיות בהתאם למדיה ויקי:Edittools !
| |
| */
| |
| function addCharSubsetMenu() {
| |
| if (wgNamespaceNumber==3) return;
| |
| var specialchars = document.getElementById('specialcharsMenu');
| |
| if (specialchars) {
| |
| var menu = "<select style=\"float:left\" onChange=\"chooseCharSubset(selectedIndex)\">";
| |
| menu += "<option>תווים מיוחדים</option>";
| |
| menu += "<option>מתמטיקה</option>";
| |
| menu += "<option>IPA</option>";
| |
| menu += "<option>לטינית</option>";
| |
| menu += "<option>יוונית</option>";
| |
| menu += "<option>קירילית</option>";
| |
| menu += "<option>גרמנית</option>";
| |
| menu += "<option>ערבית</option>";
| |
| menu += "<option>קטלנית</option>";
| |
| menu += "<option>קרואטית</option>";
| |
| menu += "<option>ספרדית</option>";
| |
| menu += "<option>אספרנטו</option>";
| |
| menu += "<option>אסטונית</option>";
| |
| menu += "<option>ולשית</option>";
| |
| menu += "<option>הירוגליפי</option>";
| |
| menu += "<option>הולנדית</option>";
| |
| menu += "<option>הונגרית</option>";
| |
| menu += "<option>אירית</option>";
| |
| menu += "<option>איסלנדית</option>";
| |
| menu += "<option>איטלקית</option>";
| |
| menu += "<option>לטבית</option>";
| |
| menu += "<option>ליטאית</option>";
| |
| menu += "<option>מלטזית</option>";
| |
| menu += "<option>פולנית</option>";
| |
| menu += "<option>פורטוגזית</option>";
| |
| menu += "<option>רומנית</option>";
| |
| menu += "<option>סקנדינבית</option>";
| |
| menu += "<option>סרבית</option>";
| |
| menu += "<option>צ'כית</option>";
| |
| menu += "<option>טורקית</option>";
| |
| menu += "<option>אנגלית עתיקה</option>";
| |
| menu += "<option>וייטנאמית</option>";
| |
| menu += "</select>";
| |
| specialchars.innerHTML = menu + specialchars.innerHTML;
| |
| | |
| /* default subset - try to use a cookie some day */
| |
| // chooseCharSubset(0);
| |
| }
| |
| }
| |
| | |
| /* select subsection of special characters */
| |
| function chooseCharSubset(s) { | |
| var l = document.getElementById('specialchars').getElementsByTagName('p');
| |
| for (var i = 0; i < l.length ; i++) {
| |
| l[i].style.display = i == s ? 'inline' : 'none';
| |
| l[i].style.visibility = i == s ? 'visible' : 'hidden';
| |
| }
| |
| }
| |
| | |
| | |
| /* "Technical restrictions" title fix - Taken from en:MediaWiki:Common.js */
| |
| | |
| // For pages that have something like Template:Lowercase, replace the title, but only if it is cut-and-pasteable as a valid wikilink.
| |
| // (for instance iPod's title is updated. But [[C#]] is not an equivalent wikilink, so [[C Sharp]] doesn't have its main title changed)
| |
| //
| |
| // The function looks for a banner like this:
| |
| // <div id="RealTitleBanner"> <!-- div that gets hidden -->
| |
| // <span id="RealTitle">title</span>
| |
| // </div>
| |
| // An element with id=DisableRealTitle disables the function.
| |
| var disableRealTitle = 0; // users can disable this by making this true from their monobook.js
| |
| addOnloadHook(function() {
| |
| try {
| |
| var realTitleBanner = document.getElementById("RealTitleBanner");
| |
| if (realTitleBanner && !document.getElementById("DisableRealTitle") && !disableRealTitle) {
| |
| var realTitle = document.getElementById("RealTitle");
| |
| if (realTitle) {
| |
| var realTitleHTML = realTitle.innerHTML;
| |
| /* אם הכותרת לא כוללת אותיות בעברית ואם realTitleHTML מכיל dir, אז שנה את הכיווניות של הכותרת לשמאל->ימין */
| |
| if (realTitleHTML=='dir' && !document.getElementsByTagName('h1')[0].innerHTML.match(/[א-ת]/) && document.getElementsByTagName('h1')[0].className=='firstHeading'){
| |
| document.getElementsByTagName('h1')[0].innerHTML='<span dir=\"ltr\">'+document.getElementsByTagName('h1')[0].innerHTML+'</span>';
| |
| realTitleBanner.style.display = "none";
| |
| return;
| |
| }
| |
| realTitleText = pickUpText(realTitle);
| |
| | |
| var isPasteable = 0;
| |
| //var containsHTML = /</.test(realTitleHTML); // contains ANY HTML
| |
| var containsTooMuchHTML = /</.test( realTitleHTML.replace(/<\/?(sub|sup|small|big)>/gi, "") ); // contains HTML that will be ignored when cut-n-pasted as a wikilink
| |
| // calculate whether the title is pasteable
| |
| var verifyTitle = realTitleText.replace(/^ +/, ""); // trim left spaces
| |
| verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
| |
| | |
| // if the namespace prefix is there, remove it on our verification copy. If it isn't there, add it to the original realValue copy.
| |
| if (wgNamespaceNumber != 0) {
| |
| if (wgCanonicalNamespace == verifyTitle.substr(0, wgCanonicalNamespace.length).replace(/ /g, "_") && verifyTitle.charAt(wgCanonicalNamespace.length) == ":") {
| |
| verifyTitle = verifyTitle.substr(wgCanonicalNamespace.length + 1);
| |
| } else {
| |
| realTitleText = wgCanonicalNamespace.replace(/_/g, " ") + ":" + realTitleText;
| |
| realTitleHTML = wgCanonicalNamespace.replace(/_/g, " ") + ":" + realTitleHTML;
| |
| }
| |
| }
| |
| | |
| // verify whether wgTitle matches
| |
| verifyTitle = verifyTitle.replace(/^ +/, "").replace(/ +$/, ""); // trim left and right spaces
| |
| verifyTitle = verifyTitle.replace(/_/g, " "); // underscores to spaces
| |
| verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
| |
| isPasteable = (verifyTitle == wgTitle);
| |
| | |
| var h1 = document.getElementsByTagName("h1")[0];
| |
| if (h1 && isPasteable) {
| |
| h1.innerHTML = containsTooMuchHTML ? realTitleText : realTitleHTML;
| |
| if (!containsTooMuchHTML)
| |
| realTitleBanner.style.display = "none";
| |
| }
| |
| document.title = realTitleText + " - ויקיפדיה";
| |
| }
| |
| }
| |
| } catch (e) {
| |
| /* Something went wrong. */
| |
| }
| |
| });
| |
| | |
| | |
| // similar to innerHTML, but only returns the text portions of the insides, excludes HTML
| |
| function pickUpText(aParentElement) {
| |
| var str = "";
| |
| | |
| function pickUpTextInternal(aElement) {
| |
| var child = aElement.firstChild;
| |
| while (child) {
| |
| if (child.nodeType == 1) // ELEMENT_NODE
| |
| pickUpTextInternal(child);
| |
| else if (child.nodeType == 3) // TEXT_NODE
| |
| str += child.nodeValue;
| |
| | |
| child = child.nextSibling;
| |
| }
| |
| }
| |
| | |
| pickUpTextInternal(aParentElement);
| |
| | |
| return str;
| |
| }
| |
| | |
| /* קישור ישיר לדף שהפך להפניה בדף אישור ההעברה */
| |
| function EncodedMoveLink()
| |
| {
| |
| encodedLinkID = document.getElementById('encodedlink');
| |
| if (encodedLinkID != null) {
| |
| encodedLinkID.innerHTML = '(<a href="http://he.wikipedia.org/w/index.php?title=' + encodedLinkID.innerHTML + '&redirect=no" class="internal">קישור קבוע</a>)';
| |
| encodedLinkID.style.display = "inline";
| |
| }
| |
| }
| |
| | |
| /* לא מאפשר לאנונימיים לשמור את הדף לפני לחיצה על תצוגה מקדימה */
| |
| | |
| function noSaving() {
| |
| if (wgUserName == null && wgAction == 'edit') {
| |
| saveButton = document.getElementById('wpSave');
| |
| if (saveButton != null) {
| |
| saveButton.disabled = true;
| |
| if(document.getElementById('wpPreview')!=null) document.getElementById('wpPreview').value = 'הראה תצוגה מקדימה (חובה)';
| |
| }
| |
| }
| |
| }
| |
|
| |
| /** MediaWiki media player *******************************************************
| |
| *
| |
| * Description: A Java player for in-browser playback of media files.
| |
| * Created by: [[:commons:User:Gmaxwell]]
| |
| */
| |
| | |
| document.write('<script type="text/javascript" src="'
| |
| + 'http://he.wikipedia.org/w/index.php?title=Mediawiki:Wikimediaplayer.js'
| |
| + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
| |
| | |
| /*
| |
| * fix numbered lists in firefox
| |
| *
| |
| * written by Dekel [dekelb(at)(no-spam)gmail.com]
| |
| */
| |
| function fixOl()
| |
| {
| |
| if(clientPC.indexOf('firefox/') == -1) {
| |
| return;
| |
| }
| |
| var olList = document.getElementsByTagName('ol');
| |
| for(var i = 0; i < olList.length; ++i) {
| |
| var d = document.createElement('div');
| |
| d.setAttribute('style', 'margin-left: 2em; display: table;');
| |
| var o = document.createElement('ol');
| |
| o.innerHTML = olList[i].innerHTML;
| |
| olList[i].parentNode.insertBefore(d, olList[i]);
| |
| olList[i].parentNode.removeChild(olList[i]);
| |
| d.appendChild(o);
| |
| }
| |
| }
| |
| | |
| /* טעינת [[תבנית:דיון חדש במזנון]] לפני יצירת פסקה חדשה במזנון */
| |
| function miznon(){
| |
| if (wgPageName != 'ויקיפדיה:מזנון') return;
| |
| if(!document.getElementById('ca-addsection')) return;
| |
| document.getElementById('ca-addsection').getElementsByTagName('a')[0].href+='&editintro=%D7%AA%D7%91%D7%A0%D7%99%D7%AA:%D7%93%D7%99%D7%95%D7%9F_%D7%97%D7%93%D7%A9_%D7%91%D7%9E%D7%96%D7%A0%D7%95%D7%9F';
| |
| }
| |
| | |
| /* A helper function to add a button to one of the toolbars in the interface.
| |
|
| |
| Took it from [[:en:User:Omegatron/monobook.js/addlink.js]] */
| |
|
| |
| function addLink(where, url, name, id, title, key, after){
| |
| var na = document.createElement('a');
| |
| na.href = url;
| |
| na.appendChild(document.createTextNode(name));
| |
| var li = document.createElement('li');
| |
| if(id) li.id = id;
| |
| li.appendChild(na);
| |
| var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
| |
| if(after) {
| |
| tabs.insertBefore(li,document.getElementById(after));
| |
| } else {
| |
| tabs.appendChild(li);
| |
| }
| |
| if(id) {
| |
| if(key && title) { ta[id] = [key, title]; }
| |
| else if(key) { ta[id] = [key, '']; }
| |
| else if(title) { ta[id] = ['', title];}
| |
| }
| |
| // re-render the title and accesskeys from existing code in wikibits.js
| |
| akeytt();
| |
| return li;
| |
| } | |
| | |
| // From [[en:User:Lupin/autoedit.js]]
| |
| // Retrieve parameter value from the address bar link
| |
| //
| |
| function getParamValue(paramName) {
| |
| var cmdRe=RegExp('[&?]'+paramName+'=([^&]*)');
| |
| var h=document.location;
| |
| var m=cmdRe.exec(h);
| |
| if (m) {
| |
| try {
| |
| return decodeURIComponent(m[1]);
| |
| } catch (someError) {}
| |
| }
| |
| return null;
| |
| }
| |
| | |
| /* הגדרת הפונקציות לטעינה */
| |
| addLoadEvent(templatesList);
| |
| addLoadEvent(tableButton);
| |
| addLoadEvent(EncodedMoveLink);
| |
| addLoadEvent(licenseListViewer);
| |
| addLoadEvent(noSaving);
| |
| addOnloadHook(selectAllunDel);
| |
| addOnloadHook(featuredInterwiki);
| |
| addOnloadHook(createNavigationBarToggleButton);
| |
| addOnloadHook(addCharSubsetMenu);
| |
| addLoadEvent(nikud);
| |
| addOnloadHook(fixOl);
| |
| addOnloadHook(miznon);
| |
| | |
| //</source>
| |