לדלג לתוכן

מדיה ויקי:Common.js: הבדלים בין גרסאות בדף

מתוך ויקיטקסט, מאגר הטקסטים החופשי
תוכן שנמחק תוכן שנוסף
מ תיקון ם, והקטנת השהיה
הוספת מכפלת גימטריות - מתוך שיחת משתמש:קיפודנחש
שורה 920: שורה 920:
"use strict"
"use strict"
$(function() {
$(function() {
if ($('.gim-calc').length)
if ($('.gim-calc, .gim-product .gim-factor').length)
mw.loader.using('jquery.tipsy', function() {
mw.loader.using('jquery.tipsy', function() {
var gimvals = {'א': 1, 'ב': 2, 'ג': 3, 'ד': 4, 'ה': 5, 'ו': 6, 'ז': 7, 'ח': 8, 'ט': 9, 'י': 10, 'כ': 20, 'ך': 20, 'ל': 30, 'מ': 40, 'ם': 40, 'נ': 50, 'ן': 50, 'ס': 60, 'ע': 70, 'פ': 80, 'ף': 80, 'צ': 90, 'ץ': 90, 'ק': 100, 'ר': 200, 'ש': 300, 'ת': 400},
var gimvals = {'א': 1, 'ב': 2, 'ג': 3, 'ד': 4, 'ה': 5, 'ו': 6, 'ז': 7, 'ח': 8, 'ט': 9, 'י': 10, 'כ': 20, 'ך': 20, 'ל': 30, 'מ': 40, 'ם': 40, 'נ': 50, 'ן': 50, 'ס': 60, 'ע': 70, 'פ': 80, 'ף': 80, 'צ': 90, 'ץ': 90, 'ק': 100, 'ר': 200, 'ש': 300, 'ת': 400},
smallgimvals={'א':1,'ב':2,'ג':3,'ד':4,'ה':5,'ו':6,'ז':7,'ח':8,'ט':9,'י':1,'כ':2,'ך':2,'ל':3,'מ':4,'ם':4,
smallgimvals={'א':1,'ב':2,'ג':3,'ד':4,'ה':5,'ו':6,'ז':7,'ח':8,'ט':9,'י':1,'כ':2,'ך':2,'ל':3,'מ':4,'ם':4,
'נ':5,'ן':5,'ס':6,'ע':7,'פ':8,'ף':8,'צ':9,'ץ':9,'ק':1,'ר':2,'ש':3,'ת':4},
'נ':5,'ן':5,'ס':6,'ע':7,'פ':8,'ף':8,'צ':9,'ץ':9,'ק':1,'ר':2,'ש':3,'ת':4},
tipsyParams = {
tipsyParams = {
title: function() {
title: function() {
var t = $(this).text(),
function gimatria(str, small) {
trim_t = t.substr(0, 100) + (t.length > 100 ? '...' : ''),
var tar = str.split(''),
tar = t.split(''),
sum = 0;
sum = 0,
is_smallgim = $(this).hasClass('smallgim');
for (var ind in tar)
for (var ind in tar)
sum+=is_smallgim? (smallgimvals[tar[ind]]||0): (gimvals[tar[ind]]||0);
sum += (small ? (smallgimvals[tar[ind]] || 0) : (gimvals[tar[ind]] || 0));
return 'הערך של <p style="font-weight:bold; border: solid red 1px;">'+trim_t+'</p> בגימטריה'+(is_smallgim? ' קטנה': '')+' '+'הוא: '+sum;
return sum;
},
}
gravity: function() {
function trim(str) {
return str.substr(0, 100) + (str.length > 100 ? '...' : '');
}
var $this = $(this),
product = $this.hasClass('gim-factor'),
is_smallgim = $this.hasClass('smallgim');
if (product) {
var factors = $this.closest('.gim-product').find('.gim-factor'),
prod = 1,
desc = [],
glue = $('<span>').append($('<p>').text('בגימטריה כפול')).html();
factors.each(function() {
var t = $(this).text(),
p = $('<p>').css({fontWeight: 'bold', border: 'solid red 1px'}).text(t);
prod *= gimatria(t, false);
desc.push($('<span>').append(p).html());
});
return ('הערך של'
+ desc.join(glue)
+ 'בגימטריה הוא: '
+ prod
);
} else {
var str = $this.text();
return (
'הערך של <p style="font-weight:bold; border: solid red 1px;">'
+ trim(str)
+'</p> בגימטריה'
+(is_smallgim? ' קטנה ': ' ' )
+ 'הוא: '
+ gimatria(str, is_smallgim)
);
}
},
gravity: function() {
var loc =
var loc =
($(this).offset().top > ($(document).scrollTop() + $(window).height() - 120) ? 's' : 'n') +
($(this).offset().top > ($(document).scrollTop() + $(window).height() - 120) ? 's' : 'n') +
($(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? '' : 'w');
($(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? '' : 'w');
return loc;
return loc;
},
},
html: true,
html: true,
delayOut: 150,
delayOut: 150,
delayIn: 150,
delayIn: 150,
fade: true, opacity: 1,
fade: true, opacity: 1,
};
};
$('.gim-calc').tipsy(tipsyParams);
$('.gim-calc, .gim-product .gim-factor').tipsy(tipsyParams);
});
});
});
});

גרסה מ־08:49, 28 בנובמבר 2012

/* ערכו קובץ זה כדי להריץ סקריפטים ב־JavaScript באתר כולו. ערכו את [[מדיה ויקי:Monobook.js]] לסקריפטים שיופעלו ברקע מונובוק בלבד. */

// import scripts for Interwiki Transclusion from //wikisource.org/wiki/Wikisource:Shared_Scripts
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:InterWikiTransclusion.js&action=raw&ctype=text/javascript');

var talkNS = "שיחה"; // talk namespace


/** JSconfig *****
  * You can override these default in your [[Special:Mypage/monobook.js]]
  * templatesList gets the following parameter:
  * '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'
}

/* ייבוא סקריפטים */
importScript("Functions.js"); // פונקציות המצויות בשימוש בסקריפטים שונים
importScript("Edittoolbar.js"); // תוספות לסרגל העריכה
importScript("Hebrew.js"); // עברית וגימטריה
importScript("Templateslist.js"); // הצגת רשימת תבניות





 // ============================================================
 // BEGIN Dynamic Navigation Bars (experimantal)
 
 // set up the words in your language
 var NavigationBarHide = '[הסתר]';
 var NavigationBarShow = '[הראה]';
 
 // set up max count of Navigation Bars on page,
 // if there are more, all will be hidden
 // NavigationBarShowDefault = 0; // all bars will be hidden
 // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
 var NavigationBarShowDefault = 0;
 
 
 // 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');

 if (licenseAlertField) 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 isMainPage = (wgTitle == wgMainPageTitle);

var isDiff = !!mw.util.getParamValue('diff') || !!mw.util.getParamValue('oldid');

if (isMainPage && !isDiff) {
 if (wgNamespaceNumber != 1) { // don't hide main page talk title
  // הסתרת הכותרת בעמוד הראשי; מבוסס על ויקי האנגלית
  mw.util.addCSS('#siteSub, #contentSub, h1.firstHeading { display:none; }');

  // הסתרת המילים "שונה לאחרונה" בתחתית העמוד
  $(document).ready( mainPageFixLastModified );
 }

 if (skin == "vector") {
  document.getElementById('ca-nstab-main').firstChild.firstChild.innerHTML = wgMainPageTitle;
 }
 else {
  document.getElementById('ca-nstab-main').firstChild.innerHTML = wgMainPageTitle;
 }
}

function mainPageFixLastModified() {
    $("#Lastmodified").html("דף זה מעודכן אוטומטית מדי יום.");
}

/* פונקציה שמשמשת לאיפשור ניקוד ב[[מדיה ויקי: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
$(document).ready(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="//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]]
   */

 mw.loader.load('//he.wikipedia.org/w/index.php?title=Mediawiki:Wikimediaplayer.js&action=raw&ctype=text/javascript');

/*
 * 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;
                var attr;
                for ( var j = 0; j < olList[i].attributes.length; j++ ) {
                        attr = olList[i].attributes[j];
                        o.setAttribute( attr.nodeName, attr.nodeValue );
                }
                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;
}

/* סקריפט זמני לתקופת סקר הקוראים שגורם לקישור הסקר להיפתח בחלון חדש */
function popupsforanons(){
if(!document.getElementById('siteNotice')) return;
if(!document.getElementById('siteNotice').getElementsByTagName('a')[0]) return;
document.getElementById('siteNotice').getElementsByTagName('a')[0].target='_blank';
}

$(document).ready(popupsforanons);

function interwikiExtra() {
	// iterate over all <span>-elements
	for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
		// if found a linkInfo span
		if(a.className == "interwiki-info") {
			// iterate over all <li>-elements
			var count=0;
 
			for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
				if(b.className == "interwiki-" + a.id) {
					b.innerHTML = b.innerHTML + " "+a.title;
					if(a.title == "(vo)") {
						b.title = "Texte original";
					}
				}
				else if(b.className == "interwiki-" + a.id.substr(0,a.id.length-1)) {
					count = count+1;
					if(a.id.charAt(a.id.length-1) == count) {
						b.innerHTML = b.innerHTML + " "+a.title;
					}
				}
			}
		}
	}
}
 
