diff --git a/.gitignore b/.gitignore index 9b1fed9..5b987b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.log *.DS_Store package-lock.json +node_modules \ No newline at end of file diff --git a/build-index.sh b/build-index.sh new file mode 100755 index 0000000..f8e0a82 --- /dev/null +++ b/build-index.sh @@ -0,0 +1,9 @@ +#! /bin/bash +cd public +terser data.js > data-min.js + +cd index.src +terser index.js > index-min.js +uglifycss index.css > index-min.css + +awk '$1 == "@include"{system("cat " $2); next} 1' index.html > ../index.html diff --git a/favicon.png b/favicon.png deleted file mode 100644 index 8e0569b..0000000 Binary files a/favicon.png and /dev/null differ diff --git a/firebase.json b/firebase.json index f8ab8c7..17518c7 100644 --- a/firebase.json +++ b/firebase.json @@ -1,6 +1,6 @@ { "hosting": { - "public": ".", + "public": "public", "ignore": [ "firebase.json", "**/.*", @@ -9,7 +9,8 @@ "src/**", "LICENSE", "**.md", - "**/.git/**" + "**/.git/**", + "**.sh" ], "rewrites": [ { diff --git a/index.html.src/README.md b/index.html.src/README.md deleted file mode 100644 index 2e4e719..0000000 --- a/index.html.src/README.md +++ /dev/null @@ -1 +0,0 @@ -Source files for the js/css in index.html diff --git a/index.html.src/index.min.css b/index.html.src/index.min.css deleted file mode 100644 index fa29945..0000000 --- a/index.html.src/index.min.css +++ /dev/null @@ -1 +0,0 @@ -body{font-family:sans-serif}#iframe{border:none;height:100%;left:0;top:0;width:100%}#edit,#iframe{position:absolute}#edit{color:rgba(0,0,0,.54);display:none;font-family:monospace;font-weight:700;right:1em;top:.85em;z-index:100}#edit:not(:hover){text-decoration:none}#warning{background-color:#feecc2;border-radius:4px;font-size:16px;left:50vw;margin-left:-10em;padding:1em;position:absolute;top:10vh;width:20em;z-index:100}#warning:empty{display:none}body.toasting #edit,body.toasting #iframe{opacity:.5;pointer-events:none}body.toasting #toast{background-color:#feecc2;border-radius:4px;box-sizing:border-box;font-size:13px;left:50%;margin-left:-160px;max-width:320px;padding:1em;position:absolute;top:10px;z-index:101}body.toasting #warning,body:not(.toasting) #toast{display:none} \ No newline at end of file diff --git a/index.html.src/index.sh b/index.html.src/index.sh deleted file mode 100755 index 1728906..0000000 --- a/index.html.src/index.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash -terser index.js > index.min.js -terser ../data.js > data.min.js -postcss index.css > index.min.css \ No newline at end of file diff --git a/index.html.src/postcss.config.js b/index.html.src/postcss.config.js deleted file mode 100644 index ffb2269..0000000 --- a/index.html.src/postcss.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - plugins: [ - require('cssnano')({ - preset: 'default', - }), - ], -}; diff --git a/base.css b/public/base.css similarity index 100% rename from base.css rename to public/base.css diff --git a/index.html.src/data.min.js b/public/data-min.js similarity index 100% rename from index.html.src/data.min.js rename to public/data-min.js diff --git a/data.js b/public/data.js similarity index 100% rename from data.js rename to public/data.js diff --git a/edit.css b/public/edit.css similarity index 100% rename from edit.css rename to public/edit.css diff --git a/edit.html b/public/edit.html similarity index 100% rename from edit.html rename to public/edit.html diff --git a/edit.js b/public/edit.js similarity index 100% rename from edit.js rename to public/edit.js diff --git a/favicon.ico b/public/favicon.ico similarity index 100% rename from favicon.ico rename to public/favicon.ico diff --git a/index.html b/public/index.html similarity index 93% rename from index.html rename to public/index.html index 4e8586f..6a68708 100644 --- a/index.html +++ b/public/index.html @@ -4,7 +4,9 @@ var e=function(){"use strict";function r(e,r){postMessage({action:nr,cbn:r,resul var BASE64_MARKER=";base64,";var LZMA64_MARKER=";bxze64,";function compressDataURI(dataURI,callback){var base64Index=dataURI.indexOf(BASE64_MARKER);var base64=dataURI.substring(base64Index+BASE64_MARKER.length);stringToZip(base64ToByteArray(base64),function(result){callback(dataURI.substring(0,base64Index)+LZMA64_MARKER+result)})}function base64ToByteArray(base64){var raw=window.atob(base64);var rawLength=raw.length;var array=new Uint8Array(new ArrayBuffer(rawLength));for(i=0;i0){var base64=dataURI.substring(base64Index+LZMA64_MARKER.length);zipToString(base64,function(result){stringToData(result,function(data){if(!data)return callback(undefined);callback(dataURI.substring(0,base64Index)+BASE64_MARKER+(preamble||"")+data.split(",")[1])})})}else{callback(dataURI)}}function zipToString(data,callback){var array=base64ToByteArray(data);LZMA.decompress(array,function(result,error){if(!(typeof result==="string"))result=new Uint8Array(result);if(error)console.error(error);callback(result)})}function stringToData(string,callback){if(!string.length)return callback("");var a=new FileReader;a.onload=function(e){callback(e.target.result.replace())};a.readAsDataURL(new Blob([string],{encoding:"UTF-8",type:"text/html;charset=UTF-8"}))}function dataToString(data,callback){var blob=dataURItoBlob(data);var reader=new FileReader;reader.onload=function(e){callback(reader.result)};reader.readAsText(blob)}function dataURItoBlob(dataURI){var byteString=atob(dataURI.split(",")[1]);var mimeString=dataURI.split(",")[0].split(":")[1].split(";")[0];var arrayBuffer=new ArrayBuffer(byteString.length);var _ia=new Uint8Array(arrayBuffer);for(var i=0;i0&&colon<15){document.body.classList.remove("toasting");return window.location.replace(hash)}var compressed=true;preamble=HEAD_TAGS_EXTENDED;hash="data:text/html;charset=utf-8;"+(compressed?"bxze64,":"base64,")+hash}else if(hash.indexOf("data:text/html;")==0){preamble=HEAD_TAGS}link.onclick=function(){location.href="/edit"+location.hash};var isIE=navigator.userAgent.match(/rv:11/);var isEdge=navigator.userAgent.match(/Edge\//);if((isEdge||isIE)&&location.href.length==2083){document.getElementById("warning").innerHTML='Edge only supports shorter URLs (maximum 2083 bytes).
Larger sites may require a different browser.
Learn more'}decompressDataURI(hash,preamble,function(hash){if(!hash)return;iframe.sandbox="allow-scripts allow-forms allow-top-navigation allow-popups allow-modals allow-popups-to-escape-sandbox";if(!isIE){if(hash)iframe.src=hash}else{dataToString(hash,function(content){var doc=iframe.contentWindow.document;doc.open();doc.write(content);doc.close()})}});var link=document.getElementById("edit");link.href="/edit"+location.hash;link.style.display=editable?"block":"none"}}; - +
itty.bitty is experimental technology that renders linked content from outside sources. Learn more.

