-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathencode.html
More file actions
1 lines (1 loc) · 2.88 KB
/
encode.html
File metadata and controls
1 lines (1 loc) · 2.88 KB
1
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Konversi Kode HTML</title><style>*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;text-align:left}body{background-color:#222;padding:20px;font:normal normal 11px/1.2 Tahoma,Verdana,Arial,sans-serif;color:#888}p{margin:0 0 20px;overflow:hidden}p+p{text-align:center}p+p+p{text-align:inherit;margin:0}label{display:block;float:left;clear:both;cursor:pointer}textarea,code{font:inherit;font-family:"Courier New",Courier,"Nimbus Mono L",monospace}code{color:#BC587E}textarea{display:block;border:none;width:100%;height:200px;background-color:#292E34;padding:10px 12px;color:#8E9081;resize:vertical}textarea:focus{color:#93A1A1}button,button:active,button[disabled]:active{border:none;background-color:#5498C9;border-bottom:1px solid #4679A0;font:inherit;color:white;font-weight:bold;padding:7px 12px;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);-moz-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2);cursor:pointer}button:active{background-color:#468BC1;border-bottom-color:#396486}button::-moz-focus-inner{margin:0;padding:0;border:0;outline:none}button[disabled],button[disabled]:active{display:none}input{display:inline-block;margin:0 10px 0 0;vertical-align:middle;border:none;outline:none;cursor:inherit}@media (max-height:450px){textarea{resize:none}}</style></head><body><p><textarea spellcheck="false" placeholder="Tulis/paste kode di sini lalu klik ‘Konversi’"></textarea></p><p><button>Konversi</button> <button>Bersihkan</button></p><p><label><input type="checkbox" checked>Konversi <code>&</code> menjadi <code>&amp;</code></label><label><input type="checkbox" checked>Konversi <code><</code> menjadi <code>&lt;</code></label><label><input type="checkbox" checked>Konversi <code>></code> menjadi <code>&gt;</code></label><label><input type="checkbox">Konversi <code>"</code> menjadi <code>&quot;</code></label><label><input type="checkbox">Konversi <code>'</code> menjadi <code>&apos;</code></label></p><script>!function(t,e){var n="getElementsByTagName",a="replace",i=e[n]("button"),o=e[n]("input"),s=e[n]("textarea");i[0].onclick=function(){if(0===s[0].value.length)return alert("Eits, jangan ngelamun!"),!1;1===s[0].value.length&&alert("Pelit.");var t=s[0].value;return t=o[0].checked?t[a](/&/g,"&"):t,t=o[1].checked?t[a](/</g,"<"):t,t=o[2].checked?t[a](/>/g,">"):t,t=o[3].checked?t[a](/"/g,"""):t,t=o[4].checked?t[a](/'/g,"'"):t,s[0].value='<i rel="'+(t.length>40||-1!==t.indexOf("\n")?"code":"code")+'">'+t+"</i>",s[0].focus(),s[0].select(),this.disabled=!0,!1},i[1].onclick=function(){return s[0].value="",s[0].focus(),i[0].disabled=!1,!1},s[0].onpaste=function(){i[0].disabled=!1},s[0].onkeydown=function(){i[0].disabled=!1}}(window,document);</script></body></html>