מדיה ויקי:Makor.js: הבדלים בין גרסאות בדף
קפיצה לניווט
קפיצה לחיפוש
Yeshivaorgil (שיחה | תרומות) מאין תקציר עריכה |
אין תקציר עריכה |
||
| (21 גרסאות ביניים של 3 משתמשים אינן מוצגות) | |||
| שורה 5: | שורה 5: | ||
function generateMakor( cat, book, per, pas, tex) { | function generateMakor( cat, book, per, pas, tex) { | ||
var code = ""; | var code = ""; | ||
if (book.substr(0,book.indexOf(" ")) != cat) | if (cat != "") | ||
code += cat + ":" + book + " " + per + " " + pas; | { | ||
if (book.substr(0,book.indexOf(" ")) != cat) | |||
code += cat + ":" + book + " " + per + " " + pas; | |||
else | |||
code += cat + ":" + book.substr(book.indexOf(" ")+1) + " " + per + " " + pas; | |||
} | |||
else | else | ||
code += | code += book + " " + per + " " + pas; | ||
if (tex) | if (tex) | ||
code += "$" + tex; | code += "$" + tex; | ||
insertTags( "{{מקור|", "}}", code ); | insertTags( "{{מקור|", "}}", code ); | ||
} | |||
function generateNewMakor(path,per,pas,tex){ | |||
var code = tex+"|"+path+"|"+per+"|"+pas; | |||
insertTags( "{{#makor-new:", "}}", code ); | |||
} | } | ||
| שורה 23: | שורה 32: | ||
function popupMakor() { | function popupMakor() { | ||
// var popup = window.open( "http://www.yeshiva.org.il/wiki/extensions/makor/makor.html", "popup", "height=510,width=500" ); | |||
var popup = window.open( "/wiki/extensions/makor/tree.php", "popup", "height=610,width=900" ); | |||
} | } | ||
| שורה 46: | שורה 55: | ||
} | } | ||
hookEvent("load", makorButton); | /*test*/ | ||
//hookEvent("load", makorButton); | |||
mw.hook('load').add(makorButton); | |||
גרסה אחרונה מ־09:54, 10 במאי 2022
|
|
/* כלי ליצירת מקורות המקושרים לפרוייקט השו"ת */
/* גרסה 1.0 נכתב ע"י Yeshivaorgil */
function generateMakor( cat, book, per, pas, tex) {
var code = "";
if (cat != "")
{
if (book.substr(0,book.indexOf(" ")) != cat)
code += cat + ":" + book + " " + per + " " + pas;
else
code += cat + ":" + book.substr(book.indexOf(" ")+1) + " " + per + " " + pas;
}
else
code += book + " " + per + " " + pas;
if (tex)
code += "$" + tex;
insertTags( "{{מקור|", "}}", code );
}
function generateNewMakor(path,per,pas,tex){
var code = tex+"|"+path+"|"+per+"|"+pas;
insertTags( "{{#makor-new:", "}}", code );
}
function calPer(hak)
{
a=hak*1;
a *= 0.27;
hak=Math.round((100*(a+1))/27);
return hak;
}
function popupMakor() {
// var popup = window.open( "http://www.yeshiva.org.il/wiki/extensions/makor/makor.html", "popup", "height=510,width=500" );
var popup = window.open( "/wiki/extensions/makor/tree.php", "popup", "height=610,width=900" );
}
/* הוספת כפתור מקורות לסרגל הכלים */
function makorButton()
{
if( document.getElementById("toolbar") )
{
var makorButton = document.createElement("img");
makorButton.width = 23;
makorButton.height = 22;
makorButton.src = "images/4/44/Button_makor.PNG";
makorButton.border = 0;
makorButton.alt = "הוספת מקור";
makorButton.title = "הוספת מקור";
makorButton.style.cursor = "pointer";
makorButton.onclick = popupMakor;
document.getElementById("toolbar").appendChild( makorButton );
}
}
/*test*/
//hookEvent("load", makorButton);
mw.hook('load').add(makorButton);