$(document).ready(interwikiExtra);

/* הגדרת הפונקציות לטעינה */
$(document).ready(EncodedMoveLink);
$(document).ready(licenseListViewer);
$(document).ready(noSaving);
$(document).ready(selectAllunDel);
$(document).ready(createNavigationBarToggleButton);
$(document).ready(addCharSubsetMenu);
$(document).ready(nikud);
$(document).ready(fixOl);
$(document).ready(miznon);


//
// Popup script   [[User:ori229]]  july,2007   Used in [[תבנית:ב]]
// Show popups on specific words, when the mouse is placed on them
// Based on ideas from [[User:Lupin/popups.js]]
//
var t;
function Close()
{
	clearTimeout(t); 
	t=window.setTimeout('Hide()',500); // Hide after 0.5 second

	var all_span = document.getElementsByTagName("span");
	for (var i=0;i<all_span.length;i++)		{ 
		if (all_span[i].className == 'word_with_explain') { 
			all_span[i].style.borderBottom ="#aad 1px dotted"; // nice to have...
			 all_span[i].style.color =""; // nice to have...
		}
	}
}


function Hide() {
	var all_span=document.getElementsByTagName("span");
	for (var i=0;i<all_span.length;i++)		{ 
		if (all_span[i].className.match(/the_explain/)) {
			//Hide all of them
			//all_span[i].style.visibility='hidden';
			all_span[i].className='the_explain';
		}
	}
	listen_to_mouse_on();
}

