From 1b6cde4bf0b36872e227520944b0187e8121c7be Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 25 Apr 2018 11:58:24 +0200 Subject: [PATCH] Bump v0.1.3 --- dist/grapesjs-component-countdown.min.js | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/grapesjs-component-countdown.min.js b/dist/grapesjs-component-countdown.min.js index b7b0f3c..1c6563f 100644 --- a/dist/grapesjs-component-countdown.min.js +++ b/dist/grapesjs-component-countdown.min.js @@ -1,2 +1,2 @@ -/*! grapesjs-component-countdown - 0.1.2 */ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("grapesjs")):"function"==typeof define&&define.amd?define(["grapesjs"],n):"object"==typeof exports?exports["grapesjs-component-countdown"]=n(require("grapesjs")):e["grapesjs-component-countdown"]=n(e.grapesjs)}(this,function(e){return function(e){function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=1)}([function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.countdownRef="countdown"},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var a=t(2),d=o(a),s=t(3),l=o(s),r=t(4),i=o(r),c=t(0);n.default=d.default.plugins.add("gjs-component-countdown",function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n,o={blocks:[c.countdownRef],defaultStyle:!0,startTime:"",endText:"EXPIRED",dateInputType:"date",countdownClsPfx:"countdown",labelCountdown:"Countdown",labelCountdownCategory:"Extra",labelDays:"days",labelHours:"hours",labelMinutes:"minutes",labelSeconds:"seconds"};for(var a in o)a in t||(t[a]=o[a]);(0,l.default)(e,t),(0,i.default)(e,t)})},function(n,t){n.exports=e},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(e){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},t=n,a=e.DomComponents,d=a.getType("default"),s=a.getType("text"),l=d.model,r=d.view,i=(s.model,s.view,t.countdownClsPfx);a.addType("countdown",{model:l.extend({defaults:o({},l.prototype.defaults,{startfrom:t.startTime,endText:t.endText,droppable:!1,traits:[{label:"Start",name:"startfrom",changeProp:1,type:t.dateInputType},{label:"End text",name:"endText",changeProp:1}],script:function(){var e=new Date("{[ startfrom ]}").getTime(),n=this.querySelector("[data-js=countdown]"),t=this.querySelector("[data-js=countdown-endtext]"),o=this.querySelector("[data-js=countdown-day]"),a=this.querySelector("[data-js=countdown-hour]"),d=this.querySelector("[data-js=countdown-minute]"),s=this.querySelector("[data-js=countdown-second]"),l=this.gjs_countdown_interval;l&&l&&clearInterval(l);var r=function(e,n,t,l){o.innerHTML=e<10?"0"+e:e,a.innerHTML=n<10?"0"+n:n,d.innerHTML=t<10?"0"+t:t,s.innerHTML=l<10?"0"+l:l},i=function(){var o=(new Date).getTime(),a=e-o,d=Math.floor(a/864e5),s=Math.floor(a%864e5/36e5),l=Math.floor(a%36e4/6e4),i=Math.floor(a%6e4/1e3);r(d,s,l,i),a<0&&(clearInterval(c),t.innerHTML="{[ endText ]}",n.style.display="none",t.style.display="")};if(e){var c=setInterval(i,1e3);this.gjs_countdown_interval=c,t.style.display="none",n.style.display="",i()}else r(0,0,0,0)}})},{isComponent:function(e){if(e.getAttribute&&"countdown"==e.getAttribute("data-gjs-type"))return{type:"countdown"}}}),view:r.extend({init:function(){this.listenTo(this.model,"change:startfrom change:endText",this.updateScript);var e=this.model.get("components");e.length||(e.reset(),e.add('\n \n
\n
\n
'+t.labelDays+'
\n
\n
\n
\n
'+t.labelHours+'
\n
\n
\n
\n
'+t.labelMinutes+'
\n
\n
\n
\n
'+t.labelSeconds+'
\n
\n
\n \n '))}})})}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n,a=e.BlockManager,d=t.countdownClsPfx,s=t.defaultStyle?"":"";t.blocks.indexOf(o.countdownRef)>=0&&a.add(o.countdownRef,{label:t.labelCountdown,category:t.labelCountdownCategory,attributes:{class:"fa fa-clock-o"},content:'\n
\n '+s+"\n "})};var o=t(0)}])}); \ No newline at end of file +/*! grapesjs-component-countdown - 0.1.3 */ +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("grapesjs")):"function"==typeof define&&define.amd?define(["grapesjs"],n):"object"==typeof exports?exports["grapesjs-component-countdown"]=n(require("grapesjs")):e["grapesjs-component-countdown"]=n(e.grapesjs)}(this,function(e){return function(e){function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=1)}([function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.countdownRef="countdown"},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var a=t(2),d=o(a),s=t(3),l=o(s),r=t(4),i=o(r),c=t(0);n.default=d.default.plugins.add("gjs-component-countdown",function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n,o={blocks:[c.countdownRef],defaultStyle:!0,startTime:"",endText:"EXPIRED",dateInputType:"date",countdownClsPfx:"countdown",labelCountdown:"Countdown",labelCountdownCategory:"Extra",labelDays:"days",labelHours:"hours",labelMinutes:"minutes",labelSeconds:"seconds"};for(var a in o)a in t||(t[a]=o[a]);(0,l.default)(e,t),(0,i.default)(e,t)})},function(n,t){n.exports=e},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(e){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},t=n,a=e.DomComponents,d=a.getType("default"),s=a.getType("text"),l=d.model,r=d.view,i=(s.model,s.view,t.countdownClsPfx);a.addType("countdown",{model:l.extend({defaults:o({},l.prototype.defaults,{startfrom:t.startTime,endText:t.endText,droppable:!1,traits:[{label:"Start",name:"startfrom",changeProp:1,type:t.dateInputType},{label:"End text",name:"endText",changeProp:1}],script:function(){var e=new Date("{[ startfrom ]}").getTime(),n=this.querySelector("[data-js=countdown]"),t=this.querySelector("[data-js=countdown-endtext]"),o=this.querySelector("[data-js=countdown-day]"),a=this.querySelector("[data-js=countdown-hour]"),d=this.querySelector("[data-js=countdown-minute]"),s=this.querySelector("[data-js=countdown-second]"),l=this.gjs_countdown_interval;l&&l&&clearInterval(l);var r=function(e,n,t,l){o.innerHTML=e<10?"0"+e:e,a.innerHTML=n<10?"0"+n:n,d.innerHTML=t<10?"0"+t:t,s.innerHTML=l<10?"0"+l:l},i=function(){var o=(new Date).getTime(),a=e-o,d=Math.floor(a/864e5),s=Math.floor(a%864e5/36e5),l=Math.floor(a%36e5/6e4),i=Math.floor(a%6e4/1e3);r(d,s,l,i),a<0&&(clearInterval(c),t.innerHTML="{[ endText ]}",n.style.display="none",t.style.display="")};if(e){var c=setInterval(i,1e3);this.gjs_countdown_interval=c,t.style.display="none",n.style.display="",i()}else r(0,0,0,0)}})},{isComponent:function(e){if(e.getAttribute&&"countdown"==e.getAttribute("data-gjs-type"))return{type:"countdown"}}}),view:r.extend({init:function(){this.listenTo(this.model,"change:startfrom change:endText",this.updateScript);var e=this.model.get("components");e.length||(e.reset(),e.add('\n \n
\n
\n
'+t.labelDays+'
\n
\n
\n
\n
'+t.labelHours+'
\n
\n
\n
\n
'+t.labelMinutes+'
\n
\n
\n
\n
'+t.labelSeconds+'
\n
\n
\n \n '))}})})}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n,a=e.BlockManager,d=t.countdownClsPfx,s=t.defaultStyle?"":"";t.blocks.indexOf(o.countdownRef)>=0&&a.add(o.countdownRef,{label:t.labelCountdown,category:t.labelCountdownCategory,attributes:{class:"fa fa-clock-o"},content:'\n
\n '+s+"\n "})};var o=t(0)}])}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 013f5f2..fa1f07a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "grapesjs-component-countdown", - "version": "0.1.2", + "version": "0.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 19e87c7..1c035ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grapesjs-component-countdown", - "version": "0.1.2", + "version": "0.1.3", "description": "Simple countdown component for the GrapesJS Editor", "main": "dist/grapesjs-component-countdown.min.js", "scripts": {