1/******/ (function() { // webpackBootstrap 2/******/ "use strict"; 3/******/ var __webpack_modules__ = ([ 4/* 0 */, 5/* 1 */ 6/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 7 8__webpack_require__.r(__webpack_exports__); 9/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10/* harmony export */ "default": function() { return /* binding */ Map; } 11/* harmony export */ }); 12/* harmony import */ var _jquery_replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 13function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 14function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 15function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 16function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 17function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 18function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 19function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 20function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 21function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 22/** 23 * 24 */ 25 26 27var Map = /*#__PURE__*/function () { 28 function Map(id, params) { 29 _classCallCheck(this, Map); 30 _defineProperty(this, "map", null); 31 _defineProperty(this, "markers", []); 32 var p = { 33 center: [46.890232, 2.702637], 34 zoom: 5, 35 scrollWheelZoom: false 36 }; 37 if (params) p = _objectSpread(_objectSpread({}, p), params); 38 this.map = L.map(id, p); 39 L.tileLayer('https://api.maptiler.com/maps/basic-v2-light/{z}/{x}/{y}@2x.png?key=atX67b6Yxm6b8EhWGlYR', { 40 tileSize: 512, 41 zoomOffset: -1, 42 minZoom: 1, 43 attribution: '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>', 44 crossOrigin: true 45 }).addTo(this.map); 46 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].sAll('#map-infobox').length > 0) { 47 document.addEventListener('keydown', function (event) { 48 if (event.keyCode == 27 && _jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].s('#row-projects-map').hasClass('infobox-open')) _jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].s('#row-projects-map').removeClass('infobox-open'); 49 }); 50 } 51 } 52 return _createClass(Map, [{ 53 key: "update", 54 value: function update(markers_datas) { 55 var _this2 = this; 56 var _this = this; 57 this.markers.forEach(function (el) { 58 _this.map.removeLayer(el); 59 }); 60 markers_datas.forEach(function (el) { 61 /** Icône des markers */ 62 var icon = L.icon({ 63 iconUrl: assets_url + 'svg/map-marker.svg', 64 iconSize: [40, 60] 65 }); 66 var marker = L.marker([el.lat, el.lng], { 67 'alt': el.title, 68 'icon': icon 69 }).addTo(_this2.map); 70 _this2.markers.push(marker); 71 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].sAll('#map-infobox').length == 0) return; 72 marker.on('click', function () { 73 _jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].s('#row-projects-map').addClass('infobox-open'); 74 _jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].s('#map-infobox > div').html(el.html); 75 }); 76 _jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].s('#map-infobox button.close').on('click', function () { 77 _jquery_replace__WEBPACK_IMPORTED_MODULE_0__["default"].s('#row-projects-map').removeClass('infobox-open'); 78 }); 79 }); 80 } 81 }]); 82}(); 83 84 85/***/ }), 86/* 2 */ 87/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 88 89__webpack_require__.r(__webpack_exports__); 90function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap;
vendor: 5,439 bytes, line 90
90 var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEac
vendor: 6,032 bytes, lines 90-154
90h(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } 91function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } 92function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 93function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } 94function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 95function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 96function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } 97function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 98function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 99function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 100/** 101 * 102 * jQuery custom replace 103 * 104 * Fonctions & extends remplaçant des fonctionnalitées jQuery 105 * Développement personnel 106 * 107 * 1.2.0 108 * 109 */ 110 111/** Get element offset */ 112Element.prototype.getOffset = function () { 113 var rect = this.getBoundingClientRect(); 114 return { 115 left: rect.left + window.scrollX, 116 top: rect.top + window.scrollY 117 }; 118}; 119 120/** Get element width */ 121Element.prototype.width = function () { 122 return this.getBoundingClientRect().width; 123}; 124 125/** Get element height */ 126Element.prototype.height = function () { 127 return this.getBoundingClientRect().height; 128}; 129 130/** Multiple attributes set */ 131Element.prototype.setAttributes = function (attrs) { 132 for (var idx in attrs) { 133 if ((idx === 'styles' || idx === 'style') && _typeof(attrs[idx]) === 'object') { 134 for (var prop in attrs[idx]) { 135 this.style[prop] = attrs[idx][prop]; 136 } 137 } else if (idx === 'html') { 138 this.innerHTML = attrs[idx]; 139 } else { 140 this.setAttribute(idx, attrs[idx]); 141 } 142 } 143}; 144 145/** */ 146Element.prototype.data = function (slug, value) { 147 if (typeof value === 'undefined' || value === undefined) { 148 // Get value 149 150 var value = this.getAttribute('data-' + slug); 151 try { 152 var json = JSON.parse(value); 153 } catch (e) { 154 var json = false;
155 } 156 157 /** Boolean datas */ 158 if (value == 'true' || value == 'false') value = Boolean(value); 159 160 /** JSON datas */ 161 if (_typeof(json) == 'object') value = json; 162 return value; 163 } else { 164 // Set value 165 166 this.setAttribute('data-' + slug, value); 167 return this; 168 } 169}; 170 171/** */ 172NodeList.prototype.data = function (slug, value) { 173 this.forEach(function ($node) { 174 $node.setAttribute('data-' + slug, value); 175 }); 176 return this; 177}; 178 179/** */ 180Element.prototype.addClass = function (classname) { 181 this.classList.add(classname); 182 return this; 183}; 184 185/** */ 186NodeList.prototype.addClass = function (classname) { 187 this.forEach(function ($node) { 188 $node.classList.add(classname); 189 }); 190 return this; 191}; 192 193/** Toggle an element class */ 194Element.prototype.toggleClass = function (the_class) { 195 if (this.classList.contains(the_class)) { 196 this.classList.remove(the_class); 197 } else { 198 this.classList.add(the_class); 199 } 200}; 201 202/** */ 203NodeList.prototype.toggleClass = function (classname) { 204 this.forEach(function ($node) { 205 $node.toggleClass(classname); 206 }); 207 return this; 208}; 209 210/** */ 211Element.prototype.removeClass = function (classname) { 212 this.classList.remove(classname); 213 return this; 214}; 215 216/** */ 217NodeList.prototype.removeClass = function (classname) { 218 this.forEach(function ($node) { 219 $node.classList.remove(classname); 220 }); 221 return this; 222}; 223 224/** */ 225Element.prototype.hasClass = function (classname) { 226 return this.classList.contains(classname); 227}; 228 229/** */ 230Element.prototype.html = function (html) { 231 if (typeof html == 'undefined' || html === false) return false; 232 this.innerHTML = html; 233 return this; 234}; 235 236/** */ 237NodeList.prototype.html = function (html) { 238 if (!html) return false; 239 this.forEach(function ($node) { 240 $node.innerHTML = html; 241 }); 242 return this; 243}; 244 245/** */ 246Element.prototype.empty = function () { 247 this.replaceChildren(); 248 return this; 249}; 250 251/** */ 252NodeList.prototype.empty = function () { 253 this.forEach(function ($node) { 254 $node.replaceChildren(); 255 }); 256 return this; 257}; 258 259/** */ 260NodeList.prototype.each = function (handler) { 261 this.forEach(function ($node) { 262 handler($node); 263 }); 264 return this; 265}; 266 267/** */ 268Element.prototype.find = function (selector) { 269 selector = selector.split(', ').join(','); // Supprime les espaces autour des virgules dans le selecteur 270 271 var elmts = this.querySelectorAll(selector); 272 if (elmts.length == 0) return false; 273 if (elmts.length == 1) return elmts[0]; 274 return elmts; 275}; 276 277/** */ 278Element.prototype.val = function (value) { 279 if (!this || this.length == 0) return false; 280 if (typeof value == 'undefined') return this.value; 281 this.value = value; 282 return this; 283}; 284 285/** 286 * Dans le cas où l'élément est inexistant, le selecteur retourne une NodeList vide 287 * On retourne donc false 288 */ 289NodeList.prototype.val = function (value) { 290 return false; 291}; 292 293/** */ 294Element.prototype.on = function (event_name, child_selector, handler, options) { 295 var _this = this; 296 if (typeof child_selector == 'function') { 297 this.addEventListener(event_name, function (e) { 298 e['stopImmediatePropagation'](); 299 child_selector(this, e); 300 }, options); 301 } else { 302 this.addEventListener(event_name, function (e) { 303 e['stopImmediatePropagation'](); 304 var elmt = e.target, 305 match = elmt.closest(child_selector); 306 if (match) handler(match, e); 307 }, options); 308 } 309}; 310 311/** */ 312NodeList.prototype.on = function (event_name, child_selector, handler, options) { 313 this.forEach(function ($node) { 314 $node.on(event_name, child_selector, handler, options); 315 }); 316}; 317 318/** */ 319Element.prototype.off = function (event_name, child_selector, handler) { 320 if (typeof child_selector == 'function') { 321 this.removeEventListener(event_name, function (e) { 322 child_selector(e.target, e); 323 }); 324 } else { 325 this.removeEventListener(event_name, function (e) { 326 var elmt = e.target, 327 match = elmt.closest(child_selector); 328 if (match) handler(e.target, e); 329 }); 330 } 331}; 332 333/** */ 334NodeList.prototype.off = function (event_name, child_selector, handler) { 335 this.forEach(function ($node) { 336 $node.off(event_name, child_selector, handler); 337 }); 338}; 339 340/** */ 341Element.prototype.attr = function (attr, value) { 342 var _this2 = this; 343 if (_typeof(attr) == 'object') { 344 Object.entries(attr).forEach(function (value) { 345 if (!!value[0] && !!value[1]) _this2.attr(value[0], value[1]); 346 }); 347 return this; 348 } 349 if (!value) return this.getAttribute(attr); 350 this.setAttribute(attr, value); 351 return this; 352}; 353 354/** */ 355Element.prototype.hide = function () { 356 return this.style.display = 'none'; 357}; 358 359/** */ 360NodeList.prototype.hide = function () { 361 this.forEach(function ($node) { 362 $node.style.display = 'none'; 363 }); 364 return this; 365}; 366 367/** */ 368Element.prototype.show = function () { 369 return this.style.display = 'block'; 370}; 371 372/** */ 373NodeList.prototype.show = function () { 374 this.forEach(function ($node) { 375 $node.style.display = 'block'; 376 }); 377 return this; 378}; 379 380/** */ 381Element.prototype.is = function (selector) { 382 return this.matches(selector); 383}; 384 385/** */ 386Element.prototype.trigger = function (event_name) { 387 var event = new CustomEvent(event_name); 388 this.dispatchEvent(event); 389}; 390 391/** */ 392NodeList.prototype.trigger = function (event_name) { 393 this.forEach(function ($node) { 394 var event = new CustomEvent(event_name); 395 $node.dispatchEvent(event); 396 }); 397 return this; 398}; 399 400/** */ 401NodeList.prototype.remove = function () { 402 this.forEach(function ($node) { 403 $node.remove(); 404 }); 405 return true; 406}; 407 408/** 409 * Récupère l'index de l'élément dans son parent 410 */ 411Element.prototype.eq = function () { 412 var nodes = Array.prototype.slice.call(this.parentElement.children); 413 return nodes.indexOf(this); 414}; 415 416/** */ 417Element.prototype.css = function (prop, value) { 418 var _this3 = this; 419 if (_typeof(prop) == 'object') {
420 Object.entries(prop).forEach(function (value) { 421 if (!!value[0] && !!value[1]) _this3.css(value[0], value[1]); 422 }); 423 } 424 if (!value) return getComputedStyle(this)[prop]; 425 this.style[prop] = value; 426 return this; 427}; 428 429/** */ 430NodeList.prototype.css = function (prop, value) { 431 this.forEach(function ($node) { 432 $node.css(prop, value); 433 }); 434 return this; 435}; 436 437/** */ 438Element.prototype.loaded = function (callback) { 439 var _this = this; 440 window.addEventListener('load', function (event) { 441 callback(_this); 442 }); 443}; 444 445/** */ 446NodeList.prototype.loaded = function (callback) { 447 var _this = this; 448 var total = this.length; 449 var loaded = 0; 450 _this.forEach(function ($node) { 451 $node.loaded(function () { 452 loaded++; 453 if (total == loaded) callback(_this); 454 }); 455 }); 456}; 457 458/** */ 459Element.prototype.parents = function (selector) { 460 var _this = this; 461 var parents = []; 462 while ((_this = _this.parentNode) && _this !== document) { 463 if (!selector || _this.matches(selector)) parents.push(_this); 464 } 465 if (parents.length == 1) return parents[0]; 466 return parents; 467}; 468 469/** */ 470Element.prototype.s = function (selector) { 471 var els = this.querySelectorAll(selector); 472 if (els.length == 0) return document.createElement('div'); // Aucun élément n'est trouvé, on retourn un div vide afin d'éviter l'erreur JS 473 if (els.length == 1) return els[0]; // Un seul élément, on le retourne en élément simple, pas en NodeList 474 475 return els; 476}; 477 478/** */ 479Element.prototype.sAll = function (selector) { 480 return this.querySelectorAll(selector); 481}; 482window.scrollTop = function () { 483 return (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0); 484}; 485 486/** 487 */ 488/* harmony default export */ __webpack_exports__["default"] = ({ 489 /** 490 * Selector 491 */ 492 s: function s(selector) { 493 if (typeof selector == 'string') selector = selector.split(', ').join(','); // Supprime les espaces autour des virgules dans le selecteur 494 else return false; 495 var els = document.querySelectorAll(selector); 496 if (els.length == 0) return document.createElement('div'); // Aucun élément n'est trouvé, on retourn un div vide afin d'éviter l'erreur JS 497 if (els.length == 1) return els[0]; // Un seul élément, on le retourne en élément simple, pas en NodeList 498 499 return els; 500 }, 501 /** 502 * Selector all (force) 503 */ 504 sAll: function sAll(selector) { 505 return document.querySelectorAll(selector); 506 }, 507 /** 508 */ 509 event: function event(event_name, selector, handler) { 510 this.s(selector).removeEventListener(event_name, handler); 511 this.s(selector).addEventListener(event_name, handler); 512 }, 513 /** 514 * Detection que la page est chargée 515 */ 516 documentReady: function documentReady(fn) { 517 if (document.readyState !== 'loading') { 518 fn(); 519 } else { 520 document.addEventListener('DOMContentLoaded', fn); 521 } 522 }, 523 /** 524 */ 525 createElement: function createElement(html) { 526 var template = document.createElement('template'); 527 template.innerHTML = html.trim(); 528 return template.content.children; 529 }, 530 /** 531 */ 532 ajaxPost: function ajaxPost(url, datas) { 533 return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { 534 var form_datas, myHeaders, response; 535 return _regeneratorRuntime().wrap(function _callee$(_context) { 536 while (1) switch (_context.prev = _context.next) { 537 case 0: 538 form_datas = new FormData(); 539 /** Transformation des données en données de formulaire */ 540 Object.entries(datas).forEach(function (_ref) { 541 var _ref2 = _slicedToArray(_ref, 2), 542 key = _ref2[0], 543 value = _ref2[1]; 544 if (_typeof(value) == 'object') { 545 Object.entries(value).forEach(function (_ref3) { 546 var _ref4 = _slicedToArray(_ref3, 2), 547 sub_key = _ref4[0], 548 sub_value = _ref4[1]; 549 form_datas.append(key + '[' + sub_key + ']', sub_value); 550 }); 551 } else { 552 form_datas.append(key, value); 553 } 554 }); 555 myHeaders = new Headers(); 556 myHeaders.append('Content-Type', 'application/json'); 557 _context.next = 6; 558 return fetch(url, { 559 method: 'POST', 560 body: form_datas 561 }); 562 case 6: 563 response = _context.sent; 564 return _context.abrupt("return", response.json()); 565 case 8: 566 case "end": 567 return _context.stop(); 568 } 569 }, _callee); 570 }))(); 571 } 572}); 573 574/***/ }) 575/******/ ]); 576/************************************************************************/ 577/******/ // The module cache 578/******/ var __webpack_module_cache__ = {}; 579/******/ 580/******/ // The require function 581/******/ function __webpack_require__(moduleId) { 582/******/ // Check if module is in cache 583/******/ var cachedModule = __webpack_module_cache__[moduleId]; 584/******/ if (cachedModule !== undefined) { 585/******/ return cachedModule.exports; 586/******/ } 587/******/ // Create a new module (and put it into the cache) 588/******/ var module = __webpack_module_cache__[moduleId] = { 589/******/ // no module.id needed 590/******/ // no module.loaded needed 591/******/ exports: {} 592/******/ }; 593/******/ 594/******/ // Execute the module function 595/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 596/******/ 597/******/ // Return the exports of the module 598/******/ return module.exports; 599/******/ } 600/******/ 601/************************************************************************/ 602/******/ /* webpack/runtime/define property getters */ 603/******/ !function() { 604/******/ // define getter functions for harmony exports 605/******/ __webpack_require__.d = function(exports, definition) { 606/******/ for(var key in definition) { 607/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 608/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 609/******/ } 610/******/ } 611/******/ }; 612/******/ }(); 613/******/ 614/******/ /* webpack/runtime/hasOwnProperty shorthand */ 615/******/ !function() { 616/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 617/******/ }(); 618/******/ 619/******/ /* webpack/runtime/make namespace object */ 620/******/ !function() { 621/******/ // define __esModule on exports 622/******/ __webpack_require__.r = function(exports) { 623/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 624/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 625/******/ } 626/******/ Object.defineProperty(exports, '__esModule', { value: true }); 627/******/ }; 628/******/ }(); 629/******/ 630/************************************************************************/ 631var __webpack_exports__ = {}; 632// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. 633!function() { 634__webpack_require__.r(__webpack_exports__); 635/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); 636/* harmony import */ var _jquery_replace__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); 637function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 638function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 639function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 640function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 641function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 642function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 643function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 644/** 645 * 646 * Global 647 * 648 */ 649 650 651var prllx_active = true; 652window.addEventListener('DOMContentLoaded', function () { 653 /** Desktop - Pas de clic sur les menus avec sous-menu */ 654 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#header-desktop .main-menu li.has-submenu > a').on('click', function (el, e) { 655 e.preventDefault(); 656 if (el.attr('href') == '#') return false;
657 }); 658 659 /** Custom select */ 660 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('select').length > 0) { 661 new Choices(_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('select'), { 662 searchEnabled: false 663 }); 664 } 665 666 /** Events & news */ 667 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.block-list-events').forEach(function (el) { 668 var list = new listEvents(el); 669 list.update(); 670 }); 671 672 /** Posts list */ 673 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.block-list-posts').forEach(function (el) { 674 if (el.sAll('.pagination').length > 0) { 675 var list = new listPosts(el); 676 list.params.category = el.data('category'); 677 list.update(); 678 } 679 }); 680 681 /** Members map */ 682 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#map').length > 0) { 683 var membersList = new List(_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#list-members'), 'theme_members_list'); 684 membersList.load_all_btn = true; 685 membersList.pagination = true; 686 membersList.params.per_page = 8; 687 688 /** Members map */ 689 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map svg path, #map svg polygon').on('click', function (el) { 690 var $cont = _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map-country'); 691 var code = el.attr('id'); 692 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map svg path, #map svg path').removeClass('selected'); 693 if (membersList.params.country != code) { 694 var flag_code_exceptions = { 695 'bos': 'ba', 696 'ger': 'de', 697 'ko': 'xk', 698 'lat': 'lv', 699 'sp': 'es', 700 'swe': 'se', 701 'swi': 'ch', 702 'cr': 'hk', 703 'slova': 'sk', 704 'slove': 'si' 705 }; 706 var flag_code = code; 707 if (flag_code_exceptions[code]) flag_code = flag_code_exceptions[code]; 708 $cont.s('.flag img').addClass('old'); 709 var new_flag = document.createElement('img'); 710 new_flag.attr({ 711 src: 'https://flagcdn.com/w40/' + flag_code + '.png', 712 srcset: 'https://flagcdn.com/w80/' + flag_code + '.png 2x', 713 class: 'new', 714 style: 'transform:translateY(-100%)' 715 }); 716 $cont.s('.flag').append(new_flag); 717 $cont.s('.flag img.old').css('transform', 'translateY(100%)'); 718 $cont.s('.flag img.old').addEventListener('transitionstart', function () { 719 $cont.s('.flag img.new:not(.old)').css('transform', 'translateY(0%)'); 720 $cont.s('.flag img.new:not(.old)').addEventListener('transitionend', function () { 721 $cont.s('.flag img.old').remove(); 722 }, { 723 once: true 724 }); 725 }, { 726 once: true 727 }); 728 $cont.s('i').html(el.attr('title')); 729 730 /** Link is present */ 731 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('a#map-country').length > 0) { 732 var match = $cont.attr('href').match('\/#([a-z]{2})'); 733 if (match && match[1]) $cont.attr('href', _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map-country').attr('href').replace('#' + match[1], '#' + code)); 734 } else { 735 membersList.params.country = code; 736 } 737 $cont.removeClass('hidden'); 738 el.addClass('selected'); 739 } else { 740 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('body#tpl-members_partners').length > 0) { 741 membersList.params.country = false; 742 } 743 $cont.addClass('hidden'); 744 } 745 746 /** Reset listing parameters */ 747 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('body#tpl-members_partners').length > 0) { 748 membersList.pagination = true; 749 membersList.params.per_page = 8; 750 membersList.page = 1; 751 membersList.params.paged = 1; 752 membersList.update(); 753 } 754 }); 755 756 /** 757 * Members listing processing by the map 758 */ 759 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('body#tpl-members_partners').length > 0) { 760 var country = window.location.hash.replace('#', ''); 761 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map path').removeClass('selected'); 762 763 /** Country select (or not) in the map on page load */ 764 if (country) { 765 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map path[id="' + country + '"]').addClass('selected'); 766 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map-country img').attr('src', 'https://flagcdn.com/w40/' + country + '.png').attr('srcset', 'https://flagcdn.com/w80/' + country + '.png 2x'); 767 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map-country i').html(_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map path.selected').attr('title')); 768 } else { 769 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#map-country').addClass('hidden'); 770 } 771 772 /** List update on page load */ 773 membersList.params.country = country;
774 membersList.update(); 775 776 /** When a country is already selected in the home page, or linked */ 777 if (window.location.hash.replace('#', '')) { 778 setTimeout(function () { 779 window.scrollTo({ 780 top: _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#list-members').getOffset().top - _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s(_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('body').hasClass('device-touch') ? '#header-mobile' : '#header-desktop').height() - 150, 781 behavior: 'smooth' 782 }); 783 }, 2); 784 } 785 786 /** Load all members */ 787 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#list-members button.load-all').on('click', function ($el) { 788 if ($el.hasClass('hide')) { 789 $el.removeClass('hide'); 790 membersList.pagination = true; 791 membersList.params.per_page = 8; 792 } else { 793 $el.addClass('hide'); 794 membersList.pagination = false; 795 membersList.params.per_page = -1; 796 } 797 membersList.update(); 798 }); 799 } 800 } 801 802 /** 803 * Housing slider 804 */ 805 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.acf-block.template-slider').length > 0) { 806 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.acf-block.template-slider').forEach(function (el) { 807 var slider = { 808 current: 0, 809 last_i: 0, 810 update: function update() { 811 this.last_i = el.sAll('.element,figure').length - 1; 812 813 // this.current = index_new 814 815 if (this.current < 0) this.current = this.last_i; 816 if (this.current > this.last_i) this.current = 0; 817 el.sAll('.element,figure').removeClass('current'); 818 el.sAll('.element,figure')[this.current].addClass('current'); 819 el.sAll('.pagination button').removeClass('current'); 820 el.sAll('.pagination button[data-index="' + this.current + '"]').addClass('current'); 821 } 822 }; 823 var boardH = 0; 824 el.sAll('.element,figure').forEach(function (el) { 825 if (el.height() > boardH) boardH = el.height(); 826 }); 827 el.s('.slider').style.height = boardH + 'px'; 828 el.sAll('.element,figure')[0].addClass('current'); 829 el.sAll('.pagination button')[0].addClass('current'); 830 el.sAll('button.prev, button.next').on('click', function (el) { 831 if (el.attr('class') == 'next') slider.current += 1;else slider.current -= 1; 832 slider.update(); 833 }); 834 el.sAll('.pagination button').on('click', function (el) { 835 slider.current = el.data('index'); 836 slider.update(); 837 }); 838 }); 839 } 840 841 /** Login pop-in */ 842 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#login').length > 0) { 843 /** Show login form */ 844 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.btn-login:not(.logged)').on('click', function () { 845 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#popin-login').addClass('open'); 846 }); 847 848 /** Login form submit */ 849 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login').on('submit', function (el, e) { 850 e.preventDefault(); 851 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].ajaxPost(theme_vars.ajax_url, { 852 action: 'theme_login', 853 login: _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login input[name="login"]').val(), 854 pwd: _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login input[name="pwd"]').val(), 855 nonce: _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login input[name="_wpnonce_login"]').val() 856 }).then(function (resp) { 857 if (resp.success == true) { 858 var datas = { 859 'event': 'login', 860 'userId': resp.id, 861 'emailAddress': resp.email 862 }; 863 if (resp.organisation) datas.organisation = resp.organisation; 864 if (resp.country) datas.country = resp.country; 865 window.dataLayer = window.dataLayer || []; 866 window.dataLayer.push(datas); 867 window.location.reload(); 868 } else { 869 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login .notices').empty();
870 resp.forEach(function (notice) { 871 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login .notices').innerHTML += '<span class="error ' + notice.id + '">' + notice.txt + '</span>'; 872 }); 873 } 874 }); 875 return false; 876 }); 877 878 /** Reset password */ 879 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#reset-pwd').on('click', function () { 880 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].ajaxPost(theme_vars.ajax_url, { 881 action: 'theme_reset_pwd', 882 email: _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login input[name="login"]').val(), 883 nonce: _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login input[name="_wpnonce_login"]').val() 884 }).then(function (resp) { 885 if (resp.success) _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login .notices').html('<span class="success">' + resp.success + '</span>');else _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login .notices').html('<span class="error">' + resp.error + '</span>'); 886 }); 887 }); 888 889 /** Login form close */ 890 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#popin-login .close').on('click', function () { 891 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#popin-login').removeClass('open'); 892 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#login .notice').html(''); 893 }); 894 } 895 896 /** Input date label display */ 897 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('input[type="date"]').on('change', function (el) { 898 if (el.val() != '') el.addClass('date-is-selected');else el.removeClass('date-is-selected'); 899 }); 900 901 /** Projects map */ 902 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#projects-map').length > 0) { 903 var map = new _map__WEBPACK_IMPORTED_MODULE_0__["default"]('projects-map', typeof map_params != 'undefined' ? map_params : false); 904 map.update(map_markers); 905 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#projects-map-filters button').on('click', function (el) { 906 var categories = []; 907 el.toggleClass('selected'); 908 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#projects-map-filters button.selected').forEach(function (el) { 909 categories.push(el.value); 910 }); 911 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].ajaxPost(theme_vars.ajax_url, { 912 action: 'theme_projects_list', 913 categories: categories 914 }).then(function (resp) { 915 map.update(resp); 916 }); 917 }); 918 } 919 920 /** Parallax */ 921 if (prllx_active == true) { 922 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.text-2-columns').length > 0) { 923 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.text-2-columns').prllx({ 924 trigger_offset: window.innerHeight / 2 * -1 925 }); 926 } 927 928 // if ( jq.sAll('.double-img-33-66,.double-img-66-33').length > 0 && !jq.s('body').hasClass('device-phone') ) { 929 930 // jq.sAll('.double-img-33-66 .acf-image img, .double-img-66-33 .acf-image img').prllx({ 931 // trigger_offset : window.innerHeight * -1, 932 // scroll_area : window.innerHeight * 2, 933 // }) 934 935 // } 936 937 /** Landing initialisation */ 938 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.landing').length > 0) { 939 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.landing').addClass('init'); 940 } 941 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.section-video').length > 0) { 942 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.section-video').prllx({ 943 trigger_offset: window.innerHeight / 2 * -1 944 // debugger : true, 945 }); 946 } 947 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('section.img-text').length > 0 && !_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('body').hasClass('device-phone')) { 948 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('section.img-text .acf-image img, section.img-text .acf-wysiwyg').prllx({ 949 trigger_offset: window.innerHeight * -1, 950 scroll_area: window.innerHeight * 2 951 }); 952 } 953 954 /** Files list */ 955 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.acf-files').length > 0) { 956 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.acf-files').prllx({ 957 trigger_offset: window.innerHeight / 1.2 * -1 958 }); 959 } 960 961 /** Podcast episodes */ 962 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#podcast-episodes .acf-block').length > 0) { 963 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#podcast-episodes .acf-blocks').prllx({ 964 trigger_offset: window.innerHeight / 2 * -1 965 }); 966 } 967 968 /** Classic animation, must stay last ! */ 969 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('section.acf-row:not(.section-vi
969deo):not(.section-img-text):not(.text-2-columns) .acf-title').length > 0 && !_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('body').hasClass('device-phone')) { 970 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('section.acf-row:not(.section-video):not(.section-img-text):not(.text-2-columns)').prllx({ 971 trigger_offset: window.innerHeight / 2 * -1 972 // debugger : true, 973 }); 974 } 975 } 976}); 977 978/** 979 * Event list 980 */ 981var listEvents = /*#__PURE__*/function () { 982 function listEvents(container) { 983 _classCallCheck(this, listEvents); 984 _defineProperty(this, "$cont", false); 985 _defineProperty(this, "$pagination", false); 986 _defineProperty(this, "page", 1); 987 _defineProperty(this, "total", 0); 988 _defineProperty(this, "last_page", 1); 989 var _this = this; 990 _this.$cont = container; 991 _this.$pagination = _this.$cont.s('.pagination'); 992 _this.$cont.s('.events-filters').on('submit', function (elmt, e) { 993 _this.update(); 994 e.preventDefault(); 995 return false; 996 }); 997 _this.$cont.s('.past-incoming button').on('click', function (elmt) { 998 if (elmt.hasClass('selected')) return false; 999 _this.$cont.s('.past-incoming button').removeClass('selected'); 1000 elmt.addClass('selected'); 1001 _this.update(); 1002 }); 1003 } 1004 return _createClass(listEvents, [{ 1005 key: "update", 1006 value: function update() { 1007 var _this = this; 1008 var params = { 1009 action: 'theme_events_list', 1010 search: _this.$cont.s('.filters-search').val(), 1011 paged: _this.page 1012 }; 1013 if (_this.$cont.s('.filters-category').val()) params.category = _this.$cont.s('.filters-category').val(); 1014 if (_this.$cont.data('category')) params.category = _this.$cont.data('category'); 1015 if (_this.$cont.data('past_incoming')) params.past = _this.$cont.s('.past-incoming button.past').hasClass('selected') ? 1 : 0; 1016 if (_this.$cont.s('#date-from').val()) params.from = _this.$cont.s('#date-from').val(); 1017 if (_this.$cont.s('#date-to').val()) params.to = _this.$cont.s('#date-to').val(); 1018 _this.$cont.s('.loader').addClass('visible'); 1019 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].ajaxPost(theme_vars.ajax_url, params).then(function (resp) { 1020 _this.total = resp.found_posts; 1021 _this.last_page = resp.max_num_pages; 1022 _this.$cont.s('.events-list').html(resp.html); 1023 if (_this.page == 1) { 1024 _this.$pagination.s('button.prev').addClass('disabled'); 1025 } else { 1026 _this.$pagination.s('button.prev').removeClass('disabled'); 1027 } 1028 if (_this.page == _this.last_page) _this.$pagination.s('button.next').addClass('disabled');else _this.$pagination.s('button.next').removeClass('disabled'); 1029 if (_this.last_page > 1) { 1030 _this.$pagination.s('.pages').html(resp.pagination_html); 1031 _this.$pagination.removeClass('hidden'); 1032 } else { 1033 _this.$pagination.addClass('hidden'); 1034 } 1035 1036 /** Init pagination */ 1037 _this.$pagination.s('button').on('click', function (el) { 1038 if (el.hasClass('selected')) return false; 1039 if (el.hasClass('prev')) _this.page -= 1; 1040 if (el.hasClass('next')) _this.page += 1; 1041 if (el.hasClass('page')) _this.page = parseInt(el.data('paged')); 1042 _this.update(); 1043 }); 1044 _this.$cont.s('.loader').removeClass('visible'); 1045 }); 1046 } 1047 }]); 1048}(); 1049/** 1050 * Posts list 1051 */ 1052var listPosts = /*#__PURE__*/function () { 1053 function listPosts(container) { 1054 _classCallCheck(this, listPosts); 1055 _defineProperty(this, "$cont", false); 1056 _defineProperty(this, "$pagination", false); 1057 _defineProperty(this, "page", 1); 1058 _defineProperty(this, "total", 0); 1059 _defineProperty(this, "last_page", 1); 1060 _defineProperty(this, "params", {}); 1061 var _this = this; 1062 _this.$cont = container; 1063 _this.$pagination = _this.$cont.s('.pagination'); 1064 } 1065 return _createClass(listPosts, [{ 1066 key: "update", 1067 value: function update() { 1068 var _this = this; 1069 _this.$cont.s('.loader').addClass('visible'); 1070 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].ajaxPost(theme_vars.ajax_url, { 1071 action: 'theme_posts_list', 1072 paged: _this.page, 1073 number: _this.$cont.data('number'), 1074 params: _this.params 1075 }).then(function (resp) { 1076 _this.total = resp.found_posts; 1077 _this.last_page = resp.max_num_pages; 1078 _this.$cont.s('.list').html(resp.html); 1079 if (_this.page == 1) { 1080 _this.$pagination.s('button.prev').addClass('disabled'); 1081 } else { 1082 _this.$pagination.s('button.prev').removeClass('disabled'); 1083 } 1084 if (_this.page == _this.last_page) { 1085 _this.$pagination.s('button.next').addClass('disabled'); 1086 } else { 1087 _this.$pagination.s('button.next').removeClass('disabled'); 1088 } 1089 if (_this.last_page > 1) { 1090 _this.$pagination.s('.pages').html(resp.pagination_html); 1091 _this.$pagination.removeClass('hidden'); 1092 } else { 1093 _this.$pagination.addClass('hidden'); 1094 } 1095 _this.$pagination.s('button').on('click', function (el) { 1096 if (el.hasClass('selected')) return false;
1097 if (el.hasClass('prev')) _this.page -= 1; 1098 if (el.hasClass('next')) _this.page += 1; 1099 if (el.hasClass('page')) _this.page = parseInt(el.data('paged')); 1100 _this.update(); 1101 }); 1102 _this.$cont.s('.loader').removeClass('visible'); 1103 }); 1104 } 1105 }]); 1106}(); 1107/** 1108 * Elements list 1109 */ 1110var List = /*#__PURE__*/function () { 1111 function List(container, ajax_action) { 1112 _classCallCheck(this, List); 1113 _defineProperty(this, "$cont", false); 1114 _defineProperty(this, "$pagination", false); 1115 _defineProperty(this, "pagination", true); 1116 _defineProperty(this, "page", 1); 1117 _defineProperty(this, "total", 0); 1118 _defineProperty(this, "last_page", 1); 1119 _defineProperty(this, "ajax_action", ''); 1120 // Wordpress ajax action 1121 _defineProperty(this, "params", {}); 1122 _defineProperty(this, "load_all_btn", false); 1123 var _this = this; 1124 _this.$cont = container; 1125 _this.$pagination = _this.$cont.s('.pagination'); 1126 _this.ajax_action = ajax_action; 1127 } 1128 return _createClass(List, [{ 1129 key: "update", 1130 value: function update() { 1131 var _this = this; 1132 _this.$cont.s('.loader').addClass('visible'); 1133 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].ajaxPost(theme_vars.ajax_url, { 1134 action: _this.ajax_action, 1135 paged: _this.page, 1136 params: _this.params 1137 }).then(function (resp) { 1138 _this.total = resp.found_posts; 1139 _this.last_page = resp.max_num_pages; 1140 _this.$cont.s('.list').html(resp.html); 1141 if (_this.page == 1) { 1142 _this.$pagination.s('button.prev').addClass('disabled'); 1143 } else { 1144 _this.$pagination.s('button.prev').removeClass('disabled'); 1145 } 1146 if (_this.page == _this.last_page) { 1147 _this.$pagination.s('button.next').addClass('disabled'); 1148 } else { 1149 _this.$pagination.s('button.next').removeClass('disabled'); 1150 } 1151 if (_this.last_page > 1) { 1152 _this.$pagination.s('.pages').html(resp.pagination_html); 1153 _this.$pagination.removeClass('hidden'); 1154 } else { 1155 _this.$pagination.addClass('hidden'); 1156 } 1157 1158 /** _this.pagination is reversed because value is changed before */ 1159 if (_this.load_all_btn == true && resp.found_posts > _this.params.per_page) { 1160 _this.$cont.s('button.load-all').removeClass('hidden'); 1161 } else { 1162 _this.$cont.s('button.load-all').addClass('hidden'); 1163 } 1164 _this.$pagination.s('button').on('click', function (el) { 1165 if (el.hasClass('selected')) return false; 1166 if (el.hasClass('prev')) _this.page -= 1; 1167 if (el.hasClass('next')) _this.page += 1; 1168 if (el.hasClass('page')) _this.page = parseInt(el.data('paged')); 1169 _this.update(); 1170 }); 1171 _this.$cont.s('.loader').removeClass('visible'); 1172 }); 1173 } 1174 }]); 1175}(); 1176/** 1177 * Youtube iFrame API 1178 */ 1179window.onYouTubeIframeAPIReady = function () { 1180 if (!_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.yt-video').data('video-url')) return false; 1181 var match = _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.yt-video').data('video-url').match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/); 1182 var videoId = match && match[7] ? match[7] : false; 1183 videoId = videoId.replace(' ', ''); 1184 if (videoId && videoId.length == 11) { 1185 // let video_time = 0; 1186 player = new YT.Player(_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.yt-video'), _defineProperty(_defineProperty(_defineProperty(_defineProperty({ 1187 height: '720', 1188 width: '1280', 1189 videoId: videoId 1190 }, "videoId", match[7]), "playerVars", { 1191 autoplay: 0, 1192 controls: 0, 1193 showinfo: 0, 1194 rel: 0, 1195 iv_load_policy: 3, 1196 modestbranding: 1, 1197 mute: 0, 1198 disablekb: 1 1199 // loop : 1, 1200 }), "events", { 1201 onReady: function onReady() { 1202 1203 // /** Délai pour éviter l'apparition de l'UI Youtube */ 1204 // window.setTimeout(function() { 1205 // jq.s('#banner').addClass('video-playing'); 1206 // }, 1000 ); 1207 }, 1208 onStateChange: function onStateChange(event) { 1209 1210 // console.log( YT.PlayerState.PAUSED ); 1211 // video_time = event.target.playerInfo.duration; 1212 // if ( event.data == 0 ) jq.s('#banner').removeClass('video-ready'); 1213 } 1214 }), "suggestedQuality", 'hd720')); 1215 1216 // let iframeWindow = player.getIframe().contentWindow; // This is the source "window" that will emit the events. 1217 // let lastTimeUpdate = 0; // So we can compare against new updates. 1218 1219 // // Listen to events triggered by postMessage, 1220 // // this is how different windows in a browser 1221 // // (such as a popup or iFrame) can communicate. 1222 // // See: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage 1223 // window.addEventListener( 'message', function( event ) { 1224 1225 // // Check that the event was sent from the YouTube IFrame. 1226 // if ( event.source === iframeWindow ) { 1227 1228 // let data = JSON.parse( event.data ); 1229 1230 // // The "infoDelivery" event is used by YT to transmit any 1231 // // kind of information change in the player, 1232 // // such as the current time or a playback quality change. 1233 // if ( 1234 // data.event === "infoDelivery" && 1235 // data.info && 1236 // data.info.currentTime 1237 // ) { 1238 // // currentTime is emitted very frequently, 1239 // // but we only care about whole second changes. 1240 // let time = Math.floor( data.info.currentTime ); 1241 1242 // if ( time !== lastTimeUpdate ) { 1243 1244 // lastTimeUpdate = time; 1245 1246 // // /** Cache la vidéo 3s avant la fin */ 1247 // // if ( video_time - time < 3 ) jq.s('#banner').removeClass('video-playing'); 1248 1249 // } 1250 1251 // } 1252 1253 // } 1254 1255 // }); 1256 1257 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.acf-video').on('click', function (elmt) { 1258 if (elmt.hasClass('playing')) { 1259 player.pauseVideo(); 1260 } else { 1261 player.playVideo(); 1262 } 1263 elmt.toggleClass('playing'); 1264 }); 1265 } 1266}; 1267/** 1268 * 1269 * @page Home/Front page 1270 * 1271 */ 1272 1273 1274_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].documentReady(function () { 1275 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#landing .acf-blocks').addClass('init'); 1276 1277 /** Q&A animation */ 1278 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.acf-qna .block-qna').on('click', function (el, e) { 1279 e.preventDefault(); 1280 if (_jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('.acf-qna .block-qna.open').length == 0) { 1281 // No submenu open 1282 1283 var submenu = el.s('.block-content'); 1284 1285 /** Show the container. */ 1286 el.addClass('open'); 1287 submenu.style.height = 'auto'; 1288 1289 /** Get the computed height of the container. */ 1290 var height = submenu.clientHeight + 'px'; 1291 1292 /** Set the height of the content as 0px, */ 1293 /** so we can trigger the slide down animation. */ 1294 submenu.style.height = '0px'; 1295 1296 /** Do this after the 0px has applied. */ 1297 /** It's like a delay or something. MAGIC! */ 1298 setTimeout(function () { 1299 submenu.style.height = height; 1300 }, 0); 1301 } else { 1302 // Submenu open 1303 1304 var _submenu = el.s('.block-content'); 1305 var opened = _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.acf-qna .block-qna.open'); 1306 1307 /** Slide Up opened menu */ 1308 1309 /** Set the height as 0px to trigger the slide up animation. */ 1310 opened.s('.block-content').style.height = '0px'; 1311 1312 /** Remove the `active` class when the animation ends. */ 1313 opened.s('.block-content').addEventListener('transitionend', function () { 1314 opened.removeClass('open'); 1315 }, { 1316 once: true 1317 }); 1318 1319 /** Clicked element is not already the opened element */ 1320 if (!el.hasClass('open')) { 1321 /** Show the container. */ 1322 el.addClass('open'); 1323 _submenu.style.height = 'auto'; 1324 1325 /** Get the computed height of the container. */ 1326 var _height = _submenu.clientHeight + 'px'; 1327 1328 /** Set the height of the content as 0px, */ 1329 /** so we can trigger the slide down animation. */ 1330 _submenu.style.height = '0px'; 1331 1332 /** Do this after the 0px has applied. */ 1333 /** It's like a delay or something. MAGIC! */ 1334 setTimeout(function () { 1335 _submenu.style.height = _height; 1336 }, 0); 1337 } 1338 } 1339 return false;
1340 }); 1341 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('.acf-qna .block-qna').on('click', function (el) { 1342 var list = el.parents('.acf-qna'); 1343 var open = el.hasClass('open'); 1344 list.find('.block-qna').removeClass('open'); 1345 if (!open) el.addClass('open'); 1346 }); 1347 home_slider.init(); 1348 if (prllx_active == true) { 1349 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#landing .acf-slider img').prllx({ 1350 start_pos: 1, 1351 gap_area: 0.8 1352 }); 1353 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#our-network').prllx({ 1354 trigger_offset: window.innerHeight / 2 * -1 1355 }); 1356 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].sAll('#mythbusters-misconceptions').prllx({ 1357 trigger_offset: window.innerHeight / 3 * -1 1358 }); 1359 1360 /** Fix scroll bug */ 1361 window.setTimeout(function () { 1362 window.scrollTo({ 1363 top: 0, 1364 left: 0, 1365 behavior: 'instant' 1366 }); 1367 }, 100); 1368 } 1369}); 1370var home_slider = { 1371 elmts: [], 1372 total: 0, 1373 index: 0, 1374 interval: false, 1375 init: function init() { 1376 var _this = this; 1377 this.elmts = _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#landing').sAll('element,figure'); 1378 this.total = this.elmts.length; 1379 this.elmts[0].addClass('current'); 1380 this.interval = window.setInterval(function () { 1381 _this.index = _this.index + 1; 1382 if (_this.index >= _this.total) _this.index = 0; 1383 _jquery_replace__WEBPACK_IMPORTED_MODULE_1__["default"].s('#landing figure').removeClass('current'); 1384 _this.elmts[_this.index].addClass('current'); 1385 }, 10000); 1386 } 1387}; 1388}(); 1389/******/ })() 1390;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.