function listen_to_mouse_on() {
	clearTimeout(t); // stop other timers that might call this func
	var all_span = document.getElementsByTagName("span");
	for (var i=0;i<all_span.length;i++)		{ 
		if (all_span[i].className == 'word_with_explain') { 
			all_span[i].onmousemove = mouse_on_explained_word;
		}
	}
}

function mouse_on_explained_word(e) {
	Hide(); // first of all - hide all other popups on the page
	this.onmousemove = null; // we don't want the popup to move after it was displayed
	clearTimeout(t); // stop other timers that might call this func
	t=window.setTimeout('listen_to_mouse_on()',1000); // only after 1 seconds

	this.style.borderBottom ="#ffffff 1px dotted"; // remove the dotted line below word. nice to have...
	 this.style.color ="#555555"; // Chagne to gray.   nice to have...

	var span_inside=this.getElementsByTagName("span");
	span_inside[0].className='the_explain_visible';
	//span_inside[0].style.visibility='visible';

	// window.setTimeout('Hide()',5000); // we hide only after mouseout

        // if(clientPC.indexOf('firefox/') == -1) { alert("This is not FF for sure"); }

	var e=(e)?e:event; // fix for IE
	var x, y;  	   // locating the popup below the cursor:
	if (e) {
		if (e.pageX) {
			x=e.pageX; y=e.pageY;
			x=x-60; y=y-120;  // fix the position (in FireFox and Chrome)
                        //alert("This is probably FF or Chrome");
			// span_inside[0].innerHTML="pageX x="+x+" y="+y;  // for debugging
		} else if (typeof e.clientX!='undefined') {
			var left, top, docElt = window.document.documentElement;

			if (docElt) { left=docElt.scrollLeft; }
			left = left || window.document.body.scrollLeft || window.document.scrollLeft || 0;

			if (docElt) { top=docElt.scrollTop; }
			top = top || window.document.body.scrollTop || window.document.scrollTop || 0;

			left = 0;  // ...I think it is better without it...
			x=e.clientX + left;
			y=e.clientY + top;
			x=x-70; y=y-130; // fix the position (in IE)
                        //alert("This is probably IE");
			// span_inside[0].innerHTML="left="+left+" top="+top + " x="+x+" y="+y;  // for debugging
		} else {
                        //alert("This is a strange browser");
			return;
		}
		span_inside[0].style.left = x+"px";
		span_inside[0].style.top  = y+"px";
	}
}
 
