Modification of https://github.com/artf/grapesjs-component-countdown.git
Simple promoclock component for GrapesJS Editor
- Plugin name:
gjs-component-promoclock
- Components:
promoclock
- Blocks:
promoclock
blocks
Which blocks to add, default:['promoclock']
(all)defaultStyle
Add default style to blocks, default: trueduration
promoClock durationcookie
Cookie name 'promoClockCookie'expires
Cookie validity in days shall be greater than promoClock duration '100'endText
Text to show when the promoclock is ended, default: 'EXPIRED'dateInputType
Date input type, eg, 'date', 'datetime-local', default: 'date'promoclockClsPfx
Promoclock class prefix, default: 'promoclock'labelPromoclock
Promoclock label, default 'Promoclock'labelPromoclockCategory
Promoclock category label, default 'Extra'labelDays
Days label text used in component, default 'days'labelHours
Hours label text used in component, default 'hours'labelMinutes
Minutes label text used in component, default 'minutes'labelSeconds
Seconds label text used in component, default 'seconds'
npm i grapesjs-component-promoclock
oryarn add grapesjs-component-promoclock
<link href="path/to/grapes.min.css" rel="stylesheet"/>
<script src="path/to/grapes.min.js"></script>
<script src="path/to/grapesjs-component-promoclock.min.js"></script>
<div id="gjs"></div>
<script type="text/javascript">
var editor = grapesjs.init({
container : '#gjs',
plugins: ['gjs-component-promoclock'],
pluginsOpts: {
'gjs-component-promoclock': {/* ...options */}
}
});
</script>
Clone the repository
$ git clone https://github.com/artf/grapesjs-component-promoclock.git
$ cd grapesjs-component-promoclock
Install it
$ npm i
Start the dev server
$ npm start
Build before the commit. This will also increase the patch level version of the package
$ npm run build
BSD 3-Clause