LearnPress – WordPress LMS Plugin - Version 3.2.8.7

Version Description

~ Fix: start quiz 404 ~ Optimize

Download this release

Release Info

Developer ThimPress
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 3.2.8.7
Comparing to
See all releases

Code changes from version 3.2.8.5 to 3.2.8.7

assets/js/utils.js ADDED
@@ -0,0 +1,1629 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function(modules) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = {};
4
+ /******/
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__(moduleId) {
7
+ /******/
8
+ /******/ // Check if module is in cache
9
+ /******/ if(installedModules[moduleId]) {
10
+ /******/ return installedModules[moduleId].exports;
11
+ /******/ }
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules[moduleId] = {
14
+ /******/ i: moduleId,
15
+ /******/ l: false,
16
+ /******/ exports: {}
17
+ /******/ };
18
+ /******/
19
+ /******/ // Execute the module function
20
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
+ /******/
22
+ /******/ // Flag the module as loaded
23
+ /******/ module.l = true;
24
+ /******/
25
+ /******/ // Return the exports of the module
26
+ /******/ return module.exports;
27
+ /******/ }
28
+ /******/
29
+ /******/
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__.m = modules;
32
+ /******/
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__.c = installedModules;
35
+ /******/
36
+ /******/ // define getter function for harmony exports
37
+ /******/ __webpack_require__.d = function(exports, name, getter) {
38
+ /******/ if(!__webpack_require__.o(exports, name)) {
39
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
40
+ /******/ }
41
+ /******/ };
42
+ /******/
43
+ /******/ // define __esModule on exports
44
+ /******/ __webpack_require__.r = function(exports) {
45
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47
+ /******/ }
48
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
49
+ /******/ };
50
+ /******/
51
+ /******/ // create a fake namespace object
52
+ /******/ // mode & 1: value is a module id, require it
53
+ /******/ // mode & 2: merge all properties of value into the ns
54
+ /******/ // mode & 4: return value when already ns object
55
+ /******/ // mode & 8|1: behave like require
56
+ /******/ __webpack_require__.t = function(value, mode) {
57
+ /******/ if(mode & 1) value = __webpack_require__(value);
58
+ /******/ if(mode & 8) return value;
59
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60
+ /******/ var ns = Object.create(null);
61
+ /******/ __webpack_require__.r(ns);
62
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64
+ /******/ return ns;
65
+ /******/ };
66
+ /******/
67
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
68
+ /******/ __webpack_require__.n = function(module) {
69
+ /******/ var getter = module && module.__esModule ?
70
+ /******/ function getDefault() { return module['default']; } :
71
+ /******/ function getModuleExports() { return module; };
72
+ /******/ __webpack_require__.d(getter, 'a', getter);
73
+ /******/ return getter;
74
+ /******/ };
75
+ /******/
76
+ /******/ // Object.prototype.hasOwnProperty.call
77
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78
+ /******/
79
+ /******/ // __webpack_public_path__
80
+ /******/ __webpack_require__.p = "";
81
+ /******/
82
+ /******/
83
+ /******/ // Load entry module and return exports
84
+ /******/ return __webpack_require__(__webpack_require__.s = "./assets/src/js/utils/index.js");
85
+ /******/ })
86
+ /************************************************************************/
87
+ /******/ ({
88
+
89
+ /***/ "./assets/src/js/utils/event-callback.js":
90
+ /*!***********************************************!*\
91
+ !*** ./assets/src/js/utils/event-callback.js ***!
92
+ \***********************************************/
93
+ /*! exports provided: default */
94
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
+
96
+ "use strict";
97
+ __webpack_require__.r(__webpack_exports__);
98
+ /**
99
+ * Manage event callbacks.
100
+ * Allow add/remove a callback function into custom event of an object.
101
+ *
102
+ * @constructor
103
+ */
104
+ var Event_Callback = function Event_Callback(self) {
105
+ var callbacks = {};
106
+ var $ = window.jQuery;
107
+
108
+ this.on = function (event, callback) {
109
+ var namespaces = event.split('.'),
110
+ namespace = '';
111
+
112
+ if (namespaces.length > 1) {
113
+ event = namespaces[0];
114
+ namespace = namespaces[1];
115
+ }
116
+
117
+ if (!callbacks[event]) {
118
+ callbacks[event] = [[], {}];
119
+ }
120
+
121
+ if (namespace) {
122
+ if (!callbacks[event][1][namespace]) {
123
+ callbacks[event][1][namespace] = [];
124
+ }
125
+
126
+ callbacks[event][1][namespace].push(callback);
127
+ } else {
128
+ callbacks[event][0].push(callback);
129
+ }
130
+
131
+ return self;
132
+ };
133
+
134
+ this.off = function (event, callback) {
135
+ var namespaces = event.split('.'),
136
+ namespace = '';
137
+
138
+ if (namespaces.length > 1) {
139
+ event = namespaces[0];
140
+ namespace = namespaces[1];
141
+ }
142
+
143
+ if (!callbacks[event]) {
144
+ return self;
145
+ }
146
+
147
+ var at = -1;
148
+
149
+ if (!namespace) {
150
+ if ($.isFunction(callback)) {
151
+ at = callbacks[event][0].indexOf(callback);
152
+
153
+ if (at < 0) {
154
+ return self;
155
+ }
156
+
157
+ callbacks[event][0].splice(at, 1);
158
+ } else {
159
+ callbacks[event][0] = [];
160
+ }
161
+ } else {
162
+ if (!callbacks[event][1][namespace]) {
163
+ return self;
164
+ }
165
+
166
+ if ($.isFunction(callback)) {
167
+ at = callbacks[event][1][namespace].indexOf(callback);
168
+
169
+ if (at < 0) {
170
+ return self;
171
+ }
172
+
173
+ callbacks[event][1][namespace].splice(at, 1);
174
+ } else {
175
+ callbacks[event][1][namespace] = [];
176
+ }
177
+ }
178
+
179
+ return self;
180
+ };
181
+
182
+ this.callEvent = function (event, callbackArgs) {
183
+ if (!callbacks[event]) {
184
+ return;
185
+ }
186
+
187
+ if (callbacks[event][0]) {
188
+ for (var i = 0; i < callbacks[event][0].length; i++) {
189
+ $.isFunction(callbacks[event][0][i]) && callbacks[event][i][0].apply(self, callbackArgs);
190
+ }
191
+ }
192
+
193
+ if (callbacks[event][1]) {
194
+ for (var i in callbacks[event][1]) {
195
+ for (var j = 0; j < callbacks[event][1][i].length; j++) {
196
+ $.isFunction(callbacks[event][1][i][j]) && callbacks[event][1][i][j].apply(self, callbackArgs);
197
+ }
198
+ }
199
+ }
200
+ };
201
+ };
202
+
203
+ /* harmony default export */ __webpack_exports__["default"] = (Event_Callback);
204
+
205
+ /***/ }),
206
+
207
+ /***/ "./assets/src/js/utils/extend.js":
208
+ /*!***************************************!*\
209
+ !*** ./assets/src/js/utils/extend.js ***!
210
+ \***************************************/
211
+ /*! exports provided: default */
212
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
213
+
214
+ "use strict";
215
+ __webpack_require__.r(__webpack_exports__);
216
+ /* harmony default export */ __webpack_exports__["default"] = (function () {
217
+ window.LP = window.LP || {};
218
+
219
+ if (typeof arguments[0] === 'string') {
220
+ LP[arguments[0]] = LP[arguments[0]] || {};
221
+ LP[arguments[0]] = jQuery.extend(LP[arguments[0]], arguments[1]);
222
+ } else {
223
+ LP = jQuery.extend(LP, arguments[0]);
224
+ }
225
+ });
226
+
227
+ /***/ }),
228
+
229
+ /***/ "./assets/src/js/utils/fn.js":
230
+ /*!***********************************!*\
231
+ !*** ./assets/src/js/utils/fn.js ***!
232
+ \***********************************/
233
+ /*! exports provided: default */
234
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
235
+
236
+ "use strict";
237
+ __webpack_require__.r(__webpack_exports__);
238
+ /**
239
+ * Auto prepend `LP` prefix for jQuery fn plugin name.
240
+ *
241
+ * Create : $.fn.LP( 'PLUGIN_NAME', func) <=> $.fn.LP_PLUGIN_NAME
242
+ * Usage: $(selector).LP('PLUGIN_NAME') <=> $(selector).LP_PLUGIN_NAME()
243
+ *
244
+ * @version 3.2.6
245
+ */
246
+ var $ = window.jQuery;
247
+ var exp;
248
+
249
+ (function () {
250
+ if ($ === undefined) {
251
+ return;
252
+ }
253
+
254
+ $.fn.LP = exp = function exp(widget, fn) {
255
+ if ($.isFunction(fn)) {
256
+ $.fn['LP_' + widget] = fn;
257
+ } else if (widget) {
258
+ var args = [];
259
+
260
+ if (arguments.length > 1) {
261
+ for (var i = 1; i < arguments.length; i++) {
262
+ args.push(arguments[i]);
263
+ }
264
+ }
265
+
266
+ return $.isFunction($(this)['LP_' + widget]) ? $(this)['LP_' + widget].apply(this, args) : this;
267
+ }
268
+
269
+ return this;
270
+ };
271
+ })();
272
+
273
+ /* harmony default export */ __webpack_exports__["default"] = (exp);
274
+
275
+ /***/ }),
276
+
277
+ /***/ "./assets/src/js/utils/hook.js":
278
+ /*!*************************************!*\
279
+ !*** ./assets/src/js/utils/hook.js ***!
280
+ \*************************************/
281
+ /*! exports provided: default */
282
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
283
+
284
+ "use strict";
285
+ __webpack_require__.r(__webpack_exports__);
286
+ var Hook = {
287
+ hooks: {
288
+ action: {},
289
+ filter: {}
290
+ },
291
+ addAction: function addAction(action, callable, priority, tag) {
292
+ this.addHook('action', action, callable, priority, tag);
293
+ return this;
294
+ },
295
+ addFilter: function addFilter(action, callable, priority, tag) {
296
+ this.addHook('filter', action, callable, priority, tag);
297
+ return this;
298
+ },
299
+ doAction: function doAction(action) {
300
+ this.doHook('action', action, arguments);
301
+ return this;
302
+ },
303
+ applyFilters: function applyFilters(action) {
304
+ return this.doHook('filter', action, arguments);
305
+ },
306
+ removeAction: function removeAction(action, tag) {
307
+ this.removeHook('action', action, tag);
308
+ return this;
309
+ },
310
+ removeFilter: function removeFilter(action, priority, tag) {
311
+ this.removeHook('filter', action, priority, tag);
312
+ return this;
313
+ },
314
+ addHook: function addHook(hookType, action, callable, priority, tag) {
315
+ if (undefined === this.hooks[hookType][action]) {
316
+ this.hooks[hookType][action] = [];
317
+ }
318
+
319
+ var hooks = this.hooks[hookType][action];
320
+
321
+ if (undefined === tag) {
322
+ tag = action + '_' + hooks.length;
323
+ }
324
+
325
+ this.hooks[hookType][action].push({
326
+ tag: tag,
327
+ callable: callable,
328
+ priority: priority
329
+ });
330
+ return this;
331
+ },
332
+ doHook: function doHook(hookType, action, args) {
333
+ // splice args from object into array and remove first index which is the hook name
334
+ args = Array.prototype.slice.call(args, 1);
335
+
336
+ if (undefined !== this.hooks[hookType][action]) {
337
+ var hooks = this.hooks[hookType][action],
338
+ hook; //sort by priority
339
+
340
+ hooks.sort(function (a, b) {
341
+ return a["priority"] - b["priority"];
342
+ });
343
+
344
+ for (var i = 0; i < hooks.length; i++) {
345
+ hook = hooks[i].callable;
346
+ if (typeof hook !== 'function') hook = window[hook];
347
+
348
+ if ('action' === hookType) {
349
+ hook.apply(null, args);
350
+ } else {
351
+ args[0] = hook.apply(null, args);
352
+ }
353
+ }
354
+ }
355
+
356
+ if ('filter' === hookType) {
357
+ return args[0];
358
+ }
359
+
360
+ return this;
361
+ },
362
+ removeHook: function removeHook(hookType, action, priority, tag) {
363
+ if (undefined !== this.hooks[hookType][action]) {
364
+ var hooks = this.hooks[hookType][action];
365
+
366
+ for (var i = hooks.length - 1; i >= 0; i--) {
367
+ if ((undefined === tag || tag === hooks[i].tag) && (undefined === priority || priority === hooks[i].priority)) {
368
+ hooks.splice(i, 1);
369
+ }
370
+ }
371
+ }
372
+
373
+ return this;
374
+ }
375
+ };
376
+ /* harmony default export */ __webpack_exports__["default"] = (Hook);
377
+
378
+ /***/ }),
379
+
380
+ /***/ "./assets/src/js/utils/index.js":
381
+ /*!**************************************!*\
382
+ !*** ./assets/src/js/utils/index.js ***!
383
+ \**************************************/
384
+ /*! exports provided: default */
385
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
386
+
387
+ "use strict";
388
+ __webpack_require__.r(__webpack_exports__);
389
+ /* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extend */ "./assets/src/js/utils/extend.js");
390
+ /* harmony import */ var _fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fn */ "./assets/src/js/utils/fn.js");
391
+ /* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quick-tip */ "./assets/src/js/utils/quick-tip.js");
392
+ /* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_quick_tip__WEBPACK_IMPORTED_MODULE_2__);
393
+ /* harmony import */ var _message_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./message-box */ "./assets/src/js/utils/message-box.js");
394
+ /* harmony import */ var _event_callback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-callback */ "./assets/src/js/utils/event-callback.js");
395
+ /* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hook */ "./assets/src/js/utils/hook.js");
396
+ /* harmony import */ var _jquery_plugins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./jquery.plugins */ "./assets/src/js/utils/jquery.plugins.js");
397
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
398
+
399
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
400
+
401
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
402
+
403
+ /**
404
+ * Utility functions may use for both admin and frontend.
405
+ *
406
+ * @version 3.2.6
407
+ */
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+ var $ = jQuery;
416
+
417
+ String.prototype.getQueryVar = function (name) {
418
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
419
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
420
+ results = regex.exec(this);
421
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
422
+ };
423
+
424
+ String.prototype.addQueryVar = function (name, value) {
425
+ var url = this,
426
+ m = url.split('#');
427
+ url = m[0];
428
+
429
+ if (name.match(/\[/)) {
430
+ url += url.match(/\?/) ? '&' : '?';
431
+ url += name + '=' + value;
432
+ } else {
433
+ if (url.indexOf('&' + name + '=') != -1 || url.indexOf('?' + name + '=') != -1) {
434
+ url = url.replace(new RegExp(name + "=([^&#]*)", 'g'), name + '=' + value);
435
+ } else {
436
+ url += url.match(/\?/) ? '&' : '?';
437
+ url += name + '=' + value;
438
+ }
439
+ }
440
+
441
+ return url + (m[1] ? '#' + m[1] : '');
442
+ };
443
+
444
+ String.prototype.removeQueryVar = function (name) {
445
+ var url = this;
446
+ var m = url.split('#');
447
+ url = m[0];
448
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
449
+ var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
450
+ url = url.replace(regex, '');
451
+ return url + (m[1] ? '#' + m[1] : '');
452
+ };
453
+
454
+ if ($.isEmptyObject("") == false) {
455
+ $.isEmptyObject = function (a) {
456
+ var prop;
457
+
458
+ for (prop in a) {
459
+ if (a.hasOwnProperty(prop)) {
460
+ return false;
461
+ }
462
+ }
463
+
464
+ return true;
465
+ };
466
+ }
467
+
468
+ var _default = {
469
+ Hook: _hook__WEBPACK_IMPORTED_MODULE_5__["default"],
470
+ setUrl: function setUrl(url, ember, title) {
471
+ if (url) {
472
+ history.pushState({}, title, url);
473
+ LP.Hook.doAction('learn_press_set_location_url', url);
474
+ }
475
+ },
476
+ toggleGroupSection: function toggleGroupSection(el, target) {
477
+ var $el = $(el),
478
+ isHide = $el.hasClass('hide-if-js');
479
+
480
+ if (isHide) {
481
+ $el.hide().removeClass('hide-if-js');
482
+ }
483
+
484
+ $el.removeClass('hide-if-js').slideToggle(function () {
485
+ var $this = $(this);
486
+
487
+ if ($this.is(':visible')) {
488
+ $(target).addClass('toggle-on').removeClass('toggle-off');
489
+ } else {
490
+ $(target).addClass('toggle-off').removeClass('toggle-on');
491
+ }
492
+ });
493
+ },
494
+ overflow: function overflow(el, v) {
495
+ var $el = $(el),
496
+ overflow = $el.css('overflow');
497
+
498
+ if (v) {
499
+ $el.css('overflow', v).data('overflow', overflow);
500
+ } else {
501
+ $el.css('overflow', $el.data('overflow'));
502
+ }
503
+ },
504
+ getUrl: function getUrl() {
505
+ return window.location.href;
506
+ },
507
+ addQueryVar: function addQueryVar(name, value, url) {
508
+ return (url === undefined ? window.location.href : url).addQueryVar(name, value);
509
+ },
510
+ removeQueryVar: function removeQueryVar(name, url) {
511
+ return (url === undefined ? window.location.href : url).removeQueryVar(name);
512
+ },
513
+ reload: function reload(url) {
514
+ if (!url) {
515
+ url = window.location.href;
516
+ }
517
+
518
+ window.location.href = url;
519
+ },
520
+ parseResponse: function parseResponse(response, type) {
521
+ var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
522
+
523
+ if (m) {
524
+ response = m[1];
525
+ }
526
+
527
+ return (type || "json") === "json" ? this.parseJSON(response) : response;
528
+ },
529
+ parseJSON: function parseJSON(data) {
530
+ var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
531
+
532
+ try {
533
+ if (m) {
534
+ data = $.parseJSON(m[1]);
535
+ } else {
536
+ data = $.parseJSON(data);
537
+ }
538
+ } catch (e) {
539
+ data = {};
540
+ }
541
+
542
+ return data;
543
+ },
544
+ ajax: function ajax(args) {
545
+ var type = args.type || 'post',
546
+ dataType = args.dataType || 'json',
547
+ data = args.action ? $.extend(args.data, {
548
+ 'lp-ajax': args.action
549
+ }) : args.data,
550
+ beforeSend = args.beforeSend || function () {},
551
+ url = args.url || window.location.href; // console.debug( beforeSend );
552
+
553
+
554
+ $.ajax({
555
+ data: data,
556
+ url: url,
557
+ type: type,
558
+ dataType: 'html',
559
+ beforeSend: beforeSend.apply(null, args),
560
+ success: function success(raw) {
561
+ var response = LP.parseResponse(raw, dataType);
562
+ $.isFunction(args.success) && args.success(response, raw);
563
+ },
564
+ error: function error() {
565
+ $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
566
+ }
567
+ });
568
+ },
569
+ doAjax: function doAjax(args) {
570
+ var type = args.type || 'post',
571
+ dataType = args.dataType || 'json',
572
+ action = (args.prefix === undefined || 'learnpress_') + args.action,
573
+ data = args.action ? $.extend(args.data, {
574
+ action: action
575
+ }) : args.data;
576
+ $.ajax({
577
+ data: data,
578
+ url: args.url || window.location.href,
579
+ type: type,
580
+ dataType: 'html',
581
+ success: function success(raw) {
582
+ var response = LP.parseResponse(raw, dataType);
583
+ $.isFunction(args.success) && args.success(response, raw);
584
+ },
585
+ error: function error() {
586
+ $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
587
+ }
588
+ });
589
+ },
590
+ funcArgs2Array: function funcArgs2Array(args) {
591
+ var arr = [];
592
+
593
+ for (var i = 0; i < args.length; i++) {
594
+ arr.push(args[i]);
595
+ }
596
+
597
+ return arr;
598
+ },
599
+ addFilter: function addFilter(action, callback) {
600
+ var $doc = $(document),
601
+ event = 'LP.' + action;
602
+ $doc.on(event, callback);
603
+ LP.log($doc.data('events'));
604
+ return this;
605
+ },
606
+ applyFilters: function applyFilters() {
607
+ var $doc = $(document),
608
+ action = arguments[0],
609
+ args = this.funcArgs2Array(arguments);
610
+
611
+ if ($doc.hasEvent(action)) {
612
+ args[0] = 'LP.' + action;
613
+ return $doc.triggerHandler.apply($doc, args);
614
+ }
615
+
616
+ return args[1];
617
+ },
618
+ addAction: function addAction(action, callback) {
619
+ return this.addFilter(action, callback);
620
+ },
621
+ doAction: function doAction() {
622
+ var $doc = $(document),
623
+ action = arguments[0],
624
+ args = this.funcArgs2Array(arguments);
625
+
626
+ if ($doc.hasEvent(action)) {
627
+ args[0] = 'LP.' + action;
628
+ $doc.trigger.apply($doc, args);
629
+ }
630
+ },
631
+ toElement: function toElement(element, args) {
632
+ if ($(element).length === 0) {
633
+ return;
634
+ }
635
+
636
+ args = $.extend({
637
+ delay: 300,
638
+ duration: 'slow',
639
+ offset: 50,
640
+ container: null,
641
+ callback: null,
642
+ invisible: false
643
+ }, args || {});
644
+ var $container = $(args.container),
645
+ rootTop = 0;
646
+
647
+ if ($container.length === 0) {
648
+ $container = $('body, html');
649
+ }
650
+
651
+ rootTop = $container.offset().top;
652
+ var to = $(element).offset().top + $container.scrollTop() - rootTop - args.offset;
653
+
654
+ function isElementInView(element, fullyInView) {
655
+ var pageTop = $container.scrollTop();
656
+ var pageBottom = pageTop + $container.height();
657
+ var elementTop = $(element).offset().top - $container.offset().top;
658
+ var elementBottom = elementTop + $(element).height();
659
+
660
+ if (fullyInView === true) {
661
+ return pageTop < elementTop && pageBottom > elementBottom;
662
+ } else {
663
+ return elementTop <= pageBottom && elementBottom >= pageTop;
664
+ }
665
+ }
666
+
667
+ if (args.invisible && isElementInView(element, true)) {
668
+ return;
669
+ }
670
+
671
+ $container.fadeIn(10).delay(args.delay).animate({
672
+ scrollTop: to
673
+ }, args.duration, args.callback);
674
+ },
675
+ uniqueId: function uniqueId(prefix, more_entropy) {
676
+ if (typeof prefix === 'undefined') {
677
+ prefix = '';
678
+ }
679
+
680
+ var retId;
681
+
682
+ var formatSeed = function formatSeed(seed, reqWidth) {
683
+ seed = parseInt(seed, 10).toString(16); // to hex str
684
+
685
+ if (reqWidth < seed.length) {
686
+ // so long we split
687
+ return seed.slice(seed.length - reqWidth);
688
+ }
689
+
690
+ if (reqWidth > seed.length) {
691
+ // so short we pad
692
+ return new Array(1 + (reqWidth - seed.length)).join('0') + seed;
693
+ }
694
+
695
+ return seed;
696
+ }; // BEGIN REDUNDANT
697
+
698
+
699
+ if (!this.php_js) {
700
+ this.php_js = {};
701
+ } // END REDUNDANT
702
+
703
+
704
+ if (!this.php_js.uniqidSeed) {
705
+ // init seed with big random int
706
+ this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
707
+ }
708
+
709
+ this.php_js.uniqidSeed++;
710
+ retId = prefix; // start with prefix, add current milliseconds hex string
711
+
712
+ retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
713
+ retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
714
+
715
+ if (more_entropy) {
716
+ // for more entropy we add a float lower to 10
717
+ retId += (Math.random() * 10).toFixed(8).toString();
718
+ }
719
+
720
+ return retId;
721
+ },
722
+ log: function log() {
723
+ //if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
724
+ for (var i = 0, n = arguments.length; i < n; i++) {
725
+ console.log(arguments[i]);
726
+ } //}
727
+
728
+ },
729
+ blockContent: function blockContent() {
730
+ if ($('#learn-press-block-content').length === 0) {
731
+ $(LP.template('learn-press-template-block-content', {})).appendTo($('body'));
732
+ }
733
+
734
+ LP.hideMainScrollbar().addClass('block-content');
735
+ $(document).trigger('learn_press_block_content');
736
+ },
737
+ unblockContent: function unblockContent() {
738
+ setTimeout(function () {
739
+ LP.showMainScrollbar().removeClass('block-content');
740
+ $(document).trigger('learn_press_unblock_content');
741
+ }, 350);
742
+ },
743
+ hideMainScrollbar: function hideMainScrollbar(el) {
744
+ if (!el) {
745
+ el = 'html, body';
746
+ }
747
+
748
+ var $el = $(el);
749
+ $el.each(function () {
750
+ var $root = $(this),
751
+ overflow = $root.css('overflow');
752
+ $root.css('overflow', 'hidden').attr('overflow', overflow);
753
+ });
754
+ return $el;
755
+ },
756
+ showMainScrollbar: function showMainScrollbar(el) {
757
+ if (!el) {
758
+ el = 'html, body';
759
+ }
760
+
761
+ var $el = $(el);
762
+ $el.each(function () {
763
+ var $root = $(this),
764
+ overflow = $root.attr('overflow');
765
+ $root.css('overflow', overflow).removeAttr('overflow');
766
+ });
767
+ return $el;
768
+ },
769
+ template: typeof _ !== 'undefined' ? _.memoize(function (id, data) {
770
+ var compiled,
771
+ options = {
772
+ evaluate: /<#([\s\S]+?)#>/g,
773
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
774
+ escape: /\{\{([^\}]+?)\}\}(?!\})/g,
775
+ variable: 'data'
776
+ };
777
+
778
+ var tmpl = function tmpl(data) {
779
+ compiled = compiled || _.template($('#' + id).html(), null, options);
780
+ return compiled(data);
781
+ };
782
+
783
+ return data ? tmpl(data) : tmpl;
784
+ }, function (a, b) {
785
+ return a + '-' + JSON.stringify(b);
786
+ }) : function () {
787
+ return '';
788
+ },
789
+ alert: function alert(localize, callback) {
790
+ var title = '',
791
+ message = '';
792
+
793
+ if (typeof localize === 'string') {
794
+ message = localize;
795
+ } else {
796
+ if (typeof localize['title'] !== 'undefined') {
797
+ title = localize['title'];
798
+ }
799
+
800
+ if (typeof localize['message'] !== 'undefined') {
801
+ message = localize['message'];
802
+ }
803
+ }
804
+
805
+ $.alerts.alert(message, title, function (e) {
806
+ LP._on_alert_hide();
807
+
808
+ callback && callback(e);
809
+ });
810
+
811
+ this._on_alert_show();
812
+ },
813
+ confirm: function confirm(localize, callback) {
814
+ var title = '',
815
+ message = '';
816
+
817
+ if (typeof localize === 'string') {
818
+ message = localize;
819
+ } else {
820
+ if (typeof localize['title'] !== 'undefined') {
821
+ title = localize['title'];
822
+ }
823
+
824
+ if (typeof localize['message'] !== 'undefined') {
825
+ message = localize['message'];
826
+ }
827
+ }
828
+
829
+ $.alerts.confirm(message, title, function (e) {
830
+ LP._on_alert_hide();
831
+
832
+ callback && callback(e);
833
+ });
834
+
835
+ this._on_alert_show();
836
+ },
837
+ _on_alert_show: function _on_alert_show() {
838
+ var $container = $('#popup_container'),
839
+ $placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container);
840
+ $container.stop().css('top', '-=50').css('opacity', '0').animate({
841
+ top: '+=50',
842
+ opacity: 1
843
+ }, 250);
844
+ },
845
+ _on_alert_hide: function _on_alert_hide() {
846
+ var $holder = $("#popup_container_placeholder"),
847
+ $container = $holder.data('xxx');
848
+
849
+ if ($container) {
850
+ $container.replaceWith($holder);
851
+ }
852
+
853
+ $container.appendTo($(document.body));
854
+ $container.stop().animate({
855
+ top: '+=50',
856
+ opacity: 0
857
+ }, 250, function () {
858
+ $(this).remove();
859
+ });
860
+ },
861
+ sendMessage: function sendMessage(data, object, targetOrigin, transfer) {
862
+ if ($.isPlainObject(data)) {
863
+ data = JSON.stringify(data);
864
+ }
865
+
866
+ object = object || window;
867
+ targetOrigin = targetOrigin || '*';
868
+ object.postMessage(data, targetOrigin, transfer);
869
+ },
870
+ receiveMessage: function receiveMessage(event, b) {
871
+ var target = event.origin || event.originalEvent.origin,
872
+ data = event.data || event.originalEvent.data || '';
873
+
874
+ if (typeof data === 'string' || data instanceof String) {
875
+ if (data.indexOf('{') === 0) {
876
+ data = LP.parseJSON(data);
877
+ }
878
+ }
879
+
880
+ LP.Hook.doAction('learn_press_receive_message', data, target);
881
+ }
882
+ };
883
+ $(document).ready(function () {
884
+ if (typeof $.alerts !== 'undefined') {
885
+ $.alerts.overlayColor = '#000';
886
+ $.alerts.overlayOpacity = 0.5;
887
+ $.alerts.okButton = lpGlobalSettings.localize.button_ok;
888
+ $.alerts.cancelButton = lpGlobalSettings.localize.button_cancel;
889
+ }
890
+
891
+ $('.learn-press-message.fixed').each(function () {
892
+ var $el = $(this),
893
+ options = $el.data();
894
+
895
+ (function ($el, options) {
896
+ if (options.delayIn) {
897
+ setTimeout(function () {
898
+ $el.show().hide().fadeIn();
899
+ }, options.delayIn);
900
+ }
901
+
902
+ if (options.delayOut) {
903
+ setTimeout(function () {
904
+ $el.fadeOut();
905
+ }, options.delayOut + (options.delayIn || 0));
906
+ }
907
+ })($el, options);
908
+ });
909
+ $('body').on('click', '.learn-press-nav-tabs li a', function (e) {
910
+ e.preventDefault();
911
+ var $tab = $(this),
912
+ url = '';
913
+ $tab.closest('li').addClass('active').siblings().removeClass('active');
914
+ $($tab.attr('data-tab')).addClass('active').siblings().removeClass('active');
915
+ $(document).trigger('learn-press/nav-tabs/clicked', $tab);
916
+ });
917
+ setTimeout(function () {
918
+ $('.learn-press-nav-tabs li.active:not(.default) a').trigger('click');
919
+ }, 300);
920
+ $('body.course-item-popup').parent().css('overflow', 'hidden');
921
+
922
+ (function () {
923
+ var timer = null,
924
+ callback = function callback() {
925
+ $('.auto-check-lines').checkLines(function (r) {
926
+ if (r > 1) {
927
+ $(this).removeClass('single-lines');
928
+ } else {
929
+ $(this).addClass('single-lines');
930
+ }
931
+
932
+ $(this).attr('rows', r);
933
+ });
934
+ };
935
+
936
+ $(window).on('resize.check-lines', function () {
937
+ if (timer) {
938
+ timer && clearTimeout(timer);
939
+ timer = setTimeout(callback, 300);
940
+ } else {
941
+ callback();
942
+ }
943
+ });
944
+ })();
945
+
946
+ $('.learn-press-tooltip, .lp-passing-conditional').LP_Tooltip({
947
+ offset: [24, 24]
948
+ });
949
+ $('.learn-press-icon').LP_Tooltip({
950
+ offset: [30, 30]
951
+ });
952
+ $('.learn-press-message[data-autoclose]').each(function () {
953
+ var $el = $(this),
954
+ delay = parseInt($el.data('autoclose'));
955
+
956
+ if (delay) {
957
+ setTimeout(function ($el) {
958
+ $el.fadeOut();
959
+ }, delay, $el);
960
+ }
961
+ });
962
+ $(document).on('click', function () {
963
+ $(document).trigger('learn-press/close-all-quick-tip');
964
+ });
965
+ });
966
+ Object(_extend__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread({
967
+ Event_Callback: _event_callback__WEBPACK_IMPORTED_MODULE_4__["default"],
968
+ MessageBox: _message_box__WEBPACK_IMPORTED_MODULE_3__["default"]
969
+ }, _default));
970
+ /* harmony default export */ __webpack_exports__["default"] = ({
971
+ fn: _fn__WEBPACK_IMPORTED_MODULE_1__["default"],
972
+ QuickTip: _quick_tip__WEBPACK_IMPORTED_MODULE_2___default.a
973
+ });
974
+
975
+ /***/ }),
976
+
977
+ /***/ "./assets/src/js/utils/jquery.plugins.js":
978
+ /*!***********************************************!*\
979
+ !*** ./assets/src/js/utils/jquery.plugins.js ***!
980
+ \***********************************************/
981
+ /*! exports provided: default */
982
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
983
+
984
+ "use strict";
985
+ __webpack_require__.r(__webpack_exports__);
986
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
987
+
988
+ var $ = window.jQuery;
989
+
990
+ var serializeJSON = function serializeJSON(path) {
991
+ var isInput = $(this).is('input') || $(this).is('select') || $(this).is('textarea');
992
+ var unIndexed = isInput ? $(this).serializeArray() : $(this).find('input, select, textarea').serializeArray(),
993
+ indexed = {},
994
+ validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g,
995
+ arrayKeys = {},
996
+ end = false;
997
+ $.each(unIndexed, function () {
998
+ var that = this,
999
+ match = this.name.match(/^([0-9a-zA-Z_-]+)/);
1000
+
1001
+ if (!match) {
1002
+ return;
1003
+ }
1004
+
1005
+ var keys = this.name.match(validate),
1006
+ objPath = "indexed['" + match[0] + "']";
1007
+
1008
+ if (keys) {
1009
+ if (_typeof(indexed[match[0]]) != 'object') {
1010
+ indexed[match[0]] = {};
1011
+ }
1012
+
1013
+ $.each(keys, function (i, prop) {
1014
+ prop = prop.replace(/\]|\[/g, '');
1015
+ var rawPath = objPath.replace(/'|\[|\]/g, ''),
1016
+ objExp = '',
1017
+ preObjPath = objPath;
1018
+
1019
+ if (prop == '') {
1020
+ if (arrayKeys[rawPath] == undefined) {
1021
+ arrayKeys[rawPath] = 0;
1022
+ } else {
1023
+ arrayKeys[rawPath]++;
1024
+ }
1025
+
1026
+ objPath += "['" + arrayKeys[rawPath] + "']";
1027
+ } else {
1028
+ if (!isNaN(prop)) {
1029
+ arrayKeys[rawPath] = prop;
1030
+ }
1031
+
1032
+ objPath += "['" + prop + "']";
1033
+