אונטערשייד צווישן ווערסיעס פון "באַניצער:תנא קמא/tanachLinks.js"

פון המכלול
קפיצה לניווט קפיצה לחיפוש
אין תקציר עריכה
אין תקציר עריכה
שורה 1: שורה 1:
mw.hook('wikipage.content').add(function($content) {
$(document).ready(function() {
     console.log("Tanach Citation Script Running"); // Debugging message
     console.log("Tanach Citation Script Running"); // Debugging message
     $content.find(".tanach-citation").each(function() {
     $(".tanach-citation").each(function() {
         var $this = $(this);
         var $this = $(this);
         console.log("Found citation:", $this.text()); // Debugging each found citation
         console.log("Found citation:", $this.text()); // Debugging each found citation

רעוויזיע פון 23:27, 3 אפריל 2025

$(document).ready(function() {
    console.log("Tanach Citation Script Running"); // Debugging message
    $(".tanach-citation").each(function() {
        var $this = $(this);
        console.log("Found citation:", $this.text()); // Debugging each found citation

        var sefer = $this.data("sefer");
        var perek = $this.data("perek");
        var pasuk = $this.data("pasuk") || 1;

        console.log("Extracted:", sefer, perek, pasuk); // Debugging extracted values

        var sefariaUrl = `https://www.sefaria.org/${encodeURIComponent(sefer)}.${perek}.${pasuk}`;
        var iconHtml = `<a href="${sefariaUrl}" target="_blank" title="View on Sefaria">
            <img src="https://www.sefaria.org/static/img/favicon.ico" style="width: 16px; height: 16px; vertical-align: middle;" />
        </a>`;

        $this.append(' ' + iconHtml); // Append icon to the citation
    });
});