Last Updated: February 25, 2016
·
249
· lambdax

Data url based silly note editor

data: text/html,<html ><head><title>Data Note</title></head><body><div id='container' contenteditable style='background:#eee;padding:30px;font-size:14pt;color:#888'/><script>body = document.querySelector('body');cont=document.querySelector('#container');window.addEventListener('keydown', function(e){if (e.keyIdentifier == 'U+0053' && e.ctrlKey ) {e.preventDefault();body.innerHTML = body.innerHTML + "<a href=\"data: text/html," + cont.innerHTML + "\">save Me</a>";}}); cont.innerHTML = 'Edit me and save by Ctrl+S'</script></body></html>