From d889d9931f362b3ef513abf1145945c7585c5872 Mon Sep 17 00:00:00 2001 From: Max Ziebell <1752114+worldoptimizer@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:59:13 +0200 Subject: [PATCH] v1.0.4 --- HypeReactiveContent.min.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HypeReactiveContent.min.js b/HypeReactiveContent.min.js index ddfe0a1..aaac621 100644 --- a/HypeReactiveContent.min.js +++ b/HypeReactiveContent.min.js @@ -1,8 +1,8 @@ /* - Hype Reactive Content 1.0.3 + Hype Reactive Content 1.0.4 copyright (c) 2022 Max Ziebell, (https://maxziebell.de). MIT-license */ -!1==="HypeReactiveContent"in window&&(window.HypeReactiveContent=function(){function h(a,e){return new Proxy(a,{get:function(c,b,d){c=Reflect.get(c,b,d);return"object"===typeof c?h(c,e):c},set:function(c,b,d,f){var g=Reflect.set(c,b,d,f);e(b,d,c,f);return g},has:function(c,b,d){return"hypeDocument"==b?!1:c.hasOwnProperty(b)||window[b]?Reflect.has(c,b,d):!0}})}function k(a){return function(){if(!a.timeout){var e=arguments;a.timeout=requestAnimationFrame(function(){a.apply(this,e);a.timeout=null}.bind(this))}}} -!1==="HYPE_eventListeners"in window&&(window.HYPE_eventListeners=[]);window.HYPE_eventListeners.push({type:"HypeDocumentLoad",callback:function(a,e,c){a.updateContent=function(b,d){b&&d&&a.triggerCustomBehaviorNamed(b+" equals "+("string"===typeof d?'"'+d+'"':d));b&&a.triggerCustomBehaviorNamed(b+" was updated");document.getElementById(a.currentSceneId()).querySelectorAll("[data-content], [data-visibility]").forEach(function(f){var g=f.getAttribute("data-content");g&&(f.innerHTML=a.runCode(g,!0)|| -"");if(g=f.getAttribute("data-visibility"))f.style.visibility=a.runCode(g,!0)?"visible":"hidden"})};a.runCode=function(b,d){try{return d&&(b="return "+b),(new Function("hypeDocument","customData","with(customData){ "+b+"}"))(a,a.customData)}catch(f){console.error(f)}};a.customData=h(a.customData,k(a.updateContent));a.functions().HypeReactiveContent&&a.functions().HypeReactiveContent(a,e,c)}});window.HYPE_eventListeners.push({type:"HypeTriggerCustomBehavior",callback:function(a,e,c){e=c.customBehaviorName; -/[;=()]/.test(e)&&a.runCode(e)}});window.HYPE_eventListeners.push({type:"HypeScenePrepareForDisplay",callback:function(a,e,c){a.updateContent()}});return{version:"1.0.3"}}()); +!1==="HypeReactiveContent"in window&&(window.HypeReactiveContent=function(){function h(a,e){return new Proxy(a,{get:function(c,b,d){c=Reflect.get(c,b,d);return"object"===typeof c?h(c,e):c},set:function(c,b,d,f){var g=Reflect.set(c,b,d,f);e(b,d,c,f);return g},has:function(c,b,d){return"hypeDocument"==b?!1:c.hasOwnProperty(b)||window[b]?Reflect.has(c,b,d):!0}})}function l(a){return function(){if(!a.timeout){var e=arguments;a.timeout=requestAnimationFrame(function(){a.apply(this,e);a.timeout=null}.bind(this))}}} +!1==="HYPE_eventListeners"in window&&(window.HYPE_eventListeners=[]);window.HYPE_eventListeners.push({type:"HypeDocumentLoad",callback:function(a,e,c){a.updateContent=function(b,d){void 0!==b&&void 0!==d&&a.triggerCustomBehaviorNamed(b+" equals "+("string"===typeof d?'"'+d+'"':d));void 0!==b&&a.triggerCustomBehaviorNamed(b+" was updated");document.getElementById(a.currentSceneId()).querySelectorAll("[data-content], [data-visibility]").forEach(function(f){var g=f.getAttribute("data-content"),k=a.runCode(g, +!0);g&&(f.innerHTML=void 0!==k?k:"");if(g=f.getAttribute("data-visibility"))f.style.visibility=a.runCode(g,!0)?"visible":"hidden"})};a.runCode=function(b,d){try{return d&&(b="return "+b),(new Function("hypeDocument","customData","with(customData){ "+b+"}"))(a,a.customData)}catch(f){console.error(f)}};a.customData=h(a.customData,l(a.updateContent));a.functions().HypeReactiveContent&&a.functions().HypeReactiveContent(a,e,c)}});window.HYPE_eventListeners.push({type:"HypeTriggerCustomBehavior",callback:function(a, +e,c){e=c.customBehaviorName;/[;=()]/.test(e)&&a.runCode(e)}});window.HYPE_eventListeners.push({type:"HypeScenePrepareForDisplay",callback:function(a,e,c){a.updateContent()}});return{version:"1.0.4"}}());