Created
March 1, 2011 05:42
-
-
Save taizooo/848680 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
CopyTitleAndURL(); | |
function CopyTitleAndURL(){ | |
const EOL = "\r\n"; | |
var unescapeHTML = function(s){ | |
s = s.replace(/\&/g, "&"); | |
s = s.replace(/</g, "<"); | |
s = s.replace(/>/g, ">"); | |
s = s.replace(/"/g, """); | |
// s = s.replace(/\'/g, "'"); | |
// s = s.replace(/\\/g, "\"); | |
return s; | |
} | |
var docTitle = window.content.document.title; | |
var docURL = window.content.document.location.href; | |
var docQuote = unescapeHTML(document.getSelection()); | |
_jsaCScript.setClipBoardString( | |
docURL + EOL + | |
EOL + | |
'<blockquote>' + EOL + | |
docQuote + | |
EOL + | |
'</blockquote>' | |
); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment