vendor: 3,679 bytes, lines 1-88
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 = "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/index.js"); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88
89/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/event-callback.js": 90/*!************************************************************************************************************!*\ 91 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/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 */ 104var 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/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/extend.js": 208/*!****************************************************************************************************!*\ 209 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/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/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/fn.js": 230/*!************************************************************************************************!*\ 231 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/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 */ 246var $ = window.jQuery; 247var 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/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/hook.js": 278/*!**************************************************************************************************!*\ 279 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/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__); 286var 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/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/index.js": 381/*!***************************************************************************************************!*\ 382 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/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 */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/extend.js"); 390/* harmony import */ var _fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fn */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/fn.js"); 391/* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quick-tip */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/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 */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/message-box.js"); 394/* harmony import */ var _event_callback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-callback */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/event-callback.js"); 395/* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hook */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/hook.js"); 396/* harmony import */ var _jquery_plugins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./jquery.plugins */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/jquery.plugins.js"); 397function 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 399function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 400 401function _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 415var $ = jQuery; 416 417String.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 424String.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 if (url.indexOf('&' + name + '=') != -1 || url.indexOf('?' + name + '=') != -1) { 433 url = url.replace(new RegExp(name + '=([^&#]*)', 'g'), name + '=' + value); 434 } else { 435 url += url.match(/\?/) ? '&' : '?'; 436 url += name + '=' + value; 437 } 438 439 return url + (m[1] ? '#' + m[1] : ''); 440}; 441 442String.prototype.removeQueryVar = function (name) { 443 var url = this; 444 var m = url.split('#'); 445 url = m[0]; 446 name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); 447 var regex = new RegExp('[\\?&]' + name + '([\[][^=]*)?=([^&#]*)', 'g'); 448 url = url.replace(regex, ''); 449 return url + (m[1] ? '#' + m[1] : ''); 450}; // if ( $.isEmptyObject( '' ) == false ) { 451// $.isEmptyObject = function( a ) { 452// let prop; 453// for ( prop in a ) { 454// if ( a.hasOwnProperty( prop ) ) { 455// return false;
456// } 457// } 458// return true; 459// }; 460// } 461 462 463var _default = { 464 Hook: _hook__WEBPACK_IMPORTED_MODULE_5__["default"], 465 setUrl: function setUrl(url, ember, title) { 466 if (url) { 467 history.pushState({}, title, url); 468 LP.Hook.doAction('learn_press_set_location_url', url); 469 } 470 }, 471 toggleGroupSection: function toggleGroupSection(el, target) { 472 var $el = $(el), 473 isHide = $el.hasClass('hide-if-js'); 474 475 if (isHide) { 476 $el.hide().removeClass('hide-if-js'); 477 } 478 479 $el.removeClass('hide-if-js').slideToggle(function () { 480 var $this = $(this); 481 482 if ($this.is(':visible')) { 483 $(target).addClass('toggle-on').removeClass('toggle-off'); 484 } else { 485 $(target).addClass('toggle-off').removeClass('toggle-on'); 486 } 487 }); 488 }, 489 overflow: function overflow(el, v) { 490 var $el = $(el), 491 overflow = $el.css('overflow'); 492 493 if (v) { 494 $el.css('overflow', v).data('overflow', overflow); 495 } else { 496 $el.css('overflow', $el.data('overflow')); 497 } 498 }, 499 getUrl: function getUrl() { 500 return window.location.href; 501 }, 502 addQueryVar: function addQueryVar(name, value, url) { 503 return (url === undefined ? window.location.href : url).addQueryVar(name, value); 504 }, 505 removeQueryVar: function removeQueryVar(name, url) { 506 return (url === undefined ? window.location.href : url).removeQueryVar(name); 507 }, 508 reload: function reload(url) { 509 if (!url) { 510 url = window.location.href; 511 } 512 513 window.location.href = url; 514 }, 515 parseResponse: function parseResponse(response, type) { 516 var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/); 517 518 if (m) { 519 response = m[1]; 520 } 521 522 return (type || 'json') === 'json' ? this.parseJSON(response) : response; 523 }, 524 parseJSON: function parseJSON(data) { 525 var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/); 526 527 try { 528 if (m) { 529 data = $.parseJSON(m[1]); 530 } else { 531 data = $.parseJSON(data); 532 } 533 } catch (e) { 534 data = {}; 535 } 536 537 return data; 538 }, 539 ajax: function ajax(args) { 540 var type = args.type || 'post', 541 dataType = args.dataType || 'json', 542 data = args.action ? $.extend(args.data, { 543 'lp-ajax': args.action 544 }) : args.data, 545 beforeSend = args.beforeSend || function () {}, 546 url = args.url || window.location.href; // console.debug( beforeSend ); 547 548 549 $.ajax({ 550 data: data, 551 url: url, 552 type: type, 553 dataType: 'html', 554 beforeSend: beforeSend.apply(null, args), 555 success: function success(raw) { 556 var response = LP.parseResponse(raw, dataType); 557 $.isFunction(args.success) && args.success(response, raw); 558 }, 559 error: function error() { 560 $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array()); 561 } 562 }); 563 }, 564 doAjax: function doAjax(args) { 565 var type = args.type || 'post', 566 dataType = args.dataType || 'json', 567 action = (args.prefix === undefined || 'learnpress_') + args.action, 568 data = args.action ? $.extend(args.data, { 569 action: action 570 }) : args.data; 571 $.ajax({ 572 data: data, 573 url: args.url || window.location.href, 574 type: type, 575 dataType: 'html', 576 success: function success(raw) { 577 var response = LP.parseResponse(raw, dataType); 578 $.isFunction(args.success) && args.success(response, raw); 579 }, 580 error: function error() { 581 $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array()); 582 } 583 }); 584 }, 585 funcArgs2Array: function funcArgs2Array(args) { 586 var arr = []; 587 588 for (var i = 0; i < args.length; i++) { 589 arr.push(args[i]); 590 } 591 592 return arr; 593 }, 594 addFilter: function addFilter(action, callback) { 595 var $doc = $(document), 596 event = 'LP.' + action; 597 $doc.on(event, callback); 598 LP.log($doc.data('events')); 599 return this; 600 }, 601 applyFilters: function applyFilters() { 602 var $doc = $(document), 603 action = arguments[0], 604 args = this.funcArgs2Array(arguments); 605 606 if ($doc.hasEvent(action)) { 607 args[0] = 'LP.' + action; 608 return $doc.triggerHandler.apply($doc, args); 609 } 610 611 return args[1]; 612 }, 613 addAction: function addAction(action, callback) { 614 return this.addFilter(action, callback); 615 }, 616 doAction: function doAction() { 617 var $doc = $(document), 618 action = arguments[0], 619 args = this.funcArgs2Array(arguments); 620 621 if ($doc.hasEvent(action)) { 622 args[0] = 'LP.' + action; 623 $doc.trigger.apply($doc, args); 624 } 625 }, 626 toElement: function toElement(element, args) { 627 if ($(element).length === 0) { 628 return; 629 } 630 631 args = $.extend({ 632 delay: 300, 633 duration: 'slow', 634 offset: 50, 635 container: null, 636 callback: null, 637 invisible: false 638 }, args || {}); 639 var $container = $(args.container), 640 rootTop = 0; 641 642 if ($container.length === 0) { 643 $container = $('body, html'); 644 } 645 646 rootTop = $container.offset().top; 647 var to = $(element).offset().top + $container.scrollTop() - rootTop - args.offset; 648 649 function isElementInView(element, fullyInView) { 650 var pageTop = $container.scrollTop(); 651 var pageBottom = pageTop + $container.height(); 652 var elementTop = $(element).offset().top - $container.offset().top; 653 var elementBottom = elementTop + $(element).height(); 654 655 if (fullyInView === true) { 656 return pageTop < elementTop && pageBottom > elementBottom; 657 } 658 659 return elementTop <= pageBottom && elementBottom >= pageTop; 660 } 661 662 if (args.invisible && isElementInView(element, true)) { 663 return; 664 } 665 666 $container.fadeIn(10).delay(args.delay).animate({ 667 scrollTop: to 668 }, args.duration, args.callback); 669 }, 670 uniqueId: function uniqueId(prefix, more_entropy) { 671 if (typeof prefix === 'undefined') { 672 prefix = ''; 673 } 674 675 var retId; 676 677 var formatSeed = function formatSeed(seed, reqWidth) { 678 seed = parseInt(seed, 10).toString(16); // to hex str 679 680 if (reqWidth < seed.length) { 681 // so long we split 682 return seed.slice(seed.length - reqWidth); 683 } 684 685 if (reqWidth > seed.length) { 686 // so short we pad 687 return new Array(1 + (reqWidth - seed.length)).join('0') + seed; 688 } 689 690 return seed; 691 }; // BEGIN REDUNDANT 692 693 694 if (!this.php_js) { 695 this.php_js = {}; 696 } // END REDUNDANT 697 698 699 if (!this.php_js.uniqidSeed) { 700 // init seed with big random int 701 this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15); 702 } 703 704 this.php_js.uniqidSeed++; 705 retId = prefix; // start with prefix, add current milliseconds hex string 706 707 retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8); 708 retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string 709 710 if (more_entropy) { 711 // for more entropy we add a float lower to 10 712 retId += (Math.random() * 10).toFixed(8).toString(); 713 } 714 715 return retId; 716 }, 717 log: function log() { 718 //if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) { 719 for (var i = 0, n = arguments.length; i < n; i++) { 720 console.log(arguments[i]); 721 } //} 722 723 }, 724 blockContent: function blockContent() { 725 if ($('#learn-press-block-content').length === 0) { 726 $(LP.template('learn-press-template-block-content', {})).appendTo($('body')); 727 } 728 729 LP.hideMainScrollbar().addClass('block-content'); 730 $(document).trigger('learn_press_block_content'); 731 }, 732 unblockContent: function unblockContent() { 733 setTimeout(function () { 734 LP.showMainScrollbar().removeClass('block-content'); 735 $(document).trigger('learn_press_unblock_content'); 736 }, 350); 737 }, 738 hideMainScrollbar: function hideMainScrollbar(el) { 739 if (!el) { 740 el = 'html, body'; 741 } 742 743 var $el = $(el); 744 $el.each(function () { 745 var $root = $(this), 746 overflow = $root.css('overflow'); 747 $root.css('overflow', 'hidden').attr('overflow', overflow); 748 }); 749 return $el; 750 }, 751 showMainScrollbar: function showMainScrollbar(el) { 752 if (!el) { 753 el = 'html, body'; 754 } 755 756 var $el = $(el); 757 $el.each(function () { 758 var $root = $(this), 759 overflow = $root.attr('overflow'); 760 $root.css('overflow', overflow).removeAttr('overflow'); 761 }); 762 return $el; 763 }, 764 template: typeof _ !== 'undefined' ? _.memoize(function (id, data) { 765 var compiled, 766 options = { 767 evaluate: /<#([\s\S]+?)#>/g, 768 interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, 769 escape: /\{\{([^\}]+?)\}\}(?!\})/g, 770 variable: 'data' 771 }; 772 773 var tmpl = function tmpl(data) { 774 compiled = compiled || _.template($('#' + id).html(), null, options); 775 return compiled(data); 776 }; 777 778 return data ? tmpl(data) : tmpl; 779 }, function (a, b) { 780 return a + '-' + JSON.stringify(b); 781 }) : function () { 782 return ''; 783 }, 784 alert: function alert(localize, callback) { 785 var title = '', 786 message = ''; 787 788 if (typeof localize === 'string') { 789 message = localize; 790 } else { 791 if (typeof localize.title !== 'undefined') { 792 title = localize.title; 793 } 794 795 if (typeof localize.message !== 'undefined') { 796 message = localize.message; 797 } 798 } 799 800 $.alerts.alert(message, title, function (e) { 801 LP._on_alert_hide(); 802 803 callback && callback(e); 804 }); 805 806 this._on_alert_show(); 807 }, 808 confirm: function confirm(localize, callback) { 809 var title = '', 810 message = ''; 811 812 if (typeof localize === 'string') { 813 message = localize; 814 } else { 815 if (typeof localize.title !== 'undefined') { 816 title = localize.title; 817 } 818 819 if (typeof localize.message !== 'undefined') { 820 message = localize.message; 821 } 822 } 823 824 $.alerts.confirm(message, title, function (e) { 825 LP._on_alert_hide(); 826 827 callback && callback(e); 828 }); 829 830 this._on_alert_show(); 831 }, 832 _on_alert_show: function _on_alert_show() { 833 var $container = $('#popup_container'), 834 $placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container); 835 $container.stop().css('top', '-=50').css('opacity', '0').animate({ 836 top: '+=50', 837 opacity: 1 838 }, 250); 839 }, 840 _on_alert_hide: function _on_alert_hide() { 841 var $holder = $('#popup_container_placeholder'), 842 $container = $holder.data('xxx'); 843 844 if ($container) { 845 $container.replaceWith($holder); 846 } 847 848 $container.appendTo($(document.body)); 849 $container.stop().animate({ 850 top: '+=50', 851 opacity: 0 852 }, 250, function () { 853 $(this).remove(); 854 }); 855 }, 856 sendMessage: function sendMessage(data, object, targetOrigin, transfer) { 857 if ($.isPlainObject(data)) { 858 data = JSON.stringify(data); 859 } 860 861 object = object || window; 862 targetOrigin = targetOrigin || '*'; 863 object.postMessage(data, targetOrigin, transfer); 864 }, 865 receiveMessage: function receiveMessage(event, b) { 866 var target = event.origin || event.originalEvent.origin, 867 data = event.data || event.originalEvent.data || ''; 868 869 if (typeof data === 'string' || data instanceof String) { 870 if (data.indexOf('{') === 0) { 871 data = LP.parseJSON(data); 872 } 873 } 874 875 LP.Hook.doAction('learn_press_receive_message', data, target); 876 } 877}; 878$(document).ready(function () { 879 if (typeof $.alerts !== 'undefined') { 880 $.alerts.overlayColor = '#000'; 881 $.alerts.overlayOpacity = 0.5; 882 $.alerts.okButton = lpGlobalSettings.localize.button_ok; 883 $.alerts.cancelButton = lpGlobalSettings.localize.button_cancel; 884 } 885 886 $('.learn-press-message.fixed').each(function () { 887 var $el = $(this), 888 options = $el.data(); 889 890 (function ($el, options) { 891 if (options.delayIn) { 892 setTimeout(function () { 893 $el.show().hide().fadeIn(); 894 }, options.delayIn); 895 } 896 897 if (options.delayOut) { 898 setTimeout(function () { 899 $el.fadeOut(); 900 }, options.delayOut + (options.delayIn || 0)); 901 } 902 })($el, options); 903 }); 904 $('body').on('click', '.learn-press-nav-tabs li a', function (e) { 905 e.preventDefault(); 906 var $tab = $(this), 907 url = ''; 908 $tab.closest('li').addClass('active').siblings().removeClass('active'); 909 $($tab.attr('data-tab')).addClass('active').siblings().removeClass('active'); 910 $(document).trigger('learn-press/nav-tabs/clicked', $tab); 911 }); 912 setTimeout(function () { 913 $('.learn-press-nav-tabs li.active:not(.default) a').trigger('click'); 914 }, 300); 915 $('body.course-item-popup').parent().css('overflow', 'hidden'); 916 917 (function () { 918 var timer = null, 919 callback = function callback() { 920 $('.auto-check-lines').checkLines(function (r) { 921 if (r > 1) { 922 $(this).removeClass('single-lines'); 923 } else { 924 $(this).addClass('single-lines'); 925 } 926 927 $(this).attr('rows', r); 928 }); 929 }; 930 931 $(window).on('resize.check-lines', function () { 932 if (timer) { 933 timer && clearTimeout(timer); 934 timer = setTimeout(callback, 300); 935 } else { 936 callback(); 937 } 938 }); 939 })(); 940 941 $('.learn-press-tooltip, .lp-passing-conditional').LP_Tooltip({ 942 offset: [24, 24] 943 }); 944 $('.learn-press-icon').LP_Tooltip({ 945 offset: [30, 30] 946 }); 947 $('.learn-press-message[data-autoclose]').each(function () { 948 var $el = $(this),
949 delay = parseInt($el.data('autoclose')); 950 951 if (delay) { 952 setTimeout(function ($el) { 953 $el.fadeOut(); 954 }, delay, $el); 955 } 956 }); 957 $(document).on('click', function () { 958 $(document).trigger('learn-press/close-all-quick-tip'); 959 }); 960}); 961Object(_extend__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread({ 962 Event_Callback: _event_callback__WEBPACK_IMPORTED_MODULE_4__["default"], 963 MessageBox: _message_box__WEBPACK_IMPORTED_MODULE_3__["default"] 964}, _default)); 965/* harmony default export */ __webpack_exports__["default"] = ({ 966 fn: _fn__WEBPACK_IMPORTED_MODULE_1__["default"], 967 QuickTip: _quick_tip__WEBPACK_IMPORTED_MODULE_2___default.a 968}); 969 970/***/ }), 971
972/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/jquery.plugins.js": 973/*!************************************************************************************************************!*\ 974 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/jquery.plugins.js ***! 975 \************************************************************************************************************/ 976/*! exports provided: default */ 977/***/ (function(module, __webpack_exports__, __webpack_require__) { 978 979"use strict"; 980__webpack_require__.r(__webpack_exports__); 981function _typeof(obj) { "@babel/helpers - typeof"; 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); } 982 983var $ = window.jQuery; 984 985var serializeJSON = function serializeJSON(path) { 986 var isInput = $(this).is('input') || $(this).is('select') || $(this).is('textarea'); 987 var unIndexed = isInput ? $(this).serializeArray() : $(this).find('input, select, textarea').serializeArray(), 988 indexed = {}, 989 validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g, 990 arrayKeys = {}, 991 end = false; 992 $.each(unIndexed, function () { 993 var that = this, 994 match = this.name.match(/^([0-9a-zA-Z_-]+)/); 995 996 if (!match) { 997 return; 998 } 999 1000 var keys = this.name.match(validate), 1001 objPath = "indexed['" + match[0] + "']"; 1002 1003 if (keys) { 1004 if (_typeof(indexed[match[0]]) != 'object') { 1005 indexed[match[0]] = {}; 1006 } 1007 1008 $.each(keys, function (i, prop) { 1009 prop = prop.replace(/\]|\[/g, ''); 1010 var rawPath = objPath.replace(/'|\[|\]/g, ''), 1011 objExp = '', 1012 preObjPath = objPath; 1013 1014 if (prop == '') { 1015 if (arrayKeys[rawPath] == undefined) { 1016 arrayKeys[rawPath] = 0; 1017 } else { 1018 arrayKeys[rawPath]++; 1019 } 1020 1021 objPath += "['" + arrayKeys[rawPath] + "']"; 1022 } else { 1023 if (!isNaN(prop)) { 1024 arrayKeys[rawPath] = prop; 1025 } 1026 1027 objPath += "['" + prop + "']"; 1028 } 1029 1030 try { 1031 if (i == keys.length - 1) { 1032 objExp = objPath + "=that.value;"; 1033 end = true; 1034 } else { 1035 objExp = objPath + "={}"; 1036 end = false; 1037 } 1038 1039 var evalString = "" + "if( typeof " + objPath + " == 'undefined'){" + objExp + ";" + "}else{" + "if(end){" + "if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}" + "}"; 1040 eval(evalString); 1041 } catch (e) { 1042 console.log('Error:' + e + "\n" + objExp); 1043 } 1044 }); 1045 } else { 1046 indexed[match[0]] = this.value; 1047 } 1048 }); 1049 1050 if (path) { 1051 path = "['" + path.replace('.', "']['") + "']"; 1052 var c = 'try{indexed = indexed' + path + '}catch(ex){console.log(c, ex);}'; 1053 eval(c); 1054 } 1055 1056 return indexed; 1057}; 1058 1059var LP_Tooltip = function LP_Tooltip(options) { 1060 options = $.extend({}, { 1061 offset: [0, 0] 1062 }, options || {}); 1063 return $.each(this, function () { 1064 var $el = $(this), 1065 content = $el.data('content'); 1066 1067 if (!content || $el.data('LP_Tooltip') !== undefined) { 1068 return; 1069 } 1070 1071 var $tooltip = null; 1072 $el.hover(function (e) { 1073 $tooltip = $('<div class="learn-press-tooltip-bubble"/>').html(content).appendTo($('body')).hide(); 1074 var position = $el.offset(); 1075 1076 if ($.isArray(options.offset)) { 1077 var top = options.offset[1], 1078 left = options.offset[0]; 1079 1080 if ($.isNumeric(left)) { 1081 position.left += left; 1082 } else {} 1083 1084 if ($.isNumeric(top)) { 1085 position.top += top; 1086 } else {} 1087 } 1088 1089 $tooltip.css({ 1090 top: position.top, 1091 left: position.left 1092 }); 1093 $tooltip.fadeIn(); 1094 }, function () { 1095 $tooltip && $tooltip.remove(); 1096 }); 1097 $el.data('tooltip', true); 1098 }); 1099}; 1100 1101var hasEvent = function hasEvent(name) { 1102 var events = $(this).data('events'); 1103 1104 if (typeof events.LP == 'undefined') { 1105 return false;
1106 } 1107 1108 for (i = 0; i < events.LP.length; i++) { 1109 if (events.LP[i].namespace == name) { 1110 return true; 1111 } 1112 } 1113 1114 return false; 1115}; 1116 1117var dataToJSON = function dataToJSON() { 1118 var json = {}; 1119 $.each(this[0].attributes, function () { 1120 var m = this.name.match(/^data-(.*)/); 1121 1122 if (m) { 1123 json[m[1]] = this.value; 1124 } 1125 }); 1126 return json; 1127}; 1128 1129var rows = function rows() { 1130 var h = $(this).height(); 1131 var lh = $(this).css('line-height').replace("px", ""); 1132 $(this).attr({ 1133 height: h, 1134 'line-height': lh 1135 }); 1136 return Math.floor(h / parseInt(lh)); 1137}; 1138 1139var checkLines = function checkLines(p) { 1140 return this.each(function () { 1141 var $e = $(this), 1142 rows = $e.rows(); 1143 p.call(this, rows); 1144 }); 1145}; 1146 1147var findNext = function findNext(selector) { 1148 var $selector = $(selector), 1149 $root = this.first(), 1150 index = $selector.index($root), 1151 $next = $selector.eq(index + 1); 1152 return $next.length ? $next : false; 1153}; 1154 1155var findPrev = function findPrev(selector) { 1156 var $selector = $(selector), 1157 $root = this.first(), 1158 index = $selector.index($root), 1159 $prev = $selector.eq(index - 1); 1160 return $prev.length ? $prev : false; 1161}; 1162 1163var progress = function progress(v) { 1164 return this.each(function () { 1165 var t = parseInt(v / 100 * 360), 1166 timer = null, 1167 $this = $(this); 1168 1169 if (t < 180) { 1170 $this.find('.progress-circle').removeClass('gt-50'); 1171 } else { 1172 $this.find('.progress-circle').addClass('gt-50'); 1173 } 1174 1175 $this.find('.fill').css({ 1176 transform: 'rotate(' + t + 'deg)' 1177 }); 1178 }); 1179}; 1180 1181$.fn.serializeJSON = serializeJSON; 1182$.fn.LP_Tooltip = LP_Tooltip; 1183$.fn.hasEvent = hasEvent; 1184$.fn.dataToJSON = dataToJSON; 1185$.fn.rows = rows; 1186$.fn.checkLines = checkLines; 1187$.fn.findNext = findNext; 1188$.fn.findPrev = findPrev; 1189$.fn.progress = progress; 1190/* harmony default export */ __webpack_exports__["default"] = ({ 1191 serializeJSON: serializeJSON, 1192 LP_Tooltip: LP_Tooltip, 1193 hasEvent: hasEvent, 1194 dataToJSON: dataToJSON, 1195 rows: rows, 1196 checkLines: checkLines, 1197 findNext: findNext, 1198 findPrev: findPrev, 1199 progress: progress 1200}); 1201 1202/***/ }), 1203
1204/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/message-box.js": 1205/*!*********************************************************************************************************!*\ 1206 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/message-box.js ***! 1207 \*********************************************************************************************************/ 1208/*! exports provided: default */ 1209/***/ (function(module, __webpack_exports__, __webpack_require__) { 1210 1211"use strict"; 1212__webpack_require__.r(__webpack_exports__); 1213var $ = window.jQuery; 1214var MessageBox = { 1215 /* 1216 * 1217 */ 1218 $block: null, 1219 $window: null, 1220 events: {}, 1221 instances: [], 1222 instance: null, 1223 quickConfirm: function quickConfirm(elem, args) { 1224 var $e = $(elem); 1225 $('[learn-press-quick-confirm]').each(function () { 1226 var $ins; 1227 ($ins = $(this).data('quick-confirm')) && (console.log($ins), $ins.destroy()); 1228 }); 1229 !$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm', new function (elem, args) { 1230 var $elem = $(elem), 1231 $div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem),
1232 //($(document.body)), 1233 offset = $(elem).position() || { 1234 left: 0, 1235 top: 0 1236 }, 1237 timerOut = null, 1238 timerHide = null, 1239 n = 3, 1240 hide = function hide() { 1241 $div.fadeOut('fast', function () { 1242 $(this).remove(); 1243 $div.parent().css('position', ''); 1244 }); 1245 $elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined); 1246 stop(); 1247 }, 1248 stop = function stop() { 1249 timerHide && clearInterval(timerHide); 1250 timerOut && clearInterval(timerOut); 1251 }, 1252 start = function start() { 1253 timerOut = setInterval(function () { 1254 if (--n == 0) { 1255 hide.call($div[0]); 1256 $.isFunction(args.onCancel) && args.onCancel(args.data); 1257 stop(); 1258 } 1259 1260 $div.find('span').html(' (' + n + ')'); 1261 }, 1000); 1262 timerHide = setInterval(function () { 1263 if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') { 1264 stop(); 1265 $div.remove(); 1266 $div.parent().css('position', ''); 1267 $.isFunction(args.onCancel) && args.onCancel(args.data); 1268 } 1269 }, 350); 1270 }; 1271 1272 args = $.extend({ 1273 message: '', 1274 data: null, 1275 onOk: null, 1276 onCancel: null, 1277 offset: { 1278 top: 0, 1279 left: 0 1280 } 1281 }, args || {}); 1282 $div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append('<span> (' + n + ')</span>').css({}); 1283 $div.click(function () { 1284 $.isFunction(args.onOk) && args.onOk(args.data); 1285 hide(); 1286 }).hover(function () { 1287 stop(); 1288 }, function () { 1289 start(); 1290 }); //$div.parent().css('position', 'relative'); 1291 1292 $div.css({ 1293 left: offset.left + $elem.outerWidth() - $div.outerWidth() + args.offset.left, 1294 top: offset.top + $elem.outerHeight() + args.offset.top + 5 1295 }).hide().fadeIn('fast'); 1296 start(); 1297 1298 this.destroy = function () { 1299 $div.remove(); 1300 $elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined); 1301 stop(); 1302 }; 1303 }(elem, args)); 1304 }, 1305 show: function show(message, args) { 1306 //this.hide(); 1307 $.proxy(function () { 1308 args = $.extend({ 1309 title: '', 1310 buttons: '', 1311 events: false, 1312 autohide: false, 1313 message: message, 1314 data: false, 1315 id: LP.uniqueId(), 1316 onHide: null 1317 }, args || {}); 1318 this.instances.push(args); 1319 this.instance = args; 1320 var $doc = $(document), 1321 $body = $(document.body); 1322 1323 if (!this.$block) { 1324 this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body); 1325 } 1326 1327 if (!this.$window) { 1328 this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block); 1329 this.$window.click(function () {}); 1330 } //this.events = args.events || {}; 1331 1332 1333 this._createWindow(message, args.title, args.buttons); 1334 1335 this.$block.show(); 1336 this.$window.show().attr('instance', args.id); 1337 $(window).bind('resize.message-box', $.proxy(this.update, this)).bind('scroll.message-box', $.proxy(this.update, this)); 1338 this.update(true); 1339 1340 if (args.autohide) { 1341 setTimeout(function () { 1342 LP.MessageBox.hide(); 1343 $.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args); 1344 }, args.autohide); 1345 } 1346 }, this)(); 1347 }, 1348 blockUI: function blockUI(message) { 1349 message = (message !== false ? message ? message : 'Wait a moment' : '') + '<div class="message-box-animation"></div>'; 1350 this.show(message); 1351 }, 1352 hide: function hide(delay, instance) { 1353 if (instance) { 1354 this._removeInstance(instance.id); 1355 } else if (this.instance) { 1356 this._removeInstance(this.instance.id); 1357 } 1358 1359 if (this.instances.length === 0) { 1360 if (this.$block) { 1361 this.$block.hide(); 1362 } 1363 1364 if (this.$window) { 1365 this.$window.hide(); 1366 } 1367 1368 $(window).unbind('resize.message-box', this.update).unbind('scroll.message-box', this.update); 1369 } else { 1370 if (this.instance) { 1371 this._createWindow(this.instance.message, this.instance.title, this.instance.buttons); 1372 } 1373 } 1374 }, 1375 update: function update(force) { 1376 var that = this, 1377 $wrap = this.$window.find('#message-box-wrap'), 1378 timer = $wrap.data('timer'), 1379 _update = function _update() { 1380 LP.Hook.doAction('learn_press_message_box_before_resize', that); 1381 var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'), 1382 width = $wrap.outerWidth(), 1383 height = $wrap.outerHeight(), 1384 contentHeight = $content.height(), 1385 windowHeight = $(window).height(), 1386 top = $wrap.offset().top; 1387 1388 if (contentHeight > windowHeight - 50) { 1389 $content.css({ 1390 height: windowHeight - 25 1391 }); 1392 height = $wrap.outerHeight(); 1393 } else { 1394 $content.css("height", "").css('overflow', ''); 1395 } 1396 1397 $wrap.css({ 1398 marginTop: ($(window).height() - height) / 2 1399 }); 1400 LP.Hook.doAction('learn_press_message_box_resize', height, that); 1401 }; 1402 1403 if (force) _update(); 1404 timer && clearTimeout(timer); 1405 timer = setTimeout(_update, 250); 1406 }, 1407 _removeInstance: function _removeInstance(id) { 1408 for (var i = 0; i < this.instances.length; i++) { 1409 if (this.instances[i].id === id) { 1410 this.instances.splice(i, 1); 1411 var len = this.instances.length; 1412 1413 if (len) { 1414 this.instance = this.instances[len - 1]; 1415 this.$window.attr('instance', this.instance.id); 1416 } else { 1417 this.instance = false;
1418 this.$window.removeAttr('instance'); 1419 } 1420 1421 break; 1422 } 1423 } 1424 }, 1425 _getInstance: function _getInstance(id) { 1426 for (var i = 0; i < this.instances.length; i++) { 1427 if (this.instances[i].id === id) { 1428 return this.instances[i]; 1429 } 1430 } 1431 }, 1432 _createWindow: function _createWindow(message, title, buttons) { 1433 var $wrap = this.$window.find('#message-box-wrap').html(''); 1434 1435 if (title) { 1436 $wrap.append('<h3 class="message-box-title">' + title + '</h3>'); 1437 } 1438 1439 $wrap.append($('<div class="message-box-content"></div>').html(message)); 1440 1441 if (buttons) { 1442 var $buttons = $('<div class="message-box-buttons"></div>'); 1443 1444 switch (buttons) { 1445 case 'yesNo': 1446 $buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes')); 1447 $buttons.append(this._createButton(LP_Settings.localize.button_no, 'no')); 1448 break; 1449 1450 case 'okCancel': 1451 $buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok')); 1452 $buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel')); 1453 break; 1454 1455 default: 1456 $buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok')); 1457 } 1458 1459 $wrap.append($buttons); 1460 } 1461 }, 1462 _createButton: function _createButton(title, type) { 1463 var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + '</button>'), 1464 callback = 'on' + (type.substr(0, 1).toUpperCase() + type.substr(1)); 1465 $button.data('callback', callback).click(function () { 1466 var instance = $(this).data('instance'), 1467 callback = instance.events[$(this).data('callback')]; 1468 1469 if ($.type(callback) === 'function') { 1470 if (callback.apply(LP.MessageBox, [instance]) === false) {// return; 1471 } else { 1472 LP.MessageBox.hide(null, instance); 1473 } 1474 } else { 1475 LP.MessageBox.hide(null, instance); 1476 } 1477 }).data('instance', this.instance); 1478 return $button; 1479 } 1480}; 1481/* harmony default export */ __webpack_exports__["default"] = (MessageBox); 1482 1483/***/ }), 1484
1485/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/quick-tip.js": 1486/*!*******************************************************************************************************!*\ 1487 !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/quick-tip.js ***! 1488 \*******************************************************************************************************/ 1489/*! no static exports found */ 1490/***/ (function(module, exports) { 1491 1492; 1493 1494(function ($) { 1495 function QuickTip(el, options) { 1496 var $el = $(el), 1497 uniId = $el.attr('data-id') || LP.uniqueId(); 1498 options = $.extend({ 1499 event: 'hover', 1500 autoClose: true, 1501 single: true, 1502 closeInterval: 1000, 1503 arrowOffset: null, 1504 tipClass: '' 1505 }, options, $el.data()); 1506 $el.attr('data-id', uniId); 1507 var content = $el.attr('data-content-tip') || $el.html(), 1508 $tip = $('<div class="learn-press-tip-floating">' + content + '</div>'), 1509 t = null, 1510 closeInterval = 0, 1511 useData = false, 1512 arrowOffset = options.arrowOffset === 'el' ? $el.outerWidth() / 2 : 8, 1513 $content = $('#__' + uniId); 1514 1515 if ($content.length === 0) { 1516 $(document.body).append($('<div />').attr('id', '__' + uniId).html(content).css('display', 'none')); 1517 } 1518 1519 content = $content.html(); 1520 $tip.addClass(options.tipClass); 1521 $el.data('content-tip', content); 1522 1523 if ($el.attr('data-content-tip')) { 1524 //$el.removeAttr('data-content-tip'); 1525 useData = true; 1526 } 1527 1528 closeInterval = options.closeInterval; 1529 1530 if (options.autoClose === false) { 1531 $tip.append('<a class="close"></a>'); 1532 $tip.on('click', '.close', function () { 1533 close(); 1534 }); 1535 } 1536 1537 function show() { 1538 if (t) { 1539 clearTimeout(t); 1540 return; 1541 } 1542 1543 if (options.single) { 1544 $('.learn-press-tip').not($el).LP('QuickTip', 'close'); 1545 } 1546 1547 $tip.appendTo(document.body); 1548 var pos = $el.offset(); 1549 $tip.css({ 1550 top: pos.top - $tip.outerHeight() - 8, 1551 left: pos.left - $tip.outerWidth() / 2 + arrowOffset 1552 }); 1553 } 1554 1555 function hide() { 1556 t && clearTimeout(t); 1557 t = setTimeout(function () { 1558 $tip.detach(); 1559 t = null; 1560 }, closeInterval); 1561 } 1562 1563 function close() { 1564 closeInterval = 0; 1565 hide(); 1566 closeInterval = options.closeInterval; 1567 } 1568 1569 function open() { 1570 show(); 1571 } 1572 1573 if (!useData) { 1574 $el.html(''); 1575 } 1576 1577 if (options.event === 'click') { 1578 $el.on('click', function (e) { 1579 e.stopPropagation(); 1580 show(); 1581 }); 1582 } 1583 1584 $(document).on('learn-press/close-all-quick-tip', function () { 1585 close(); 1586 }); 1587 $el.hover(function (e) { 1588 e.stopPropagation(); 1589 1590 if (options.event !== 'click') { 1591 show(); 1592 } 1593 }, function (e) { 1594 e.stopPropagation(); 1595 1596 if (options.autoClose) { 1597 hide(); 1598 } 1599 }).addClass('ready'); 1600 return { 1601 close: close, 1602 open: open 1603 }; 1604 } 1605 1606 $.fn.LP('QuickTip', function (options) { 1607 return $.each(this, function () { 1608 var $tip = $(this).data('quick-tip'); 1609 1610 if (!$tip) { 1611 $tip = new QuickTip(this, options); 1612 $(this).data('quick-tip', $tip); 1613 } 1614 1615 if ($.type(options) === 'string') { 1616 $tip[options] && $tip[options].apply($tip); 1617 } 1618 }); 1619 }); 1620})(jQuery); 1621 1622/***/ })
1622 1623 1624/******/ }); 1625//# sourceMappingURL=utils.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.