בדוקי עריכות אוטומטית, אינטערפעיס רעדאקטארן, אינטערפעיס אדמיניסטראַטאָרן, סיסאפן, מייבאים, מעדכנים, מייבא, אספקלריה רעדאקטארן
46,538
רעדאגירונגען
אין תקציר עריכה |
אין תקציר עריכה צייכן: צוריקגעשטעלט |
||
| שורה 4: | שורה 4: | ||
var sefariaFavicon = 'https://www.sefaria.org/static/icons/favicon.ico'; | var sefariaFavicon = 'https://www.sefaria.org/static/icons/favicon.ico'; | ||
var alHaTorahFavicon = 'https://mg.alhatorah.org/favicon.ico'; | var alHaTorahFavicon = 'https://mg.alhatorah.org/favicon.ico'; | ||
var wikisourceFavicon = 'https://he.wikisource.org/favicon.ico'; | |||
// Define the mapping between | // Define the mapping between Sefaria and AlHaTorah book names | ||
const bookNameMapping = { | const bookNameMapping = { | ||
'Genesis': 'בראשית', | |||
'Exodus': 'שמות', | |||
'Leviticus': 'ויקרא', | |||
'Numbers': 'במדבר', | |||
'Deuteronomy': 'דברים', | |||
'Joshua': 'יהושע', | |||
'Judges': 'שופטים', | |||
' | 'Samuel I': 'שמואל א', | ||
' | 'Samuel II': 'שמואל ב', | ||
' | 'Kings I': 'מלכים א', | ||
' | 'Kings II': 'מלכים ב', | ||
'Isaiah': 'ישעיהו', | |||
'Jeremiah': 'ירמיהו', | |||
'Ezekiel': 'יחזקאל', | |||
'Hosea': 'הושע', | |||
'Joel': 'יואל', | |||
'Amos': 'עמוס', | |||
'Obadiah': 'עובדיה', | |||
'Jonah': 'יונה', | |||
'Micah': 'מיכה', | |||
'Nahum': 'נחום', | |||
'Habakkuk': 'חבקוק', | |||
'Zephaniah': 'צפניה', | |||
'Haggai': 'חגי', | |||
'Zechariah': 'זכריה', | |||
'Malachi': 'מלאכי', | |||
'Psalms': 'תהילים', | |||
'Proverbs': 'משלי', | |||
'Job': 'איוב', | |||
' | 'Song of Songs': 'שיר השירים', | ||
'Ruth': 'רות', | |||
'Lamentations': 'איכה', | |||
'Ecclesiastes': 'קהלת', | |||
'Esther': 'אסתר', | |||
'Daniel': 'דניאל', | |||
'Ezra': 'עזרא', | |||
'Nehemiah': 'נחמיה', | |||
'דברי הימים א' | 'Chronicles I': 'דברי הימים א', | ||
'Chronicles II': 'דברי הימים ב' | |||
}; | }; | ||
| שורה 65: | שורה 66: | ||
.attr('href', sefariaUrl) | .attr('href', sefariaUrl) | ||
.attr('target', '_blank') | .attr('target', '_blank') | ||
.attr('title', ' | .attr('title', 'View on Sefaria') | ||
.html('<img src="' + sefariaFavicon + '" alt="Sefaria" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'); | .html('<img src="' + sefariaFavicon + '" alt="Sefaria" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'); | ||
$link.after(sefariaIcon); | $link.after(sefariaIcon); | ||
// Map | // Map Sefaria book name to AlHaTorah's naming convention | ||
var | var alHaTorahSefer = bookNameMapping[sefer]; | ||
if ( | if (alHaTorahSefer) { | ||
// Construct AlHaTorah URL | // Construct AlHaTorah URL | ||
var alHaTorahUrl = 'https://mg.alhatorah.org/Full/' + encodeURIComponent( | var alHaTorahUrl = 'https://mg.alhatorah.org/Full/' + encodeURIComponent(alHaTorahSefer) + | ||
'/' + encodeURIComponent(perek) + | '/' + encodeURIComponent(perek) + | ||
'.' + encodeURIComponent(pasuk); | '.' + encodeURIComponent(pasuk); | ||
| שורה 81: | שורה 82: | ||
.attr('href', alHaTorahUrl) | .attr('href', alHaTorahUrl) | ||
.attr('target', '_blank') | .attr('target', '_blank') | ||
.attr('title', ' | .attr('title', 'View on AlHaTorah') | ||
.html('<img src="' + alHaTorahFavicon + '" alt="AlHaTorah" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'); | .html('<img src="' + alHaTorahFavicon + '" alt="AlHaTorah" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'); | ||
$link.after(alHaTorahIcon); | $link.after(alHaTorahIcon); | ||
} | |||
// Map Sefaria book name to Wikisource's naming convention | |||
var wikisourceSefer = bookNameMapping[sefer]; | |||
if (wikisourceSefer) { | |||
// Construct Wikisource URL | |||
var wikisourceUrl = 'https://he.wikisource.org/wiki/' + encodeURIComponent(wikisourceSefer) + | |||
'_' + encodeURIComponent(perek) + | |||
':' + encodeURIComponent(pasuk); | |||
// Create and append the Wikisource icon | |||
var wikisourceIcon = $('<a>') | |||
.attr('href', wikisourceUrl) | |||
.attr('target', '_blank') | |||
.attr('title', 'View on Wikisource') | |||
.html('<img src="' + wikisourceFavicon + '" alt="Wikisource" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'); | |||
$link.after(wikisourceIcon); | |||
} | } | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
רעדאגירונגען