Skip to content

Instantly share code, notes, and snippets.

@legodude17
Last active November 15, 2016 19:42
Show Gist options
  • Save legodude17/0881902922ca653653b851ee8ee97fc5 to your computer and use it in GitHub Desktop.
Save legodude17/0881902922ca653653b851ee8ee97fc5 to your computer and use it in GitHub Desktop.
A set of bookmarklets
<div class='container'>
Bookmarklets:
Simply click and drag the link to your bookmarks bar.
<ul class='list'>
<li><a href="javascript:document.body.contentEditable='true'; document.designMode='on'; void 0">Edit</a></li>
<li><a href="javascript:document.body.contentEditable='false'; document.designMode='off'; void 0">Unedit</a></li>
<li><a href="javascript:(function(){var a = prompt('What file?');var b=document.createElement('script');b.src=a;document.body.appendChild(b);}())">Add scripts</a></li>
<li><a href="javascript:(function () {
function getSelectionText() {
var text = '';
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type !== 'Control') {
text = document.selection.createRange().text;
}
return text;
}
var a = document.createElement('a');
a.href = 'javascript:' + getSelectionText();
document.body.appendChild(a);
}());">Selected text</a></li>
<li><a href="javascript:document.querySelector('.ace_text-input').select();setTimeout(function(){document.execCommand('copy');alert('Copied!', 'Your text has been copied');},100);">Editey Copy</a></li>
<li><a href="javascript:open('http://code.colegannon.com/htmlTester#'+ace.edit('gwt-uid-1').getValue());">Test Editey</a></li>
<li><a href="javascript:open('http://code.colegannon.com/htmlTester#'+prompt('What code?'));">Test Code</a></li>
</ul>
</div>
<style>
.container {
background-color: cyan;
font-family: cursive;
font-size: 50px
}
.list {
font-size: .5em;
}
li {
margin-bottom: 10px;
}
</style>
@legodude17
Copy link
Author

legodude17 commented Nov 15, 2016

This has been moved to my website. This one will no longer be updated. http://legodude17.github.io/bookmarklets.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment