Browse Source

Update 'README.md'

master
Daniel 7 months ago
parent
commit
af4905e838
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      README.md

+ 1
- 2
README.md View File

@@ -1,4 +1,3 @@
# HtmlEdit

A JS editor bookmarklet I made for my school Chromebook
[drag](data:text/html,<!-- JS Version 0.1 - Nov 2019 - GNU Public License v3.0 --> <html> <head> <title>JSedit</title> </head> <body style='margin:0px; width: 100%; height: 100%; background: grey;'> <div class='toolbar'> <div class='button' onclick='popup("about")'><b>JSedit</b></div> <div class='button' onclick='preview()'>Exec</div> <div class='button' onclick='exportCode()'>Export</div> </div> <textarea onkeydown="if(event.keyCode===9){var v=elem.value,s=elem.selectionStart,e=elem.selectionEnd;elem.value=v.substring(0, s)+'\t'+v.substring(e);elem.selectionStart=elem.selectionEnd=s+1;return false;" id='code' class='code' placeholder='Enter text here...'></textarea> <style> .toolbar { width: 100%: height: 35px; background: grey; padding: 1.5px 1.5px; position: absolute; top: 0px; left: 0px; } .button { float: left; margin-right: 2px; border: 2px solid black; width:100px; height:31px; font-size:15px; background: grey; color: black; background: white; text-align: center; font-family: sans-serif; cursor: pointer; user-select: none; padding-top: 4px; box-sizing: border-box; } .button:active { background: lightgrey; } .code { position: absolute; bottom: 0px; left: 0px; color:white; background-color:rgb(45, 49, 66); font-size:19px; border:none; width:100%; height:calc(100% - 35px); resize:none; outline:none; } .popup { position: absolute; top: calc(50% - 200px); left: calc(50% - 200px); background: white; width: 400px; height: 400px; text-align: center; } </style> <script> function setText(text) { document.getElementById("code").value = text; } function preview() { window.open("javascript:try {" + document.getElementById("code").value + "} catch(e) {alert(e)}", "Hola", "width=500, height=500" ); } function exportCode() { prompt('Copy this as a bookmarklet', "javascript:setText(atob('" +btoa(document.getElementById("code").value) + "'))"); } window.onbeforeunload = function() { return "If you leave this page, you will lose any unsaved changes."; }; function popup(name) { var popup = document.createElement("DIV"); popup.className = "popup"; popup.innerHTML = ` <h1>JSedit</h1> <span>JSedit v0.1.0</span> <br> <span>View source at https://code.theres.life/PetabyteStudios/JSedit/raw/branch/master/bookmarklet</span> <br> <button onclick='this.parentElement.outerHTML = ""'>Close</button> `; document.body.appendChild(popup); } </script> </html>)
A JS editor bookmarklet I made for my school Chromebook

Loading…
Cancel
Save