| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ "use strict"; |
| 3 |
/******/ var __webpack_modules__ = ({ |
| 4 |
|
| 5 |
/***/ "../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js": |
| 6 |
/*!******************************************************************************!*\ |
| 7 |
!*** ../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! |
| 8 |
\******************************************************************************/ |
| 9 |
/*! unknown exports (runtime-defined) */ |
| 10 |
/*! runtime requirements: module */ |
| 11 |
/*! CommonJS bailout: module.exports is used directly at 39:0-14 */ |
| 12 |
/***/ ((module) => { |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
| 17 |
try { |
| 18 |
var info = gen[key](arg); |
| 19 |
var value = info.value; |
| 20 |
} catch (error) { |
| 21 |
reject(error); |
| 22 |
return; |
| 23 |
} |
| 24 |
|
| 25 |
if (info.done) { |
| 26 |
resolve(value); |
| 27 |
} else { |
| 28 |
Promise.resolve(value).then(_next, _throw); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
function _asyncToGenerator(fn) { |
| 33 |
return function () { |
| 34 |
var self = this, |
| 35 |
args = arguments; |
| 36 |
return new Promise(function (resolve, reject) { |
| 37 |
var gen = fn.apply(self, args); |
| 38 |
|
| 39 |
function _next(value) { |
| 40 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); |
| 41 |
} |
| 42 |
|
| 43 |
function _throw(err) { |
| 44 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); |
| 45 |
} |
| 46 |
|
| 47 |
_next(undefined); |
| 48 |
}); |
| 49 |
}; |
| 50 |
} |
| 51 |
|
| 52 |
module.exports = _asyncToGenerator; |
| 53 |
|
| 54 |
/***/ }), |
| 55 |
|
| 56 |
/***/ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js": |
| 57 |
/*!****************************************************************************!*\ |
| 58 |
!*** ../../../../../node_modules/@babel/runtime/helpers/defineProperty.js ***! |
| 59 |
\****************************************************************************/ |
| 60 |
/*! unknown exports (runtime-defined) */ |
| 61 |
/*! runtime requirements: module */ |
| 62 |
/*! CommonJS bailout: module.exports is used directly at 18:0-14 */ |
| 63 |
/***/ ((module) => { |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
function _defineProperty(obj, key, value) { |
| 68 |
if (key in obj) { |
| 69 |
Object.defineProperty(obj, key, { |
| 70 |
value: value, |
| 71 |
enumerable: true, |
| 72 |
configurable: true, |
| 73 |
writable: true |
| 74 |
}); |
| 75 |
} else { |
| 76 |
obj[key] = value; |
| 77 |
} |
| 78 |
|
| 79 |
return obj; |
| 80 |
} |
| 81 |
|
| 82 |
module.exports = _defineProperty; |
| 83 |
|
| 84 |
/***/ }), |
| 85 |
|
| 86 |
/***/ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js": |
| 87 |
/*!***********************************************************************************!*\ |
| 88 |
!*** ../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! |
| 89 |
\***********************************************************************************/ |
| 90 |
/*! unknown exports (runtime-defined) */ |
| 91 |
/*! runtime requirements: module */ |
| 92 |
/*! CommonJS bailout: module.exports is used directly at 9:0-14 */ |
| 93 |
/***/ ((module) => { |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
function _interopRequireDefault(obj) { |
| 98 |
return obj && obj.__esModule ? obj : { |
| 99 |
"default": obj |
| 100 |
}; |
| 101 |
} |
| 102 |
|
| 103 |
module.exports = _interopRequireDefault; |
| 104 |
|
| 105 |
/***/ }), |
| 106 |
|
| 107 |
/***/ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js": |
| 108 |
/*!************************************************************************************!*\ |
| 109 |
!*** ../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js ***! |
| 110 |
\************************************************************************************/ |
| 111 |
/*! unknown exports (runtime-defined) */ |
| 112 |
/*! runtime requirements: module, __webpack_require__ */ |
| 113 |
/*! CommonJS bailout: module.exports is used directly at 57:0-14 */ |
| 114 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../../../../../node_modules/@babel/runtime/helpers/typeof.js"); |
| 119 |
|
| 120 |
function _getRequireWildcardCache() { |
| 121 |
if (typeof WeakMap !== "function") return null; |
| 122 |
var cache = new WeakMap(); |
| 123 |
|
| 124 |
_getRequireWildcardCache = function _getRequireWildcardCache() { |
| 125 |
return cache; |
| 126 |
}; |
| 127 |
|
| 128 |
return cache; |
| 129 |
} |
| 130 |
|
| 131 |
function _interopRequireWildcard(obj) { |
| 132 |
if (obj && obj.__esModule) { |
| 133 |
return obj; |
| 134 |
} |
| 135 |
|
| 136 |
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { |
| 137 |
return { |
| 138 |
"default": obj |
| 139 |
}; |
| 140 |
} |
| 141 |
|
| 142 |
var cache = _getRequireWildcardCache(); |
| 143 |
|
| 144 |
if (cache && cache.has(obj)) { |
| 145 |
return cache.get(obj); |
| 146 |
} |
| 147 |
|
| 148 |
var newObj = {}; |
| 149 |
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; |
| 150 |
|
| 151 |
for (var key in obj) { |
| 152 |
if (Object.prototype.hasOwnProperty.call(obj, key)) { |
| 153 |
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; |
| 154 |
|
| 155 |
if (desc && (desc.get || desc.set)) { |
| 156 |
Object.defineProperty(newObj, key, desc); |
| 157 |
} else { |
| 158 |
newObj[key] = obj[key]; |
| 159 |
} |
| 160 |
} |
| 161 |
} |
| 162 |
|
| 163 |
newObj["default"] = obj; |
| 164 |
|
| 165 |
if (cache) { |
| 166 |
cache.set(obj, newObj); |
| 167 |
} |
| 168 |
|
| 169 |
return newObj; |
| 170 |
} |
| 171 |
|
| 172 |
module.exports = _interopRequireWildcard; |
| 173 |
|
| 174 |
/***/ }), |
| 175 |
|
| 176 |
/***/ "../../../../../node_modules/@babel/runtime/helpers/typeof.js": |
| 177 |
/*!********************************************************************!*\ |
| 178 |
!*** ../../../../../node_modules/@babel/runtime/helpers/typeof.js ***! |
| 179 |
\********************************************************************/ |
| 180 |
/*! unknown exports (runtime-defined) */ |
| 181 |
/*! runtime requirements: module */ |
| 182 |
/*! CommonJS bailout: module.exports is used directly at 7:4-18 */ |
| 183 |
/*! CommonJS bailout: module.exports is used directly at 11:4-18 */ |
| 184 |
/*! CommonJS bailout: module.exports is used directly at 19:0-14 */ |
| 185 |
/***/ ((module) => { |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
function _typeof(obj) { |
| 190 |
"@babel/helpers - typeof"; |
| 191 |
|
| 192 |
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
| 193 |
module.exports = _typeof = function _typeof(obj) { |
| 194 |
return typeof obj; |
| 195 |
}; |
| 196 |
} else { |
| 197 |
module.exports = _typeof = function _typeof(obj) { |
| 198 |
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
| 199 |
}; |
| 200 |
} |
| 201 |
|
| 202 |
return _typeof(obj); |
| 203 |
} |
| 204 |
|
| 205 |
module.exports = _typeof; |
| 206 |
|
| 207 |
/***/ }), |
| 208 |
|
| 209 |
/***/ "../include/js/front-end/src/Components/Modal.js": |
| 210 |
/*!*******************************************************!*\ |
| 211 |
!*** ../include/js/front-end/src/Components/Modal.js ***! |
| 212 |
\*******************************************************/ |
| 213 |
/*! flagged exports */ |
| 214 |
/*! export Modal [provided] [no usage info] [missing usage info prevents renaming] */ |
| 215 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 216 |
/*! other exports [not provided] [no usage info] */ |
| 217 |
/*! runtime requirements: __webpack_exports__ */ |
| 218 |
/***/ ((__unused_webpack_module, exports) => { |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
Object.defineProperty(exports, "__esModule", ({ |
| 223 |
value: true |
| 224 |
})); |
| 225 |
exports.Modal = void 0; |
| 226 |
|
| 227 |
/* |
| 228 |
* Photonic Modal |
| 229 |
* Used as the overlay panel |
| 230 |
* License: MIT |
| 231 |
*/ |
| 232 |
var Modal = function Modal(modal, options) { |
| 233 |
var body = document.body; //Defaults |
| 234 |
|
| 235 |
var settings = Object.assign({ |
| 236 |
modalTarget: 'photonicModal', |
| 237 |
closeCSS: '', |
| 238 |
closeFromRight: 0, |
| 239 |
width: '80%', |
| 240 |
height: '100%', |
| 241 |
top: '0px', |
| 242 |
left: '0px', |
| 243 |
zIndexIn: '9999', |
| 244 |
zIndexOut: '-9999', |
| 245 |
color: '#39BEB9', |
| 246 |
opacityIn: '1', |
| 247 |
opacityOut: '0', |
| 248 |
animationDuration: '.6s', |
| 249 |
overflow: 'auto' |
| 250 |
}, options); |
| 251 |
var overlay = document.querySelector('.photonicModalOverlay'), |
| 252 |
scrollable = document.querySelector('.photonicModalOverlayScrollable'); |
| 253 |
|
| 254 |
if (!overlay) { |
| 255 |
overlay = document.createElement('div'); |
| 256 |
overlay.className = 'photonicModalOverlay'; |
| 257 |
scrollable = document.createElement('div'); |
| 258 |
scrollable.className = 'photonicModalOverlayScrollable'; |
| 259 |
overlay.appendChild(scrollable); |
| 260 |
body.appendChild(overlay); |
| 261 |
} |
| 262 |
|
| 263 |
var closeIcon = modal.querySelector('.photonicModalClose'); |
| 264 |
|
| 265 |
if (!closeIcon) { |
| 266 |
closeIcon = document.createElement('a'); |
| 267 |
closeIcon.className = 'photonicModalClose ' + settings.closeCSS; |
| 268 |
closeIcon.style.right = settings.closeFromRight; |
| 269 |
closeIcon.innerHTML = '×'; |
| 270 |
closeIcon.setAttribute('href', '#'); |
| 271 |
modal.insertAdjacentElement('afterbegin', closeIcon); |
| 272 |
} |
| 273 |
|
| 274 |
closeIcon = modal.querySelector('.photonicModalClose'); |
| 275 |
var id = document.querySelector('#' + settings.modalTarget); // Default Classes |
| 276 |
// id.addClass('photonicModal'); |
| 277 |
// id.addClass(settings.modalTarget+'-off'); |
| 278 |
//Init styles |
| 279 |
|
| 280 |
var initStyles = { |
| 281 |
'width': settings.width, |
| 282 |
'height': settings.height, |
| 283 |
'top': settings.top, |
| 284 |
'left': settings.left, |
| 285 |
'background-color': settings.color, |
| 286 |
'overflow-y': settings.overflow, |
| 287 |
'z-index': settings.zIndexOut, |
| 288 |
'opacity': settings.opacityOut, |
| 289 |
'-webkit-animation-duration': settings.animationDuration, |
| 290 |
'-moz-animation-duration': settings.animationDuration, |
| 291 |
'-ms-animation-duration': settings.animationDuration, |
| 292 |
'animation-duration': settings.animationDuration |
| 293 |
}; |
| 294 |
|
| 295 |
if (id) { |
| 296 |
id.classList.add('photonicModal'); |
| 297 |
id.classList.add(settings.modalTarget + '-off'); |
| 298 |
var style = ''; |
| 299 |
|
| 300 |
for (var [key, value] of Object.entries(initStyles)) { |
| 301 |
style += "".concat(key, ": ").concat(value, "; "); |
| 302 |
} |
| 303 |
|
| 304 |
id.style.cssText += style; // initStyles.reduce((a, v, i) => a + i + ': ' + v + ';'); |
| 305 |
|
| 306 |
open(id); |
| 307 |
} |
| 308 |
|
| 309 |
closeIcon.addEventListener('click', function (event) { |
| 310 |
event.preventDefault(); |
| 311 |
document.documentElement.style.overflow = 'auto'; |
| 312 |
document.body.style.overflow = 'auto'; |
| 313 |
|
| 314 |
if (id.classList.contains(settings.modalTarget + '-on')) { |
| 315 |
id.classList.remove(settings.modalTarget + '-on'); |
| 316 |
id.classList.add(settings.modalTarget + '-off'); |
| 317 |
} |
| 318 |
|
| 319 |
if (id.classList.contains(settings.modalTarget + '-off')) { |
| 320 |
id.addEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', afterClose, { |
| 321 |
once: true |
| 322 |
}); |
| 323 |
} |
| 324 |
|
| 325 |
id.style.overflowY = 'hidden'; |
| 326 |
slideUp(id); // Util.slideUpDown(id.closest('.photonicModalOverlayScrollable'), 'hide'); |
| 327 |
|
| 328 |
overlay.style.overflowY = 'hidden'; // Util.fadeOut(overlay); |
| 329 |
|
| 330 |
overlay.style.display = 'none'; |
| 331 |
}); |
| 332 |
|
| 333 |
function slideDown(element) { |
| 334 |
element.style.height = 'auto'; |
| 335 |
element.style.height = "".concat(element.scrollHeight, "px"); |
| 336 |
element.style.height = 'auto'; |
| 337 |
} |
| 338 |
|
| 339 |
var slideUp = element => { |
| 340 |
element.style.height = 0; |
| 341 |
element.style.display = 'none'; |
| 342 |
}; |
| 343 |
|
| 344 |
function open(el) { |
| 345 |
document.documentElement.style.overflow = 'hidden'; |
| 346 |
document.body.style.overflow = 'hidden'; |
| 347 |
|
| 348 |
if (el.classList.contains(settings.modalTarget + '-off')) { |
| 349 |
el.classList.remove(settings.modalTarget + '-off'); |
| 350 |
el.classList.add(settings.modalTarget + '-on'); |
| 351 |
} |
| 352 |
|
| 353 |
if (el.classList.contains(settings.modalTarget + '-on')) { |
| 354 |
el.style.opacity = settings.opacityIn; |
| 355 |
el.style.zIndex = settings.zIndexIn; |
| 356 |
} |
| 357 |
|
| 358 |
overlay.style.overflowY = settings.overflow; |
| 359 |
overlay.style.display = 'block'; // Util.fadeIn(overlay); |
| 360 |
|
| 361 |
scrollable.appendChild(el); |
| 362 |
el.style.display = 'block'; |
| 363 |
el.style.overflowY = settings.overflow; |
| 364 |
slideDown(scrollable); // Util.slideUpDown(scrollable, 'show'); |
| 365 |
} |
| 366 |
|
| 367 |
function afterClose() { |
| 368 |
id.style.zIndex = settings.zIndexOut; |
| 369 |
} |
| 370 |
}; |
| 371 |
|
| 372 |
exports.Modal = Modal; |
| 373 |
|
| 374 |
/***/ }), |
| 375 |
|
| 376 |
/***/ "../include/js/front-end/src/Components/Prompter.js": |
| 377 |
/*!**********************************************************!*\ |
| 378 |
!*** ../include/js/front-end/src/Components/Prompter.js ***! |
| 379 |
\**********************************************************/ |
| 380 |
/*! flagged exports */ |
| 381 |
/*! export Prompter [provided] [no usage info] [missing usage info prevents renaming] */ |
| 382 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 383 |
/*! other exports [not provided] [no usage info] */ |
| 384 |
/*! runtime requirements: __webpack_exports__ */ |
| 385 |
/***/ ((__unused_webpack_module, exports) => { |
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
Object.defineProperty(exports, "__esModule", ({ |
| 390 |
value: true |
| 391 |
})); |
| 392 |
exports.Prompter = void 0; |
| 393 |
|
| 394 |
/** |
| 395 |
* Photonic Prompter |
| 396 |
* Used for interactive dialogs, e.g. the Photonic password prompter. |
| 397 |
* |
| 398 |
* GPL v3.0 |
| 399 |
*/ |
| 400 |
|
| 401 |
/* |
| 402 |
* var myPrompter = Prompter('htmlID'); |
| 403 |
* |
| 404 |
* id: The HTML id of the object |
| 405 |
*/ |
| 406 |
class Prompter { |
| 407 |
constructor(id) { |
| 408 |
this.events = { |
| 409 |
onShow: new Event('onShow'), |
| 410 |
onConfirm: new Event('onConfirm'), |
| 411 |
onHide: new Event('onHide') |
| 412 |
}; |
| 413 |
this.modal = document.getElementById(id); |
| 414 |
this.classClose = '.close'; |
| 415 |
this.classCancel = '.cancel'; |
| 416 |
this.classConfirm = '.confirm'; |
| 417 |
this.btnsOpen = []; |
| 418 |
} |
| 419 |
/* |
| 420 |
* Prompter.show() : |
| 421 |
* |
| 422 |
* Shows the modal |
| 423 |
*/ |
| 424 |
|
| 425 |
|
| 426 |
show() { |
| 427 |
this.modal.dispatchEvent(this.events.onShow); |
| 428 |
this.modal.style.display = "block"; |
| 429 |
return this; |
| 430 |
} |
| 431 |
/* Prompter.hide() : |
| 432 |
* |
| 433 |
* Hides the modal |
| 434 |
*/ |
| 435 |
|
| 436 |
|
| 437 |
hide() { |
| 438 |
this.modal.dispatchEvent(this.events.onHide); |
| 439 |
this.modal.style.display = "none"; |
| 440 |
return this; |
| 441 |
} |
| 442 |
/* |
| 443 |
* Prompter.removeEvents() : |
| 444 |
* |
| 445 |
* Removes the events (by cloning the modal) |
| 446 |
*/ |
| 447 |
|
| 448 |
|
| 449 |
removeEvents() { |
| 450 |
var clone = this.modal.cloneNode(true); |
| 451 |
this.modal.parentNode.replaceChild(clone, this.modal); |
| 452 |
this.modal = clone; |
| 453 |
return this; |
| 454 |
} |
| 455 |
/* |
| 456 |
* Prompter.on(event, callback): |
| 457 |
* |
| 458 |
* Connect an event. |
| 459 |
* |
| 460 |
* event: |
| 461 |
* - 'onShow': Called when the modal is shown (via Prompter.show() or a bound button) |
| 462 |
* - 'onConfirm': Called when the modal when the user sends the data (via the element with the class '.confirm') |
| 463 |
* - 'onHide': Called when the modal is hidden (via Prompter.hide() or a bound button) |
| 464 |
* callback: The function to call on the event |
| 465 |
* |
| 466 |
*/ |
| 467 |
|
| 468 |
|
| 469 |
on(event, callback) { |
| 470 |
this.modal.addEventListener(event, callback); |
| 471 |
return this; |
| 472 |
} |
| 473 |
/* |
| 474 |
* Prompter.attach() : |
| 475 |
* |
| 476 |
* Attaches the click events on the elements with classes ".confirm", ".hide", ".cancel" plus the elements to show the modal |
| 477 |
*/ |
| 478 |
|
| 479 |
|
| 480 |
attach() { |
| 481 |
var i; |
| 482 |
var items = []; |
| 483 |
var self = this; |
| 484 |
items = this.modal.querySelectorAll(self.classClose); |
| 485 |
|
| 486 |
for (i = items.length - 1; i >= 0; i--) { |
| 487 |
items[i].addEventListener('click', function () { |
| 488 |
self.hide(); |
| 489 |
}); |
| 490 |
} |
| 491 |
|
| 492 |
items = self.modal.querySelectorAll(self.classCancel); |
| 493 |
|
| 494 |
for (i = items.length - 1; i >= 0; i--) { |
| 495 |
items[i].addEventListener('click', function () { |
| 496 |
self.hide(); |
| 497 |
}); |
| 498 |
} |
| 499 |
|
| 500 |
items = self.modal.querySelectorAll(self.classConfirm); |
| 501 |
|
| 502 |
for (i = items.length - 1; i >= 0; i--) { |
| 503 |
items[i].addEventListener('click', function () { |
| 504 |
self.modal.dispatchEvent(self.events.onConfirm); |
| 505 |
self.hide(); |
| 506 |
}); |
| 507 |
} |
| 508 |
|
| 509 |
for (i = self.btnsOpen.length - 1; i >= 0; i--) { |
| 510 |
self.btnsOpen[i].addEventListener('click', function () { |
| 511 |
self.show(); |
| 512 |
}); |
| 513 |
} |
| 514 |
|
| 515 |
return self; |
| 516 |
} |
| 517 |
/* |
| 518 |
* Attach an external element that will open the modal. |
| 519 |
* Prompter.addOpenBtn(element) |
| 520 |
* |
| 521 |
* element: Any HTML element a button, div, span,... |
| 522 |
*/ |
| 523 |
|
| 524 |
|
| 525 |
addOpenBtn(element) { |
| 526 |
this.btnsOpen.push(element); |
| 527 |
} |
| 528 |
|
| 529 |
} |
| 530 |
|
| 531 |
exports.Prompter = Prompter; |
| 532 |
|
| 533 |
/***/ }), |
| 534 |
|
| 535 |
/***/ "../include/js/front-end/src/Components/Tooltip.js": |
| 536 |
/*!*********************************************************!*\ |
| 537 |
!*** ../include/js/front-end/src/Components/Tooltip.js ***! |
| 538 |
\*********************************************************/ |
| 539 |
/*! flagged exports */ |
| 540 |
/*! export Tooltip [provided] [no usage info] [missing usage info prevents renaming] */ |
| 541 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 542 |
/*! other exports [not provided] [no usage info] */ |
| 543 |
/*! runtime requirements: __webpack_exports__ */ |
| 544 |
/***/ ((__unused_webpack_module, exports) => { |
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
Object.defineProperty(exports, "__esModule", ({ |
| 549 |
value: true |
| 550 |
})); |
| 551 |
exports.Tooltip = void 0; |
| 552 |
|
| 553 |
/* |
| 554 |
* Photonic Tooltip |
| 555 |
* License: MIT |
| 556 |
*/ |
| 557 |
var Tooltip = function Tooltip(selector, tooltip_element) { |
| 558 |
var tooltip, tooltipClass, elemEdges, tooltipElems; // From https://locutus.io/php/strings/strip_tags/, or https://stackoverflow.com/questions/5601903/jquery-almost-equivalent-of-phps-strip-tags/46483672#46483672 |
| 559 |
|
| 560 |
function strip_tags(input, allowed) { |
| 561 |
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); |
| 562 |
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; |
| 563 |
var commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; |
| 564 |
return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { |
| 565 |
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; |
| 566 |
}); |
| 567 |
} |
| 568 |
|
| 569 |
function create(tooltip, elm) { |
| 570 |
var tooltipText = elm.getAttribute('data-photonic-tooltip'); |
| 571 |
tooltipText = strip_tags(tooltipText, '<br><strong><em><b><i><p>'); |
| 572 |
|
| 573 |
if (tooltipText !== '') { |
| 574 |
elm.setAttribute('title', ''); // Blank out the regular title |
| 575 |
// elemEdges relative to the viewport. |
| 576 |
|
| 577 |
elemEdges = elm.getBoundingClientRect(); |
| 578 |
var tooltipTextNode = document.createTextNode(tooltipText); |
| 579 |
tooltip.innerHTML = tooltipText; // ''; // Reset, or upon refresh the node gets repeated |
| 580 |
// tooltip.appendChild(tooltipTextNode); |
| 581 |
// Remove no-display + set the correct classname based on the position |
| 582 |
// of the elm. |
| 583 |
|
| 584 |
if (elemEdges.left > window.innerWidth - 100) { |
| 585 |
tooltip.className = 'photonic-tooltip-container tooltip-left'; |
| 586 |
} else if (elemEdges.left + elemEdges.width / 2 < 100) { |
| 587 |
tooltip.className = 'photonic-tooltip-container tooltip-right'; |
| 588 |
} else { |
| 589 |
tooltip.className = 'photonic-tooltip-container tooltip-center'; |
| 590 |
} |
| 591 |
} |
| 592 |
} |
| 593 |
|
| 594 |
function position(tooltip, elm) { |
| 595 |
var tooltipText = elm.getAttribute('data-photonic-tooltip'); |
| 596 |
|
| 597 |
if (tooltipText !== '') { |
| 598 |
if (elemEdges === undefined) { |
| 599 |
elemEdges = elm.getBoundingClientRect(); |
| 600 |
} // 10 = arrow height |
| 601 |
|
| 602 |
|
| 603 |
var elm_top = elemEdges.top + elemEdges.height + window.scrollY; |
| 604 |
var viewport_edges = window.innerWidth - 100; // Position tooltip on the left side of the elm if the elm touches |
| 605 |
// the viewports right edge and elm width is < 50px. |
| 606 |
|
| 607 |
if (elemEdges.left + window.scrollX > viewport_edges && elemEdges.width < 50) { |
| 608 |
tooltip.style.left = elemEdges.left + window.scrollX - (tooltip.offsetWidth + elemEdges.width) + 'px'; |
| 609 |
tooltip.style.top = elm.offsetTop + 'px'; // Position tooltip on the left side of the elm if the elm touches |
| 610 |
// the viewports right edge and elm width is > 50px. |
| 611 |
} else if (elemEdges.left + window.scrollX > viewport_edges && elemEdges.width > 50) { |
| 612 |
tooltip.style.left = elemEdges.left + window.scrollX - tooltip.offsetWidth - 20 + 'px'; |
| 613 |
tooltip.style.top = elm.offsetTop + 'px'; |
| 614 |
} else if (elemEdges.left + window.scrollX + elemEdges.width / 2 < 100) { |
| 615 |
// position tooltip on the right side of the elm. |
| 616 |
tooltip.style.left = elemEdges.left + window.scrollX + elemEdges.width + 20 + 'px'; |
| 617 |
tooltip.style.top = elm.offsetTop + 'px'; |
| 618 |
} else { |
| 619 |
// Position the toolbox in the center of the elm. |
| 620 |
var centered = elemEdges.left + window.scrollX + elemEdges.width / 2 - tooltip.offsetWidth / 2; |
| 621 |
tooltip.style.left = centered + 'px'; |
| 622 |
tooltip.style.top = elm_top + 'px'; |
| 623 |
} |
| 624 |
} |
| 625 |
} |
| 626 |
|
| 627 |
function show(evt) { |
| 628 |
create(tooltip, evt.currentTarget); |
| 629 |
position(tooltip, evt.currentTarget); |
| 630 |
} |
| 631 |
|
| 632 |
function hide(evt) { |
| 633 |
tooltip.className = tooltipClass + ' no-display'; |
| 634 |
|
| 635 |
if (tooltip.innerText !== '') { |
| 636 |
tooltip.removeChild(tooltip.firstChild); |
| 637 |
tooltip.removeAttribute('style'); |
| 638 |
var element = evt.currentTarget; |
| 639 |
element.setAttribute('title', element.getAttribute('data-photonic-tooltip')); |
| 640 |
} |
| 641 |
} |
| 642 |
|
| 643 |
function init() { |
| 644 |
tooltipElems = document.documentElement.querySelectorAll(selector); |
| 645 |
tooltip = document.documentElement.querySelector(tooltip_element); |
| 646 |
tooltipClass = tooltip_element.replace(/^\.+/g, ''); |
| 647 |
|
| 648 |
if (tooltip === null || tooltip.length === 0) { |
| 649 |
tooltip = document.createElement('div'); |
| 650 |
tooltip.className = tooltipClass + ' no-display'; |
| 651 |
document.body.appendChild(tooltip); |
| 652 |
} |
| 653 |
|
| 654 |
tooltipElems.forEach(elm => { |
| 655 |
elm.removeEventListener('mouseenter', show); |
| 656 |
elm.removeEventListener('mouseleave', hide); |
| 657 |
elm.addEventListener('mouseenter', show, false); |
| 658 |
elm.addEventListener('mouseleave', hide, false); |
| 659 |
}); |
| 660 |
} |
| 661 |
|
| 662 |
init(); |
| 663 |
}; |
| 664 |
|
| 665 |
exports.Tooltip = Tooltip; |
| 666 |
|
| 667 |
/***/ }), |
| 668 |
|
| 669 |
/***/ "../include/js/front-end/src/Core.js": |
| 670 |
/*!*******************************************!*\ |
| 671 |
!*** ../include/js/front-end/src/Core.js ***! |
| 672 |
\*******************************************/ |
| 673 |
/*! flagged exports */ |
| 674 |
/*! export Core [provided] [no usage info] [missing usage info prevents renaming] */ |
| 675 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 676 |
/*! other exports [not provided] [no usage info] */ |
| 677 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 678 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 683 |
|
| 684 |
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 685 |
|
| 686 |
Object.defineProperty(exports, "__esModule", ({ |
| 687 |
value: true |
| 688 |
})); |
| 689 |
exports.Core = void 0; |
| 690 |
|
| 691 |
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); |
| 692 |
|
| 693 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 694 |
|
| 695 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js")); |
| 696 |
|
| 697 |
var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js"); |
| 698 |
|
| 699 |
var _Prompter = __webpack_require__(/*! ./Components/Prompter */ "../include/js/front-end/src/Components/Prompter.js"); |
| 700 |
|
| 701 |
class Core {} |
| 702 |
|
| 703 |
exports.Core = Core; |
| 704 |
(0, _defineProperty2.default)(Core, "lightboxList", []); |
| 705 |
(0, _defineProperty2.default)(Core, "prompterList", []); |
| 706 |
(0, _defineProperty2.default)(Core, "lightbox", void 0); |
| 707 |
(0, _defineProperty2.default)(Core, "deep", location.hash); |
| 708 |
(0, _defineProperty2.default)(Core, "setLightbox", lb => Core.lightbox = lb); |
| 709 |
(0, _defineProperty2.default)(Core, "getLightbox", () => Core.lightbox); |
| 710 |
(0, _defineProperty2.default)(Core, "setDeep", d => Core.deep = d); |
| 711 |
(0, _defineProperty2.default)(Core, "getDeep", () => Core.deep); |
| 712 |
(0, _defineProperty2.default)(Core, "addToLightboxList", (idx, lightbox) => Core.lightboxList[idx] = lightbox); |
| 713 |
(0, _defineProperty2.default)(Core, "getLightboxList", () => Core.lightboxList); |
| 714 |
(0, _defineProperty2.default)(Core, "showSpinner", () => { |
| 715 |
var loading = document.getElementsByClassName('photonic-loading'); |
| 716 |
|
| 717 |
if (loading.length > 0) { |
| 718 |
loading = loading[0]; |
| 719 |
} else { |
| 720 |
loading = document.createElement('div'); |
| 721 |
loading.className = 'photonic-loading'; |
| 722 |
} |
| 723 |
|
| 724 |
loading.style.display = 'block'; |
| 725 |
document.body.appendChild(loading); |
| 726 |
}); |
| 727 |
(0, _defineProperty2.default)(Core, "hideLoading", () => { |
| 728 |
var loading = document.getElementsByClassName('photonic-loading'); |
| 729 |
|
| 730 |
if (loading.length > 0) { |
| 731 |
loading = loading[0]; |
| 732 |
loading.style.display = 'none'; |
| 733 |
} |
| 734 |
}); |
| 735 |
(0, _defineProperty2.default)(Core, "initializePasswordPrompter", selector => { |
| 736 |
var selectorNoHash = selector.replace(/^#+/g, ''); |
| 737 |
var prompter = new _Prompter.Prompter(selectorNoHash); |
| 738 |
prompter.attach(); |
| 739 |
Core.prompterList[selector] = prompter; |
| 740 |
prompter.show(); |
| 741 |
}); |
| 742 |
(0, _defineProperty2.default)(Core, "moveHTML5External", () => { |
| 743 |
var videos = document.getElementById('photonic-html5-external-videos'); |
| 744 |
|
| 745 |
if (!videos) { |
| 746 |
videos = document.createElement('div'); |
| 747 |
videos.id = 'photonic-html5-external-videos'; |
| 748 |
videos.style.display = 'none'; |
| 749 |
document.body.appendChild(videos); |
| 750 |
} |
| 751 |
|
| 752 |
var current = document.querySelectorAll('.photonic-html5-external'); |
| 753 |
|
| 754 |
if (current) { |
| 755 |
var cLen = current.length; |
| 756 |
|
| 757 |
for (var c = 0; c < cLen; c++) { |
| 758 |
current[c].classList.remove('photonic-html5-external'); |
| 759 |
videos.appendChild(current[c]); |
| 760 |
} |
| 761 |
} |
| 762 |
}); |
| 763 |
(0, _defineProperty2.default)(Core, "blankSlideupTitle", () => { |
| 764 |
document.querySelectorAll('.title-display-slideup-stick, .photonic-slideshow.title-display-slideup-stick').forEach(item => { |
| 765 |
Array.from(item.getElementsByTagName('a')).forEach(a => { |
| 766 |
a.setAttribute('title', ''); |
| 767 |
}); |
| 768 |
}); |
| 769 |
}); |
| 770 |
(0, _defineProperty2.default)(Core, "showSlideupTitle", () => { |
| 771 |
var titles = document.documentElement.querySelectorAll('.title-display-slideup-stick a .photonic-title'); |
| 772 |
var len = titles.length; |
| 773 |
|
| 774 |
for (var i = 0; i < len; i++) { |
| 775 |
titles[i].style.display = 'block'; |
| 776 |
} |
| 777 |
}); |
| 778 |
(0, _defineProperty2.default)(Core, "waitForImages", /*#__PURE__*/function () { |
| 779 |
var _ref = (0, _asyncToGenerator2.default)(function* (selector) { |
| 780 |
var images = Core.getImagesFromSelector(selector); |
| 781 |
var imageUrlArray = []; |
| 782 |
var anchorArray = []; |
| 783 |
var setDimensions = false; |
| 784 |
|
| 785 |
if (selector instanceof Element && selector.getAttribute('data-photonic-platform') === 'instagram') { |
| 786 |
setDimensions = true; |
| 787 |
} |
| 788 |
|
| 789 |
images.forEach(img => { |
| 790 |
imageUrlArray.push(img.getAttribute('src')); |
| 791 |
anchorArray.push(img.parentElement); |
| 792 |
}); |
| 793 |
var promiseArray = []; // create an array for promises |
| 794 |
|
| 795 |
var imageArray = []; // array for the images |
| 796 |
|
| 797 |
var _loop = function _loop(idx, imageUrl) { |
| 798 |
promiseArray.push(new Promise(resolve => { |
| 799 |
var img = new Image(); |
| 800 |
|
| 801 |
img.onload = () => { |
| 802 |
if (setDimensions) { |
| 803 |
anchorArray[idx].setAttribute('data-pswp-width', img.naturalWidth); |
| 804 |
anchorArray[idx].setAttribute('data-pswp-height', img.naturalHeight); |
| 805 |
} |
| 806 |
|
| 807 |
resolve(); |
| 808 |
}; |
| 809 |
|
| 810 |
img.src = imageUrl; |
| 811 |
imageArray.push(img); |
| 812 |
})); |
| 813 |
}; |
| 814 |
|
| 815 |
for (var [idx, imageUrl] of imageUrlArray.entries()) { |
| 816 |
_loop(idx, imageUrl); |
| 817 |
} |
| 818 |
|
| 819 |
yield Promise.all(promiseArray); // wait for all the images to be loaded |
| 820 |
|
| 821 |
return imageArray; |
| 822 |
}); |
| 823 |
|
| 824 |
return function (_x) { |
| 825 |
return _ref.apply(this, arguments); |
| 826 |
}; |
| 827 |
}()); |
| 828 |
(0, _defineProperty2.default)(Core, "loadSingleImage", /*#__PURE__*/function () { |
| 829 |
var _ref2 = (0, _asyncToGenerator2.default)(function* (image) { |
| 830 |
var promiseArray = []; |
| 831 |
var retImage = null; |
| 832 |
promiseArray.push(new Promise(resolve => { |
| 833 |
var img = new Image(); |
| 834 |
|
| 835 |
img.onload = () => { |
| 836 |
resolve(); |
| 837 |
}; |
| 838 |
|
| 839 |
if (image.getAttribute('data-src') !== null) { |
| 840 |
img.src = image.getAttribute('data-src'); |
| 841 |
} else { |
| 842 |
img.src = image.getAttribute('src'); // Leave the 'src' in just as a backup. E.g. Gallery header images |
| 843 |
} |
| 844 |
|
| 845 |
retImage = img; |
| 846 |
})); |
| 847 |
yield Promise.all(promiseArray); |
| 848 |
return retImage; |
| 849 |
}); |
| 850 |
|
| 851 |
return function (_x2) { |
| 852 |
return _ref2.apply(this, arguments); |
| 853 |
}; |
| 854 |
}()); |
| 855 |
(0, _defineProperty2.default)(Core, "watchForImages", selector => { |
| 856 |
var images = Core.getImagesFromSelector(selector); |
| 857 |
var intersectionObserver = new IntersectionObserver((items, observer) => { |
| 858 |
items.forEach(item => { |
| 859 |
if (item.isIntersecting || item.intersectionRatio > 0) { |
| 860 |
var image = item.target; |
| 861 |
image.closest('a').classList.add('photonic-image-loading'); |
| 862 |
Core.loadSingleImage(image).then(() => { |
| 863 |
if (image.getAttribute('data-src') !== null && image.getAttribute('data-src') !== '') { |
| 864 |
image.src = image.getAttribute('data-src'); |
| 865 |
image.setAttribute('data-src', ''); |
| 866 |
image.setAttribute('data-loaded', 'true'); |
| 867 |
} |
| 868 |
|
| 869 |
image.closest('a').classList.remove('photonic-image-loading'); |
| 870 |
Util.fadeIn(image); |
| 871 |
}); |
| 872 |
observer.unobserve(image); |
| 873 |
} |
| 874 |
}); |
| 875 |
}); |
| 876 |
images.forEach(image => { |
| 877 |
intersectionObserver.observe(image); |
| 878 |
}); |
| 879 |
}); |
| 880 |
(0, _defineProperty2.default)(Core, "getImagesFromSelector", selector => { |
| 881 |
var images = []; |
| 882 |
|
| 883 |
if (typeof selector === 'string') { |
| 884 |
document.querySelectorAll(selector).forEach(selection => { |
| 885 |
images = Array.from(selection.getElementsByTagName('img')); |
| 886 |
}); |
| 887 |
} else if (selector instanceof Element) { |
| 888 |
images = Array.from(selector.getElementsByTagName('img')); |
| 889 |
} else if (selector instanceof NodeList) { |
| 890 |
selector.forEach(selection => { |
| 891 |
images.push(selection.querySelector('img')); |
| 892 |
}); |
| 893 |
} |
| 894 |
|
| 895 |
return images; |
| 896 |
}); |
| 897 |
(0, _defineProperty2.default)(Core, "standardizeTitleWidths", () => { |
| 898 |
var self = Core; |
| 899 |
|
| 900 |
var setWidths = grid => { |
| 901 |
grid.querySelectorAll('.photonic-thumb').forEach(item => { |
| 902 |
var img = item.getElementsByTagName('img'); |
| 903 |
|
| 904 |
if (img != null) { |
| 905 |
img = img[0]; |
| 906 |
var title = item.querySelector('.photonic-title-info'); |
| 907 |
|
| 908 |
if (title) { |
| 909 |
title.style.width = img.width + 'px'; |
| 910 |
} |
| 911 |
} |
| 912 |
}); |
| 913 |
}; |
| 914 |
|
| 915 |
document.querySelectorAll('.photonic-standard-layout.title-display-below, .photonic-standard-layout.title-display-hover-slideup-show, .photonic-standard-layout.title-display-slideup-stick').forEach(grid => { |
| 916 |
if (grid.classList.contains('sizes-present')) { |
| 917 |
self.watchForImages(grid); |
| 918 |
setWidths(grid); |
| 919 |
} else { |
| 920 |
self.waitForImages(grid).then(() => { |
| 921 |
setWidths(grid); |
| 922 |
}); |
| 923 |
} |
| 924 |
}); |
| 925 |
}); |
| 926 |
(0, _defineProperty2.default)(Core, "sanitizeTitles", () => { |
| 927 |
var thumbs = document.querySelectorAll('.photonic-stream a, a.photonic-level-2-thumb'); |
| 928 |
thumbs.forEach(thumb => { |
| 929 |
if (!thumb.parentNode.classList.contains('photonic-header-title')) { |
| 930 |
var title = thumb.getAttribute('title'); // Not doing innerHTML, which is susceptible to XSS |
| 931 |
|
| 932 |
thumb.setAttribute('title', Util.getText(title)); |
| 933 |
var dataTitle = thumb.getAttribute('data-title'); |
| 934 |
thumb.setAttribute('data-title', Util.HTMLSanitizer.SanitizeHTML(dataTitle)); |
| 935 |
} |
| 936 |
}); |
| 937 |
}); |
| 938 |
(0, _defineProperty2.default)(Core, "initializeTooltips", () => { |
| 939 |
if (document.querySelector('.title-display-tooltip a, .photonic-slideshow.title-display-tooltip img') != null) { |
| 940 |
(0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container'); |
| 941 |
} |
| 942 |
}); |
| 943 |
(0, _defineProperty2.default)(Core, "showRegularGrids", () => { |
| 944 |
document.querySelectorAll('.photonic-standard-layout').forEach(grid => { |
| 945 |
if (grid.classList.contains('sizes-present')) { |
| 946 |
Core.watchForImages(grid); |
| 947 |
} else { |
| 948 |
Core.waitForImages(grid).then(() => { |
| 949 |
grid.querySelectorAll('.photonic-level-1, .photonic-level-2').forEach(item => { |
| 950 |
item.style.display = 'inline-block'; |
| 951 |
}); |
| 952 |
}); |
| 953 |
} |
| 954 |
}); |
| 955 |
}); |
| 956 |
(0, _defineProperty2.default)(Core, "executeCommon", () => { |
| 957 |
Core.moveHTML5External(); |
| 958 |
Core.blankSlideupTitle(); |
| 959 |
Core.standardizeTitleWidths(); |
| 960 |
Core.sanitizeTitles(); |
| 961 |
Core.initializeTooltips(); |
| 962 |
Core.showRegularGrids(); |
| 963 |
}); |
| 964 |
|
| 965 |
/***/ }), |
| 966 |
|
| 967 |
/***/ "../include/js/front-end/src/Layouts/Justified.js": |
| 968 |
/*!********************************************************!*\ |
| 969 |
!*** ../include/js/front-end/src/Layouts/Justified.js ***! |
| 970 |
\********************************************************/ |
| 971 |
/*! flagged exports */ |
| 972 |
/*! export JustifiedGrid [provided] [no usage info] [missing usage info prevents renaming] */ |
| 973 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 974 |
/*! other exports [not provided] [no usage info] */ |
| 975 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 976 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 977 |
|
| 978 |
|
| 979 |
|
| 980 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 981 |
|
| 982 |
Object.defineProperty(exports, "__esModule", ({ |
| 983 |
value: true |
| 984 |
})); |
| 985 |
exports.JustifiedGrid = void 0; |
| 986 |
|
| 987 |
var _Core = __webpack_require__(/*! ../Core.js */ "../include/js/front-end/src/Core.js"); |
| 988 |
|
| 989 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util.js */ "../include/js/front-end/src/Util.js")); |
| 990 |
|
| 991 |
/** |
| 992 |
* Photonic Justified Grid Layout (JS-based) |
| 993 |
* Photonic can render a justified grid using CSS or JS. The CSS layout is the default. The JS one is used when the sizes of the images are not available upfront. |
| 994 |
* The CSS layout renders quicker, but the JS layouts are a lot prettier. |
| 995 |
* |
| 996 |
* License: GPL v3.0 |
| 997 |
*/ |
| 998 |
var linearMin = arr => { |
| 999 |
var computed, result, x, _i, _len; |
| 1000 |
|
| 1001 |
for (_i = 0, _len = arr.length; _i < _len; _i++) { |
| 1002 |
x = arr[_i]; |
| 1003 |
computed = x[0]; |
| 1004 |
|
| 1005 |
if (!result || computed < result.computed) { |
| 1006 |
result = { |
| 1007 |
value: x, |
| 1008 |
computed: computed |
| 1009 |
}; |
| 1010 |
} |
| 1011 |
} |
| 1012 |
|
| 1013 |
return result.value; |
| 1014 |
}; |
| 1015 |
|
| 1016 |
var linearPartition = (seq, k) => { |
| 1017 |
var ans, i, j, m, n, solution, table, x, y, _i, _j, _k, _l; |
| 1018 |
|
| 1019 |
n = seq.length; |
| 1020 |
|
| 1021 |
if (k <= 0) { |
| 1022 |
return []; |
| 1023 |
} |
| 1024 |
|
| 1025 |
if (k > n) { |
| 1026 |
return seq.map(x => [x]); |
| 1027 |
} |
| 1028 |
|
| 1029 |
table = (() => { |
| 1030 |
var _i, _results; |
| 1031 |
|
| 1032 |
_results = []; |
| 1033 |
|
| 1034 |
for (y = _i = 0; 0 <= n ? _i < n : _i > n; y = 0 <= n ? ++_i : --_i) { |
| 1035 |
_results.push(function () { |
| 1036 |
var _j, _results1; |
| 1037 |
|
| 1038 |
_results1 = []; |
| 1039 |
|
| 1040 |
for (x = _j = 0; 0 <= k ? _j < k : _j > k; x = 0 <= k ? ++_j : --_j) { |
| 1041 |
_results1.push(0); |
| 1042 |
} |
| 1043 |
|
| 1044 |
return _results1; |
| 1045 |
}()); |
| 1046 |
} |
| 1047 |
|
| 1048 |
return _results; |
| 1049 |
})(); |
| 1050 |
|
| 1051 |
solution = (() => { |
| 1052 |
var _i, _ref, _results; |
| 1053 |
|
| 1054 |
_results = []; |
| 1055 |
|
| 1056 |
for (y = _i = 0, _ref = n - 1; 0 <= _ref ? _i < _ref : _i > _ref; y = 0 <= _ref ? ++_i : --_i) { |
| 1057 |
_results.push(function () { |
| 1058 |
var _j, _ref1, _results1; |
| 1059 |
|
| 1060 |
_results1 = []; |
| 1061 |
|
| 1062 |
for (x = _j = 0, _ref1 = k - 1; 0 <= _ref1 ? _j < _ref1 : _j > _ref1; x = 0 <= _ref1 ? ++_j : --_j) { |
| 1063 |
_results1.push(0); |
| 1064 |
} |
| 1065 |
|
| 1066 |
return _results1; |
| 1067 |
}()); |
| 1068 |
} |
| 1069 |
|
| 1070 |
return _results; |
| 1071 |
})(); |
| 1072 |
|
| 1073 |
for (i = _i = 0; 0 <= n ? _i < n : _i > n; i = 0 <= n ? ++_i : --_i) { |
| 1074 |
table[i][0] = seq[i] + (i ? table[i - 1][0] : 0); |
| 1075 |
} |
| 1076 |
|
| 1077 |
for (j = _j = 0; 0 <= k ? _j < k : _j > k; j = 0 <= k ? ++_j : --_j) { |
| 1078 |
table[0][j] = seq[0]; |
| 1079 |
} |
| 1080 |
|
| 1081 |
for (i = _k = 1; 1 <= n ? _k < n : _k > n; i = 1 <= n ? ++_k : --_k) { |
| 1082 |
for (j = _l = 1; 1 <= k ? _l < k : _l > k; j = 1 <= k ? ++_l : --_l) { |
| 1083 |
m = linearMin((() => { |
| 1084 |
var _m, _results; |
| 1085 |
|
| 1086 |
_results = []; |
| 1087 |
|
| 1088 |
for (x = _m = 0; 0 <= i ? _m < i : _m > i; x = 0 <= i ? ++_m : --_m) { |
| 1089 |
_results.push([Math.max(table[x][j - 1], table[i][0] - table[x][0]), x]); |
| 1090 |
} |
| 1091 |
|
| 1092 |
return _results; |
| 1093 |
})()); |
| 1094 |
table[i][j] = m[0]; |
| 1095 |
solution[i - 1][j - 1] = m[1]; |
| 1096 |
} |
| 1097 |
} |
| 1098 |
|
| 1099 |
n = n - 1; |
| 1100 |
k = k - 2; |
| 1101 |
ans = []; |
| 1102 |
|
| 1103 |
while (k >= 0) { |
| 1104 |
ans = [(() => { |
| 1105 |
var _m, _ref, _ref1, _results; |
| 1106 |
|
| 1107 |
_results = []; |
| 1108 |
|
| 1109 |
for (i = _m = _ref = solution[n - 1][k] + 1, _ref1 = n + 1; _ref <= _ref1 ? _m < _ref1 : _m > _ref1; i = _ref <= _ref1 ? ++_m : --_m) { |
| 1110 |
_results.push(seq[i]); |
| 1111 |
} |
| 1112 |
|
| 1113 |
return _results; |
| 1114 |
})()].concat(ans); |
| 1115 |
n = solution[n - 1][k]; |
| 1116 |
k = k - 1; |
| 1117 |
} |
| 1118 |
|
| 1119 |
return [(() => { |
| 1120 |
var _m, _ref, _results; |
| 1121 |
|
| 1122 |
_results = []; |
| 1123 |
|
| 1124 |
for (i = _m = 0, _ref = n + 1; 0 <= _ref ? _m < _ref : _m > _ref; i = 0 <= _ref ? ++_m : --_m) { |
| 1125 |
_results.push(seq[i]); |
| 1126 |
} |
| 1127 |
|
| 1128 |
return _results; |
| 1129 |
})()].concat(ans); |
| 1130 |
}; |
| 1131 |
|
| 1132 |
function part(seq, k) { |
| 1133 |
if (k <= 0) { |
| 1134 |
return []; |
| 1135 |
} |
| 1136 |
|
| 1137 |
while (k) { |
| 1138 |
try { |
| 1139 |
return linearPartition(seq, k--); |
| 1140 |
} catch (_error) {// |
| 1141 |
} |
| 1142 |
} |
| 1143 |
} |
| 1144 |
|
| 1145 |
var JustifiedGrid = (resized, jsLoaded, selector, lightbox) => { |
| 1146 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Justified Grid'); |
| 1147 |
var selection = document.querySelectorAll(selector); |
| 1148 |
|
| 1149 |
if (selector == null || selection.length === 0) { |
| 1150 |
selection = document.querySelectorAll('.photonic-random-layout'); |
| 1151 |
} |
| 1152 |
|
| 1153 |
if (!resized && selection.length > 0) { |
| 1154 |
_Core.Core.showSpinner(); |
| 1155 |
} |
| 1156 |
|
| 1157 |
var setupTitles = () => { |
| 1158 |
_Core.Core.blankSlideupTitle(); |
| 1159 |
|
| 1160 |
_Core.Core.showSlideupTitle(); |
| 1161 |
|
| 1162 |
if (!resized && !jsLoaded) { |
| 1163 |
_Core.Core.hideLoading(); |
| 1164 |
} |
| 1165 |
}; |
| 1166 |
|
| 1167 |
selection.forEach(container => { |
| 1168 |
// If there are some nodes for which the sizes are missing, play safe and run this in JS mode. |
| 1169 |
// Otherwise render the gallery using CSS, and just display the images once they have downloaded. |
| 1170 |
if (container.classList.contains('sizes-missing') || !window.CSS || !CSS.supports('color', 'var(--fake-var)')) { |
| 1171 |
var viewportWidth = Math.floor(container.getBoundingClientRect().width), |
| 1172 |
windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0), |
| 1173 |
idealHeight = Math.max(parseInt(windowHeight / 4), Photonic_JS.tile_min_height); |
| 1174 |
var gap = Photonic_JS.tile_spacing * 2; |
| 1175 |
|
| 1176 |
_Core.Core.waitForImages(container).then(() => { |
| 1177 |
var photos = [], |
| 1178 |
images = Array.from(container.getElementsByTagName('img')); |
| 1179 |
images.forEach(image => { |
| 1180 |
if (image.closest('.photonic-panel') !== null) { |
| 1181 |
return; |
| 1182 |
} |
| 1183 |
|
| 1184 |
var div = image.parentNode.parentNode; |
| 1185 |
|
| 1186 |
if (!(image.naturalHeight === 0 || image.naturalHeight === undefined || image.naturalWidth === undefined)) { |
| 1187 |
photos.push({ |
| 1188 |
tile: div, |
| 1189 |
aspect_ratio: image.naturalWidth / image.naturalHeight |
| 1190 |
}); |
| 1191 |
} |
| 1192 |
}); |
| 1193 |
var summedWidth = photos.reduce((sum, p) => sum += p.aspect_ratio * idealHeight + gap, 0); |
| 1194 |
var rows = Math.max(Math.round(summedWidth / viewportWidth), 1), |
| 1195 |
// At least 1 row should be shown |
| 1196 |
weights = photos.map(p => Math.round(p.aspect_ratio * 100)); |
| 1197 |
var partition = part(weights, rows); |
| 1198 |
var index = 0; |
| 1199 |
var oLen = partition.length; |
| 1200 |
|
| 1201 |
for (var o = 0; o < oLen; o++) { |
| 1202 |
var onePart = partition[o]; |
| 1203 |
var summedRatios = void 0; |
| 1204 |
var rowBuffer = photos.slice(index, index + onePart.length); |
| 1205 |
index = index + onePart.length; |
| 1206 |
summedRatios = rowBuffer.reduce((sum, p) => sum += p.aspect_ratio, 0); |
| 1207 |
var rLen = rowBuffer.length; |
| 1208 |
|
| 1209 |
for (var r = 0; r < rLen; r++) { |
| 1210 |
var item = rowBuffer[r], |
| 1211 |
existing = item.tile; |
| 1212 |
existing.style.width = parseInt(viewportWidth / summedRatios * item.aspect_ratio) + "px"; |
| 1213 |
existing.style.height = parseInt(viewportWidth / summedRatios) + "px"; |
| 1214 |
} |
| 1215 |
} |
| 1216 |
|
| 1217 |
container.querySelectorAll('.photonic-thumb, .photonic-thumb img').forEach(thumb => Util.fadeIn(thumb)); |
| 1218 |
setupTitles(); |
| 1219 |
}); |
| 1220 |
} else { |
| 1221 |
_Core.Core.watchForImages(container); |
| 1222 |
|
| 1223 |
setupTitles(); |
| 1224 |
} |
| 1225 |
|
| 1226 |
if (lightbox && !resized) { |
| 1227 |
if (Photonic_JS.lightbox_library === 'lightcase') { |
| 1228 |
lightbox.initialize('.photonic-random-layout'); |
| 1229 |
} else if (['bigpicture', 'featherlight', 'glightbox'].indexOf(Photonic_JS.lightbox_library) > -1) { |
| 1230 |
lightbox.initialize(container); |
| 1231 |
} else if (Photonic_JS.lightbox_library === 'fancybox3') { |
| 1232 |
lightbox.initialize('.photonic-random-layout'); |
| 1233 |
} else if (Photonic_JS.lightbox_library === 'photoswipe') { |
| 1234 |
lightbox.initialize(); |
| 1235 |
} |
| 1236 |
} |
| 1237 |
}); |
| 1238 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Justified Grid'); |
| 1239 |
}; |
| 1240 |
|
| 1241 |
exports.JustifiedGrid = JustifiedGrid; |
| 1242 |
|
| 1243 |
/***/ }), |
| 1244 |
|
| 1245 |
/***/ "../include/js/front-end/src/Layouts/Layout.js": |
| 1246 |
/*!*****************************************************!*\ |
| 1247 |
!*** ../include/js/front-end/src/Layouts/Layout.js ***! |
| 1248 |
\*****************************************************/ |
| 1249 |
/*! flagged exports */ |
| 1250 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1251 |
/*! export initializeLayouts [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1252 |
/*! other exports [not provided] [no usage info] */ |
| 1253 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 1254 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1255 |
|
| 1256 |
|
| 1257 |
|
| 1258 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 1259 |
|
| 1260 |
Object.defineProperty(exports, "__esModule", ({ |
| 1261 |
value: true |
| 1262 |
})); |
| 1263 |
exports.initializeLayouts = void 0; |
| 1264 |
|
| 1265 |
var _Justified = __webpack_require__(/*! ./Justified */ "../include/js/front-end/src/Layouts/Justified.js"); |
| 1266 |
|
| 1267 |
var _Mosaic = __webpack_require__(/*! ./Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js"); |
| 1268 |
|
| 1269 |
var _Masonry = __webpack_require__(/*! ./Masonry */ "../include/js/front-end/src/Layouts/Masonry.js"); |
| 1270 |
|
| 1271 |
var _MasonryHorizontal = __webpack_require__(/*! ./MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js"); |
| 1272 |
|
| 1273 |
var Slider = _interopRequireWildcard(__webpack_require__(/*! ./Slider */ "../include/js/front-end/src/Layouts/Slider.js")); |
| 1274 |
|
| 1275 |
var initializeLayouts = lightbox => { |
| 1276 |
(0, _Justified.JustifiedGrid)(false, false, null, lightbox); |
| 1277 |
(0, _Mosaic.Mosaic)(false, false); |
| 1278 |
(0, _Masonry.Masonry)(false, false); |
| 1279 |
(0, _MasonryHorizontal.MasonryHorizontal)(false, false); |
| 1280 |
Slider.initializeSliders(); |
| 1281 |
window.addEventListener('resize', () => { |
| 1282 |
(0, _Justified.JustifiedGrid)(true, false, '.photonic-random-layout.sizes-missing'); |
| 1283 |
(0, _Mosaic.Mosaic)(true, false); |
| 1284 |
(0, _Masonry.Masonry)(true, false); |
| 1285 |
(0, _MasonryHorizontal.MasonryHorizontal)(true, false); |
| 1286 |
}); |
| 1287 |
}; |
| 1288 |
|
| 1289 |
exports.initializeLayouts = initializeLayouts; |
| 1290 |
|
| 1291 |
/***/ }), |
| 1292 |
|
| 1293 |
/***/ "../include/js/front-end/src/Layouts/Masonry.js": |
| 1294 |
/*!******************************************************!*\ |
| 1295 |
!*** ../include/js/front-end/src/Layouts/Masonry.js ***! |
| 1296 |
\******************************************************/ |
| 1297 |
/*! flagged exports */ |
| 1298 |
/*! export Masonry [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1299 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1300 |
/*! other exports [not provided] [no usage info] */ |
| 1301 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 1302 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1303 |
|
| 1304 |
|
| 1305 |
|
| 1306 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 1307 |
|
| 1308 |
Object.defineProperty(exports, "__esModule", ({ |
| 1309 |
value: true |
| 1310 |
})); |
| 1311 |
exports.Masonry = void 0; |
| 1312 |
|
| 1313 |
var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js"); |
| 1314 |
|
| 1315 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js")); |
| 1316 |
|
| 1317 |
/** |
| 1318 |
* Photonic Masonry Layout |
| 1319 |
* The Masonry layout is primarily controlled using CSS columns. The JS component is to facilitate responsive behaviour and breakpoints. |
| 1320 |
* |
| 1321 |
* License: GPL v3.0 |
| 1322 |
*/ |
| 1323 |
var Masonry = (resized, jsLoaded, selector) => { |
| 1324 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Masonry'); |
| 1325 |
var selection = document.querySelectorAll(selector); |
| 1326 |
|
| 1327 |
if (selector == null || selection.length === 0) { |
| 1328 |
selection = document.querySelectorAll('.photonic-masonry-layout'); |
| 1329 |
} |
| 1330 |
|
| 1331 |
if (!resized && selection.length > 0) { |
| 1332 |
_Core.Core.showSpinner(); |
| 1333 |
} |
| 1334 |
|
| 1335 |
var minWidth = isNaN(Photonic_JS.masonry_min_width) || parseInt(Photonic_JS.masonry_min_width) <= 0 ? 200 : Photonic_JS.masonry_min_width; |
| 1336 |
minWidth = parseInt(minWidth); |
| 1337 |
selection.forEach(grid => { |
| 1338 |
var columns = grid.getAttribute('data-photonic-gallery-columns'); |
| 1339 |
columns = isNaN(parseInt(columns)) || parseInt(columns) <= 0 ? 3 : parseInt(columns); |
| 1340 |
|
| 1341 |
var buildLayout = (grid, fadeIn) => { |
| 1342 |
var viewportWidth = Math.floor(grid.getBoundingClientRect().width), |
| 1343 |
idealColumns = viewportWidth / columns > minWidth ? columns : Math.floor(viewportWidth / minWidth); |
| 1344 |
|
| 1345 |
if (idealColumns !== undefined && idealColumns !== null) { |
| 1346 |
grid.style.columnCount = idealColumns.toString(); |
| 1347 |
} |
| 1348 |
|
| 1349 |
if (fadeIn) { |
| 1350 |
Array.from(grid.getElementsByTagName('img')).forEach(img => { |
| 1351 |
Util.fadeIn(img); |
| 1352 |
}); |
| 1353 |
} |
| 1354 |
|
| 1355 |
_Core.Core.showSlideupTitle(); |
| 1356 |
|
| 1357 |
if (!resized && !jsLoaded) { |
| 1358 |
_Core.Core.hideLoading(); |
| 1359 |
} |
| 1360 |
}; |
| 1361 |
|
| 1362 |
if (grid.classList.contains('sizes-present')) { |
| 1363 |
_Core.Core.watchForImages(grid); |
| 1364 |
|
| 1365 |
buildLayout(grid, false); |
| 1366 |
} else { |
| 1367 |
_Core.Core.waitForImages(grid).then(() => { |
| 1368 |
buildLayout(grid, true); |
| 1369 |
}); |
| 1370 |
} |
| 1371 |
}); |
| 1372 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Masonry'); |
| 1373 |
}; |
| 1374 |
|
| 1375 |
exports.Masonry = Masonry; |
| 1376 |
|
| 1377 |
/***/ }), |
| 1378 |
|
| 1379 |
/***/ "../include/js/front-end/src/Layouts/MasonryHorizontal.js": |
| 1380 |
/*!****************************************************************!*\ |
| 1381 |
!*** ../include/js/front-end/src/Layouts/MasonryHorizontal.js ***! |
| 1382 |
\****************************************************************/ |
| 1383 |
/*! flagged exports */ |
| 1384 |
/*! export MasonryHorizontal [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1385 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1386 |
/*! other exports [not provided] [no usage info] */ |
| 1387 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 1388 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1389 |
|
| 1390 |
|
| 1391 |
|
| 1392 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 1393 |
|
| 1394 |
Object.defineProperty(exports, "__esModule", ({ |
| 1395 |
value: true |
| 1396 |
})); |
| 1397 |
exports.MasonryHorizontal = void 0; |
| 1398 |
|
| 1399 |
var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js"); |
| 1400 |
|
| 1401 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js")); |
| 1402 |
|
| 1403 |
/** |
| 1404 |
* Photonic Masonry Layout |
| 1405 |
* The Masonry layout is primarily controlled using CSS columns. The JS component is to facilitate responsive behaviour and breakpoints. |
| 1406 |
* |
| 1407 |
* License: GPL v3.0 |
| 1408 |
*/ |
| 1409 |
var MasonryHorizontal = (resized, jsLoaded, selector) => { |
| 1410 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Horizontal Masonry'); |
| 1411 |
var selection = document.querySelectorAll(selector); |
| 1412 |
|
| 1413 |
if (selector == null || selection.length === 0) { |
| 1414 |
selection = document.querySelectorAll('.photonic-masonry-horizontal-layout'); |
| 1415 |
} |
| 1416 |
|
| 1417 |
if (!resized && selection.length > 0) { |
| 1418 |
_Core.Core.showSpinner(); |
| 1419 |
} |
| 1420 |
|
| 1421 |
var minWidth = isNaN(Photonic_JS.masonry_min_width) || parseInt(Photonic_JS.masonry_min_width) <= 0 ? 200 : Photonic_JS.masonry_min_width; |
| 1422 |
minWidth = parseInt(minWidth); |
| 1423 |
selection.forEach(grid => { |
| 1424 |
var columns = grid.getAttribute('data-photonic-gallery-columns'); |
| 1425 |
columns = isNaN(parseInt(columns)) || parseInt(columns) <= 0 ? 3 : parseInt(columns); |
| 1426 |
|
| 1427 |
var buildLayout = (grid, fadeIn) => { |
| 1428 |
var figures = grid.querySelectorAll('figure'); |
| 1429 |
var inputFigures = [], |
| 1430 |
outputFigures = []; |
| 1431 |
figures.forEach(figure => { |
| 1432 |
inputFigures[figure.getAttribute('data-photonic-idx')] = figure; |
| 1433 |
}); |
| 1434 |
var viewportWidth = Math.floor(grid.getBoundingClientRect().width), |
| 1435 |
idealColumns = viewportWidth / columns > minWidth ? columns : Math.floor(viewportWidth / minWidth); |
| 1436 |
|
| 1437 |
if (idealColumns !== undefined && idealColumns !== null) { |
| 1438 |
grid.style.columnCount = idealColumns.toString(); |
| 1439 |
var col = 0; |
| 1440 |
|
| 1441 |
while (col < idealColumns) { |
| 1442 |
for (var idx = 0; idx < inputFigures.length; idx += idealColumns) { |
| 1443 |
var _val = inputFigures[idx + col]; |
| 1444 |
|
| 1445 |
if (_val !== undefined) { |
| 1446 |
outputFigures.push(_val); |
| 1447 |
} |
| 1448 |
} |
| 1449 |
|
| 1450 |
col++; |
| 1451 |
} |
| 1452 |
|
| 1453 |
if (outputFigures.length === inputFigures.length) { |
| 1454 |
var fragment = document.createDocumentFragment(); |
| 1455 |
outputFigures.forEach(figure => { |
| 1456 |
grid.appendChild(figure); |
| 1457 |
}); |
| 1458 |
} |
| 1459 |
} |
| 1460 |
|
| 1461 |
if (fadeIn) { |
| 1462 |
Array.from(grid.getElementsByTagName('img')).forEach(img => { |
| 1463 |
Util.fadeIn(img); |
| 1464 |
}); |
| 1465 |
} |
| 1466 |
|
| 1467 |
_Core.Core.showSlideupTitle(); |
| 1468 |
|
| 1469 |
if (!resized && !jsLoaded) { |
| 1470 |
_Core.Core.hideLoading(); |
| 1471 |
} |
| 1472 |
}; |
| 1473 |
|
| 1474 |
if (grid.classList.contains('sizes-present')) { |
| 1475 |
_Core.Core.watchForImages(grid); |
| 1476 |
|
| 1477 |
buildLayout(grid, !resized); |
| 1478 |
} else { |
| 1479 |
_Core.Core.waitForImages(grid).then(() => { |
| 1480 |
buildLayout(grid, true); |
| 1481 |
}); |
| 1482 |
} |
| 1483 |
}); |
| 1484 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Horizontal Masonry'); |
| 1485 |
}; |
| 1486 |
|
| 1487 |
exports.MasonryHorizontal = MasonryHorizontal; |
| 1488 |
|
| 1489 |
/***/ }), |
| 1490 |
|
| 1491 |
/***/ "../include/js/front-end/src/Layouts/Mosaic.js": |
| 1492 |
/*!*****************************************************!*\ |
| 1493 |
!*** ../include/js/front-end/src/Layouts/Mosaic.js ***! |
| 1494 |
\*****************************************************/ |
| 1495 |
/*! flagged exports */ |
| 1496 |
/*! export Mosaic [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1497 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1498 |
/*! other exports [not provided] [no usage info] */ |
| 1499 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 1500 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1501 |
|
| 1502 |
|
| 1503 |
|
| 1504 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 1505 |
|
| 1506 |
Object.defineProperty(exports, "__esModule", ({ |
| 1507 |
value: true |
| 1508 |
})); |
| 1509 |
exports.Mosaic = void 0; |
| 1510 |
|
| 1511 |
var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js"); |
| 1512 |
|
| 1513 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js")); |
| 1514 |
|
| 1515 |
/** |
| 1516 |
* Photonic Mosaic Layout |
| 1517 |
* Arranges photos similar to JetPack tiles, but without any of the limitations of JetPack tiles. JS-based, responsive, and images are not affected by resolution issues. |
| 1518 |
* |
| 1519 |
* License: GPL V3.0 |
| 1520 |
*/ |
| 1521 |
var getDistribution = (setSize, max, min) => { |
| 1522 |
var distribution = []; |
| 1523 |
var processed = 0; |
| 1524 |
|
| 1525 |
while (processed < setSize) { |
| 1526 |
if (setSize - processed <= max && processed > 0) { |
| 1527 |
distribution.push(setSize - processed); |
| 1528 |
processed += setSize - processed; |
| 1529 |
} else { |
| 1530 |
var current = Math.max(Math.floor(Math.random() * max + 1), min); |
| 1531 |
current = Math.min(current, setSize - processed); |
| 1532 |
distribution.push(current); |
| 1533 |
processed += current; |
| 1534 |
} |
| 1535 |
} |
| 1536 |
|
| 1537 |
return distribution; |
| 1538 |
}; |
| 1539 |
|
| 1540 |
var arrayAlternate = (array, remainder) => array.filter((value, index) => index % 2 === remainder); |
| 1541 |
|
| 1542 |
var setUniformHeightsForRow = array => { |
| 1543 |
// First, order the array by increasing height |
| 1544 |
array.sort((a, b) => a.height - b.height); |
| 1545 |
array[0].new_height = array[0].height; |
| 1546 |
array[0].new_width = array[0].width; |
| 1547 |
|
| 1548 |
for (var i = 1; i < array.length; i++) { |
| 1549 |
array[i].new_height = array[0].height; |
| 1550 |
array[i].new_width = array[i].new_height * array[i].aspect_ratio; |
| 1551 |
} |
| 1552 |
|
| 1553 |
var new_width = array.reduce((sum, p) => sum += p.new_width, 0); |
| 1554 |
return { |
| 1555 |
elements: array, |
| 1556 |
height: array[0].new_height, |
| 1557 |
width: new_width, |
| 1558 |
aspect_ratio: new_width / array[0].new_height |
| 1559 |
}; |
| 1560 |
}; |
| 1561 |
|
| 1562 |
var finalizeTiledLayout = (components, containers) => { |
| 1563 |
var cLength = components.length; |
| 1564 |
|
| 1565 |
for (var c = 0; c < cLength; c++) { |
| 1566 |
var component = components[c]; |
| 1567 |
var rowY = component.y, |
| 1568 |
otherRowHeight = 0, |
| 1569 |
container = void 0; |
| 1570 |
var ceLen = component.elements.length; |
| 1571 |
|
| 1572 |
for (var e = 0; e < ceLen; e++) { |
| 1573 |
var element = component.elements[e]; |
| 1574 |
|
| 1575 |
if (element.photo_position !== undefined) { |
| 1576 |
// Component is a single image |
| 1577 |
container = containers[element.photo_position]; |
| 1578 |
container.style.width = component.new_width + 'px'; |
| 1579 |
container.style.height = component.new_height + 'px'; |
| 1580 |
container.style.top = component.y + 'px'; |
| 1581 |
container.style.left = component.x + 'px'; |
| 1582 |
} else { |
| 1583 |
// Component is a clique (element is a row). Widths and Heights of cliques have been calculated. But the rows in cliques need to be recalculated |
| 1584 |
element.new_width = component.new_width; |
| 1585 |
|
| 1586 |
if (otherRowHeight === 0) { |
| 1587 |
element.new_height = element.new_width / element.aspect_ratio; |
| 1588 |
otherRowHeight = element.new_height; |
| 1589 |
} else { |
| 1590 |
element.new_height = component.new_height - otherRowHeight; |
| 1591 |
} |
| 1592 |
|
| 1593 |
element.x = component.x; |
| 1594 |
element.y = rowY; |
| 1595 |
rowY += element.new_height; |
| 1596 |
var totalWidth = element.elements.reduce((sum, p) => sum += p.new_width, 0); |
| 1597 |
var rowX = 0; |
| 1598 |
var eLength = element.elements.length; |
| 1599 |
|
| 1600 |
for (var i = 0; i < eLength; i++) { |
| 1601 |
var image = element.elements[i]; |
| 1602 |
image.new_width = element.new_width * image.new_width / totalWidth; |
| 1603 |
image.new_height = element.new_height; //image.new_width / image.aspect_ratio; |
| 1604 |
|
| 1605 |
image.x = rowX; |
| 1606 |
rowX += image.new_width; |
| 1607 |
container = containers[image.photo_position]; |
| 1608 |
container.style.width = Math.floor(image.new_width) + 'px'; |
| 1609 |
container.style.height = Math.floor(image.new_height) + 'px'; |
| 1610 |
container.style.top = Math.floor(element.y) + 'px'; |
| 1611 |
container.style.left = Math.floor(element.x + image.x) + 'px'; |
| 1612 |
} |
| 1613 |
} |
| 1614 |
} |
| 1615 |
} |
| 1616 |
}; |
| 1617 |
|
| 1618 |
var doImageLayout = (grid, needToWait) => { |
| 1619 |
var viewportWidth = Math.floor(grid.getBoundingClientRect().width), |
| 1620 |
triggerWidth = isNaN(Photonic_JS.mosaic_trigger_width) || parseInt(Photonic_JS.mosaic_trigger_width) <= 0 ? 200 : parseInt(Photonic_JS.mosaic_trigger_width), |
| 1621 |
maxInRow = Math.floor(viewportWidth / triggerWidth), |
| 1622 |
minInRow = viewportWidth >= triggerWidth * 2 ? 2 : 1, |
| 1623 |
photos = []; |
| 1624 |
var setSize; |
| 1625 |
var containers = [], |
| 1626 |
images = Array.from(grid.getElementsByTagName('img')); |
| 1627 |
images.forEach((image, position) => { |
| 1628 |
if (image.closest('.photonic-panel') != null) { |
| 1629 |
return; |
| 1630 |
} |
| 1631 |
|
| 1632 |
var a = image.parentNode; |
| 1633 |
var div = a.parentNode; |
| 1634 |
div.setAttribute('data-photonic-photo-index', position); |
| 1635 |
containers[position] = div; |
| 1636 |
var height = needToWait ? image.naturalHeight : image.getAttribute('height'), |
| 1637 |
width = needToWait ? image.naturalWidth : image.getAttribute('width'); |
| 1638 |
|
| 1639 |
if (!(height === 0 || height === undefined || width === undefined)) { |
| 1640 |
var aspectRatio = width / height; |
| 1641 |
photos.push({ |
| 1642 |
src: image.src, |
| 1643 |
width: width, |
| 1644 |
height: height, |
| 1645 |
aspect_ratio: aspectRatio, |
| 1646 |
photo_position: position |
| 1647 |
}); |
| 1648 |
} |
| 1649 |
}); |
| 1650 |
setSize = photos.length; |
| 1651 |
var distribution = getDistribution(setSize, maxInRow, minInRow); // We got our random distribution. Let's divide the photos up according to the distribution. |
| 1652 |
|
| 1653 |
var groups = [], |
| 1654 |
startIdx = 0; |
| 1655 |
distribution.forEach(size => { |
| 1656 |
groups.push(photos.slice(startIdx, startIdx + size)); |
| 1657 |
startIdx += size; |
| 1658 |
}); |
| 1659 |
var groupY = 0; // We now have our groups of photos. We need to find the optimal layout for each group. |
| 1660 |
|
| 1661 |
groups.forEach(group => { |
| 1662 |
// First, order the group by aspect ratio |
| 1663 |
group.sort((a, b) => a.aspect_ratio - b.aspect_ratio); // Next, pick a random layout |
| 1664 |
|
| 1665 |
var groupLayout; |
| 1666 |
|
| 1667 |
if (group.length === 1) { |
| 1668 |
groupLayout = [1]; |
| 1669 |
} else if (group.length === 2) { |
| 1670 |
groupLayout = [1, 1]; |
| 1671 |
} else { |
| 1672 |
groupLayout = getDistribution(group.length, group.length - 1, 1); |
| 1673 |
} // Now, LAYOUT, BABY!!! |
| 1674 |
|
| 1675 |
|
| 1676 |
var cliqueF = 0, |
| 1677 |
cliqueL = group.length - 1, |
| 1678 |
cliques = [], |
| 1679 |
indices = []; |
| 1680 |
|
| 1681 |
for (var i = 2; i <= maxInRow; i++) { |
| 1682 |
var index = groupLayout.indexOf(i); |
| 1683 |
|
| 1684 |
while (-1 < index && cliqueF < cliqueL) { |
| 1685 |
// Ideal Layout: one landscape, one portrait. But we will take any 2 with contrasting aspect ratios |
| 1686 |
var clique = [], |
| 1687 |
j = 0; |
| 1688 |
|
| 1689 |
while (j < i && cliqueF <= cliqueL) { |
| 1690 |
clique.push(group[cliqueF++]); // One with a low aspect ratio |
| 1691 |
|
| 1692 |
j++; |
| 1693 |
|
| 1694 |
if (j < i && cliqueF <= cliqueL) { |
| 1695 |
clique.push(group[cliqueL--]); // One with a high aspect ratio |
| 1696 |
|
| 1697 |
j++; |
| 1698 |
} |
| 1699 |
} // Clique is formed. Add it to the list of cliques. |
| 1700 |
|
| 1701 |
|
| 1702 |
cliques.push(clique); |
| 1703 |
indices.push(index); // Keep track of the position of the clique in the row |
| 1704 |
|
| 1705 |
index = groupLayout.indexOf(i, index + 1); |
| 1706 |
} |
| 1707 |
} // The ones that are not in any clique (i.e. the ones in the middle) will be given their own columns in the row. |
| 1708 |
|
| 1709 |
|
| 1710 |
var remainder = group.slice(cliqueF, cliqueL + 1); // Now let's layout the cliques individually. Each clique is its own column. |
| 1711 |
|
| 1712 |
var rowLayout = []; |
| 1713 |
cliques.forEach((clique, cliqueIdx) => { |
| 1714 |
var toss = Math.floor(Math.random() * 2); // 0 --> Groups of smallest and largest, or 1 --> Alternating |
| 1715 |
|
| 1716 |
var oneRow, otherRow; |
| 1717 |
|
| 1718 |
if (toss === 0) { |
| 1719 |
// Group the ones with the lowest aspect ratio together, and the ones with the highest aspect ratio together. |
| 1720 |
// Lay one group at the top and the other at the bottom |
| 1721 |
var wide = Math.max(Math.floor(Math.random() * (clique.length / 2 - 1)), 1); |
| 1722 |
oneRow = clique.slice(0, wide); |
| 1723 |
otherRow = clique.slice(wide); |
| 1724 |
} else { |
| 1725 |
// Group alternates together. |
| 1726 |
// Lay one group at the top and the other at the bottom |
| 1727 |
oneRow = arrayAlternate(clique, 0); |
| 1728 |
otherRow = arrayAlternate(clique, 1); |
| 1729 |
} // Make heights consistent within rows: |
| 1730 |
|
| 1731 |
|
| 1732 |
oneRow = setUniformHeightsForRow(oneRow); |
| 1733 |
otherRow = setUniformHeightsForRow(otherRow); // Now make widths consistent |
| 1734 |
|
| 1735 |
oneRow.new_width = Math.min(oneRow.width, otherRow.width); |
| 1736 |
oneRow.new_height = oneRow.new_width / oneRow.aspect_ratio; |
| 1737 |
otherRow.new_width = oneRow.new_width; |
| 1738 |
otherRow.new_height = otherRow.new_width / otherRow.aspect_ratio; |
| 1739 |
rowLayout.push({ |
| 1740 |
elements: [oneRow, otherRow], |
| 1741 |
height: oneRow.new_height + otherRow.new_height, |
| 1742 |
width: oneRow.new_width, |
| 1743 |
aspect_ratio: oneRow.new_width / (oneRow.new_height + otherRow.new_height), |
| 1744 |
element_position: indices[cliqueIdx] |
| 1745 |
}); |
| 1746 |
}); |
| 1747 |
rowLayout.sort((a, b) => a.element_position - b.element_position); |
| 1748 |
var orderedRowLayout = []; |
| 1749 |
|
| 1750 |
for (var position = 0; position < groupLayout.length; position++) { |
| 1751 |
var cliqueExists = indices.indexOf(position) > -1; |
| 1752 |
|
| 1753 |
if (cliqueExists) { |
| 1754 |
orderedRowLayout.push(rowLayout.shift()); |
| 1755 |
} else { |
| 1756 |
var rem = remainder.shift(); |
| 1757 |
orderedRowLayout.push({ |
| 1758 |
elements: [rem], |
| 1759 |
height: rem.height, |
| 1760 |
width: rem.width, |
| 1761 |
aspect_ratio: rem.aspect_ratio |
| 1762 |
}); |
| 1763 |
} |
| 1764 |
} // Main Row layout is fully constructed and ordered. Now we need to balance heights and widths of all cliques with the "remainder" |
| 1765 |
|
| 1766 |
|
| 1767 |
var totalAspect = orderedRowLayout.reduce((sum, p) => sum += p.aspect_ratio, 0); |
| 1768 |
var elementX = 0; |
| 1769 |
orderedRowLayout.forEach(component => { |
| 1770 |
component.new_width = component.aspect_ratio / totalAspect * viewportWidth; |
| 1771 |
component.new_height = component.new_width / component.aspect_ratio; |
| 1772 |
component.y = groupY; |
| 1773 |
component.x = elementX; |
| 1774 |
elementX += component.new_width; |
| 1775 |
}); |
| 1776 |
groupY += orderedRowLayout[0].new_height; |
| 1777 |
finalizeTiledLayout(orderedRowLayout, containers); |
| 1778 |
}); |
| 1779 |
grid.style.height = groupY + 'px'; |
| 1780 |
}; |
| 1781 |
|
| 1782 |
var Mosaic = (resized, jsLoaded, selector) => { |
| 1783 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Mosaic'); |
| 1784 |
var selection = document.querySelectorAll(selector); |
| 1785 |
|
| 1786 |
if (selector == null || selection.length === 0) { |
| 1787 |
selection = document.querySelectorAll('.photonic-mosaic-layout'); |
| 1788 |
} |
| 1789 |
|
| 1790 |
if (!resized && selection.length > 0) { |
| 1791 |
_Core.Core.showSpinner(); |
| 1792 |
} |
| 1793 |
|
| 1794 |
selection.forEach(grid => { |
| 1795 |
if (!grid.hasChildNodes()) { |
| 1796 |
return; |
| 1797 |
} |
| 1798 |
|
| 1799 |
if (grid.classList.contains('sizes-present')) { |
| 1800 |
_Core.Core.watchForImages(grid); |
| 1801 |
|
| 1802 |
doImageLayout(grid, false); |
| 1803 |
|
| 1804 |
_Core.Core.showSlideupTitle(); |
| 1805 |
|
| 1806 |
if (!resized && !jsLoaded) { |
| 1807 |
_Core.Core.hideLoading(); |
| 1808 |
} |
| 1809 |
} else { |
| 1810 |
_Core.Core.waitForImages(grid).then(() => { |
| 1811 |
if (!grid.classList.contains('sizes-present')) { |
| 1812 |
doImageLayout(grid, true); |
| 1813 |
} |
| 1814 |
|
| 1815 |
Array.from(grid.getElementsByTagName('img')).forEach(image => Util.fadeIn(image)); |
| 1816 |
|
| 1817 |
_Core.Core.showSlideupTitle(); |
| 1818 |
|
| 1819 |
if (!resized && !jsLoaded) { |
| 1820 |
_Core.Core.hideLoading(); |
| 1821 |
} |
| 1822 |
}); |
| 1823 |
} |
| 1824 |
}); |
| 1825 |
if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Mosaic'); |
| 1826 |
}; //Mosaic(false); |
| 1827 |
|
| 1828 |
|
| 1829 |
exports.Mosaic = Mosaic; |
| 1830 |
|
| 1831 |
/***/ }), |
| 1832 |
|
| 1833 |
/***/ "../include/js/front-end/src/Layouts/Slider.js": |
| 1834 |
/*!*****************************************************!*\ |
| 1835 |
!*** ../include/js/front-end/src/Layouts/Slider.js ***! |
| 1836 |
\*****************************************************/ |
| 1837 |
/*! flagged exports */ |
| 1838 |
/*! export Slider [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1839 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1840 |
/*! export initializeSliders [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1841 |
/*! other exports [not provided] [no usage info] */ |
| 1842 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 1843 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1844 |
|
| 1845 |
|
| 1846 |
|
| 1847 |
Object.defineProperty(exports, "__esModule", ({ |
| 1848 |
value: true |
| 1849 |
})); |
| 1850 |
exports.initializeSliders = exports.Slider = void 0; |
| 1851 |
|
| 1852 |
var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js"); |
| 1853 |
|
| 1854 |
var adaptiveHeight = (slideshow, slide, splide) => { |
| 1855 |
var options = splide.options; |
| 1856 |
var currentlyActive = splide.index; |
| 1857 |
|
| 1858 |
if (slide.isWithin(parseInt(currentlyActive), parseInt(options.perPage) - 1)) { |
| 1859 |
var allSlides = splide.Components.Elements.slides; |
| 1860 |
var lastVisible = parseInt(currentlyActive) + parseInt(options.perPage); |
| 1861 |
var visibleSlides = allSlides.slice(currentlyActive, lastVisible); |
| 1862 |
var maxHeight = 0; // Need requestAnimationFrame, otherwise offsetHeight returns 0 for first photo |
| 1863 |
|
| 1864 |
requestAnimationFrame(() => { |
| 1865 |
Array.prototype.forEach.call(visibleSlides, visible => { |
| 1866 |
var visibleImage = visible.querySelector('img'); |
| 1867 |
var offsetHeight = visibleImage.offsetHeight; |
| 1868 |
|
| 1869 |
if (visibleImage && offsetHeight > maxHeight) { |
| 1870 |
maxHeight = offsetHeight; |
| 1871 |
} |
| 1872 |
}); |
| 1873 |
slide.slide.style.height = "".concat(maxHeight, "px"); |
| 1874 |
var splideTrack = slideshow.querySelector('.splide__track'); |
| 1875 |
var splideTrackHeight = splideTrack ? splideTrack.offsetHeight : 0; |
| 1876 |
|
| 1877 |
if (maxHeight !== splideTrackHeight) { |
| 1878 |
var splideList = slideshow.querySelector('.splide__list'); |
| 1879 |
splideList.style.height = "".concat(maxHeight, "px"); |
| 1880 |
splideTrack.style.height = "".concat(maxHeight, "px"); |
| 1881 |
} |
| 1882 |
}); |
| 1883 |
} |
| 1884 |
}; |
| 1885 |
|
| 1886 |
var fixedHeight = (slideshow, splideObj) => { |
| 1887 |
var maxHeight = 0, |
| 1888 |
maxAspect = 0, |
| 1889 |
containerWidth = slideshow.offsetWidth, |
| 1890 |
children = slideshow.querySelectorAll('.splide__slide img'); |
| 1891 |
Array.prototype.forEach.call(children, img => { |
| 1892 |
if (img.naturalHeight !== 0) { |
| 1893 |
var childAspect = img.naturalWidth / img.naturalHeight; |
| 1894 |
|
| 1895 |
if (childAspect >= maxAspect) { |
| 1896 |
maxAspect = childAspect; |
| 1897 |
var heightFactor = img.naturalWidth > containerWidth ? containerWidth / img.naturalWidth : 1; |
| 1898 |
var cols = parseInt(splideObj.options.perPage, 10); |
| 1899 |
|
| 1900 |
if (!isNaN(cols) && cols !== 0) { |
| 1901 |
heightFactor = heightFactor / cols; |
| 1902 |
} |
| 1903 |
|
| 1904 |
maxHeight = img.naturalHeight * heightFactor; |
| 1905 |
} |
| 1906 |
} |
| 1907 |
}); |
| 1908 |
Array.prototype.forEach.call(children, img => { |
| 1909 |
img.style.height = maxHeight + 'px'; |
| 1910 |
}); |
| 1911 |
Array.prototype.forEach.call(slideshow.querySelectorAll('.splide__slide, .splide__list'), slideOrList => { |
| 1912 |
slideOrList.style.height = maxHeight + 'px'; |
| 1913 |
}); |
| 1914 |
slideshow.style.height = maxHeight + 'px'; |
| 1915 |
}; |
| 1916 |
|
| 1917 |
var Slider = slideshow => { |
| 1918 |
if (slideshow) { |
| 1919 |
var content = slideshow.querySelector('.photonic-slideshow-content'); |
| 1920 |
|
| 1921 |
if (content) { |
| 1922 |
_Core.Core.waitForImages(slideshow).then(() => { |
| 1923 |
var idStr = '#' + slideshow.getAttribute('id'); |
| 1924 |
var splideThumbs = document.querySelector(idStr + '-thumbs'); |
| 1925 |
|
| 1926 |
if (splideThumbs != null) { |
| 1927 |
splideThumbs = new Splide(idStr + '-thumbs'); |
| 1928 |
splideThumbs.mount(); |
| 1929 |
} |
| 1930 |
|
| 1931 |
var splide = new Splide(idStr); |
| 1932 |
splide.on('mounted resize', function (slide) { |
| 1933 |
if (slideshow.classList.contains('photonic-slideshow-side-white') || slideshow.classList.contains('photonic-slideshow-start-next')) { |
| 1934 |
fixedHeight(slideshow, splide); |
| 1935 |
} |
| 1936 |
}); |
| 1937 |
splide.on('visible', function (slide) { |
| 1938 |
if (slideshow.classList.contains('photonic-slideshow-adapt-height')) { |
| 1939 |
adaptiveHeight(slideshow, slide, splide); |
| 1940 |
} |
| 1941 |
}); |
| 1942 |
|
| 1943 |
if (splideThumbs == null) { |
| 1944 |
splide.mount(); |
| 1945 |
} else { |
| 1946 |
splide.sync(splideThumbs).mount(); |
| 1947 |
} |
| 1948 |
|
| 1949 |
slideshow.querySelectorAll('img').forEach(img => { |
| 1950 |
img.style.display = 'inline'; |
| 1951 |
}); |
| 1952 |
}); |
| 1953 |
} |
| 1954 |
} |
| 1955 |
}; |
| 1956 |
|
| 1957 |
exports.Slider = Slider; |
| 1958 |
|
| 1959 |
var initializeSliders = () => { |
| 1960 |
var primarySliders = document.querySelectorAll('.photonic-slideshow'); |
| 1961 |
|
| 1962 |
if (typeof Splide != "undefined") { |
| 1963 |
primarySliders.forEach(slideshow => Slider(slideshow)); |
| 1964 |
} else if (console !== undefined && primarySliders.length > 0) { |
| 1965 |
console.error('Splide not found! Please ensure that the Splide script is available and loaded before Photonic.'); |
| 1966 |
} |
| 1967 |
}; |
| 1968 |
|
| 1969 |
exports.initializeSliders = initializeSliders; |
| 1970 |
|
| 1971 |
/***/ }), |
| 1972 |
|
| 1973 |
/***/ "../include/js/front-end/src/Listeners.js": |
| 1974 |
/*!************************************************!*\ |
| 1975 |
!*** ../include/js/front-end/src/Listeners.js ***! |
| 1976 |
\************************************************/ |
| 1977 |
/*! flagged exports */ |
| 1978 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1979 |
/*! export addAllListeners [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1980 |
/*! export addHelperMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1981 |
/*! export addLazyLoadListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1982 |
/*! export addLevel2ClickListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1983 |
/*! export addLevel3ExpandListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1984 |
/*! export addMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1985 |
/*! export addPasswordSubmitListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1986 |
/*! export addSlideUpEnterListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1987 |
/*! export addSlideUpLeaveListener [provided] [no usage info] [missing usage info prevents renaming] */ |
| 1988 |
/*! other exports [not provided] [no usage info] */ |
| 1989 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 1990 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1991 |
|
| 1992 |
|
| 1993 |
|
| 1994 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 1995 |
|
| 1996 |
Object.defineProperty(exports, "__esModule", ({ |
| 1997 |
value: true |
| 1998 |
})); |
| 1999 |
exports.addAllListeners = exports.addLazyLoadListener = exports.addSlideUpLeaveListener = exports.addSlideUpEnterListener = exports.addHelperMoreButtonListener = exports.addMoreButtonListener = exports.addLevel3ExpandListener = exports.addPasswordSubmitListener = exports.addLevel2ClickListener = void 0; |
| 2000 |
|
| 2001 |
var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js"); |
| 2002 |
|
| 2003 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js")); |
| 2004 |
|
| 2005 |
var Requests = _interopRequireWildcard(__webpack_require__(/*! ./Requests */ "../include/js/front-end/src/Requests.js")); |
| 2006 |
|
| 2007 |
var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js"); |
| 2008 |
|
| 2009 |
var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js"); |
| 2010 |
|
| 2011 |
var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js"); |
| 2012 |
|
| 2013 |
var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js"); |
| 2014 |
|
| 2015 |
// .photonic-level-2-thumb:not(".gallery-page") |
| 2016 |
var addLevel2ClickListener = () => { |
| 2017 |
document.addEventListener('click', e => { |
| 2018 |
if (!(e.target instanceof Element) || !e.target.closest('.photonic-level-2-thumb') || Photonic_JS.lightbox_library === 'none') { |
| 2019 |
return; |
| 2020 |
} |
| 2021 |
|
| 2022 |
var clicked = e.target.closest('.photonic-level-2-thumb'); |
| 2023 |
|
| 2024 |
if (Util.hasClass(clicked, 'gallery-page')) { |
| 2025 |
return; |
| 2026 |
} |
| 2027 |
|
| 2028 |
e.preventDefault(); |
| 2029 |
var container = clicked.closest('.photonic-level-2-container'); |
| 2030 |
var galleryData = JSON.parse(container.getAttribute('data-photonic')); |
| 2031 |
var provider = galleryData['platform'], |
| 2032 |
singular = galleryData['singular'], |
| 2033 |
query = container.getAttribute('data-photonic-query'); |
| 2034 |
var args = { |
| 2035 |
"panel_id": clicked.getAttribute('id'), |
| 2036 |
"popup": galleryData['popup'], |
| 2037 |
"photo_count": galleryData['photo-count'], |
| 2038 |
"photo_more": galleryData['photo-more'] || '', |
| 2039 |
"query": query |
| 2040 |
}; |
| 2041 |
if (provider === 'google' || provider === 'zenfolio') args.thumb_size = galleryData['thumb-size']; |
| 2042 |
|
| 2043 |
if (provider === 'flickr' || provider === 'smug' || provider === 'google' || provider === 'zenfolio') { |
| 2044 |
args.overlay_size = galleryData['overlay-size']; |
| 2045 |
args.overlay_video_size = galleryData['overlay-video-size']; |
| 2046 |
} |
| 2047 |
|
| 2048 |
if (provider === 'google') { |
| 2049 |
args.overlay_crop = galleryData['overlay-crop']; |
| 2050 |
} |
| 2051 |
|
| 2052 |
Requests.displayLevel2(provider, singular, args); |
| 2053 |
}, false); |
| 2054 |
}; // .photonic-password-submit |
| 2055 |
|
| 2056 |
|
| 2057 |
exports.addLevel2ClickListener = addLevel2ClickListener; |
| 2058 |
|
| 2059 |
var addPasswordSubmitListener = () => { |
| 2060 |
document.addEventListener('click', e => { |
| 2061 |
if (!(e.target instanceof Element) || !e.target.closest('.photonic-password-submit')) { |
| 2062 |
return; |
| 2063 |
} |
| 2064 |
|
| 2065 |
e.preventDefault(); |
| 2066 |
var clicked = e.target.closest('.photonic-password-submit'); |
| 2067 |
var modal = clicked.closest('.photonic-password-prompter'), |
| 2068 |
container = clicked.closest('.photonic-level-2-container'); |
| 2069 |
var galleryData = JSON.parse(container.getAttribute('data-photonic')); |
| 2070 |
var album_id = modal.getAttribute('id'); |
| 2071 |
var components = album_id.split('-'); |
| 2072 |
var provider = galleryData['platform'], |
| 2073 |
singular_type = galleryData['singular'], |
| 2074 |
album_key = components.slice(4).join('-'), |
| 2075 |
thumb_id = "photonic-".concat(provider, "-").concat(singular_type, "-thumb-").concat(album_key), |
| 2076 |
thumb = document.getElementById("".concat(thumb_id)), |
| 2077 |
query = container.getAttribute('data-photonic-query'); |
| 2078 |
var password = modal.querySelector('input[name="photonic-' + provider + '-password"]'); |
| 2079 |
password = password.value; |
| 2080 |
|
| 2081 |
var prompter = _Core.Core.prompterList["#photonic-".concat(provider, "-").concat(singular_type, "-prompter-").concat(album_key)]; |
| 2082 |
|
| 2083 |
if (prompter !== undefined && prompter !== null) { |
| 2084 |
prompter.hide(); |
| 2085 |
} |
| 2086 |
|
| 2087 |
_Core.Core.showSpinner(); |
| 2088 |
|
| 2089 |
var args = { |
| 2090 |
'panel_id': thumb_id, |
| 2091 |
"popup": galleryData['popup'], |
| 2092 |
"photo_count": galleryData['photo-count'], |
| 2093 |
"photo_more": galleryData['photo-more'] || '', |
| 2094 |
"query": query |
| 2095 |
}; |
| 2096 |
|
| 2097 |
if (provider === 'smug') { |
| 2098 |
args.password = password; |
| 2099 |
args.overlay_size = galleryData['overlay-size']; |
| 2100 |
} else if (provider === 'zenfolio') { |
| 2101 |
args.password = password; |
| 2102 |
args.realm_id = thumb.getAttribute('data-photonic-realm'); |
| 2103 |
args.thumb_size = galleryData['thumb-size']; |
| 2104 |
args.overlay_size = galleryData['overlay-size']; |
| 2105 |
args.overlay_video_size = galleryData['overlay-video-size']; |
| 2106 |
} |
| 2107 |
|
| 2108 |
Requests.processRequest(provider, singular_type, album_key, args); |
| 2109 |
}, false); |
| 2110 |
}; // a.photonic-level-3-expand |
| 2111 |
|
| 2112 |
|
| 2113 |
exports.addPasswordSubmitListener = addPasswordSubmitListener; |
| 2114 |
|
| 2115 |
var addLevel3ExpandListener = () => { |
| 2116 |
document.addEventListener('click', e => { |
| 2117 |
if (!(e.target instanceof Element) || !e.target.closest('a.photonic-level-3-expand')) { |
| 2118 |
return; |
| 2119 |
} |
| 2120 |
|
| 2121 |
e.preventDefault(); |
| 2122 |
var current = e.target.closest('a.photonic-level-3-expand'), |
| 2123 |
header = current.parentNode.parentNode.parentNode, |
| 2124 |
stream = header.parentNode; |
| 2125 |
|
| 2126 |
if (current.classList.contains('photonic-level-3-expand-plus')) { |
| 2127 |
Requests.processL3Request(current, header, { |
| 2128 |
'view': 'collections', |
| 2129 |
'node': current.getAttribute('data-photonic-level-3'), |
| 2130 |
'layout': current.getAttribute('data-photonic-layout'), |
| 2131 |
'stream': stream.getAttribute('id') |
| 2132 |
}); |
| 2133 |
} else if (current.classList.contains('photonic-level-3-expand-up')) { |
| 2134 |
var display = Util.next(header, '.photonic-stream'); |
| 2135 |
Util.slideUpDown(display, 'hide'); |
| 2136 |
current.classList.remove('photonic-level-3-expand-up'); |
| 2137 |
current.classList.add('photonic-level-3-expand-down'); |
| 2138 |
current.setAttribute('title', Photonic_JS.maximize_panel === undefined ? 'Show' : Photonic_JS.maximize_panel); |
| 2139 |
} else if (current.classList.contains('photonic-level-3-expand-down')) { |
| 2140 |
var _display = Util.next(header, '.photonic-stream'); // Util.slideDown(display); |
| 2141 |
|
| 2142 |
|
| 2143 |
Util.slideUpDown(_display, 'show'); |
| 2144 |
current.classList.remove('photonic-level-3-expand-down'); |
| 2145 |
current.classList.add('photonic-level-3-expand-up'); |
| 2146 |
current.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel); |
| 2147 |
} |
| 2148 |
}, false); |
| 2149 |
}; // a.photonic-more-button.photonic-more-dynamic |
| 2150 |
|
| 2151 |
|
| 2152 |
exports.addLevel3ExpandListener = addLevel3ExpandListener; |
| 2153 |
|
| 2154 |
var addMoreButtonListener = () => { |
| 2155 |
document.addEventListener('click', e => { |
| 2156 |
if (!(e.target instanceof Element) || !e.target.closest('a.photonic-more-button.photonic-more-dynamic')) { |
| 2157 |
return; |
| 2158 |
} |
| 2159 |
|
| 2160 |
e.preventDefault(); |
| 2161 |
var clicked = e.target.closest('a.photonic-more-button.photonic-more-dynamic'); |
| 2162 |
var container = clicked.parentNode.querySelector('.photonic-level-1-container, .photonic-level-2-container'); |
| 2163 |
var query = container.getAttribute('data-photonic-query'), |
| 2164 |
provider = container.getAttribute('data-photonic-platform'), |
| 2165 |
level = container.classList.contains('photonic-level-1-container') ? 'level-1' : 'level-2', |
| 2166 |
containerId = container.getAttribute('id'), |
| 2167 |
existing = container.querySelectorAll('figure'); |
| 2168 |
|
| 2169 |
_Core.Core.showSpinner(); |
| 2170 |
|
| 2171 |
Util.post(Photonic_JS.ajaxurl, { |
| 2172 |
'action': 'photonic_load_more', |
| 2173 |
'provider': provider, |
| 2174 |
'query': query |
| 2175 |
}, data => { |
| 2176 |
var ret = Util.getElement(data), |
| 2177 |
images = ret.querySelectorAll(".photonic-".concat(level)), |
| 2178 |
more_button = ret.querySelector('.photonic-more-button'), |
| 2179 |
one_existing = container.querySelector('a.photonic-lb'); |
| 2180 |
var anchors = []; |
| 2181 |
|
| 2182 |
if (one_existing !== null) { |
| 2183 |
images.forEach(image => { |
| 2184 |
var a = image.querySelector('a'); |
| 2185 |
|
| 2186 |
if (a !== null) { |
| 2187 |
a.setAttribute('rel', one_existing.getAttribute('rel')); |
| 2188 |
|
| 2189 |
if (a.getAttribute('data-fancybox') != null) { |
| 2190 |
a.setAttribute('data-fancybox', one_existing.getAttribute('data-fancybox')); |
| 2191 |
} else if (a.getAttribute('data-rel') != null) { |
| 2192 |
a.setAttribute('data-rel', one_existing.getAttribute('data-rel')); |
| 2193 |
} else if (a.getAttribute('data-strip-group') != null) { |
| 2194 |
a.setAttribute('data-strip-group', one_existing.getAttribute('data-strip-group')); |
| 2195 |
} else if (a.getAttribute('data-gall') != null) { |
| 2196 |
a.setAttribute('data-gall', one_existing.getAttribute('data-gall')); |
| 2197 |
} |
| 2198 |
|
| 2199 |
anchors.push(a); |
| 2200 |
} |
| 2201 |
}); |
| 2202 |
} // Can't do this above, which is only for L1 |
| 2203 |
|
| 2204 |
|
| 2205 |
images.forEach(image => container.appendChild(image)); |
| 2206 |
|
| 2207 |
_Core.Core.moveHTML5External(); |
| 2208 |
|
| 2209 |
if (images.length === 0) { |
| 2210 |
_Core.Core.hideLoading(); |
| 2211 |
|
| 2212 |
Util.fadeOut(clicked); |
| 2213 |
clicked.remove(); |
| 2214 |
} |
| 2215 |
|
| 2216 |
var lightbox = _Core.Core.getLightbox(); |
| 2217 |
|
| 2218 |
if (Photonic_JS.lightbox_library === 'imagelightbox') { |
| 2219 |
if (one_existing != null) { |
| 2220 |
lightbox = _Core.Core.getLightboxList()['a[rel="' + one_existing.getAttribute('rel') + '"]']; |
| 2221 |
|
| 2222 |
if (level === 'level-1') { |
| 2223 |
lightbox.addToImageLightbox(anchors); |
| 2224 |
} |
| 2225 |
} |
| 2226 |
} else if (Photonic_JS.lightbox_library === 'lightcase') { |
| 2227 |
if (one_existing != null) { |
| 2228 |
lightbox.initialize('a[data-rel="' + one_existing.getAttribute('data-rel') + '"]'); |
| 2229 |
} |
| 2230 |
} else if (Photonic_JS.lightbox_library === 'lightgallery') { |
| 2231 |
if (one_existing !== null) { |
| 2232 |
lightbox = _Core.Core.getLightboxList()[one_existing.getAttribute('rel')]; |
| 2233 |
var galleryItems = [...lightbox.galleryItems]; |
| 2234 |
images.forEach(image => { |
| 2235 |
var a = image.querySelector('a'); |
| 2236 |
var img = a.querySelector('img'); |
| 2237 |
var videoAttr; |
| 2238 |
|
| 2239 |
if (a.getAttribute('data-photonic-media-type') === 'video') { |
| 2240 |
videoAttr = JSON.parse(a.getAttribute('data-video')); |
| 2241 |
} |
| 2242 |
|
| 2243 |
galleryItems.push({ |
| 2244 |
"alt": img.getAttribute('alt'), |
| 2245 |
"downloadUrl": a.getAttribute('data-download-url'), |
| 2246 |
"src": a.getAttribute('data-photonic-media-type') === 'video' ? videoAttr.source[0].src : a.getAttribute('href'), |
| 2247 |
"subHtml": a.getAttribute('data-sub-html'), |
| 2248 |
"thumb": img.getAttribute('src') |
| 2249 |
}); |
| 2250 |
}); |
| 2251 |
lightbox.updateSlides(galleryItems, 0); |
| 2252 |
lightbox.refresh(); |
| 2253 |
} else { |
| 2254 |
lightbox.initialize(container); |
| 2255 |
} |
| 2256 |
} else if (Photonic_JS.lightbox_library === 'venobox') { |
| 2257 |
if (one_existing !== null) { |
| 2258 |
var gallId = one_existing.getAttribute('data-gall'); |
| 2259 |
|
| 2260 |
if (one_existing.closest('.photonic-panel')) { |
| 2261 |
gallId = one_existing.closest('.photonic-panel').getAttribute('id'); |
| 2262 |
} |
| 2263 |
|
| 2264 |
lightbox.initialize('#' + gallId, true); |
| 2265 |
} |
| 2266 |
} else if (['bigpicture', 'featherlight', 'glightbox', 'spotlight'].includes(Photonic_JS.lightbox_library)) { |
| 2267 |
lightbox.initialize(container); |
| 2268 |
} else if (Photonic_JS.lightbox_library === 'baguettebox') { |
| 2269 |
lightbox.initialize(null, true); |
| 2270 |
} else if (Photonic_JS.lightbox_library === 'fancybox3') { |
| 2271 |
if (one_existing != null) { |
| 2272 |
lightbox.initialize(null, one_existing.getAttribute('data-fancybox')); |
| 2273 |
} |
| 2274 |
} else if (Photonic_JS.lightbox_library === 'photoswipe') { |
| 2275 |
lightbox.initialize(); |
| 2276 |
} |
| 2277 |
|
| 2278 |
function doImageLayout(images) { |
| 2279 |
var new_query = ret.querySelector('.photonic-random-layout,.photonic-standard-layout,.photonic-masonry-layout,.photonic-mosaic-layout,.modal-gallery'); |
| 2280 |
|
| 2281 |
if (new_query != null) { |
| 2282 |
container.setAttribute('data-photonic-query', new_query.getAttribute('data-photonic-query')); |
| 2283 |
} |
| 2284 |
|
| 2285 |
if (more_button == null) { |
| 2286 |
Util.fadeOut(clicked); |
| 2287 |
clicked.remove(); |
| 2288 |
} |
| 2289 |
|
| 2290 |
if (Util.hasClass(container, 'photonic-mosaic-layout')) { |
| 2291 |
(0, _Mosaic.Mosaic)(false, false, '#' + containerId); |
| 2292 |
} else if (Util.hasClass(container, 'photonic-random-layout')) { |
| 2293 |
(0, _Justified.JustifiedGrid)(false, false, '#' + containerId, lightbox); |
| 2294 |
} else if (Util.hasClass(container, 'photonic-masonry-layout')) { |
| 2295 |
images.forEach(image => { |
| 2296 |
var img = image.querySelector('img'); |
| 2297 |
Util.fadeIn(img); |
| 2298 |
img.style.display = 'block'; |
| 2299 |
}); |
| 2300 |
|
| 2301 |
_Core.Core.hideLoading(); |
| 2302 |
} else if (Util.hasClass(container, 'photonic-masonry-horizontal-layout')) { |
| 2303 |
var existingCount = existing.length; |
| 2304 |
images.forEach((image, idx) => { |
| 2305 |
image.setAttribute('data-photonic-idx', existingCount + idx); // const img = image.querySelector('img'); |
| 2306 |
// Util.fadeIn(img); |
| 2307 |
// img.style.display = 'block'; |
| 2308 |
}); |
| 2309 |
(0, _MasonryHorizontal.MasonryHorizontal)(false, false, '#' + containerId); |
| 2310 |
|
| 2311 |
_Core.Core.hideLoading(); |
| 2312 |
} else { |
| 2313 |
container.querySelectorAll('.photonic-' + level).forEach(el => { |
| 2314 |
el.style.display = 'inline-block'; |
| 2315 |
}); |
| 2316 |
|
| 2317 |
_Core.Core.standardizeTitleWidths(); |
| 2318 |
|
| 2319 |
_Core.Core.hideLoading(); |
| 2320 |
} |
| 2321 |
|
| 2322 |
(0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container'); |
| 2323 |
} |
| 2324 |
|
| 2325 |
if (container.classList.contains('sizes-present')) { |
| 2326 |
_Core.Core.watchForImages(images); |
| 2327 |
|
| 2328 |
doImageLayout(images); |
| 2329 |
} else { |
| 2330 |
_Core.Core.waitForImages(images).then(() => { |
| 2331 |
doImageLayout(images); |
| 2332 |
}); |
| 2333 |
} |
| 2334 |
}); |
| 2335 |
}); |
| 2336 |
}; // input[type="button"].photonic-helper-more |
| 2337 |
|
| 2338 |
|
| 2339 |
exports.addMoreButtonListener = addMoreButtonListener; |
| 2340 |
|
| 2341 |
var addHelperMoreButtonListener = () => { |
| 2342 |
document.addEventListener('click', e => { |
| 2343 |
if (!(e.target instanceof Element) || !e.target.closest('input[type="button"].photonic-helper-more')) { |
| 2344 |
return; |
| 2345 |
} |
| 2346 |
|
| 2347 |
e.preventDefault(); |
| 2348 |
|
| 2349 |
_Core.Core.showSpinner(); |
| 2350 |
|
| 2351 |
var clicked = e.target.closest('input[type="button"].photonic-helper-more'); |
| 2352 |
var table = clicked.closest('table'); |
| 2353 |
var nextToken = clicked.getAttribute('data-photonic-token') === undefined ? null : clicked.getAttribute('data-photonic-token'), |
| 2354 |
provider = clicked.getAttribute('data-photonic-platform'), |
| 2355 |
accessType = clicked.getAttribute('data-photonic-access'); |
| 2356 |
var args = { |
| 2357 |
'action': 'photonic_helper_shortcode_more', |
| 2358 |
'provider': provider, |
| 2359 |
'access': accessType |
| 2360 |
}; |
| 2361 |
|
| 2362 |
if (nextToken) { |
| 2363 |
args.nextPageToken = nextToken; |
| 2364 |
} |
| 2365 |
|
| 2366 |
if (provider === 'google') { |
| 2367 |
Util.post(Photonic_JS.ajaxurl, args, data => { |
| 2368 |
var ret = Util.getElement(data); |
| 2369 |
ret = Array.from(ret.getElementsByTagName('tr')); |
| 2370 |
|
| 2371 |
if (ret.length > 0) { |
| 2372 |
var tr = clicked.closest('tr'); |
| 2373 |
|
| 2374 |
if (tr) { |
| 2375 |
tr.remove(); |
| 2376 |
} |
| 2377 |
|
| 2378 |
ret.forEach((node, i) => { |
| 2379 |
if (i !== 0) { |
| 2380 |
table.appendChild(node); |
| 2381 |
} |
| 2382 |
}); |
| 2383 |
} |
| 2384 |
|
| 2385 |
(0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container'); |
| 2386 |
|
| 2387 |
_Core.Core.hideLoading(); |
| 2388 |
}); |
| 2389 |
} |
| 2390 |
}); |
| 2391 |
}; |
| 2392 |
|
| 2393 |
exports.addHelperMoreButtonListener = addHelperMoreButtonListener; |
| 2394 |
|
| 2395 |
var addSlideUpEnterListener = () => { |
| 2396 |
document.addEventListener('mouseover', e => { |
| 2397 |
var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li'; |
| 2398 |
|
| 2399 |
if (e.target instanceof Element && e.target.closest(slideup)) { |
| 2400 |
var node = e.target.closest(slideup); |
| 2401 |
var title = node.querySelector('.photonic-title'); |
| 2402 |
Util.slideUpTitle(title, 'show'); |
| 2403 |
node.setAttribute('title', ''); |
| 2404 |
} |
| 2405 |
}, true); |
| 2406 |
}; |
| 2407 |
|
| 2408 |
exports.addSlideUpEnterListener = addSlideUpEnterListener; |
| 2409 |
|
| 2410 |
var addSlideUpLeaveListener = () => { |
| 2411 |
document.addEventListener('mouseout', e => { |
| 2412 |
var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li'; |
| 2413 |
|
| 2414 |
if (e.target instanceof Element && e.target.closest(slideup)) { |
| 2415 |
var node = e.target.closest(slideup); |
| 2416 |
var title = node.querySelector('.photonic-title'); |
| 2417 |
Util.slideUpTitle(title, 'hide'); |
| 2418 |
node.setAttribute('title', Util.getText(node.getAttribute('data-title'))); |
| 2419 |
} |
| 2420 |
}, true); |
| 2421 |
}; |
| 2422 |
|
| 2423 |
exports.addSlideUpLeaveListener = addSlideUpLeaveListener; |
| 2424 |
|
| 2425 |
var addLazyLoadListener = () => { |
| 2426 |
var buttons = document.documentElement.querySelectorAll('input.photonic-show-gallery-button'); |
| 2427 |
Array.prototype.forEach.call(buttons, button => { |
| 2428 |
button.addEventListener('click', Requests.lazyLoad); |
| 2429 |
}); |
| 2430 |
buttons = document.documentElement.querySelectorAll('input.photonic-js-load-button'); |
| 2431 |
Array.prototype.forEach.call(buttons, button => { |
| 2432 |
button.addEventListener('click', Requests.lazyLoad); |
| 2433 |
button.click(); |
| 2434 |
}); |
| 2435 |
}; |
| 2436 |
|
| 2437 |
exports.addLazyLoadListener = addLazyLoadListener; |
| 2438 |
|
| 2439 |
var addAllListeners = () => { |
| 2440 |
addLevel2ClickListener(); |
| 2441 |
addPasswordSubmitListener(); |
| 2442 |
addLevel3ExpandListener(); |
| 2443 |
addMoreButtonListener(); |
| 2444 |
addHelperMoreButtonListener(); |
| 2445 |
addSlideUpEnterListener(); |
| 2446 |
addSlideUpLeaveListener(); |
| 2447 |
addLazyLoadListener(); |
| 2448 |
}; |
| 2449 |
|
| 2450 |
exports.addAllListeners = addAllListeners; |
| 2451 |
|
| 2452 |
/***/ }), |
| 2453 |
|
| 2454 |
/***/ "../include/js/front-end/src/Requests.js": |
| 2455 |
/*!***********************************************!*\ |
| 2456 |
!*** ../include/js/front-end/src/Requests.js ***! |
| 2457 |
\***********************************************/ |
| 2458 |
/*! flagged exports */ |
| 2459 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2460 |
/*! export displayLevel2 [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2461 |
/*! export lazyLoad [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2462 |
/*! export processL3Request [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2463 |
/*! export processRequest [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2464 |
/*! other exports [not provided] [no usage info] */ |
| 2465 |
/*! runtime requirements: __webpack_exports__, __webpack_require__ */ |
| 2466 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 2467 |
|
| 2468 |
|
| 2469 |
|
| 2470 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 2471 |
|
| 2472 |
Object.defineProperty(exports, "__esModule", ({ |
| 2473 |
value: true |
| 2474 |
})); |
| 2475 |
exports.lazyLoad = exports.processL3Request = exports.displayLevel2 = exports.processRequest = void 0; |
| 2476 |
|
| 2477 |
var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js"); |
| 2478 |
|
| 2479 |
var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js")); |
| 2480 |
|
| 2481 |
var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js"); |
| 2482 |
|
| 2483 |
var _Masonry = __webpack_require__(/*! ./Layouts/Masonry */ "../include/js/front-end/src/Layouts/Masonry.js"); |
| 2484 |
|
| 2485 |
var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js"); |
| 2486 |
|
| 2487 |
var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js"); |
| 2488 |
|
| 2489 |
var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js"); |
| 2490 |
|
| 2491 |
var _Modal = __webpack_require__(/*! ./Components/Modal */ "../include/js/front-end/src/Components/Modal.js"); |
| 2492 |
|
| 2493 |
var spinners = 0; |
| 2494 |
|
| 2495 |
var bypassPopup = data => { |
| 2496 |
_Core.Core.hideLoading(); |
| 2497 |
|
| 2498 |
var panel; |
| 2499 |
|
| 2500 |
if (data instanceof Element) { |
| 2501 |
panel = data; |
| 2502 |
} else { |
| 2503 |
panel = Util.getElement(data).firstElementChild; |
| 2504 |
} |
| 2505 |
|
| 2506 |
Util.hide(panel); |
| 2507 |
var images = panel.querySelectorAll('img'); |
| 2508 |
images.forEach(image => { |
| 2509 |
if ((image.getAttribute('src') === null || image.getAttribute('src') === '') && image.getAttribute('data-src') !== null) { |
| 2510 |
image.setAttribute('src', image.getAttribute('data-src')); |
| 2511 |
image.removeAttribute('data-src'); |
| 2512 |
} |
| 2513 |
}); |
| 2514 |
document.body.appendChild(panel); |
| 2515 |
|
| 2516 |
_Core.Core.moveHTML5External(); |
| 2517 |
|
| 2518 |
var lightbox = _Core.Core.getLightbox(); |
| 2519 |
|
| 2520 |
if (lightbox !== undefined && lightbox !== null) { |
| 2521 |
lightbox.initializeForNewContainer('#' + panel.getAttribute('id')); |
| 2522 |
} |
| 2523 |
|
| 2524 |
var thumbs = panel.querySelectorAll('.photonic-lb'); |
| 2525 |
|
| 2526 |
if (thumbs.length > 0) { |
| 2527 |
_Core.Core.setDeep('#' + thumbs[0].getAttribute('data-photonic-deep')); |
| 2528 |
|
| 2529 |
var evt = new MouseEvent('click', { |
| 2530 |
bubbles: true, |
| 2531 |
cancelable: true, |
| 2532 |
view: window |
| 2533 |
}); // If cancelled, don't dispatch our event |
| 2534 |
|
| 2535 |
!thumbs[0].dispatchEvent(evt); |
| 2536 |
} |
| 2537 |
}; |
| 2538 |
|
| 2539 |
var displayPopup = (data, provider, popup, panelId) => { |
| 2540 |
var safePanelId = panelId.replace('.', '\\.'); // FOR EXISTING ELEMENTS WHICH NEED SANITIZED PANELID |
| 2541 |
|
| 2542 |
var div = Util.getElement(data).firstElementChild; |
| 2543 |
var grid = div.querySelector('.modal-gallery'); |
| 2544 |
|
| 2545 |
var doImageLayout = () => { |
| 2546 |
var popupPanel = document.querySelector('#photonic-' + provider + '-' + popup + '-' + safePanelId); |
| 2547 |
|
| 2548 |
if (popupPanel) { |
| 2549 |
popupPanel.appendChild(div); |
| 2550 |
Util.show(popupPanel); |
| 2551 |
} |
| 2552 |
|
| 2553 |
(0, _Modal.Modal)(div, { |
| 2554 |
modalTarget: 'photonic-' + provider + '-panel-' + safePanelId, |
| 2555 |
color: '#000', |
| 2556 |
width: Photonic_JS.gallery_panel_width + '%', |
| 2557 |
closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%' |
| 2558 |
}); |
| 2559 |
|
| 2560 |
_Core.Core.moveHTML5External(); |
| 2561 |
|
| 2562 |
var lightbox = _Core.Core.getLightbox(); |
| 2563 |
|
| 2564 |
if (lightbox !== undefined && lightbox !== null) { |
| 2565 |
lightbox.initializeForNewContainer('#' + div.getAttribute('id')); |
| 2566 |
} |
| 2567 |
|
| 2568 |
(0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container'); |
| 2569 |
|
| 2570 |
_Core.Core.hideLoading(); |
| 2571 |
}; |
| 2572 |
|
| 2573 |
if (grid.classList.contains('sizes-present')) { |
| 2574 |
_Core.Core.watchForImages(grid); |
| 2575 |
|
| 2576 |
doImageLayout(); |
| 2577 |
} else { |
| 2578 |
_Core.Core.waitForImages(grid).then(() => { |
| 2579 |
doImageLayout(); |
| 2580 |
}); |
| 2581 |
} |
| 2582 |
}; |
| 2583 |
|
| 2584 |
var redisplayPopupContents = (provider, panelId, panel, args) => { |
| 2585 |
var panelEl = Util.getElement(panel); |
| 2586 |
|
| 2587 |
if ('show' === args['popup']) { |
| 2588 |
_Core.Core.hideLoading(); |
| 2589 |
|
| 2590 |
(0, _Modal.Modal)(panelEl, { |
| 2591 |
modalTarget: 'photonic-' + provider + '-panel-' + panelId, |
| 2592 |
color: '#000', |
| 2593 |
width: Photonic_JS.gallery_panel_width + '%', |
| 2594 |
closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%' |
| 2595 |
}); |
| 2596 |
} else { |
| 2597 |
bypassPopup(document.getElementById('photonic-' + provider + '-panel-' + panelId)); |
| 2598 |
} |
| 2599 |
}; |
| 2600 |
|
| 2601 |
var processRequest = (provider, type, identifier, args) => { |
| 2602 |
args['action'] = 'photonic_display_level_2_contents'; |
| 2603 |
Util.post(Photonic_JS.ajaxurl, args, function (data) { |
| 2604 |
if (data.substr(0, Photonic_JS.password_failed.length) === Photonic_JS.password_failed) { |
| 2605 |
_Core.Core.hideLoading(); |
| 2606 |
|
| 2607 |
var prompter = '#photonic-' + provider + '-' + type + '-prompter-' + identifier; |
| 2608 |
var prompterDialog = _Core.Core.prompterList[prompter]; |
| 2609 |
|
| 2610 |
if (prompterDialog !== undefined && prompterDialog !== null) { |
| 2611 |
prompterDialog.show(); |
| 2612 |
} |
| 2613 |
} else { |
| 2614 |
if ('show' === args['popup']) { |
| 2615 |
displayPopup(data, provider, type, identifier); |
| 2616 |
} else { |
| 2617 |
if (data !== '') { |
| 2618 |
bypassPopup(data); |
| 2619 |
} else { |
| 2620 |
_Core.Core.hideLoading(); |
| 2621 |
} |
| 2622 |
} |
| 2623 |
} |
| 2624 |
}); |
| 2625 |
}; |
| 2626 |
|
| 2627 |
exports.processRequest = processRequest; |
| 2628 |
|
| 2629 |
var displayLevel2 = (provider, type, args) => { |
| 2630 |
var identifier = args['panel_id'].substr(('photonic-' + provider + '-' + type + '-thumb-').length); |
| 2631 |
var panel = '#photonic-' + provider + '-panel-' + identifier; |
| 2632 |
var existing = document.getElementById('photonic-' + provider + '-panel-' + identifier); |
| 2633 |
|
| 2634 |
if (existing == null) { |
| 2635 |
existing = document.getElementById(args['panel_id']); |
| 2636 |
|
| 2637 |
if (existing.classList.contains('photonic-' + provider + '-passworded')) { |
| 2638 |
_Core.Core.initializePasswordPrompter("#photonic-".concat(provider, "-").concat(type, "-prompter-").concat(identifier)); |
| 2639 |
} else { |
| 2640 |
_Core.Core.showSpinner(); |
| 2641 |
|
| 2642 |
processRequest(provider, type, identifier, args); |
| 2643 |
} |
| 2644 |
} else { |
| 2645 |
_Core.Core.showSpinner(); |
| 2646 |
|
| 2647 |
redisplayPopupContents(provider, identifier, panel, args); |
| 2648 |
} |
| 2649 |
}; |
| 2650 |
|
| 2651 |
exports.displayLevel2 = displayLevel2; |
| 2652 |
|
| 2653 |
var processL3Request = (clicked, header, args) => { |
| 2654 |
args['action'] = 'photonic_display_level_3_contents'; |
| 2655 |
|
| 2656 |
_Core.Core.showSpinner(); |
| 2657 |
|
| 2658 |
var lightbox = _Core.Core.getLightbox(); |
| 2659 |
|
| 2660 |
Util.post(Photonic_JS.ajaxurl, args, function (data) { |
| 2661 |
var insert = Util.getElement(data); |
| 2662 |
|
| 2663 |
if (header) { |
| 2664 |
var layout = insert.querySelector('.photonic-level-2-container'); |
| 2665 |
var container = header.parentNode; |
| 2666 |
var returnedStream = insert.firstElementChild; |
| 2667 |
var collectionId = args.node.substr('flickr-collection-'.length); |
| 2668 |
returnedStream.setAttribute('id', args.stream + '-' + collectionId); |
| 2669 |
container.insertBefore(returnedStream, header.nextSibling); |
| 2670 |
|
| 2671 |
if (layout.classList.contains('photonic-random-layout')) { |
| 2672 |
(0, _Justified.JustifiedGrid)(false, false, null, lightbox); |
| 2673 |
} else if (layout.classList.contains('photonic-mosaic-layout')) { |
| 2674 |
(0, _Mosaic.Mosaic)(false, false); |
| 2675 |
} else if (layout.classList.contains('photonic-masonry-layout')) { |
| 2676 |
(0, _Masonry.Masonry)(false, false); |
| 2677 |
} else if (layout.classList.contains('photonic-masonry-horizontal-layout')) { |
| 2678 |
(0, _MasonryHorizontal.MasonryHorizontal)(false, false); |
| 2679 |
} else if (layout.classList.contains('sizes-present')) { |
| 2680 |
_Core.Core.watchForImages(layout); |
| 2681 |
} |
| 2682 |
|
| 2683 |
var level2 = returnedStream.querySelectorAll('.photonic-level-2'); |
| 2684 |
level2.forEach(function (item) { |
| 2685 |
item.style.display = 'inline-block'; |
| 2686 |
}); |
| 2687 |
(0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container'); |
| 2688 |
clicked.classList.remove('photonic-level-3-expand-plus'); |
| 2689 |
clicked.classList.add('photonic-level-3-expand-up'); |
| 2690 |
clicked.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel); |
| 2691 |
} |
| 2692 |
|
| 2693 |
_Core.Core.hideLoading(); |
| 2694 |
}); |
| 2695 |
}; |
| 2696 |
|
| 2697 |
exports.processL3Request = processL3Request; |
| 2698 |
|
| 2699 |
var lazyLoad = evt => { |
| 2700 |
spinners++; |
| 2701 |
|
| 2702 |
_Core.Core.showSpinner(); |
| 2703 |
|
| 2704 |
var clicked = evt.currentTarget; |
| 2705 |
var shortcode = clicked.getAttribute('data-photonic-shortcode'); |
| 2706 |
var args = { |
| 2707 |
'action': 'photonic_lazy_load', |
| 2708 |
'shortcode': shortcode |
| 2709 |
}; |
| 2710 |
|
| 2711 |
var countdownSpinners = () => { |
| 2712 |
spinners--; |
| 2713 |
|
| 2714 |
if (spinners <= 0) { |
| 2715 |
_Core.Core.hideLoading(); |
| 2716 |
} |
| 2717 |
}; |
| 2718 |
|
| 2719 |
Util.post(Photonic_JS.ajaxurl, args, data => { |
| 2720 |
var div = document.createElement('div'); |
| 2721 |
div.innerHTML = data; |
| 2722 |
div = div.firstElementChild; |
| 2723 |
|
| 2724 |
if (div) { |
| 2725 |
var divId = div.getAttribute('id'); |
| 2726 |
var divClass = divId.substring(0, divId.lastIndexOf('-')); |
| 2727 |
var streams = document.documentElement.querySelectorAll('.' + divClass); |
| 2728 |
var max = 0; |
| 2729 |
streams.forEach(stream => { |
| 2730 |
var streamId = stream.getAttribute('id'); |
| 2731 |
streamId = streamId.substring(streamId.lastIndexOf('-') + 1); |
| 2732 |
streamId = parseInt(streamId, 10); |
| 2733 |
max = Math.max(max, streamId); |
| 2734 |
}); |
| 2735 |
max = max + 1; |
| 2736 |
var regex = new RegExp(divId, 'gi'); |
| 2737 |
div.innerHTML = data.replace(regex, divClass + '-' + max).replace('photonic-slideshow-' + divId.substring(divId.lastIndexOf('-') + 1), 'photonic-slideshow-' + max); |
| 2738 |
div = div.firstElementChild; // Level 2 elements get their own ids, which need to be readjusted because the back-end always assigns them a gallery_index of 1 |
| 2739 |
|
| 2740 |
div.querySelectorAll('figure.photonic-level-2').forEach(figure => { |
| 2741 |
if (figure.getAttribute('id') != null) { |
| 2742 |
var figId = figure.getAttribute('id'); |
| 2743 |
var modId = figId.substring(0, figId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max" |
| 2744 |
|
| 2745 |
figure.setAttribute('id', modId); |
| 2746 |
var anchor = figure.querySelector('a'); |
| 2747 |
|
| 2748 |
if (anchor.getAttribute('id') != null) { |
| 2749 |
var anchorId = anchor.getAttribute('id'); |
| 2750 |
var modAnchorId = anchorId.substring(0, anchorId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max" |
| 2751 |
|
| 2752 |
anchor.setAttribute('id', modAnchorId); |
| 2753 |
} |
| 2754 |
|
| 2755 |
var prompter = figure.querySelector('.photonic-password-prompter'); |
| 2756 |
|
| 2757 |
if (prompter != null && prompter.getAttribute('id') != null) { |
| 2758 |
var prompterId = prompter.getAttribute('id'); |
| 2759 |
var modPrompterId = prompterId.substring(0, prompterId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max" |
| 2760 |
|
| 2761 |
prompter.setAttribute('id', modPrompterId); |
| 2762 |
} |
| 2763 |
} |
| 2764 |
}); |
| 2765 |
clicked.insertAdjacentElement('afterend', div); |
| 2766 |
var newDivId = divClass + '-' + max; |
| 2767 |
|
| 2768 |
var lightbox = _Core.Core.getLightbox(); |
| 2769 |
|
| 2770 |
if (lightbox !== undefined && lightbox !== null) { |
| 2771 |
lightbox.initializeForNewContainer('#' + div.getAttribute('id')); |
| 2772 |
} |
| 2773 |
|
| 2774 |
if (document.querySelectorAll('#' + newDivId + ' .photonic-random-layout').length > 0) { |
| 2775 |
(0, _Justified.JustifiedGrid)(false, true, '#' + newDivId + ' .photonic-random-layout', lightbox); |
| 2776 |
spinners--; |
| 2777 |
} else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-layout').length > 0) { |
| 2778 |
(0, _Masonry.Masonry)(false, true, '#' + newDivId + ' .photonic-masonry-layout'); |
| 2779 |
spinners--; |
| 2780 |
} else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-horizontal-layout').length > 0) { |
| 2781 |
(0, _MasonryHorizontal.MasonryHorizontal)(false, true, '#' + newDivId + ' .photonic-masonry-horizontal-layout'); |
| 2782 |
spinners--; |
| 2783 |
} else if (document.querySelectorAll('#' + newDivId + ' .photonic-mosaic-layout').length > 0) { |
| 2784 |
(0, _Mosaic.Mosaic)(false, true, '#' + newDivId + ' .photonic-mosaic-layout'); |
| 2785 |
spinners--; |
| 2786 |
} // Slider(document.querySelector('#photonic-slideshow-' + max)); |
| 2787 |
|
| 2788 |
|
| 2789 |
if (div.classList.contains('sizes-present') || div.querySelector('.sizes-present') !== null) { |
| 2790 |
_Core.Core.watchForImages(div); |
| 2791 |
|
| 2792 |
_Core.Core.standardizeTitleWidths(); |
| 2793 |
|
| 2794 |
countdownSpinners(); |
| 2795 |
} else { |
| 2796 |
_Core.Core.waitForImages(div).then(() => { |
| 2797 |
var standard = document.documentElement.querySelectorAll('#' + newDivId + ' .photonic-standard-layout .photonic-level-1, ' + '#' + newDivId + ' .photonic-standard-layout .photonic-level-2'); |
| 2798 |
standard.forEach(image => { |
| 2799 |
image.style.display = 'inline-block'; |
| 2800 |
}); |
| 2801 |
|
| 2802 |
_Core.Core.standardizeTitleWidths(); |
| 2803 |
|
| 2804 |
countdownSpinners(); |
| 2805 |
}); |
| 2806 |
} |
| 2807 |
|
| 2808 |
_Core.Core.moveHTML5External(); |
| 2809 |
|
| 2810 |
clicked.parentNode.removeChild(clicked); |
| 2811 |
(0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container'); |
| 2812 |
|
| 2813 |
if (spinners <= 0) { |
| 2814 |
_Core.Core.hideLoading(); |
| 2815 |
} |
| 2816 |
} |
| 2817 |
}); |
| 2818 |
}; |
| 2819 |
|
| 2820 |
exports.lazyLoad = lazyLoad; |
| 2821 |
|
| 2822 |
/***/ }), |
| 2823 |
|
| 2824 |
/***/ "../include/js/front-end/src/Util.js": |
| 2825 |
/*!*******************************************!*\ |
| 2826 |
!*** ../include/js/front-end/src/Util.js ***! |
| 2827 |
\*******************************************/ |
| 2828 |
/*! flagged exports */ |
| 2829 |
/*! export HTMLSanitizer [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2830 |
/*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2831 |
/*! export fadeIn [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2832 |
/*! export fadeOut [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2833 |
/*! export get [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2834 |
/*! export getElement [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2835 |
/*! export getText [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2836 |
/*! export hasClass [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2837 |
/*! export hide [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2838 |
/*! export next [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2839 |
/*! export post [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2840 |
/*! export show [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2841 |
/*! export slideUpDown [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2842 |
/*! export slideUpTitle [provided] [no usage info] [missing usage info prevents renaming] */ |
| 2843 |
/*! other exports [not provided] [no usage info] */ |
| 2844 |
/*! runtime requirements: __webpack_exports__ */ |
| 2845 |
/***/ ((__unused_webpack_module, exports) => { |
| 2846 |
|
| 2847 |
|
| 2848 |
|
| 2849 |
Object.defineProperty(exports, "__esModule", ({ |
| 2850 |
value: true |
| 2851 |
})); |
| 2852 |
exports.HTMLSanitizer = exports.hide = exports.show = exports.fadeOut = exports.fadeIn = exports.slideUpTitle = exports.slideUpDown = exports.getText = exports.getElement = exports.next = exports.get = exports.post = exports.hasClass = void 0; |
| 2853 |
|
| 2854 |
// Utilities for Photonic |
| 2855 |
var hasClass = (element, className) => { |
| 2856 |
if (element.classList) { |
| 2857 |
return element.classList.contains(className); |
| 2858 |
} else { |
| 2859 |
return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); |
| 2860 |
} |
| 2861 |
}; |
| 2862 |
|
| 2863 |
exports.hasClass = hasClass; |
| 2864 |
|
| 2865 |
function ajax(method, url, args, callback) { |
| 2866 |
var xhr = new XMLHttpRequest(); |
| 2867 |
xhr.open(method, url); |
| 2868 |
|
| 2869 |
xhr.onreadystatechange = function () { |
| 2870 |
if (xhr.readyState === 4) { |
| 2871 |
if (xhr.status === 200) { |
| 2872 |
var data = xhr.responseText; |
| 2873 |
callback(data); |
| 2874 |
} |
| 2875 |
} |
| 2876 |
}; |
| 2877 |
|
| 2878 |
var form = new FormData(); |
| 2879 |
|
| 2880 |
for (var [key, value] of Object.entries(args)) { |
| 2881 |
form.append(key, value); |
| 2882 |
} |
| 2883 |
|
| 2884 |
xhr.send(form); |
| 2885 |
} |
| 2886 |
|
| 2887 |
var post = (url, args, callback) => { |
| 2888 |
ajax('POST', url, args, callback); |
| 2889 |
}; |
| 2890 |
|
| 2891 |
exports.post = post; |
| 2892 |
|
| 2893 |
var get = (url, args, callback) => { |
| 2894 |
ajax('GET', url, args, callback); |
| 2895 |
}; |
| 2896 |
|
| 2897 |
exports.get = get; |
| 2898 |
|
| 2899 |
var next = (elem, selector) => { |
| 2900 |
var sibling = elem.nextElementSibling; |
| 2901 |
if (!selector) return sibling; |
| 2902 |
|
| 2903 |
while (sibling) { |
| 2904 |
if (sibling.matches(selector)) return sibling; |
| 2905 |
sibling = sibling.nextElementSibling; |
| 2906 |
} |
| 2907 |
}; |
| 2908 |
|
| 2909 |
exports.next = next; |
| 2910 |
|
| 2911 |
var getElement = value => { |
| 2912 |
var parser = new DOMParser(); |
| 2913 |
var doc = parser.parseFromString(value, 'text/html'); |
| 2914 |
return doc.body; |
| 2915 |
}; |
| 2916 |
|
| 2917 |
exports.getElement = getElement; |
| 2918 |
|
| 2919 |
var getText = value => { |
| 2920 |
// Not using innerHTML because of vulnerability to XSS |
| 2921 |
if (value == null) { |
| 2922 |
return ''; |
| 2923 |
} |
| 2924 |
|
| 2925 |
return value.replace(/<[^>]+>/g, ''); |
| 2926 |
}; |
| 2927 |
|
| 2928 |
exports.getText = getText; |
| 2929 |
|
| 2930 |
var slideUpDown = (element, state) => { |
| 2931 |
if (element != null && element.classList) { |
| 2932 |
if (!element.classList.contains('photonic-can-slide')) { |
| 2933 |
element.classList.add('photonic-can-slide'); |
| 2934 |
} |
| 2935 |
|
| 2936 |
if ('show' === state) { |
| 2937 |
element.classList.remove('photonic-can-slide-hide'); |
| 2938 |
element.style.height = "".concat(element.scrollHeight, "px"); |
| 2939 |
} else { |
| 2940 |
element.classList.add('photonic-can-slide-hide'); |
| 2941 |
element.style.height = 0; |
| 2942 |
} |
| 2943 |
} |
| 2944 |
}; |
| 2945 |
|
| 2946 |
exports.slideUpDown = slideUpDown; |
| 2947 |
|
| 2948 |
var slideUpTitle = (element, state) => { |
| 2949 |
if (element && element.classList) { |
| 2950 |
if ('show' === state) { |
| 2951 |
var currentPadding = 0; |
| 2952 |
|
| 2953 |
if (element.offsetHeight) { |
| 2954 |
currentPadding = parseInt(getComputedStyle(element).paddingTop.slice(0, -2)) * 2; |
| 2955 |
} |
| 2956 |
|
| 2957 |
element.style.height = element.scrollHeight + 6 - currentPadding + 'px'; |
| 2958 |
element.classList.add('slideup-show'); |
| 2959 |
} else { |
| 2960 |
element.style.height = ''; |
| 2961 |
element.classList.remove('slideup-show'); |
| 2962 |
} |
| 2963 |
} |
| 2964 |
}; |
| 2965 |
|
| 2966 |
exports.slideUpTitle = slideUpTitle; |
| 2967 |
|
| 2968 |
var fadeIn = el => { |
| 2969 |
if (!hasClass(el, 'fade-in')) { |
| 2970 |
el.style.display = 'block'; |
| 2971 |
el.style.visibility = 'visible'; |
| 2972 |
el.classList.add('fade-in'); |
| 2973 |
} |
| 2974 |
}; |
| 2975 |
|
| 2976 |
exports.fadeIn = fadeIn; |
| 2977 |
|
| 2978 |
var fadeOut = (el, duration) => { |
| 2979 |
var s = el.style, |
| 2980 |
step = 25 / (duration || 500); |
| 2981 |
s.opacity = s.opacity || 1; |
| 2982 |
|
| 2983 |
(function fade() { |
| 2984 |
s.opacity -= step; |
| 2985 |
|
| 2986 |
if (s.opacity < 0) { |
| 2987 |
s.display = "none"; |
| 2988 |
el.classList.remove('fade-in'); |
| 2989 |
} else { |
| 2990 |
setTimeout(fade, 25); |
| 2991 |
} |
| 2992 |
})(); |
| 2993 |
}; // get the default display style of an element |
| 2994 |
|
| 2995 |
|
| 2996 |
exports.fadeOut = fadeOut; |
| 2997 |
|
| 2998 |
var defaultDisplay = tag => { |
| 2999 |
var iframe = document.createElement('iframe'); |
| 3000 |
iframe.setAttribute('frameborder', 0); |
| 3001 |
iframe.setAttribute('width', 0); |
| 3002 |
iframe.setAttribute('height', 0); |
| 3003 |
document.documentElement.appendChild(iframe); |
| 3004 |
var doc = (iframe.contentWindow || iframe.contentDocument).document; // IE support |
| 3005 |
|
| 3006 |
doc.write(); |
| 3007 |
doc.close(); |
| 3008 |
var testEl = doc.createElement(tag); |
| 3009 |
doc.documentElement.appendChild(testEl); |
| 3010 |
var display = (window.getComputedStyle ? getComputedStyle(testEl, null) : testEl.currentStyle).display; |
| 3011 |
iframe.parentNode.removeChild(iframe); |
| 3012 |
return display; |
| 3013 |
}; // actual show/hide function used by show() and hide() below |
| 3014 |
|
| 3015 |
|
| 3016 |
var showHide = (el, show) => { |
| 3017 |
var value = el.getAttribute('data-olddisplay'), |
| 3018 |
display = el.style.display, |
| 3019 |
computedDisplay = (window.getComputedStyle ? getComputedStyle(el, null) : el.currentStyle).display; |
| 3020 |
|
| 3021 |
if (show) { |
| 3022 |
if (!value && display === 'none') el.style.display = ''; |
| 3023 |
if (el.style.display === '' && computedDisplay === 'none') value = value || defaultDisplay(el.nodeName); |
| 3024 |
} else { |
| 3025 |
if (display && display !== 'none' || !(computedDisplay === 'none')) el.setAttribute('data-olddisplay', computedDisplay === 'none' ? display : computedDisplay); |
| 3026 |
} |
| 3027 |
|
| 3028 |
if (!show || el.style.display === 'none' || el.style.display === '') el.style.display = show ? value || '' : 'none'; |
| 3029 |
}; // helper functions |
| 3030 |
|
| 3031 |
|
| 3032 |
var show = el => showHide(el, true); |
| 3033 |
|
| 3034 |
exports.show = show; |
| 3035 |
|
| 3036 |
var hide = el => showHide(el); //JavaScript HTML Sanitizer v2.0.3, (c) Alexander Yumashev, Jitbit Software. |
| 3037 |
//homepage https://github.com/jitbit/HtmlSanitizer |
| 3038 |
//License: MIT https://github.com/jitbit/HtmlSanitizer/blob/master/LICENSE |
| 3039 |
|
| 3040 |
|
| 3041 |
exports.hide = hide; |
| 3042 |
var HTMLSanitizer = new function () { |
| 3043 |
var _tagWhitelist = { |
| 3044 |
'A': true, |
| 3045 |
'ABBR': true, |
| 3046 |
'B': true, |
| 3047 |
'BLOCKQUOTE': true, |
| 3048 |
'BODY': true, |
| 3049 |
'BR': true, |
| 3050 |
'CENTER': true, |
| 3051 |
'CODE': true, |
| 3052 |
'DD': true, |
| 3053 |
'DIV': true, |
| 3054 |
'DL': true, |
| 3055 |
'DT': true, |
| 3056 |
'EM': true, |
| 3057 |
'FONT': true, |
| 3058 |
'H1': true, |
| 3059 |
'H2': true, |
| 3060 |
'H3': true, |
| 3061 |
'H4': true, |
| 3062 |
'H5': true, |
| 3063 |
'H6': true, |
| 3064 |
'HR': true, |
| 3065 |
'I': true, |
| 3066 |
'IMG': true, |
| 3067 |
'LABEL': true, |
| 3068 |
'LI': true, |
| 3069 |
'OL': true, |
| 3070 |
'P': true, |
| 3071 |
'PRE': true, |
| 3072 |
'SMALL': true, |
| 3073 |
'SOURCE': true, |
| 3074 |
'SPAN': true, |
| 3075 |
'STRONG': true, |
| 3076 |
'SUB': true, |
| 3077 |
'SUP': true, |
| 3078 |
'TABLE': true, |
| 3079 |
'TBODY': true, |
| 3080 |
'TR': true, |
| 3081 |
'TD': true, |
| 3082 |
'TH': true, |
| 3083 |
'THEAD': true, |
| 3084 |
'UL': true, |
| 3085 |
'U': true, |
| 3086 |
'VIDEO': true |
| 3087 |
}; |
| 3088 |
var _contentTagWhiteList = { |
| 3089 |
'FORM': true, |
| 3090 |
'GOOGLE-SHEETS-HTML-ORIGIN': true |
| 3091 |
}; //tags that will be converted to DIVs |
| 3092 |
|
| 3093 |
var _attributeWhitelist = { |
| 3094 |
'align': true, |
| 3095 |
'color': true, |
| 3096 |
'controls': true, |
| 3097 |
'height': true, |
| 3098 |
'href': true, |
| 3099 |
'id': true, |
| 3100 |
'src': true, |
| 3101 |
'style': true, |
| 3102 |
'target': true, |
| 3103 |
'title': true, |
| 3104 |
'type': true, |
| 3105 |
'width': true |
| 3106 |
}; |
| 3107 |
var _cssWhitelist = { |
| 3108 |
'background-color': true, |
| 3109 |
'color': true, |
| 3110 |
'font-size': true, |
| 3111 |
'font-weight': true, |
| 3112 |
'text-align': true, |
| 3113 |
'text-decoration': true, |
| 3114 |
'width': true |
| 3115 |
}; |
| 3116 |
var _schemaWhiteList = ['http:', 'https:', 'data:', 'm-files:', 'file:', 'ftp:', 'mailto:', 'pw:']; //which "protocols" are allowed in "href", "src" etc |
| 3117 |
|
| 3118 |
var _uriAttributes = { |
| 3119 |
'href': true, |
| 3120 |
'action': true |
| 3121 |
}; |
| 3122 |
|
| 3123 |
var _parser = new DOMParser(); |
| 3124 |
|
| 3125 |
this.SanitizeHTML = (input, extraSelector) => { |
| 3126 |
if (input == null) return null; |
| 3127 |
input = input.trim(); |
| 3128 |
if (input === "") return ""; //to save performance |
| 3129 |
//firefox "bogus node" workaround for wysiwyg's |
| 3130 |
|
| 3131 |
if (input === "<br>") return ""; |
| 3132 |
if (input.indexOf("<body") === -1) input = "<body>" + input + "</body>"; //add "body" otherwise some tags are skipped, like <style> |
| 3133 |
|
| 3134 |
var doc = _parser.parseFromString(input, "text/html"); //DOM clobbering check (damn you firefox) |
| 3135 |
|
| 3136 |
|
| 3137 |
if (doc.body.tagName !== 'BODY') doc.body.remove(); |
| 3138 |
if (typeof doc.createElement !== 'function') doc.createElement.remove(); |
| 3139 |
|
| 3140 |
function makeSanitizedCopy(node) { |
| 3141 |
var newNode; |
| 3142 |
|
| 3143 |
if (node.nodeType === Node.TEXT_NODE) { |
| 3144 |
newNode = node.cloneNode(true); |
| 3145 |
} else if (node.nodeType === Node.ELEMENT_NODE && (_tagWhitelist[node.tagName] || _contentTagWhiteList[node.tagName] || extraSelector && node.matches(extraSelector))) { |
| 3146 |
//is tag allowed? |
| 3147 |
if (_contentTagWhiteList[node.tagName]) newNode = doc.createElement('DIV'); //convert to DIV |
| 3148 |
else newNode = doc.createElement(node.tagName); |
| 3149 |
|
| 3150 |
for (var i = 0; i < node.attributes.length; i++) { |
| 3151 |
var attr = node.attributes[i]; |
| 3152 |
|
| 3153 |
if (_attributeWhitelist[attr.name]) { |
| 3154 |
if (attr.name === "style") { |
| 3155 |
for (var s = 0; s < node.style.length; s++) { |
| 3156 |
var styleName = node.style[s]; |
| 3157 |
if (_cssWhitelist[styleName]) newNode.style.setProperty(styleName, node.style.getPropertyValue(styleName)); |
| 3158 |
} |
| 3159 |
} else { |
| 3160 |
if (_uriAttributes[attr.name]) { |
| 3161 |
//if this is a "uri" attribute, that can have "javascript:" or something |
| 3162 |
if (attr.value.indexOf(":") > -1 && !startsWithAny(attr.value, _schemaWhiteList)) continue; |
| 3163 |
} |
| 3164 |
|
| 3165 |
newNode.setAttribute(attr.name, attr.value); |
| 3166 |
} |
| 3167 |
} |
| 3168 |
} |
| 3169 |
|
| 3170 |
for (var _i = 0; _i < node.childNodes.length; _i++) { |
| 3171 |
var subCopy = makeSanitizedCopy(node.childNodes[_i]); |
| 3172 |
newNode.appendChild(subCopy, false); |
| 3173 |
} //remove useless empty spans (lots of those when pasting from MS Outlook) |
| 3174 |
|
| 3175 |
|
| 3176 |
if ((newNode.tagName === "SPAN" || newNode.tagName === "B" || newNode.tagName === "I" || newNode.tagName === "U") && newNode.innerHTML.trim() === "") { |
| 3177 |
return doc.createDocumentFragment(); |
| 3178 |
} |
| 3179 |
} else { |
| 3180 |
newNode = doc.createDocumentFragment(); |
| 3181 |
} |
| 3182 |
|
| 3183 |
return newNode; |
| 3184 |
} |
| 3185 |
|
| 3186 |
var resultElement = makeSanitizedCopy(doc.body); |
| 3187 |
return resultElement.innerHTML.replace(/div><div/g, "div>\n<div"); //replace is just for cleaner code |
| 3188 |
}; |
| 3189 |
|
| 3190 |
function startsWithAny(str, substrings) { |
| 3191 |
for (var i = 0; i < substrings.length; i++) { |
| 3192 |
if (str.indexOf(substrings[i]) === 0) { |
| 3193 |
return true; |
| 3194 |
} |
| 3195 |
} |
| 3196 |
|
| 3197 |
return false; |
| 3198 |
} |
| 3199 |
|
| 3200 |
this.AllowedTags = _tagWhitelist; |
| 3201 |
this.AllowedAttributes = _attributeWhitelist; |
| 3202 |
this.AllowedCssStyles = _cssWhitelist; |
| 3203 |
this.AllowedSchemas = _schemaWhiteList; |
| 3204 |
}(); |
| 3205 |
exports.HTMLSanitizer = HTMLSanitizer; |
| 3206 |
|
| 3207 |
/***/ }) |
| 3208 |
|
| 3209 |
/******/ }); |
| 3210 |
/************************************************************************/ |
| 3211 |
/******/ // The module cache |
| 3212 |
/******/ var __webpack_module_cache__ = {}; |
| 3213 |
/******/ |
| 3214 |
/******/ // The require function |
| 3215 |
/******/ function __webpack_require__(moduleId) { |
| 3216 |
/******/ // Check if module is in cache |
| 3217 |
/******/ if(__webpack_module_cache__[moduleId]) { |
| 3218 |
/******/ return __webpack_module_cache__[moduleId].exports; |
| 3219 |
/******/ } |
| 3220 |
/******/ // Create a new module (and put it into the cache) |
| 3221 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 3222 |
/******/ // no module.id needed |
| 3223 |
/******/ // no module.loaded needed |
| 3224 |
/******/ exports: {} |
| 3225 |
/******/ }; |
| 3226 |
/******/ |
| 3227 |
/******/ // Execute the module function |
| 3228 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 3229 |
/******/ |
| 3230 |
/******/ // Return the exports of the module |
| 3231 |
/******/ return module.exports; |
| 3232 |
/******/ } |
| 3233 |
/******/ |
| 3234 |
/************************************************************************/ |
| 3235 |
(() => { |
| 3236 |
/*!***************************************************!*\ |
| 3237 |
!*** ../include/js/front-end/src/Entries/None.js ***! |
| 3238 |
\***************************************************/ |
| 3239 |
/*! unknown exports (runtime-defined) */ |
| 3240 |
/*! runtime requirements: __webpack_require__ */ |
| 3241 |
|
| 3242 |
|
| 3243 |
var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"); |
| 3244 |
|
| 3245 |
var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js"); |
| 3246 |
|
| 3247 |
var Listeners = _interopRequireWildcard(__webpack_require__(/*! ../Listeners */ "../include/js/front-end/src/Listeners.js")); |
| 3248 |
|
| 3249 |
var Layout = _interopRequireWildcard(__webpack_require__(/*! ../Layouts/Layout */ "../include/js/front-end/src/Layouts/Layout.js")); |
| 3250 |
|
| 3251 |
document.addEventListener('DOMContentLoaded', () => { |
| 3252 |
_Core.Core.executeCommon(); |
| 3253 |
|
| 3254 |
Listeners.addAllListeners(); |
| 3255 |
Layout.initializeLayouts(); |
| 3256 |
}); |
| 3257 |
})(); |
| 3258 |
|
| 3259 |
/******/ })() |
| 3260 |
; |