-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHypeDocumentLoader.min.js
More file actions
9 lines (9 loc) · 2.21 KB
/
Copy pathHypeDocumentLoader.min.js
File metadata and controls
9 lines (9 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
/*
Hype DocumentLoader 1.4.2
copyright (c) 2024 Max Ziebell, (https://maxziebell.de). MIT-license
*/
'use strict';!1==="HypeDocumentLoader"in window&&(window.HypeDocumentLoader=function(){function v(b,d,k){b.documentLoaderInfo=function(){return q[this.documentName()]};b.notifyEvent=function(a,c){return l(a,null,c,this)};b.notifyEventAdditivum=function(a,c,f){return l(a,f,c,this)}}function l(b,d,k,a){var c=window.HYPE_eventListeners;if(null!=c){for(var f,e=0;e<c.length;e++)if(c[e].type==b.type&&null!=c[e].callback){f=c[e].callback(a,k,b);if(!1===f)return!1;d&&(b[d]=f)}return f}}function r(b,d){d||
t(b);u("HYPE_"+b+"T",b);u("HYPE_"+b+"F",b)}function t(b){if(n){for(let d=750;800>=d;d++)d!=b&&(delete window["HYPE_"+d+"T"],delete window["HYPE_"+d+"F"]);n=!1}}function u(b,d){if(b){var k=function(){var a=arguments;a.length&&t(d);var c={documentName:a[0],mainContainerID:a[1],resources:a[2],resourcesFolderName:a[3],headAdditions:a[4],functions:a[5],sceneContainers:a[6],scenes:a[7],persistentSymbolDescendants:a[8],javascriptMapping:a[9],timingFunctions:a[10],loadingScreenFunction:a[11],hasPhysics:a[12],
drawSceneBackgrounds:a[13],initialSceneIndex:a[14],useGraphicsAcceleration:a[15],useCSSReset:a[16],useCSSPositioning:a[17],useWebAudioAPI:a[18],useTouchEvents:a[19]},f=JSON.parse(JSON.stringify(c));for(g in a[5])f.functions[g]=a[5][g];f.loadingScreenFunction=a[11];var e=l({type:"HypeDocumentData",data:f},"data");if("object"===typeof e){a=["hasPhysics","documentName","mainContainerID"];for(g in a)delete e[a[g]];a=Object.keys(c).map(function(h){return e[h]?(c[h]=e[h],e[h]):c[h]})}var m=new (Function.prototype.bind.apply(p[b],
[null].concat(Array.from(a))));v(m.API);var g={type:"HypeDocumentRender",render:function(){window.HYPE.documents[c.documentName]=m.API;m.z_o()},name:c.documentName,id:c.mainContainerID,data:c};q[a[0]]=c;return 0!=l(g)?m:{API:{},z_o:function(){}}};Object.defineProperty(window,b,{enumerable:!0,configurable:!0,get:function(){return p[b]?k:void 0},set:function(a){p[b]=a}})}else console.log("Hype DocumentLoader: Please provide a build")}let p={},q={},n=!0;(function(){if(n)for(let b=750;800>=b;b++)r(b,
!0)})();!1==="HYPE_eventListeners"in window&&(window.HYPE_eventListeners=[]);return{version:"1.4.2",setBuild:r}}());