-
-
Save edfuh/1263289 to your computer and use it in GitHub Desktop.
portable text editor, copy and paste into address bar
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
data:text/html,<textarea contenteditable spellcheck=false ></textarea><button>Save</button><style>body{margin:0; padding:0;}textarea{background%3A%23666%3Bcolor%3A%230F0%3Bheight:100%;width:100%;line-height:1.3;font-size:14px;letter-spacing:1px;padding:10px;}button{position:absolute;color:black;right:20px;top:20px;border:1px solid grey;font-size:14px;padding:6px 14px;border-radius:8px;background%3A%239ECFF5%3B}</style><script>p = document.body.firstChild;p.focus();var val,tabs = 2,spaces = (function (s, t){while (--t) s += s;return s}(' ', tabs));p.onkeydown = function (e) {val = this.value;sstart = this.selectionStart;s = val.substr(0, sstart);n = val.substr(sstart);if (e.which === 9) {this.value = s + spaces + n;this.selectionStart = this.selectionEnd = sstart + tabs;return false;}};document.querySelector('button').onclick = function () {window.location = 'data:application/json,' + val;}</script> |
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
data:text/html, | |
<textarea contenteditable spellcheck=false ></textarea> | |
<button>Save</button> | |
<style> | |
body{margin:0;} | |
textarea{ | |
background%3A%23666%3B | |
color%3A%230F0%3B | |
height:100%; | |
width:100%; | |
line-height:1.3; | |
font-size:14px; | |
letter-spacing:1px; | |
padding:10px; | |
} | |
button{ | |
position:absolute; | |
color:black; | |
right:20px; | |
top:20px; | |
border:1px solid grey; | |
font-size:14px; | |
padding:6px 14px; | |
border-radius:8px; | |
background%3A%239ECFF5%3B | |
} | |
</style> | |
<script> | |
p = document.body.firstChild; | |
p.focus(); | |
var val, | |
tabs = 2, | |
spaces = (function (s, t){ | |
while (--t) s += s; | |
return s | |
}(' ', tabs)); | |
p.onkeydown = function (e) { | |
val = this.value; | |
sstart = this.selectionStart; | |
s = val.substr(0, sstart); | |
n = val.substr(sstart); | |
if (e.which === 9) { | |
this.value = s + spaces + n; | |
this.selectionStart = this.selectionEnd = sstart + tabs; | |
return false; | |
} | |
}; | |
document.querySelector('button').onclick = function () { | |
window.location = 'data:application/json;' + val; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tested in FF7 only.
ugly DHTML FTL