-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHypeImageBaseEncoder.min.js
More file actions
6 lines (6 loc) · 923 Bytes
/
HypeImageBaseEncoder.min.js
File metadata and controls
6 lines (6 loc) · 923 Bytes
1
2
3
4
5
6
/*
Hype ImageBaseEncoder.
copyright (c) 2018 Max Ziebell, (https://maxziebell.de). MIT-license
*/
!1==="HypeImageBaseEncoder"in window&&(window.HypeImageBaseEncoder=function(){var f=["jpg","jpeg","svg","png"],d=!0,e={},g=function(c,d){var a=new XMLHttpRequest;a.onload=function(){var b=new FileReader;b.onloadend=function(){d(b.result)};b.readAsDataURL(a.response)};a.open("GET",c);a.responseType="blob";a.send()};!1==="HYPE_eventListeners"in window&&(window.HYPE_eventListeners=[]);window.HYPE_eventListeners.push({type:"HypeResourceLoad",callback:function(c,h,a){var b=a.url.toLowerCase().split("/").pop();
c=b.split(".").pop();if(-1<f.indexOf(c)&&(0==a.url.indexOf("http://127.0.0.1:")&&d&&!e[b]&&(e[b]=!0,g(a.url,function(a){console.log("\x3c!-- "+b+' --\x3e\n<script>window["Inline-'+b+'"]="'+a+'";\x3c/script>')})),window["Inline-"+b]))return window["Inline-"+b]}});return{localConsoleOutput:function(c){d=!!c}}}());