From ce4331e224b30fa95a3d3cce5e8b78cdc4016f57 Mon Sep 17 00:00:00 2001 From: Andrius Pratusis Date: Sun, 25 Feb 2018 20:33:07 +0200 Subject: [PATCH] Add files via upload --- .../tinymce/plugins/paypal/plugin.min.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bl-plugins/tinymce/tinymce/plugins/paypal/plugin.min.js b/bl-plugins/tinymce/tinymce/plugins/paypal/plugin.min.js index 393c784e..c8a696d7 100644 --- a/bl-plugins/tinymce/tinymce/plugins/paypal/plugin.min.js +++ b/bl-plugins/tinymce/tinymce/plugins/paypal/plugin.min.js @@ -8,17 +8,29 @@ tinymce.PluginManager.add('paypal', function(editor, url) { editor.windowManager.open({ title: 'Paypal Bludit plugin', body: [ - {type: 'textbox', name: 'email', label: 'Your Paypal email'}, - {type: 'textbox', name: 'title', label: 'Title'}, + // If you and only you will use this plugin comment out email and currency rows below. Define e.data.email and e.data.currency variable in onsubmit method + {type: 'textbox', name: 'email', label: 'Your Paypal email'}, + {type: 'textbox', name: 'title', label: 'Title'}, {type: 'textbox', name: 'price', label: 'Price'}, {type: 'textbox', name: 'currency', label: 'Currency'}, + {type: 'textbox', name: 'description', label: 'Short description'}, {type: 'textbox', name: 'url', label: 'Redirect to url after payment'} ], onsubmit: function(e) { // Insert content when the window form is submitted - - var button="
"; + if(e.data.email!=="" && e.data.title!=="" && e.data.price!=="" && e.data.currency!=="" && e.data.url!=="" && e.data.description!==""){ + var button=""; + editor.insertContent("

Product: "+e.data.title+"


"); + editor.insertContent("

Description: "+e.data.description+"


"); + editor.insertContent("

Price: "+e.data.price+""+e.data.currency+"


"); editor.insertContent(button); + change; + } + + else{ + alert("Error: You must fill in all of the fields :("); + } + } }); }