From c66b0b550e97397fb9641ca5d26390794d3c1771 Mon Sep 17 00:00:00 2001 From: Mahmoud Adly Date: Wed, 29 May 2024 12:33:49 +0200 Subject: [PATCH 1/2] Try to remove old form --- assets/js/feedback.js | 45 ---------------------------------- layouts/partials/feedback.html | 16 ------------ 2 files changed, 61 deletions(-) delete mode 100644 assets/js/feedback.js delete mode 100644 layouts/partials/feedback.html diff --git a/assets/js/feedback.js b/assets/js/feedback.js deleted file mode 100644 index 915a668cb..000000000 --- a/assets/js/feedback.js +++ /dev/null @@ -1,45 +0,0 @@ -const yesButton = document.querySelector('.feedback-yes'); -const noButton = document.querySelector('.feedback-no'); - -const disableButtons = () => { - yesButton.disabled = true; - noButton.disabled = true; -}; - -function thanksFeedback(button){ - button.blur(); - buttonText = button.innerText - button.innerText = 'Thanks for the feedback!' - setTimeout(function () { - button.innerText = buttonText; - }, 2000); -} - -const sendFeedback = (value) => { - if (typeof ga !== 'function') return; - const args = { - command: 'send', - hitType: 'event', - category: 'Feedback Buttons', - action: 'click', - label: window.location.pathname, - value: value - }; - ga(args.command, args.hitType, args.category, args.action, args.label, args.value); -}; - -if (yesButton !== null ) { - yesButton.addEventListener('click', () => { - thanksFeedback(yesButton); - disableButtons(); - sendFeedback(1); - }); -} - -if (noButton !== null ) { - noButton.addEventListener('click', () => { - thanksFeedback(noButton); - disableButtons(); - sendFeedback(0); - }); -} \ No newline at end of file diff --git a/layouts/partials/feedback.html b/layouts/partials/feedback.html deleted file mode 100644 index 1abc37cbd..000000000 --- a/layouts/partials/feedback.html +++ /dev/null @@ -1,16 +0,0 @@ -
-
-
-
-

Was this page helpful?

- - - Yes - - - No - - - Create an Issue - -
\ No newline at end of file From faadca39022f5f01e3d9b905f65101153c07ac89 Mon Sep 17 00:00:00 2001 From: Mahmoud Adly Date: Wed, 29 May 2024 12:49:02 +0200 Subject: [PATCH 2/2] Update docsy feedback form --- themes/docsy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/docsy b/themes/docsy index f82dd5efa..456e4c5b8 160000 --- a/themes/docsy +++ b/themes/docsy @@ -1 +1 @@ -Subproject commit f82dd5efa0eb5a03086498686f9e60f7bd2bb5f3 +Subproject commit 456e4c5b8fd48764578254e55bdd6751b4e7aa40