From 61ae8efd7a16ffd9bcdd1cbcb0d61f80cca83133 Mon Sep 17 00:00:00 2001 From: "Stephane Lacoin (aka nxmatic)" Date: Tue, 26 Mar 2024 16:42:45 +0100 Subject: [PATCH] BDE-226 shared service worker bridge bootstrap logic - allow to bind a service workspace bridge and to bootstrap an entry point with. - used in main and about popup pages --- src/about/index.html | 4 +-- src/about/index.js | 55 +++++++++++++++++++----------------- src/popup/index.html | 3 +- src/popup/index.js | 25 ++++------------ src/service-worker-bridge.js | 24 ++++++++++++++-- 5 files changed, 60 insertions(+), 51 deletions(-) diff --git a/src/about/index.html b/src/about/index.html index e553c71f..cf7ffb02 100644 --- a/src/about/index.html +++ b/src/about/index.html @@ -27,8 +27,8 @@
-
-
+
+
Nuxeo Extension is released under the
diff --git a/src/about/index.js b/src/about/index.js index 6d3f7f7e..8faa8b81 100644 --- a/src/about/index.js +++ b/src/about/index.js @@ -19,29 +19,32 @@ import $ from 'jquery'; import ServiceWorkerBridge from '../service-worker-bridge'; new ServiceWorkerBridge() - .bootstrap() - .then((worker) => worker.tabActivator) - .then((tabActivator) => $(() => { - const date = new Date().getFullYear(); - $('#copyright').append(`${date} Nuxeo`); - $('#apache').click(() => { - tabActivator.loadNewExtensionTab( - 'http://www.apache.org/licenses/LICENSE-2.0' - ); - }); - $('#feedback').click(() => { - tabActivator.loadNewExtensionTab( - 'https://portal.prodpad.com/40c295d6-739d-11e7-9e52-06df22ffaf6f' - ); - }); - $('#apache').click(() => { - tabActivator.loadNewExtensionTab( - 'http://www.apache.org/licenses/LICENSE-2.0' - ); - }); - $('#feedback').click(() => { - tabActivator.loadNewExtensionTab( - 'https://portal.prodpad.com/40c295d6-739d-11e7-9e52-06df22ffaf6f' - ); - }); - })); + .bootstrap({ + name: 'about', + entrypoint: (worker) => { + const tabActivator = worker.tabActivator; + const date = new Date().getFullYear(); + $('#copyright').append(`${date} Nuxeo`); + $('#version').append(chrome.runtime.getManifest().version_name); + $('#apache').click(() => { + tabActivator.loadNewExtensionTab( + 'http://www.apache.org/licenses/LICENSE-2.0' + ); + }); + $('#feedback').click(() => { + tabActivator.loadNewExtensionTab( + 'https://portal.prodpad.com/40c295d6-739d-11e7-9e52-06df22ffaf6f' + ); + }); + $('#apache').click(() => { + tabActivator.loadNewExtensionTab( + 'http://www.apache.org/licenses/LICENSE-2.0' + ); + }); + $('#feedback').click(() => { + tabActivator.loadNewExtensionTab( + 'https://portal.prodpad.com/40c295d6-739d-11e7-9e52-06df22ffaf6f' + ); + }); + } + }); diff --git a/src/popup/index.html b/src/popup/index.html index c0ee28b9..840969b8 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -1,6 +1,7 @@ + Nuxeo Dev Tools - +