Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/blogs-gentoo:master commit in: plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/, ...
Date: Mon, 20 Nov 2017 21:52:54
Message-Id: 1511214737.ad893100e9199d8f203b6c5cb906eb110bbdf0a8.blueness@gentoo
1 commit: ad893100e9199d8f203b6c5cb906eb110bbdf0a8
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 20 21:52:17 2017 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 20 21:52:17 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/blogs-gentoo.git/commit/?id=ad893100
7
8 Update wordpress-mobile-pack 3.2
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11
12 .../admin/pages/theme-settings.php | 2 +-
13 plugins/wordpress-mobile-pack/core/class-wmp.php | 2 +-
14 plugins/wordpress-mobile-pack/core/config.php | 2 +-
15 .../sections/notification-banner/lib/noty.css | 374 +++
16 .../sections/notification-banner/lib/noty.js | 3073 ++++++++++++++++++++
17 .../sections/notification-banner/lib/noty.min.js | 17 +
18 .../notification-banner/notification-banner.js | 112 +
19 .../frontend/sections/smart-app-banner-premium.php | 68 +-
20 .../frontend/sections/smart-app-banner.php | 54 +-
21 .../sections/smart-app-banner/css/style-light.css | 118 -
22 .../smart-app-banner/css/style-light.min.css | 1 -
23 .../sections/smart-app-banner/iframe/bar.html | 222 --
24 .../sections/smart-app-banner/js/UI.Modules/Bar.js | 223 --
25 .../smart-app-banner/js/UI.Modules/Cookie.js | 60 -
26 .../smart-app-banner/js/UI.Modules/Main.js | 136 -
27 .../smart-app-banner/js/UI.Modules/Stage.js | 114 -
28 .../smart-app-banner/js/smart-app-banner.js | 532 ----
29 .../smart-app-banner/js/smart-app-banner.min.js | 1 -
30 plugins/wordpress-mobile-pack/readme.txt | 11 +-
31 .../wordpress-mobile-pack.php | 2 +-
32 20 files changed, 3665 insertions(+), 1459 deletions(-)
33
34 diff --git a/plugins/wordpress-mobile-pack/admin/pages/theme-settings.php b/plugins/wordpress-mobile-pack/admin/pages/theme-settings.php
35 index dc16af3..e332527 100755
36 --- a/plugins/wordpress-mobile-pack/admin/pages/theme-settings.php
37 +++ b/plugins/wordpress-mobile-pack/admin/pages/theme-settings.php
38 @@ -217,7 +217,7 @@
39 } elseif ($icon_filename != '' && file_exists(WMP_FILES_UPLOADS_DIR . $icon_filename)) {
40 foreach (WMobilePack_Uploads::$manifest_sizes as $manifest_size) {
41 if (!file_exists(WMP_FILES_UPLOADS_DIR . $manifest_size . $icon_filename)) {
42 - $warning_message = 'WP Mobile Pack Version 3.1 comes with Add To Home Screen functionality which requires you to reupload your App Icon.';
43 + $warning_message = 'WP Mobile Pack Version 3.2 comes with Add To Home Screen functionality which requires you to reupload your App Icon.';
44 break;
45 }
46 }
47
48 diff --git a/plugins/wordpress-mobile-pack/core/class-wmp.php b/plugins/wordpress-mobile-pack/core/class-wmp.php
49 index 652e139..f27a322 100755
50 --- a/plugins/wordpress-mobile-pack/core/class-wmp.php
51 +++ b/plugins/wordpress-mobile-pack/core/class-wmp.php
52 @@ -193,7 +193,7 @@ if ( ! class_exists( 'WMobilePack' ) ) {
53 } elseif ($icon_filename != '' && file_exists(WMP_FILES_UPLOADS_DIR . $icon_filename)) {
54 foreach (WMobilePack_Uploads::$manifest_sizes as $manifest_size) {
55 if (!file_exists(WMP_FILES_UPLOADS_DIR . $manifest_size . $icon_filename)) {
56 - echo '<div class="notice notice-warning is-dismissible"><p>WP Mobile Pack Version 3.1 comes with Add To Home Screen functionality which requires you to reupload your <a href="' . get_admin_url() . 'admin.php?page=wmp-options-theme-settings"/>App Icon</a>!</p></div>';
57 + echo '<div class="notice notice-warning is-dismissible"><p>WP Mobile Pack Version 3.2 comes with Add To Home Screen functionality which requires you to reupload your <a href="' . get_admin_url() . 'admin.php?page=wmp-options-theme-settings"/>App Icon</a>!</p></div>';
58 return;
59 }
60 }
61
62 diff --git a/plugins/wordpress-mobile-pack/core/config.php b/plugins/wordpress-mobile-pack/core/config.php
63 index 34953f8..faee346 100755
64 --- a/plugins/wordpress-mobile-pack/core/config.php
65 +++ b/plugins/wordpress-mobile-pack/core/config.php
66 @@ -1,6 +1,6 @@
67 <?php
68
69 -define("WMP_VERSION", '3.1');
70 +define("WMP_VERSION", '3.2');
71 define('WMP_PLUGIN_NAME', 'WP Mobile Pack');
72 define('WMP_DOMAIN', 'wordpress-mobile-pack');
73
74
75 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.css b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.css
76 new file mode 100755
77 index 0000000..8648557
78 --- /dev/null
79 +++ b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.css
80 @@ -0,0 +1,374 @@
81 +.noty_layout_mixin,
82 +#noty_layout__top,
83 +#noty_layout__topLeft,
84 +#noty_layout__topCenter,
85 +#noty_layout__topRight,
86 +#noty_layout__bottom,
87 +#noty_layout__bottomLeft,
88 +#noty_layout__bottomCenter,
89 +#noty_layout__bottomRight,
90 +#noty_layout__center,
91 +#noty_layout__centerLeft,
92 +#noty_layout__centerRight {
93 + position: fixed;
94 + margin: 0;
95 + padding: 0;
96 + z-index: 9999999;
97 + -webkit-transform: translateZ(0) scale(1, 1);
98 + transform: translateZ(0) scale(1, 1);
99 + -webkit-backface-visibility: hidden;
100 + backface-visibility: hidden;
101 + -webkit-font-smoothing: subpixel-antialiased;
102 + filter: blur(0);
103 + -webkit-filter: blur(0);
104 + max-width: 100%;
105 +}
106 +
107 +#noty_layout__top {
108 + top: 0;
109 + left: 5%;
110 + width: 90%;
111 +}
112 +
113 +#noty_layout__topLeft {
114 + top: 20px;
115 + left: 20px;
116 + width: 325px;
117 +}
118 +
119 +#noty_layout__topCenter {
120 + top: 0%;
121 + left: 50%;
122 + width: 100%;
123 + -webkit-transform: translate(-webkit-calc(-50% - 0.5px)) translateZ(0)
124 + scale(1, 1);
125 + transform: translate(calc(-50% - 0.5px)) translateZ(0) scale(1, 1);
126 +}
127 +
128 +#noty_layout__topRight {
129 + top: 20px;
130 + right: 20px;
131 + width: 325px;
132 +}
133 +
134 +#noty_layout__bottom {
135 + bottom: 0;
136 + left: 5%;
137 + width: 90%;
138 +}
139 +
140 +#noty_layout__bottomLeft {
141 + bottom: 20px;
142 + left: 20px;
143 + width: 325px;
144 +}
145 +
146 +#noty_layout__bottomCenter {
147 + bottom: 5%;
148 + left: 50%;
149 + width: 325px;
150 + -webkit-transform: translate(-webkit-calc(-50% - 0.5px)) translateZ(0)
151 + scale(1, 1);
152 + transform: translate(calc(-50% - 0.5px)) translateZ(0) scale(1, 1);
153 +}
154 +
155 +#noty_layout__bottomRight {
156 + bottom: 20px;
157 + right: 20px;
158 + width: 325px;
159 +}
160 +
161 +#noty_layout__center {
162 + top: 50%;
163 + left: 50%;
164 + width: 325px;
165 + -webkit-transform: translate(
166 + -webkit-calc(-50% - 0.5px),
167 + -webkit-calc(-50% - 0.5px)
168 + )
169 + translateZ(0) scale(1, 1);
170 + transform: translate(calc(-50% - 0.5px), calc(-50% - 0.5px)) translateZ(0)
171 + scale(1, 1);
172 +}
173 +
174 +#noty_layout__centerLeft {
175 + top: 50%;
176 + left: 20px;
177 + width: 325px;
178 + -webkit-transform: translate(0, -webkit-calc(-50% - 0.5px)) translateZ(0)
179 + scale(1, 1);
180 + transform: translate(0, calc(-50% - 0.5px)) translateZ(0) scale(1, 1);
181 +}
182 +
183 +#noty_layout__centerRight {
184 + top: 50%;
185 + right: 20px;
186 + width: 325px;
187 + -webkit-transform: translate(0, -webkit-calc(-50% - 0.5px)) translateZ(0)
188 + scale(1, 1);
189 + transform: translate(0, calc(-50% - 0.5px)) translateZ(0) scale(1, 1);
190 +}
191 +
192 +.noty_progressbar {
193 + display: none;
194 +}
195 +
196 +.noty_has_timeout.noty_has_progressbar .noty_progressbar {
197 + display: block;
198 + position: absolute;
199 + left: 0;
200 + bottom: 0;
201 + height: 3px;
202 + width: 100%;
203 + background-color: #646464;
204 + opacity: 0.2;
205 + filter: alpha(opacity=10);
206 +}
207 +
208 +.noty_bar {
209 + -webkit-backface-visibility: hidden;
210 + -webkit-transform: translate(0, 0) translateZ(0) scale(1, 1);
211 + -ms-transform: translate(0, 0) scale(1, 1);
212 + transform: translate(0, 0) scale(1, 1);
213 + -webkit-font-smoothing: subpixel-antialiased;
214 + overflow: hidden;
215 +}
216 +
217 +.noty_effects_open {
218 + opacity: 0;
219 + -webkit-transform: translate(50%);
220 + -ms-transform: translate(50%);
221 + transform: translate(50%);
222 + -webkit-animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
223 + animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
224 + -webkit-animation-fill-mode: forwards;
225 + animation-fill-mode: forwards;
226 +}
227 +
228 +.noty_effects_close {
229 + -webkit-animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
230 + animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
231 + -webkit-animation-fill-mode: forwards;
232 + animation-fill-mode: forwards;
233 +}
234 +
235 +.noty_fix_effects_height {
236 + -webkit-animation: noty_anim_height 75ms ease-out;
237 + animation: noty_anim_height 75ms ease-out;
238 +}
239 +
240 +.noty_close_with_click {
241 + cursor: pointer;
242 +}
243 +
244 +.noty_close_button {
245 + position: absolute;
246 + top: 30px;
247 + right: 2px;
248 + font-weight: bold;
249 + width: 20px;
250 + height: 20px;
251 + text-align: center;
252 + line-height: 20px;
253 + background-color: rgba(0, 0, 0, 0.05);
254 + border-radius: 2px;
255 + cursor: pointer;
256 + -webkit-transition: all 0.2s ease-out;
257 + transition: all 0.2s ease-out;
258 +}
259 +
260 +.noty_close_button:hover {
261 + background-color: rgba(0, 0, 0, 0.1);
262 +}
263 +
264 +.noty_modal {
265 + position: fixed;
266 + width: 100%;
267 + height: 100%;
268 + background-color: #000;
269 + z-index: 10000;
270 + opacity: 0.3;
271 + left: 0;
272 + top: 0;
273 +}
274 +
275 +.noty_modal.noty_modal_open {
276 + opacity: 0;
277 + -webkit-animation: noty_modal_in 0.3s ease-out;
278 + animation: noty_modal_in 0.3s ease-out;
279 +}
280 +
281 +.noty_modal.noty_modal_close {
282 + -webkit-animation: noty_modal_out 0.3s ease-out;
283 + animation: noty_modal_out 0.3s ease-out;
284 + -webkit-animation-fill-mode: forwards;
285 + animation-fill-mode: forwards;
286 +}
287 +
288 +@-webkit-keyframes noty_modal_in {
289 + 100% {
290 + opacity: 0.3;
291 + }
292 +}
293 +
294 +@keyframes noty_modal_in {
295 + 100% {
296 + opacity: 0.3;
297 + }
298 +}
299 +
300 +@-webkit-keyframes noty_modal_out {
301 + 100% {
302 + opacity: 0;
303 + }
304 +}
305 +
306 +@keyframes noty_modal_out {
307 + 100% {
308 + opacity: 0;
309 + }
310 +}
311 +
312 +@keyframes noty_modal_out {
313 + 100% {
314 + opacity: 0;
315 + }
316 +}
317 +
318 +@-webkit-keyframes noty_anim_in {
319 + 100% {
320 + -webkit-transform: translate(0);
321 + transform: translate(0);
322 + opacity: 1;
323 + }
324 +}
325 +
326 +@keyframes noty_anim_in {
327 + 100% {
328 + -webkit-transform: translate(0);
329 + transform: translate(0);
330 + opacity: 1;
331 + }
332 +}
333 +
334 +@-webkit-keyframes noty_anim_out {
335 + 100% {
336 + -webkit-transform: translate(50%);
337 + transform: translate(50%);
338 + opacity: 0;
339 + }
340 +}
341 +
342 +@keyframes noty_anim_out {
343 + 100% {
344 + -webkit-transform: translate(50%);
345 + transform: translate(50%);
346 + opacity: 0;
347 + }
348 +}
349 +
350 +@-webkit-keyframes noty_anim_height {
351 + 100% {
352 + height: 0;
353 + }
354 +}
355 +
356 +@keyframes noty_anim_height {
357 + 100% {
358 + height: 0;
359 + }
360 +}
361 +
362 +.noty_theme__relax.noty_bar {
363 + overflow: hidden;
364 + position: relative;
365 +}
366 +.noty_theme__relax.noty_bar .noty_body {
367 + padding: 10px;
368 + padding-top: 20px;
369 + margin: 0 auto;
370 + min-height: 55px;
371 +}
372 +.noty_theme__relax.noty_bar .noty_buttons {
373 + /* border-top: 1px solid #e7e7e7; */
374 + float: right;
375 + padding: 5px 10px;
376 +}
377 +
378 +.noty_theme__relax.noty_type__alert,
379 +.noty_theme__relax.noty_type__notification {
380 + border-bottom: 1px solid #a4a4a4;
381 + background-color: #f2f2f2;
382 + color: black;
383 + font-size: 1rem;
384 +}
385 +
386 +.noty_theme__relax.noty_type__warning {
387 + background-color: #ffeaa8;
388 + border: 1px solid #ffc237;
389 + color: #826200;
390 +}
391 +.noty_theme__relax.noty_type__warning .noty_buttons {
392 + border-color: #dfaa30;
393 +}
394 +
395 +.noty_theme__relax.noty_type__error {
396 + background-color: #ff8181;
397 + border: 1px solid #e25353;
398 + color: #fff;
399 +}
400 +.noty_theme__relax.noty_type__error .noty_buttons {
401 + border-color: darkred;
402 +}
403 +
404 +.noty_theme__relax.noty_type__info,
405 +.noty_theme__relax.noty_type__information {
406 + background-color: #78c5e7;
407 + border: 1px solid #3badd6;
408 + color: #fff;
409 +}
410 +.noty_theme__relax.noty_type__info .noty_buttons,
411 +.noty_theme__relax.noty_type__information .noty_buttons {
412 + border-color: #0b90c4;
413 +}
414 +
415 +.noty_theme__relax.noty_type__success {
416 + background-color: #bcf5bc;
417 + border: 1px solid #7cdd77;
418 + color: darkgreen;
419 +}
420 +.noty_theme__relax.noty_type__success .noty_buttons {
421 + border-color: #50c24e;
422 +}
423 +
424 +/* Custom styling added for the WP Mobile Pack banner */
425 +.noty_theme__relax.noty_bar .noty_body img {
426 + max-width: 60px;
427 + height: auto;
428 + -webkit-border-radius: 5px;
429 + -moz-border-radius: 5px;
430 + border-radius: 5px;
431 + overflow: hidden;
432 + padding: 1px;
433 + float: left;
434 + margin: 0 5px 5px 5px;
435 +}
436 +
437 +.noty_theme__relax.noty_bar .noty_body a {
438 + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
439 + float: right;
440 + padding: 0.5rem;
441 + background: #2f2f2f;
442 + color: white;
443 + margin-right: 1.7rem;
444 +}
445 +
446 +.noty_theme__relax.noty_bar .noty_body p {
447 + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
448 + font-size: 1rem;
449 + float: left;
450 +}
451 +
452 +.noty_theme__relax.noty_bar .noty_body span {
453 + font-size: 0.85rem;
454 +}
455
456 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.js b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.js
457 new file mode 100755
458 index 0000000..409c721
459 --- /dev/null
460 +++ b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.js
461 @@ -0,0 +1,3073 @@
462 +/*
463 + @package NOTY - Dependency-free notification library
464 + @version version: 3.1.3
465 + @contributors https://github.com/needim/noty/graphs/contributors
466 + @documentation Examples and Documentation - http://needim.github.com/noty
467 + @license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
468 +*/
469 +
470 +(function webpackUniversalModuleDefinition(root, factory) {
471 + if(typeof exports === 'object' && typeof module === 'object')
472 + module.exports = factory();
473 + else if(typeof define === 'function' && define.amd)
474 + define("Noty", [], factory);
475 + else if(typeof exports === 'object')
476 + exports["Noty"] = factory();
477 + else
478 + root["Noty"] = factory();
479 +})(this, function() {
480 +return /******/ (function(modules) { // webpackBootstrap
481 +/******/ // The module cache
482 +/******/ var installedModules = {};
483 +/******/
484 +/******/ // The require function
485 +/******/ function __webpack_require__(moduleId) {
486 +/******/
487 +/******/ // Check if module is in cache
488 +/******/ if(installedModules[moduleId]) {
489 +/******/ return installedModules[moduleId].exports;
490 +/******/ }
491 +/******/ // Create a new module (and put it into the cache)
492 +/******/ var module = installedModules[moduleId] = {
493 +/******/ i: moduleId,
494 +/******/ l: false,
495 +/******/ exports: {}
496 +/******/ };
497 +/******/
498 +/******/ // Execute the module function
499 +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
500 +/******/
501 +/******/ // Flag the module as loaded
502 +/******/ module.l = true;
503 +/******/
504 +/******/ // Return the exports of the module
505 +/******/ return module.exports;
506 +/******/ }
507 +/******/
508 +/******/
509 +/******/ // expose the modules object (__webpack_modules__)
510 +/******/ __webpack_require__.m = modules;
511 +/******/
512 +/******/ // expose the module cache
513 +/******/ __webpack_require__.c = installedModules;
514 +/******/
515 +/******/ // identity function for calling harmony imports with the correct context
516 +/******/ __webpack_require__.i = function(value) { return value; };
517 +/******/
518 +/******/ // define getter function for harmony exports
519 +/******/ __webpack_require__.d = function(exports, name, getter) {
520 +/******/ if(!__webpack_require__.o(exports, name)) {
521 +/******/ Object.defineProperty(exports, name, {
522 +/******/ configurable: false,
523 +/******/ enumerable: true,
524 +/******/ get: getter
525 +/******/ });
526 +/******/ }
527 +/******/ };
528 +/******/
529 +/******/ // getDefaultExport function for compatibility with non-harmony modules
530 +/******/ __webpack_require__.n = function(module) {
531 +/******/ var getter = module && module.__esModule ?
532 +/******/ function getDefault() { return module['default']; } :
533 +/******/ function getModuleExports() { return module; };
534 +/******/ __webpack_require__.d(getter, 'a', getter);
535 +/******/ return getter;
536 +/******/ };
537 +/******/
538 +/******/ // Object.prototype.hasOwnProperty.call
539 +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
540 +/******/
541 +/******/ // __webpack_public_path__
542 +/******/ __webpack_require__.p = "";
543 +/******/
544 +/******/ // Load entry module and return exports
545 +/******/ return __webpack_require__(__webpack_require__.s = 6);
546 +/******/ })
547 +/************************************************************************/
548 +/******/ ([
549 +/* 0 */
550 +/***/ (function(module, exports, __webpack_require__) {
551 +
552 +"use strict";
553 +
554 +
555 +Object.defineProperty(exports, "__esModule", {
556 + value: true
557 +});
558 +exports.css = exports.deepExtend = exports.animationEndEvents = undefined;
559 +
560 +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
561 +
562 +exports.inArray = inArray;
563 +exports.stopPropagation = stopPropagation;
564 +exports.generateID = generateID;
565 +exports.outerHeight = outerHeight;
566 +exports.addListener = addListener;
567 +exports.hasClass = hasClass;
568 +exports.addClass = addClass;
569 +exports.removeClass = removeClass;
570 +exports.remove = remove;
571 +exports.classList = classList;
572 +exports.visibilityChangeFlow = visibilityChangeFlow;
573 +exports.createAudioElements = createAudioElements;
574 +
575 +var _api = __webpack_require__(1);
576 +
577 +var API = _interopRequireWildcard(_api);
578 +
579 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
580 +
581 +var animationEndEvents = exports.animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
582 +
583 +function inArray(needle, haystack, argStrict) {
584 + var key = void 0;
585 + var strict = !!argStrict;
586 +
587 + if (strict) {
588 + for (key in haystack) {
589 + if (haystack.hasOwnProperty(key) && haystack[key] === needle) {
590 + return true;
591 + }
592 + }
593 + } else {
594 + for (key in haystack) {
595 + if (haystack.hasOwnProperty(key) && haystack[key] === needle) {
596 + return true;
597 + }
598 + }
599 + }
600 + return false;
601 +}
602 +
603 +function stopPropagation(evt) {
604 + evt = evt || window.event;
605 +
606 + if (typeof evt.stopPropagation !== 'undefined') {
607 + evt.stopPropagation();
608 + } else {
609 + evt.cancelBubble = true;
610 + }
611 +}
612 +
613 +var deepExtend = exports.deepExtend = function deepExtend(out) {
614 + out = out || {};
615 +
616 + for (var i = 1; i < arguments.length; i++) {
617 + var obj = arguments[i];
618 +
619 + if (!obj) continue;
620 +
621 + for (var key in obj) {
622 + if (obj.hasOwnProperty(key)) {
623 + if (Array.isArray(obj[key])) {
624 + out[key] = obj[key];
625 + } else if (_typeof(obj[key]) === 'object' && obj[key] !== null) {
626 + out[key] = deepExtend(out[key], obj[key]);
627 + } else {
628 + out[key] = obj[key];
629 + }
630 + }
631 + }
632 + }
633 +
634 + return out;
635 +};
636 +
637 +function generateID() {
638 + var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
639 +
640 + var id = 'noty_' + prefix + '_';
641 +
642 + id += 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
643 + var r = Math.random() * 16 | 0;
644 + var v = c === 'x' ? r : r & 0x3 | 0x8;
645 + return v.toString(16);
646 + });
647 +
648 + return id;
649 +}
650 +
651 +function outerHeight(el) {
652 + var height = el.offsetHeight;
653 + var style = window.getComputedStyle(el);
654 +
655 + height += parseInt(style.marginTop) + parseInt(style.marginBottom);
656 + return height;
657 +}
658 +
659 +var css = exports.css = function () {
660 + var cssPrefixes = ['Webkit', 'O', 'Moz', 'ms'];
661 + var cssProps = {};
662 +
663 + function camelCase(string) {
664 + return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function (match, letter) {
665 + return letter.toUpperCase();
666 + });
667 + }
668 +
669 + function getVendorProp(name) {
670 + var style = document.body.style;
671 + if (name in style) return name;
672 +
673 + var i = cssPrefixes.length;
674 + var capName = name.charAt(0).toUpperCase() + name.slice(1);
675 + var vendorName = void 0;
676 +
677 + while (i--) {
678 + vendorName = cssPrefixes[i] + capName;
679 + if (vendorName in style) return vendorName;
680 + }
681 +
682 + return name;
683 + }
684 +
685 + function getStyleProp(name) {
686 + name = camelCase(name);
687 + return cssProps[name] || (cssProps[name] = getVendorProp(name));
688 + }
689 +
690 + function applyCss(element, prop, value) {
691 + prop = getStyleProp(prop);
692 + element.style[prop] = value;
693 + }
694 +
695 + return function (element, properties) {
696 + var args = arguments;
697 + var prop = void 0;
698 + var value = void 0;
699 +
700 + if (args.length === 2) {
701 + for (prop in properties) {
702 + if (properties.hasOwnProperty(prop)) {
703 + value = properties[prop];
704 + if (value !== undefined && properties.hasOwnProperty(prop)) {
705 + applyCss(element, prop, value);
706 + }
707 + }
708 + }
709 + } else {
710 + applyCss(element, args[1], args[2]);
711 + }
712 + };
713 +}();
714 +
715 +function addListener(el, events, cb) {
716 + var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
717 +
718 + events = events.split(' ');
719 + for (var i = 0; i < events.length; i++) {
720 + if (document.addEventListener) {
721 + el.addEventListener(events[i], cb, useCapture);
722 + } else if (document.attachEvent) {
723 + el.attachEvent('on' + events[i], cb);
724 + }
725 + }
726 +}
727 +
728 +function hasClass(element, name) {
729 + var list = typeof element === 'string' ? element : classList(element);
730 + return list.indexOf(' ' + name + ' ') >= 0;
731 +}
732 +
733 +function addClass(element, name) {
734 + var oldList = classList(element);
735 + var newList = oldList + name;
736 +
737 + if (hasClass(oldList, name)) return;
738 +
739 + // Trim the opening space.
740 + element.className = newList.substring(1);
741 +}
742 +
743 +function removeClass(element, name) {
744 + var oldList = classList(element);
745 + var newList = void 0;
746 +
747 + if (!hasClass(element, name)) return;
748 +
749 + // Replace the class name.
750 + newList = oldList.replace(' ' + name + ' ', ' ');
751 +
752 + // Trim the opening and closing spaces.
753 + element.className = newList.substring(1, newList.length - 1);
754 +}
755 +
756 +function remove(element) {
757 + if (element.parentNode) {
758 + element.parentNode.removeChild(element);
759 + }
760 +}
761 +
762 +function classList(element) {
763 + return (' ' + (element && element.className || '') + ' ').replace(/\s+/gi, ' ');
764 +}
765 +
766 +function visibilityChangeFlow() {
767 + var hidden = void 0;
768 + var visibilityChange = void 0;
769 + if (typeof document.hidden !== 'undefined') {
770 + // Opera 12.10 and Firefox 18 and later support
771 + hidden = 'hidden';
772 + visibilityChange = 'visibilitychange';
773 + } else if (typeof document.msHidden !== 'undefined') {
774 + hidden = 'msHidden';
775 + visibilityChange = 'msvisibilitychange';
776 + } else if (typeof document.webkitHidden !== 'undefined') {
777 + hidden = 'webkitHidden';
778 + visibilityChange = 'webkitvisibilitychange';
779 + }
780 +
781 + function onVisibilityChange() {
782 + API.PageHidden = document[hidden];
783 + handleVisibilityChange();
784 + }
785 +
786 + function onBlur() {
787 + API.PageHidden = true;
788 + handleVisibilityChange();
789 + }
790 +
791 + function onFocus() {
792 + API.PageHidden = false;
793 + handleVisibilityChange();
794 + }
795 +
796 + function handleVisibilityChange() {
797 + if (API.PageHidden) stopAll();else resumeAll();
798 + }
799 +
800 + function stopAll() {
801 + setTimeout(function () {
802 + Object.keys(API.Store).forEach(function (id) {
803 + if (API.Store.hasOwnProperty(id)) {
804 + if (API.Store[id].options.visibilityControl) {
805 + API.Store[id].stop();
806 + }
807 + }
808 + });
809 + }, 100);
810 + }
811 +
812 + function resumeAll() {
813 + setTimeout(function () {
814 + Object.keys(API.Store).forEach(function (id) {
815 + if (API.Store.hasOwnProperty(id)) {
816 + if (API.Store[id].options.visibilityControl) {
817 + API.Store[id].resume();
818 + }
819 + }
820 + });
821 + API.queueRenderAll();
822 + }, 100);
823 + }
824 +
825 + addListener(document, visibilityChange, onVisibilityChange);
826 + addListener(window, 'blur', onBlur);
827 + addListener(window, 'focus', onFocus);
828 +}
829 +
830 +function createAudioElements(ref) {
831 + if (ref.hasSound) {
832 + var audioElement = document.createElement('audio');
833 +
834 + ref.options.sounds.sources.forEach(function (s) {
835 + var source = document.createElement('source');
836 + source.src = s;
837 + source.type = 'audio/' + getExtension(s);
838 + audioElement.appendChild(source);
839 + });
840 +
841 + if (ref.barDom) {
842 + ref.barDom.appendChild(audioElement);
843 + } else {
844 + document.querySelector('body').appendChild(audioElement);
845 + }
846 +
847 + audioElement.volume = ref.options.sounds.volume;
848 +
849 + if (!ref.soundPlayed) {
850 + audioElement.play();
851 + ref.soundPlayed = true;
852 + }
853 +
854 + audioElement.onended = function () {
855 + remove(audioElement);
856 + };
857 + }
858 +}
859 +
860 +function getExtension(fileName) {
861 + return fileName.match(/\.([^.]+)$/)[1];
862 +}
863 +
864 +/***/ }),
865 +/* 1 */
866 +/***/ (function(module, exports, __webpack_require__) {
867 +
868 +"use strict";
869 +
870 +
871 +Object.defineProperty(exports, "__esModule", {
872 + value: true
873 +});
874 +exports.Defaults = exports.Store = exports.Queues = exports.DefaultMaxVisible = exports.docTitle = exports.DocModalCount = exports.PageHidden = undefined;
875 +exports.getQueueCounts = getQueueCounts;
876 +exports.addToQueue = addToQueue;
877 +exports.removeFromQueue = removeFromQueue;
878 +exports.queueRender = queueRender;
879 +exports.queueRenderAll = queueRenderAll;
880 +exports.ghostFix = ghostFix;
881 +exports.build = build;
882 +exports.hasButtons = hasButtons;
883 +exports.handleModal = handleModal;
884 +exports.handleModalClose = handleModalClose;
885 +exports.queueClose = queueClose;
886 +exports.dequeueClose = dequeueClose;
887 +exports.fire = fire;
888 +exports.openFlow = openFlow;
889 +exports.closeFlow = closeFlow;
890 +
891 +var _utils = __webpack_require__(0);
892 +
893 +var Utils = _interopRequireWildcard(_utils);
894 +
895 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
896 +
897 +var PageHidden = exports.PageHidden = false;
898 +var DocModalCount = exports.DocModalCount = 0;
899 +
900 +var DocTitleProps = {
901 + originalTitle: null,
902 + count: 0,
903 + changed: false,
904 + timer: -1
905 +};
906 +
907 +var docTitle = exports.docTitle = {
908 + increment: function increment() {
909 + DocTitleProps.count++;
910 +
911 + docTitle._update();
912 + },
913 +
914 + decrement: function decrement() {
915 + DocTitleProps.count--;
916 +
917 + if (DocTitleProps.count <= 0) {
918 + docTitle._clear();
919 + return;
920 + }
921 +
922 + docTitle._update();
923 + },
924 +
925 + _update: function _update() {
926 + var title = document.title;
927 +
928 + if (!DocTitleProps.changed) {
929 + DocTitleProps.originalTitle = title;
930 + document.title = '(' + DocTitleProps.count + ') ' + title;
931 + DocTitleProps.changed = true;
932 + } else {
933 + document.title = '(' + DocTitleProps.count + ') ' + DocTitleProps.originalTitle;
934 + }
935 + },
936 +
937 + _clear: function _clear() {
938 + if (DocTitleProps.changed) {
939 + DocTitleProps.count = 0;
940 + document.title = DocTitleProps.originalTitle;
941 + DocTitleProps.changed = false;
942 + }
943 + }
944 +};
945 +
946 +var DefaultMaxVisible = exports.DefaultMaxVisible = 5;
947 +
948 +var Queues = exports.Queues = {
949 + global: {
950 + maxVisible: DefaultMaxVisible,
951 + queue: []
952 + }
953 +};
954 +
955 +var Store = exports.Store = {};
956 +
957 +var Defaults = exports.Defaults = {
958 + type: 'alert',
959 + layout: 'topRight',
960 + theme: 'mint',
961 + text: '',
962 + timeout: false,
963 + progressBar: true,
964 + closeWith: ['click'],
965 + animation: {
966 + open: 'noty_effects_open',
967 + close: 'noty_effects_close'
968 + },
969 + id: false,
970 + force: false,
971 + killer: false,
972 + queue: 'global',
973 + container: false,
974 + buttons: [],
975 + callbacks: {
976 + beforeShow: null,
977 + onShow: null,
978 + afterShow: null,
979 + onClose: null,
980 + afterClose: null,
981 + onClick: null,
982 + onHover: null,
983 + onTemplate: null
984 + },
985 + sounds: {
986 + sources: [],
987 + volume: 1,
988 + conditions: []
989 + },
990 + titleCount: {
991 + conditions: []
992 + },
993 + modal: false,
994 + visibilityControl: false
995 +
996 + /**
997 + * @param {string} queueName
998 + * @return {object}
999 + */
1000 +};function getQueueCounts() {
1001 + var queueName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'global';
1002 +
1003 + var count = 0;
1004 + var max = DefaultMaxVisible;
1005 +
1006 + if (Queues.hasOwnProperty(queueName)) {
1007 + max = Queues[queueName].maxVisible;
1008 + Object.keys(Store).forEach(function (i) {
1009 + if (Store[i].options.queue === queueName && !Store[i].closed) count++;
1010 + });
1011 + }
1012 +
1013 + return {
1014 + current: count,
1015 + maxVisible: max
1016 + };
1017 +}
1018 +
1019 +/**
1020 + * @param {Noty} ref
1021 + * @return {void}
1022 + */
1023 +function addToQueue(ref) {
1024 + if (!Queues.hasOwnProperty(ref.options.queue)) {
1025 + Queues[ref.options.queue] = { maxVisible: DefaultMaxVisible, queue: [] };
1026 + }
1027 +
1028 + Queues[ref.options.queue].queue.push(ref);
1029 +}
1030 +
1031 +/**
1032 + * @param {Noty} ref
1033 + * @return {void}
1034 + */
1035 +function removeFromQueue(ref) {
1036 + if (Queues.hasOwnProperty(ref.options.queue)) {
1037 + var queue = [];
1038 + Object.keys(Queues[ref.options.queue].queue).forEach(function (i) {
1039 + if (Queues[ref.options.queue].queue[i].id !== ref.id) {
1040 + queue.push(Queues[ref.options.queue].queue[i]);
1041 + }
1042 + });
1043 + Queues[ref.options.queue].queue = queue;
1044 + }
1045 +}
1046 +
1047 +/**
1048 + * @param {string} queueName
1049 + * @return {void}
1050 + */
1051 +function queueRender() {
1052 + var queueName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'global';
1053 +
1054 + if (Queues.hasOwnProperty(queueName)) {
1055 + var noty = Queues[queueName].queue.shift();
1056 +
1057 + if (noty) noty.show();
1058 + }
1059 +}
1060 +
1061 +/**
1062 + * @return {void}
1063 + */
1064 +function queueRenderAll() {
1065 + Object.keys(Queues).forEach(function (queueName) {
1066 + queueRender(queueName);
1067 + });
1068 +}
1069 +
1070 +/**
1071 + * @param {Noty} ref
1072 + * @return {void}
1073 + */
1074 +function ghostFix(ref) {
1075 + var ghostID = Utils.generateID('ghost');
1076 + var ghost = document.createElement('div');
1077 + ghost.setAttribute('id', ghostID);
1078 + Utils.css(ghost, {
1079 + height: Utils.outerHeight(ref.barDom) + 'px'
1080 + });
1081 +
1082 + ref.barDom.insertAdjacentHTML('afterend', ghost.outerHTML);
1083 +
1084 + Utils.remove(ref.barDom);
1085 + ghost = document.getElementById(ghostID);
1086 + Utils.addClass(ghost, 'noty_fix_effects_height');
1087 + Utils.addListener(ghost, Utils.animationEndEvents, function () {
1088 + Utils.remove(ghost);
1089 + });
1090 +}
1091 +
1092 +/**
1093 + * @param {Noty} ref
1094 + * @return {void}
1095 + */
1096 +function build(ref) {
1097 + findOrCreateContainer(ref);
1098 +
1099 + var markup = '<div class="noty_body">' + ref.options.text + '</div>' + buildButtons(ref) + '<div class="noty_progressbar"></div>';
1100 +
1101 + ref.barDom = document.createElement('div');
1102 + ref.barDom.setAttribute('id', ref.id);
1103 + Utils.addClass(ref.barDom, 'noty_bar noty_type__' + ref.options.type + ' noty_theme__' + ref.options.theme);
1104 +
1105 + ref.barDom.innerHTML = markup;
1106 +
1107 + fire(ref, 'onTemplate');
1108 +}
1109 +
1110 +/**
1111 + * @param {Noty} ref
1112 + * @return {boolean}
1113 + */
1114 +function hasButtons(ref) {
1115 + return !!(ref.options.buttons && Object.keys(ref.options.buttons).length);
1116 +}
1117 +
1118 +/**
1119 + * @param {Noty} ref
1120 + * @return {string}
1121 + */
1122 +function buildButtons(ref) {
1123 + if (hasButtons(ref)) {
1124 + var buttons = document.createElement('div');
1125 + Utils.addClass(buttons, 'noty_buttons');
1126 +
1127 + Object.keys(ref.options.buttons).forEach(function (key) {
1128 + buttons.appendChild(ref.options.buttons[key].dom);
1129 + });
1130 +
1131 + ref.options.buttons.forEach(function (btn) {
1132 + buttons.appendChild(btn.dom);
1133 + });
1134 + return buttons.outerHTML;
1135 + }
1136 + return '';
1137 +}
1138 +
1139 +/**
1140 + * @param {Noty} ref
1141 + * @return {void}
1142 + */
1143 +function handleModal(ref) {
1144 + if (ref.options.modal) {
1145 + if (DocModalCount === 0) {
1146 + createModal(ref);
1147 + }
1148 +
1149 + exports.DocModalCount = DocModalCount += 1;
1150 + }
1151 +}
1152 +
1153 +/**
1154 + * @param {Noty} ref
1155 + * @return {void}
1156 + */
1157 +function handleModalClose(ref) {
1158 + if (ref.options.modal && DocModalCount > 0) {
1159 + exports.DocModalCount = DocModalCount -= 1;
1160 +
1161 + if (DocModalCount <= 0) {
1162 + var modal = document.querySelector('.noty_modal');
1163 +
1164 + if (modal) {
1165 + Utils.removeClass(modal, 'noty_modal_open');
1166 + Utils.addClass(modal, 'noty_modal_close');
1167 + Utils.addListener(modal, Utils.animationEndEvents, function () {
1168 + Utils.remove(modal);
1169 + });
1170 + }
1171 + }
1172 + }
1173 +}
1174 +
1175 +/**
1176 + * @return {void}
1177 + */
1178 +function createModal() {
1179 + var body = document.querySelector('body');
1180 + var modal = document.createElement('div');
1181 + Utils.addClass(modal, 'noty_modal');
1182 + body.insertBefore(modal, body.firstChild);
1183 + Utils.addClass(modal, 'noty_modal_open');
1184 +
1185 + Utils.addListener(modal, Utils.animationEndEvents, function () {
1186 + Utils.removeClass(modal, 'noty_modal_open');
1187 + });
1188 +}
1189 +
1190 +/**
1191 + * @param {Noty} ref
1192 + * @return {void}
1193 + */
1194 +function findOrCreateContainer(ref) {
1195 + if (ref.options.container) {
1196 + ref.layoutDom = document.querySelector(ref.options.container);
1197 + return;
1198 + }
1199 +
1200 + var layoutID = 'noty_layout__' + ref.options.layout;
1201 + ref.layoutDom = document.querySelector('div#' + layoutID);
1202 +
1203 + if (!ref.layoutDom) {
1204 + ref.layoutDom = document.createElement('div');
1205 + ref.layoutDom.setAttribute('id', layoutID);
1206 + Utils.addClass(ref.layoutDom, 'noty_layout');
1207 + document.querySelector('body').appendChild(ref.layoutDom);
1208 + }
1209 +}
1210 +
1211 +/**
1212 + * @param {Noty} ref
1213 + * @return {void}
1214 + */
1215 +function queueClose(ref) {
1216 + if (ref.options.timeout) {
1217 + if (ref.options.progressBar && ref.progressDom) {
1218 + Utils.css(ref.progressDom, {
1219 + transition: 'width ' + ref.options.timeout + 'ms linear',
1220 + width: '0%'
1221 + });
1222 + }
1223 +
1224 + clearTimeout(ref.closeTimer);
1225 +
1226 + ref.closeTimer = setTimeout(function () {
1227 + ref.close();
1228 + }, ref.options.timeout);
1229 + }
1230 +}
1231 +
1232 +/**
1233 + * @param {Noty} ref
1234 + * @return {void}
1235 + */
1236 +function dequeueClose(ref) {
1237 + if (ref.options.timeout && ref.closeTimer) {
1238 + clearTimeout(ref.closeTimer);
1239 + ref.closeTimer = -1;
1240 +
1241 + if (ref.options.progressBar && ref.progressDom) {
1242 + Utils.css(ref.progressDom, {
1243 + transition: 'width 0ms linear',
1244 + width: '100%'
1245 + });
1246 + }
1247 + }
1248 +}
1249 +
1250 +/**
1251 + * @param {Noty} ref
1252 + * @param {string} eventName
1253 + * @return {void}
1254 + */
1255 +function fire(ref, eventName) {
1256 + if (ref.listeners.hasOwnProperty(eventName)) {
1257 + ref.listeners[eventName].forEach(function (cb) {
1258 + if (typeof cb === 'function') {
1259 + cb.apply(ref);
1260 + }
1261 + });
1262 + }
1263 +}
1264 +
1265 +/**
1266 + * @param {Noty} ref
1267 + * @return {void}
1268 + */
1269 +function openFlow(ref) {
1270 + fire(ref, 'afterShow');
1271 + queueClose(ref);
1272 +
1273 + Utils.addListener(ref.barDom, 'mouseenter', function () {
1274 + dequeueClose(ref);
1275 + });
1276 +
1277 + Utils.addListener(ref.barDom, 'mouseleave', function () {
1278 + queueClose(ref);
1279 + });
1280 +}
1281 +
1282 +/**
1283 + * @param {Noty} ref
1284 + * @return {void}
1285 + */
1286 +function closeFlow(ref) {
1287 + delete Store[ref.id];
1288 + ref.closing = false;
1289 + fire(ref, 'afterClose');
1290 +
1291 + Utils.remove(ref.barDom);
1292 +
1293 + if (ref.layoutDom.querySelectorAll('.noty_bar').length === 0 && !ref.options.container) {
1294 + Utils.remove(ref.layoutDom);
1295 + }
1296 +
1297 + if (Utils.inArray('docVisible', ref.options.titleCount.conditions) || Utils.inArray('docHidden', ref.options.titleCount.conditions)) {
1298 + docTitle.decrement();
1299 + }
1300 +
1301 + queueRender(ref.options.queue);
1302 +}
1303 +
1304 +/***/ }),
1305 +/* 2 */
1306 +/***/ (function(module, exports, __webpack_require__) {
1307 +
1308 +"use strict";
1309 +
1310 +
1311 +Object.defineProperty(exports, "__esModule", {
1312 + value: true
1313 +});
1314 +exports.NotyButton = undefined;
1315 +
1316 +var _utils = __webpack_require__(0);
1317 +
1318 +var Utils = _interopRequireWildcard(_utils);
1319 +
1320 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1321 +
1322 +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1323 +
1324 +var NotyButton = exports.NotyButton = function NotyButton(html, classes, cb) {
1325 + var _this = this;
1326 +
1327 + var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1328 +
1329 + _classCallCheck(this, NotyButton);
1330 +
1331 + this.dom = document.createElement('button');
1332 + this.dom.innerHTML = html;
1333 + this.id = attributes.id = attributes.id || Utils.generateID('button');
1334 + this.cb = cb;
1335 + Object.keys(attributes).forEach(function (propertyName) {
1336 + _this.dom.setAttribute(propertyName, attributes[propertyName]);
1337 + });
1338 + Utils.addClass(this.dom, classes || 'noty_btn');
1339 +
1340 + return this;
1341 +};
1342 +
1343 +/***/ }),
1344 +/* 3 */
1345 +/***/ (function(module, exports, __webpack_require__) {
1346 +
1347 +"use strict";
1348 +
1349 +
1350 +Object.defineProperty(exports, "__esModule", {
1351 + value: true
1352 +});
1353 +
1354 +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1355 +
1356 +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1357 +
1358 +var Push = exports.Push = function () {
1359 + function Push() {
1360 + var workerPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/service-worker.js';
1361 +
1362 + _classCallCheck(this, Push);
1363 +
1364 + this.subData = {};
1365 + this.workerPath = workerPath;
1366 + this.listeners = {
1367 + onPermissionGranted: [],
1368 + onPermissionDenied: [],
1369 + onSubscriptionSuccess: [],
1370 + onSubscriptionCancel: [],
1371 + onWorkerError: [],
1372 + onWorkerSuccess: [],
1373 + onWorkerNotSupported: []
1374 + };
1375 + return this;
1376 + }
1377 +
1378 + /**
1379 + * @param {string} eventName
1380 + * @param {function} cb
1381 + * @return {Push}
1382 + */
1383 +
1384 +
1385 + _createClass(Push, [{
1386 + key: 'on',
1387 + value: function on(eventName) {
1388 + var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
1389 +
1390 + if (typeof cb === 'function' && this.listeners.hasOwnProperty(eventName)) {
1391 + this.listeners[eventName].push(cb);
1392 + }
1393 +
1394 + return this;
1395 + }
1396 + }, {
1397 + key: 'fire',
1398 + value: function fire(eventName) {
1399 + var _this = this;
1400 +
1401 + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1402 +
1403 + if (this.listeners.hasOwnProperty(eventName)) {
1404 + this.listeners[eventName].forEach(function (cb) {
1405 + if (typeof cb === 'function') {
1406 + cb.apply(_this, params);
1407 + }
1408 + });
1409 + }
1410 + }
1411 + }, {
1412 + key: 'create',
1413 + value: function create() {
1414 + console.log('NOT IMPLEMENTED YET');
1415 + }
1416 +
1417 + /**
1418 + * @return {boolean}
1419 + */
1420 +
1421 + }, {
1422 + key: 'isSupported',
1423 + value: function isSupported() {
1424 + var result = false;
1425 +
1426 + try {
1427 + result = window.Notification || window.webkitNotifications || navigator.mozNotification || window.external && window.external.msIsSiteMode() !== undefined;
1428 + } catch (e) {}
1429 +
1430 + return result;
1431 + }
1432 +
1433 + /**
1434 + * @return {string}
1435 + */
1436 +
1437 + }, {
1438 + key: 'getPermissionStatus',
1439 + value: function getPermissionStatus() {
1440 + var perm = 'default';
1441 +
1442 + if (window.Notification && window.Notification.permissionLevel) {
1443 + perm = window.Notification.permissionLevel;
1444 + } else if (window.webkitNotifications && window.webkitNotifications.checkPermission) {
1445 + switch (window.webkitNotifications.checkPermission()) {
1446 + case 1:
1447 + perm = 'default';
1448 + break;
1449 + case 0:
1450 + perm = 'granted';
1451 + break;
1452 + default:
1453 + perm = 'denied';
1454 + }
1455 + } else if (window.Notification && window.Notification.permission) {
1456 + perm = window.Notification.permission;
1457 + } else if (navigator.mozNotification) {
1458 + perm = 'granted';
1459 + } else if (window.external && window.external.msIsSiteMode() !== undefined) {
1460 + perm = window.external.msIsSiteMode() ? 'granted' : 'default';
1461 + }
1462 +
1463 + return perm.toString().toLowerCase();
1464 + }
1465 +
1466 + /**
1467 + * @return {string}
1468 + */
1469 +
1470 + }, {
1471 + key: 'getEndpoint',
1472 + value: function getEndpoint(subscription) {
1473 + var endpoint = subscription.endpoint;
1474 + var subscriptionId = subscription.subscriptionId;
1475 +
1476 + // fix for Chrome < 45
1477 + if (subscriptionId && endpoint.indexOf(subscriptionId) === -1) {
1478 + endpoint += '/' + subscriptionId;
1479 + }
1480 +
1481 + return endpoint;
1482 + }
1483 +
1484 + /**
1485 + * @return {boolean}
1486 + */
1487 +
1488 + }, {
1489 + key: 'isSWRegistered',
1490 + value: function isSWRegistered() {
1491 + try {
1492 + return navigator.serviceWorker.controller.state === 'activated';
1493 + } catch (e) {
1494 + return false;
1495 + }
1496 + }
1497 +
1498 + /**
1499 + * @return {void}
1500 + */
1501 +
1502 + }, {
1503 + key: 'unregisterWorker',
1504 + value: function unregisterWorker() {
1505 + var self = this;
1506 + if ('serviceWorker' in navigator) {
1507 + navigator.serviceWorker.getRegistrations().then(function (registrations) {
1508 + var _iteratorNormalCompletion = true;
1509 + var _didIteratorError = false;
1510 + var _iteratorError = undefined;
1511 +
1512 + try {
1513 + for (var _iterator = registrations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1514 + var registration = _step.value;
1515 +
1516 + registration.unregister();
1517 + self.fire('onSubscriptionCancel');
1518 + }
1519 + } catch (err) {
1520 + _didIteratorError = true;
1521 + _iteratorError = err;
1522 + } finally {
1523 + try {
1524 + if (!_iteratorNormalCompletion && _iterator.return) {
1525 + _iterator.return();
1526 + }
1527 + } finally {
1528 + if (_didIteratorError) {
1529 + throw _iteratorError;
1530 + }
1531 + }
1532 + }
1533 + });
1534 + }
1535 + }
1536 +
1537 + /**
1538 + * @return {void}
1539 + */
1540 +
1541 + }, {
1542 + key: 'requestSubscription',
1543 + value: function requestSubscription() {
1544 + var _this2 = this;
1545 +
1546 + var userVisibleOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
1547 +
1548 + var self = this;
1549 + var current = this.getPermissionStatus();
1550 + var cb = function cb(result) {
1551 + if (result === 'granted') {
1552 + _this2.fire('onPermissionGranted');
1553 +
1554 + if ('serviceWorker' in navigator) {
1555 + navigator.serviceWorker.register(_this2.workerPath).then(function () {
1556 + navigator.serviceWorker.ready.then(function (serviceWorkerRegistration) {
1557 + self.fire('onWorkerSuccess');
1558 + serviceWorkerRegistration.pushManager.subscribe({
1559 + userVisibleOnly: userVisibleOnly
1560 + }).then(function (subscription) {
1561 + var key = subscription.getKey('p256dh');
1562 + var token = subscription.getKey('auth');
1563 +
1564 + self.subData = {
1565 + endpoint: self.getEndpoint(subscription),
1566 + p256dh: key ? window.btoa(String.fromCharCode.apply(null, new Uint8Array(key))) : null,
1567 + auth: token ? window.btoa(String.fromCharCode.apply(null, new Uint8Array(token))) : null
1568 + };
1569 +
1570 + self.fire('onSubscriptionSuccess', [self.subData]);
1571 + }).catch(function (err) {
1572 + self.fire('onWorkerError', [err]);
1573 + });
1574 + });
1575 + });
1576 + } else {
1577 + self.fire('onWorkerNotSupported');
1578 + }
1579 + } else if (result === 'denied') {
1580 + _this2.fire('onPermissionDenied');
1581 + _this2.unregisterWorker();
1582 + }
1583 + };
1584 +
1585 + if (current === 'default') {
1586 + if (window.Notification && window.Notification.requestPermission) {
1587 + window.Notification.requestPermission(cb);
1588 + } else if (window.webkitNotifications && window.webkitNotifications.checkPermission) {
1589 + window.webkitNotifications.requestPermission(cb);
1590 + }
1591 + } else {
1592 + cb(current);
1593 + }
1594 + }
1595 + }]);
1596 +
1597 + return Push;
1598 +}();
1599 +
1600 +/***/ }),
1601 +/* 4 */
1602 +/***/ (function(module, exports, __webpack_require__) {
1603 +
1604 +/* WEBPACK VAR INJECTION */(function(process, global) {var require;/*!
1605 + * @overview es6-promise - a tiny implementation of Promises/A+.
1606 + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
1607 + * @license Licensed under MIT license
1608 + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
1609 + * @version 4.1.0
1610 + */
1611 +
1612 +(function (global, factory) {
1613 + true ? module.exports = factory() :
1614 + typeof define === 'function' && define.amd ? define(factory) :
1615 + (global.ES6Promise = factory());
1616 +}(this, (function () { 'use strict';
1617 +
1618 +function objectOrFunction(x) {
1619 + return typeof x === 'function' || typeof x === 'object' && x !== null;
1620 +}
1621 +
1622 +function isFunction(x) {
1623 + return typeof x === 'function';
1624 +}
1625 +
1626 +var _isArray = undefined;
1627 +if (!Array.isArray) {
1628 + _isArray = function (x) {
1629 + return Object.prototype.toString.call(x) === '[object Array]';
1630 + };
1631 +} else {
1632 + _isArray = Array.isArray;
1633 +}
1634 +
1635 +var isArray = _isArray;
1636 +
1637 +var len = 0;
1638 +var vertxNext = undefined;
1639 +var customSchedulerFn = undefined;
1640 +
1641 +var asap = function asap(callback, arg) {
1642 + queue[len] = callback;
1643 + queue[len + 1] = arg;
1644 + len += 2;
1645 + if (len === 2) {
1646 + // If len is 2, that means that we need to schedule an async flush.
1647 + // If additional callbacks are queued before the queue is flushed, they
1648 + // will be processed by this flush that we are scheduling.
1649 + if (customSchedulerFn) {
1650 + customSchedulerFn(flush);
1651 + } else {
1652 + scheduleFlush();
1653 + }
1654 + }
1655 +};
1656 +
1657 +function setScheduler(scheduleFn) {
1658 + customSchedulerFn = scheduleFn;
1659 +}
1660 +
1661 +function setAsap(asapFn) {
1662 + asap = asapFn;
1663 +}
1664 +
1665 +var browserWindow = typeof window !== 'undefined' ? window : undefined;
1666 +var browserGlobal = browserWindow || {};
1667 +var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
1668 +var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';
1669 +
1670 +// test for web worker but not in IE10
1671 +var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
1672 +
1673 +// node
1674 +function useNextTick() {
1675 + // node version 0.10.x displays a deprecation warning when nextTick is used recursively
1676 + // see https://github.com/cujojs/when/issues/410 for details
1677 + return function () {
1678 + return process.nextTick(flush);
1679 + };
1680 +}
1681 +
1682 +// vertx
1683 +function useVertxTimer() {
1684 + if (typeof vertxNext !== 'undefined') {
1685 + return function () {
1686 + vertxNext(flush);
1687 + };
1688 + }
1689 +
1690 + return useSetTimeout();
1691 +}
1692 +
1693 +function useMutationObserver() {
1694 + var iterations = 0;
1695 + var observer = new BrowserMutationObserver(flush);
1696 + var node = document.createTextNode('');
1697 + observer.observe(node, { characterData: true });
1698 +
1699 + return function () {
1700 + node.data = iterations = ++iterations % 2;
1701 + };
1702 +}
1703 +
1704 +// web worker
1705 +function useMessageChannel() {
1706 + var channel = new MessageChannel();
1707 + channel.port1.onmessage = flush;
1708 + return function () {
1709 + return channel.port2.postMessage(0);
1710 + };
1711 +}
1712 +
1713 +function useSetTimeout() {
1714 + // Store setTimeout reference so es6-promise will be unaffected by
1715 + // other code modifying setTimeout (like sinon.useFakeTimers())
1716 + var globalSetTimeout = setTimeout;
1717 + return function () {
1718 + return globalSetTimeout(flush, 1);
1719 + };
1720 +}
1721 +
1722 +var queue = new Array(1000);
1723 +function flush() {
1724 + for (var i = 0; i < len; i += 2) {
1725 + var callback = queue[i];
1726 + var arg = queue[i + 1];
1727 +
1728 + callback(arg);
1729 +
1730 + queue[i] = undefined;
1731 + queue[i + 1] = undefined;
1732 + }
1733 +
1734 + len = 0;
1735 +}
1736 +
1737 +function attemptVertx() {
1738 + try {
1739 + var r = require;
1740 + var vertx = __webpack_require__(9);
1741 + vertxNext = vertx.runOnLoop || vertx.runOnContext;
1742 + return useVertxTimer();
1743 + } catch (e) {
1744 + return useSetTimeout();
1745 + }
1746 +}
1747 +
1748 +var scheduleFlush = undefined;
1749 +// Decide what async method to use to triggering processing of queued callbacks:
1750 +if (isNode) {
1751 + scheduleFlush = useNextTick();
1752 +} else if (BrowserMutationObserver) {
1753 + scheduleFlush = useMutationObserver();
1754 +} else if (isWorker) {
1755 + scheduleFlush = useMessageChannel();
1756 +} else if (browserWindow === undefined && "function" === 'function') {
1757 + scheduleFlush = attemptVertx();
1758 +} else {
1759 + scheduleFlush = useSetTimeout();
1760 +}
1761 +
1762 +function then(onFulfillment, onRejection) {
1763 + var _arguments = arguments;
1764 +
1765 + var parent = this;
1766 +
1767 + var child = new this.constructor(noop);
1768 +
1769 + if (child[PROMISE_ID] === undefined) {
1770 + makePromise(child);
1771 + }
1772 +
1773 + var _state = parent._state;
1774 +
1775 + if (_state) {
1776 + (function () {
1777 + var callback = _arguments[_state - 1];
1778 + asap(function () {
1779 + return invokeCallback(_state, child, callback, parent._result);
1780 + });
1781 + })();
1782 + } else {
1783 + subscribe(parent, child, onFulfillment, onRejection);
1784 + }
1785 +
1786 + return child;
1787 +}
1788 +
1789 +/**
1790 + `Promise.resolve` returns a promise that will become resolved with the
1791 + passed `value`. It is shorthand for the following:
1792 +
1793 + ```javascript
1794 + let promise = new Promise(function(resolve, reject){
1795 + resolve(1);
1796 + });
1797 +
1798 + promise.then(function(value){
1799 + // value === 1
1800 + });
1801 + ```
1802 +
1803 + Instead of writing the above, your code now simply becomes the following:
1804 +
1805 + ```javascript
1806 + let promise = Promise.resolve(1);
1807 +
1808 + promise.then(function(value){
1809 + // value === 1
1810 + });
1811 + ```
1812 +
1813 + @method resolve
1814 + @static
1815 + @param {Any} value value that the returned promise will be resolved with
1816 + Useful for tooling.
1817 + @return {Promise} a promise that will become fulfilled with the given
1818 + `value`
1819 +*/
1820 +function resolve(object) {
1821 + /*jshint validthis:true */
1822 + var Constructor = this;
1823 +
1824 + if (object && typeof object === 'object' && object.constructor === Constructor) {
1825 + return object;
1826 + }
1827 +
1828 + var promise = new Constructor(noop);
1829 + _resolve(promise, object);
1830 + return promise;
1831 +}
1832 +
1833 +var PROMISE_ID = Math.random().toString(36).substring(16);
1834 +
1835 +function noop() {}
1836 +
1837 +var PENDING = void 0;
1838 +var FULFILLED = 1;
1839 +var REJECTED = 2;
1840 +
1841 +var GET_THEN_ERROR = new ErrorObject();
1842 +
1843 +function selfFulfillment() {
1844 + return new TypeError("You cannot resolve a promise with itself");
1845 +}
1846 +
1847 +function cannotReturnOwn() {
1848 + return new TypeError('A promises callback cannot return that same promise.');
1849 +}
1850 +
1851 +function getThen(promise) {
1852 + try {
1853 + return promise.then;
1854 + } catch (error) {
1855 + GET_THEN_ERROR.error = error;
1856 + return GET_THEN_ERROR;
1857 + }
1858 +}
1859 +
1860 +function tryThen(then, value, fulfillmentHandler, rejectionHandler) {
1861 + try {
1862 + then.call(value, fulfillmentHandler, rejectionHandler);
1863 + } catch (e) {
1864 + return e;
1865 + }
1866 +}
1867 +
1868 +function handleForeignThenable(promise, thenable, then) {
1869 + asap(function (promise) {
1870 + var sealed = false;
1871 + var error = tryThen(then, thenable, function (value) {
1872 + if (sealed) {
1873 + return;
1874 + }
1875 + sealed = true;
1876 + if (thenable !== value) {
1877 + _resolve(promise, value);
1878 + } else {
1879 + fulfill(promise, value);
1880 + }
1881 + }, function (reason) {
1882 + if (sealed) {
1883 + return;
1884 + }
1885 + sealed = true;
1886 +
1887 + _reject(promise, reason);
1888 + }, 'Settle: ' + (promise._label || ' unknown promise'));
1889 +
1890 + if (!sealed && error) {
1891 + sealed = true;
1892 + _reject(promise, error);
1893 + }
1894 + }, promise);
1895 +}
1896 +
1897 +function handleOwnThenable(promise, thenable) {
1898 + if (thenable._state === FULFILLED) {
1899 + fulfill(promise, thenable._result);
1900 + } else if (thenable._state === REJECTED) {
1901 + _reject(promise, thenable._result);
1902 + } else {
1903 + subscribe(thenable, undefined, function (value) {
1904 + return _resolve(promise, value);
1905 + }, function (reason) {
1906 + return _reject(promise, reason);
1907 + });
1908 + }
1909 +}
1910 +
1911 +function handleMaybeThenable(promise, maybeThenable, then$$) {
1912 + if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {
1913 + handleOwnThenable(promise, maybeThenable);
1914 + } else {
1915 + if (then$$ === GET_THEN_ERROR) {
1916 + _reject(promise, GET_THEN_ERROR.error);
1917 + GET_THEN_ERROR.error = null;
1918 + } else if (then$$ === undefined) {
1919 + fulfill(promise, maybeThenable);
1920 + } else if (isFunction(then$$)) {
1921 + handleForeignThenable(promise, maybeThenable, then$$);
1922 + } else {
1923 + fulfill(promise, maybeThenable);
1924 + }
1925 + }
1926 +}
1927 +
1928 +function _resolve(promise, value) {
1929 + if (promise === value) {
1930 + _reject(promise, selfFulfillment());
1931 + } else if (objectOrFunction(value)) {
1932 + handleMaybeThenable(promise, value, getThen(value));
1933 + } else {
1934 + fulfill(promise, value);
1935 + }
1936 +}
1937 +
1938 +function publishRejection(promise) {
1939 + if (promise._onerror) {
1940 + promise._onerror(promise._result);
1941 + }
1942 +
1943 + publish(promise);
1944 +}
1945 +
1946 +function fulfill(promise, value) {
1947 + if (promise._state !== PENDING) {
1948 + return;
1949 + }
1950 +
1951 + promise._result = value;
1952 + promise._state = FULFILLED;
1953 +
1954 + if (promise._subscribers.length !== 0) {
1955 + asap(publish, promise);
1956 + }
1957 +}
1958 +
1959 +function _reject(promise, reason) {
1960 + if (promise._state !== PENDING) {
1961 + return;
1962 + }
1963 + promise._state = REJECTED;
1964 + promise._result = reason;
1965 +
1966 + asap(publishRejection, promise);
1967 +}
1968 +
1969 +function subscribe(parent, child, onFulfillment, onRejection) {
1970 + var _subscribers = parent._subscribers;
1971 + var length = _subscribers.length;
1972 +
1973 + parent._onerror = null;
1974 +
1975 + _subscribers[length] = child;
1976 + _subscribers[length + FULFILLED] = onFulfillment;
1977 + _subscribers[length + REJECTED] = onRejection;
1978 +
1979 + if (length === 0 && parent._state) {
1980 + asap(publish, parent);
1981 + }
1982 +}
1983 +
1984 +function publish(promise) {
1985 + var subscribers = promise._subscribers;
1986 + var settled = promise._state;
1987 +
1988 + if (subscribers.length === 0) {
1989 + return;
1990 + }
1991 +
1992 + var child = undefined,
1993 + callback = undefined,
1994 + detail = promise._result;
1995 +
1996 + for (var i = 0; i < subscribers.length; i += 3) {
1997 + child = subscribers[i];
1998 + callback = subscribers[i + settled];
1999 +
2000 + if (child) {
2001 + invokeCallback(settled, child, callback, detail);
2002 + } else {
2003 + callback(detail);
2004 + }
2005 + }
2006 +
2007 + promise._subscribers.length = 0;
2008 +}
2009 +
2010 +function ErrorObject() {
2011 + this.error = null;
2012 +}
2013 +
2014 +var TRY_CATCH_ERROR = new ErrorObject();
2015 +
2016 +function tryCatch(callback, detail) {
2017 + try {
2018 + return callback(detail);
2019 + } catch (e) {
2020 + TRY_CATCH_ERROR.error = e;
2021 + return TRY_CATCH_ERROR;
2022 + }
2023 +}
2024 +
2025 +function invokeCallback(settled, promise, callback, detail) {
2026 + var hasCallback = isFunction(callback),
2027 + value = undefined,
2028 + error = undefined,
2029 + succeeded = undefined,
2030 + failed = undefined;
2031 +
2032 + if (hasCallback) {
2033 + value = tryCatch(callback, detail);
2034 +
2035 + if (value === TRY_CATCH_ERROR) {
2036 + failed = true;
2037 + error = value.error;
2038 + value.error = null;
2039 + } else {
2040 + succeeded = true;
2041 + }
2042 +
2043 + if (promise === value) {
2044 + _reject(promise, cannotReturnOwn());
2045 + return;
2046 + }
2047 + } else {
2048 + value = detail;
2049 + succeeded = true;
2050 + }
2051 +
2052 + if (promise._state !== PENDING) {
2053 + // noop
2054 + } else if (hasCallback && succeeded) {
2055 + _resolve(promise, value);
2056 + } else if (failed) {
2057 + _reject(promise, error);
2058 + } else if (settled === FULFILLED) {
2059 + fulfill(promise, value);
2060 + } else if (settled === REJECTED) {
2061 + _reject(promise, value);
2062 + }
2063 +}
2064 +
2065 +function initializePromise(promise, resolver) {
2066 + try {
2067 + resolver(function resolvePromise(value) {
2068 + _resolve(promise, value);
2069 + }, function rejectPromise(reason) {
2070 + _reject(promise, reason);
2071 + });
2072 + } catch (e) {
2073 + _reject(promise, e);
2074 + }
2075 +}
2076 +
2077 +var id = 0;
2078 +function nextId() {
2079 + return id++;
2080 +}
2081 +
2082 +function makePromise(promise) {
2083 + promise[PROMISE_ID] = id++;
2084 + promise._state = undefined;
2085 + promise._result = undefined;
2086 + promise._subscribers = [];
2087 +}
2088 +
2089 +function Enumerator(Constructor, input) {
2090 + this._instanceConstructor = Constructor;
2091 + this.promise = new Constructor(noop);
2092 +
2093 + if (!this.promise[PROMISE_ID]) {
2094 + makePromise(this.promise);
2095 + }
2096 +
2097 + if (isArray(input)) {
2098 + this._input = input;
2099 + this.length = input.length;
2100 + this._remaining = input.length;
2101 +
2102 + this._result = new Array(this.length);
2103 +
2104 + if (this.length === 0) {
2105 + fulfill(this.promise, this._result);
2106 + } else {
2107 + this.length = this.length || 0;
2108 + this._enumerate();
2109 + if (this._remaining === 0) {
2110 + fulfill(this.promise, this._result);
2111 + }
2112 + }
2113 + } else {
2114 + _reject(this.promise, validationError());
2115 + }
2116 +}
2117 +
2118 +function validationError() {
2119 + return new Error('Array Methods must be provided an Array');
2120 +};
2121 +
2122 +Enumerator.prototype._enumerate = function () {
2123 + var length = this.length;
2124 + var _input = this._input;
2125 +
2126 + for (var i = 0; this._state === PENDING && i < length; i++) {
2127 + this._eachEntry(_input[i], i);
2128 + }
2129 +};
2130 +
2131 +Enumerator.prototype._eachEntry = function (entry, i) {
2132 + var c = this._instanceConstructor;
2133 + var resolve$$ = c.resolve;
2134 +
2135 + if (resolve$$ === resolve) {
2136 + var _then = getThen(entry);
2137 +
2138 + if (_then === then && entry._state !== PENDING) {
2139 + this._settledAt(entry._state, i, entry._result);
2140 + } else if (typeof _then !== 'function') {
2141 + this._remaining--;
2142 + this._result[i] = entry;
2143 + } else if (c === Promise) {
2144 + var promise = new c(noop);
2145 + handleMaybeThenable(promise, entry, _then);
2146 + this._willSettleAt(promise, i);
2147 + } else {
2148 + this._willSettleAt(new c(function (resolve$$) {
2149 + return resolve$$(entry);
2150 + }), i);
2151 + }
2152 + } else {
2153 + this._willSettleAt(resolve$$(entry), i);
2154 + }
2155 +};
2156 +
2157 +Enumerator.prototype._settledAt = function (state, i, value) {
2158 + var promise = this.promise;
2159 +
2160 + if (promise._state === PENDING) {
2161 + this._remaining--;
2162 +
2163 + if (state === REJECTED) {
2164 + _reject(promise, value);
2165 + } else {
2166 + this._result[i] = value;
2167 + }
2168 + }
2169 +
2170 + if (this._remaining === 0) {
2171 + fulfill(promise, this._result);
2172 + }
2173 +};
2174 +
2175 +Enumerator.prototype._willSettleAt = function (promise, i) {
2176 + var enumerator = this;
2177 +
2178 + subscribe(promise, undefined, function (value) {
2179 + return enumerator._settledAt(FULFILLED, i, value);
2180 + }, function (reason) {
2181 + return enumerator._settledAt(REJECTED, i, reason);
2182 + });
2183 +};
2184 +
2185 +/**
2186 + `Promise.all` accepts an array of promises, and returns a new promise which
2187 + is fulfilled with an array of fulfillment values for the passed promises, or
2188 + rejected with the reason of the first passed promise to be rejected. It casts all
2189 + elements of the passed iterable to promises as it runs this algorithm.
2190 +
2191 + Example:
2192 +
2193 + ```javascript
2194 + let promise1 = resolve(1);
2195 + let promise2 = resolve(2);
2196 + let promise3 = resolve(3);
2197 + let promises = [ promise1, promise2, promise3 ];
2198 +
2199 + Promise.all(promises).then(function(array){
2200 + // The array here would be [ 1, 2, 3 ];
2201 + });
2202 + ```
2203 +
2204 + If any of the `promises` given to `all` are rejected, the first promise
2205 + that is rejected will be given as an argument to the returned promises's
2206 + rejection handler. For example:
2207 +
2208 + Example:
2209 +
2210 + ```javascript
2211 + let promise1 = resolve(1);
2212 + let promise2 = reject(new Error("2"));
2213 + let promise3 = reject(new Error("3"));
2214 + let promises = [ promise1, promise2, promise3 ];
2215 +
2216 + Promise.all(promises).then(function(array){
2217 + // Code here never runs because there are rejected promises!
2218 + }, function(error) {
2219 + // error.message === "2"
2220 + });
2221 + ```
2222 +
2223 + @method all
2224 + @static
2225 + @param {Array} entries array of promises
2226 + @param {String} label optional string for labeling the promise.
2227 + Useful for tooling.
2228 + @return {Promise} promise that is fulfilled when all `promises` have been
2229 + fulfilled, or rejected if any of them become rejected.
2230 + @static
2231 +*/
2232 +function all(entries) {
2233 + return new Enumerator(this, entries).promise;
2234 +}
2235 +
2236 +/**
2237 + `Promise.race` returns a new promise which is settled in the same way as the
2238 + first passed promise to settle.
2239 +
2240 + Example:
2241 +
2242 + ```javascript
2243 + let promise1 = new Promise(function(resolve, reject){
2244 + setTimeout(function(){
2245 + resolve('promise 1');
2246 + }, 200);
2247 + });
2248 +
2249 + let promise2 = new Promise(function(resolve, reject){
2250 + setTimeout(function(){
2251 + resolve('promise 2');
2252 + }, 100);
2253 + });
2254 +
2255 + Promise.race([promise1, promise2]).then(function(result){
2256 + // result === 'promise 2' because it was resolved before promise1
2257 + // was resolved.
2258 + });
2259 + ```
2260 +
2261 + `Promise.race` is deterministic in that only the state of the first
2262 + settled promise matters. For example, even if other promises given to the
2263 + `promises` array argument are resolved, but the first settled promise has
2264 + become rejected before the other promises became fulfilled, the returned
2265 + promise will become rejected:
2266 +
2267 + ```javascript
2268 + let promise1 = new Promise(function(resolve, reject){
2269 + setTimeout(function(){
2270 + resolve('promise 1');
2271 + }, 200);
2272 + });
2273 +
2274 + let promise2 = new Promise(function(resolve, reject){
2275 + setTimeout(function(){
2276 + reject(new Error('promise 2'));
2277 + }, 100);
2278 + });
2279 +
2280 + Promise.race([promise1, promise2]).then(function(result){
2281 + // Code here never runs
2282 + }, function(reason){
2283 + // reason.message === 'promise 2' because promise 2 became rejected before
2284 + // promise 1 became fulfilled
2285 + });
2286 + ```
2287 +
2288 + An example real-world use case is implementing timeouts:
2289 +
2290 + ```javascript
2291 + Promise.race([ajax('foo.json'), timeout(5000)])
2292 + ```
2293 +
2294 + @method race
2295 + @static
2296 + @param {Array} promises array of promises to observe
2297 + Useful for tooling.
2298 + @return {Promise} a promise which settles in the same way as the first passed
2299 + promise to settle.
2300 +*/
2301 +function race(entries) {
2302 + /*jshint validthis:true */
2303 + var Constructor = this;
2304 +
2305 + if (!isArray(entries)) {
2306 + return new Constructor(function (_, reject) {
2307 + return reject(new TypeError('You must pass an array to race.'));
2308 + });
2309 + } else {
2310 + return new Constructor(function (resolve, reject) {
2311 + var length = entries.length;
2312 + for (var i = 0; i < length; i++) {
2313 + Constructor.resolve(entries[i]).then(resolve, reject);
2314 + }
2315 + });
2316 + }
2317 +}
2318 +
2319 +/**
2320 + `Promise.reject` returns a promise rejected with the passed `reason`.
2321 + It is shorthand for the following:
2322 +
2323 + ```javascript
2324 + let promise = new Promise(function(resolve, reject){
2325 + reject(new Error('WHOOPS'));
2326 + });
2327 +
2328 + promise.then(function(value){
2329 + // Code here doesn't run because the promise is rejected!
2330 + }, function(reason){
2331 + // reason.message === 'WHOOPS'
2332 + });
2333 + ```
2334 +
2335 + Instead of writing the above, your code now simply becomes the following:
2336 +
2337 + ```javascript
2338 + let promise = Promise.reject(new Error('WHOOPS'));
2339 +
2340 + promise.then(function(value){
2341 + // Code here doesn't run because the promise is rejected!
2342 + }, function(reason){
2343 + // reason.message === 'WHOOPS'
2344 + });
2345 + ```
2346 +
2347 + @method reject
2348 + @static
2349 + @param {Any} reason value that the returned promise will be rejected with.
2350 + Useful for tooling.
2351 + @return {Promise} a promise rejected with the given `reason`.
2352 +*/
2353 +function reject(reason) {
2354 + /*jshint validthis:true */
2355 + var Constructor = this;
2356 + var promise = new Constructor(noop);
2357 + _reject(promise, reason);
2358 + return promise;
2359 +}
2360 +
2361 +function needsResolver() {
2362 + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
2363 +}
2364 +
2365 +function needsNew() {
2366 + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
2367 +}
2368 +
2369 +/**
2370 + Promise objects represent the eventual result of an asynchronous operation. The
2371 + primary way of interacting with a promise is through its `then` method, which
2372 + registers callbacks to receive either a promise's eventual value or the reason
2373 + why the promise cannot be fulfilled.
2374 +
2375 + Terminology
2376 + -----------
2377 +
2378 + - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
2379 + - `thenable` is an object or function that defines a `then` method.
2380 + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
2381 + - `exception` is a value that is thrown using the throw statement.
2382 + - `reason` is a value that indicates why a promise was rejected.
2383 + - `settled` the final resting state of a promise, fulfilled or rejected.
2384 +
2385 + A promise can be in one of three states: pending, fulfilled, or rejected.
2386 +
2387 + Promises that are fulfilled have a fulfillment value and are in the fulfilled
2388 + state. Promises that are rejected have a rejection reason and are in the
2389 + rejected state. A fulfillment value is never a thenable.
2390 +
2391 + Promises can also be said to *resolve* a value. If this value is also a
2392 + promise, then the original promise's settled state will match the value's
2393 + settled state. So a promise that *resolves* a promise that rejects will
2394 + itself reject, and a promise that *resolves* a promise that fulfills will
2395 + itself fulfill.
2396 +
2397 +
2398 + Basic Usage:
2399 + ------------
2400 +
2401 + ```js
2402 + let promise = new Promise(function(resolve, reject) {
2403 + // on success
2404 + resolve(value);
2405 +
2406 + // on failure
2407 + reject(reason);
2408 + });
2409 +
2410 + promise.then(function(value) {
2411 + // on fulfillment
2412 + }, function(reason) {
2413 + // on rejection
2414 + });
2415 + ```
2416 +
2417 + Advanced Usage:
2418 + ---------------
2419 +
2420 + Promises shine when abstracting away asynchronous interactions such as
2421 + `XMLHttpRequest`s.
2422 +
2423 + ```js
2424 + function getJSON(url) {
2425 + return new Promise(function(resolve, reject){
2426 + let xhr = new XMLHttpRequest();
2427 +
2428 + xhr.open('GET', url);
2429 + xhr.onreadystatechange = handler;
2430 + xhr.responseType = 'json';
2431 + xhr.setRequestHeader('Accept', 'application/json');
2432 + xhr.send();
2433 +
2434 + function handler() {
2435 + if (this.readyState === this.DONE) {
2436 + if (this.status === 200) {
2437 + resolve(this.response);
2438 + } else {
2439 + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
2440 + }
2441 + }
2442 + };
2443 + });
2444 + }
2445 +
2446 + getJSON('/posts.json').then(function(json) {
2447 + // on fulfillment
2448 + }, function(reason) {
2449 + // on rejection
2450 + });
2451 + ```
2452 +
2453 + Unlike callbacks, promises are great composable primitives.
2454 +
2455 + ```js
2456 + Promise.all([
2457 + getJSON('/posts'),
2458 + getJSON('/comments')
2459 + ]).then(function(values){
2460 + values[0] // => postsJSON
2461 + values[1] // => commentsJSON
2462 +
2463 + return values;
2464 + });
2465 + ```
2466 +
2467 + @class Promise
2468 + @param {function} resolver
2469 + Useful for tooling.
2470 + @constructor
2471 +*/
2472 +function Promise(resolver) {
2473 + this[PROMISE_ID] = nextId();
2474 + this._result = this._state = undefined;
2475 + this._subscribers = [];
2476 +
2477 + if (noop !== resolver) {
2478 + typeof resolver !== 'function' && needsResolver();
2479 + this instanceof Promise ? initializePromise(this, resolver) : needsNew();
2480 + }
2481 +}
2482 +
2483 +Promise.all = all;
2484 +Promise.race = race;
2485 +Promise.resolve = resolve;
2486 +Promise.reject = reject;
2487 +Promise._setScheduler = setScheduler;
2488 +Promise._setAsap = setAsap;
2489 +Promise._asap = asap;
2490 +
2491 +Promise.prototype = {
2492 + constructor: Promise,
2493 +
2494 + /**
2495 + The primary way of interacting with a promise is through its `then` method,
2496 + which registers callbacks to receive either a promise's eventual value or the
2497 + reason why the promise cannot be fulfilled.
2498 +
2499 + ```js
2500 + findUser().then(function(user){
2501 + // user is available
2502 + }, function(reason){
2503 + // user is unavailable, and you are given the reason why
2504 + });
2505 + ```
2506 +
2507 + Chaining
2508 + --------
2509 +
2510 + The return value of `then` is itself a promise. This second, 'downstream'
2511 + promise is resolved with the return value of the first promise's fulfillment
2512 + or rejection handler, or rejected if the handler throws an exception.
2513 +
2514 + ```js
2515 + findUser().then(function (user) {
2516 + return user.name;
2517 + }, function (reason) {
2518 + return 'default name';
2519 + }).then(function (userName) {
2520 + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
2521 + // will be `'default name'`
2522 + });
2523 +
2524 + findUser().then(function (user) {
2525 + throw new Error('Found user, but still unhappy');
2526 + }, function (reason) {
2527 + throw new Error('`findUser` rejected and we're unhappy');
2528 + }).then(function (value) {
2529 + // never reached
2530 + }, function (reason) {
2531 + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
2532 + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
2533 + });
2534 + ```
2535 + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
2536 +
2537 + ```js
2538 + findUser().then(function (user) {
2539 + throw new PedagogicalException('Upstream error');
2540 + }).then(function (value) {
2541 + // never reached
2542 + }).then(function (value) {
2543 + // never reached
2544 + }, function (reason) {
2545 + // The `PedgagocialException` is propagated all the way down to here
2546 + });
2547 + ```
2548 +
2549 + Assimilation
2550 + ------------
2551 +
2552 + Sometimes the value you want to propagate to a downstream promise can only be
2553 + retrieved asynchronously. This can be achieved by returning a promise in the
2554 + fulfillment or rejection handler. The downstream promise will then be pending
2555 + until the returned promise is settled. This is called *assimilation*.
2556 +
2557 + ```js
2558 + findUser().then(function (user) {
2559 + return findCommentsByAuthor(user);
2560 + }).then(function (comments) {
2561 + // The user's comments are now available
2562 + });
2563 + ```
2564 +
2565 + If the assimliated promise rejects, then the downstream promise will also reject.
2566 +
2567 + ```js
2568 + findUser().then(function (user) {
2569 + return findCommentsByAuthor(user);
2570 + }).then(function (comments) {
2571 + // If `findCommentsByAuthor` fulfills, we'll have the value here
2572 + }, function (reason) {
2573 + // If `findCommentsByAuthor` rejects, we'll have the reason here
2574 + });
2575 + ```
2576 +
2577 + Simple Example
2578 + --------------
2579 +
2580 + Synchronous Example
2581 +
2582 + ```javascript
2583 + let result;
2584 +
2585 + try {
2586 + result = findResult();
2587 + // success
2588 + } catch(reason) {
2589 + // failure
2590 + }
2591 + ```
2592 +
2593 + Errback Example
2594 +
2595 + ```js
2596 + findResult(function(result, err){
2597 + if (err) {
2598 + // failure
2599 + } else {
2600 + // success
2601 + }
2602 + });
2603 + ```
2604 +
2605 + Promise Example;
2606 +
2607 + ```javascript
2608 + findResult().then(function(result){
2609 + // success
2610 + }, function(reason){
2611 + // failure
2612 + });
2613 + ```
2614 +
2615 + Advanced Example
2616 + --------------
2617 +
2618 + Synchronous Example
2619 +
2620 + ```javascript
2621 + let author, books;
2622 +
2623 + try {
2624 + author = findAuthor();
2625 + books = findBooksByAuthor(author);
2626 + // success
2627 + } catch(reason) {
2628 + // failure
2629 + }
2630 + ```
2631 +
2632 + Errback Example
2633 +
2634 + ```js
2635 +
2636 + function foundBooks(books) {
2637 +
2638 + }
2639 +
2640 + function failure(reason) {
2641 +
2642 + }
2643 +
2644 + findAuthor(function(author, err){
2645 + if (err) {
2646 + failure(err);
2647 + // failure
2648 + } else {
2649 + try {
2650 + findBoooksByAuthor(author, function(books, err) {
2651 + if (err) {
2652 + failure(err);
2653 + } else {
2654 + try {
2655 + foundBooks(books);
2656 + } catch(reason) {
2657 + failure(reason);
2658 + }
2659 + }
2660 + });
2661 + } catch(error) {
2662 + failure(err);
2663 + }
2664 + // success
2665 + }
2666 + });
2667 + ```
2668 +
2669 + Promise Example;
2670 +
2671 + ```javascript
2672 + findAuthor().
2673 + then(findBooksByAuthor).
2674 + then(function(books){
2675 + // found books
2676 + }).catch(function(reason){
2677 + // something went wrong
2678 + });
2679 + ```
2680 +
2681 + @method then
2682 + @param {Function} onFulfilled
2683 + @param {Function} onRejected
2684 + Useful for tooling.
2685 + @return {Promise}
2686 + */
2687 + then: then,
2688 +
2689 + /**
2690 + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
2691 + as the catch block of a try/catch statement.
2692 +
2693 + ```js
2694 + function findAuthor(){
2695 + throw new Error('couldn't find that author');
2696 + }
2697 +
2698 + // synchronous
2699 + try {
2700 + findAuthor();
2701 + } catch(reason) {
2702 + // something went wrong
2703 + }
2704 +
2705 + // async with promises
2706 + findAuthor().catch(function(reason){
2707 + // something went wrong
2708 + });
2709 + ```
2710 +
2711 + @method catch
2712 + @param {Function} onRejection
2713 + Useful for tooling.
2714 + @return {Promise}
2715 + */
2716 + 'catch': function _catch(onRejection) {
2717 + return this.then(null, onRejection);
2718 + }
2719 +};
2720 +
2721 +function polyfill() {
2722 + var local = undefined;
2723 +
2724 + if (typeof global !== 'undefined') {
2725 + local = global;
2726 + } else if (typeof self !== 'undefined') {
2727 + local = self;
2728 + } else {
2729 + try {
2730 + local = Function('return this')();
2731 + } catch (e) {
2732 + throw new Error('polyfill failed because global object is unavailable in this environment');
2733 + }
2734 + }
2735 +
2736 + var P = local.Promise;
2737 +
2738 + if (P) {
2739 + var promiseToString = null;
2740 + try {
2741 + promiseToString = Object.prototype.toString.call(P.resolve());
2742 + } catch (e) {
2743 + // silently ignored
2744 + }
2745 +
2746 + if (promiseToString === '[object Promise]' && !P.cast) {
2747 + return;
2748 + }
2749 + }
2750 +
2751 + local.Promise = Promise;
2752 +}
2753 +
2754 +// Strange compat..
2755 +Promise.polyfill = polyfill;
2756 +Promise.Promise = Promise;
2757 +
2758 +return Promise;
2759 +
2760 +})));
2761 +//# sourceMappingURL=es6-promise.map
2762 +
2763 +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(8)))
2764 +
2765 +/***/ }),
2766 +/* 5 */
2767 +/***/ (function(module, exports) {
2768 +
2769 +// removed by extract-text-webpack-plugin
2770 +
2771 +/***/ }),
2772 +/* 6 */
2773 +/***/ (function(module, exports, __webpack_require__) {
2774 +
2775 +"use strict";
2776 +
2777 +
2778 +Object.defineProperty(exports, "__esModule", {
2779 + value: true
2780 +});
2781 +
2782 +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* global VERSION */
2783 +
2784 +__webpack_require__(5);
2785 +
2786 +var _es6Promise = __webpack_require__(4);
2787 +
2788 +var _es6Promise2 = _interopRequireDefault(_es6Promise);
2789 +
2790 +var _utils = __webpack_require__(0);
2791 +
2792 +var Utils = _interopRequireWildcard(_utils);
2793 +
2794 +var _api = __webpack_require__(1);
2795 +
2796 +var API = _interopRequireWildcard(_api);
2797 +
2798 +var _button = __webpack_require__(2);
2799 +
2800 +var _push = __webpack_require__(3);
2801 +
2802 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
2803 +
2804 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2805 +
2806 +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2807 +
2808 +var Noty = function () {
2809 + /**
2810 + * @param {object} options
2811 + * @return {Noty}
2812 + */
2813 + function Noty() {
2814 + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2815 +
2816 + _classCallCheck(this, Noty);
2817 +
2818 + this.options = Utils.deepExtend({}, API.Defaults, options);
2819 + this.id = this.options.id || Utils.generateID('bar');
2820 + this.closeTimer = -1;
2821 + this.barDom = null;
2822 + this.layoutDom = null;
2823 + this.progressDom = null;
2824 + this.showing = false;
2825 + this.shown = false;
2826 + this.closed = false;
2827 + this.closing = false;
2828 + this.killable = this.options.timeout || this.options.closeWith.length > 0;
2829 + this.hasSound = this.options.sounds.sources.length > 0;
2830 + this.soundPlayed = false;
2831 + this.listeners = {
2832 + beforeShow: [],
2833 + onShow: [],
2834 + afterShow: [],
2835 + onClose: [],
2836 + afterClose: [],
2837 + onClick: [],
2838 + onHover: [],
2839 + onTemplate: []
2840 + };
2841 + this.promises = {
2842 + show: null,
2843 + close: null
2844 + };
2845 + this.on('beforeShow', this.options.callbacks.beforeShow);
2846 + this.on('onShow', this.options.callbacks.onShow);
2847 + this.on('afterShow', this.options.callbacks.afterShow);
2848 + this.on('onClose', this.options.callbacks.onClose);
2849 + this.on('afterClose', this.options.callbacks.afterClose);
2850 + this.on('onClick', this.options.callbacks.onClick);
2851 + this.on('onHover', this.options.callbacks.onHover);
2852 + this.on('onTemplate', this.options.callbacks.onTemplate);
2853 +
2854 + return this;
2855 + }
2856 +
2857 + /**
2858 + * @param {string} eventName
2859 + * @param {function} cb
2860 + * @return {Noty}
2861 + */
2862 +
2863 +
2864 + _createClass(Noty, [{
2865 + key: 'on',
2866 + value: function on(eventName) {
2867 + var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2868 +
2869 + if (typeof cb === 'function' && this.listeners.hasOwnProperty(eventName)) {
2870 + this.listeners[eventName].push(cb);
2871 + }
2872 +
2873 + return this;
2874 + }
2875 +
2876 + /**
2877 + * @return {Noty}
2878 + */
2879 +
2880 + }, {
2881 + key: 'show',
2882 + value: function show() {
2883 + var _this = this;
2884 +
2885 + if (this.options.killer === true) {
2886 + Noty.closeAll();
2887 + } else if (typeof this.options.killer === 'string') {
2888 + Noty.closeAll(this.options.killer);
2889 + }
2890 +
2891 + var queueCounts = API.getQueueCounts(this.options.queue);
2892 +
2893 + if (queueCounts.current >= queueCounts.maxVisible || API.PageHidden && this.options.visibilityControl) {
2894 + API.addToQueue(this);
2895 +
2896 + if (API.PageHidden && this.hasSound && Utils.inArray('docHidden', this.options.sounds.conditions)) {
2897 + Utils.createAudioElements(this);
2898 + }
2899 +
2900 + if (API.PageHidden && Utils.inArray('docHidden', this.options.titleCount.conditions)) {
2901 + API.docTitle.increment();
2902 + }
2903 +
2904 + return this;
2905 + }
2906 +
2907 + API.Store[this.id] = this;
2908 +
2909 + API.fire(this, 'beforeShow');
2910 +
2911 + this.showing = true;
2912 +
2913 + if (this.closing) {
2914 + this.showing = false;
2915 + return this;
2916 + }
2917 +
2918 + API.build(this);
2919 + API.handleModal(this);
2920 +
2921 + if (this.options.force) {
2922 + this.layoutDom.insertBefore(this.barDom, this.layoutDom.firstChild);
2923 + } else {
2924 + this.layoutDom.appendChild(this.barDom);
2925 + }
2926 +
2927 + if (this.hasSound && !this.soundPlayed && Utils.inArray('docVisible', this.options.sounds.conditions)) {
2928 + Utils.createAudioElements(this);
2929 + }
2930 +
2931 + if (Utils.inArray('docVisible', this.options.titleCount.conditions)) {
2932 + API.docTitle.increment();
2933 + }
2934 +
2935 + this.shown = true;
2936 + this.closed = false;
2937 +
2938 + // bind button events if any
2939 + if (API.hasButtons(this)) {
2940 + Object.keys(this.options.buttons).forEach(function (key) {
2941 + var btn = _this.barDom.querySelector('#' + _this.options.buttons[key].id);
2942 + Utils.addListener(btn, 'click', function (e) {
2943 + Utils.stopPropagation(e);
2944 + _this.options.buttons[key].cb();
2945 + });
2946 + });
2947 + }
2948 +
2949 + this.progressDom = this.barDom.querySelector('.noty_progressbar');
2950 +
2951 + if (Utils.inArray('click', this.options.closeWith)) {
2952 + Utils.addClass(this.barDom, 'noty_close_with_click');
2953 + Utils.addListener(this.barDom, 'click', function (e) {
2954 + Utils.stopPropagation(e);
2955 + API.fire(_this, 'onClick');
2956 + _this.close();
2957 + }, false);
2958 + }
2959 +
2960 + Utils.addListener(this.barDom, 'mouseenter', function () {
2961 + API.fire(_this, 'onHover');
2962 + }, false);
2963 +
2964 + if (this.options.timeout) Utils.addClass(this.barDom, 'noty_has_timeout');
2965 + if (this.options.progressBar) {
2966 + Utils.addClass(this.barDom, 'noty_has_progressbar');
2967 + }
2968 +
2969 + if (Utils.inArray('button', this.options.closeWith)) {
2970 + Utils.addClass(this.barDom, 'noty_close_with_button');
2971 +
2972 + var closeButton = document.createElement('div');
2973 + Utils.addClass(closeButton, 'noty_close_button');
2974 + closeButton.innerHTML = '×';
2975 + this.barDom.appendChild(closeButton);
2976 +
2977 + Utils.addListener(closeButton, 'click', function (e) {
2978 + Utils.stopPropagation(e);
2979 + _this.close();
2980 + }, false);
2981 + }
2982 +
2983 + API.fire(this, 'onShow');
2984 +
2985 + if (this.options.animation.open === null) {
2986 + this.promises.show = new _es6Promise2.default(function (resolve) {
2987 + resolve();
2988 + });
2989 + } else if (typeof this.options.animation.open === 'function') {
2990 + this.promises.show = new _es6Promise2.default(this.options.animation.open.bind(this));
2991 + } else {
2992 + Utils.addClass(this.barDom, this.options.animation.open);
2993 + this.promises.show = new _es6Promise2.default(function (resolve) {
2994 + Utils.addListener(_this.barDom, Utils.animationEndEvents, function () {
2995 + Utils.removeClass(_this.barDom, _this.options.animation.open);
2996 + resolve();
2997 + });
2998 + });
2999 + }
3000 +
3001 + this.promises.show.then(function () {
3002 + var _t = _this;
3003 + setTimeout(function () {
3004 + API.openFlow(_t);
3005 + }, 100);
3006 + });
3007 +
3008 + return this;
3009 + }
3010 +
3011 + /**
3012 + * @return {Noty}
3013 + */
3014 +
3015 + }, {
3016 + key: 'stop',
3017 + value: function stop() {
3018 + API.dequeueClose(this);
3019 + return this;
3020 + }
3021 +
3022 + /**
3023 + * @return {Noty}
3024 + */
3025 +
3026 + }, {
3027 + key: 'resume',
3028 + value: function resume() {
3029 + API.queueClose(this);
3030 + return this;
3031 + }
3032 +
3033 + /**
3034 + * @param {int|boolean} ms
3035 + * @return {Noty}
3036 + */
3037 +
3038 + }, {
3039 + key: 'setTimeout',
3040 + value: function (_setTimeout) {
3041 + function setTimeout(_x) {
3042 + return _setTimeout.apply(this, arguments);
3043 + }
3044 +
3045 + setTimeout.toString = function () {
3046 + return _setTimeout.toString();
3047 + };
3048 +
3049 + return setTimeout;
3050 + }(function (ms) {
3051 + this.stop();
3052 + this.options.timeout = ms;
3053 +
3054 + if (this.barDom) {
3055 + if (this.options.timeout) {
3056 + Utils.addClass(this.barDom, 'noty_has_timeout');
3057 + } else {
3058 + Utils.removeClass(this.barDom, 'noty_has_timeout');
3059 + }
3060 +
3061 + var _t = this;
3062 + setTimeout(function () {
3063 + // ugly fix for progressbar display bug
3064 + _t.resume();
3065 + }, 100);
3066 + }
3067 +
3068 + return this;
3069 + })
3070 +
3071 + /**
3072 + * @param {string} html
3073 + * @param {boolean} optionsOverride
3074 + * @return {Noty}
3075 + */
3076 +
3077 + }, {
3078 + key: 'setText',
3079 + value: function setText(html) {
3080 + var optionsOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3081 +
3082 + if (this.barDom) {
3083 + this.barDom.querySelector('.noty_body').innerHTML = html;
3084 + }
3085 +
3086 + if (optionsOverride) this.options.text = html;
3087 +
3088 + return this;
3089 + }
3090 +
3091 + /**
3092 + * @param {string} type
3093 + * @param {boolean} optionsOverride
3094 + * @return {Noty}
3095 + */
3096 +
3097 + }, {
3098 + key: 'setType',
3099 + value: function setType(type) {
3100 + var _this2 = this;
3101 +
3102 + var optionsOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3103 +
3104 + if (this.barDom) {
3105 + var classList = Utils.classList(this.barDom).split(' ');
3106 +
3107 + classList.forEach(function (c) {
3108 + if (c.substring(0, 11) === 'noty_type__') {
3109 + Utils.removeClass(_this2.barDom, c);
3110 + }
3111 + });
3112 +
3113 + Utils.addClass(this.barDom, 'noty_type__' + type);
3114 + }
3115 +
3116 + if (optionsOverride) this.options.type = type;
3117 +
3118 + return this;
3119 + }
3120 +
3121 + /**
3122 + * @param {string} theme
3123 + * @param {boolean} optionsOverride
3124 + * @return {Noty}
3125 + */
3126 +
3127 + }, {
3128 + key: 'setTheme',
3129 + value: function setTheme(theme) {
3130 + var _this3 = this;
3131 +
3132 + var optionsOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3133 +
3134 + if (this.barDom) {
3135 + var classList = Utils.classList(this.barDom).split(' ');
3136 +
3137 + classList.forEach(function (c) {
3138 + if (c.substring(0, 12) === 'noty_theme__') {
3139 + Utils.removeClass(_this3.barDom, c);
3140 + }
3141 + });
3142 +
3143 + Utils.addClass(this.barDom, 'noty_theme__' + theme);
3144 + }
3145 +
3146 + if (optionsOverride) this.options.theme = theme;
3147 +
3148 + return this;
3149 + }
3150 +
3151 + /**
3152 + * @return {Noty}
3153 + */
3154 +
3155 + }, {
3156 + key: 'close',
3157 + value: function close() {
3158 + var _this4 = this;
3159 +
3160 + if (this.closed) return this;
3161 +
3162 + if (!this.shown) {
3163 + // it's in the queue
3164 + API.removeFromQueue(this);
3165 + return this;
3166 + }
3167 +
3168 + API.fire(this, 'onClose');
3169 +
3170 + this.closing = true;
3171 +
3172 + if (this.options.animation.close === null) {
3173 + this.promises.close = new _es6Promise2.default(function (resolve) {
3174 + resolve();
3175 + });
3176 + } else if (typeof this.options.animation.close === 'function') {
3177 + this.promises.close = new _es6Promise2.default(this.options.animation.close.bind(this));
3178 + } else {
3179 + Utils.addClass(this.barDom, this.options.animation.close);
3180 + this.promises.close = new _es6Promise2.default(function (resolve) {
3181 + Utils.addListener(_this4.barDom, Utils.animationEndEvents, function () {
3182 + if (_this4.options.force) {
3183 + Utils.remove(_this4.barDom);
3184 + } else {
3185 + API.ghostFix(_this4);
3186 + }
3187 + resolve();
3188 + });
3189 + });
3190 + }
3191 +
3192 + this.promises.close.then(function () {
3193 + API.closeFlow(_this4);
3194 + API.handleModalClose(_this4);
3195 + });
3196 +
3197 + this.closed = true;
3198 +
3199 + return this;
3200 + }
3201 +
3202 + // API functions
3203 +
3204 + /**
3205 + * @param {boolean|string} queueName
3206 + * @return {Noty}
3207 + */
3208 +
3209 + }], [{
3210 + key: 'closeAll',
3211 + value: function closeAll() {
3212 + var queueName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3213 +
3214 + Object.keys(API.Store).forEach(function (id) {
3215 + if (queueName) {
3216 + if (API.Store[id].options.queue === queueName && API.Store[id].killable) {
3217 + API.Store[id].close();
3218 + }
3219 + } else if (API.Store[id].killable) {
3220 + API.Store[id].close();
3221 + }
3222 + });
3223 + return this;
3224 + }
3225 +
3226 + /**
3227 + * @param {Object} obj
3228 + * @return {Noty}
3229 + */
3230 +
3231 + }, {
3232 + key: 'overrideDefaults',
3233 + value: function overrideDefaults(obj) {
3234 + API.Defaults = Utils.deepExtend({}, API.Defaults, obj);
3235 + return this;
3236 + }
3237 +
3238 + /**
3239 + * @param {int} amount
3240 + * @param {string} queueName
3241 + * @return {Noty}
3242 + */
3243 +
3244 + }, {
3245 + key: 'setMaxVisible',
3246 + value: function setMaxVisible() {
3247 + var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : API.DefaultMaxVisible;
3248 + var queueName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'global';
3249 +
3250 + if (!API.Queues.hasOwnProperty(queueName)) {
3251 + API.Queues[queueName] = { maxVisible: amount, queue: [] };
3252 + }
3253 +
3254 + API.Queues[queueName].maxVisible = amount;
3255 + return this;
3256 + }
3257 +
3258 + /**
3259 + * @param {string} innerHtml
3260 + * @param {String} classes
3261 + * @param {Function} cb
3262 + * @param {Object} attributes
3263 + * @return {NotyButton}
3264 + */
3265 +
3266 + }, {
3267 + key: 'button',
3268 + value: function button(innerHtml) {
3269 + var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
3270 + var cb = arguments[2];
3271 + var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3272 +
3273 + return new _button.NotyButton(innerHtml, classes, cb, attributes);
3274 + }
3275 +
3276 + /**
3277 + * @return {string}
3278 + */
3279 +
3280 + }, {
3281 + key: 'version',
3282 + value: function version() {
3283 + return "3.1.3";
3284 + }
3285 +
3286 + /**
3287 + * @param {String} workerPath
3288 + * @return {Push}
3289 + */
3290 +
3291 + }, {
3292 + key: 'Push',
3293 + value: function Push(workerPath) {
3294 + return new _push.Push(workerPath);
3295 + }
3296 + }]);
3297 +
3298 + return Noty;
3299 +}();
3300 +
3301 +// Document visibility change controller
3302 +
3303 +
3304 +exports.default = Noty;
3305 +Utils.visibilityChangeFlow();
3306 +module.exports = exports['default'];
3307 +
3308 +/***/ }),
3309 +/* 7 */
3310 +/***/ (function(module, exports) {
3311 +
3312 +// shim for using process in browser
3313 +var process = module.exports = {};
3314 +
3315 +// cached from whatever global is present so that test runners that stub it
3316 +// don't break things. But we need to wrap it in a try catch in case it is
3317 +// wrapped in strict mode code which doesn't define any globals. It's inside a
3318 +// function because try/catches deoptimize in certain engines.
3319 +
3320 +var cachedSetTimeout;
3321 +var cachedClearTimeout;
3322 +
3323 +function defaultSetTimout() {
3324 + throw new Error('setTimeout has not been defined');
3325 +}
3326 +function defaultClearTimeout () {
3327 + throw new Error('clearTimeout has not been defined');
3328 +}
3329 +(function () {
3330 + try {
3331 + if (typeof setTimeout === 'function') {
3332 + cachedSetTimeout = setTimeout;
3333 + } else {
3334 + cachedSetTimeout = defaultSetTimout;
3335 + }
3336 + } catch (e) {
3337 + cachedSetTimeout = defaultSetTimout;
3338 + }
3339 + try {
3340 + if (typeof clearTimeout === 'function') {
3341 + cachedClearTimeout = clearTimeout;
3342 + } else {
3343 + cachedClearTimeout = defaultClearTimeout;
3344 + }
3345 + } catch (e) {
3346 + cachedClearTimeout = defaultClearTimeout;
3347 + }
3348 +} ())
3349 +function runTimeout(fun) {
3350 + if (cachedSetTimeout === setTimeout) {
3351 + //normal enviroments in sane situations
3352 + return setTimeout(fun, 0);
3353 + }
3354 + // if setTimeout wasn't available but was latter defined
3355 + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
3356 + cachedSetTimeout = setTimeout;
3357 + return setTimeout(fun, 0);
3358 + }
3359 + try {
3360 + // when when somebody has screwed with setTimeout but no I.E. maddness
3361 + return cachedSetTimeout(fun, 0);
3362 + } catch(e){
3363 + try {
3364 + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3365 + return cachedSetTimeout.call(null, fun, 0);
3366 + } catch(e){
3367 + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
3368 + return cachedSetTimeout.call(this, fun, 0);
3369 + }
3370 + }
3371 +
3372 +
3373 +}
3374 +function runClearTimeout(marker) {
3375 + if (cachedClearTimeout === clearTimeout) {
3376 + //normal enviroments in sane situations
3377 + return clearTimeout(marker);
3378 + }
3379 + // if clearTimeout wasn't available but was latter defined
3380 + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
3381 + cachedClearTimeout = clearTimeout;
3382 + return clearTimeout(marker);
3383 + }
3384 + try {
3385 + // when when somebody has screwed with setTimeout but no I.E. maddness
3386 + return cachedClearTimeout(marker);
3387 + } catch (e){
3388 + try {
3389 + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3390 + return cachedClearTimeout.call(null, marker);
3391 + } catch (e){
3392 + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
3393 + // Some versions of I.E. have different rules for clearTimeout vs setTimeout
3394 + return cachedClearTimeout.call(this, marker);
3395 + }
3396 + }
3397 +
3398 +
3399 +
3400 +}
3401 +var queue = [];
3402 +var draining = false;
3403 +var currentQueue;
3404 +var queueIndex = -1;
3405 +
3406 +function cleanUpNextTick() {
3407 + if (!draining || !currentQueue) {
3408 + return;
3409 + }
3410 + draining = false;
3411 + if (currentQueue.length) {
3412 + queue = currentQueue.concat(queue);
3413 + } else {
3414 + queueIndex = -1;
3415 + }
3416 + if (queue.length) {
3417 + drainQueue();
3418 + }
3419 +}
3420 +
3421 +function drainQueue() {
3422 + if (draining) {
3423 + return;
3424 + }
3425 + var timeout = runTimeout(cleanUpNextTick);
3426 + draining = true;
3427 +
3428 + var len = queue.length;
3429 + while(len) {
3430 + currentQueue = queue;
3431 + queue = [];
3432 + while (++queueIndex < len) {
3433 + if (currentQueue) {
3434 + currentQueue[queueIndex].run();
3435 + }
3436 + }
3437 + queueIndex = -1;
3438 + len = queue.length;
3439 + }
3440 + currentQueue = null;
3441 + draining = false;
3442 + runClearTimeout(timeout);
3443 +}
3444 +
3445 +process.nextTick = function (fun) {
3446 + var args = new Array(arguments.length - 1);
3447 + if (arguments.length > 1) {
3448 + for (var i = 1; i < arguments.length; i++) {
3449 + args[i - 1] = arguments[i];
3450 + }
3451 + }
3452 + queue.push(new Item(fun, args));
3453 + if (queue.length === 1 && !draining) {
3454 + runTimeout(drainQueue);
3455 + }
3456 +};
3457 +
3458 +// v8 likes predictible objects
3459 +function Item(fun, array) {
3460 + this.fun = fun;
3461 + this.array = array;
3462 +}
3463 +Item.prototype.run = function () {
3464 + this.fun.apply(null, this.array);
3465 +};
3466 +process.title = 'browser';
3467 +process.browser = true;
3468 +process.env = {};
3469 +process.argv = [];
3470 +process.version = ''; // empty string to avoid regexp issues
3471 +process.versions = {};
3472 +
3473 +function noop() {}
3474 +
3475 +process.on = noop;
3476 +process.addListener = noop;
3477 +process.once = noop;
3478 +process.off = noop;
3479 +process.removeListener = noop;
3480 +process.removeAllListeners = noop;
3481 +process.emit = noop;
3482 +process.prependListener = noop;
3483 +process.prependOnceListener = noop;
3484 +
3485 +process.listeners = function (name) { return [] }
3486 +
3487 +process.binding = function (name) {
3488 + throw new Error('process.binding is not supported');
3489 +};
3490 +
3491 +process.cwd = function () { return '/' };
3492 +process.chdir = function (dir) {
3493 + throw new Error('process.chdir is not supported');
3494 +};
3495 +process.umask = function() { return 0; };
3496 +
3497 +
3498 +/***/ }),
3499 +/* 8 */
3500 +/***/ (function(module, exports) {
3501 +
3502 +var g;
3503 +
3504 +// This works in non-strict mode
3505 +g = (function() {
3506 + return this;
3507 +})();
3508 +
3509 +try {
3510 + // This works if eval is allowed (see CSP)
3511 + g = g || Function("return this")() || (1,eval)("this");
3512 +} catch(e) {
3513 + // This works if the window reference is available
3514 + if(typeof window === "object")
3515 + g = window;
3516 +}
3517 +
3518 +// g can still be undefined, but nothing to do about it...
3519 +// We return undefined, instead of nothing here, so it's
3520 +// easier to handle this case. if(!global) { ...}
3521 +
3522 +module.exports = g;
3523 +
3524 +
3525 +/***/ }),
3526 +/* 9 */
3527 +/***/ (function(module, exports) {
3528 +
3529 +/* (ignored) */
3530 +
3531 +/***/ })
3532 +/******/ ]);
3533 +});
3534 +//# sourceMappingURL=noty.js.map
3535 \ No newline at end of file
3536
3537 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.min.js b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.min.js
3538 new file mode 100755
3539 index 0000000..a4332f6
3540 --- /dev/null
3541 +++ b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/lib/noty.min.js
3542 @@ -0,0 +1,17 @@
3543 +/*
3544 + @package NOTY - Dependency-free notification library
3545 + @version version: 3.1.3
3546 + @contributors https://github.com/needim/noty/graphs/contributors
3547 + @documentation Examples and Documentation - http://needim.github.com/noty
3548 + @license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
3549 +*/
3550 +
3551 +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Noty",[],e):"object"==typeof exports?exports.Noty=e():t.Noty=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=6)}([function(t,e,n){"use strict";function o(t,e,n){var o=void 0;if(!n){for(o in e)if(e.hasOwnProperty(o)&&e[o]===t)return!0}else for(o in e)if(e.hasOwnProperty(o)&&e[o]===t)return!0;return!1}function i(t){t=t||window.event,void 0!==t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}f
3552 unction r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e="noty_"+t+"_";return e+="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function s(t){var e=t.offsetHeight,n=window.getComputedStyle(t);return e+=parseInt(n.marginTop)+parseInt(n.marginBottom)}function u(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e=e.split(" ");for(var i=0;i<e.length;i++)document.addEventListener?t.addEventListener(e[i],n,o):document.attachEvent&&t.attachEvent("on"+e[i],n)}function a(t,e){return("string"==typeof t?t:f(t)).indexOf(" "+e+" ")>=0}function c(t,e){var n=f(t),o=n+e;a(n,e)||(t.className=o.substring(1))}function l(t,e){var n=f(t),o=void 0;a(t,e)&&(o=n.replace(" "+e+" "," "),t.className=o.substring(1,o.length-1))}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function f(t){return(" "+(t&&t.className||"")+" ").replace(/\s+/gi," ")}function h(){function t(){b.PageHidd
3553 en=document[s],o()}function e(){b.PageHidden=!0,o()}function n(){b.PageHidden=!1,o()}function o(){b.PageHidden?i():r()}function i(){setTimeout(function(){Object.keys(b.Store).forEach(function(t){b.Store.hasOwnProperty(t)&&b.Store[t].options.visibilityControl&&b.Store[t].stop()})},100)}function r(){setTimeout(function(){Object.keys(b.Store).forEach(function(t){b.Store.hasOwnProperty(t)&&b.Store[t].options.visibilityControl&&b.Store[t].resume()}),b.queueRenderAll()},100)}var s=void 0,a=void 0;void 0!==document.hidden?(s="hidden",a="visibilitychange"):void 0!==document.msHidden?(s="msHidden",a="msvisibilitychange"):void 0!==document.webkitHidden&&(s="webkitHidden",a="webkitvisibilitychange"),u(document,a,t),u(window,"blur",e),u(window,"focus",n)}function p(t){if(t.hasSound){var e=document.createElement("audio");t.options.sounds.sources.forEach(function(t){var n=document.createElement("source");n.src=t,n.type="audio/"+m(t),e.appendChild(n)}),t.barDom?t.barDom.appendChild(e):document.que
3554 rySelector("body").appendChild(e),e.volume=t.options.sounds.volume,t.soundPlayed||(e.play(),t.soundPlayed=!0),e.onended=function(){d(e)}}}function m(t){return t.match(/\.([^.]+)$/)[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.css=e.deepExtend=e.animationEndEvents=void 0;var v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.inArray=o,e.stopPropagation=i,e.generateID=r,e.outerHeight=s,e.addListener=u,e.hasClass=a,e.addClass=c,e.removeClass=l,e.remove=d,e.classList=f,e.visibilityChangeFlow=h,e.createAudioElements=p;var y=n(1),b=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(y);e.animationEndEvents="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",e.deepExtend=function t(e){e=e||{};for(var n=1
3555 ;n<arguments.length;n++){var o=arguments[n];if(o)for(var i in o)o.hasOwnProperty(i)&&(Array.isArray(o[i])?e[i]=o[i]:"object"===v(o[i])&&null!==o[i]?e[i]=t(e[i],o[i]):e[i]=o[i])}return e},e.css=function(){function t(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})}function e(t){var e=document.body.style;if(t in e)return t;for(var n=i.length,o=t.charAt(0).toUpperCase()+t.slice(1),r=void 0;n--;)if((r=i[n]+o)in e)return r;return t}function n(n){return n=t(n),r[n]||(r[n]=e(n))}function o(t,e,o){e=n(e),t.style[e]=o}var i=["Webkit","O","Moz","ms"],r={};return function(t,e){var n=arguments,i=void 0,r=void 0;if(2===n.length)for(i in e)e.hasOwnProperty(i)&&void 0!==(r=e[i])&&e.hasOwnProperty(i)&&o(t,i,r);else o(t,n[1],n[2])}}()},function(t,e,n){"use strict";function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global",e=0,n=x;return E.hasOwnProperty(t)&&(n=E[t].maxVisible,Object.keys(P).forEach(function(n){P[n].options.queue
3556 !==t||P[n].closed||e++})),{current:e,maxVisible:n}}function i(t){E.hasOwnProperty(t.options.queue)||(E[t.options.queue]={maxVisible:x,queue:[]}),E[t.options.queue].queue.push(t)}function r(t){if(E.hasOwnProperty(t.options.queue)){var e=[];Object.keys(E[t.options.queue].queue).forEach(function(n){E[t.options.queue].queue[n].id!==t.id&&e.push(E[t.options.queue].queue[n])}),E[t.options.queue].queue=e}}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";if(E.hasOwnProperty(t)){var e=E[t].queue.shift();e&&e.show()}}function u(){Object.keys(E).forEach(function(t){s(t)})}function a(t){var e=k.generateID("ghost"),n=document.createElement("div");n.setAttribute("id",e),k.css(n,{height:k.outerHeight(t.barDom)+"px"}),t.barDom.insertAdjacentHTML("afterend",n.outerHTML),k.remove(t.barDom),n=document.getElementById(e),k.addClass(n,"noty_fix_effects_height"),k.addListener(n,k.animationEndEvents,function(){k.remove(n)})}function c(t){m(t);var e='<div class="noty_body">
3557 '+t.options.text+"</div>"+d(t)+'<div class="noty_progressbar"></div>';t.barDom=document.createElement("div"),t.barDom.setAttribute("id",t.id),k.addClass(t.barDom,"noty_bar noty_type__"+t.options.type+" noty_theme__"+t.options.theme),t.barDom.innerHTML=e,b(t,"onTemplate")}function l(t){return!(!t.options.buttons||!Object.keys(t.options.buttons).length)}function d(t){if(l(t)){var e=document.createElement("div");return k.addClass(e,"noty_buttons"),Object.keys(t.options.buttons).forEach(function(n){e.appendChild(t.options.buttons[n].dom)}),t.options.buttons.forEach(function(t){e.appendChild(t.dom)}),e.outerHTML}return""}function f(t){t.options.modal&&(0===C&&p(),e.DocModalCount=C+=1)}function h(t){if(t.options.modal&&C>0&&(e.DocModalCount=C-=1,C<=0)){var n=document.querySelector(".noty_modal");n&&(k.removeClass(n,"noty_modal_open"),k.addClass(n,"noty_modal_close"),k.addListener(n,k.animationEndEvents,function(){k.remove(n)}))}}function p(){var t=document.querySelector("body"),e=document
3558 .createElement("div");k.addClass(e,"noty_modal"),t.insertBefore(e,t.firstChild),k.addClass(e,"noty_modal_open"),k.addListener(e,k.animationEndEvents,function(){k.removeClass(e,"noty_modal_open")})}function m(t){if(t.options.container)return void(t.layoutDom=document.querySelector(t.options.container));var e="noty_layout__"+t.options.layout;t.layoutDom=document.querySelector("div#"+e),t.layoutDom||(t.layoutDom=document.createElement("div"),t.layoutDom.setAttribute("id",e),k.addClass(t.layoutDom,"noty_layout"),document.querySelector("body").appendChild(t.layoutDom))}function v(t){t.options.timeout&&(t.options.progressBar&&t.progressDom&&k.css(t.progressDom,{transition:"width "+t.options.timeout+"ms linear",width:"0%"}),clearTimeout(t.closeTimer),t.closeTimer=setTimeout(function(){t.close()},t.options.timeout))}function y(t){t.options.timeout&&t.closeTimer&&(clearTimeout(t.closeTimer),t.closeTimer=-1,t.options.progressBar&&t.progressDom&&k.css(t.progressDom,{transition:"width 0ms linea
3559 r",width:"100%"}))}function b(t,e){t.listeners.hasOwnProperty(e)&&t.listeners[e].forEach(function(e){"function"==typeof e&&e.apply(t)})}function w(t){b(t,"afterShow"),v(t),k.addListener(t.barDom,"mouseenter",function(){y(t)}),k.addListener(t.barDom,"mouseleave",function(){v(t)})}function g(t){delete P[t.id],t.closing=!1,b(t,"afterClose"),k.remove(t.barDom),0!==t.layoutDom.querySelectorAll(".noty_bar").length||t.options.container||k.remove(t.layoutDom),(k.inArray("docVisible",t.options.titleCount.conditions)||k.inArray("docHidden",t.options.titleCount.conditions))&&D.decrement(),s(t.options.queue)}Object.defineProperty(e,"__esModule",{value:!0}),e.Defaults=e.Store=e.Queues=e.DefaultMaxVisible=e.docTitle=e.DocModalCount=e.PageHidden=void 0,e.getQueueCounts=o,e.addToQueue=i,e.removeFromQueue=r,e.queueRender=s,e.queueRenderAll=u,e.ghostFix=a,e.build=c,e.hasButtons=l,e.handleModal=f,e.handleModalClose=h,e.queueClose=v,e.dequeueClose=y,e.fire=b,e.openFlow=w,e.closeFlow=g;var _=n(0),k=func
3560 tion(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(_),C=(e.PageHidden=!1,e.DocModalCount=0),S={originalTitle:null,count:0,changed:!1,timer:-1},D=e.docTitle={increment:function(){S.count++,D._update()},decrement:function(){if(--S.count<=0)return void D._clear();D._update()},_update:function(){var t=document.title;S.changed?document.title="("+S.count+") "+S.originalTitle:(S.originalTitle=t,document.title="("+S.count+") "+t,S.changed=!0)},_clear:function(){S.changed&&(S.count=0,document.title=S.originalTitle,S.changed=!1)}},x=e.DefaultMaxVisible=5,E=e.Queues={global:{maxVisible:x,queue:[]}},P=e.Store={};e.Defaults={type:"alert",layout:"topRight",theme:"mint",text:"",timeout:!1,progressBar:!0,closeWith:["click"],animation:{open:"noty_effects_open",close:"noty_effects_close"},id:!1,force:!1,killer:!1,queue:"global",container:!1,buttons:[],callbacks:{beforeShow:null,onShow:null,afterShow:null,
3561 onClose:null,afterClose:null,onClick:null,onHover:null,onTemplate:null},sounds:{sources:[],volume:1,conditions:[]},titleCount:{conditions:[]},modal:!1,visibilityControl:!1}},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.NotyButton=void 0;var i=n(0),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(i);e.NotyButton=function t(e,n,i){var s=this,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o(this,t),this.dom=document.createElement("button"),this.dom.innerHTML=e,this.id=u.id=u.id||r.generateID("button"),this.cb=i,Object.keys(u).forEach(function(t){s.dom.setAttribute(t,u[t])}),r.addClass(this.dom,n||"noty_btn"),this}},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}
3562 Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();e.Push=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/service-worker.js";return o(this,t),this.subData={},this.workerPath=e,this.listeners={onPermissionGranted:[],onPermissionDenied:[],onSubscriptionSuccess:[],onSubscriptionCancel:[],onWorkerError:[],onWorkerSuccess:[],onWorkerNotSupported:[]},this}return i(t,[{key:"on",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof e&&this.listeners.hasOwnProperty(t)&&this.listeners[t].push(e),this}},{key:"fire",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.listeners.hasOwnProperty(t)&&this.listeners[
3563 t].forEach(function(t){"function"==typeof t&&t.apply(e,n)})}},{key:"create",value:function(){console.log("NOT IMPLEMENTED YET")}},{key:"isSupported",value:function(){var t=!1;try{t=window.Notification||window.webkitNotifications||navigator.mozNotification||window.external&&void 0!==window.external.msIsSiteMode()}catch(t){}return t}},{key:"getPermissionStatus",value:function(){var t="default";if(window.Notification&&window.Notification.permissionLevel)t=window.Notification.permissionLevel;else if(window.webkitNotifications&&window.webkitNotifications.checkPermission)switch(window.webkitNotifications.checkPermission()){case 1:t="default";break;case 0:t="granted";break;default:t="denied"}else window.Notification&&window.Notification.permission?t=window.Notification.permission:navigator.mozNotification?t="granted":window.external&&void 0!==window.external.msIsSiteMode()&&(t=window.external.msIsSiteMode()?"granted":"default");return t.toString().toLowerCase()}},{key:"getEndpoint",value:f
3564 unction(t){var e=t.endpoint,n=t.subscriptionId;return n&&-1===e.indexOf(n)&&(e+="/"+n),e}},{key:"isSWRegistered",value:function(){try{return"activated"===navigator.serviceWorker.controller.state}catch(t){return!1}}},{key:"unregisterWorker",value:function(){var t=this;"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(function(e){var n=!0,o=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(n=(r=s.next()).done);n=!0){r.value.unregister(),t.fire("onSubscriptionCancel")}}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}})}},{key:"requestSubscription",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this,o=this.getPermissionStatus(),i=function(o){"granted"===o?(t.fire("onPermissionGranted"),"serviceWorker"in navigator?navigator.serviceWorker.register(t.workerPath).then(function(){navigator.serviceWorker.ready.then(function(t){n.fire("onWorkerSuccess"),t.pushManager.subscribe({userVisibleOnly:
3565 e}).then(function(t){var e=t.getKey("p256dh"),o=t.getKey("auth");n.subData={endpoint:n.getEndpoint(t),p256dh:e?window.btoa(String.fromCharCode.apply(null,new Uint8Array(e))):null,auth:o?window.btoa(String.fromCharCode.apply(null,new Uint8Array(o))):null},n.fire("onSubscriptionSuccess",[n.subData])}).catch(function(t){n.fire("onWorkerError",[t])})})}):n.fire("onWorkerNotSupported")):"denied"===o&&(t.fire("onPermissionDenied"),t.unregisterWorker())};"default"===o?window.Notification&&window.Notification.requestPermission?window.Notification.requestPermission(i):window.webkitNotifications&&window.webkitNotifications.checkPermission&&window.webkitNotifications.requestPermission(i):i(o)}}]),t}()},function(t,e,n){(function(e,o){/*!
3566 + * @overview es6-promise - a tiny implementation of Promises/A+.
3567 + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
3568 + * @license Licensed under MIT license
3569 + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
3570 + * @version 4.1.0
3571 + */
3572 +!function(e,n){t.exports=n()}(0,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function i(t){return"function"==typeof t}function r(t){z=t}function s(t){U=t}function u(){return void 0!==R?function(){R(c)}:a()}function a(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<Q;t+=2){(0,X[t])(X[t+1]),X[t]=void 0,X[t+1]=void 0}Q=0}function l(t,e){var n=arguments,o=this,i=new this.constructor(f);void 0===i[tt]&&A(i);var r=o._state;return r?function(){var t=n[r-1];U(function(){return P(r,i,t,o._result)})}():S(o,i,t,e),i}function d(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(f);return g(n,t),n}function f(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function m(t){try{return t.then}catch(t){return it.error=t,it}}function v(t,e,n,o){try{t.call(e,n,o)}catch(t){retu
3573 rn t}}function y(t,e,n){U(function(t){var o=!1,i=v(n,e,function(n){o||(o=!0,e!==n?g(t,n):k(t,n))},function(e){o||(o=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!o&&i&&(o=!0,C(t,i))},t)}function b(t,e){e._state===nt?k(t,e._result):e._state===ot?C(t,e._result):S(e,void 0,function(e){return g(t,e)},function(e){return C(t,e)})}function w(t,e,n){e.constructor===t.constructor&&n===l&&e.constructor.resolve===d?b(t,e):n===it?(C(t,it.error),it.error=null):void 0===n?k(t,e):i(n)?y(t,e,n):k(t,e)}function g(e,n){e===n?C(e,h()):t(n)?w(e,n,m(n)):k(e,n)}function _(t){t._onerror&&t._onerror(t._result),D(t)}function k(t,e){t._state===et&&(t._result=e,t._state=nt,0!==t._subscribers.length&&U(D,t))}function C(t,e){t._state===et&&(t._state=ot,t._result=e,U(_,t))}function S(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+nt]=n,i[r+ot]=o,0===r&&t._state&&U(D,t)}function D(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.lengt
3574 h;s+=3)o=e[s],i=e[s+n],o?P(n,o,i,r):i(r);t._subscribers.length=0}}function x(){this.error=null}function E(t,e){try{return t(e)}catch(t){return rt.error=t,rt}}function P(t,e,n,o){var r=i(n),s=void 0,u=void 0,a=void 0,c=void 0;if(r){if(s=E(n,o),s===rt?(c=!0,u=s.error,s.error=null):a=!0,e===s)return void C(e,p())}else s=o,a=!0;e._state!==et||(r&&a?g(e,s):c?C(e,u):t===nt?k(e,s):t===ot&&C(e,s))}function T(t,e){try{e(function(e){g(t,e)},function(e){C(t,e)})}catch(e){C(t,e)}}function O(){return st++}function A(t){t[tt]=st++,t._state=void 0,t._result=void 0,t._subscribers=[]}function M(t,e){this._instanceConstructor=t,this.promise=new t(f),this.promise[tt]||A(this.promise),I(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?k(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&k(this.promise,this._result))):C(this.promise,q())}function q(){return new Error("Array Methods must be provi
3575 ded an Array")}function j(t){return new M(this,t).promise}function N(t){var e=this;return new e(I(t)?function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function L(t){var e=this,n=new e(f);return C(n,t),n}function H(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(t){this[tt]=O(),this._result=this._state=void 0,this._subscribers=[],f!==t&&("function"!=typeof t&&H(),this instanceof V?T(this,t):W())}function B(){var t=void 0;if(void 0!==o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype
3576 .toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=V}var F=void 0;F=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var I=F,Q=0,R=void 0,z=void 0,U=function(t,e){X[Q]=t,X[Q+1]=e,2===(Q+=2)&&(z?z(c):Z())},Y="undefined"!=typeof window?window:void 0,K=Y||{},G=K.MutationObserver||K.WebKitMutationObserver,$="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),J="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,X=new Array(1e3),Z=void 0;Z=$?function(){return function(){return e.nextTick(c)}}():G?function(){var t=0,e=new G(c),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}():J?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===Y?function(){try{var t=n(9);return R=t.runOnLoop||t.runOnContext,u()}catch(t){
3577 return a()}}():a();var tt=Math.random().toString(36).substring(16),et=void 0,nt=1,ot=2,it=new x,rt=new x,st=0;return M.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===et&&n<t;n++)this._eachEntry(e[n],n)},M.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===d){var i=m(t);if(i===l&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===V){var r=new n(f);w(r,t,i),this._willSettleAt(r,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(o(t),e)},M.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===et&&(this._remaining--,t===ot?C(o,n):this._result[e]=n),0===this._remaining&&k(o,this._result)},M.prototype._willSettleAt=function(t,e){var n=this;S(t,void 0,function(t){return n._settledAt(nt,e,t)},function(t){return n._settledAt(ot,e,t)})},V.all=j,V.race=N,V.resolve=d,V.reject=L,V._setScheduler=r,V.
3578 _setAsap=s,V._asap=U,V.prototype={constructor:V,then:l,catch:function(t){return this.then(null,t)}},V.polyfill=B,V.Promise=V,V})}).call(e,n(7),n(8))},function(t,e){},function(t,e,n){"use strict";function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();n(5);var s=n(4),u=function(t){return t&&t.__esModule?t:{default:t}}(s),a=n(0),c=o(a),l=n(1),d=o(l),f=n(2),h=n(3),p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(this,t),this.options=c.deepExtend({},d.Defaul
3579 ts,e),this.id=this.options.id||c.generateID("bar"),this.closeTimer=-1,this.barDom=null,this.layoutDom=null,this.progressDom=null,this.showing=!1,this.shown=!1,this.closed=!1,this.closing=!1,this.killable=this.options.timeout||this.options.closeWith.length>0,this.hasSound=this.options.sounds.sources.length>0,this.soundPlayed=!1,this.listeners={beforeShow:[],onShow:[],afterShow:[],onClose:[],afterClose:[],onClick:[],onHover:[],onTemplate:[]},this.promises={show:null,close:null},this.on("beforeShow",this.options.callbacks.beforeShow),this.on("onShow",this.options.callbacks.onShow),this.on("afterShow",this.options.callbacks.afterShow),this.on("onClose",this.options.callbacks.onClose),this.on("afterClose",this.options.callbacks.afterClose),this.on("onClick",this.options.callbacks.onClick),this.on("onHover",this.options.callbacks.onHover),this.on("onTemplate",this.options.callbacks.onTemplate),this}return r(t,[{key:"on",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arg
3580 uments[1]:function(){};return"function"==typeof e&&this.listeners.hasOwnProperty(t)&&this.listeners[t].push(e),this}},{key:"show",value:function(){var e=this;!0===this.options.killer?t.closeAll():"string"==typeof this.options.killer&&t.closeAll(this.options.killer);var n=d.getQueueCounts(this.options.queue);if(n.current>=n.maxVisible||d.PageHidden&&this.options.visibilityControl)return d.addToQueue(this),d.PageHidden&&this.hasSound&&c.inArray("docHidden",this.options.sounds.conditions)&&c.createAudioElements(this),d.PageHidden&&c.inArray("docHidden",this.options.titleCount.conditions)&&d.docTitle.increment(),this;if(d.Store[this.id]=this,d.fire(this,"beforeShow"),this.showing=!0,this.closing)return this.showing=!1,this;if(d.build(this),d.handleModal(this),this.options.force?this.layoutDom.insertBefore(this.barDom,this.layoutDom.firstChild):this.layoutDom.appendChild(this.barDom),this.hasSound&&!this.soundPlayed&&c.inArray("docVisible",this.options.sounds.conditions)&&c.createAudioEl
3581 ements(this),c.inArray("docVisible",this.options.titleCount.conditions)&&d.docTitle.increment(),this.shown=!0,this.closed=!1,d.hasButtons(this)&&Object.keys(this.options.buttons).forEach(function(t){var n=e.barDom.querySelector("#"+e.options.buttons[t].id);c.addListener(n,"click",function(n){c.stopPropagation(n),e.options.buttons[t].cb()})}),this.progressDom=this.barDom.querySelector(".noty_progressbar"),c.inArray("click",this.options.closeWith)&&(c.addClass(this.barDom,"noty_close_with_click"),c.addListener(this.barDom,"click",function(t){c.stopPropagation(t),d.fire(e,"onClick"),e.close()},!1)),c.addListener(this.barDom,"mouseenter",function(){d.fire(e,"onHover")},!1),this.options.timeout&&c.addClass(this.barDom,"noty_has_timeout"),this.options.progressBar&&c.addClass(this.barDom,"noty_has_progressbar"),c.inArray("button",this.options.closeWith)){c.addClass(this.barDom,"noty_close_with_button");var o=document.createElement("div");c.addClass(o,"noty_close_button"),o.innerHTML="×",t
3582 his.barDom.appendChild(o),c.addListener(o,"click",function(t){c.stopPropagation(t),e.close()},!1)}return d.fire(this,"onShow"),null===this.options.animation.open?this.promises.show=new u.default(function(t){t()}):"function"==typeof this.options.animation.open?this.promises.show=new u.default(this.options.animation.open.bind(this)):(c.addClass(this.barDom,this.options.animation.open),this.promises.show=new u.default(function(t){c.addListener(e.barDom,c.animationEndEvents,function(){c.removeClass(e.barDom,e.options.animation.open),t()})})),this.promises.show.then(function(){var t=e;setTimeout(function(){d.openFlow(t)},100)}),this}},{key:"stop",value:function(){return d.dequeueClose(this),this}},{key:"resume",value:function(){return d.queueClose(this),this}},{key:"setTimeout",value:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){if(this.stop(),this.options.timeout=t,this.barDom){this.options.timeout?c.addClass(th
3583 is.barDom,"noty_has_timeout"):c.removeClass(this.barDom,"noty_has_timeout");var e=this;setTimeout(function(){e.resume()},100)}return this})},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(this.barDom.querySelector(".noty_body").innerHTML=t),e&&(this.options.text=t),this}},{key:"setType",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.barDom){c.classList(this.barDom).split(" ").forEach(function(t){"noty_type__"===t.substring(0,11)&&c.removeClass(e.barDom,t)}),c.addClass(this.barDom,"noty_type__"+t)}return n&&(this.options.type=t),this}},{key:"setTheme",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.barDom){c.classList(this.barDom).split(" ").forEach(function(t){"noty_theme__"===t.substring(0,12)&&c.removeClass(e.barDom,t)}),c.addClass(this.barDom,"noty_theme__"+t)}return n&&(this.options.theme=t),this}},{key:"close",value:
3584 function(){var t=this;return this.closed?this:this.shown?(d.fire(this,"onClose"),this.closing=!0,null===this.options.animation.close?this.promises.close=new u.default(function(t){t()}):"function"==typeof this.options.animation.close?this.promises.close=new u.default(this.options.animation.close.bind(this)):(c.addClass(this.barDom,this.options.animation.close),this.promises.close=new u.default(function(e){c.addListener(t.barDom,c.animationEndEvents,function(){t.options.force?c.remove(t.barDom):d.ghostFix(t),e()})})),this.promises.close.then(function(){d.closeFlow(t),d.handleModalClose(t)}),this.closed=!0,this):(d.removeFromQueue(this),this)}}],[{key:"closeAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.keys(d.Store).forEach(function(e){t?d.Store[e].options.queue===t&&d.Store[e].killable&&d.Store[e].close():d.Store[e].killable&&d.Store[e].close()}),this}},{key:"overrideDefaults",value:function(t){return d.Defaults=c.deepExtend({},d.Def
3585 aults,t),this}},{key:"setMaxVisible",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d.DefaultMaxVisible,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global";return d.Queues.hasOwnProperty(e)||(d.Queues[e]={maxVisible:t,queue:[]}),d.Queues[e].maxVisible=t,this}},{key:"button",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new f.NotyButton(t,e,n,o)}},{key:"version",value:function(){return"3.1.3"}},{key:"Push",value:function(t){return new h.Push(t)}}]),t}();e.default=p,c.visibilityChangeFlow(),t.exports=e.default},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}
3586 catch(e){return l.call(this,t,0)}}}function r(t){if(d===clearTimeout)return clearTimeout(t);if((d===o||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function s(){m&&h&&(m=!1,h.length?p=h.concat(p):v=-1,p.length&&u())}function u(){if(!m){var t=i(s);m=!0;for(var e=p.length;e;){for(h=p,p=[];++v<e;)h&&h[v].run();v=-1,e=p.length}h=null,m=!1,r(t)}}function a(t,e){this.fun=t,this.array=e}function c(){}var l,d,f=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{d="function"==typeof clearTimeout?clearTimeout:o}catch(t){d=o}}();var h,p=[],m=!1,v=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new a(t,e)),1!==p.length||m||i(u)},a.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.
3587 on=c,f.addListener=c,f.once=c,f.off=c,f.removeListener=c,f.removeAllListeners=c,f.emit=c,f.prependListener=c,f.prependOnceListener=c,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){}])});
3588 +//# sourceMappingURL=noty.min.js.map
3589 \ No newline at end of file
3590
3591 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/notification-banner.js b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/notification-banner.js
3592 new file mode 100755
3593 index 0000000..1795eb8
3594 --- /dev/null
3595 +++ b/plugins/wordpress-mobile-pack/frontend/sections/notification-banner/notification-banner.js
3596 @@ -0,0 +1,112 @@
3597 +var WMPAppBanner = WMPAppBanner || {};
3598 +WMPAppBanner.message = WMPAppBanner.message || '';
3599 +WMPAppBanner.cookiePrefix = WMPAppBanner.cookiePrefix || 'wmp_';
3600 +WMPAppBanner.isSecure = WMPAppBanner.isSecure || false;
3601 +
3602 +(function() {
3603 + /**
3604 + * Create timer that will check if the document is ready
3605 + * @type {number}
3606 + */
3607 + var DOMLoadTimer = setInterval(function() {
3608 + if (/loading|loaded|complete/i.test(document.readyState)) {
3609 + clearInterval(DOMLoadTimer);
3610 + documentLoaded();
3611 + }
3612 + }, 10);
3613 +
3614 + /**
3615 + * Init method, called when the document is ready
3616 + *
3617 + * The 'redirect' GET param is used for hosted apps (on Appticles).
3618 + * Setting redirect=false will deactivate the app banner.
3619 + *
3620 + */
3621 + function documentLoaded() {
3622 + if (WMPAppBanner.message !== '' && WMPAppBanner.cookiePrefix !== '') {
3623 + var redirect = getCookie(WMPAppBanner.cookiePrefix + 'redirect'),
3624 + closed = getCookie(WMPAppBanner.cookiePrefix + 'closed');
3625 +
3626 + // if there is a cookie already set, then convert it to a boolean value
3627 + // redirect param is used for hosted apps (on Appticles)
3628 + redirect = redirect !== null ? Boolean(Number(String(redirect))) : true;
3629 +
3630 + var urlParams = window.location.href.split('?');
3631 +
3632 + // if the URL contains a redirect param, then set up a cookie with this value
3633 + if (urlParams.length > 1) {
3634 + if (urlParams[urlParams.length - 1].indexOf('redirect=false') != -1) {
3635 + setCookie(WMPAppBanner.cookiePrefix + 'redirect', 0, 7);
3636 + redirect = false;
3637 + } else if (
3638 + urlParams[urlParams.length - 1].indexOf('redirect=true') != -1
3639 + ) {
3640 + setCookie(WMPAppBanner.cookiePrefix + 'redirect', 1, 7);
3641 + redirect = true;
3642 + }
3643 + }
3644 +
3645 + // create the wrapper bar
3646 + if (redirect && !closed) {
3647 + createBar();
3648 + }
3649 + }
3650 + }
3651 +
3652 + /**
3653 + * Display the notification / app banner.
3654 + */
3655 + function createBar() {
3656 + new Noty({
3657 + text: WMPAppBanner.message,
3658 + layout: 'topCenter',
3659 + theme: 'relax',
3660 + closeWith: ['button'],
3661 + callbacks: {
3662 + onClose: function() {
3663 + setCookie(WMPAppBanner.cookiePrefix + 'closed', 1, 15);
3664 + }
3665 + }
3666 + }).show();
3667 + }
3668 +
3669 + /**
3670 + * Search a cookie by name in document cookies.
3671 + * @param {String} c_name
3672 + */
3673 + function getCookie(c_name) {
3674 + var i,
3675 + x,
3676 + y,
3677 + ARRcookies = document.cookie.split(';');
3678 + for (i = 0; i < ARRcookies.length; i++) {
3679 + x = ARRcookies[i].substr(0, ARRcookies[i].indexOf('='));
3680 + y = ARRcookies[i].substr(ARRcookies[i].indexOf('=') + 1);
3681 + x = x.replace(/^\s+|\s+$/g, '');
3682 + if (x == c_name) {
3683 + return decodeURIComponent(y);
3684 + }
3685 + }
3686 +
3687 + return null;
3688 + }
3689 +
3690 + /**
3691 + * Set a cookie value
3692 + * @param {String} c_name
3693 + * @param {String, Number of Boolean} value
3694 + * @param {Number} expireDays
3695 + */
3696 + function setCookie(c_name, value, expireDays) {
3697 + var expireDate = new Date();
3698 + expireDate.setDate(expireDate.getDate() + expireDays);
3699 +
3700 + var c_value =
3701 + encodeURIComponent(value) +
3702 + (expireDays == null ? '' : '; expires=' + expireDate.toUTCString()) +
3703 + '; path=/; ' +
3704 + (WMPAppBanner.isSecure === true ? 'secure' : '');
3705 +
3706 + document.cookie = c_name + '=' + c_value;
3707 + }
3708 +})();
3709
3710 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner-premium.php b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner-premium.php
3711 index 24aa903..9f74afc 100755
3712 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner-premium.php
3713 +++ b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner-premium.php
3714 @@ -2,7 +2,11 @@
3715
3716 if (class_exists('WMobilePack')):
3717
3718 - $smart_app_banner = false;
3719 + $smart_app_banner = false;
3720 + $app_name = null;
3721 + $icon_path = '';
3722 +
3723 + $is_secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
3724
3725 // Load config json
3726 if (WMobilePack_Options::get_setting('premium_active') == 1 && WMobilePack_Options::get_setting('premium_api_key') != '') {
3727 @@ -14,17 +18,32 @@ if (class_exists('WMobilePack')):
3728
3729 // Check if we have a valid subdomain linked to the Premium theme
3730 if (isset($arr_config_premium['domain_name']) && filter_var('http://' . $arr_config_premium['domain_name'], FILTER_VALIDATE_URL) &&
3731 - isset($arr_config_premium['smart_app_banner']) && filter_var('http://' . $arr_config_premium['smart_app_banner'], FILTER_VALIDATE_URL)) {
3732 + isset($arr_config_premium['smart_app_banner']) && filter_var('http://' . $arr_config_premium['smart_app_banner'], FILTER_VALIDATE_URL) &&
3733 + isset($arr_config_premium['cdn_apps_https']) && filter_var($arr_config_premium['cdn_apps_https'],FILTER_VALIDATE_URL) &&
3734 + isset($arr_config_premium['cdn_apps']) && filter_var($arr_config_premium['cdn_apps'],FILTER_VALIDATE_URL) &&
3735 + isset($arr_config_premium['shorten_url']) && ctype_alnum($arr_config_premium['shorten_url']) &&
3736 + (!isset($arr_config_premium['icon_path']) || $arr_config_premium['icon_path'] == '' || $arr_config_premium['icon_path'] == strip_tags($arr_config_premium['icon_path']))) {
3737
3738 $mobile_url = "http://" . $arr_config_premium['domain_name'];
3739 - $smart_app_banner = $arr_config_premium['smart_app_banner'];
3740 + $smart_app_banner = $arr_config_premium['smart_app_banner'];
3741 +
3742 + $app_name = $arr_config_premium['title'];
3743 +
3744 + if (isset($arr_config_premium['kit_type']) && $arr_config_premium['kit_type'] == 'wpmp') {
3745 + $app_name = htmlspecialchars_decode(urldecode(strip_tags($app_name)));
3746 + }
3747 +
3748 + $cdn_apps = ($is_secure ? $arr_config_premium['cdn_apps_https'] : $arr_config_premium['cdn_apps']);
3749 +
3750 + if (isset($arr_config_premium['icon_path']) && $arr_config_premium['icon_path'] != '') {
3751 + $icon_path = $cdn_apps."/".$arr_config_premium['shorten_url'].'/'.$arr_config_premium['icon_path'];
3752 + }
3753 }
3754 }
3755 }
3756
3757 // Smart app banner is loaded only for apps with subdomains & smart app banners
3758 - // @todo (Future releases) Load smart app banner for apps without subdomains
3759 - if ($smart_app_banner !== false):
3760 + if ($smart_app_banner !== false && $app_name !== null):
3761
3762 if (is_single() || is_page() || is_category()){
3763
3764 @@ -77,23 +96,32 @@ if (class_exists('WMobilePack')):
3765 }
3766 }
3767 }
3768 - }
3769 + }
3770 +
3771 + $app_url = $mobile_url;
3772 + if (strlen($app_url) > 30) {
3773 + $app_url = substr($app_url, 0, 30).' ... ';
3774 + }
3775 ?>
3776 + <link href="<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/notification-banner/lib/noty.css" rel="stylesheet">
3777 + <script src="<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/notification-banner/lib/noty.min.js" type="text/javascript" pagespeed_no_defer=""></script>
3778 + <script src="<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/notification-banner/notification-banner.js" type="text/javascript" pagespeed_no_defer=""></script>
3779 +
3780 <script type="text/javascript" pagespeed_no_defer="">
3781 - var appticlesRedirectToMobile = "<?php echo $mobile_url;?>";
3782 -
3783 - var wmpAppBanner = wmpAppBanner || {};
3784 - wmpAppBanner.WIDGET = wmpAppBanner.WIDGET || {};
3785 - wmpAppBanner.WIDGET.ref = '<?php echo $mobile_url;?>';
3786 -
3787 - (function() {
3788 - var wbz = document.createElement('script');
3789 - wbz.type = 'text/javascript';
3790 - wbz.async = true;
3791 - wbz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + '<?php echo $smart_app_banner;?>';
3792 - var s = document.getElementsByTagName('script')[0];
3793 - s.parentNode.insertBefore(wbz, s); })();
3794 - </script>
3795 + jQuery(document).ready(function(){
3796 +
3797 + const wmpIconPath = "<?php echo $icon_path;?>";
3798 +
3799 + WMPAppBanner.message =
3800 + (wmpIconPath !== '' ? '<img src="<?php echo $icon_path;?>" />' : '') +
3801 + '<p><?php echo $app_name;?><br/> ' +
3802 + '<span><?php echo $app_url;?></span></p>' +
3803 + '<a href="<?php echo $mobile_url;?>"><span>OPEN</span></a>';
3804 +
3805 + WMPAppBanner.cookiePrefix = "<?php echo WMobilePack_Cookie::$prefix;?>";
3806 + WMPAppBanner.isSecure = <?php echo $is_secure ? "true" : "false";?>;
3807 + });
3808 + </script>
3809 <?php
3810 endif;
3811 endif;
3812
3813 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner.php b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner.php
3814 index 3fb7d6f..1c48518 100755
3815 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner.php
3816 +++ b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner.php
3817 @@ -1,6 +1,5 @@
3818 <?php
3819
3820 -// @todo (Future releases) Find a more efficient way to feed params to the banner script
3821 if (class_exists('WMobilePack')):
3822
3823 // The mobile web app paths will be set relative to the home url and will deactivate the desktop theme
3824 @@ -92,31 +91,38 @@ if (class_exists('WMobilePack')):
3825 $open_btn_text = 'Open';
3826 if ($wmp_texts_json !== false && isset($wmp_texts_json['APP_TEXTS']['LINKS']) && isset($wmp_texts_json['APP_TEXTS']['LINKS']['OPEN_APP'])) {
3827 $open_btn_text = $wmp_texts_json['APP_TEXTS']['LINKS']['OPEN_APP'];
3828 - }
3829 + }
3830 +
3831 + $app_name = get_bloginfo("name");
3832 + if (strlen($app_name) > 20) {
3833 + $app_name = substr($app_name, 0, 20).' ... ';
3834 + }
3835
3836 + $app_url = home_url();
3837 + if (strlen($app_url) > 20) {
3838 + $app_url = substr($app_url, 0, 20).' ... ';
3839 + }
3840 +
3841 + $is_secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
3842 ?>
3843 +
3844 + <link href="<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/notification-banner/lib/noty.css" rel="stylesheet">
3845 + <script src="<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/notification-banner/lib/noty.min.js" type="text/javascript" pagespeed_no_defer=""></script>
3846 + <script src="<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/notification-banner/notification-banner.js" type="text/javascript" pagespeed_no_defer=""></script>
3847 +
3848 <script type="text/javascript" pagespeed_no_defer="">
3849 + jQuery(document).ready(function(){
3850 +
3851 + const wmpIconPath = "<?php echo esc_attr($app_icon_path);?>";
3852 +
3853 + WMPAppBanner.message =
3854 + (wmpIconPath !== '' ? '<img src="<?php echo esc_attr($app_icon_path);?>" />' : '') +
3855 + '<p><?php echo $app_name;?><br/> ' +
3856 + '<span><?php echo $app_url;?></span></p>' +
3857 + '<a href="<?php echo $mobile_url;?>"><span><?php echo $open_btn_text;?></span></a>';
3858
3859 - var wmpAppBanner = wmpAppBanner || {};
3860 - wmpAppBanner.WIDGET = wmpAppBanner.WIDGET || {};
3861 - wmpAppBanner.WIDGET.appUrl = '<?php echo home_url();?>';
3862 - wmpAppBanner.WIDGET.appIcon = '<?php echo $app_icon_path;?>';
3863 - wmpAppBanner.WIDGET.appName = '<?php echo get_bloginfo("name");?>';
3864 - wmpAppBanner.WIDGET.ref = '<?php echo $mobile_url;?>';
3865 - wmpAppBanner.WIDGET.trustedDevice = 1;
3866 - wmpAppBanner.WIDGET.iframeUrl = '<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/smart-app-banner/iframe/bar.html';
3867 - wmpAppBanner.WIDGET.cssPath = '<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/smart-app-banner/css/style-light.min.css';
3868 - wmpAppBanner.WIDGET.openAppButton = '<?php echo $open_btn_text;?>';
3869 - wmpAppBanner.WIDGET.cookiePrefix = '<?php echo WMobilePack_Cookie::$prefix;?>';
3870 -
3871 - (function () {
3872 - var wmp = document.createElement('script');
3873 - wmp.async = true;
3874 - wmp.type = 'text/javascript';
3875 - wmp.src = '<?php echo plugins_url()."/".WMP_DOMAIN;?>/frontend/sections/smart-app-banner/js/smart-app-banner.min.js';
3876 - var node = document.getElementsByTagName('script')[0];
3877 - node.parentNode.insertBefore(wmp, node);
3878 - })();
3879 -
3880 - </script>
3881 + WMPAppBanner.cookiePrefix = "<?php echo WMobilePack_Cookie::$prefix;?>";
3882 + WMPAppBanner.isSecure = <?php echo $is_secure ? "true" : "false";?>;
3883 + });
3884 + </script>
3885 <?php endif; ?>
3886
3887 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/style-light.css b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/style-light.css
3888 deleted file mode 100755
3889 index cc823ef..0000000
3890 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/style-light.css
3891 +++ /dev/null
3892 @@ -1,118 +0,0 @@
3893 -/* wrapper */
3894 -html, body, *{
3895 - padding: 0;
3896 - margin: 0;
3897 - border: 0;
3898 - box-sizing: border-box;
3899 - font-size: 100%;
3900 - font: inherit;
3901 - -webkit-font-smoothing: antialiased;
3902 -}
3903 -
3904 -app-bar {
3905 - position:relative;
3906 - width: 100%;
3907 - height: 100%;
3908 - overflow: hidden;
3909 - border-bottom: 1px solid #a4a4a4;
3910 - background-color:#f2f2f2;
3911 - box-shadow: 0px 0px 7px rgba(164, 164, 164, 0.7);
3912 -
3913 - display: flex;
3914 - display: -webkit-box;
3915 - display: -ms-flexbox;
3916 -
3917 - -webkit-box-orient: horizontal;
3918 - -ms-flex-direction: row;
3919 - flex-direction: row;
3920 - -webkit-box-pack: justify;
3921 - -ms-flex-pack: justify;
3922 - justify-content: flex-between;
3923 - -webkit-box-align: center;
3924 - -ms-flex-align: center;
3925 - align-items: center;
3926 -}
3927 -
3928 -app-bar * {
3929 - display: flex;
3930 - display: -webkit-box;
3931 - display: -ms-flexbox;
3932 -}
3933 -
3934 -
3935 -/* close container */
3936 -app-bar app-box.close{
3937 - display:block;
3938 - text-align:center;
3939 -}
3940 -app-bar app-box.close app-text{
3941 - display: block;
3942 - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
3943 - color:#797979;
3944 -}
3945 -
3946 -
3947 -/* icon container */
3948 -app-bar app-box.icon{
3949 - display: block;
3950 - -webkit-border-radius: 20%;
3951 - -moz-border-radius: 20%;
3952 - border-radius: 20%;
3953 - overflow: hidden;
3954 - padding:1px;
3955 -}
3956 -app-bar app-box.icon app-icon{
3957 - display: block;
3958 - width:100%;
3959 - height:100%;
3960 - background-position: center;
3961 - background-repeat: no-repeat;
3962 - background-size: cover;
3963 - -webkit-border-radius: 20%;
3964 - -moz-border-radius: 20%;
3965 - border-radius: 20%;
3966 - border:1px solid #c9c7c6;
3967 -}
3968 -
3969 -
3970 -/* info container */
3971 -app-bar app-info{
3972 - -webkit-box-flex: 1;
3973 - -ms-flex: 1 0 auto;
3974 - -moz-box-flex: 1;
3975 - box-flex: 1;
3976 - flex: 1 0 auto;
3977 -
3978 - overflow: hidden;
3979 -
3980 - -webkit-box-orient: vertical;
3981 - -ms-flex-direction: column;
3982 - flex-direction: column;
3983 - -webkit-box-pack: center;
3984 - -ms-flex-pack: center;
3985 - justify-content: center;
3986 - -webkit-box-align: stretch;
3987 - -ms-flex-align: stretch;
3988 - align-items: stretch;
3989 -}
3990 -app-bar app-info app-title{
3991 - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
3992 - color: #000000;
3993 -}
3994 -app-bar app-info app-link{
3995 - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
3996 - color: #373737;
3997 -}
3998 -
3999 -
4000 -/* open container */
4001 -app-bar app-box.open{
4002 - display: block;
4003 - text-align:center;
4004 -}
4005 -app-bar app-box.open app-text{
4006 - display: block;
4007 - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
4008 - color: #007aff;
4009 -}
4010 -
4011
4012 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/style-light.min.css b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/style-light.min.css
4013 deleted file mode 100755
4014 index be01cc9..0000000
4015 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/css/style-light.min.css
4016 +++ /dev/null
4017 @@ -1 +0,0 @@
4018 -html,body,*{padding:0;margin:0;border:0;box-sizing:border-box;font-size:100%;font:inherit;-webkit-font-smoothing:antialiased}app-bar{position:relative;width:100%;height:100%;overflow:hidden;border-bottom:1px solid #a4a4a4;background-color:#f2f2f2;box-shadow:0 0 7px rgba(164,164,164,0.7);display:flex;display:-webkit-box;display:-ms-flexbox;-webkit-box-orient:horizontal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:flex-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}app-bar *{display:flex;display:-webkit-box;display:-ms-flexbox}app-bar app-box.close{display:block;text-align:center}app-bar app-box.close app-text{display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#797979}app-bar app-box.icon{display:block;-webkit-border-radius:20%;-moz-border-radius:20%;border-radius:20%;overflow:hidden;padding:1px}app-bar app-box.icon app-icon{display:block;width:100%;height:100%;background-po
4019 sition:center;background-repeat:no-repeat;background-size:cover;-webkit-border-radius:20%;-moz-border-radius:20%;border-radius:20%;border:1px solid #c9c7c6}app-bar app-info{-webkit-box-flex:1;-ms-flex:1 0 auto;-moz-box-flex:1;box-flex:1;flex:1 0 auto;overflow:hidden;-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}app-bar app-info app-title{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#000}app-bar app-info app-link{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#373737}app-bar app-box.open{display:block;text-align:center}app-bar app-box.open app-text{display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#007aff}
4020 \ No newline at end of file
4021
4022 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/iframe/bar.html b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/iframe/bar.html
4023 deleted file mode 100755
4024 index aafdff8..0000000
4025 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/iframe/bar.html
4026 +++ /dev/null
4027 @@ -1,222 +0,0 @@
4028 -<!DOCTYPE HTML>
4029 -<html>
4030 -<head>
4031 - <meta charset="UTF-8">
4032 - <meta name="viewport">
4033 - <title></title>
4034 -
4035 - <script type="text/javascript">
4036 -
4037 - (function() {
4038 -
4039 - var appName, appUrl, appIcon, cssPath, originUrl, height;
4040 - var appBar,
4041 - closeBtnBox,
4042 - closeBtn,
4043 - iconBox,
4044 - appInfo,
4045 - appTitle,
4046 - appLink,
4047 - openBtnBox,
4048 - openBtn,
4049 - openText;
4050 -
4051 -
4052 - var DOMLoadTimer = setInterval(function () {
4053 - if (/loading|loaded|complete/i.test(document.readyState)) {
4054 - clearInterval(DOMLoadTimer);
4055 - documentLoaded();
4056 - }
4057 - }, 10);
4058 -
4059 - function documentLoaded() {
4060 - parseParams();
4061 - loadCssStyle();
4062 - initializeBar();
4063 - resizeElements();
4064 - translate("-100%");
4065 - document.body.style.display = "block";
4066 -
4067 - window.onhashchange = onHashChange;
4068 -
4069 - // show the bar
4070 - setTimeout(function(){
4071 - show();
4072 - }, 300);
4073 - }
4074 -
4075 - function parseParams(){
4076 - var hash = window.location.hash.split("#")[1];
4077 -
4078 - var params = hash.split("&");
4079 - for (var i=0; i<params.length; i++){
4080 - var item = params[i].split("=");
4081 - var prop = item[0];
4082 - var value = item[1];
4083 -
4084 - switch (prop){
4085 - case "appName": appName = value; break;
4086 - case "appUrl": appUrl = value; break;
4087 - case "appIcon": appIcon = value; break;
4088 - case "cssPath": cssPath = value; break;
4089 - case "originUrl": originUrl = decodeURIComponent(value); break;
4090 - case "height": height = value; break;
4091 - case "openText": openText = decodeURIComponent(value); break;
4092 - default: break;
4093 - }
4094 - }
4095 - }
4096 -
4097 - function loadCssStyle(){
4098 - var _dc = (new Date()).getTime();
4099 - var css = document.createElement("link");
4100 - css.type = 'text/css';
4101 - css.rel = 'stylesheet';
4102 - css.href = cssPath+'?_dc='+_dc;
4103 - css.async = true;
4104 - (document.head || document.getElementsByTagName('head')[0]).appendChild(css);
4105 - }
4106 -
4107 - function initializeBar(){
4108 -
4109 - appBar = document.querySelector("app-bar");
4110 - closeBtnBox = document.querySelector("app-box.close");
4111 - closeBtn = document.querySelector("app-box.close app-text");
4112 - iconBox = document.querySelector("app-box.icon");
4113 - appInfo = document.querySelector("app-info");
4114 - appTitle = document.querySelector("app-info app-title");
4115 - appLink = document.querySelector("app-info app-link");
4116 - openBtnBox = document.querySelector("app-box.open");
4117 - openBtn = document.querySelector("app-box.open app-text");
4118 -
4119 - // hide icon container if the app doesn't have an icon
4120 - if (appIcon && appIcon.length > 0) {
4121 - var icon = document.querySelector("app-box.icon app-icon");
4122 - icon.style.backgroundImage = "url('" + appIcon + "')";
4123 - } else {
4124 - iconBox.style.display = 'none';
4125 - }
4126 -
4127 - appTitle.innerHTML = decodeURIComponent(appName);
4128 - appLink.innerHTML = decodeURIComponent(appUrl);
4129 -
4130 - // set bar height
4131 - appBar.style.height = height + "px";
4132 -
4133 - // set open button text
4134 - openBtn.innerHTML = openText;
4135 -
4136 - // add events
4137 - closeBtnBox.addEventListener("click", function(){hide();}, false);
4138 - iconBox.addEventListener("click", function(){openApp();}, false);
4139 - appInfo.addEventListener("click", function(){openApp();}, false);
4140 - openBtnBox.addEventListener("click", function(){openApp();}, false);
4141 - }
4142 -
4143 -
4144 - function resizeElements(){
4145 -
4146 - // set bar height
4147 - appBar.style.height = height + "px";
4148 -
4149 - // resize close btn box
4150 - closeBtnBox.style.width = Math.round(0.35*height) + "px";
4151 -
4152 - // resize close btn font size
4153 - closeBtn.style.fontSize = Math.round(0.22*height) + "px";
4154 -
4155 - // resize icon box
4156 - iconBox.style.width = Math.round(0.70*height) + "px";
4157 - iconBox.style.height = Math.round(0.70*height) + "px";
4158 -
4159 - // resize app title font size
4160 - appTitle.style.fontSize = Math.round(0.18*height) + "px";
4161 -
4162 - // resize app link font size
4163 - appLink.style.fontSize = Math.round(0.13*height) + "px";
4164 -
4165 - // resize app info padding left
4166 - appInfo.style.paddingLeft = Math.round(0.1*height) + "px";
4167 -
4168 - // resize open btn box
4169 - openBtnBox.style.width = Math.round(0.7*height) + "px";
4170 -
4171 - // resize open btn font size
4172 - openBtn.style.fontSize = Math.round(0.14*height) + "px";
4173 -
4174 - // resize bar box shadow
4175 - var shadow = Math.round(height * 0.1);
4176 - appBar.style.boxShadow = "0px 0px "+shadow+"px rgba(164, 164, 164, 0.7)";
4177 - }
4178 -
4179 -
4180 - function onHashChange(){
4181 - parseParams();
4182 - resizeElements();
4183 - }
4184 -
4185 -
4186 - function translate(translateValue, time){
4187 - time = time || 0;
4188 -
4189 - var style = {
4190 - '-webkit-transition': 'all '+time+'s ease',
4191 - '-moz-transition': 'all '+time+'s ease',
4192 - '-o-transition': 'all '+time+'s ease',
4193 - 'transition': 'all '+time+'s ease',
4194 - '-webkit-transform': 'translate3d(0px, ' + translateValue + ', 0px)',
4195 - '-moz-transform': 'translate3d(0px, ' + translateValue + ', 0px)',
4196 - '-ms-transform': 'translate3d(0px, ' + translateValue + ', 0px)',
4197 - '-o-transform': 'translate3d(0px, ' + translateValue + ', 0px)',
4198 - 'transform': 'translate3d(0px, ' + translateValue + ', 0px)'
4199 - };
4200 -
4201 - appBar = document.querySelector("app-bar");
4202 -
4203 - for (var prop in style){
4204 - appBar.style[prop] = style[prop];
4205 - }
4206 - }
4207 -
4208 -
4209 - function show(){
4210 - translate("0%", 0.3);
4211 - }
4212 -
4213 - function hide(){
4214 - translate("-105%", 0.3);
4215 -
4216 - // change opener window hash
4217 - var origin = originUrl.split("#")[0];
4218 - window.parent.location = origin + "#app_action=closebar";
4219 - }
4220 -
4221 - function openApp(){
4222 - // change opener window hash
4223 - var origin = originUrl.split("#")[0];
4224 - window.parent.location = origin + "#app_action=openapp";
4225 - }
4226 -
4227 - }());
4228 -
4229 - </script>
4230 -
4231 -</head>
4232 -
4233 -<body style="display:none">
4234 -<app-bar>
4235 - <app-box class="close"><app-text>x</app-text></app-box>
4236 -
4237 - <app-box class="icon">
4238 - <app-icon style=""></app-icon>
4239 - </app-box>
4240 -
4241 - <app-info>
4242 - <app-title></app-title>
4243 - <app-link></app-link>
4244 - </app-info>
4245 -
4246 - <app-box class="open"><app-text></app-text></app-box>
4247 -</app-bar>
4248 -</body>
4249 -</html>
4250 \ No newline at end of file
4251
4252 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Bar.js b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Bar.js
4253 deleted file mode 100755
4254 index f7e0123..0000000
4255 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Bar.js
4256 +++ /dev/null
4257 @@ -1,223 +0,0 @@
4258 -wmpAppBanner = wmpAppBanner || {};
4259 -
4260 -(function () {
4261 -
4262 - /**
4263 - * @class Bar
4264 - * @constructor
4265 - */
4266 - var Bar = function (options) {
4267 - this.initialize(options);
4268 - };
4269 -
4270 - var p = Bar.prototype;
4271 -
4272 - /**
4273 - * Public properties
4274 - */
4275 -
4276 - /**
4277 - * The DOM object to manage.
4278 - * @property htmlElement
4279 - * @type HTMLElement
4280 - */
4281 - p.htmlElement = null;
4282 - p.iframe = null;
4283 - p.iframeUrl = null;
4284 -
4285 - /**
4286 - * Initialization method.
4287 - * @method initialize
4288 - */
4289 - p.initialize = function (options) {
4290 -
4291 - var me = this;
4292 - this.createWrapper(options);
4293 -
4294 - // add orientation change event
4295 - if ('onorientationchange' in window) {
4296 -
4297 - // orientation change event functions
4298 - this.orientationchangeFn = function () {
4299 - setTimeout(function () {
4300 - me.resize();
4301 - }, 250);
4302 - };
4303 - window.addEventListener("orientationchange", this.orientationchangeFn, false);
4304 - }
4305 - else {
4306 - var mqOrientation = window.matchMedia("(orientation: portrait)");
4307 -
4308 - // The Listener will fire whenever this either matches or ceases to match
4309 - mqOrientation.addListener(function (media) {
4310 - // portrait
4311 - if (media.matches) {
4312 - me.resize("portrait");
4313 - }
4314 - else {
4315 - me.resize("landscape");
4316 - }
4317 - }, false);
4318 - }
4319 -
4320 - // add zoom event
4321 - this.touchendFn = function () {
4322 - clearTimeout(window.resizeEvt);
4323 - window.resizeEvt = setTimeout(function () {
4324 - //alert("resize");
4325 - me.resize();
4326 - }, 300);
4327 - };
4328 -
4329 - window.resizeEvt;
4330 - window.addEventListener("touchleave", this.touchendFn, false);
4331 - window.addEventListener("touchcancel", this.touchendFn, false);
4332 - window.addEventListener("touchmove", this.touchendFn, false);
4333 - window.addEventListener("touchend", this.touchendFn, false);
4334 - };
4335 -
4336 -
4337 - /**
4338 - * Create wrapper (public method)
4339 - * @param options
4340 - */
4341 - p.createWrapper = function (options) {
4342 - var wrapper = document.createElement("appticles-wrapper");
4343 - this.htmlElement = wrapper;
4344 - var height = Math.round(this.getHeight());
4345 - var shadow = Math.round(0.1 * height);
4346 -
4347 - wrapper.style.position = "fixed";
4348 - wrapper.style.width = "100%";
4349 - wrapper.style.height = "0px";
4350 - wrapper.style.top = "0px";
4351 - wrapper.style.left = "0px";
4352 - wrapper.style.boxSizing = "border-box";
4353 - wrapper.style.zIndex = 1000000;
4354 - wrapper.style.display = "block";
4355 - wrapper.style.height = (height + shadow) + "px";
4356 -
4357 - document.body.appendChild(wrapper);
4358 -
4359 - var appName = options.appName || "";
4360 - var appUrl = options.appUrl || "";
4361 - var appIcon = options.appIcon || "";
4362 - var cssPath = options.cssPath || "";
4363 - var iframeUrl = this.iframeUrl = options.iframeUrl || "";
4364 - var originUrl = window.location.href;
4365 - var openAppButton = options.openAppButton || "";
4366 -
4367 - var _dc = (new Date()).getTime();
4368 - var params = "cssPath=" + cssPath + "?_dc" + _dc;
4369 - params += "&amp;height=" + height;
4370 - params += "&amp;appName=" + encodeURIComponent(appName);
4371 - params += "&amp;appUrl=" + encodeURIComponent(appUrl);
4372 - params += "&amp;appIcon=" + appIcon;
4373 - params += "&amp;originUrl=" + encodeURIComponent(originUrl);
4374 - params += "&amp;openText=" + encodeURIComponent(openAppButton);
4375 -
4376 - var html = [
4377 - '<iframe id="appticles-iframe-bar" width="100%" height="' + (height + shadow) + 'px" src="' + iframeUrl + '#' + params + '" frameborder="0" allowtransparency="true" scrolling="no" style="position:relative;"></iframe>'
4378 - ].join("");
4379 -
4380 - wrapper.innerHTML = html;
4381 -
4382 - this.iframe = document.getElementById("appticles-iframe-bar");
4383 - };
4384 -
4385 -
4386 - /**
4387 - * Resize banner (public method)
4388 - *
4389 - * @param orientation
4390 - */
4391 - p.resize = function (orientation) {
4392 -
4393 - var wrapper = this.htmlElement;
4394 - if (wrapper == null) return;
4395 -
4396 - // compute new wrapper height
4397 - var newH = Math.round(this.getHeight());
4398 - var shadow = Math.round(0.1 * newH);
4399 - wrapper.style.height = (newH + shadow) + "px";
4400 -
4401 - // change iframe params
4402 - var params = "height=" + newH;
4403 - this.iframe.style.height = (newH + shadow) + "px";
4404 - this.iframe.src = this.iframeUrl + '#' + params;
4405 - };
4406 -
4407 -
4408 - /**
4409 - * Get height (public method)
4410 - *
4411 - * @param orientation
4412 - * @returns {number}
4413 - */
4414 - p.getHeight = function (orientation) {
4415 -
4416 - orientation = orientation || this.getOrientation();
4417 -
4418 - var screenWidth, screenHeight, windowWidth, newH;
4419 -
4420 - // resize wrapper
4421 - if (orientation == "portrait") {
4422 - screenWidth = Math.min(screen.width, screen.height);
4423 - screenHeight = Math.max(screen.width, screen.height);
4424 - windowWidth = window.innerWidth;
4425 - newH = 90 * (windowWidth / screenWidth);
4426 -
4427 - return newH;
4428 - }
4429 - else if (orientation == "landscape") {
4430 - screenWidth = Math.max(screen.width, screen.height);
4431 - screenHeight = Math.min(screen.width, screen.height);
4432 - windowWidth = window.innerWidth;
4433 - newH = (90 * (windowWidth / screenHeight)) * (screenHeight / screenWidth);
4434 -
4435 - return newH;
4436 - }
4437 - };
4438 -
4439 - /**
4440 - * Destroy bar (public method)
4441 - */
4442 - p.destroy = function () {
4443 -
4444 - // remove the bar from HTML
4445 - var wrapper = this.htmlElement;
4446 - wrapper.parentNode.removeChild(wrapper);
4447 - this.htmlElement = null;
4448 -
4449 - // remove orientation change event
4450 - if ('onorientationchange' in window) {
4451 - window.removeEventListener("orientationchange", this.orientationchangeFn);
4452 - }
4453 -
4454 - // remove touch end event
4455 - window.removeEventListener("touchleave", this.touchendFn);
4456 - window.removeEventListener("touchcancel", this.touchendFn);
4457 - window.removeEventListener("touchmove", this.touchendFn);
4458 - window.removeEventListener("touchend", this.touchendFn);
4459 -
4460 - window[this] = null;
4461 - delete this;
4462 - };
4463 -
4464 -
4465 - /**
4466 - * Get device orientation
4467 - *
4468 - * @return string (portrait | landscape)
4469 - */
4470 - p.getOrientation = function () {
4471 - if (window.matchMedia("(orientation: portrait)").matches) {
4472 - return "portrait";
4473 - }
4474 - else if (window.matchMedia("(orientation: landscape)").matches) {
4475 - return "landscape";
4476 - }
4477 - };
4478 -
4479 - wmpAppBanner.Bar = Bar;
4480 -}());
4481 \ No newline at end of file
4482
4483 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Cookie.js b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Cookie.js
4484 deleted file mode 100755
4485 index 33ffa3c..0000000
4486 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Cookie.js
4487 +++ /dev/null
4488 @@ -1,60 +0,0 @@
4489 -wmpAppBanner = wmpAppBanner || {};
4490 -
4491 -(function () {
4492 -
4493 - /**
4494 - * @class Cookie
4495 - * @constructor
4496 - */
4497 - var Cookie = function () {
4498 - this.initialize();
4499 - };
4500 -
4501 - var p = Cookie.prototype;
4502 -
4503 - /**
4504 - *
4505 - * Initialization method.
4506 - * @method initialize
4507 - */
4508 - p.initialize = function () {
4509 -
4510 - };
4511 -
4512 - /**
4513 - * Get cookie (public method)
4514 - *
4515 - * @param c_name
4516 - * @returns {string}
4517 - */
4518 - p.get = function (c_name) {
4519 -
4520 - var i, x, y, ARRcookies = document.cookie.split(";");
4521 - for (i = 0; i < ARRcookies.length; i++) {
4522 - x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
4523 - y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
4524 - x = x.replace(/^\s+|\s+$/g, "");
4525 - if (x == c_name) {
4526 - return decodeURIComponent(y);
4527 - }
4528 - }
4529 - };
4530 -
4531 - /**
4532 - * Set cookie (public method)
4533 - *
4534 - * @param c_name
4535 - * @param value
4536 - * @param expireDays
4537 - */
4538 - p.set = function (c_name, value, expireDays) {
4539 - var expireDate = new Date();
4540 - expireDate.setDate(expireDate.getDate() + expireDays);
4541 -
4542 - var c_value = encodeURIComponent(value) + ((expireDays == null) ? "" : "; expires=" + expireDate.toUTCString()) + "; path=/;";
4543 - document.cookie = c_name + "=" + c_value;
4544 - };
4545 -
4546 - wmpAppBanner.Cookie = Cookie;
4547 - }()
4548 -);
4549 \ No newline at end of file
4550
4551 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Main.js b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Main.js
4552 deleted file mode 100755
4553 index 888dd67..0000000
4554 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Main.js
4555 +++ /dev/null
4556 @@ -1,136 +0,0 @@
4557 -var wmpAppBanner = wmpAppBanner || {};
4558 -wmpAppBanner.WIDGET = wmpAppBanner.WIDGET || {};
4559 -
4560 -wmpAppBanner.WIDGET.appUrl = wmpAppBanner.WIDGET.appUrl || '';
4561 -wmpAppBanner.WIDGET.appIcon = wmpAppBanner.WIDGET.appIcon || '';
4562 -wmpAppBanner.WIDGET.appName = wmpAppBanner.WIDGET.appName || '';
4563 -wmpAppBanner.WIDGET.ref = wmpAppBanner.WIDGET.ref || '';
4564 -wmpAppBanner.WIDGET.trustedDevice = wmpAppBanner.WIDGET.trustedDevice || 0;
4565 -wmpAppBanner.WIDGET.iframeUrl = wmpAppBanner.WIDGET.iframeUrl || '';
4566 -wmpAppBanner.WIDGET.cssPath = wmpAppBanner.WIDGET.cssPath || '';
4567 -wmpAppBanner.WIDGET.openAppButton = wmpAppBanner.WIDGET.openAppButton || 'OPEN';
4568 -
4569 -(function() {
4570 -
4571 - var appticlesStage, stage;
4572 -
4573 - /**
4574 - * Create timer that will check if the document is ready
4575 - * @type {number}
4576 - */
4577 - var DOMLoadTimer = setInterval(function () {
4578 - if (/loading|loaded|complete/i.test(document.readyState)) {
4579 - clearInterval(DOMLoadTimer);
4580 - documentLoaded();
4581 - }
4582 - }, 10);
4583 -
4584 - /**
4585 - * Init method, called when the document is ready
4586 - *
4587 - * The 'redirect' GET param is used for hosted apps (on Appticles).
4588 - * Setting redirect=false will deactivate the app banner.
4589 - *
4590 - */
4591 - function documentLoaded() {
4592 -
4593 - // create stage
4594 - appticlesStage = stage = new wmpAppBanner.Stage(wmpAppBanner.WIDGET);
4595 -
4596 - // get saved cookies
4597 - var cookie = stage.cookie,
4598 - mobileDevice = cookie.get(wmpAppBanner.WIDGET.cookiePrefix + "mobile_device"),
4599 - redirect = cookie.get(wmpAppBanner.WIDGET.cookiePrefix + "redirect"),
4600 - closed = cookie.get(wmpAppBanner.WIDGET.cookiePrefix + "closed"),
4601 - appUrl = wmpAppBanner.WIDGET.appUrl;
4602 -
4603 - // if there was a previous detection and the device is mobile
4604 - if (mobileDevice && Boolean(Number(String(mobileDevice))) == true && appUrl && appUrl.length > 1){
4605 -
4606 - // if there is a cookie already set, then convert it to a boolean value
4607 - // redirect param is used for hosted apps (on Appticles)
4608 - redirect = (redirect != null) ? Boolean(Number(String(redirect))) : true;
4609 -
4610 - var urlParams = window.location.href.split("?");
4611 -
4612 - // if the URL contains a redirect param, then set up a cookie with this value
4613 - if (urlParams.length > 1){
4614 - if (urlParams[urlParams.length-1].indexOf("redirect=false") != -1){
4615 - cookie.set(wmpAppBanner.WIDGET.cookiePrefix + "redirect", 0, 7);
4616 - redirect = false;
4617 - }
4618 - else if (urlParams[urlParams.length-1].indexOf("redirect=true") != -1){
4619 - cookie.set(wmpAppBanner.WIDGET.cookiePrefix + "redirect", 1, 7);
4620 - redirect = true;
4621 - }
4622 - }
4623 -
4624 - // create the wrapper bar
4625 - if (redirect && !closed){
4626 -
4627 - // attach on hash change listener
4628 - window.onhashchange = onHashChange;
4629 -
4630 - // create wrapper bar
4631 - stage.createBar();
4632 - }
4633 -
4634 - return;
4635 - }
4636 - // if there was a previous detection and the device is a desktop one
4637 - else if (mobileDevice && Boolean(Number(String(mobileDevice))) == false){
4638 - return;
4639 - }
4640 - else if (window.location.href.indexOf("redirect=false") != -1){
4641 - return;
4642 - }
4643 -
4644 - window.onhashchange = onHashChange;
4645 -
4646 - // detect device
4647 - stage.detectDevice();
4648 - }
4649 -
4650 - /**
4651 - * The hashchange event fires when a window's hash changes (location.hash).
4652 - * The hash is used for opening the app or hiding the banner (using close button from iframe).
4653 - *
4654 - */
4655 - function onHashChange(){
4656 -
4657 - var params = window.location.hash.split("#")[1];
4658 -
4659 - if (params){
4660 - params = params.split("=");
4661 -
4662 - if (params[0] == "app_action"){
4663 -
4664 - switch (params[1]){
4665 -
4666 - case "closebar":
4667 - // set cookie
4668 - appticlesStage.cookie.set(wmpAppBanner.WIDGET.cookiePrefix + "closed", 1, 7);
4669 -
4670 - // remove the bar
4671 - setTimeout(function(){
4672 - appticlesStage.bar.destroy();
4673 - appticlesStage = null;
4674 - }, 300);
4675 -
4676 - window.onhashchange = null;
4677 - window.location.hash = "";
4678 - break;
4679 -
4680 - case "openapp":
4681 - window.onhashchange = null;
4682 - window.location.hash = "";
4683 - appticlesStage.openApp();
4684 - break;
4685 -
4686 - default: break;
4687 - }
4688 - }
4689 - }
4690 - }
4691 -
4692 -}());
4693 \ No newline at end of file
4694
4695 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Stage.js b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Stage.js
4696 deleted file mode 100755
4697 index 5140dd5..0000000
4698 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/UI.Modules/Stage.js
4699 +++ /dev/null
4700 @@ -1,114 +0,0 @@
4701 -wmpAppBanner = wmpAppBanner || {};
4702 -
4703 -(function () {
4704 -
4705 - /**
4706 - * @class Stage
4707 - * @constructor
4708 - */
4709 - var Stage = function (WIDGET) {
4710 - this.WIDGET = WIDGET;
4711 -
4712 - this.initialize(WIDGET);
4713 - };
4714 -
4715 - var p = Stage.prototype;
4716 -
4717 - /**
4718 - * Public properties
4719 - */
4720 - p.cookie = null;
4721 - p.WIDGET = null;
4722 - p.bar = null;
4723 -
4724 -
4725 - /**
4726 - * Initialization method.
4727 - * @method initialize
4728 - */
4729 - p.initialize = function () {
4730 -
4731 - // create cookie obj
4732 - this.cookie = new wmpAppBanner.Cookie();
4733 - };
4734 -
4735 -
4736 - /**
4737 - * Detect device
4738 - * @todo (Future releases) Add device detection using user agent
4739 - */
4740 - p.detectDevice = function () {
4741 -
4742 - var me = this;
4743 -
4744 - if (me.WIDGET.trustedDevice == 1){
4745 -
4746 - me.redirectFn(1);
4747 - return;
4748 - }
4749 -
4750 - me.redirectFn(0);
4751 - };
4752 -
4753 -
4754 - /**
4755 - * Set mobile device cookie and call createBar() method
4756 - *
4757 - * @param isAllowedDevice
4758 - *
4759 - */
4760 - p.redirectFn = function (isAllowedDevice) {
4761 -
4762 - var WIDGET = this.WIDGET;
4763 - var cookie = this.cookie;
4764 - cookie.set(WIDGET.cookiePrefix + "mobile_device", isAllowedDevice, 7);
4765 -
4766 - if (Boolean(Number(String(isAllowedDevice)))) {
4767 - this.createBar();
4768 - }
4769 - };
4770 -
4771 -
4772 - /**
4773 - * Create bar
4774 - */
4775 - p.createBar = function () {
4776 -
4777 - // wait until the document body is created
4778 - var me = this;
4779 - var DOMLoadTimer = setInterval(function () {
4780 - if (document.body && document.body.clientWidth != 0) {
4781 - clearInterval(DOMLoadTimer);
4782 -
4783 - me.bar = new wmpAppBanner.Bar({
4784 - appIcon: me.WIDGET.appIcon,
4785 - appName: me.WIDGET.appName,
4786 - appUrl: me.WIDGET.appUrl,
4787 - cssPath: me.WIDGET.cssPath,
4788 - iframeUrl: me.WIDGET.iframeUrl,
4789 - openAppButton: me.WIDGET.openAppButton
4790 - });
4791 - }
4792 - }, 10);
4793 - };
4794 -
4795 - /**
4796 - *
4797 - * Redirect to app
4798 - *
4799 - */
4800 - p.openApp = function () {
4801 -
4802 - var WIDGET = this.WIDGET;
4803 - var mobileUrl = WIDGET.ref;
4804 -
4805 - document.cookie = WIDGET.cookiePrefix + "redirect=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;";
4806 -
4807 - // redirect to the app
4808 - if (mobileUrl && mobileUrl.length > 0) {
4809 - window.location.href = mobileUrl;
4810 - }
4811 - };
4812 -
4813 - wmpAppBanner.Stage = Stage;
4814 -}());
4815 \ No newline at end of file
4816
4817 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/smart-app-banner.js b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/smart-app-banner.js
4818 deleted file mode 100755
4819 index b19c430..0000000
4820 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/smart-app-banner.js
4821 +++ /dev/null
4822 @@ -1,532 +0,0 @@
4823 -var wmpAppBanner = wmpAppBanner || {};
4824 -wmpAppBanner.WIDGET = wmpAppBanner.WIDGET || {};
4825 -
4826 -wmpAppBanner.WIDGET.appUrl = wmpAppBanner.WIDGET.appUrl || '';
4827 -wmpAppBanner.WIDGET.appIcon = wmpAppBanner.WIDGET.appIcon || '';
4828 -wmpAppBanner.WIDGET.appName = wmpAppBanner.WIDGET.appName || '';
4829 -wmpAppBanner.WIDGET.ref = wmpAppBanner.WIDGET.ref || '';
4830 -wmpAppBanner.WIDGET.trustedDevice = wmpAppBanner.WIDGET.trustedDevice || 0;
4831 -wmpAppBanner.WIDGET.iframeUrl = wmpAppBanner.WIDGET.iframeUrl || '';
4832 -wmpAppBanner.WIDGET.cssPath = wmpAppBanner.WIDGET.cssPath || '';
4833 -wmpAppBanner.WIDGET.openAppButton = wmpAppBanner.WIDGET.openAppButton || 'OPEN';
4834 -
4835 -(function () {
4836 -
4837 - /**
4838 - * @class Cookie
4839 - * @constructor
4840 - */
4841 - var Cookie = function () {
4842 - this.initialize();
4843 - };
4844 -
4845 - var p = Cookie.prototype;
4846 -
4847 - /**
4848 - *
4849 - * Initialization method.
4850 - * @method initialize
4851 - */
4852 - p.initialize = function () {
4853 -
4854 - };
4855 -
4856 - /**
4857 - * Get cookie (public method)
4858 - *
4859 - * @param c_name
4860 - * @returns {string}
4861 - */
4862 - p.get = function (c_name) {
4863 -
4864 - var i, x, y, ARRcookies = document.cookie.split(";");
4865 - for (i = 0; i < ARRcookies.length; i++) {
4866 - x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
4867 - y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
4868 - x = x.replace(/^\s+|\s+$/g, "");
4869 - if (x == c_name) {
4870 - return decodeURIComponent(y);
4871 - }
4872 - }
4873 - };
4874 -
4875 - /**
4876 - * Set cookie (public method)
4877 - *
4878 - * @param c_name
4879 - * @param value
4880 - * @param expireDays
4881 - */
4882 - p.set = function (c_name, value, expireDays) {
4883 - var expireDate = new Date();
4884 - expireDate.setDate(expireDate.getDate() + expireDays);
4885 -
4886 - var c_value = encodeURIComponent(value) + ((expireDays == null) ? "" : "; expires=" + expireDate.toUTCString()) + "; path=/;";
4887 - document.cookie = c_name + "=" + c_value;
4888 - };
4889 -
4890 - wmpAppBanner.Cookie = Cookie;
4891 - }()
4892 -);
4893 -
4894 -(function () {
4895 -
4896 - /**
4897 - * @class Bar
4898 - * @constructor
4899 - */
4900 - var Bar = function (options) {
4901 - this.initialize(options);
4902 - };
4903 -
4904 - var p = Bar.prototype;
4905 -
4906 - /**
4907 - * Public properties
4908 - */
4909 -
4910 - /**
4911 - * The DOM object to manage.
4912 - * @property htmlElement
4913 - * @type HTMLElement
4914 - */
4915 - p.htmlElement = null;
4916 - p.iframe = null;
4917 - p.iframeUrl = null;
4918 -
4919 - /**
4920 - * Initialization method.
4921 - * @method initialize
4922 - */
4923 - p.initialize = function (options) {
4924 -
4925 - var me = this;
4926 - this.createWrapper(options);
4927 -
4928 - // add orientation change event
4929 - if ('onorientationchange' in window) {
4930 -
4931 - // orientation change event functions
4932 - this.orientationchangeFn = function () {
4933 - setTimeout(function () {
4934 - me.resize();
4935 - }, 250);
4936 - };
4937 - window.addEventListener("orientationchange", this.orientationchangeFn, false);
4938 - }
4939 - else {
4940 - var mqOrientation = window.matchMedia("(orientation: portrait)");
4941 -
4942 - // The Listener will fire whenever this either matches or ceases to match
4943 - mqOrientation.addListener(function (media) {
4944 - // portrait
4945 - if (media.matches) {
4946 - me.resize("portrait");
4947 - }
4948 - else {
4949 - me.resize("landscape");
4950 - }
4951 - }, false);
4952 - }
4953 -
4954 - // add zoom event
4955 - this.touchendFn = function () {
4956 - clearTimeout(window.resizeEvt);
4957 - window.resizeEvt = setTimeout(function () {
4958 - //alert("resize");
4959 - me.resize();
4960 - }, 300);
4961 - };
4962 -
4963 - window.resizeEvt;
4964 - window.addEventListener("touchleave", this.touchendFn, false);
4965 - window.addEventListener("touchcancel", this.touchendFn, false);
4966 - window.addEventListener("touchmove", this.touchendFn, false);
4967 - window.addEventListener("touchend", this.touchendFn, false);
4968 - };
4969 -
4970 -
4971 - /**
4972 - * Create wrapper (public method)
4973 - * @param options
4974 - */
4975 - p.createWrapper = function (options) {
4976 - var wrapper = document.createElement("appticles-wrapper");
4977 - this.htmlElement = wrapper;
4978 - var height = Math.round(this.getHeight());
4979 - var shadow = Math.round(0.1 * height);
4980 -
4981 - wrapper.style.position = "fixed";
4982 - wrapper.style.width = "100%";
4983 - wrapper.style.height = "0px";
4984 - wrapper.style.top = "0px";
4985 - wrapper.style.left = "0px";
4986 - wrapper.style.boxSizing = "border-box";
4987 - wrapper.style.zIndex = 1000000;
4988 - wrapper.style.display = "block";
4989 - wrapper.style.height = (height + shadow) + "px";
4990 -
4991 - document.body.appendChild(wrapper);
4992 -
4993 - var appName = options.appName || "";
4994 - var appUrl = options.appUrl || "";
4995 - var appIcon = options.appIcon || "";
4996 - var cssPath = options.cssPath || "";
4997 - var iframeUrl = this.iframeUrl = options.iframeUrl || "";
4998 - var originUrl = window.location.href;
4999 - var openAppButton = options.openAppButton || "";
5000 -
5001 - var _dc = (new Date()).getTime();
5002 - var params = "cssPath=" + cssPath + "?_dc" + _dc;
5003 - params += "&amp;height=" + height;
5004 - params += "&amp;appName=" + encodeURIComponent(appName);
5005 - params += "&amp;appUrl=" + encodeURIComponent(appUrl);
5006 - params += "&amp;appIcon=" + appIcon;
5007 - params += "&amp;originUrl=" + encodeURIComponent(originUrl);
5008 - params += "&amp;openText=" + encodeURIComponent(openAppButton);
5009 -
5010 - var html = [
5011 - '<iframe id="appticles-iframe-bar" width="100%" height="' + (height + shadow) + 'px" src="' + iframeUrl + '#' + params + '" frameborder="0" allowtransparency="true" scrolling="no" style="position:relative;"></iframe>'
5012 - ].join("");
5013 -
5014 - wrapper.innerHTML = html;
5015 -
5016 - this.iframe = document.getElementById("appticles-iframe-bar");
5017 - };
5018 -
5019 -
5020 - /**
5021 - * Resize banner (public method)
5022 - *
5023 - * @param orientation
5024 - */
5025 - p.resize = function (orientation) {
5026 -
5027 - var wrapper = this.htmlElement;
5028 - if (wrapper == null) return;
5029 -
5030 - // compute new wrapper height
5031 - var newH = Math.round(this.getHeight());
5032 - var shadow = Math.round(0.1 * newH);
5033 - wrapper.style.height = (newH + shadow) + "px";
5034 -
5035 - // change iframe params
5036 - var params = "height=" + newH;
5037 - this.iframe.style.height = (newH + shadow) + "px";
5038 - this.iframe.src = this.iframeUrl + '#' + params;
5039 - };
5040 -
5041 -
5042 - /**
5043 - * Get height (public method)
5044 - *
5045 - * @param orientation
5046 - * @returns {number}
5047 - */
5048 - p.getHeight = function (orientation) {
5049 -
5050 - orientation = orientation || this.getOrientation();
5051 -
5052 - var screenWidth, screenHeight, windowWidth, newH;
5053 -
5054 - // resize wrapper
5055 - if (orientation == "portrait") {
5056 - screenWidth = Math.min(screen.width, screen.height);
5057 - screenHeight = Math.max(screen.width, screen.height);
5058 - windowWidth = window.innerWidth;
5059 - newH = 90 * (windowWidth / screenWidth);
5060 -
5061 - return newH;
5062 - }
5063 - else if (orientation == "landscape") {
5064 - screenWidth = Math.max(screen.width, screen.height);
5065 - screenHeight = Math.min(screen.width, screen.height);
5066 - windowWidth = window.innerWidth;
5067 - newH = (90 * (windowWidth / screenHeight)) * (screenHeight / screenWidth);
5068 -
5069 - return newH;
5070 - }
5071 - };
5072 -
5073 - /**
5074 - * Destroy bar (public method)
5075 - */
5076 - p.destroy = function () {
5077 -
5078 - // remove the bar from HTML
5079 - var wrapper = this.htmlElement;
5080 - wrapper.parentNode.removeChild(wrapper);
5081 - this.htmlElement = null;
5082 -
5083 - // remove orientation change event
5084 - if ('onorientationchange' in window) {
5085 - window.removeEventListener("orientationchange", this.orientationchangeFn);
5086 - }
5087 -
5088 - // remove touch end event
5089 - window.removeEventListener("touchleave", this.touchendFn);
5090 - window.removeEventListener("touchcancel", this.touchendFn);
5091 - window.removeEventListener("touchmove", this.touchendFn);
5092 - window.removeEventListener("touchend", this.touchendFn);
5093 -
5094 - window[this] = null;
5095 - delete this;
5096 - };
5097 -
5098 -
5099 - /**
5100 - * Get device orientation
5101 - *
5102 - * @return string (portrait | landscape)
5103 - */
5104 - p.getOrientation = function () {
5105 - if (window.matchMedia("(orientation: portrait)").matches) {
5106 - return "portrait";
5107 - }
5108 - else if (window.matchMedia("(orientation: landscape)").matches) {
5109 - return "landscape";
5110 - }
5111 - };
5112 -
5113 - wmpAppBanner.Bar = Bar;
5114 -}());
5115 -
5116 -wmpAppBanner = wmpAppBanner || {};
5117 -
5118 -(function () {
5119 -
5120 - /**
5121 - * @class Stage
5122 - * @constructor
5123 - */
5124 - var Stage = function (WIDGET) {
5125 - this.WIDGET = WIDGET;
5126 -
5127 - this.initialize(WIDGET);
5128 - };
5129 -
5130 - var p = Stage.prototype;
5131 -
5132 - /**
5133 - * Public properties
5134 - */
5135 - p.cookie = null;
5136 - p.WIDGET = null;
5137 - p.bar = null;
5138 -
5139 -
5140 - /**
5141 - * Initialization method.
5142 - * @method initialize
5143 - */
5144 - p.initialize = function () {
5145 -
5146 - // create cookie obj
5147 - this.cookie = new wmpAppBanner.Cookie();
5148 - };
5149 -
5150 -
5151 - /**
5152 - * Detect device
5153 - * @todo (Future releases) Add device detection using user agent
5154 - */
5155 - p.detectDevice = function () {
5156 -
5157 - var me = this;
5158 -
5159 - if (me.WIDGET.trustedDevice == 1){
5160 -
5161 - me.redirectFn(1);
5162 - return;
5163 - }
5164 -
5165 - me.redirectFn(0);
5166 - };
5167 -
5168 -
5169 - /**
5170 - * Set mobile device cookie and call createBar() method
5171 - *
5172 - * @param isAllowedDevice
5173 - *
5174 - */
5175 - p.redirectFn = function (isAllowedDevice) {
5176 -
5177 - var WIDGET = this.WIDGET;
5178 - var cookie = this.cookie;
5179 - cookie.set(WIDGET.cookiePrefix + "mobile_device", isAllowedDevice, 7);
5180 -
5181 - if (Boolean(Number(String(isAllowedDevice)))) {
5182 - this.createBar();
5183 - }
5184 - };
5185 -
5186 -
5187 - /**
5188 - * Create bar
5189 - */
5190 - p.createBar = function () {
5191 -
5192 - // wait until the document body is created
5193 - var me = this;
5194 - var DOMLoadTimer = setInterval(function () {
5195 - if (document.body && document.body.clientWidth != 0) {
5196 - clearInterval(DOMLoadTimer);
5197 -
5198 - me.bar = new wmpAppBanner.Bar({
5199 - appIcon: me.WIDGET.appIcon,
5200 - appName: me.WIDGET.appName,
5201 - appUrl: me.WIDGET.appUrl,
5202 - cssPath: me.WIDGET.cssPath,
5203 - iframeUrl: me.WIDGET.iframeUrl,
5204 - openAppButton: me.WIDGET.openAppButton
5205 - });
5206 - }
5207 - }, 10);
5208 - };
5209 -
5210 - /**
5211 - *
5212 - * Redirect to app
5213 - *
5214 - */
5215 - p.openApp = function () {
5216 -
5217 - var WIDGET = this.WIDGET;
5218 - var mobileUrl = WIDGET.ref;
5219 -
5220 - document.cookie = WIDGET.cookiePrefix + "redirect=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;";
5221 -
5222 - // redirect to the app
5223 - if (mobileUrl && mobileUrl.length > 0) {
5224 - window.location.href = mobileUrl;
5225 - }
5226 - };
5227 -
5228 - wmpAppBanner.Stage = Stage;
5229 -}());
5230 -
5231 -(function() {
5232 -
5233 - var appticlesStage, stage;
5234 -
5235 - /**
5236 - * Create timer that will check if the document is ready
5237 - * @type {number}
5238 - */
5239 - var DOMLoadTimer = setInterval(function () {
5240 - if (/loading|loaded|complete/i.test(document.readyState)) {
5241 - clearInterval(DOMLoadTimer);
5242 - documentLoaded();
5243 - }
5244 - }, 10);
5245 -
5246 - /**
5247 - * Init method, called when the document is ready
5248 - *
5249 - * The 'redirect' GET param is used for hosted apps (on Appticles).
5250 - * Setting redirect=false will deactivate the app banner.
5251 - *
5252 - */
5253 - function documentLoaded() {
5254 -
5255 - // create stage
5256 - appticlesStage = stage = new wmpAppBanner.Stage(wmpAppBanner.WIDGET);
5257 -
5258 - // get saved cookies
5259 - var cookie = stage.cookie,
5260 - mobileDevice = cookie.get(wmpAppBanner.WIDGET.cookiePrefix + "mobile_device"),
5261 - redirect = cookie.get(wmpAppBanner.WIDGET.cookiePrefix + "redirect"),
5262 - closed = cookie.get(wmpAppBanner.WIDGET.cookiePrefix + "closed"),
5263 - appUrl = wmpAppBanner.WIDGET.appUrl;
5264 -
5265 - // if there was a previous detection and the device is mobile
5266 - if (mobileDevice && Boolean(Number(String(mobileDevice))) == true && appUrl && appUrl.length > 1){
5267 -
5268 - // if there is a cookie already set, then convert it to a boolean value
5269 - // redirect param is used for hosted apps (on Appticles)
5270 - redirect = (redirect != null) ? Boolean(Number(String(redirect))) : true;
5271 -
5272 - var urlParams = window.location.href.split("?");
5273 -
5274 - // if the URL contains a redirect param, then set up a cookie with this value
5275 - if (urlParams.length > 1){
5276 - if (urlParams[urlParams.length-1].indexOf("redirect=false") != -1){
5277 - cookie.set(wmpAppBanner.WIDGET.cookiePrefix + "redirect", 0, 7);
5278 - redirect = false;
5279 - }
5280 - else if (urlParams[urlParams.length-1].indexOf("redirect=true") != -1){
5281 - cookie.set(wmpAppBanner.WIDGET.cookiePrefix + "redirect", 1, 7);
5282 - redirect = true;
5283 - }
5284 - }
5285 -
5286 - // create the wrapper bar
5287 - if (redirect && !closed){
5288 -
5289 - // attach on hash change listener
5290 - window.onhashchange = onHashChange;
5291 -
5292 - // create wrapper bar
5293 - stage.createBar();
5294 - }
5295 -
5296 - return;
5297 - }
5298 - // if there was a previous detection and the device is a desktop one
5299 - else if (mobileDevice && Boolean(Number(String(mobileDevice))) == false){
5300 - return;
5301 - }
5302 - else if (window.location.href.indexOf("redirect=false") != -1){
5303 - return;
5304 - }
5305 -
5306 - window.onhashchange = onHashChange;
5307 -
5308 - // detect device
5309 - stage.detectDevice();
5310 - }
5311 -
5312 - /**
5313 - * The hashchange event fires when a window's hash changes (location.hash).
5314 - * The hash is used for opening the app or hiding the banner (using close button from iframe).
5315 - *
5316 - */
5317 - function onHashChange(){
5318 -
5319 - var params = window.location.hash.split("#")[1];
5320 -
5321 - if (params){
5322 - params = params.split("=");
5323 -
5324 - if (params[0] == "app_action"){
5325 -
5326 - switch (params[1]){
5327 -
5328 - case "closebar":
5329 - // set cookie
5330 - appticlesStage.cookie.set(wmpAppBanner.WIDGET.cookiePrefix + "closed", 1, 7);
5331 -
5332 - // remove the bar
5333 - setTimeout(function(){
5334 - appticlesStage.bar.destroy();
5335 - appticlesStage = null;
5336 - }, 300);
5337 -
5338 - window.onhashchange = null;
5339 - window.location.hash = "";
5340 - break;
5341 -
5342 - case "openapp":
5343 - window.onhashchange = null;
5344 - window.location.hash = "";
5345 - appticlesStage.openApp();
5346 - break;
5347 -
5348 - default: break;
5349 - }
5350 - }
5351 - }
5352 - }
5353 -
5354 -}());
5355 \ No newline at end of file
5356
5357 diff --git a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/smart-app-banner.min.js b/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/smart-app-banner.min.js
5358 deleted file mode 100755
5359 index 6e64042..0000000
5360 --- a/plugins/wordpress-mobile-pack/frontend/sections/smart-app-banner/js/smart-app-banner.min.js
5361 +++ /dev/null
5362 @@ -1 +0,0 @@
5363 -var wmpAppBanner=wmpAppBanner||{};wmpAppBanner.WIDGET=wmpAppBanner.WIDGET||{},wmpAppBanner.WIDGET.appUrl=wmpAppBanner.WIDGET.appUrl||"",wmpAppBanner.WIDGET.appIcon=wmpAppBanner.WIDGET.appIcon||"",wmpAppBanner.WIDGET.appName=wmpAppBanner.WIDGET.appName||"",wmpAppBanner.WIDGET.ref=wmpAppBanner.WIDGET.ref||"",wmpAppBanner.WIDGET.trustedDevice=wmpAppBanner.WIDGET.trustedDevice||0,wmpAppBanner.WIDGET.iframeUrl=wmpAppBanner.WIDGET.iframeUrl||"",wmpAppBanner.WIDGET.cssPath=wmpAppBanner.WIDGET.cssPath||"",wmpAppBanner.WIDGET.openAppButton=wmpAppBanner.WIDGET.openAppButton||"OPEN",function(){var e=function(){this.initialize()},n=e.prototype;n.initialize=function(){},n.get=function(e){var n,t,i,o=document.cookie.split(";");for(n=0;n<o.length;n++)if(t=o[n].substr(0,o[n].indexOf("=")),i=o[n].substr(o[n].indexOf("=")+1),t=t.replace(/^\s+|\s+$/g,""),t==e)return decodeURIComponent(i)},n.set=function(e,n,t){var i=new Date;i.setDate(i.getDate()+t);var o=encodeURIComponent(n)+(null==t?"":"; expires="
5364 +i.toUTCString())+"; path=/;";document.cookie=e+"="+o},wmpAppBanner.Cookie=e}(),function(){var e=function(e){this.initialize(e)},n=e.prototype;n.htmlElement=null,n.iframe=null,n.iframeUrl=null,n.initialize=function(e){var n=this;if(this.createWrapper(e),"onorientationchange"in window)this.orientationchangeFn=function(){setTimeout(function(){n.resize()},250)},window.addEventListener("orientationchange",this.orientationchangeFn,!1);else{var t=window.matchMedia("(orientation: portrait)");t.addListener(function(e){e.matches?n.resize("portrait"):n.resize("landscape")},!1)}this.touchendFn=function(){clearTimeout(window.resizeEvt),window.resizeEvt=setTimeout(function(){n.resize()},300)},window.resizeEvt,window.addEventListener("touchleave",this.touchendFn,!1),window.addEventListener("touchcancel",this.touchendFn,!1),window.addEventListener("touchmove",this.touchendFn,!1),window.addEventListener("touchend",this.touchendFn,!1)},n.createWrapper=function(e){var n=document.createElement("apptic
5365 les-wrapper");this.htmlElement=n;var t=Math.round(this.getHeight()),i=Math.round(.1*t);n.style.position="fixed",n.style.width="100%",n.style.height="0px",n.style.top="0px",n.style.left="0px",n.style.boxSizing="border-box",n.style.zIndex=1e6,n.style.display="block",n.style.height=t+i+"px",document.body.appendChild(n);var o=e.appName||"",r=e.appUrl||"",a=e.appIcon||"",p=e.cssPath||"",c=this.iframeUrl=e.iframeUrl||"",h=window.location.href,s=e.openAppButton||"",d=(new Date).getTime(),l="cssPath="+p+"?_dc"+d;l+="&amp;height="+t,l+="&amp;appName="+encodeURIComponent(o),l+="&amp;appUrl="+encodeURIComponent(r),l+="&amp;appIcon="+a,l+="&amp;originUrl="+encodeURIComponent(h),l+="&amp;openText="+encodeURIComponent(s);var m=['<iframe id="appticles-iframe-bar" width="100%" height="'+(t+i)+'px" src="'+c+"#"+l+'" frameborder="0" allowtransparency="true" scrolling="no" style="position:relative;"></iframe>'].join("");n.innerHTML=m,this.iframe=document.getElementById("appticles-iframe-bar")},n.resiz
5366 e=function(e){var n=this.htmlElement;if(null!=n){var t=Math.round(this.getHeight()),i=Math.round(.1*t);n.style.height=t+i+"px";var o="height="+t;this.iframe.style.height=t+i+"px",this.iframe.src=this.iframeUrl+"#"+o}},n.getHeight=function(e){e=e||this.getOrientation();var n,t,i,o;return"portrait"==e?(n=Math.min(screen.width,screen.height),t=Math.max(screen.width,screen.height),i=window.innerWidth,o=90*(i/n)):"landscape"==e?(n=Math.max(screen.width,screen.height),t=Math.min(screen.width,screen.height),i=window.innerWidth,o=90*(i/t)*(t/n)):void 0},n.destroy=function(){var e=this.htmlElement;e.parentNode.removeChild(e),this.htmlElement=null,"onorientationchange"in window&&window.removeEventListener("orientationchange",this.orientationchangeFn),window.removeEventListener("touchleave",this.touchendFn),window.removeEventListener("touchcancel",this.touchendFn),window.removeEventListener("touchmove",this.touchendFn),window.removeEventListener("touchend",this.touchendFn),window[this]=null,de
5367 lete this},n.getOrientation=function(){return window.matchMedia("(orientation: portrait)").matches?"portrait":window.matchMedia("(orientation: landscape)").matches?"landscape":void 0},wmpAppBanner.Bar=e}(),wmpAppBanner=wmpAppBanner||{},function(){var e=function(e){this.WIDGET=e,this.initialize(e)},n=e.prototype;n.cookie=null,n.WIDGET=null,n.bar=null,n.initialize=function(){this.cookie=new wmpAppBanner.Cookie},n.detectDevice=function(){var e=this;return 1==e.WIDGET.trustedDevice?void e.redirectFn(1):void e.redirectFn(0)},n.redirectFn=function(e){var n=this.WIDGET,t=this.cookie;t.set(n.cookiePrefix+"mobile_device",e,7),Boolean(Number(String(e)))&&this.createBar()},n.createBar=function(){var e=this,n=setInterval(function(){document.body&&0!=document.body.clientWidth&&(clearInterval(n),e.bar=new wmpAppBanner.Bar({appIcon:e.WIDGET.appIcon,appName:e.WIDGET.appName,appUrl:e.WIDGET.appUrl,cssPath:e.WIDGET.cssPath,iframeUrl:e.WIDGET.iframeUrl,openAppButton:e.WIDGET.openAppButton}))},10)},n.o
5368 penApp=function(){var e=this.WIDGET,n=e.ref;document.cookie=e.cookiePrefix+"redirect=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;",n&&n.length>0&&(window.location.href=n)},wmpAppBanner.Stage=e}(),function(){function e(){t=i=new wmpAppBanner.Stage(wmpAppBanner.WIDGET);var e=i.cookie,o=e.get(wmpAppBanner.WIDGET.cookiePrefix+"mobile_device"),r=e.get(wmpAppBanner.WIDGET.cookiePrefix+"redirect"),a=e.get(wmpAppBanner.WIDGET.cookiePrefix+"closed"),p=wmpAppBanner.WIDGET.appUrl;if(o&&1==Boolean(Number(String(o)))&&p&&p.length>1){r=null!=r?Boolean(Number(String(r))):!0;var c=window.location.href.split("?");return c.length>1&&(-1!=c[c.length-1].indexOf("redirect=false")?(e.set(wmpAppBanner.WIDGET.cookiePrefix+"redirect",0,7),r=!1):-1!=c[c.length-1].indexOf("redirect=true")&&(e.set(wmpAppBanner.WIDGET.cookiePrefix+"redirect",1,7),r=!0)),void(r&&!a&&(window.onhashchange=n,i.createBar()))}o&&0==Boolean(Number(String(o)))||-1==window.location.href.indexOf("redirect=false")&&(window.onhashchang
5369 e=n,i.detectDevice())}function n(){var e=window.location.hash.split("#")[1];if(e&&(e=e.split("="),"app_action"==e[0]))switch(e[1]){case"closebar":t.cookie.set(wmpAppBanner.WIDGET.cookiePrefix+"closed",1,7),setTimeout(function(){t.bar.destroy(),t=null},300),window.onhashchange=null,window.location.hash="";break;case"openapp":window.onhashchange=null,window.location.hash="",t.openApp()}}var t,i,o=setInterval(function(){/loading|loaded|complete/i.test(document.readyState)&&(clearInterval(o),e())},10)}();
5370 \ No newline at end of file
5371
5372 diff --git a/plugins/wordpress-mobile-pack/readme.txt b/plugins/wordpress-mobile-pack/readme.txt
5373 index b3e72cf..133a21b 100755
5374 --- a/plugins/wordpress-mobile-pack/readme.txt
5375 +++ b/plugins/wordpress-mobile-pack/readme.txt
5376 @@ -1,9 +1,9 @@
5377 === WordPress Mobile Pack - Mobile Plugin for Progressive Web Apps & Hybrid Mobile Apps ===
5378 -Contributors: jamesgpearce, andreatrasatti, edent, cborodescu, anghelalexandra
5379 +Contributors: jamesgpearce, andreatrasatti, cborodescu, anghelalexandra
5380 Tags: android, iOS, html5, iphone, mobile, mobile internet, mobile web, mobile web app, responsive ui, safari, sencha touch, smartphone, webkit, progressive web apps, app builder, apple, apps, convert to app, create blog app, ios app, ipad, make an app, mobile app plugin, mobile application, mobile blog app, mobile converter, mobile plugin, native app plugin, app theme, website to mobile app, WordPress android, WordPress app, WordPress iphone, WordPress mobile, WordPress mobile app
5381 Requires at least: 3.6
5382 Tested up to: 4.7.3
5383 -Stable tag: 3.1
5384 +Stable tag: 3.2
5385 License: GPLv2 or later
5386
5387 Mobile plugin to package your content into a progressive web app, build a hybrid mobile app and submit it to App Stores. Multiple mobile app themes.
5388 @@ -157,6 +157,9 @@ There are almost 50,000 plugins in the WordPress.org repository. It's impossible
5389
5390 == Changelog ==
5391
5392 += 3.2 =
5393 +* Security fix, replaced Smart App Banner script with jQuery Noty plugin
5394 +
5395 = 3.1 =
5396 * Implemented Add to Home Screen functionality
5397 * Translated app in Bosnian (bs_BA)
5398 @@ -400,8 +403,8 @@ Two major issues were introduced in beta 1, now solved:
5399
5400 == Upgrade Notice ==
5401
5402 -= 3.1 =
5403 -* WordPress Mobile Pack packages your content into a progressive web app or a hybrid mobile app that can be submitted to App Stores. The latest version comes with Add to Home Screen functionality, your users will now be prompted to add your web app to their home screen.
5404 += 3.2 =
5405 +* WordPress Mobile Pack packages your content into a progressive web app or a hybrid mobile app that can be submitted to App Stores. The latest version comes with a security fix for the smart app banner.
5406
5407 == Screenshots ==
5408
5409
5410 diff --git a/plugins/wordpress-mobile-pack/wordpress-mobile-pack.php b/plugins/wordpress-mobile-pack/wordpress-mobile-pack.php
5411 index a84ae41..92d178d 100755
5412 --- a/plugins/wordpress-mobile-pack/wordpress-mobile-pack.php
5413 +++ b/plugins/wordpress-mobile-pack/wordpress-mobile-pack.php
5414 @@ -5,7 +5,7 @@
5415 * Description: WordPress Mobile Pack 3.0+ is a mobile plugin that helps you transform your WordPress-based content (posts/articles, categories, pages) into a progressive web application. It comes with multiple mobile app themes and extensions that you can purchase individually or as a bundle.
5416 * Author: WPMobilePack.com
5417 * Author URI: https://wpmobilepack.com/
5418 - * Version: 3.1
5419 + * Version: 3.2
5420 * Copyright (c) 2009 - 2017 James Pearce, mTLD Top Level Domain Limited, ribot, Forum Nokia, Appticles.com
5421 * License: The WordPress Mobile Pack is Licensed under the Apache License, Version 2.0
5422 * Text Domain: wordpress-mobile-pack