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

קפיצה לניווט קפיצה לחיפוש
קיין רעדאגירונג באמערקונג
אין תקציר עריכה
צייכן: צוריקגעשטעלט
אין תקציר עריכה
צייכן: צוריקגעשטעלט
שורה 134: שורה 134:
// [[m:User:Jon Harald Søby/diffedit.js]]
// [[m:User:Jon Harald Søby/diffedit.js]]
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' );
document.querySelectorAll('sup.reference').forEach(ref => {
mw.loader.using('mediawiki.util', function() {
    // Look for the next sibling node
    $(document).ready(function() {
    let next = ref.nextSibling;
        document.querySelectorAll('sup.reference').forEach(ref => {
    while (next && next.nodeType === Node.TEXT_NODE && next.textContent.trim() === '') {
            let next = ref.nextSibling;
        next = next.nextSibling; // skip empty text nodes
            while (next && next.nodeType === Node.TEXT_NODE && next.textContent.trim() === '') {
    }
                next = next.nextSibling; // skip empty text nodes
    // If the next non-empty node is also a reference, add a comma
            }
    if (next && next.nodeType === Node.ELEMENT_NODE && next.classList.contains('reference')) {
            if (next && next.nodeType === Node.ELEMENT_NODE && next.classList.contains('reference')) {
        ref.insertAdjacentText('afterend', ', ');
                ref.insertAdjacentText('afterend', ', ');
     }
            }
        });
     });
});
});

נאוויגאציע מעניו