בדוקי עריכות אוטומטית, אינטערפעיס רעדאקטארן, אינטערפעיס אדמיניסטראַטאָרן, סיסאפן, מייבאים, מעדכנים, מייבא, אספקלריה רעדאקטארן
46,726
רעדאגירונגען
קאין תקציר עריכה |
אין תקציר עריכה |
||
| (איין צווישנדיגע ווערסיע פונעם זעלבן באַניצער נישט געוויזן) | |||
| שורה 3: | שורה 3: | ||
// adds backlink to copied text | // adds backlink to copied text | ||
document.addEventListener('copy', function(event) { | document.addEventListener('copy', function(event) { | ||
if (mw.config.get('wgUserName') !== null) { | |||
return; | |||
} | |||
if (mw.config.get('wgAction') !== 'view') { | |||
return; | |||
} | |||
const selection = window.getSelection(); | const selection = window.getSelection(); | ||
if (!selection || selection.rangeCount === 0) return; | if (!selection || selection.rangeCount === 0) return; | ||
| שורה 8: | שורה 14: | ||
if (selectedText.length > 150) { | if (selectedText.length > 150) { | ||
if (event.clipboardData) { | if (event.clipboardData) { | ||
const attribution = "\n\nפון המכלול: " + | const decodedUrl = decodeURI(document.location.href); | ||
const attribution = "\n\nפון המכלול: " + decodedUrl; | |||
const combinedText = selectedText + attribution; | const combinedText = selectedText + attribution; | ||
event.clipboardData.setData('text/plain', combinedText); | event.clipboardData.setData('text/plain', combinedText); | ||
רעדאגירונגען