@liascript/exporter
Version:
A generic exporter for LiaScript
1 lines • 2.98 kB
JavaScript
!function(){function e(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var t=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;t.register("knzCS",(function(n,r){e(n.exports,"Connector",(function(){return c}));var o=t("hnmIs"),u=t("9Klpk"),i=t("3bWnf"),a=t("32Euv"),l=t("87lFe"),f=t("cRTHJ"),c=function(){"use strict";function e(){(0,u.default)(this,e)}return(0,i.default)(e,[{key:"hasIndex",value:function(){return!1}},{key:"storage",value:function(){return new l.LiaStorage}},{key:"initSettings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return f.Settings.init(e,t,this.setSettings)}},{key:"setSettings",value:function(e){f.Settings.update(e)}},{key:"getSettings",value:function(){var e="";try{e=localStorage.getItem(f.Settings.PORT)}catch(e){console.warn("cannot write to localStorage")}var t=null;if("string"==typeof e){try{t=JSON.parse(e)}catch(e){console.warn("getSettings =>",e)}t||(t=f.Settings.data),window.innerWidth<=768&&(t.table_of_contents=!1)}return t}},{key:"open",value:function(e,t,n){}},{key:"load",value:function(e){}},{key:"store",value:function(e){}},{key:"update",value:function(e,t){}},{key:"slide",value:function(e){}},{key:"getIndex",value:function(){}},{key:"deleteFromIndex",value:function(e){}},{key:"storeToIndex",value:function(e){return(0,o.default)((function(){return(0,a.__generator)(this,(function(e){return[2]}))}))()}},{key:"restoreFromIndex",value:function(e,t){}},{key:"reset",value:function(e,t){this.initSettings(null,!0)}},{key:"getFromIndex",value:function(e){return(0,o.default)((function(){return(0,a.__generator)(this,(function(e){return[2,null]}))}))()}},{key:"addMisc",value:function(e,t,n,r){return(0,o.default)((function(){return(0,a.__generator)(this,(function(e){return console.log("addMisc not implemented"),[2]}))}))()}},{key:"getMisc",value:function(e,t,n){return(0,o.default)((function(){return(0,a.__generator)(this,(function(e){return console.log("getMisc not implemented"),[2]}))}))()}}]),e}()})),t.register("87lFe",(function(n,r){e(n.exports,"LiaStorage",(function(){return a}));var o=t("9Klpk"),u=t("3bWnf"),i=t("5ENmm"),a=function(){"use strict";function e(){(0,o.default)(this,e)}return(0,u.default)(e,[{key:"getItems",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof e&&(e=[e]);for(var t={},n=0;n<e.length;n++){var r=localStorage.getItem(e[n]);t[e[n]]=r?JSON.parse(r):r}return t}},{key:"setItems",value:function(e){this._setLocal(e)}},{key:"_setLocal",value:function(e){var t=!0,n=!1,r=void 0;if("object"==typeof e)try{for(var o,u=Object.entries(e)[Symbol.iterator]();!(t=(o=u.next()).done);t=!0){var a=(0,i.default)(o.value,2),l=a[0],f=a[1];localStorage.setItem(l,JSON.stringify(f))}}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}]),e}()}))}();