Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alcor committed May 26, 2018
1 parent a03a33c commit 0aa1fee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

*.log
20 changes: 7 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
<html xmanifest="manifest.appcache">
<title>itty bitty</title>
<meta name="viewport" content="width=device-width">
<style type="text/css">
#edit { position:absolute; z-index:100;font-family:sans-serif;text-decoration:none;position:absolute;top:20px;right:20px; color:black; display:none; }
iframe { border:none;position:absolute;top:0;left:0;width:100%;height:100% }
</style>
<script type="text/javascript">
var hash = window.location.hash.substring(1)
if (hash.length) {
window.onload = function() {
if (hash.startsWith('!')) {
var link = document.getElementById('edit');
var editLink = "/edit#" + hash
link.onclick = function() {
location.href = editLink
}
link.style.display = "block";
var style = "PG1ldGEgY2hhcnNldD0idXRmLTgiPjxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgiPjxiYXNlIHRhcmdldD0iX3RvcCI+PHN0eWxlIHR5cGU9InRleHQvY3NzIj5ib2R5e21hcmdpbjowIGF1dG87cGFkZGluZzoxMnZtaW4gMTB2bWluO21heC13aWR0aDozNWVtO2xpbmUtaGVpZ2h0OjEuNWVtO2ZvbnQtZmFtaWx5OiAtYXBwbGUtc3lzdGVtLEJsaW5rTWFjU3lzdGVtRm9udCxzYW5zLXNlcmlmO3dvcmQtd3JhcDogYnJlYWstd29yZDt9PC9zdHlsZT4g"
hash = style + hash.substring(1)
link.onclick = function() { location.href = "/edit#" + hash }
link.style.display = "block";
var preamble = "PG1ldGEgY2hhcnNldD0idXRmLTgiPjxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgiPjxiYXNlIHRhcmdldD0iX3RvcCI+PHN0eWxlIHR5cGU9InRleHQvY3NzIj5ib2R5e21hcmdpbjowIGF1dG87cGFkZGluZzoxMnZtaW4gMTB2bWluO21heC13aWR0aDozNWVtO2xpbmUtaGVpZ2h0OjEuNWVtO2ZvbnQtZmFtaWx5OiAtYXBwbGUtc3lzdGVtLEJsaW5rTWFjU3lzdGVtRm9udCxzYW5zLXNlcmlmO3dvcmQtd3JhcDogYnJlYWstd29yZDt9PC9zdHlsZT4g"
hash = preamble + hash.substring(1)
}
if (!hash.startsWith("data:")) hash = 'data:text/html;charset=utf-8;base64,' + hash;
// location.href = hash
// location.href = hash // Redirect to data URI in supported browsers
var iframe = document.getElementById('iframe');
iframe.src = hash;
document.body.appendChild(iframe);
Expand All @@ -29,5 +22,6 @@
location.href = "/edit"
}
</script>
<iframe id="iframe"></iframe><button id="edit">Edit</button>
<iframe id="iframe" style="border:none;position:absolute;top:0;left:0;width:100%;height:100%"></iframe>
<button id="edit" style="position:absolute;z-index:100;position:absolute;top:20px;right:20px;display:none;">Edit</button>
</html>
2 changes: 1 addition & 1 deletion manifest.appcache
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ CACHE MANIFEST

CACHE:
/
/favicon.ico
/favicon.ico

0 comments on commit 0aa1fee

Please sign in to comment.