Користувачка:JTs/Букмарклети

Матеріал з Вікіцитат
Перейти до навігації Перейти до пошуку
Виноска Genius

javascript: function sel () {if (window.getSelection) {return window.getSelection();} else if (document.getSelection) {return document.getSelection();} else if (document.selection) {return document.selection.createRange().text;}} var s = sel(); var now = new Date(); var thisYear = now.getFullYear(); var thisMonth = now.getMonth(); var thisDay = now.getDate(); var base_window = window; var server = base_window.location.hostname.replace(/www./g, ''); var copy_window = window.open(); copy_window.document.write('<textarea style="width:100%;height:250px"><ref>{{cite web|url= '+base_window.location+'\n|title='+base_window.document.title+'\n|publisher=Genius|accessdate='+thisYear+'-'+thisMonth+'-'+thisDay+'}}</ref></textarea>');

Виноска повний title сторінки

javascript: function sel () {if (window.getSelection) {return window.getSelection();} else if (document.getSelection) {return document.getSelection();} else if (document.selection) {return document.selection.createRange().text;}} var s = sel(); var now = new Date(); var thisYear = now.getFullYear(); var thisMonth = now.getMonth(); var thisDay = now.getDate(); var base_window = window; var server = base_window.location.hostname.replace(/www./g, ''); var copy_window = window.open(); copy_window.document.write('<textarea style="width:100%;height:250px"><ref>{{cite web|url= '+base_window.location+'\n|title='+base_window.document.title+'\n|publisher=Genius|accessdate='+thisYear+'-'+thisMonth+'-'+thisDay+'}}</ref></textarea>');

Повний шаблон для англомовних цитат (виділення заноситься в Оригінал)

javascript: function sel () {if (window.getSelection) {return window.getSelection();} else if (document.getSelection) {return document.getSelection();} else if (document.selection) {return document.selection.createRange().text;}} var s = sel(); var now = new Date(); var thisYear = now.getFullYear(); var thisMonth = now.getMonth(); var thisDay = now.getDate(); var ttl= base_window.document.title.substring(0, base_window.document.title.indexOf("|") ); var base_window = window; var server = base_window.location.hostname.replace(/www./g, ''); var copy_window = window.open(); copy_window.document.write('<textarea style="width:100%;height:250px">* {{q|Цитата= <ref>{{cite web|url= '+base_window.location+'\n|title='+ttl+'\n|publisher=Genius|accessdate='+thisYear+'-'+thisMonth+'-'+thisDay+'}}</ref>|Оригінал='+(s != "" ? s : base_window.document.title)+'|Коментар=«'+ttl.replace('Muse – ','').replace('Lyrics','').trim()+'»}}</textarea>');