From a1014a2a9e28c5121b051bc17ad4eb3cee170571 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 14 Aug 2017 23:19:48 +0200 Subject: [PATCH] Remove test newsletters as not usable anymore and add clear command --- demo-newsletter-editor.html | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/demo-newsletter-editor.html b/demo-newsletter-editor.html index 899e5705a..74ed35e11 100644 --- a/demo-newsletter-editor.html +++ b/demo-newsletter-editor.html @@ -608,9 +608,10 @@ var mdlClass = 'gjs-mdl-dialog-sm'; var pnm = editor.Panels; var cmdm = editor.Commands; + var md = editor.Modal; + /* var testContainer = document.getElementById("test-form"); var contentEl = testContainer.querySelector('input[name=body]'); - var md = editor.Modal; cmdm.add('send-test', { run(editor, sender) { sender.set('active', 0); @@ -640,7 +641,6 @@ }, }); - //fa fa-refresh var statusFormElC = document.querySelector('.form-status'); var statusFormEl = document.querySelector('.form-status i'); var ajaxTest = ajaxable(testContainer). @@ -661,6 +661,8 @@ statusFormElC.className = 'form-status text-danger'; } }); + */ + // Add info command var infoContainer = document.getElementById("info-cont"); cmdm.add('open-info', { @@ -678,6 +680,22 @@ }) } }); + pnm.addButton('options', { + id: 'clear-all', + className: 'fa fa-trash icon-blank', + attributes: {title: 'Empty canvas'}, + command: { + run: function(editor, sender) { + sender && sender.set('active', false); + if(confirm('Are you sure to clean the canvas?')){ + editor.DomComponents.clear(); + setTimeout(function(){ + localStorage.clear() + },0) + } + } + } + }); pnm.addButton('options', { id: 'view-info', className: 'fa fa-question-circle',