Created
May 2, 2012 11:51
-
-
Save renehuber/2576050 to your computer and use it in GitHub Desktop.
Evernote Note Link Bookmarklet
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
/* Evernote Link Bookmarklet V. 1.0 | |
Rene Huber, 2012 | |
www.prosinus.ch | |
While displaying a note in the Evernote webclient, the bookmarklet extracts a link which can be embedded in other notes. | |
*/ | |
// Load jQuery | |
if (typeof jQuery == 'undefined') { | |
var jQ = document.createElement('script'); | |
jQ.type = 'text/javascript'; | |
jQ.onload=runthis; | |
jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; | |
document.body.appendChild(jQ); | |
} | |
$(function() { | |
var linkBaseUrl = 'evernote:///view/29738/s1/'; | |
var currUrl = window.location.href; | |
if (currUrl.indexOf('n=') < 0) { | |
alert('Page\'s url is not a known Evernote address.'); | |
} | |
var guid = currUrl.split('n=')[1]; | |
guid = (guid.indexOf('&')>0) ? guid.substring(0, guid.indexOf('&')) : guid; | |
var noteLink = '<a href="' + linkBaseUrl + guid + '/' +guid + '/">' + $('#gwt-debug-noteTitle').text() + '</a>'; | |
//alert(guid); | |
$('<div>', { | |
html: noteLink | |
}).css({ | |
position: 'absolute', | |
'z-index': 9999, | |
top: '18px', | |
right: '20px', | |
height: '22px', | |
overflow: 'auto', | |
padding: '14px', | |
border: '5px solid white', | |
background: '#C8DFC4', | |
color: 'white', | |
'text-align': 'right', | |
'user-select': 'text', | |
'-webkit-user-select': 'text' | |
}).appendTo('body').dblclick(function(){ | |
$(this).remove(); | |
}).click(function() { | |
$(this).focus(); | |
document.execCommand('SelectAll'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment