diff options
Diffstat (limited to 'js/script_api.js')
-rw-r--r-- | js/script_api.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/script_api.js b/js/script_api.js new file mode 100644 index 0000000..afa5775 --- /dev/null +++ b/js/script_api.js @@ -0,0 +1,28 @@ +function windw(action, transition) { + var deferred = when.defer(); + setTimeout(function () { + deferred.resolve(action); + }, 100); + return deferred.promise; +} +var types = { + "ev": "event", + "evh": "event", + "ovl": "event", + "bg": "bgs", + "": "vfx" +} +// NOT iscene +function scene(type, name) { + if (typeof name == "undefined") name = type; + WARN("don't know extension, trying all"); + var bg = document.getElementById("bg"); + var img = "/" + types[type] + "/" + name; + bg.onerror = function () { + bg.onerror = function () { + bg.src = img + ".jpg"; + }; + bg.src = img + ".png"; + }; + bg.src = img + ".webp"; +} |