-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataurl.txt
More file actions
1 lines (1 loc) · 2.62 KB
/
Copy pathdataurl.txt
File metadata and controls
1 lines (1 loc) · 2.62 KB
1
data:text/html,<html style%3D"background-color%3Ablack%3B">%0A<style>button%7Bborder%3Anone%3Bbackground-color%3Ablack%3Bcolor%3Awhite%3B%7D</style>%0A<div contenteditable%3D"true" id%3D"main" spellcheck%3D"false" style%3D"border%3A 5px solid black%3Bfont-family%3Amonospace%3B width%3A 100%25%3B height%3A 100%25%3Boutline%3A none%3Bbackground-color%3A%23000%3Bcolor%3A00FF00%3B" autofocus></div>%0A<title>HTML</title>%0A<script src%3D"https%3A//cdnjs.cloudflare.com/ajax/libs/ace/1.4.13/ace.js"></script>%0A<script src%3D"https%3A//cdnjs.cloudflare.com/ajax/libs/ace/1.4.13/ext-language_tools.min.js"></script>%0A<script>%0A var editor %3D ace.edit%28"main"%29%3B%0A editor.setTheme%28"ace/theme/ambiance"%29%3B%0A editor.session.setMode%28"ace/mode/html"%29%3B%0A editor.setOptions%28%7B%0A enableBasicAutocompletion%3A true%2C%0A enableLiveAutocompletion%3A true%0A %7D%29%3B%0A function run%28%29%7B%0A let blob %3D new Blob%28%5Beditor.getValue%28%29%5D%2C %7Btype%3A %27text/html%27%7D%29%3B%0A var n %3D window.URL.createObjectURL%28blob%29%3B%0A window.open%28n%29%3B%0A window.URL.revokeObjectURL%28n%29%0A %7D%0A function save%28%29%7B%0A window.open%28%29.document.write%28%27data%3Atext/html%2C%27 + escape%28editor.getValue%28%29%29%29%3B%0A %7D%0A function save64%28%29%7B%0A window.open%28%29.document.write%28%27data%3Atext/html%3Bbase64%2C%27 + btoa%28editor.getValue%28%29%29%29%3B%0A %7D%0A function savefile%28%29%7B%0A let link %3D document.createElement%28%27a%27%29%3B%0A var name %3D prompt%28%27What do want the file to be called%3F%28include file format%27%29%3B%0A link.download %3D name%3B%0A let blob %3D new Blob%28%5Beditor.getValue%28%29%5D%2C %7Btype%3A %27text/html%27%7D%29%3B%0A link.href %3D window.URL.createObjectURL%28blob%29%3B%0A link.click%28%29%3B%0A window.URL.revokeObjectURL%28link.href%29%3B%0A %7D%0A</script>%0A<button onclick%3D"run%28%29">Run</button>%0A<button onclick%3D"save%28%29">Save</button>%0A<button onclick%3D"save64%28%29">Save as base64</button>%0A<button onclick%3D"savefile%28%29">Save as file</button>%0A<button onclick%3D"editor.setValue%28unescape%28prompt%28%27Paste here%27%29.substring%2815%29%29%29%3B">Import From Data Url</button>%0A<button onclick%3D"editor.setValue%28unescape%28atob%28prompt%28%27Paste here%27%29.substring%2822%29%29%29%29%3B">Import From Base64 Data Url</button>%0A<script>%0Awindow.addEventListener%28%27beforeunload%27%2C function%28e%29%7B%0A e.preventDefault%28%29%3B%0A e.returnValue %3D %27%27%3B%0A%7D%29%3B%0A</script></html>