function explain_popup() { 
	var all_span = document.getElementsByTagName("span");
        // This loop takes time each page load, but there is no getElementsByClassName in JS.   :-(
	for (var i=0;i<all_span.length;i++)		{ 
		if (all_span[i].className == 'word_with_explain') {
			// listen to events on this object:
			all_span[i].onmousemove = mouse_on_explained_word;
			all_span[i].onmouseout  = Close;  // Hide after a second

			if (all_span[i].childNodes[0].title) // should return "true" on Firefox, "false" on IE
				all_span[i].childNodes[0].title = '';  // remove the title from words with links 
		}
	}
} 


$(document).ready(explain_popup);

// Dynamic layouts
if ( !self.ws_layouts ) {
 self.ws_layouts = {};
}
self.ws_layouts['Layout 1'] = {
   '#text-wrap':"", 
   '#text-container':"" , 
   '#text':"", 
   '.sidenote-right':"float:right;margin:0.5em;padding:3px;border:solid 1px gray;max-width:9em;text-indent:0em;text-align:left;",
   '.sidenote-left':"float:left;margin:0.5em;padding:3px;border:solid 1px gray;max-width:9em;text-indent:0em;text-align:left;",
   '.editsection':"display:none",
   '#headertemplate':"" 
};
self.ws_layouts['Layout 2'] = {
   '#text-wrap':"position:relative;margin-left:3em;margin-right:3em;", 
   '#text-container':"width:36em;margin:0px auto;font-family:Georgia,serif;" , 
   '#text':"text-align:justify;", 
   '.sidenote-right':"position:absolute; left:37em;width:16em;text-indent:0em;text-align:left;",
   '.sidenote-left':"position:absolute; right:37em;width:16em;text-indent:0em;text-align:right;",
   '.editsection':"display:none",
   '#headertemplate':"" 
};
self.ws_layouts['Layout 3'] = {
   '#text-wrap':"margin-left:3em",
   '#text-container':"position:relative; min-width:60em; float:left; width:100%; margin-right:-23em;" , 
   '#text':"text-align:justify;margin-right:23em; text-indent:0em; padding-left:0px; padding-right:0px;width:auto; position:relative;",
   '.sidenote-right':"position:absolute; right:-10em; width:9em; background-color:#eeeeee;text-indent:0em;text-align:left;",
   '.sidenote-left':"position:absolute; right:-10em; width:9em; background-color:#eeeeee;text-indent:0em;text-align:left;",
   '.editsection':"display:none",
   '#headertemplate':"position:absolute; top:0em; right:-23em; width:21em;float:right; text-align:left;" 
};



