From bc5f5e82127aded58b863ba7619884d4f2413099 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 15 Feb 2024 16:40:18 +0100 Subject: [PATCH] merge openlink feature (#223) --- CHANGES | 12 ++++++++++++ lib/CallBackery.pm | 2 +- .../source/class/callbackery/ui/plugin/Action.js | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4384fd3..72b5d05 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +0.49.0 2024-01-09 09:45:14 +0100 Tobias Oetiker + + - add new action: openLink + + return { + action => 'openLink', + url => $url, + target => '_blank', + features => 'noopener,noreferrer' + } + + 0.48.1 2023-12-01 17:32:03 +0100 Tobias Oetiker - use CB_CFG_ as prefix ... this makes more sense than CM_CB diff --git a/lib/CallBackery.pm b/lib/CallBackery.pm index 7d1c6a6..c7a86ef 100644 --- a/lib/CallBackery.pm +++ b/lib/CallBackery.pm @@ -37,7 +37,7 @@ use CallBackery::Plugin::Doc; use CallBackery::Database; use CallBackery::User; -our $VERSION = '0.48.2'; +our $VERSION = '0.49.0'; =head2 config diff --git a/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/plugin/Action.js b/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/plugin/Action.js index 0ab5fe3..1b77a3a 100644 --- a/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/plugin/Action.js +++ b/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/plugin/Action.js @@ -76,6 +76,15 @@ qx.Class.define("callbackery.ui.plugin.Action", { case 'print': this._print(data.content); break; + case 'openLink': + const link = document.createElement('a'); + link.href = data.url; + link.target = data.target || '_blank'; + link.rel = data.rel || 'noopener noreferrer'; + document.body.appendChild(link); + link.click(); + link.remove(); + break; case 'reloadStatus': case 'reload': break;