Skip to content

Commit

Permalink
Merge pull request #175 from WebDevStudios/release220
Browse files Browse the repository at this point in the history
Release 2.1.2
  • Loading branch information
tw2113 authored Jul 20, 2023
2 parents d97ba56 + eb3f73b commit a4a648e
Show file tree
Hide file tree
Showing 15 changed files with 7,069 additions and 2,697 deletions.
8 changes: 7 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: constantcontact, webdevstudios, znowebdev, jmichaelward, ggwicz, r
Tags: Constant Contact, WooCommerce, eCommerce, email marketing, marketing automation, email, form, forms, marketing, mobile, opt-in, plugin, signup, subscribe, subscription, widget
Requires at least: 5.2.2
Tested up to: 6.2.2
Stable tag: 2.1.1
Stable tag: 2.1.2
Requires PHP: 7.2
License: GPLv3

Expand Down Expand Up @@ -83,6 +83,12 @@ You've connected your WooCommerce store to Constant Contact, promoted your WooCo

== Changelog ==

= 2.1.2 =
* Fixed - `enableStoreDetails` javascript console error.
* Fixed - PHP8 compatibility errors.
* Fixed - Mismatch in SettingsModel PHP signature.
* Updated - Build tools versions.

= 2.1.1 =
* Updates - Remove deprecated customer properties usage.

Expand Down
97 changes: 96 additions & 1 deletion app/admin-bundle.js
Original file line number Diff line number Diff line change
@@ -1 +1,96 @@
(()=>{"use strict";function e(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}var t=new(function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.els={}}var n,l;return n=t,(l=[{key:"init",value:function(){this.cacheEls(),this.bindEvents(),this.enableStoreDetails()}},{key:"cacheEls",value:function(){this.els.enableStoreDetails=document.getElementById("cc_woo_save_store_details"),this.els.optionalFields=document.getElementById("cc-optional-fields")}},{key:"bindEvents",value:function(){var e=this;this.els.enableStoreDetails.addEventListener("change",(function(t){e.enableStoreDetails()}))}},{key:"enableStoreDetails",value:function(){this.els.enableStoreDetails.checked?(console.log(this.els.optionalFields.parentElement),this.els.optionalFields.parentElement.style.display="block"):this.els.optionalFields.parentElement.style.display="none"}}])&&e(n.prototype,l),t}());window.onload=function(e){t.init()}})();
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ "./app/admin.js":
/*!**********************!*\
!*** ./app/admin.js ***!
\**********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _handleSettingsPage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handleSettingsPage */ \"./app/handleSettingsPage.js\");\n\n\n// Handles store details.\nvar enableStoreDetails = new _handleSettingsPage__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\nwindow.onload = function (e) {\n enableStoreDetails.init();\n};\n\n//# sourceURL=webpack://constant-contact-woocommerce/./app/admin.js?");

/***/ }),

/***/ "./app/handleSettingsPage.js":
/*!***********************************!*\
!*** ./app/handleSettingsPage.js ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ HandleSettingsPage)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * GuestCheckoutCapture.\n *\n * @package WebDevStudios\\CCForWoo\n * @since 1.2.0\n */\nvar HandleSettingsPage = /*#__PURE__*/function () {\n /**\n * @constructor\n *\n * @author Biplav Subedi <[email protected]>\n * @since 2.0.0\n */\n function HandleSettingsPage() {\n _classCallCheck(this, HandleSettingsPage);\n this.els = {};\n }\n\n /**\n * Init ccWoo admin JS.\n *\n * @author Biplav Subedi <[email protected]>\n * @since 2.0.0\n */\n _createClass(HandleSettingsPage, [{\n key: \"init\",\n value: function init() {\n this.cacheEls();\n this.bindEvents();\n this.enableStoreDetails();\n }\n\n /**\n * Cache some DOM elements.\n *\n * @author Biplav Subedi <[email protected]>\n * @since 2.0.0\n */\n }, {\n key: \"cacheEls\",\n value: function cacheEls() {\n this.els.enableStoreDetails = document.getElementById('cc_woo_save_store_details');\n this.els.optionalFields = document.getElementById('cc-optional-fields');\n }\n\n /**\n * Bind callbacks to events.\n *\n * @author Biplav Subedi <[email protected]>\n * @since 2.0.0\n */\n }, {\n key: \"bindEvents\",\n value: function bindEvents() {\n var _this = this;\n if (null !== this.els.enableStoreDetails) {\n this.els.enableStoreDetails.addEventListener('change', function (e) {\n _this.enableStoreDetails();\n });\n }\n }\n\n /**\n * Captures guest checkout if billing email is valid.\n *\n * @author Biplav Subedi <[email protected]>\n * @since 2.0.0\n */\n }, {\n key: \"enableStoreDetails\",\n value: function enableStoreDetails() {\n if (null !== this.els.enableStoreDetails) {\n if (this.els.enableStoreDetails.checked) {\n console.log(this.els.optionalFields.parentElement);\n this.els.optionalFields.parentElement.style.display = 'block';\n } else {\n this.els.optionalFields.parentElement.style.display = 'none';\n }\n }\n }\n }]);\n return HandleSettingsPage;\n}();\n\n\n//# sourceURL=webpack://constant-contact-woocommerce/./app/handleSettingsPage.js?");

/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./app/admin.js");
/******/
/******/ })()
;
127 changes: 126 additions & 1 deletion app/bundle.js

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions app/handleSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default class HandleSettingsPage {
cacheEls() {
this.els.enableStoreDetails = document.getElementById( 'cc_woo_save_store_details' );
this.els.optionalFields = document.getElementById( 'cc-optional-fields' );

}

/**
Expand All @@ -48,9 +47,11 @@ export default class HandleSettingsPage {
* @since 2.0.0
*/
bindEvents() {
this.els.enableStoreDetails.addEventListener( 'change', e => {
this.enableStoreDetails();
} );
if ( null !== this.els.enableStoreDetails ) {
this.els.enableStoreDetails.addEventListener('change', e => {
this.enableStoreDetails();
});
}
}

/**
Expand All @@ -60,11 +61,13 @@ export default class HandleSettingsPage {
* @since 2.0.0
*/
enableStoreDetails() {
if (this.els.enableStoreDetails.checked) {
console.log(this.els.optionalFields.parentElement);
this.els.optionalFields.parentElement.style.display = 'block';
} else {
this.els.optionalFields.parentElement.style.display = 'none';
if (null !== this.els.enableStoreDetails) {
if (this.els.enableStoreDetails.checked) {
console.log(this.els.optionalFields.parentElement);
this.els.optionalFields.parentElement.style.display = 'block';
} else {
this.els.optionalFields.parentElement.style.display = 'none';
}
}
}

Expand Down
Loading

0 comments on commit a4a648e

Please sign in to comment.