This content is only as trustworthy as its source, and it should be treated with the caution @@ -13,4 +15,4 @@ you would show any insecure web page.
edit - \ No newline at end of file + diff --git a/public/index.src/index-min.css b/public/index.src/index-min.css new file mode 100644 index 0000000..a5b1624 --- /dev/null +++ b/public/index.src/index-min.css @@ -0,0 +1 @@ +body{font-family:sans-serif}#iframe{border:0;position:absolute;top:0;left:0;width:100%;height:100%}#edit{font-family:monospace;font-weight:bold;color:rgba(0,0,0,0.54);position:absolute;z-index:100;position:absolute;top:.85em;right:1em;display:none}#edit:not(:hover){text-decoration:none}#warning{position:absolute;border-radius:4px;background-color:#feecc2;padding:1em;font-size:16px;width:20em;z-index:100;top:10vh;left:50vw;margin-left:-10em}#warning:empty{display:none}body.toasting #iframe,body.toasting #edit{opacity:.5;pointer-events:none}body.toasting #toast{box-sizing:border-box;background-color:#feecc2;border-radius:4px;font-size:13px;left:50%;top:10px;margin-left:-160px;padding:1em;position:absolute;max-width:320px;z-index:101}body:not(.toasting) #toast,body.toasting #warning{display:none} diff --git a/index.html.src/index.min.js b/public/index.src/index-min.js similarity index 100% rename from index.html.src/index.min.js rename to public/index.src/index-min.js diff --git a/index.html.src/index.css b/public/index.src/index.css similarity index 100% rename from index.html.src/index.css rename to public/index.src/index.css diff --git a/public/index.src/index.html b/public/index.src/index.html new file mode 100644 index 0000000..001b43d --- /dev/null +++ b/public/index.src/index.html @@ -0,0 +1,19 @@ + + + + +
itty.bitty is experimental technology that renders linked content from outside sources. Learn more. +

This content is only as trustworthy as its source, and it should be treated with the caution +you would show any insecure web page. +

+ +
+edit + \ No newline at end of file diff --git a/index.html.src/index.js b/public/index.src/index.js similarity index 100% rename from index.html.src/index.js rename to public/index.src/index.js diff --git a/jquery-3.3.1.min.js b/public/jquery-3.3.1.min.js similarity index 100% rename from jquery-3.3.1.min.js rename to public/jquery-3.3.1.min.js diff --git a/lzma/LICENSE b/public/lzma/LICENSE similarity index 100% rename from lzma/LICENSE rename to public/lzma/LICENSE diff --git a/lzma/lzma-d-min.js b/public/lzma/lzma-d-min.js similarity index 100% rename from lzma/lzma-d-min.js rename to public/lzma/lzma-d-min.js diff --git a/lzma/lzma_worker-min.js b/public/lzma/lzma_worker-min.js similarity index 100% rename from lzma/lzma_worker-min.js rename to public/lzma/lzma_worker-min.js diff --git a/manifest.appcache b/public/manifest.appcache similarity index 75% rename from manifest.appcache rename to public/manifest.appcache index 689b7f0..fa2ee48 100644 --- a/manifest.appcache +++ b/public/manifest.appcache @@ -1,2 +1,2 @@ CACHE MANIFEST -# v23 \ No newline at end of file +# v24 \ No newline at end of file