/* תבנית גימטריה - נכתבה ע"י קיפודנחש */
"use strict"
$(function() {
        if ($('.gim-calc, .gim-product .gim-factor').length) 
                mw.loader.using('jquery.tipsy', function() {
 
                        var gimvals = {'א': 1, 'ב': 2, 'ג': 3, 'ד': 4, 'ה': 5, 'ו': 6, 'ז': 7, 'ח': 8, 'ט': 9, 'י': 10, 'כ': 20, 'ך': 20, 'ל': 30, 'מ': 40, 'ם': 40, 'נ': 50, 'ן': 50, 'ס': 60, 'ע': 70, 'פ': 80, 'ף': 80, 'צ': 90, 'ץ': 90, 'ק': 100, 'ר': 200, 'ש': 300, 'ת': 400},
                        smallgimvals={'א':1,'ב':2,'ג':3,'ד':4,'ה':5,'ו':6,'ז':7,'ח':8,'ט':9,'י':1,'כ':2,'ך':2,'ל':3,'מ':4,'ם':4,
'נ':5,'ן':5,'ס':6,'ע':7,'פ':8,'ף':8,'צ':9,'ץ':9,'ק':1,'ר':2,'ש':3,'ת':4},
                        tipsyParams = {
                                title: function() {
                                        function gimatria(str, small) {
                                                var tar = str.split(''),
                                                        sum = 0;
                                                for (var ind in tar)
                                                        sum += (small ? (smallgimvals[tar[ind]] || 0) : (gimvals[tar[ind]] || 0));
                                                return sum;
                                        }
 
                                        function trim(str) {
                                                return str.substr(0, 100) + (str.length > 100 ? '...' : '');
                                        }
 
                                        var $this = $(this),
                                                product = $this.hasClass('gim-factor'),
                                                is_smallgim = $this.hasClass('smallgim');
 
                                        if (product) {
                                                var factors = $this.closest('.gim-product').find('.gim-factor'),
                                                        prod = 1,
                                                        desc = [],
                                                        glue = $('<span>').append($('<p>').text('בגימטריה כפול')).html();
                                                factors.each(function() {
                                                        var t = $(this).text(),
                                                                p = $('<p>').css({fontWeight: 'bold', border: 'solid red 1px'}).text(t);
                                                        prod *= gimatria(t, false);
                                                        desc.push($('<span>').append(p).html());
                                                });
                                                return ('הערך של' 
                                                        + desc.join(glue)
                                                        + 'בגימטריה הוא: ' 
                                                        + prod
                                                );
                                        } else {
                                                var str = $this.text();
                                                return (
                                                        'הערך של <p style="font-weight:bold; border: solid red 1px;">' 
                                                        + trim(str) 
                                                        +'</p> בגימטריה'
                                                        +(is_smallgim? ' קטנה ': ' ' ) 
                                                        + 'הוא: '
                                                        + gimatria(str, is_smallgim)
                                                );
                                        }
                                },
                                gravity: function() {
                                                var loc =
                                                                ($(this).offset().top > ($(document).scrollTop() + $(window).height() - 120) ? 's' : 'n') +
                                                                ($(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? '' : 'w');
                                                return loc;
                                },
                                html: true, 
                                delayOut: 150, 
                                delayIn: 150, 
                                fade: true, opacity: 1, 
                        };
                        $('.gim-calc, .gim-product .gim-factor').tipsy(tipsyParams);
                });
});