| @@ -1,50 +1,32 @@ | ||
| 1 | -;(function($) { | |
| 2 | - $(document).on('change', '.better-payment .payment-form-layout-3 .payment-method-checkbox input', function() { | |
| 3 | - if(this.checked) { | |
| 4 | - $('.better-payment .payment-form-layout-3 .payment-method-checkbox').removeClass('active'); | |
| 5 | - $(this).parent().addClass("active"); | |
| 1 | +/* | |
| 2 | + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). | |
| 3 | + * This devtool is neither made for production nor for readable output files. | |
| 4 | + * It uses "eval()" calls to create a separate source file in the browser devtools. | |
| 5 | + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) | |
| 6 | + * or disable the default devtool with "devtool: false". | |
| 7 | + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). | |
| 8 | + */ | |
| 9 | +/******/ (() => { // webpackBootstrap | |
| 10 | +/******/ var __webpack_modules__ = ({ | |
| 6 | 11 | |
| 7 | - $('.better-payment .payment-form-layout-3 .payment-method-checkbox input').removeAttr('checked', ); | |
| 8 | - $(this).attr('checked', true); | |
| 12 | +/***/ "./src/js/common.js" | |
| 13 | +/*!**************************!*\ | |
| 14 | + !*** ./src/js/common.js ***! | |
| 15 | + \**************************/ | |
| 16 | +() { | |
| 9 | 17 | |
| 10 | - let paypalBtnClassName = 'better-payment-paypal-bt'; | |
| 11 | - let stripeBtnClassName = 'better-payment-stripe-bt'; | |
| 12 | - let targetButtonClassName = $(this).hasClass('layout-payment-method-paypal') ? paypalBtnClassName : stripeBtnClassName; | |
| 18 | +eval("{(function ($) {\n $(document).on('change', '.better-payment .payment-form-layout-3 .payment-method-checkbox input', function () {\n if (this.checked) {\n $('.better-payment .payment-form-layout-3 .payment-method-checkbox').removeClass('active');\n $(this).parent().addClass('active');\n $('.better-payment .payment-form-layout-3 .payment-method-checkbox input').removeAttr('checked');\n $(this).attr('checked', true);\n let paypalBtnClassName = 'better-payment-paypal-bt';\n let stripeBtnClassName = 'better-payment-stripe-bt';\n let paystackBtnClassName = 'better-payment-paystack-bt';\n let targetButtonClassName = $(this).hasClass('layout-payment-method-paypal') ? paypalBtnClassName : stripeBtnClassName;\n targetButtonClassName = $(this).hasClass('layout-payment-method-paystack') ? paystackBtnClassName : targetButtonClassName;\n $('.better-payment .' + paypalBtnClassName + ', .better-payment .' + stripeBtnClassName + ', .better-payment .' + paystackBtnClassName).addClass('is-hidden');\n $('.better-payment .' + targetButtonClassName).removeClass('is-hidden');\n }\n });\n $(document).on('change', '.better-payment .payment-form-layout-1 .payment-method-checkbox input, .better-payment .payment-form-layout-2 .payment-method-checkbox input, .better-payment .payment-method-item input', function (e) {\n if (this.checked) {\n let paypalBtnClassName = 'better-payment-paypal-bt';\n let stripeBtnClassName = 'better-payment-stripe-bt';\n let paystackBtnClassName = 'better-payment-paystack-bt';\n let targetButtonClassName = $(this).hasClass('layout-payment-method-paypal') ? paypalBtnClassName : stripeBtnClassName;\n targetButtonClassName = $(this).hasClass('layout-payment-method-paystack') ? paystackBtnClassName : targetButtonClassName;\n $('.better-payment .' + paypalBtnClassName + ', .better-payment .' + stripeBtnClassName + ', .better-payment .' + paystackBtnClassName).addClass('is-hidden');\n $('.better-payment .' + targetButtonClassName).removeClass('is-hidden');\n }\n });\n $(document).on('click', '.better-payment .user-dashboard-sidebar .bp--sidebar-nav', function (e) {\n e.preventDefault();\n let $this = $(this);\n let tabCommonSelector = '.better-payment .user-dashboard-sidebar .bp--sidebar-nav';\n let tabContentCommonSelector = '.better-payment .bp--tab-conetnt-wrapper';\n let tabName = $this.data('tab');\n $(tabCommonSelector).removeClass('active');\n $(tabContentCommonSelector).addClass('d-none').fadeOut();\n $this.addClass('active');\n $(`.better-payment .${tabName}-tab-wrapper`).fadeIn(500).removeClass('d-none');\n\n // Hide sidebar on mobile\n if (window.innerWidth < 768) {\n if ($(e.target).closest('.bp--sidebar-nav-list').length) {\n hideDashboardSidebar();\n }\n }\n });\n $('.better-payment .bp-dashboard-hamburger').on('click', function (e) {\n $('.better-payment-user-dashboard-sidebar').fadeIn(500);\n $('.better-payment .bp-overlay').fadeIn(500);\n });\n $('.better-payment .bp-overlay').on('click', function (e) {\n // Overlay click\n if (e.target !== '.better-payment-user-dashboard-sidebar') {\n hideDashboardSidebar();\n }\n });\n function hideDashboardSidebar() {\n $('.better-payment-user-dashboard-sidebar').fadeOut(500);\n $('.better-payment .bp-overlay').fadeOut();\n }\n function copyDataFunction() {\n const $transactionIDElement = $('.bp-transaction_id');\n const $copyButton = $('.bp-transaction_data-copy_btn');\n if ($transactionIDElement.length) {\n const transactionID = $.trim($transactionIDElement.text());\n navigator.clipboard.writeText(transactionID);\n $copyButton.css('stroke', '#6B59EE');\n\n // Dynamically add or update tooltip message using jQuery\n const styleId = 'copy-tooltip-style';\n let $styleTag = $('#' + styleId);\n if (!$styleTag.length) {\n $styleTag = $('<style>', {\n id: styleId\n }).appendTo('head');\n }\n\n // Clear previous rules if needed\n $styleTag.html(`\n .bp-transaction_data-copy_btn::after {\n content: 'Copied!';\n right: -23px;\n }\n `);\n $copyButton.addClass('copied-text');\n setTimeout(() => {\n $copyButton.removeClass('copied-text');\n }, 3000);\n }\n }\n\n // jQuery event delegation for dynamically bound elements\n $(document).on('click', '.bp-transaction_data-copy_btn', function () {\n copyDataFunction();\n });\n function printElementByClass(className) {\n // Get the first element with the class\n const element = document.querySelector('.' + className);\n if (!element) return;\n\n // Create iframeElement\n const iframeElement = document.createElement('iframe');\n iframeElement.style.display = 'none';\n document.body.appendChild(iframeElement);\n\n // Get styles from parent document\n const styles = Array.from(document.styleSheets).map(styleSheet => {\n try {\n return Array.from(styleSheet.cssRules).map(rule => rule.cssText).join('\\n');\n } catch (e) {\n // Cross-origin stylesheet - can't access rules\n return '';\n }\n }).filter(Boolean).join('\\n');\n\n // Write to iframeElement document\n const doc = iframeElement.contentDocument || iframeElement.contentWindow.document;\n doc.write(`\n <html>\n <head>\n <title>${document.title}</title>\n <style>${styles}</style>\n </head>\n <body>\n ${element.outerHTML}\n </body>\n </html>\n `);\n doc.close();\n\n // Print and remove iframeElement\n iframeElement.contentWindow.focus();\n setTimeout(() => {\n iframeElement.contentWindow.print();\n setTimeout(() => document.body.removeChild(iframeElement), 1000);\n }, 300);\n }\n $(document).on('click', '.bp-print_btn', function () {\n printElementByClass('bp-thank_page');\n });\n})(jQuery);\n\n//# sourceURL=webpack://better-payment/./src/js/common.js?\n}"); | |
| 13 | 19 | |
| 14 | - $('.better-payment .' + paypalBtnClassName + ', .better-payment .' + stripeBtnClassName).addClass('is-hidden'); | |
| 15 | - $('.better-payment .' + targetButtonClassName).removeClass('is-hidden'); | |
| 16 | - } | |
| 17 | - }); | |
| 20 | +/***/ } | |
| 18 | 21 | |
| 19 | - $(document).on('change', '.better-payment .payment-form-layout-1 .payment-method-checkbox input, .better-payment .payment-form-layout-2 .payment-method-checkbox input', function(e) { | |
| 20 | - if(this.checked) { | |
| 21 | - let paypalBtnClassName = 'better-payment-paypal-bt'; | |
| 22 | - let stripeBtnClassName = 'better-payment-stripe-bt'; | |
| 23 | - let targetButtonClassName = $(this).hasClass('layout-payment-method-paypal') ? paypalBtnClassName : stripeBtnClassName; | |
| 24 | - | |
| 25 | - $('.better-payment .' + paypalBtnClassName + ', .better-payment .' + stripeBtnClassName).addClass('is-hidden'); | |
| 26 | - $('.better-payment .' + targetButtonClassName).removeClass('is-hidden'); | |
| 27 | - } | |
| 28 | - }); | |
| 29 | - | |
| 30 | - $(document).on("click", ".better-payment .bp-modal-button", function (e) { | |
| 31 | - e.preventDefault(); | |
| 32 | - let $this = $(this); | |
| 33 | - let modalWrap = $this.attr("data-targetwrap"); | |
| 34 | - | |
| 35 | - let modalSelector = "." + modalWrap + " .modal"; | |
| 36 | - $(modalSelector).addClass("is-active"); | |
| 37 | - }); | |
| 38 | - | |
| 39 | - $(document).on( | |
| 40 | - "click", | |
| 41 | - ".better-payment .modal-background, .better-payment .modal-close, .better-payment .delete, .better-payment .bp-modal .cancel-button", | |
| 42 | - function (e) { | |
| 43 | - e.preventDefault(); | |
| 44 | - let $this = $(this); | |
| 45 | - let modalSelector = $this.closest(".bp-modal .modal"); | |
| 46 | - | |
| 47 | - $(modalSelector).removeClass("is-active"); | |
| 48 | - } | |
| 49 | - ); | |
| 50 | -})(jQuery); | |
| 22 | +/******/ }); | |
| 23 | +/************************************************************************/ | |
| 24 | +/******/ | |
| 25 | +/******/ // startup | |
| 26 | +/******/ // Load entry module and return exports | |
| 27 | +/******/ // This entry module can't be inlined because the eval devtool is used. | |
| 28 | +/******/ var __webpack_exports__ = {}; | |
| 29 | +/******/ __webpack_modules__["./src/js/common.js"](); | |
| 30 | +/******/ | |
| 31 | +/******/ })() | |
| 32 | +; | |