From 9bf1408640f926eb7933b0194034fef3ff181947 Mon Sep 17 00:00:00 2001 From: Kristoffer Tonning Date: Sat, 16 Dec 2023 10:38:52 +0100 Subject: [PATCH] Add more app tokens --- src/OsanoServiceProvider.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/OsanoServiceProvider.php b/src/OsanoServiceProvider.php index e2810a3..3897954 100644 --- a/src/OsanoServiceProvider.php +++ b/src/OsanoServiceProvider.php @@ -24,8 +24,18 @@ public function registerApp(App $app) AppToken::name('Cookie preferences drawer trigger') ->type(AppToken::TYPE_TEXT) ->key('cookie-preferences-drawer-trigger') - ->value("event.preventDefault(); Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')") - ->description('To trigger the Storage/Cookie preferences drawer'), + ->value("event.preventDefault(); window.Osano.cm.showDrawer()") + ->description('To trigger the storage/cookie preferences drawer'), + AppToken::name('Cookie banner trigger') + ->type(AppToken::TYPE_TEXT) + ->key('cookie-preferences-dialog-trigger') + ->value("event.preventDefault(); window.Osano.cm.showDialog()") + ->description('To trigger the cookie dialog aka. banner'), + AppToken::name('Do Not Sell modal trigger') + ->type(AppToken::TYPE_TEXT) + ->key('cookie-preferences-dialog-trigger') + ->value("event.preventDefault(); window.Osano.cm.showDoNotSell()") + ->description('To trigger the Do Not Sell preferences modal'), ]) ->includeFrontendViews(function (IncludeFrontendViews $frontendViews) { return $frontendViews->addToHead(view: 'osano::script', priority: 100);