Açıklama Yok

pum-integration-contactform7.js 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = "./assets/js/src/integration/contactform7.js");
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./assets/js/src/integration/contactform7.js":
  89. /*!***************************************************!*\
  90. !*** ./assets/js/src/integration/contactform7.js ***!
  91. \***************************************************/
  92. /*! no exports provided */
  93. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94. "use strict";
  95. __webpack_require__.r(__webpack_exports__);
  96. /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js");
  97. /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
  98. /**************************************
  99. * Copyright (c) 2020, Popup Maker
  100. *************************************/
  101. {
  102. var formProvider = "contactform7";
  103. var $ = window.jQuery;
  104. $(document).on("wpcf7mailsent", function (event, details) {
  105. var formId = event.detail.contactFormId,
  106. $form = $(event.target),
  107. identifier = event.detail.id || event.detail.unitTag,
  108. // Converts string like wpcf7-f190-p2-o11 and reduces it to simply 11, the last o11 is the instance ID.
  109. // More accurate way of doing it in case things change in the future, this version filters out all but the o param.
  110. // formInstanceId = .split('-').filter((string) => string.indexOf('o') === 0)[0].replace('o','');
  111. // Simpler version that simply splits and pops the last item in the array. This requires it always be the last.
  112. formInstanceId = identifier.split("-").pop().replace("o", ""); // All the magic happens here.
  113. window.PUM.integrations.formSubmission($form, {
  114. formProvider: formProvider,
  115. formId: formId,
  116. formInstanceId: formInstanceId,
  117. extras: {
  118. details: details
  119. }
  120. });
  121. /**
  122. * TODO - Move this to a backward compatiblilty file, hook it into the pum.integration.form.success action.
  123. *
  124. * Listen for older popup actions applied directly to the form.
  125. *
  126. * This is here for backward compatibility with form actions prior to v1.9.
  127. */
  128. var $settings = $form.find("input.wpcf7-pum"),
  129. settings = $settings.length ? JSON.parse($settings.val()) : false;
  130. if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(settings) === "object" && settings.closedelay !== undefined && settings.closedelay.toString().length >= 3) {
  131. settings.closedelay = settings.closedelay / 1000;
  132. } // Nothing should happen if older action settings not applied
  133. // except triggering of pumFormSuccess event for old cookie method.
  134. window.PUM.forms.success($form, settings);
  135. });
  136. }
  137. /***/ }),
  138. /***/ "./node_modules/@babel/runtime/helpers/typeof.js":
  139. /*!*******************************************************!*\
  140. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  141. \*******************************************************/
  142. /*! no static exports found */
  143. /***/ (function(module, exports) {
  144. function _typeof(obj) {
  145. "@babel/helpers - typeof";
  146. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  147. module.exports = _typeof = function _typeof(obj) {
  148. return typeof obj;
  149. };
  150. } else {
  151. module.exports = _typeof = function _typeof(obj) {
  152. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  153. };
  154. }
  155. return _typeof(obj);
  156. }
  157. module.exports = _typeof;
  158. /***/ })
  159. /******/ });