Created
August 19, 2020 08:15
-
-
Save jackysee/923aaa1c87d229b328eefee835bbf5a7 to your computer and use it in GitHub Desktop.
extract note as citation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var c = document.querySelector('.e-content').innerHTML; | |
var a = document.querySelector('.u-url'); | |
var w = window.open('', '', 'width=400,height=200'); | |
w.document.write(`<textarea style="width:90vw;height:80vh"><p><cite class="h-cite">Note on <a class="u-url" href="${a.href}">${a.innerText}</a></cite></p><blockquote>${c.trim()}</blockquote></textarea>`); | |
var t = w.document.querySelector('textarea'); | |
t.addEventListener('click', function(){ t.select(); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment