בדוקי עריכות אוטומטית, אינטערפעיס רעדאקטארן, אינטערפעיס אדמיניסטראַטאָרן, סיסאפן, מייבאים, מעדכנים, מייבא, אספקלריה רעדאקטארן
46,540
רעדאגירונגען
אין תקציר עריכה צייכן: צוריקגעשטעלט |
אין תקציר עריכה צייכן: אַנולירונג |
||
| שורה 33: | שורה 33: | ||
'במדבר': { english: 'Numbers', alHaTorah: 'Bemidbar' }, | 'במדבר': { english: 'Numbers', alHaTorah: 'Bemidbar' }, | ||
'דברים': { english: 'Deuteronomy', alHaTorah: 'Devarim' }, | 'דברים': { english: 'Deuteronomy', alHaTorah: 'Devarim' }, | ||
'יהושע': { english: 'Joshua', alHaTorah: 'Yehoshua' }, | |||
'שופטים': { english: 'Judges', alHaTorah: 'Shofetim' }, | 'שופטים': { english: 'Judges', alHaTorah: 'Shofetim' }, | ||
'שמואל א': { english: 'I_Samuel', alHaTorah: 'Shemuel_I' }, | 'שמואל א': { english: 'I_Samuel', alHaTorah: 'Shemuel_I' }, | ||
| שורה 69: | שורה 69: | ||
}; | }; | ||
// | // Iterate over each Tanakh citation link | ||
$('.tanach-citation').each(function () { | $('.tanach-citation').each(function () { | ||
var $link = $(this); | var $link = $(this); | ||
var sefer = $link.data('sefer'); | var sefer = $link.data('sefer'); | ||
var | var perekRaw = $link.data('perek'); | ||
var | var pasukRaw = $link.data('pasuk'); | ||
// Ensure the necessary data exists | // Ensure the necessary data exists | ||
if (!sefer || ! | if (!sefer || !perekRaw || !pasukRaw) return; | ||
// Map Hebrew book name to Sefaria's naming convention | // Map Hebrew book name to Sefaria's naming convention | ||
var sefariaNames = bookNameMapping[sefer]; | var sefariaNames = bookNameMapping[sefer]; | ||
if (sefariaNames) | if (!sefariaNames) return; | ||
var perek = hebrewNumeralToInt(perekRaw); | |||
var pasuk = hebrewNumeralToInt(pasukRaw); | |||
// Construct Sefaria URL | |||
var sefariaUrl = 'https://www.sefaria.org/' + encodeURIComponent(sefariaNames.english) + '.' + perek + '.' + pasuk; | |||
// Create a button to toggle the visibility of the icons | // Map Hebrew book name to AlHaTorah's naming convention | ||
var alHaTorahNames = bookNameMapping[sefer]; | |||
if (alHaTorahNames) { | |||
// Construct AlHaTorah URL | |||
var alHaTorahUrl = 'https://mg.alhatorah.org/Full/' + encodeURIComponent(alHaTorahNames.alHaTorah) + | |||
'/' + encodeURIComponent(perek) + | |||
'.' + encodeURIComponent(pasuk); | |||
// Construct Wikisource URL (Hebrew names and numbers as-is) | |||
var wikiSourceUrl = 'https://he.wikisource.org/wiki/' + | |||
'קטגוריה:' + encodeURIComponent(sefer + '_' + perek + '_' + pasuk); | |||
// Create a button to toggle the visibility of the icons | |||
var button = $('<button>') | |||
.text('Show Sources') | |||
.css({ | |||
'padding': '5px 10px', | |||
'background': '#4CAF50', | |||
'color': 'white', | |||
'border': 'none', | |||
'cursor': 'pointer', | |||
'border-radius': '5px', | |||
'margin-top': '5px' | |||
}); | |||
// Create the icon container (hidden initially) | |||
var iconContainer = $('<div>') | |||
.addClass('icon-container') | |||
.css('display', 'none') | |||
.append( | |||
$('<a>') | |||
.attr('href', sefariaUrl) | |||
.attr('target', '_blank') | |||
.attr('title', 'עפן אין ספריא') | |||
.html('<img src="' + sefariaFavicon + '" alt="Sefaria" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'), | |||
$('<a>') | |||
.attr('href', alHaTorahUrl) | |||
.attr('target', '_blank') | |||
.attr('title', 'עפן אין על התורה') | |||
.html('<img src="' + alHaTorahFavicon + '" alt="AlHaTorah" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">'), | |||
$('<a>') | |||
.attr('href', wikiSourceUrl) | |||
.attr('target', '_blank') | |||
.attr('title', 'עפן אין ויקיטקסט') | |||
.html('<img src="' + wikiSourceFavicon + '" alt="Wikisource" style="width:12px; height:12px; vertical-align:middle; margin-left: 3px;">') | |||
); | |||
// Add button and icon container after the link | |||
$link.after(button).after(iconContainer); | |||
// Toggle the visibility of the icons when the button is clicked | |||
button.click(function () { | |||
iconContainer.toggle(); | |||
}); | }); | ||
// Optionally, show the icons on hover | |||
$link.hover( | |||
function () { iconContainer.show(); }, // Show icons on hover | |||
function () { iconContainer.hide(); } // Hide icons when not hovering | |||
); | ); | ||
} | |||
} | |||
} | } | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
רעדאגירונגען