backup
2 years ago
notices
2 years ago
analytics-consent-modal.js
2 years ago
analytics-consent-modal.js.map
2 years ago
analytics-consent-modal.min.js
2 years ago
analytics-consent-modal.min.js.map
2 years ago
wpstg-admin-beta.js
2 years ago
wpstg-admin-beta.js.map
2 years ago
wpstg-admin-beta.min.js
5 years ago
wpstg-admin-beta.min.js.map
2 years ago
wpstg-admin-corrupt-settings.js
2 years ago
wpstg-admin-corrupt-settings.js.map
2 years ago
wpstg-admin-corrupt-settings.min.js
2 years ago
wpstg-admin-corrupt-settings.min.js.map
2 years ago
wpstg-admin-plugins.js
2 years ago
wpstg-admin-plugins.js.map
2 years ago
wpstg-admin-plugins.min.js
2 years ago
wpstg-admin-plugins.min.js.map
2 years ago
wpstg-admin-rating.js
2 years ago
wpstg-admin-rating.js.map
2 years ago
wpstg-admin-rating.min.js
2 years ago
wpstg-admin-rating.min.js.map
2 years ago
wpstg-admin.js
2 years ago
wpstg-admin.js.map
2 years ago
wpstg-admin.min.js
2 years ago
wpstg-admin.min.js.map
2 years ago
wpstg-blank-loader.js
2 years ago
wpstg-blank-loader.js.map
2 years ago
wpstg-blank-loader.min.js
2 years ago
wpstg-blank-loader.min.js.map
2 years ago
wpstg-sweetalert2.js
2 years ago
wpstg-sweetalert2.js.map
2 years ago
wpstg-sweetalert2.min.js
2 years ago
wpstg-sweetalert2.min.js.map
2 years ago
wpstg.js
2 years ago
wpstg.js.map
2 years ago
wpstg.min.js
2 years ago
wpstg.min.js.map
2 years ago
analytics-consent-modal.js
65 lines
| 1 | (function () { |
| 2 | 'use strict'; |
| 3 | |
| 4 | var AnalyticsConsentModal = /*#__PURE__*/function () { |
| 5 | function AnalyticsConsentModal(wpstgObject) { |
| 6 | if (wpstgObject === void 0) { |
| 7 | wpstgObject = wpstg; |
| 8 | } |
| 9 | this.wpstgObject = wpstgObject; |
| 10 | this.isLearnMoreLink = false; |
| 11 | this.init(); |
| 12 | } |
| 13 | var _proto = AnalyticsConsentModal.prototype; |
| 14 | _proto.init = function init() { |
| 15 | this.consentModalWrapper = document.querySelector('.wpstg-consent-modal-main-wrapper'); |
| 16 | this.consentModalLearnMoreLink = document.querySelector('#wpstg-admin-notice-learn-more'); |
| 17 | this.consentModalPermissionList = document.querySelector('#wpstg-consent-modal-permission-list'); |
| 18 | this.consentModalSkipLink = document.querySelector('#wpstg-skip-activate-notice'); |
| 19 | this.consentModalGiveConsentButton = document.querySelector('#wpstg-consent-modal-btn-success'); |
| 20 | this.addEvents(); |
| 21 | }; |
| 22 | _proto.addEvents = function addEvents() { |
| 23 | var _this = this; |
| 24 | document.addEventListener('keydown', function (event) { |
| 25 | if (event.key === 'Escape') { |
| 26 | _this.hide(_this.consentModalWrapper); |
| 27 | _this.hide(_this.consentModalPermissionList); |
| 28 | } |
| 29 | }); |
| 30 | this.consentModalSkipLink.addEventListener('click', function () { |
| 31 | _this.hide(_this.consentModalWrapper); |
| 32 | _this.hide(_this.consentModalPermissionList); |
| 33 | location.href = _this.wpstgObject.analyticsConsentDeny; |
| 34 | }); |
| 35 | this.consentModalLearnMoreLink.addEventListener('click', function () { |
| 36 | _this.isLearnMoreLink = !_this.isLearnMoreLink; |
| 37 | if (_this.isLearnMoreLink) { |
| 38 | _this.consentModalLearnMoreLink.innerHTML = 'Read Less'; |
| 39 | _this.show(_this.consentModalPermissionList); |
| 40 | return false; |
| 41 | } |
| 42 | _this.consentModalLearnMoreLink.innerHTML = 'Read More'; |
| 43 | _this.hide(_this.consentModalPermissionList); |
| 44 | }); |
| 45 | this.consentModalGiveConsentButton.addEventListener('click', function () { |
| 46 | _this.hide(_this.consentModalWrapper); |
| 47 | _this.hide(_this.consentModalPermissionList); |
| 48 | location.href = _this.wpstgObject.analyticsConsentAllow; |
| 49 | }); |
| 50 | }; |
| 51 | _proto.show = function show(element) { |
| 52 | element.style.display = 'block'; |
| 53 | }; |
| 54 | _proto.hide = function hide(element) { |
| 55 | element.style.display = 'none'; |
| 56 | }; |
| 57 | return AnalyticsConsentModal; |
| 58 | }(); |
| 59 | new AnalyticsConsentModal(); |
| 60 | |
| 61 | return AnalyticsConsentModal; |
| 62 | |
| 63 | })(); |
| 64 | //# sourceMappingURL=analytics-consent-modal.js.map |
| 65 |