אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Common.js"

קיין רעדאגירונג באמערקונג
ק (הגהה, נאר פון וויקי)
אין תקציר עריכה
 
(2 צווישנדיגע ווערסיעס פונעם זעלבן באַניצער נישט געוויזן)
שורה 1: שורה 1:
/* אלע סקריפטן פון JavaScript דא געשריבן וועלן געלאדן ווערן פאר אלע באניצער ווען זיי לאדירן דעם בלאט */
/* אלע סקריפטן פון JavaScript דא געשריבן וועלן געלאדן ווערן פאר אלע באניצער ווען זיי לאדירן דעם בלאט */
// adds backlink to copied text
document.addEventListener('copy', function(event) {
    const selection = window.getSelection();
    if (!selection || selection.rangeCount === 0) return;
    const selectedText = selection.toString();
    if (selectedText.length > 150) {
        if (event.clipboardData) {
            const attribution = "\n\nפון המכלול: " + decodeURI(document.location.href);
            const combinedText = selectedText + attribution;
            event.clipboardData.setData('text/plain', combinedText);
            event.preventDefault();
        }
    }
});


// פונקציה לסקריפטים דו-לשוניים
// פונקציה לסקריפטים דו-לשוניים