1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_OrcaSlide=require("./OrcaSlide"),_OrcaSlide2=_interopRequireDefault(_OrcaSlide);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var Config={arrowNext:"",arrowPrevious:"",autoPlay:!1,callbacks:[],contentItem:"",ctrlStop:"",ctrlPlay:"",jump:64,time:1,timeAutoPlay:2,isInfinite:!1,position:0,active:!1,swipeConfig:{direction:"",startX:0,startY:0,endX:0,endY:0,min_x:20,max_x:40,min_y:40,max_y:50}},initOrcaSlide=function(){function a(){_classCallCheck(this,a)}return _createClass(a,null,[{key:"buildOrcaStorage",value:function(a){localStorage.orcaslide||(localStorage.orcaslide="[]");var b=JSON.parse(localStorage.orcaslide);b.push(a),localStorage.orcaslide=JSON.stringify(b)}},{key:"config",set:function(a){console.log("demo9"),this.buildOrcaStorage(a),document.onreadystatechange=function(){if("complete"===document.readyState){var a=JSON.parse(localStorage.orcaslide);a.map(function(a){var b=JSON.stringify(Config),c=JSON.parse(b);return Object.assign(c,a),new _OrcaSlide2.default(c)}),delete localStorage.orcaslide}}}}]),a}();exports.default=initOrcaSlide; |