From b73879039c2c4bcb71f39611523abd2d1f4bcf18 Mon Sep 17 00:00:00 2001 From: Claudio-Emmolo <113107618+Claudio-Emmolo@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:07:11 +0200 Subject: [PATCH] widgetbay, add forceLink --- src/shortcodeList.js | 2 +- src/widgetbay.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/shortcodeList.js b/src/shortcodeList.js index b5ab52a..cb65ed3 100644 --- a/src/shortcodeList.js +++ b/src/shortcodeList.js @@ -34,7 +34,7 @@ tinymce.PluginManager.add('shortcodeList', function (editor, url) { }, { title: 'Widgetbay', - code: '[widgetbay id="optional" link="optional"]', + code: '[widgetbay id="optional" link="optional" forceLink="optional"]', description: 'Insert a widgetbay iframe. You can use the id or the link, but not both. You can use multiple links separated by a comma. - link="https://link1.com,https://link2.com' }, { diff --git a/src/widgetbay.js b/src/widgetbay.js index 1fc5796..7d0e9ee 100644 --- a/src/widgetbay.js +++ b/src/widgetbay.js @@ -26,13 +26,18 @@ tinymce.PluginManager.add('widgetbay', function (editor, url) { - - + Custom title (optional) + + Force Link (optional) + + It only works on single product + + Create @@ -133,8 +138,9 @@ function generateShortcode () { const parsedTitle = formData.get('widget-title') ? 'title="' + formData.get('widget-title') + '" ' : '' const parsedLink = link ? 'link="' + link + '" ' : ' ' const parsedId = formData.get('widget-id') ? 'id="' + formData.get('widget-id') + '"' : ' ' + const parsedForceLink = formData.get('widget-force-link') ? 'forceLink="' + formData.get('widget-force-link') + '" ' : ' ' - const content = '[widgetbay ' + parsedId + parsedLink + parsedTitle + ']' + const content = '[widgetbay ' + parsedId + parsedLink + parsedTitle + parsedForceLink + ']' tinymce.activeEditor.insertContent(content) tinymce.activeEditor.windowManager.close()
It only works on single product