Version Description
~ Added option to exclude js/css libraries unnecessary (used in theme or other plugins). ~ Added alt prop to user profile avatar. ~ Fixed can't next/prev questions when doing quiz. ~ Fixed wrong items navigation when learning course. ~ Fixed missing js of some pages in admin. ~ Fixed can't close admin notices. ~ Updated envato api to newer version.
Download this release
Release Info
Developer | tunnhn |
Plugin | LearnPress – WordPress LMS Plugin |
Version | 3.2.6 |
Comparing to | |
See all releases |
Code changes from version 3.2.5.6 to 3.2.6
- assets/css/admin.bundle.min.css +4 -0
- assets/css/admin/admin.css +53 -0
- assets/{scss/_icons.scss → css/bundle.css} +0 -0
- assets/css/bundle.min.css +4 -0
- assets/css/learnpress.css +3 -0
- assets/css/{font-awesome.min.css → vendor/font-awesome.min.css} +0 -0
- assets/css/{jalert.css → vendor/jalert.css} +0 -0
- assets/{js/vendor/jquery-scrollbar → css/vendor}/jquery.scrollbar.css +0 -0
- assets/{js/vendor/jquery-tipsy → css/vendor}/jquery.tipsy.css +0 -0
- assets/js/admin/admin-tabs.js +0 -88
- assets/js/admin/admin-tools.js +0 -106
- assets/js/admin/admin.js +311 -403
- assets/js/admin/admin.min.js +1 -0
- assets/js/admin/all.js +0 -1
- assets/js/admin/attributes.js +0 -92
- assets/js/admin/conditional-logic.js +102 -22
- assets/js/admin/conditional-logic.min.js +1 -0
- assets/js/admin/course-editor.js +0 -866
- assets/js/admin/editor/course.js +1136 -0
- assets/js/admin/editor/course.min.js +1 -0
- assets/js/admin/editor/question.js +469 -0
- assets/js/admin/editor/question.min.js +1 -0
- assets/js/admin/editor/quiz.js +1252 -0
- assets/js/admin/editor/quiz.min.js +1 -0
- assets/js/admin/index.php +0 -1
- assets/js/admin/learnpress.js +1071 -0
- assets/js/admin/learnpress.min.js +1 -0
- assets/js/admin/meta-box-order.js +0 -461
- assets/js/admin/modal-search-items.js +0 -145
- assets/js/admin/modal-search-users.js +0 -148
- assets/js/admin/pages/setup.js +261 -0
- assets/js/admin/pages/setup.min.js +1 -0
- assets/js/admin/pages/statistic.js +365 -0
- assets/js/admin/pages/statistic.min.js +1 -0
- assets/js/admin/partial/meta-box-order.js +240 -0
- assets/js/admin/partial/meta-box-order.min.js +1 -0
- assets/js/admin/question-editor.js +0 -330
- assets/js/admin/quiz-editor.js +0 -1002
- assets/js/admin/settings.js +0 -235
- assets/js/admin/setup.js +0 -153
- assets/js/admin/statistic.js +0 -286
- assets/js/admin/sync-data.js +0 -268
- assets/js/admin/update.js +0 -238
- assets/js/admin/utils.js +2730 -1
- assets/js/admin/utils.min.js +1 -0
- assets/js/admin/utils/_advanced-list.js +0 -133
- assets/js/admin/utils/_advertisement.js +0 -79
- assets/js/admin/utils/_cookie.js +0 -3
- assets/js/admin/utils/_dropdown-pages.js +0 -130
- assets/js/admin/utils/_search-items.js +0 -46
- assets/js/frontend/learnpress.js +81 -3
- assets/js/frontend/learnpress.min.js +1 -0
- assets/js/frontend/quiz.bak.js +0 -915
- assets/js/frontend/utils.js +83 -0
- assets/js/frontend/utils.min.js +1 -0
- assets/js/global.js +1323 -1154
- assets/js/global.min.js +1 -600
- assets/js/index.php +0 -1
- assets/js/utils.js +1506 -0
- assets/js/utils.min.js +1 -0
- assets/js/vendor/Chart.bundle.min.js +0 -16
assets/css/admin.bundle.min.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
|
3 |
+
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
4 |
+
*/@font-face{font-family:FontAwesome;src:url(../fonts/awesome/fontawesome-webfont.eot?v=4.7.0);src:url(../fonts/awesome/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'),url(../fonts/awesome/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(../fonts/awesome/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(../fonts/awesome/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(../fonts/awesome/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.tipsy{font-size:12px;position:absolute;padding:5px;z-index:100000}.tipsy-inner{background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center}.tipsy-inner{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}.tipsy-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.tipsy-arrow-n{border-bottom-color:#000}.tipsy-arrow-s{border-top-color:#000}.tipsy-arrow-e{border-left-color:#000}.tipsy-arrow-w{border-right-color:#000}.tipsy-n .tipsy-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:0;border-top-color:transparent;border-bottom-color:transparent}
|
assets/css/admin/admin.css
CHANGED
@@ -390,6 +390,18 @@
|
|
390 |
.rwmb-duration {
|
391 |
border: 1px solid #ddd; }
|
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
@-moz-keyframes lp-spinner {
|
394 |
100% {
|
395 |
-moz-transform: rotate(360deg); } }
|
@@ -1639,6 +1651,20 @@
|
|
1639 |
clear: both;
|
1640 |
width: auto;
|
1641 |
padding: 8px 12px 0 12px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1642 |
.lp-order-statuses li:nth-child(even) .counter-inner {
|
1643 |
margin-left: 0; }
|
1644 |
.lp-order-statuses li:nth-child(odd) .counter-inner {
|
@@ -3184,6 +3210,33 @@ body.lp-item-moving {
|
|
3184 |
position: absolute;
|
3185 |
right: 12px;
|
3186 |
top: 12px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3187 |
|
3188 |
.learn-press-dropdown-pages {
|
3189 |
display: inline-block; }
|
390 |
.rwmb-duration {
|
391 |
border: 1px solid #ddd; }
|
392 |
|
393 |
+
.clearfix {
|
394 |
+
clear: both;
|
395 |
+
height: 0;
|
396 |
+
opacity: 0; }
|
397 |
+
|
398 |
+
.clearfix-after:after {
|
399 |
+
clear: both;
|
400 |
+
height: 0;
|
401 |
+
opacity: 0;
|
402 |
+
display: block;
|
403 |
+
content: ''; }
|
404 |
+
|
405 |
@-moz-keyframes lp-spinner {
|
406 |
100% {
|
407 |
-moz-transform: rotate(360deg); } }
|
1651 |
clear: both;
|
1652 |
width: auto;
|
1653 |
padding: 8px 12px 0 12px; }
|
1654 |
+
.lp-order-statuses li.featured-theme .star-rating {
|
1655 |
+
display: inline-block;
|
1656 |
+
line-height: 14px;
|
1657 |
+
vertical-align: middle; }
|
1658 |
+
.lp-order-statuses li.featured-theme .star-rating .star {
|
1659 |
+
font-size: 14px;
|
1660 |
+
width: 14px;
|
1661 |
+
height: 14px; }
|
1662 |
+
.lp-order-statuses li.featured-theme > div {
|
1663 |
+
margin-bottom: 3px; }
|
1664 |
+
.lp-order-statuses li.featured-theme > div span {
|
1665 |
+
font-size: 12px;
|
1666 |
+
vertical-align: middle;
|
1667 |
+
color: #999; }
|
1668 |
.lp-order-statuses li:nth-child(even) .counter-inner {
|
1669 |
margin-left: 0; }
|
1670 |
.lp-order-statuses li:nth-child(odd) .counter-inner {
|
3210 |
position: absolute;
|
3211 |
right: 12px;
|
3212 |
top: 12px; }
|
3213 |
+
.lp-notice .notice-dismiss,
|
3214 |
+
.learn-press-notice .notice-dismiss {
|
3215 |
+
position: absolute;
|
3216 |
+
top: 0;
|
3217 |
+
right: 1px;
|
3218 |
+
border: none;
|
3219 |
+
margin: 0;
|
3220 |
+
padding: 9px;
|
3221 |
+
background: 0 0;
|
3222 |
+
color: #72777c;
|
3223 |
+
cursor: pointer;
|
3224 |
+
outline: none;
|
3225 |
+
-webkit-box-shadow: none;
|
3226 |
+
-moz-box-shadow: none;
|
3227 |
+
box-shadow: none; }
|
3228 |
+
.lp-notice .notice-dismiss:before,
|
3229 |
+
.learn-press-notice .notice-dismiss:before {
|
3230 |
+
background: 0 0;
|
3231 |
+
color: #72777c;
|
3232 |
+
content: "\f153";
|
3233 |
+
display: block;
|
3234 |
+
font: normal 16px/20px dashicons;
|
3235 |
+
speak: none;
|
3236 |
+
height: 20px;
|
3237 |
+
text-align: center;
|
3238 |
+
width: 20px;
|
3239 |
+
-webkit-font-smoothing: antialiased; }
|
3240 |
|
3241 |
.learn-press-dropdown-pages {
|
3242 |
display: inline-block; }
|
assets/{scss/_icons.scss → css/bundle.css}
RENAMED
File without changes
|
assets/css/bundle.min.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.scroll-wrapper{overflow:hidden !important;padding:0 !important;position:relative}.scroll-wrapper>.scroll-content{border:none !important;box-sizing:content-box !important;height:auto;left:0;margin:0;max-height:none;max-width:none !important;overflow:scroll !important;padding:0;position:relative !important;top:0;width:auto !important}.scroll-wrapper>.scroll-content::-webkit-scrollbar{height:0;width:0}.scroll-element{display:none}.scroll-element,.scroll-element div{box-sizing:content-box}.scroll-element.scroll-x.scroll-scrollx_visible,.scroll-element.scroll-y.scroll-scrolly_visible{display:block}.scroll-element .scroll-arrow,.scroll-element .scroll-bar{cursor:default}.scroll-textarea{border:1px solid #ccc;border-top-color:#999}.scroll-textarea>.scroll-content{overflow:hidden !important}.scroll-textarea>.scroll-content>textarea{border:none !important;box-sizing:border-box;height:100% !important;margin:0;max-height:none !important;max-width:none !important;overflow:scroll !important;outline:0;padding:2px;position:relative !important;top:0;width:100% !important}.scroll-textarea>.scroll-content>textarea::-webkit-scrollbar{height:0;width:0}.scrollbar-light>.scroll-element,.scrollbar-light>.scroll-element div{border:0;margin:0;overflow:hidden;padding:0;position:absolute;z-index:10}.scrollbar-light>.scroll-element div{display:block;height:100%;left:5px;top:0;width:1px}.scrollbar-light>.scroll-element .scroll-element_outer{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}.scrollbar-light>.scroll-element .scroll-element_size{background:#dbdbdb;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2RiZGJkYiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlOGU4ZTgiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-moz-linear-gradient(left,#dbdbdb 0,#e8e8e8 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,#dbdbdb),color-stop(100%,#e8e8e8));background:-webkit-linear-gradient(left,#dbdbdb 0,#e8e8e8 100%);background:-o-linear-gradient(left,#dbdbdb 0,#e8e8e8 100%);background:-ms-linear-gradient(left,#dbdbdb 0,#e8e8e8 100%);background:linear-gradient(to right,#dbdbdb 0,#e8e8e8 100%);-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}.scrollbar-light>.scroll-element.scroll-x{bottom:0;height:17px;left:0;min-width:100%;width:100%}.scrollbar-light>.scroll-element.scroll-y{height:100%;min-height:100%;right:2px;top:0;width:12px;opacity:0}.scrollbar-light>.scroll-element .scroll-bar{background:#fefefe;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZlZmVmZSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmNWY1ZjUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-moz-linear-gradient(left,#fefefe 0,#f5f5f5 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,#fefefe),color-stop(100%,#f5f5f5));background:-webkit-linear-gradient(left,#fefefe 0,#f5f5f5 100%);background:-o-linear-gradient(left,#fefefe 0,#f5f5f5 100%);background:-ms-linear-gradient(left,#fefefe 0,#f5f5f5 100%);background:linear-gradient(to right,#fefefe 0,#f5f5f5 100%);-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}.scrollbar-light>.scroll-element.scroll-y .scroll-bar{left:0;min-height:10px;width:11px;background:#12b3ff;opacity:.5;transition:opacity .25s}.scrollbar-light>.scroll-element.scroll-y .scroll-bar:hover{opacity:1}.scrollbar-light>.scroll-element.scroll-x .scroll-element_size{left:-4px;width:1px}.scrollbar-light>.scroll-element.scroll-y .scroll-element_outer{left:0;top:2px;width:12px}.scrollbar-light>.scroll-element.scroll-y .scroll-element_size{top:-4px}.scrollbar-light>.scroll-element.scroll-x.scroll-scrolly_visible .scroll-element_size{left:-19px}.scrollbar-light>.scroll-element.scroll-y.scroll-scrollx_visible .scroll-element_size{top:-19px}.scrollbar-light>.scroll-element.scroll-x.scroll-scrolly_visible .scroll-element_track{left:-19px}.scrollbar-light>.scroll-element.scroll-y.scroll-scrollx_visible .scroll-element_track{top:-19px}.tipsy{font-size:12px;position:absolute;padding:5px;z-index:100000}.tipsy-inner{background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center}.tipsy-inner{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}.tipsy-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.tipsy-arrow-n{border-bottom-color:#000}.tipsy-arrow-s{border-top-color:#000}.tipsy-arrow-e{border-left-color:#000}.tipsy-arrow-w{border-right-color:#000}.tipsy-n .tipsy-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:0;border-top-color:transparent;border-bottom-color:transparent}#popup_container{background:#fff}#popup_container #popup_title{padding:10px 20px;background:#18b6c7;color:#fff;font-size:18px;margin:0}#popup_container #popup_content{padding:20px}#popup_container #popup_content #popup_message{margin-bottom:20px}#popup_container #popup_panel{text-align:center}.single-lp_course .course-students{padding-top:10px}.single-lp_course .course-students-list{margin-top:10px}.single-lp_course .course-students-list .students{list-style-type:none;margin:0}.single-lp_course .course-students-list .students li{margin-right:10px}.single-lp_course .course-students-list .students p{margin-top:15px}.single-lp_course .lp_course .entry-footer{display:none}/*!
|
2 |
+
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
|
3 |
+
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
4 |
+
*/@font-face{font-family:FontAwesome;src:url(../fonts/awesome/fontawesome-webfont.eot?v=4.7.0);src:url(../fonts/awesome/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'),url(../fonts/awesome/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(../fonts/awesome/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(../fonts/awesome/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(../fonts/awesome/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}
|
assets/css/learnpress.css
CHANGED
@@ -1153,6 +1153,9 @@ body .lp-quiz-buttons .form-button-finish-course {
|
|
1153 |
margin: 0; }
|
1154 |
#course-item-content-header .course-title a {
|
1155 |
box-shadow: none; }
|
|
|
|
|
|
|
1156 |
#course-item-content-header .form-button.lp-button-back {
|
1157 |
float: right;
|
1158 |
margin-right: 15px; }
|
1153 |
margin: 0; }
|
1154 |
#course-item-content-header .course-title a {
|
1155 |
box-shadow: none; }
|
1156 |
+
#course-item-content-header .course-title:before {
|
1157 |
+
content: '';
|
1158 |
+
display: none; }
|
1159 |
#course-item-content-header .form-button.lp-button-back {
|
1160 |
float: right;
|
1161 |
margin-right: 15px; }
|
assets/css/{font-awesome.min.css → vendor/font-awesome.min.css}
RENAMED
File without changes
|
assets/css/{jalert.css → vendor/jalert.css}
RENAMED
File without changes
|
assets/{js/vendor/jquery-scrollbar → css/vendor}/jquery.scrollbar.css
RENAMED
File without changes
|
assets/{js/vendor/jquery-tipsy → css/vendor}/jquery.tipsy.css
RENAMED
File without changes
|
assets/js/admin/admin-tabs.js
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Plugin: Tabs
|
3 |
-
*/
|
4 |
-
;(function ($) {
|
5 |
-
var adminTabs = function ($el, options) {
|
6 |
-
var $tabs = $el.find('.tabs-nav').find('li'),
|
7 |
-
$tabsWrap = $tabs.parent(),
|
8 |
-
$contents = $el.find('.tabs-content-container > li'),
|
9 |
-
$currentTab = null,
|
10 |
-
$currentContent = null;
|
11 |
-
|
12 |
-
function selectTab($tab) {
|
13 |
-
var index = $tabs.index($tab),
|
14 |
-
url = $tab.find('a').attr('href');
|
15 |
-
|
16 |
-
$currentContent = $contents.eq(index);
|
17 |
-
|
18 |
-
$tab.addClass('active').siblings('li.active').removeClass('active');
|
19 |
-
$currentContent.show().css({visibility: 'hidden'});
|
20 |
-
calculateHeight($currentContent);
|
21 |
-
$currentContent.hide();
|
22 |
-
$currentContent.show();
|
23 |
-
$currentContent.siblings('li.active').fadeOut(0, function () {
|
24 |
-
$currentContent.addClass('active').siblings('li.active').removeClass('active');
|
25 |
-
});
|
26 |
-
|
27 |
-
LP.setUrl(url);
|
28 |
-
}
|
29 |
-
|
30 |
-
function calculateHeight($currentContent) {
|
31 |
-
|
32 |
-
var contentHeight = $currentContent.height(),
|
33 |
-
tabsHeight = $tabsWrap.outerHeight();
|
34 |
-
|
35 |
-
if (contentHeight < tabsHeight) {
|
36 |
-
contentHeight = tabsHeight + parseInt($tabsWrap.css('margin')) * 2;
|
37 |
-
} else {
|
38 |
-
contentHeight = undefined;
|
39 |
-
}
|
40 |
-
$currentContent.css('visibility', '').css({height: contentHeight});
|
41 |
-
}
|
42 |
-
|
43 |
-
function selectDefaultTab() {
|
44 |
-
$currentTab = $tabs.filter('.active');
|
45 |
-
if (!$currentTab.length) {
|
46 |
-
$currentTab = $tabs.first();
|
47 |
-
}
|
48 |
-
$currentTab.find('a').trigger('click');
|
49 |
-
}
|
50 |
-
|
51 |
-
function initEvents() {
|
52 |
-
$el.on('click', '.tabs-nav a', function (event) {
|
53 |
-
event.preventDefault();
|
54 |
-
$currentTab = $(this).parent();
|
55 |
-
selectTab($currentTab);
|
56 |
-
});
|
57 |
-
}
|
58 |
-
|
59 |
-
function init() {
|
60 |
-
initEvents();
|
61 |
-
selectDefaultTab();
|
62 |
-
$(window).on('resize.calculate-tab', function () {
|
63 |
-
var $currentContent = $el.find('.tabs-content-container .active').css('height', '');
|
64 |
-
calculateHeight($currentContent);
|
65 |
-
})
|
66 |
-
}
|
67 |
-
|
68 |
-
init();
|
69 |
-
};
|
70 |
-
$.fn.lpAdminTab = function (options) {
|
71 |
-
options = $.extend({}, options || {});
|
72 |
-
return $.each(this, function () {
|
73 |
-
var $el = $(this),
|
74 |
-
tabs = $el.data('learn-press/tabs');
|
75 |
-
|
76 |
-
if (!tabs) {
|
77 |
-
tabs = new adminTabs($el, options);
|
78 |
-
$el.data('learn-press/tabs', tabs)
|
79 |
-
}
|
80 |
-
return $el;
|
81 |
-
})
|
82 |
-
};
|
83 |
-
|
84 |
-
var $doc = $(document);
|
85 |
-
$doc.ready(function () {
|
86 |
-
$('.learn-press-tabs').lpAdminTab();
|
87 |
-
});
|
88 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/admin-tools.js
DELETED
@@ -1,106 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
|
3 |
-
var $doc = $(document),
|
4 |
-
isRunning = false;
|
5 |
-
|
6 |
-
function installSampleCourse(e) {
|
7 |
-
e.preventDefault();
|
8 |
-
|
9 |
-
var $button = $(this);
|
10 |
-
|
11 |
-
if (isRunning) {
|
12 |
-
return;
|
13 |
-
}
|
14 |
-
|
15 |
-
if (!confirm(lpGlobalSettings.i18n.confirm_install_sample_data)) {
|
16 |
-
return;
|
17 |
-
}
|
18 |
-
|
19 |
-
$button.addClass('disabled').html($button.data('installing-text'));
|
20 |
-
$('.lp-install-sample-data-response').remove();
|
21 |
-
isRunning = true;
|
22 |
-
$.ajax({
|
23 |
-
url: $button.attr('href'),
|
24 |
-
data: $('.lp-install-sample-data-options').serializeJSON(),
|
25 |
-
success: function (response) {
|
26 |
-
$button.removeClass('disabled').html($button.data('text'));
|
27 |
-
isRunning = false;
|
28 |
-
$(response).insertBefore($button.parent());
|
29 |
-
},
|
30 |
-
error: function () {
|
31 |
-
$button.removeClass('disabled').html($button.data('text'));
|
32 |
-
isRunning = false;
|
33 |
-
}
|
34 |
-
});
|
35 |
-
}
|
36 |
-
|
37 |
-
function uninstallSampleCourse(e) {
|
38 |
-
e.preventDefault();
|
39 |
-
|
40 |
-
var $button = $(this);
|
41 |
-
|
42 |
-
if (isRunning) {
|
43 |
-
return;
|
44 |
-
}
|
45 |
-
|
46 |
-
if (!confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)) {
|
47 |
-
return;
|
48 |
-
}
|
49 |
-
|
50 |
-
$button.addClass('disabled').html($button.data('uninstalling-text'));
|
51 |
-
isRunning = true;
|
52 |
-
$.ajax({
|
53 |
-
url: $button.attr('href'),
|
54 |
-
success: function (response) {
|
55 |
-
$button.removeClass('disabled').html($button.data('text'));
|
56 |
-
isRunning = false;
|
57 |
-
},
|
58 |
-
error: function () {
|
59 |
-
$button.removeClass('disabled').html($button.data('text'));
|
60 |
-
isRunning = false;
|
61 |
-
}
|
62 |
-
})
|
63 |
-
}
|
64 |
-
|
65 |
-
function clearHardCache(e) {
|
66 |
-
e.preventDefault();
|
67 |
-
var $button = $(this);
|
68 |
-
|
69 |
-
if ($button.hasClass('disabled')) {
|
70 |
-
return;
|
71 |
-
}
|
72 |
-
|
73 |
-
$button.addClass('disabled').html($button.data('cleaning-text'));
|
74 |
-
$.ajax({
|
75 |
-
url: $button.attr('href'),
|
76 |
-
data: {},
|
77 |
-
success: function (response) {
|
78 |
-
$button.removeClass('disabled').html($button.data('text'));
|
79 |
-
},
|
80 |
-
error: function () {
|
81 |
-
$button.removeClass('disabled').html($button.data('text'));
|
82 |
-
}
|
83 |
-
});
|
84 |
-
}
|
85 |
-
|
86 |
-
function toggleHardCache() {
|
87 |
-
$.ajax({
|
88 |
-
url: 'admin.php?page=lp-toggle-hard-cache-option',
|
89 |
-
data: {v: this.checked ? 'yes' : 'no'},
|
90 |
-
success: function (response) {
|
91 |
-
},
|
92 |
-
error: function () {
|
93 |
-
}
|
94 |
-
});
|
95 |
-
}
|
96 |
-
|
97 |
-
$doc.on('click', '#learn-press-install-sample-data', installSampleCourse)
|
98 |
-
.on('click', '#learn-press-uninstall-sample-data', uninstallSampleCourse)
|
99 |
-
.on('click', '#learn-press-clear-cache', clearHardCache)
|
100 |
-
.on('click', 'input[name="enable_hard_cache"]', toggleHardCache)
|
101 |
-
.on('click', '#learn-press-install-sample-data-options', function (e) {
|
102 |
-
e.preventDefault();
|
103 |
-
$('.lp-install-sample-data-options').toggleClass('hide-if-js');
|
104 |
-
})
|
105 |
-
|
106 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/admin.js
CHANGED
@@ -1,160 +1,115 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
$templates.removeClass('hide-if-js');
|
93 |
-
} else {
|
94 |
-
$templates.map(function () {
|
95 |
-
$(this).toggleClass('hide-if-js', $(this).data('filter-' + filter) !== 'yes');
|
96 |
-
})
|
97 |
-
}
|
98 |
-
|
99 |
-
} else {
|
100 |
-
$templates.map(function () {
|
101 |
-
$(this).toggleClass('hide-if-js', $(this).data('template') !== template);
|
102 |
-
})
|
103 |
-
}
|
104 |
-
|
105 |
-
$('#learn-press-no-templates').toggleClass('hide-if-js', !!$templatesList.find('tr.template-row:not(.hide-if-js):first').length);
|
106 |
-
|
107 |
-
return false;
|
108 |
-
}
|
109 |
-
|
110 |
-
function toggleEmails(e) {
|
111 |
-
e.preventDefault();
|
112 |
-
var $button = $(this),
|
113 |
-
status = $button.data('status');
|
114 |
-
|
115 |
$.ajax({
|
116 |
url: '',
|
117 |
data: {
|
118 |
-
'lp-ajax': '
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
response = LP.parseJSON(response);
|
123 |
-
for (var i in response) {
|
124 |
-
$('#email-' + i + ' .status').toggleClass('enabled', response[i]);
|
125 |
-
}
|
126 |
-
}
|
127 |
-
});
|
128 |
-
}
|
129 |
-
|
130 |
-
function togglePaymentStatus(e) {
|
131 |
-
e.preventDefault();
|
132 |
-
var $row = $(this).closest('tr'),
|
133 |
-
$button = $(this),
|
134 |
-
status = $row.find('.status').hasClass('enabled') ? 'no' : 'yes';
|
135 |
-
|
136 |
-
$.ajax({
|
137 |
-
url: '',
|
138 |
-
data: {
|
139 |
-
'lp-ajax': 'update-payment-status',
|
140 |
-
status: status,
|
141 |
-
id: $row.data('payment')
|
142 |
},
|
143 |
-
|
|
|
144 |
response = LP.parseJSON(response);
|
145 |
-
for (var i in response) {
|
146 |
-
$('#payment-' + i + ' .status').toggleClass('enabled', response[i]);
|
147 |
-
}
|
148 |
}
|
149 |
});
|
150 |
-
}
|
151 |
|
152 |
/**
|
153 |
* Callback event for button to creating pages inside error message.
|
154 |
*
|
155 |
* @param {Event} e
|
156 |
*/
|
157 |
-
function createPages(e) {
|
158 |
var $button = $(this).addClass('disabled');
|
159 |
e.preventDefault();
|
160 |
$.post({
|
@@ -163,163 +118,16 @@
|
|
163 |
'lp-ajax': 'create-pages'
|
164 |
},
|
165 |
dataType: 'text',
|
166 |
-
success: function (res) {
|
167 |
-
var $message = $button.closest('.
|
168 |
setTimeout(function () {
|
169 |
-
$message.fadeOut()
|
170 |
}, 2000);
|
171 |
}
|
172 |
});
|
173 |
-
}
|
174 |
-
|
175 |
-
function updateEmailStatus() {
|
176 |
-
(function () {
|
177 |
-
$.post({
|
178 |
-
url: window.location.href,
|
179 |
-
data: {
|
180 |
-
'lp-ajax': 'update_email_status',
|
181 |
-
status: $(this).parent().hasClass('enabled') ? 'no' : 'yes',
|
182 |
-
id: $(this).data('id')
|
183 |
-
},
|
184 |
-
dataType: 'text',
|
185 |
-
success: $.proxy(function (res) {
|
186 |
-
res = LP.parseJSON(res);
|
187 |
-
for (var i in res) {
|
188 |
-
$('#email-' + i + ' .status').toggleClass('enabled', res[i]);
|
189 |
-
}
|
190 |
-
}, this)
|
191 |
-
});
|
192 |
-
}).apply(this)
|
193 |
-
}
|
194 |
-
|
195 |
-
function updateItemPreview() {
|
196 |
-
$.ajax({
|
197 |
-
url: '',
|
198 |
-
data: {
|
199 |
-
'lp-ajax': 'toggle_item_preview',
|
200 |
-
item_id: this.value,
|
201 |
-
previewable: this.checked ? 'yes' : 'no',
|
202 |
-
nonce: $(this).attr('data-nonce')
|
203 |
-
},
|
204 |
-
dataType: 'text',
|
205 |
-
success: function (response) {
|
206 |
-
response = LP.parseJSON(response);
|
207 |
-
}
|
208 |
-
});
|
209 |
-
}
|
210 |
-
|
211 |
-
var LP_Admin = window.LP_Admin = {
|
212 |
-
init: function () {
|
213 |
-
var $doc = $(document);
|
214 |
-
$doc.on('click', '#learn-press-install-sample-data-notice a', this._importCourses)
|
215 |
-
.on('click', '.learn-press-admin-notice-dismiss', this._dismissNotice)
|
216 |
-
.on('click', '[data-remove-confirm]', this._confirm);
|
217 |
-
setTimeout(function () {
|
218 |
-
$('[data-remove-confirm]').each(function () {
|
219 |
-
})
|
220 |
-
}, 1000);
|
221 |
-
},
|
222 |
-
_confirm: function (e) {
|
223 |
-
e.preventDefault();
|
224 |
-
return false;
|
225 |
-
},
|
226 |
-
_dismissNotice: function (e) {
|
227 |
-
|
228 |
-
var $notice = $(e.target),
|
229 |
-
context = $notice.attr('data-context'),
|
230 |
-
transient = $notice.attr('data-transient');
|
231 |
-
if (context) {
|
232 |
-
$.ajax({
|
233 |
-
url: LP_Settings.ajax,
|
234 |
-
data: {
|
235 |
-
action: 'learnpress_dismiss_notice',
|
236 |
-
context: context,
|
237 |
-
transient: transient
|
238 |
-
},
|
239 |
-
success: function (response) {
|
240 |
-
$notice.closest('.updated').fadeOut();
|
241 |
-
$notice.closest('.error').fadeOut();
|
242 |
-
}
|
243 |
-
});
|
244 |
-
return false;
|
245 |
-
}
|
246 |
-
},
|
247 |
-
_importCourses: function (e) {
|
248 |
-
var $container = $('#learn-press-install-sample-data-notice'),
|
249 |
-
action = $(this).attr('data-action');
|
250 |
-
if (!action) {
|
251 |
-
return;
|
252 |
-
}
|
253 |
-
e.preventDefault();
|
254 |
-
|
255 |
-
if (action === 'yes') {
|
256 |
-
$container
|
257 |
-
.find('.install-sample-data-notice').slideUp()
|
258 |
-
.siblings('.install-sample-data-loading').slideDown()
|
259 |
-
} else {
|
260 |
-
$container.fadeOut();
|
261 |
-
}
|
262 |
-
$.ajax({
|
263 |
-
url: ajaxurl,
|
264 |
-
dataType: 'html',
|
265 |
-
type: 'post',
|
266 |
-
data: {
|
267 |
-
action: 'learnpress_install_sample_data',
|
268 |
-
yes: action
|
269 |
-
},
|
270 |
-
success: function (response) {
|
271 |
-
response = LP.parseJSON(response);
|
272 |
-
if (response.url) {
|
273 |
-
$.ajax({
|
274 |
-
url: response.url,
|
275 |
-
success: function () {
|
276 |
-
$container
|
277 |
-
.find('.install-sample-data-notice').html(response.message).slideDown()
|
278 |
-
.siblings('.install-sample-data-loading').slideUp();
|
279 |
-
}
|
280 |
-
});
|
281 |
-
} else {
|
282 |
-
$container
|
283 |
-
.find('.install-sample-data-notice').html(response.message).slideDown()
|
284 |
-
.siblings('.install-sample-data-loading').slideUp();
|
285 |
-
}
|
286 |
-
}
|
287 |
-
})
|
288 |
-
}
|
289 |
};
|
290 |
|
291 |
-
function
|
292 |
-
$('.learn-press-tooltip').each(function () {
|
293 |
-
var $el = $(this),
|
294 |
-
args = $.extend({title: 'data-tooltip', offset: 10, gravity: 's'}, $el.data());
|
295 |
-
$el.tipsy(args);
|
296 |
-
});
|
297 |
-
}
|
298 |
-
|
299 |
-
function initSelect2() {
|
300 |
-
if ($.fn.select2) {
|
301 |
-
$('.lp-select-2 select').select2();
|
302 |
-
}
|
303 |
-
}
|
304 |
-
|
305 |
-
function toggleSalePriceSchedule() {
|
306 |
-
var $el = $(this),
|
307 |
-
id = $el.attr('id');
|
308 |
-
|
309 |
-
if (id === '_lp_sale_price_schedule') {
|
310 |
-
$(this).hide();
|
311 |
-
$('#field-_lp_sale_start, #field-_lp_sale_end').removeClass('hide-if-js');
|
312 |
-
$(window).trigger('resize.calculate-tab');
|
313 |
-
} else {
|
314 |
-
$('#_lp_sale_price_schedule').show();
|
315 |
-
$('#field-_lp_sale_start, #field-_lp_sale_end').addClass('hide-if-js').find('#_lp_sale_start, #_lp_sale_end').val('');
|
316 |
-
$(window).trigger('resize.calculate-tab');
|
317 |
-
}
|
318 |
-
|
319 |
-
return false;
|
320 |
-
}
|
321 |
-
|
322 |
-
function hideUpgradeMessage(e) {
|
323 |
e.preventDefault();
|
324 |
var $btn = $(this);
|
325 |
$btn.closest('.lp-upgrade-notice').fadeOut();
|
@@ -328,12 +136,11 @@
|
|
328 |
data: {
|
329 |
'lp-hide-upgrade-message': 'yes'
|
330 |
},
|
331 |
-
success: function (res) {
|
332 |
-
}
|
333 |
});
|
334 |
-
}
|
335 |
|
336 |
-
function pluginActions(e) {
|
337 |
|
338 |
// Premium addon
|
339 |
if ($(e.target).hasClass('buy-now')) {
|
@@ -350,134 +157,235 @@
|
|
350 |
$.ajax({
|
351 |
url: $(this).attr('href'),
|
352 |
data: {},
|
353 |
-
success: function (r) {
|
354 |
$.ajax({
|
355 |
url: window.location.href,
|
356 |
-
success: function (r) {
|
357 |
var $p = $(r).find('#' + $plugin.attr('id'));
|
358 |
if ($p.length) {
|
359 |
-
$plugin.replaceWith($p)
|
360 |
} else {
|
361 |
-
$plugin.find('.plugin-action-buttons a')
|
362 |
-
.removeClass('updating-message button-working')
|
363 |
-
.html(learn_press_admin_localize.plugin_installed);
|
364 |
}
|
365 |
}
|
366 |
-
})
|
367 |
}
|
368 |
});
|
369 |
-
}
|
370 |
-
|
371 |
-
function initSingleCoursePermalink() {
|
372 |
-
$doc.on('change', '.learn-press-single-course-permalink input[type="radio"]', function () {
|
373 |
-
var $check = $(this),
|
374 |
-
$row = $check.closest('.learn-press-single-course-permalink');
|
375 |
-
if ($row.hasClass('custom-base')) {
|
376 |
-
$row.find('input[type="text"]').prop('readonly', false);
|
377 |
-
} else {
|
378 |
-
$row.siblings('.custom-base').find('input[type="text"]').prop('readonly', true);
|
379 |
-
}
|
380 |
-
})
|
381 |
-
.on('change', 'input.learn-press-course-base', function () {
|
382 |
-
$('#course_permalink_structure').val($(this).val());
|
383 |
-
})
|
384 |
-
.on('focus', '#course_permalink_structure', function () {
|
385 |
-
$('#learn_press_custom_permalink').click();
|
386 |
-
})
|
387 |
-
.on('change', '#learn_press_courses_page_id', function () {
|
388 |
-
$('tr.learn-press-courses-page-id').toggleClass('hide-if-js', !parseInt(this.value))
|
389 |
-
});
|
390 |
-
}
|
391 |
|
392 |
-
function
|
393 |
e.preventDefault();
|
|
|
|
|
394 |
|
395 |
-
|
396 |
-
_id = _self.data('post-id');
|
397 |
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
}
|
413 |
-
});
|
414 |
-
}
|
415 |
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
},
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
} else {
|
433 |
-
|
|
|
|
|
|
|
434 |
}
|
|
|
|
|
|
|
435 |
}
|
436 |
-
}
|
437 |
-
}
|
438 |
-
|
439 |
-
function checkUpdates(e) {
|
440 |
-
//e.preventDefault();
|
441 |
-
}
|
442 |
-
|
443 |
|
444 |
-
|
445 |
|
446 |
-
|
447 |
|
448 |
-
$('
|
449 |
-
|
450 |
-
|
451 |
-
$('.learn-press-tip').QuickTip();
|
452 |
-
|
453 |
-
initTooltips();
|
454 |
-
initSelect2();
|
455 |
-
makePaymentsSortable();
|
456 |
-
initSingleCoursePermalink();
|
457 |
-
|
458 |
-
$doc.on('click', '.change-email-status', updateEmailStatus)
|
459 |
-
.on('click', '#learn-press-enable-emails, #learn-press-disable-emails', toggleEmails)
|
460 |
-
.on('click', '#learn-press-create-pages', createPages)
|
461 |
-
.on('click', '.learn-press-payments .status .dashicons', togglePaymentStatus)
|
462 |
-
.on('click', '#_lp_sale_price_schedule', toggleSalePriceSchedule)
|
463 |
-
.on('click', '#_lp_sale_price_schedule_cancel', toggleSalePriceSchedule)
|
464 |
-
.on('click', '.lp-upgrade-notice .close-notice', hideUpgradeMessage)
|
465 |
-
.on('click', '.plugin-action-buttons a', pluginActions)
|
466 |
-
.on('click', '.learn-press-filter-template', _callbackFilterTemplates)
|
467 |
-
.on('click', '.lp-duplicate-row-action .lp-duplicate-post', _duplicatePost)
|
468 |
-
.on('click', '#learn-press-newsletter-button button', send_newsletter_info)
|
469 |
-
.on('click', '#learn-press-check-update-addons', checkUpdates)
|
470 |
-
.on('mousedown', '.lp-sortable-handle', function (e) {
|
471 |
-
$('html, body').addClass('lp-item-moving');
|
472 |
-
$(e.target).closest('.lp-sortable-handle').css('cursor', 'inherit');
|
473 |
-
})
|
474 |
-
.on('mouseup', function (e) {
|
475 |
-
$('html, body').removeClass('lp-item-moving');
|
476 |
-
$('.lp-sortable-handle').css('cursor', '');
|
477 |
-
})
|
478 |
-
LP_Admin.init();
|
479 |
}
|
480 |
|
481 |
-
$
|
482 |
})(jQuery);
|
483 |
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 14);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 14:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
var _update = __webpack_require__(15);
|
75 |
+
|
76 |
+
var _update2 = _interopRequireDefault(_update);
|
77 |
+
|
78 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
79 |
+
|
80 |
+
; /**
|
81 |
+
* JS code may run in all pages in admin.
|
82 |
+
*
|
83 |
+
* @version 3.2.6
|
84 |
+
*/
|
85 |
+
//import Utils from './utils';
|
86 |
+
//import Test from './test';
|
87 |
+
|
88 |
+
(function () {
|
89 |
+
var $ = jQuery;
|
90 |
+
|
91 |
+
var updateItemPreview = function updateItemPreview() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
$.ajax({
|
93 |
url: '',
|
94 |
data: {
|
95 |
+
'lp-ajax': 'toggle_item_preview',
|
96 |
+
item_id: this.value,
|
97 |
+
previewable: this.checked ? 'yes' : 'no',
|
98 |
+
nonce: $(this).attr('data-nonce')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
},
|
100 |
+
dataType: 'text',
|
101 |
+
success: function success(response) {
|
102 |
response = LP.parseJSON(response);
|
|
|
|
|
|
|
103 |
}
|
104 |
});
|
105 |
+
};
|
106 |
|
107 |
/**
|
108 |
* Callback event for button to creating pages inside error message.
|
109 |
*
|
110 |
* @param {Event} e
|
111 |
*/
|
112 |
+
var createPages = function createPages(e) {
|
113 |
var $button = $(this).addClass('disabled');
|
114 |
e.preventDefault();
|
115 |
$.post({
|
118 |
'lp-ajax': 'create-pages'
|
119 |
},
|
120 |
dataType: 'text',
|
121 |
+
success: function success(res) {
|
122 |
+
var $message = $button.closest('.lp-notice').html('<p>' + res + '</p>');
|
123 |
setTimeout(function () {
|
124 |
+
$message.fadeOut();
|
125 |
}, 2000);
|
126 |
}
|
127 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
};
|
129 |
|
130 |
+
var hideUpgradeMessage = function hideUpgradeMessage(e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
e.preventDefault();
|
132 |
var $btn = $(this);
|
133 |
$btn.closest('.lp-upgrade-notice').fadeOut();
|
136 |
data: {
|
137 |
'lp-hide-upgrade-message': 'yes'
|
138 |
},
|
139 |
+
success: function success(res) {}
|
|
|
140 |
});
|
141 |
+
};
|
142 |
|
143 |
+
var pluginActions = function pluginActions(e) {
|
144 |
|
145 |
// Premium addon
|
146 |
if ($(e.target).hasClass('buy-now')) {
|
157 |
$.ajax({
|
158 |
url: $(this).attr('href'),
|
159 |
data: {},
|
160 |
+
success: function success(r) {
|
161 |
$.ajax({
|
162 |
url: window.location.href,
|
163 |
+
success: function success(r) {
|
164 |
var $p = $(r).find('#' + $plugin.attr('id'));
|
165 |
if ($p.length) {
|
166 |
+
$plugin.replaceWith($p);
|
167 |
} else {
|
168 |
+
$plugin.find('.plugin-action-buttons a').removeClass('updating-message button-working').html(learn_press_admin_localize.plugin_installed);
|
|
|
|
|
169 |
}
|
170 |
}
|
171 |
+
});
|
172 |
}
|
173 |
});
|
174 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
+
var preventDefault = function preventDefault(e) {
|
177 |
e.preventDefault();
|
178 |
+
return false;
|
179 |
+
};
|
180 |
|
181 |
+
var onReady = function onReady() {
|
|
|
182 |
|
183 |
+
$('.learn-press-dropdown-pages').LP('DropdownPages');
|
184 |
+
$('.learn-press-advertisement-slider').LP('Advertisement', 'a', 's').appendTo($('#wpbody-content'));
|
185 |
+
$('.learn-press-toggle-item-preview').on('change', updateItemPreview);
|
186 |
+
$('.learn-press-tip').LP('QuickTip');
|
187 |
+
//$('.learn-press-tabs').LP('AdminTab');
|
188 |
+
|
189 |
+
$(document).on('click', '#learn-press-create-pages', createPages).on('click', '.lp-upgrade-notice .close-notice', hideUpgradeMessage).on('click', '.plugin-action-buttons a', pluginActions).on('click', '[data-remove-confirm]', preventDefault).on('mousedown', '.lp-sortable-handle', function (e) {
|
190 |
+
$('html, body').addClass('lp-item-moving');
|
191 |
+
$(e.target).closest('.lp-sortable-handle').css('cursor', 'inherit');
|
192 |
+
}).on('mouseup', function (e) {
|
193 |
+
$('html, body').removeClass('lp-item-moving');
|
194 |
+
$('.lp-sortable-handle').css('cursor', '');
|
195 |
+
});
|
196 |
+
};
|
197 |
|
198 |
+
$(document).ready(onReady);
|
199 |
+
})();
|
200 |
+
|
201 |
+
/***/ }),
|
202 |
+
|
203 |
+
/***/ 15:
|
204 |
+
/***/ (function(module, exports, __webpack_require__) {
|
205 |
+
|
206 |
+
"use strict";
|
207 |
+
|
208 |
+
|
209 |
+
;(function ($) {
|
210 |
+
'use strict';
|
211 |
+
|
212 |
+
var Package = function Package(data) {
|
213 |
+
this.data = data;
|
214 |
+
|
215 |
+
var currentIndex = -1,
|
216 |
+
currentVersion = null,
|
217 |
+
currentPackage = null,
|
218 |
+
versions = Object.keys(this.data);
|
219 |
+
|
220 |
+
this.reset = function (current) {
|
221 |
+
current = current === undefined || current > versions.length - 1 || current < 0 ? 0 : current;
|
222 |
+
currentIndex = current;
|
223 |
+
currentVersion = versions[current];
|
224 |
+
currentPackage = this.data[currentVersion];
|
225 |
+
|
226 |
+
return currentPackage;
|
227 |
+
};
|
228 |
+
|
229 |
+
this.next = function () {
|
230 |
+
if (currentIndex >= versions.length - 1) {
|
231 |
+
return false;
|
232 |
}
|
|
|
|
|
233 |
|
234 |
+
currentIndex++;
|
235 |
+
this.reset(currentIndex);
|
236 |
+
|
237 |
+
return currentPackage;
|
238 |
+
};
|
239 |
+
|
240 |
+
this.prev = function () {
|
241 |
+
if (currentIndex <= 0) {
|
242 |
+
return false;
|
243 |
+
}
|
244 |
+
|
245 |
+
currentIndex--;
|
246 |
+
this.reset(currentIndex);
|
247 |
+
|
248 |
+
return currentPackage;
|
249 |
+
};
|
250 |
+
|
251 |
+
this.currentVersion = function () {
|
252 |
+
return currentVersion;
|
253 |
+
};
|
254 |
+
|
255 |
+
this.hasPackage = function () {
|
256 |
+
return versions.length;
|
257 |
+
};
|
258 |
+
|
259 |
+
this.getPercentCompleted = function () {
|
260 |
+
return currentIndex / versions.length;
|
261 |
+
};
|
262 |
+
|
263 |
+
this.getTotal = function () {
|
264 |
+
return versions.length;
|
265 |
+
};
|
266 |
+
|
267 |
+
if (!this.data) {
|
268 |
+
return;
|
269 |
+
}
|
270 |
+
};
|
271 |
+
var UpdaterSettings = {
|
272 |
+
el: '#learn-press-updater',
|
273 |
+
data: {
|
274 |
+
packages: null,
|
275 |
+
status: '',
|
276 |
+
force: false
|
277 |
+
},
|
278 |
+
watch: {
|
279 |
+
packages: function packages(newPackages, oldPackages) {
|
280 |
+
if (newPackages) {}
|
281 |
+
}
|
282 |
+
},
|
283 |
+
mounted: function mounted() {
|
284 |
+
$(this.$el).show();
|
285 |
+
},
|
286 |
+
methods: {
|
287 |
+
getUpdatePackages: function getUpdatePackages(callback) {
|
288 |
+
var that = this;
|
289 |
+
$.ajax({
|
290 |
+
url: lpGlobalSettings.admin_url,
|
291 |
+
data: {
|
292 |
+
'lp-ajax': 'get-update-packages',
|
293 |
+
force: this.force,
|
294 |
+
_wpnonce: lpGlobalSettings._wpnonce
|
295 |
+
},
|
296 |
+
success: function success(res) {
|
297 |
+
var packages = LP.parseJSON(res);
|
298 |
+
that.packages = new Package(packages);
|
299 |
+
callback && callback.call(that);
|
300 |
+
}
|
301 |
+
});
|
302 |
},
|
303 |
+
start: function start(e, force) {
|
304 |
+
this.packages = null;
|
305 |
+
this.force = force;
|
306 |
+
this.getUpdatePackages(function () {
|
307 |
+
if (this.packages.hasPackage()) {
|
308 |
+
var p = this.packages.next();
|
309 |
+
this.status = 'updating';
|
310 |
+
this.doUpdate(p);
|
311 |
+
}
|
312 |
+
});
|
313 |
+
},
|
314 |
+
getPackages: function getPackages() {
|
315 |
+
return this.packages ? this.packages.data : {};
|
316 |
+
},
|
317 |
+
hasPackage: function hasPackage() {
|
318 |
+
return !$.isEmptyObject(this.getPackages());
|
319 |
+
},
|
320 |
+
updateButtonClass: function updateButtonClass() {
|
321 |
+
return {
|
322 |
+
'disabled': this.status === 'updating'
|
323 |
+
};
|
324 |
+
},
|
325 |
+
doUpdate: function doUpdate(p, i) {
|
326 |
+
var that = this;
|
327 |
+
|
328 |
+
p = p ? p : this.packages.next();
|
329 |
+
i = i ? i : 1;
|
330 |
+
|
331 |
+
if (p) {
|
332 |
+
$.ajax({
|
333 |
+
url: lpGlobalSettings.admin_url,
|
334 |
+
data: {
|
335 |
+
'lp-ajax': 'do-update-package',
|
336 |
+
package: p,
|
337 |
+
version: this.packages.currentVersion(),
|
338 |
+
_wpnonce: lpGlobalSettings._wpnonce,
|
339 |
+
force: this.force,
|
340 |
+
i: i
|
341 |
+
},
|
342 |
+
success: function success(res) {
|
343 |
+
var response = LP.parseJSON(res),
|
344 |
+
$status = $(that.$el).find('.updater-progress-status');
|
345 |
+
if (response.done === 'yes') {
|
346 |
+
that.update(that.packages.getPercentCompleted() * 100);
|
347 |
+
that.doUpdate();
|
348 |
+
} else {
|
349 |
+
var newWidth = that.packages.getPercentCompleted() * 100;
|
350 |
+
if (response.percent) {
|
351 |
+
var stepWidth = 1 / that.packages.getTotal();
|
352 |
+
newWidth += stepWidth * response.percent;
|
353 |
+
}
|
354 |
+
|
355 |
+
that.update(newWidth);
|
356 |
+
that.doUpdate(p, ++i);
|
357 |
+
}
|
358 |
+
},
|
359 |
+
error: function error() {
|
360 |
+
that.doUpdate(p, i);
|
361 |
+
}
|
362 |
+
});
|
363 |
} else {
|
364 |
+
that.update(100).addClass('completed');
|
365 |
+
setTimeout(function (x) {
|
366 |
+
x.status = 'completed';
|
367 |
+
}, 2000, this);
|
368 |
}
|
369 |
+
},
|
370 |
+
update: function update(value) {
|
371 |
+
return $(this.$el).find('.updater-progress-status').css('width', value + '%').attr('data-value', parseInt(value));
|
372 |
}
|
373 |
+
}
|
374 |
+
};
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
+
function init() {
|
377 |
|
378 |
+
window.lpGlobalSettings = window.lpGlobalSettings || {};
|
379 |
|
380 |
+
if ($('#learn-press-updater').length) {
|
381 |
+
var Updater = new Vue(UpdaterSettings);
|
382 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
}
|
384 |
|
385 |
+
$(document).ready(init);
|
386 |
})(jQuery);
|
387 |
|
388 |
+
/***/ })
|
389 |
+
|
390 |
+
/******/ });
|
391 |
+
//# sourceMappingURL=admin.js.map
|
assets/js/admin/admin.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){function e(n){if(a[n])return a[n].exports;var s=a[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var a={};e.m=t,e.c=a,e.d=function(t,a,n){e.o(t,a)||Object.defineProperty(t,a,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=14)}({14:function(t,e,a){"use strict";var n=a(15);!function(t){t&&t.__esModule}(n);!function(){var t=jQuery,e=function(){t.ajax({url:"",data:{"lp-ajax":"toggle_item_preview",item_id:this.value,previewable:this.checked?"yes":"no",nonce:t(this).attr("data-nonce")},dataType:"text",success:function(t){t=LP.parseJSON(t)}})},a=function(e){var a=t(this).addClass("disabled");e.preventDefault(),t.post({url:a.attr("href"),data:{"lp-ajax":"create-pages"},dataType:"text",success:function(t){var e=a.closest(".lp-notice").html("<p>"+t+"</p>");setTimeout(function(){e.fadeOut()},2e3)}})},n=function(e){e.preventDefault(),t(this).closest(".lp-upgrade-notice").fadeOut(),t.post({url:"",data:{"lp-hide-upgrade-message":"yes"},success:function(t){}})},s=function(e){if(!t(e.target).hasClass("buy-now")){e.preventDefault();var a=t(this).closest(".plugin-card");t(this).hasClass("updating-message")||(t(this).addClass("updating-message button-working disabled"),t.ajax({url:t(this).attr("href"),data:{},success:function(e){t.ajax({url:window.location.href,success:function(e){var n=t(e).find("#"+a.attr("id"));n.length?a.replaceWith(n):a.find(".plugin-action-buttons a").removeClass("updating-message button-working").html(learn_press_admin_localize.plugin_installed)}})}}))}},i=function(t){return t.preventDefault(),!1},r=function(){t(".learn-press-dropdown-pages").LP("DropdownPages"),t(".learn-press-advertisement-slider").LP("Advertisement","a","s").appendTo(t("#wpbody-content")),t(".learn-press-toggle-item-preview").on("change",e),t(".learn-press-tip").LP("QuickTip"),t(document).on("click","#learn-press-create-pages",a).on("click",".lp-upgrade-notice .close-notice",n).on("click",".plugin-action-buttons a",s).on("click","[data-remove-confirm]",i).on("mousedown",".lp-sortable-handle",function(e){t("html, body").addClass("lp-item-moving"),t(e.target).closest(".lp-sortable-handle").css("cursor","inherit")}).on("mouseup",function(e){t("html, body").removeClass("lp-item-moving"),t(".lp-sortable-handle").css("cursor","")})};t(document).ready(r)}()},15:function(t,e,a){"use strict";!function(t){function e(){if(window.lpGlobalSettings=window.lpGlobalSettings||{},t("#learn-press-updater").length){new Vue(n)}}var a=function(t){this.data=t;var e=-1,a=null,n=null,s=Object.keys(this.data);this.reset=function(t){return t=void 0===t||t>s.length-1||t<0?0:t,e=t,a=s[t],n=this.data[a]},this.next=function(){return!(e>=s.length-1)&&(e++,this.reset(e),n)},this.prev=function(){return!(e<=0)&&(e--,this.reset(e),n)},this.currentVersion=function(){return a},this.hasPackage=function(){return s.length},this.getPercentCompleted=function(){return e/s.length},this.getTotal=function(){return s.length},this.data},n={el:"#learn-press-updater",data:{packages:null,status:"",force:!1},watch:{packages:function(t,e){}},mounted:function(){t(this.$el).show()},methods:{getUpdatePackages:function(e){var n=this;t.ajax({url:lpGlobalSettings.admin_url,data:{"lp-ajax":"get-update-packages",force:this.force,_wpnonce:lpGlobalSettings._wpnonce},success:function(t){var s=LP.parseJSON(t);n.packages=new a(s),e&&e.call(n)}})},start:function(t,e){this.packages=null,this.force=e,this.getUpdatePackages(function(){if(this.packages.hasPackage()){var t=this.packages.next();this.status="updating",this.doUpdate(t)}})},getPackages:function(){return this.packages?this.packages.data:{}},hasPackage:function(){return!t.isEmptyObject(this.getPackages())},updateButtonClass:function(){return{disabled:"updating"===this.status}},doUpdate:function(e,a){var n=this;e=e||this.packages.next(),a=a||1,e?t.ajax({url:lpGlobalSettings.admin_url,data:{"lp-ajax":"do-update-package",package:e,version:this.packages.currentVersion(),_wpnonce:lpGlobalSettings._wpnonce,force:this.force,i:a},success:function(s){var i=LP.parseJSON(s);t(n.$el).find(".updater-progress-status");if("yes"===i.done)n.update(100*n.packages.getPercentCompleted()),n.doUpdate();else{var r=100*n.packages.getPercentCompleted();if(i.percent){r+=1/n.packages.getTotal()*i.percent}n.update(r),n.doUpdate(e,++a)}},error:function(){n.doUpdate(e,a)}}):(n.update(100).addClass("completed"),setTimeout(function(t){t.status="completed"},2e3,this))},update:function(e){return t(this.$el).find(".updater-progress-status").css("width",e+"%").attr("data-value",parseInt(e))}}};t(document).ready(e)}(jQuery)}});
|
assets/js/admin/all.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
function login(){alert()}function abc(){}var x=0;abc();
|
|
assets/js/admin/attributes.js
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
var select2Options = {
|
3 |
-
formatNoMatches: function () {
|
4 |
-
$(document).off('keyup.addNewAttributeValueEvent');
|
5 |
-
$(document).on('keyup.addNewAttributeValueEvent', '.select2-input', addNewAttributeValueEvent);
|
6 |
-
return 'No match found, <code>Ctrl + Enter</code> to add new attribute';
|
7 |
-
},
|
8 |
-
formatMatches : function () {
|
9 |
-
$(document).off('keyup.addNewAttributeValueEvent');
|
10 |
-
}
|
11 |
-
}, postId = 0;
|
12 |
-
|
13 |
-
function getPostId() {
|
14 |
-
if (!postId) {
|
15 |
-
postId = $('input[name="post_ID"]').val();
|
16 |
-
}
|
17 |
-
return postId;
|
18 |
-
}
|
19 |
-
|
20 |
-
function addAttributeToCourse(button) {
|
21 |
-
$(button).addClass('disabled');
|
22 |
-
$.post({
|
23 |
-
url : window.location.href.addQueryVar('add-attribute-to-course', getPostId()),
|
24 |
-
data : $().extend({}, $(button).data()),
|
25 |
-
success: function (response) {
|
26 |
-
var $html = $('.course-attributes');
|
27 |
-
$(response).appendTo($html);
|
28 |
-
$html.find('.course-attribute-values').select2(select2Options)
|
29 |
-
}
|
30 |
-
})
|
31 |
-
}
|
32 |
-
|
33 |
-
function addNewAttributeValue(name, taxonomy, el) {
|
34 |
-
var $li = $(el).closest('.learn-press-attribute');
|
35 |
-
$.post({
|
36 |
-
url : window.location.href.addQueryVar('add-attribute-value', getPostId()),
|
37 |
-
data : {
|
38 |
-
name : name,
|
39 |
-
taxonomy: taxonomy
|
40 |
-
},
|
41 |
-
dataType: 'text',
|
42 |
-
success : function (response) {
|
43 |
-
response = LP.parseJSON(response);
|
44 |
-
if (response.result == 'success') {
|
45 |
-
$li.find('select.course-attribute-values').append('<option value="' + response.slug + '" selected="selected">' + response.name + '</option>').change();
|
46 |
-
} else {
|
47 |
-
if (response.message) {
|
48 |
-
alert(response.message);
|
49 |
-
}
|
50 |
-
}
|
51 |
-
}
|
52 |
-
})
|
53 |
-
}
|
54 |
-
|
55 |
-
function addNewAttributeValueEvent(e) {
|
56 |
-
if (e.ctrlKey && e.keyCode == 13) {
|
57 |
-
var $sel = $('.select2-focused');
|
58 |
-
if ($sel.length == 0) {
|
59 |
-
return;
|
60 |
-
}
|
61 |
-
addNewAttributeValue($sel.val(), $sel.closest('.learn-press-attribute').data('taxonomy'), this)
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
function saveAttributesEvent(e) {
|
66 |
-
$.post({
|
67 |
-
url : window.location.href.addQueryVar('save-attributes', getPostId()),
|
68 |
-
data : {
|
69 |
-
data: $('.course-attributes').find('input, select, textarea').serialize(),
|
70 |
-
},
|
71 |
-
success: function () {
|
72 |
-
|
73 |
-
}
|
74 |
-
});
|
75 |
-
}
|
76 |
-
|
77 |
-
$(document).ready(function () {
|
78 |
-
$(document)
|
79 |
-
.on('click', '.add-attribute:not(.disabled)', function () {
|
80 |
-
addAttributeToCourse(this);
|
81 |
-
})
|
82 |
-
.on('click', '#save-attributes', saveAttributesEvent)
|
83 |
-
.on('keyup.addNewAttributeValueEvent', '.select2-input', addNewAttributeValueEvent);
|
84 |
-
|
85 |
-
var $courseAttributes = $('.course-attribute-values') ;
|
86 |
-
|
87 |
-
if ($courseAttributes.length) {
|
88 |
-
$courseAttributes.select2(select2Options);
|
89 |
-
}
|
90 |
-
|
91 |
-
});
|
92 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/conditional-logic.js
CHANGED
@@ -1,3 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/**
|
2 |
* Conditional Logic for metabox fields
|
3 |
*
|
@@ -8,9 +81,9 @@
|
|
8 |
;(function ($) {
|
9 |
window.conditional_logic_gray_state = function (state, field) {
|
10 |
if (state) {
|
11 |
-
$(this).removeClass('disabled')
|
12 |
} else {
|
13 |
-
$(this).addClass('disabled')
|
14 |
}
|
15 |
};
|
16 |
var Conditional_Logic = window.Conditional_Logic = function (options) {
|
@@ -19,7 +92,7 @@
|
|
19 |
};
|
20 |
|
21 |
Conditional_Logic.prototype = $.extend(Conditional_Logic.prototype, {
|
22 |
-
evaluate: function (changedId, conditionals) {
|
23 |
if (!conditionals) {
|
24 |
return undefined;
|
25 |
}
|
@@ -43,7 +116,7 @@
|
|
43 |
}
|
44 |
return show;
|
45 |
},
|
46 |
-
evaluateRequirement: function (requirement) {
|
47 |
if (!requirement) {
|
48 |
return undefined;
|
49 |
}
|
@@ -80,42 +153,42 @@
|
|
80 |
}
|
81 |
},
|
82 |
|
83 |
-
compare: function (value2, value1, operator) {
|
84 |
var show = undefined;
|
85 |
switch (operator) {
|
86 |
case '===':
|
87 |
-
show =
|
88 |
break;
|
89 |
case '==':
|
90 |
case '=':
|
91 |
case 'equals':
|
92 |
case 'equal':
|
93 |
-
show =
|
94 |
break;
|
95 |
case '!==':
|
96 |
-
show =
|
97 |
break;
|
98 |
case '!=':
|
99 |
case 'not equal':
|
100 |
-
show =
|
101 |
break;
|
102 |
case '>=':
|
103 |
case 'greater or equal':
|
104 |
case 'equal or greater':
|
105 |
-
show =
|
106 |
break;
|
107 |
case '<=':
|
108 |
case 'smaller or equal':
|
109 |
case 'equal or smaller':
|
110 |
-
show =
|
111 |
break;
|
112 |
case '>':
|
113 |
case 'greater':
|
114 |
-
show =
|
115 |
break;
|
116 |
case '<':
|
117 |
case 'smaller':
|
118 |
-
show =
|
119 |
break;
|
120 |
case 'contains':
|
121 |
case 'in':
|
@@ -138,14 +211,14 @@
|
|
138 |
}
|
139 |
break;
|
140 |
default:
|
141 |
-
show =
|
142 |
}
|
143 |
if (show !== undefined) {
|
144 |
return show;
|
145 |
}
|
146 |
return true;
|
147 |
},
|
148 |
-
hasConditional: function (source, target) {
|
149 |
if (!this.options.conditionals) {
|
150 |
return;
|
151 |
}
|
@@ -159,7 +232,7 @@
|
|
159 |
}
|
160 |
return false;
|
161 |
},
|
162 |
-
update: function (changedField, $fields) {
|
163 |
var $changedField = $(changedField),
|
164 |
id = this.getFieldName($changedField);
|
165 |
$fields = $fields || $('.rwmb-field');
|
@@ -182,14 +255,14 @@
|
|
182 |
show = !show;
|
183 |
}
|
184 |
if ($.isFunction(window[conditional.state_callback])) {
|
185 |
-
window[conditional.state_callback].call(thisField, show, thisField)
|
186 |
} else {
|
187 |
thisField.toggle(show);
|
188 |
}
|
189 |
}
|
190 |
}, this);
|
191 |
},
|
192 |
-
updateAll: function () {
|
193 |
var $fields = $('.rwmb-field'),
|
194 |
that = this;
|
195 |
_.forEach($fields, function (field) {
|
@@ -209,7 +282,7 @@
|
|
209 |
}).trigger('change');
|
210 |
}, this);
|
211 |
},
|
212 |
-
getFieldType: function (field) {
|
213 |
var $field = $(field);
|
214 |
if ($field.length === 0) {
|
215 |
return false;
|
@@ -221,12 +294,19 @@
|
|
221 |
}
|
222 |
return false;
|
223 |
},
|
224 |
-
getFieldName: function (field) {
|
225 |
return $(field).find('.rwmb-field-name').val();
|
226 |
},
|
227 |
supportFields: ['yes-no', 'text', 'number', 'radio']
|
228 |
});
|
229 |
$(document).ready(function () {
|
230 |
-
|
231 |
-
|
|
|
|
|
232 |
})(jQuery);
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 11);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 11:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
/**
|
75 |
* Conditional Logic for metabox fields
|
76 |
*
|
81 |
;(function ($) {
|
82 |
window.conditional_logic_gray_state = function (state, field) {
|
83 |
if (state) {
|
84 |
+
$(this).removeClass('disabled');
|
85 |
} else {
|
86 |
+
$(this).addClass('disabled');
|
87 |
}
|
88 |
};
|
89 |
var Conditional_Logic = window.Conditional_Logic = function (options) {
|
92 |
};
|
93 |
|
94 |
Conditional_Logic.prototype = $.extend(Conditional_Logic.prototype, {
|
95 |
+
evaluate: function evaluate(changedId, conditionals) {
|
96 |
if (!conditionals) {
|
97 |
return undefined;
|
98 |
}
|
116 |
}
|
117 |
return show;
|
118 |
},
|
119 |
+
evaluateRequirement: function evaluateRequirement(requirement) {
|
120 |
if (!requirement) {
|
121 |
return undefined;
|
122 |
}
|
153 |
}
|
154 |
},
|
155 |
|
156 |
+
compare: function compare(value2, value1, operator) {
|
157 |
var show = undefined;
|
158 |
switch (operator) {
|
159 |
case '===':
|
160 |
+
show = value1 === value2;
|
161 |
break;
|
162 |
case '==':
|
163 |
case '=':
|
164 |
case 'equals':
|
165 |
case 'equal':
|
166 |
+
show = value1 === value2;
|
167 |
break;
|
168 |
case '!==':
|
169 |
+
show = value1 !== value2;
|
170 |
break;
|
171 |
case '!=':
|
172 |
case 'not equal':
|
173 |
+
show = value1 !== value2;
|
174 |
break;
|
175 |
case '>=':
|
176 |
case 'greater or equal':
|
177 |
case 'equal or greater':
|
178 |
+
show = value1 >= value2;
|
179 |
break;
|
180 |
case '<=':
|
181 |
case 'smaller or equal':
|
182 |
case 'equal or smaller':
|
183 |
+
show = value1 <= value2;
|
184 |
break;
|
185 |
case '>':
|
186 |
case 'greater':
|
187 |
+
show = value1 > value2;
|
188 |
break;
|
189 |
case '<':
|
190 |
case 'smaller':
|
191 |
+
show = value1 < value2;
|
192 |
break;
|
193 |
case 'contains':
|
194 |
case 'in':
|
211 |
}
|
212 |
break;
|
213 |
default:
|
214 |
+
show = value1 === value2;
|
215 |
}
|
216 |
if (show !== undefined) {
|
217 |
return show;
|
218 |
}
|
219 |
return true;
|
220 |
},
|
221 |
+
hasConditional: function hasConditional(source, target) {
|
222 |
if (!this.options.conditionals) {
|
223 |
return;
|
224 |
}
|
232 |
}
|
233 |
return false;
|
234 |
},
|
235 |
+
update: function update(changedField, $fields) {
|
236 |
var $changedField = $(changedField),
|
237 |
id = this.getFieldName($changedField);
|
238 |
$fields = $fields || $('.rwmb-field');
|
255 |
show = !show;
|
256 |
}
|
257 |
if ($.isFunction(window[conditional.state_callback])) {
|
258 |
+
window[conditional.state_callback].call(thisField, show, thisField);
|
259 |
} else {
|
260 |
thisField.toggle(show);
|
261 |
}
|
262 |
}
|
263 |
}, this);
|
264 |
},
|
265 |
+
updateAll: function updateAll() {
|
266 |
var $fields = $('.rwmb-field'),
|
267 |
that = this;
|
268 |
_.forEach($fields, function (field) {
|
282 |
}).trigger('change');
|
283 |
}, this);
|
284 |
},
|
285 |
+
getFieldType: function getFieldType(field) {
|
286 |
var $field = $(field);
|
287 |
if ($field.length === 0) {
|
288 |
return false;
|
294 |
}
|
295 |
return false;
|
296 |
},
|
297 |
+
getFieldName: function getFieldName(field) {
|
298 |
return $(field).find('.rwmb-field-name').val();
|
299 |
},
|
300 |
supportFields: ['yes-no', 'text', 'number', 'radio']
|
301 |
});
|
302 |
$(document).ready(function () {
|
303 |
+
if (window.lp_conditional_logic !== undefined) {
|
304 |
+
new Conditional_Logic({ conditionals: lp_conditional_logic });
|
305 |
+
}
|
306 |
+
});
|
307 |
})(jQuery);
|
308 |
+
|
309 |
+
/***/ })
|
310 |
+
|
311 |
+
/******/ });
|
312 |
+
//# sourceMappingURL=conditional-logic.js.map
|
assets/js/admin/conditional-logic.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var t={};i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},i.p="",i(i.s=11)}({11:function(e,i,t){"use strict";!function(e){window.conditional_logic_gray_state=function(i,t){i?e(this).removeClass("disabled"):e(this).addClass("disabled")};var i=window.Conditional_Logic=function(i){this.options=e.extend({},i||{}),this.updateAll()};i.prototype=e.extend(i.prototype,{evaluate:function(i,t){if(t&&t&&e.isArray(t.conditional)){var a=void 0,n=t.conditional;for(var r in n){var o=this.evaluateRequirement(n[r]),s=(n[r].combine||"and").toLowerCase();void 0!==o&&void 0!==a?a="and"===s?a&&o:a||o:void 0===a&&(a=o)}return a}},evaluateRequirement:function(i){if(i&&i.field){void 0===i.compare&&(i.compare="=");var t=e("#field-"+i.field);switch(i.state){case"show":return t.is(":visible");case"hide":return!t.is(":visible");default:var a="";switch(this.getFieldType(t)){case"yes-no":var n=t.find('input[type="checkbox"]');a=n.is(":checked")?n.val():"";break;case"radio":a=t.find("input:checked").val();break;default:a=t.find("input, select").val()}return this.compare(i.value,a,i.compare)}}},compare:function(i,t,a){var n=void 0;switch(a){case"===":n=t===i;break;case"==":case"=":case"equals":case"equal":n=t===i;break;case"!==":n=t!==i;break;case"!=":case"not equal":n=t!==i;break;case">=":case"greater or equal":case"equal or greater":n=t>=i;break;case"<=":case"smaller or equal":case"equal or smaller":n=t<=i;break;case">":case"greater":n=t>i;break;case"<":case"smaller":n=t<i;break;case"contains":case"in":var r,o;e.isArray(t)&&!e.isArray(i)?(r=t,o=i):e.isArray(i)&&!e.isArray(t)&&(r=i,o=t),r&&o?-1===e.inArray(o,r)&&(n=!1):-1===t.indexOf(i)&&-1===i.indexOf(t)&&(n=!1);break;default:n=t===i}return void 0===n||n},hasConditional:function(e,i){if(this.options.conditionals){if(!this.options.conditionals[i])return!1;for(var t in this.options.conditionals[i].conditional)if(this.options.conditionals[i].conditional[t].field===e)return this.options.conditionals[i];return!1}},update:function(i,t){var a=e(i),n=this.getFieldName(a);t=t||e(".rwmb-field"),_.forEach(t,function(i){var t=e(i),r=this.getFieldName(t);if(r!==n){var o=this.hasConditional(n,r);if(o){var s=this.evaluate(a,o);void 0!==s&&("hide"===o.state&&(s=!s),e.isFunction(window[o.state_callback])?window[o.state_callback].call(t,s,t):t.toggle(s))}}},this)},updateAll:function(){var i=e(".rwmb-field"),t=this;_.forEach(i,function(a){var n=e(a),r=this.getFieldType(n),o=n.find(".rwmb-field-name").val();o&&(n.attr("id","field-"+o),-1!==_.indexOf(this.supportFields,r)&&n.find("input, select, textarea").on("change",function(){t.update(e(this).closest(".rwmb-field"),i)}).trigger("change"))},this)},getFieldType:function(i){var t=e(i);if(0===t.length)return!1;var a=t.get(0).className,n=a.match(/rwmb-([^\s]*)-wrapper/);return!!n&&n[1]},getFieldName:function(i){return e(i).find(".rwmb-field-name").val()},supportFields:["yes-no","text","number","radio"]}),e(document).ready(function(){void 0!==window.lp_conditional_logic&&new i({conditionals:lp_conditional_logic})})}(jQuery)}});
|
assets/js/admin/course-editor.js
DELETED
@@ -1,866 +0,0 @@
|
|
1 |
-
;
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Helpers
|
5 |
-
*
|
6 |
-
* @since 3.0.0
|
7 |
-
*/
|
8 |
-
(function (exports) {
|
9 |
-
function cloneObject(object) {
|
10 |
-
return JSON.parse(JSON.stringify(object));
|
11 |
-
}
|
12 |
-
|
13 |
-
exports.LP_Helpers = {
|
14 |
-
cloneObject: cloneObject
|
15 |
-
};
|
16 |
-
})(window);
|
17 |
-
|
18 |
-
window.$Vue = window.$Vue || Vue;
|
19 |
-
window.$Vuex = window.$Vuex || Vuex;
|
20 |
-
|
21 |
-
var $VueHTTP = Vue.http;
|
22 |
-
|
23 |
-
jQuery(function ($) {
|
24 |
-
|
25 |
-
/**
|
26 |
-
* I18n Store
|
27 |
-
*
|
28 |
-
* @since 3.0.0
|
29 |
-
*/
|
30 |
-
|
31 |
-
var LP_Curriculum_i18n_Store = (function (helpers, data) {
|
32 |
-
var state = helpers.cloneObject(data.i18n);
|
33 |
-
|
34 |
-
var getters = {
|
35 |
-
all: function (state) {
|
36 |
-
return state;
|
37 |
-
}
|
38 |
-
};
|
39 |
-
|
40 |
-
return {
|
41 |
-
namespaced: true,
|
42 |
-
state: state,
|
43 |
-
getters: getters
|
44 |
-
};
|
45 |
-
|
46 |
-
})(LP_Helpers, lpAdminCourseEditorSettings);
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Sections Store.
|
50 |
-
*
|
51 |
-
* @since 3.0.0
|
52 |
-
*/
|
53 |
-
var LP_Curriculum_Sections_Store = (function (helpers, data) {
|
54 |
-
var state = helpers.cloneObject(data.sections);
|
55 |
-
|
56 |
-
state.statusUpdateSection = {};
|
57 |
-
state.statusUpdateSectionItem = {};
|
58 |
-
|
59 |
-
state.sections = state.sections.map(function (section) {
|
60 |
-
var hiddenSections = state.hidden_sections;
|
61 |
-
var find = hiddenSections.find(function (sectionId) {
|
62 |
-
return parseInt(section.id) === parseInt(sectionId);
|
63 |
-
});
|
64 |
-
|
65 |
-
section.open = !find;
|
66 |
-
|
67 |
-
return section;
|
68 |
-
});
|
69 |
-
|
70 |
-
var getters = {
|
71 |
-
sections: function (state) {
|
72 |
-
return state.sections || [];
|
73 |
-
},
|
74 |
-
urlEdit: function (state) {
|
75 |
-
return state.urlEdit;
|
76 |
-
},
|
77 |
-
hiddenSections: function (state) {
|
78 |
-
return state.sections
|
79 |
-
.filter(function (section) {
|
80 |
-
return !section.open;
|
81 |
-
})
|
82 |
-
.map(function (section) {
|
83 |
-
return parseInt(section.id);
|
84 |
-
});
|
85 |
-
},
|
86 |
-
isHiddenAllSections: function (state, getters) {
|
87 |
-
var sections = getters['sections'];
|
88 |
-
var hiddenSections = getters['hiddenSections'];
|
89 |
-
|
90 |
-
return hiddenSections.length === sections.length;
|
91 |
-
},
|
92 |
-
statusUpdateSection: function (state) {
|
93 |
-
return state.statusUpdateSection;
|
94 |
-
},
|
95 |
-
statusUpdateSectionItem: function (state) {
|
96 |
-
return state.statusUpdateSectionItem;
|
97 |
-
}
|
98 |
-
};
|
99 |
-
|
100 |
-
var mutations = {
|
101 |
-
'SORT_SECTION': function (state, orders) {
|
102 |
-
state.sections = state.sections.map(function (section) {
|
103 |
-
section.order = orders[section.id];
|
104 |
-
|
105 |
-
return section;
|
106 |
-
});
|
107 |
-
},
|
108 |
-
'SET_SECTIONS': function (state, sections) {
|
109 |
-
state.sections = sections;
|
110 |
-
},
|
111 |
-
'ADD_NEW_SECTION': function (state, newSection) {
|
112 |
-
if (newSection.open === undefined) {
|
113 |
-
newSection.open = true;
|
114 |
-
}
|
115 |
-
var pos;
|
116 |
-
|
117 |
-
if (newSection.temp_id) {
|
118 |
-
state.sections.map(function (section, i) {
|
119 |
-
if (newSection.temp_id == section.id) {
|
120 |
-
pos = i;
|
121 |
-
return false;
|
122 |
-
}
|
123 |
-
});
|
124 |
-
}
|
125 |
-
|
126 |
-
if (pos !== undefined) {
|
127 |
-
$Vue.set(state.sections, pos, newSection);
|
128 |
-
} else {
|
129 |
-
state.sections.push(newSection);
|
130 |
-
}
|
131 |
-
},
|
132 |
-
'ADD_EMPTY_SECTION': function (state, section) {
|
133 |
-
section.open = true;
|
134 |
-
state.sections.push(section);
|
135 |
-
},
|
136 |
-
'REMOVE_SECTION': function (state, index) {
|
137 |
-
state.sections.splice(index, 1);
|
138 |
-
},
|
139 |
-
'REMOVE_SECTION_ITEM': function (state, payload) {
|
140 |
-
|
141 |
-
var section = state.sections.find(function (section) {
|
142 |
-
return (section.id === payload.section_id);
|
143 |
-
});
|
144 |
-
|
145 |
-
var items = section.items || [],
|
146 |
-
item = payload.item,
|
147 |
-
index = -1;
|
148 |
-
items.forEach(function (it, i) {
|
149 |
-
if (it.id === item.id) {
|
150 |
-
index = i;
|
151 |
-
}
|
152 |
-
});
|
153 |
-
|
154 |
-
if (index !== -1) {
|
155 |
-
if (item.temp_id) {
|
156 |
-
items[index].id = item.temp_id;
|
157 |
-
} else {
|
158 |
-
items.splice(index, 1);
|
159 |
-
}
|
160 |
-
}
|
161 |
-
},
|
162 |
-
'UPDATE_SECTION_ITEMS': function (state, payload) {
|
163 |
-
var section = state.sections.find(function (section) {
|
164 |
-
return parseInt(section.id) === parseInt(payload.section_id);
|
165 |
-
});
|
166 |
-
|
167 |
-
if (!section) {
|
168 |
-
return;
|
169 |
-
}
|
170 |
-
section.items = payload.items;
|
171 |
-
},
|
172 |
-
'UPDATE_SECTION_ITEM': function (state, payload) {
|
173 |
-
|
174 |
-
},
|
175 |
-
|
176 |
-
'CLOSE_SECTION': function (state, section) {
|
177 |
-
state.sections.forEach(function (_section, index) {
|
178 |
-
if (section.id === _section.id) {
|
179 |
-
state.sections[index].open = false;
|
180 |
-
}
|
181 |
-
});
|
182 |
-
|
183 |
-
},
|
184 |
-
|
185 |
-
'OPEN_SECTION': function (state, section) {
|
186 |
-
state.sections.forEach(function (_section, index) {
|
187 |
-
if (section.id === _section.id) {
|
188 |
-
state.sections[index].open = true;
|
189 |
-
}
|
190 |
-
});
|
191 |
-
},
|
192 |
-
|
193 |
-
'OPEN_ALL_SECTIONS': function (state) {
|
194 |
-
state.sections = state.sections.map(function (_section) {
|
195 |
-
_section.open = true;
|
196 |
-
|
197 |
-
return _section;
|
198 |
-
});
|
199 |
-
},
|
200 |
-
|
201 |
-
'CLOSE_ALL_SECTIONS': function (state) {
|
202 |
-
state.sections = state.sections.map(function (_section) {
|
203 |
-
_section.open = false;
|
204 |
-
|
205 |
-
return _section;
|
206 |
-
});
|
207 |
-
},
|
208 |
-
|
209 |
-
'UPDATE_SECTION_REQUEST': function (state, sectionId) {
|
210 |
-
$Vue.set(state.statusUpdateSection, sectionId, 'updating');
|
211 |
-
},
|
212 |
-
|
213 |
-
'UPDATE_SECTION_SUCCESS': function (state, sectionId) {
|
214 |
-
$Vue.set(state.statusUpdateSection, sectionId, 'successful');
|
215 |
-
},
|
216 |
-
|
217 |
-
'UPDATE_SECTION_FAILURE': function (state, sectionId) {
|
218 |
-
$Vue.set(state.statusUpdateSection, sectionId, 'failed');
|
219 |
-
},
|
220 |
-
|
221 |
-
'UPDATE_SECTION_ITEM_REQUEST': function (state, itemId) {
|
222 |
-
$Vue.set(state.statusUpdateSectionItem, itemId, 'updating');
|
223 |
-
},
|
224 |
-
|
225 |
-
'UPDATE_SECTION_ITEM_SUCCESS': function (state, itemId) {
|
226 |
-
$Vue.set(state.statusUpdateSectionItem, itemId, 'successful');
|
227 |
-
},
|
228 |
-
|
229 |
-
'UPDATE_SECTION_ITEM_FAILURE': function (state, itemId) {
|
230 |
-
$Vue.set(state.statusUpdateSectionItem, itemId, 'failed');
|
231 |
-
},
|
232 |
-
'APPEND_EMPTY_ITEM_TO_SECTION': function (state, data) {
|
233 |
-
|
234 |
-
var section = state.sections.find(function (section) {
|
235 |
-
return parseInt(section.id) === parseInt(data.section_id);
|
236 |
-
});
|
237 |
-
|
238 |
-
if (!section) {
|
239 |
-
return;
|
240 |
-
}
|
241 |
-
|
242 |
-
section.items.push({id: data.item.id, title: data.item.title, type: 'empty-item'});
|
243 |
-
},
|
244 |
-
'UPDATE_ITEM_SECTION_BY_ID': function (state, data) {
|
245 |
-
var section = state.sections.find(function (section) {
|
246 |
-
return parseInt(section.id) === parseInt(data.section_id);
|
247 |
-
});
|
248 |
-
|
249 |
-
if (!section) {
|
250 |
-
return;
|
251 |
-
}
|
252 |
-
|
253 |
-
for (var i = 0; i < section.items.length; i++) {
|
254 |
-
try {
|
255 |
-
if (!section.items[i]) {
|
256 |
-
continue;
|
257 |
-
}
|
258 |
-
|
259 |
-
var item_id = section.items[i].id;
|
260 |
-
if (item_id) {
|
261 |
-
if (data.items[item_id]) {
|
262 |
-
$Vue.set(section.items, i, data.items[item_id])
|
263 |
-
}
|
264 |
-
}
|
265 |
-
} catch (ex) {
|
266 |
-
console.log(ex)
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
-
//section.items.push({id: data.item.id, title: data.item.title, type: 'empty-item'});
|
271 |
-
}
|
272 |
-
};
|
273 |
-
|
274 |
-
var actions = {
|
275 |
-
|
276 |
-
toggleAllSections: function (context) {
|
277 |
-
var hidden = context.getters['isHiddenAllSections'];
|
278 |
-
|
279 |
-
if (hidden) {
|
280 |
-
context.commit('OPEN_ALL_SECTIONS');
|
281 |
-
} else {
|
282 |
-
context.commit('CLOSE_ALL_SECTIONS');
|
283 |
-
}
|
284 |
-
|
285 |
-
LP.Request({
|
286 |
-
type: 'hidden-sections',
|
287 |
-
hidden: context.getters['hiddenSections']
|
288 |
-
});
|
289 |
-
},
|
290 |
-
|
291 |
-
updateSectionsOrder: function (context, order) {
|
292 |
-
LP.Request({
|
293 |
-
type: 'sort-sections',
|
294 |
-
order: JSON.stringify(order)
|
295 |
-
}).then(
|
296 |
-
function (response) {
|
297 |
-
var result = response.body;
|
298 |
-
var order_sections = result.data;
|
299 |
-
context.commit('SORT_SECTION', order_sections);
|
300 |
-
},
|
301 |
-
function (error) {
|
302 |
-
console.error(error);
|
303 |
-
}
|
304 |
-
);
|
305 |
-
},
|
306 |
-
|
307 |
-
toggleSection: function (context, section) {
|
308 |
-
if (section.open) {
|
309 |
-
context.commit('CLOSE_SECTION', section);
|
310 |
-
} else {
|
311 |
-
context.commit('OPEN_SECTION', section);
|
312 |
-
}
|
313 |
-
|
314 |
-
LP.Request({
|
315 |
-
type: 'hidden-sections',
|
316 |
-
hidden: context.getters['hiddenSections']
|
317 |
-
});
|
318 |
-
},
|
319 |
-
|
320 |
-
updateSection: function (context, section) {
|
321 |
-
context.commit('UPDATE_SECTION_REQUEST', section.id);
|
322 |
-
|
323 |
-
LP.Request({
|
324 |
-
type: 'update-section',
|
325 |
-
section: JSON.stringify(section)
|
326 |
-
})
|
327 |
-
.then(function () {
|
328 |
-
context.commit('UPDATE_SECTION_SUCCESS', section.id);
|
329 |
-
})
|
330 |
-
.catch(function () {
|
331 |
-
context.commit('UPDATE_SECTION_FAILURE', section.id);
|
332 |
-
})
|
333 |
-
},
|
334 |
-
|
335 |
-
removeSection: function (context, payload) {
|
336 |
-
context.commit('REMOVE_SECTION', payload.index);
|
337 |
-
|
338 |
-
LP.Request({
|
339 |
-
type: 'remove-section',
|
340 |
-
section_id: payload.section.id
|
341 |
-
}).then(
|
342 |
-
function (response) {
|
343 |
-
var result = response.body;
|
344 |
-
},
|
345 |
-
function (error) {
|
346 |
-
console.error(error);
|
347 |
-
}
|
348 |
-
);
|
349 |
-
},
|
350 |
-
|
351 |
-
newSection: function (context, name) {
|
352 |
-
var newSection = {
|
353 |
-
type: 'new-section',
|
354 |
-
section_name: name,
|
355 |
-
temp_id: LP.uniqueId()
|
356 |
-
}
|
357 |
-
context.commit('ADD_NEW_SECTION', {
|
358 |
-
id: newSection.temp_id,
|
359 |
-
items: [],
|
360 |
-
open: false,
|
361 |
-
title: newSection.section_name
|
362 |
-
});
|
363 |
-
|
364 |
-
LP.Request(newSection).then(
|
365 |
-
function (response) {
|
366 |
-
var result = response.body;
|
367 |
-
|
368 |
-
if (result.success) {
|
369 |
-
var section = $.extend({}, result.data, {open: true});
|
370 |
-
|
371 |
-
// update course section
|
372 |
-
context.commit('ADD_NEW_SECTION', section);
|
373 |
-
}
|
374 |
-
},
|
375 |
-
function (error) {
|
376 |
-
console.error(error);
|
377 |
-
}
|
378 |
-
);
|
379 |
-
},
|
380 |
-
|
381 |
-
updateSectionItem: function (context, payload) {
|
382 |
-
context.commit('UPDATE_SECTION_ITEM_REQUEST', payload.item.id);
|
383 |
-
|
384 |
-
LP.Request({
|
385 |
-
type: 'update-section-item',
|
386 |
-
section_id: payload.section_id,
|
387 |
-
item: JSON.stringify(payload.item)
|
388 |
-
|
389 |
-
}).then(
|
390 |
-
function (response) {
|
391 |
-
context.commit('UPDATE_SECTION_ITEM_SUCCESS', payload.item.id);
|
392 |
-
|
393 |
-
var result = response.body;
|
394 |
-
if (result.success) {
|
395 |
-
var item = result.data;
|
396 |
-
|
397 |
-
context.commit('UPDATE_SECTION_ITEM', {section_id: payload.section_id, item: item});
|
398 |
-
}
|
399 |
-
},
|
400 |
-
function (error) {
|
401 |
-
context.commit('UPDATE_SECTION_ITEM_FAILURE', payload.item.id);
|
402 |
-
console.error(error);
|
403 |
-
}
|
404 |
-
);
|
405 |
-
},
|
406 |
-
|
407 |
-
removeSectionItem: function (context, payload) {
|
408 |
-
var id = payload.item.id;
|
409 |
-
context.commit('REMOVE_SECTION_ITEM', payload);
|
410 |
-
payload.item.temp_id = 0;
|
411 |
-
LP.Request({
|
412 |
-
type: 'remove-section-item',
|
413 |
-
section_id: payload.section_id,
|
414 |
-
item_id: id
|
415 |
-
}).then(
|
416 |
-
function () {
|
417 |
-
context.commit('REMOVE_SECTION_ITEM', payload);
|
418 |
-
}
|
419 |
-
);
|
420 |
-
},
|
421 |
-
|
422 |
-
deleteSectionItem: function (context, payload) {
|
423 |
-
var id = payload.item.id;
|
424 |
-
context.commit('REMOVE_SECTION_ITEM', payload);
|
425 |
-
payload.item.temp_id = 0;
|
426 |
-
LP.Request({
|
427 |
-
type: 'delete-section-item',
|
428 |
-
section_id: payload.section_id,
|
429 |
-
item_id: id
|
430 |
-
}).then(
|
431 |
-
function () {
|
432 |
-
context.commit('REMOVE_SECTION_ITEM', payload);
|
433 |
-
}
|
434 |
-
);
|
435 |
-
},
|
436 |
-
|
437 |
-
newSectionItem: function (context, payload) {
|
438 |
-
|
439 |
-
context.commit('APPEND_EMPTY_ITEM_TO_SECTION', payload)
|
440 |
-
//context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
|
441 |
-
LP.Request({
|
442 |
-
type: 'new-section-item',
|
443 |
-
section_id: payload.section_id,
|
444 |
-
item: JSON.stringify(payload.item)
|
445 |
-
}).then(
|
446 |
-
function (response) {
|
447 |
-
var result = response.body;
|
448 |
-
|
449 |
-
if (result.success) {
|
450 |
-
// context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
|
451 |
-
var items = {};
|
452 |
-
$.each(result.data, function (i, a) {
|
453 |
-
items[a.old_id ? a.old_id : a.id] = a;
|
454 |
-
});
|
455 |
-
context.commit('UPDATE_ITEM_SECTION_BY_ID', {
|
456 |
-
section_id: payload.section_id,
|
457 |
-
items: items
|
458 |
-
});
|
459 |
-
}
|
460 |
-
},
|
461 |
-
function (error) {
|
462 |
-
console.error(error);
|
463 |
-
}
|
464 |
-
);
|
465 |
-
},
|
466 |
-
|
467 |
-
updateSectionItems: function (context, payload) {
|
468 |
-
LP.Request({
|
469 |
-
type: 'update-section-items',
|
470 |
-
section_id: payload.section_id,
|
471 |
-
items: JSON.stringify(payload.items),
|
472 |
-
last_section: state.sections[state.sections.length - 1] === (payload.section_id)
|
473 |
-
}).then(
|
474 |
-
function (response) {
|
475 |
-
var result = response.body;
|
476 |
-
|
477 |
-
if (result.success) {
|
478 |
-
// console.log(result);
|
479 |
-
}
|
480 |
-
},
|
481 |
-
function (error) {
|
482 |
-
console.error(error);
|
483 |
-
}
|
484 |
-
);
|
485 |
-
}
|
486 |
-
};
|
487 |
-
|
488 |
-
return {
|
489 |
-
namespaced: true,
|
490 |
-
state: state,
|
491 |
-
getters: getters,
|
492 |
-
mutations: mutations,
|
493 |
-
actions: actions
|
494 |
-
};
|
495 |
-
})(LP_Helpers, lpAdminCourseEditorSettings);
|
496 |
-
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Choose Item Modal Store
|
500 |
-
*
|
501 |
-
* @since 3.0.0
|
502 |
-
*
|
503 |
-
* @type {{namespaced, state, getters, mutations, actions}}
|
504 |
-
*/
|
505 |
-
var LP_Choose_Items_Modal_Store = (function (exports, helpers, data) {
|
506 |
-
var state = helpers.cloneObject(data.chooseItems);
|
507 |
-
state.sectionId = false;
|
508 |
-
state.pagination = '';
|
509 |
-
state.status = '';
|
510 |
-
|
511 |
-
var getters = {
|
512 |
-
status: function (state) {
|
513 |
-
return state.status;
|
514 |
-
},
|
515 |
-
pagination: function (state) {
|
516 |
-
return state.pagination;
|
517 |
-
},
|
518 |
-
items: function (state, _getters) {
|
519 |
-
return state.items.map(function (item) {
|
520 |
-
var find = _getters.addedItems.find(function (_item) {
|
521 |
-
return item.id === _item.id;
|
522 |
-
});
|
523 |
-
|
524 |
-
item.added = !!find;
|
525 |
-
|
526 |
-
return item;
|
527 |
-
});
|
528 |
-
},
|
529 |
-
addedItems: function (state) {
|
530 |
-
return state.addedItems;
|
531 |
-
},
|
532 |
-
isOpen: function (state) {
|
533 |
-
return state.open;
|
534 |
-
},
|
535 |
-
types: function (state) {
|
536 |
-
return state.types;
|
537 |
-
},
|
538 |
-
section: function () {
|
539 |
-
return state.sectionId;
|
540 |
-
}
|
541 |
-
};
|
542 |
-
|
543 |
-
var mutations = {
|
544 |
-
'TOGGLE': function (state) {
|
545 |
-
state.open = !state.open;
|
546 |
-
},
|
547 |
-
'SET_SECTION': function (state, sectionId) {
|
548 |
-
state.sectionId = sectionId;
|
549 |
-
},
|
550 |
-
'SET_LIST_ITEMS': function (state, items) {
|
551 |
-
state.items = items;
|
552 |
-
},
|
553 |
-
'ADD_ITEM': function (state, item) {
|
554 |
-
state.addedItems.push(item);
|
555 |
-
},
|
556 |
-
'REMOVE_ADDED_ITEM': function (state, item) {
|
557 |
-
state.addedItems.forEach(function (_item, index) {
|
558 |
-
if (_item.id === item.id) {
|
559 |
-
state.addedItems.splice(index, 1);
|
560 |
-
}
|
561 |
-
});
|
562 |
-
},
|
563 |
-
'RESET': function (state) {
|
564 |
-
state.addedItems = [];
|
565 |
-
state.items = [];
|
566 |
-
},
|
567 |
-
'UPDATE_PAGINATION': function (state, pagination) {
|
568 |
-
state.pagination = pagination;
|
569 |
-
},
|
570 |
-
'SEARCH_ITEMS_REQUEST': function (state) {
|
571 |
-
state.status = 'loading';
|
572 |
-
},
|
573 |
-
'SEARCH_ITEMS_SUCCESS': function (state) {
|
574 |
-
state.status = 'successful';
|
575 |
-
},
|
576 |
-
'SEARCH_ITEMS_FAILURE': function (state) {
|
577 |
-
state.status = 'failed';
|
578 |
-
}
|
579 |
-
};
|
580 |
-
|
581 |
-
var actions = {
|
582 |
-
|
583 |
-
toggle: function (context) {
|
584 |
-
context.commit('TOGGLE');
|
585 |
-
},
|
586 |
-
|
587 |
-
open: function (context, sectionId) {
|
588 |
-
context.commit('SET_SECTION', sectionId);
|
589 |
-
context.commit('RESET');
|
590 |
-
context.commit('TOGGLE');
|
591 |
-
},
|
592 |
-
|
593 |
-
searchItems: function (context, payload) {
|
594 |
-
context.commit('SEARCH_ITEMS_REQUEST');
|
595 |
-
|
596 |
-
LP.Request({
|
597 |
-
type: 'search-items',
|
598 |
-
query: payload.query,
|
599 |
-
item_type: payload.type,
|
600 |
-
page: payload.page,
|
601 |
-
exclude: JSON.stringify([])
|
602 |
-
}).then(
|
603 |
-
function (response) {
|
604 |
-
var result = response.body;
|
605 |
-
|
606 |
-
if (!result.success) {
|
607 |
-
return;
|
608 |
-
}
|
609 |
-
|
610 |
-
var data = result.data;
|
611 |
-
|
612 |
-
context.commit('SET_LIST_ITEMS', data.items);
|
613 |
-
context.commit('UPDATE_PAGINATION', data.pagination);
|
614 |
-
context.commit('SEARCH_ITEMS_SUCCESS');
|
615 |
-
},
|
616 |
-
function (error) {
|
617 |
-
context.commit('SEARCH_ITEMS_FAILURE');
|
618 |
-
|
619 |
-
console.error(error);
|
620 |
-
}
|
621 |
-
);
|
622 |
-
},
|
623 |
-
|
624 |
-
addItem: function (context, item) {
|
625 |
-
context.commit('ADD_ITEM', item);
|
626 |
-
},
|
627 |
-
|
628 |
-
removeItem: function (context, index) {
|
629 |
-
context.commit('REMOVE_ADDED_ITEM', index);
|
630 |
-
},
|
631 |
-
|
632 |
-
addItemsToSection: function (context) {
|
633 |
-
var items = context.getters.addedItems;
|
634 |
-
|
635 |
-
if (items.length > 0) {
|
636 |
-
LP.Request({
|
637 |
-
type: 'add-items-to-section',
|
638 |
-
section_id: context.getters.section,
|
639 |
-
items: JSON.stringify(items)
|
640 |
-
}).then(
|
641 |
-
function (response) {
|
642 |
-
var result = response.body;
|
643 |
-
|
644 |
-
if (result.success) {
|
645 |
-
context.commit('TOGGLE');
|
646 |
-
|
647 |
-
var items = result.data;
|
648 |
-
context.commit('ss/UPDATE_SECTION_ITEMS', {
|
649 |
-
section_id: context.getters.section,
|
650 |
-
items: items
|
651 |
-
}, {root: true});
|
652 |
-
}
|
653 |
-
},
|
654 |
-
function (error) {
|
655 |
-
console.error(error);
|
656 |
-
}
|
657 |
-
);
|
658 |
-
}
|
659 |
-
}
|
660 |
-
};
|
661 |
-
|
662 |
-
return {
|
663 |
-
namespaced: true,
|
664 |
-
state: state,
|
665 |
-
getters: getters,
|
666 |
-
mutations: mutations,
|
667 |
-
actions: actions
|
668 |
-
}
|
669 |
-
})(window, LP_Helpers, lpAdminCourseEditorSettings);
|
670 |
-
|
671 |
-
/**
|
672 |
-
* Root Store
|
673 |
-
*
|
674 |
-
* @since 3.0.0
|
675 |
-
*/
|
676 |
-
(function (exports, helpers, data) {
|
677 |
-
var state = helpers.cloneObject(data.root);
|
678 |
-
|
679 |
-
state.status = 'success';
|
680 |
-
state.heartbeat = true;
|
681 |
-
state.countCurrentRequest = 0;
|
682 |
-
|
683 |
-
var getters = {
|
684 |
-
heartbeat: function (state) {
|
685 |
-
return state.heartbeat;
|
686 |
-
},
|
687 |
-
action: function (state) {
|
688 |
-
return state.action;
|
689 |
-
},
|
690 |
-
id: function (state) {
|
691 |
-
return state.course_id;
|
692 |
-
},
|
693 |
-
autoDraft: function (state) {
|
694 |
-
return state.auto_draft;
|
695 |
-
},
|
696 |
-
disable_curriculum: function (state) {
|
697 |
-
return state.disable_curriculum;
|
698 |
-
},
|
699 |
-
status: function (state) {
|
700 |
-
return state.status || 'error';
|
701 |
-
},
|
702 |
-
currentRequest: function (state) {
|
703 |
-
return state.countCurrentRequest || 0;
|
704 |
-
},
|
705 |
-
urlAjax: function (state) {
|
706 |
-
return state.ajax;
|
707 |
-
},
|
708 |
-
nonce: function (state) {
|
709 |
-
return state.nonce;
|
710 |
-
}
|
711 |
-
};
|
712 |
-
|
713 |
-
var mutations = {
|
714 |
-
|
715 |
-
'UPDATE_HEART_BEAT': function (state, status) {
|
716 |
-
state.heartbeat = !!status;
|
717 |
-
},
|
718 |
-
|
719 |
-
'UPDATE_AUTO_DRAFT_STATUS': function (state, status) {
|
720 |
-
// check auto draft status
|
721 |
-
state.auto_draft = status;
|
722 |
-
},
|
723 |
-
|
724 |
-
'UPDATE_STATUS': function (state, status) {
|
725 |
-
state.status = status;
|
726 |
-
},
|
727 |
-
|
728 |
-
'INCREASE_NUMBER_REQUEST': function (state) {
|
729 |
-
state.countCurrentRequest++;
|
730 |
-
},
|
731 |
-
|
732 |
-
'DECREASE_NUMBER_REQUEST': function (state) {
|
733 |
-
state.countCurrentRequest--;
|
734 |
-
}
|
735 |
-
};
|
736 |
-
|
737 |
-
var actions = {
|
738 |
-
heartbeat: function (context) {
|
739 |
-
LP.Request({
|
740 |
-
type: 'heartbeat'
|
741 |
-
}).then(
|
742 |
-
function (response) {
|
743 |
-
var result = response.body;
|
744 |
-
context.commit('UPDATE_HEART_BEAT', !!result.success);
|
745 |
-
},
|
746 |
-
function (error) {
|
747 |
-
context.commit('UPDATE_HEART_BEAT', false);
|
748 |
-
}
|
749 |
-
);
|
750 |
-
},
|
751 |
-
|
752 |
-
draftCourse: function (context, payload) {
|
753 |
-
var auto_draft = context.getters['autoDraft'];
|
754 |
-
|
755 |
-
if (auto_draft) {
|
756 |
-
LP.Request({
|
757 |
-
type: 'draft-course',
|
758 |
-
course: JSON.stringify(payload)
|
759 |
-
}).then(function (response) {
|
760 |
-
var result = response.body;
|
761 |
-
|
762 |
-
if (!result.success) {
|
763 |
-
return;
|
764 |
-
}
|
765 |
-
|
766 |
-
context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
|
767 |
-
}
|
768 |
-
)
|
769 |
-
}
|
770 |
-
},
|
771 |
-
|
772 |
-
newRequest: function (context) {
|
773 |
-
context.commit('INCREASE_NUMBER_REQUEST');
|
774 |
-
context.commit('UPDATE_STATUS', 'loading');
|
775 |
-
|
776 |
-
window.onbeforeunload = function () {
|
777 |
-
return '';
|
778 |
-
}
|
779 |
-
},
|
780 |
-
|
781 |
-
requestComplete: function (context, status) {
|
782 |
-
context.commit('DECREASE_NUMBER_REQUEST');
|
783 |
-
|
784 |
-
if (context.getters.currentRequest === 0) {
|
785 |
-
context.commit('UPDATE_STATUS', status);
|
786 |
-
window.onbeforeunload = null;
|
787 |
-
}
|
788 |
-
}
|
789 |
-
};
|
790 |
-
|
791 |
-
exports.LP_Curriculum_Store = new $Vuex.Store({
|
792 |
-
state: state,
|
793 |
-
getters: getters,
|
794 |
-
mutations: mutations,
|
795 |
-
actions: actions,
|
796 |
-
modules: {
|
797 |
-
ci: LP_Choose_Items_Modal_Store,
|
798 |
-
i18n: LP_Curriculum_i18n_Store,
|
799 |
-
ss: LP_Curriculum_Sections_Store
|
800 |
-
}
|
801 |
-
});
|
802 |
-
|
803 |
-
})(window, LP_Helpers, lpAdminCourseEditorSettings);
|
804 |
-
|
805 |
-
/**
|
806 |
-
* HTTP
|
807 |
-
*
|
808 |
-
* @since 3.0.0
|
809 |
-
*/
|
810 |
-
(function (exports, $store) {
|
811 |
-
LP.Request = function (payload) {
|
812 |
-
payload['id'] = $store.getters.id;
|
813 |
-
payload['nonce'] = $store.getters.nonce;
|
814 |
-
payload['lp-ajax'] = $store.getters.action;
|
815 |
-
|
816 |
-
return $VueHTTP.post($store.getters.urlAjax,
|
817 |
-
payload,
|
818 |
-
{
|
819 |
-
emulateJSON: true,
|
820 |
-
params: {
|
821 |
-
namespace: 'LPCurriculumRequest'
|
822 |
-
}
|
823 |
-
});
|
824 |
-
};
|
825 |
-
|
826 |
-
$VueHTTP.interceptors.push(function (request, next) {
|
827 |
-
if (request.params['namespace'] !== 'LPCurriculumRequest') {
|
828 |
-
next();
|
829 |
-
return;
|
830 |
-
}
|
831 |
-
|
832 |
-
$store.dispatch('newRequest');
|
833 |
-
|
834 |
-
next(function (response) {
|
835 |
-
|
836 |
-
if (!jQuery.isPlainObject(response.body)) {
|
837 |
-
response.body = LP.parseJSON(response.body);
|
838 |
-
}
|
839 |
-
|
840 |
-
var body = response.body;
|
841 |
-
var result = body.success || false;
|
842 |
-
|
843 |
-
if (result) {
|
844 |
-
$store.dispatch('requestComplete', 'success');
|
845 |
-
} else {
|
846 |
-
$store.dispatch('requestComplete', 'failed');
|
847 |
-
}
|
848 |
-
});
|
849 |
-
});
|
850 |
-
})(window, LP_Curriculum_Store);
|
851 |
-
|
852 |
-
/**
|
853 |
-
* Init app.
|
854 |
-
*
|
855 |
-
* @since 3.0.0
|
856 |
-
*/
|
857 |
-
(function ($, $store) {
|
858 |
-
$(document).ready(function () {
|
859 |
-
window.LP_Course_Editor = new $Vue({
|
860 |
-
el: '#admin-editor-lp_course',
|
861 |
-
template: '<lp-course-editor></lp-course-editor>'
|
862 |
-
});
|
863 |
-
});
|
864 |
-
})(jQuery, LP_Curriculum_Store);
|
865 |
-
|
866 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/editor/course.js
ADDED
@@ -0,0 +1,1136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 28);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ([
|
67 |
+
/* 0 */,
|
68 |
+
/* 1 */,
|
69 |
+
/* 2 */,
|
70 |
+
/* 3 */,
|
71 |
+
/* 4 */,
|
72 |
+
/* 5 */,
|
73 |
+
/* 6 */,
|
74 |
+
/* 7 */,
|
75 |
+
/* 8 */
|
76 |
+
/***/ (function(module, exports, __webpack_require__) {
|
77 |
+
|
78 |
+
"use strict";
|
79 |
+
|
80 |
+
|
81 |
+
Object.defineProperty(exports, "__esModule", {
|
82 |
+
value: true
|
83 |
+
});
|
84 |
+
exports.default = HTTP;
|
85 |
+
function HTTP(options) {
|
86 |
+
var $ = window.jQuery;
|
87 |
+
var $VueHTTP = Vue.http;
|
88 |
+
|
89 |
+
options = $.extend({
|
90 |
+
ns: 'LPRequest',
|
91 |
+
store: false
|
92 |
+
}, options || {});
|
93 |
+
|
94 |
+
var $publishingAction = null;
|
95 |
+
|
96 |
+
LP.Request = function (payload) {
|
97 |
+
$publishingAction = $('#publishing-action');
|
98 |
+
|
99 |
+
payload['id'] = options.store.getters.id;
|
100 |
+
payload['nonce'] = options.store.getters.nonce;
|
101 |
+
payload['lp-ajax'] = options.store.getters.action;
|
102 |
+
payload['code'] = options.store.getters.code;
|
103 |
+
|
104 |
+
$publishingAction.find('#publish').addClass('disabled');
|
105 |
+
$publishingAction.find('.spinner').addClass('is-active');
|
106 |
+
$publishingAction.addClass('code-' + payload['code']);
|
107 |
+
|
108 |
+
return $VueHTTP.post(options.store.getters.urlAjax, payload, {
|
109 |
+
emulateJSON: true,
|
110 |
+
params: {
|
111 |
+
namespace: options.ns,
|
112 |
+
code: payload['code']
|
113 |
+
}
|
114 |
+
});
|
115 |
+
};
|
116 |
+
|
117 |
+
$VueHTTP.interceptors.push(function (request, next) {
|
118 |
+
if (request.params['namespace'] !== options.ns) {
|
119 |
+
next();
|
120 |
+
return;
|
121 |
+
}
|
122 |
+
|
123 |
+
options.store.dispatch('newRequest');
|
124 |
+
|
125 |
+
next(function (response) {
|
126 |
+
if (!jQuery.isPlainObject(response.body)) {
|
127 |
+
response.body = LP.parseJSON(response.body);
|
128 |
+
}
|
129 |
+
|
130 |
+
var body = response.body;
|
131 |
+
var result = body.success || false;
|
132 |
+
|
133 |
+
if (result) {
|
134 |
+
options.store.dispatch('requestCompleted', 'successful');
|
135 |
+
} else {
|
136 |
+
options.store.dispatch('requestCompleted', 'failed');
|
137 |
+
}
|
138 |
+
$publishingAction.removeClass('code-' + request.params.code);
|
139 |
+
if (!$publishingAction.attr('class')) {
|
140 |
+
$publishingAction.find('#publish').removeClass('disabled');
|
141 |
+
$publishingAction.find('.spinner').removeClass('is-active');
|
142 |
+
}
|
143 |
+
});
|
144 |
+
});
|
145 |
+
}
|
146 |
+
|
147 |
+
/***/ }),
|
148 |
+
/* 9 */,
|
149 |
+
/* 10 */,
|
150 |
+
/* 11 */,
|
151 |
+
/* 12 */
|
152 |
+
/***/ (function(module, exports, __webpack_require__) {
|
153 |
+
|
154 |
+
"use strict";
|
155 |
+
|
156 |
+
|
157 |
+
Object.defineProperty(exports, "__esModule", {
|
158 |
+
value: true
|
159 |
+
});
|
160 |
+
var $ = window.jQuery;
|
161 |
+
var i18n = function i18n(i18n) {
|
162 |
+
var state = $.extend({}, i18n);
|
163 |
+
var getters = {
|
164 |
+
all: function all(state) {
|
165 |
+
return state;
|
166 |
+
}
|
167 |
+
};
|
168 |
+
|
169 |
+
return {
|
170 |
+
namespaced: true,
|
171 |
+
state: state,
|
172 |
+
getters: getters
|
173 |
+
};
|
174 |
+
};
|
175 |
+
|
176 |
+
exports.default = i18n;
|
177 |
+
|
178 |
+
/***/ }),
|
179 |
+
/* 13 */,
|
180 |
+
/* 14 */,
|
181 |
+
/* 15 */,
|
182 |
+
/* 16 */,
|
183 |
+
/* 17 */,
|
184 |
+
/* 18 */,
|
185 |
+
/* 19 */,
|
186 |
+
/* 20 */,
|
187 |
+
/* 21 */,
|
188 |
+
/* 22 */,
|
189 |
+
/* 23 */,
|
190 |
+
/* 24 */,
|
191 |
+
/* 25 */,
|
192 |
+
/* 26 */,
|
193 |
+
/* 27 */,
|
194 |
+
/* 28 */
|
195 |
+
/***/ (function(module, exports, __webpack_require__) {
|
196 |
+
|
197 |
+
"use strict";
|
198 |
+
|
199 |
+
|
200 |
+
var _http = __webpack_require__(8);
|
201 |
+
|
202 |
+
var _http2 = _interopRequireDefault(_http);
|
203 |
+
|
204 |
+
var _course = __webpack_require__(29);
|
205 |
+
|
206 |
+
var _course2 = _interopRequireDefault(_course);
|
207 |
+
|
208 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
209 |
+
|
210 |
+
window.$Vue = window.$Vue || Vue;
|
211 |
+
window.$Vuex = window.$Vuex || Vuex;
|
212 |
+
|
213 |
+
var $ = window.jQuery;
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Init app.
|
217 |
+
*
|
218 |
+
* @since 3.0.0
|
219 |
+
*/
|
220 |
+
$(document).ready(function () {
|
221 |
+
|
222 |
+
window.LP_Curriculum_Store = new $Vuex.Store((0, _course2.default)(lpAdminCourseEditorSettings));
|
223 |
+
(0, _http2.default)({ ns: 'LPCurriculumRequest', store: LP_Curriculum_Store });
|
224 |
+
|
225 |
+
setTimeout(function () {
|
226 |
+
window.LP_Course_Editor = new $Vue({
|
227 |
+
el: '#admin-editor-lp_course',
|
228 |
+
template: '<lp-course-editor></lp-course-editor>'
|
229 |
+
});
|
230 |
+
}, 100);
|
231 |
+
});
|
232 |
+
|
233 |
+
/***/ }),
|
234 |
+
/* 29 */
|
235 |
+
/***/ (function(module, exports, __webpack_require__) {
|
236 |
+
|
237 |
+
"use strict";
|
238 |
+
|
239 |
+
|
240 |
+
Object.defineProperty(exports, "__esModule", {
|
241 |
+
value: true
|
242 |
+
});
|
243 |
+
|
244 |
+
var _modalCourseItems = __webpack_require__(30);
|
245 |
+
|
246 |
+
var _modalCourseItems2 = _interopRequireDefault(_modalCourseItems);
|
247 |
+
|
248 |
+
var _courseSection = __webpack_require__(34);
|
249 |
+
|
250 |
+
var _courseSection2 = _interopRequireDefault(_courseSection);
|
251 |
+
|
252 |
+
var _i18n = __webpack_require__(12);
|
253 |
+
|
254 |
+
var _i18n2 = _interopRequireDefault(_i18n);
|
255 |
+
|
256 |
+
var _course = __webpack_require__(38);
|
257 |
+
|
258 |
+
var _course2 = _interopRequireDefault(_course);
|
259 |
+
|
260 |
+
var _course3 = __webpack_require__(39);
|
261 |
+
|
262 |
+
var _course4 = _interopRequireDefault(_course3);
|
263 |
+
|
264 |
+
var _course5 = __webpack_require__(40);
|
265 |
+
|
266 |
+
var _course6 = _interopRequireDefault(_course5);
|
267 |
+
|
268 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
269 |
+
|
270 |
+
var $ = window.jQuery;
|
271 |
+
var Course = function Course(data) {
|
272 |
+
var state = $.extend({}, data.root);
|
273 |
+
|
274 |
+
state.status = 'success';
|
275 |
+
state.heartbeat = true;
|
276 |
+
state.countCurrentRequest = 0;
|
277 |
+
|
278 |
+
return {
|
279 |
+
state: state,
|
280 |
+
getters: _course2.default,
|
281 |
+
mutations: _course4.default,
|
282 |
+
actions: _course6.default,
|
283 |
+
modules: {
|
284 |
+
ci: (0, _modalCourseItems2.default)(data),
|
285 |
+
i18n: (0, _i18n2.default)(data.i18n),
|
286 |
+
ss: (0, _courseSection2.default)(data)
|
287 |
+
}
|
288 |
+
};
|
289 |
+
};
|
290 |
+
|
291 |
+
exports.default = Course;
|
292 |
+
|
293 |
+
/***/ }),
|
294 |
+
/* 30 */
|
295 |
+
/***/ (function(module, exports, __webpack_require__) {
|
296 |
+
|
297 |
+
"use strict";
|
298 |
+
|
299 |
+
|
300 |
+
Object.defineProperty(exports, "__esModule", {
|
301 |
+
value: true
|
302 |
+
});
|
303 |
+
|
304 |
+
exports.default = function (data) {
|
305 |
+
var state = $.extend({}, data.chooseItems);
|
306 |
+
state.sectionId = false;
|
307 |
+
state.pagination = '';
|
308 |
+
state.status = '';
|
309 |
+
|
310 |
+
return {
|
311 |
+
namespaced: true,
|
312 |
+
state: state,
|
313 |
+
getters: _modalCourseItems2.default,
|
314 |
+
mutations: _modalCourseItems4.default,
|
315 |
+
actions: _modalCourseItems6.default
|
316 |
+
};
|
317 |
+
};
|
318 |
+
|
319 |
+
var _modalCourseItems = __webpack_require__(31);
|
320 |
+
|
321 |
+
var _modalCourseItems2 = _interopRequireDefault(_modalCourseItems);
|
322 |
+
|
323 |
+
var _modalCourseItems3 = __webpack_require__(32);
|
324 |
+
|
325 |
+
var _modalCourseItems4 = _interopRequireDefault(_modalCourseItems3);
|
326 |
+
|
327 |
+
var _modalCourseItems5 = __webpack_require__(33);
|
328 |
+
|
329 |
+
var _modalCourseItems6 = _interopRequireDefault(_modalCourseItems5);
|
330 |
+
|
331 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
332 |
+
|
333 |
+
var $ = jQuery;
|
334 |
+
|
335 |
+
/***/ }),
|
336 |
+
/* 31 */
|
337 |
+
/***/ (function(module, exports, __webpack_require__) {
|
338 |
+
|
339 |
+
"use strict";
|
340 |
+
|
341 |
+
|
342 |
+
Object.defineProperty(exports, "__esModule", {
|
343 |
+
value: true
|
344 |
+
});
|
345 |
+
|
346 |
+
var Getters = {
|
347 |
+
status: function status(state) {
|
348 |
+
return state.status;
|
349 |
+
},
|
350 |
+
pagination: function pagination(state) {
|
351 |
+
return state.pagination;
|
352 |
+
},
|
353 |
+
items: function items(state, _getters) {
|
354 |
+
return state.items.map(function (item) {
|
355 |
+
var find = _getters.addedItems.find(function (_item) {
|
356 |
+
return item.id === _item.id;
|
357 |
+
});
|
358 |
+
|
359 |
+
item.added = !!find;
|
360 |
+
|
361 |
+
return item;
|
362 |
+
});
|
363 |
+
},
|
364 |
+
addedItems: function addedItems(state) {
|
365 |
+
return state.addedItems;
|
366 |
+
},
|
367 |
+
isOpen: function isOpen(state) {
|
368 |
+
return state.open;
|
369 |
+
},
|
370 |
+
types: function types(state) {
|
371 |
+
return state.types;
|
372 |
+
},
|
373 |
+
section: function section() {
|
374 |
+
return state.sectionId;
|
375 |
+
}
|
376 |
+
};
|
377 |
+
|
378 |
+
exports.default = Getters;
|
379 |
+
|
380 |
+
/***/ }),
|
381 |
+
/* 32 */
|
382 |
+
/***/ (function(module, exports, __webpack_require__) {
|
383 |
+
|
384 |
+
"use strict";
|
385 |
+
|
386 |
+
|
387 |
+
Object.defineProperty(exports, "__esModule", {
|
388 |
+
value: true
|
389 |
+
});
|
390 |
+
var Mutations = {
|
391 |
+
'TOGGLE': function TOGGLE(state) {
|
392 |
+
state.open = !state.open;
|
393 |
+
},
|
394 |
+
'SET_SECTION': function SET_SECTION(state, sectionId) {
|
395 |
+
state.sectionId = sectionId;
|
396 |
+
},
|
397 |
+
'SET_LIST_ITEMS': function SET_LIST_ITEMS(state, items) {
|
398 |
+
state.items = items;
|
399 |
+
},
|
400 |
+
'ADD_ITEM': function ADD_ITEM(state, item) {
|
401 |
+
state.addedItems.push(item);
|
402 |
+
},
|
403 |
+
'REMOVE_ADDED_ITEM': function REMOVE_ADDED_ITEM(state, item) {
|
404 |
+
state.addedItems.forEach(function (_item, index) {
|
405 |
+
if (_item.id === item.id) {
|
406 |
+
state.addedItems.splice(index, 1);
|
407 |
+
}
|
408 |
+
});
|
409 |
+
},
|
410 |
+
'RESET': function RESET(state) {
|
411 |
+
state.addedItems = [];
|
412 |
+
state.items = [];
|
413 |
+
},
|
414 |
+
'UPDATE_PAGINATION': function UPDATE_PAGINATION(state, pagination) {
|
415 |
+
state.pagination = pagination;
|
416 |
+
},
|
417 |
+
'SEARCH_ITEMS_REQUEST': function SEARCH_ITEMS_REQUEST(state) {
|
418 |
+
state.status = 'loading';
|
419 |
+
},
|
420 |
+
'SEARCH_ITEMS_SUCCESS': function SEARCH_ITEMS_SUCCESS(state) {
|
421 |
+
state.status = 'successful';
|
422 |
+
},
|
423 |
+
'SEARCH_ITEMS_FAILURE': function SEARCH_ITEMS_FAILURE(state) {
|
424 |
+
state.status = 'failed';
|
425 |
+
}
|
426 |
+
};
|
427 |
+
|
428 |
+
exports.default = Mutations;
|
429 |
+
|
430 |
+
/***/ }),
|
431 |
+
/* 33 */
|
432 |
+
/***/ (function(module, exports, __webpack_require__) {
|
433 |
+
|
434 |
+
"use strict";
|
435 |
+
|
436 |
+
|
437 |
+
Object.defineProperty(exports, "__esModule", {
|
438 |
+
value: true
|
439 |
+
});
|
440 |
+
var ModalCourseItems = {
|
441 |
+
|
442 |
+
toggle: function toggle(context) {
|
443 |
+
context.commit('TOGGLE');
|
444 |
+
},
|
445 |
+
|
446 |
+
open: function open(context, sectionId) {
|
447 |
+
context.commit('SET_SECTION', sectionId);
|
448 |
+
context.commit('RESET');
|
449 |
+
context.commit('TOGGLE');
|
450 |
+
},
|
451 |
+
|
452 |
+
searchItems: function searchItems(context, payload) {
|
453 |
+
context.commit('SEARCH_ITEMS_REQUEST');
|
454 |
+
|
455 |
+
LP.Request({
|
456 |
+
type: 'search-items',
|
457 |
+
query: payload.query,
|
458 |
+
item_type: payload.type,
|
459 |
+
page: payload.page,
|
460 |
+
exclude: JSON.stringify([])
|
461 |
+
}).then(function (response) {
|
462 |
+
var result = response.body;
|
463 |
+
|
464 |
+
if (!result.success) {
|
465 |
+
return;
|
466 |
+
}
|
467 |
+
|
468 |
+
var data = result.data;
|
469 |
+
|
470 |
+
context.commit('SET_LIST_ITEMS', data.items);
|
471 |
+
context.commit('UPDATE_PAGINATION', data.pagination);
|
472 |
+
context.commit('SEARCH_ITEMS_SUCCESS');
|
473 |
+
}, function (error) {
|
474 |
+
context.commit('SEARCH_ITEMS_FAILURE');
|
475 |
+
|
476 |
+
console.error(error);
|
477 |
+
});
|
478 |
+
},
|
479 |
+
|
480 |
+
addItem: function addItem(context, item) {
|
481 |
+
context.commit('ADD_ITEM', item);
|
482 |
+
},
|
483 |
+
|
484 |
+
removeItem: function removeItem(context, index) {
|
485 |
+
context.commit('REMOVE_ADDED_ITEM', index);
|
486 |
+
},
|
487 |
+
|
488 |
+
addItemsToSection: function addItemsToSection(context) {
|
489 |
+
var items = context.getters.addedItems;
|
490 |
+
|
491 |
+
if (items.length > 0) {
|
492 |
+
LP.Request({
|
493 |
+
type: 'add-items-to-section',
|
494 |
+
section_id: context.getters.section,
|
495 |
+
items: JSON.stringify(items)
|
496 |
+
}).then(function (response) {
|
497 |
+
var result = response.body;
|
498 |
+
|
499 |
+
if (result.success) {
|
500 |
+
context.commit('TOGGLE');
|
501 |
+
|
502 |
+
var items = result.data;
|
503 |
+
context.commit('ss/UPDATE_SECTION_ITEMS', {
|
504 |
+
section_id: context.getters.section,
|
505 |
+
items: items
|
506 |
+
}, { root: true });
|
507 |
+
}
|
508 |
+
}, function (error) {
|
509 |
+
console.error(error);
|
510 |
+
});
|
511 |
+
}
|
512 |
+
}
|
513 |
+
};
|
514 |
+
|
515 |
+
exports.default = ModalCourseItems;
|
516 |
+
|
517 |
+
/***/ }),
|
518 |
+
/* 34 */
|
519 |
+
/***/ (function(module, exports, __webpack_require__) {
|
520 |
+
|
521 |
+
"use strict";
|
522 |
+
|
523 |
+
|
524 |
+
Object.defineProperty(exports, "__esModule", {
|
525 |
+
value: true
|
526 |
+
});
|
527 |
+
|
528 |
+
exports.default = function (data) {
|
529 |
+
var state = $.extend({}, data.sections);
|
530 |
+
|
531 |
+
state.statusUpdateSection = {};
|
532 |
+
state.statusUpdateSectionItem = {};
|
533 |
+
|
534 |
+
state.sections = state.sections.map(function (section) {
|
535 |
+
var hiddenSections = state.hidden_sections;
|
536 |
+
var find = hiddenSections.find(function (sectionId) {
|
537 |
+
return parseInt(section.id) === parseInt(sectionId);
|
538 |
+
});
|
539 |
+
|
540 |
+
section.open = !find;
|
541 |
+
|
542 |
+
return section;
|
543 |
+
});
|
544 |
+
|
545 |
+
return {
|
546 |
+
namespaced: true,
|
547 |
+
state: state,
|
548 |
+
getters: _courseSection6.default,
|
549 |
+
mutations: _courseSection4.default,
|
550 |
+
actions: _courseSection2.default
|
551 |
+
};
|
552 |
+
};
|
553 |
+
|
554 |
+
var _courseSection = __webpack_require__(35);
|
555 |
+
|
556 |
+
var _courseSection2 = _interopRequireDefault(_courseSection);
|
557 |
+
|
558 |
+
var _courseSection3 = __webpack_require__(36);
|
559 |
+
|
560 |
+
var _courseSection4 = _interopRequireDefault(_courseSection3);
|
561 |
+
|
562 |
+
var _courseSection5 = __webpack_require__(37);
|
563 |
+
|
564 |
+
var _courseSection6 = _interopRequireDefault(_courseSection5);
|
565 |
+
|
566 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
567 |
+
|
568 |
+
var $ = jQuery;
|
569 |
+
|
570 |
+
/***/ }),
|
571 |
+
/* 35 */
|
572 |
+
/***/ (function(module, exports, __webpack_require__) {
|
573 |
+
|
574 |
+
"use strict";
|
575 |
+
|
576 |
+
|
577 |
+
Object.defineProperty(exports, "__esModule", {
|
578 |
+
value: true
|
579 |
+
});
|
580 |
+
var CourseCurriculum = {
|
581 |
+
toggleAllSections: function toggleAllSections(context) {
|
582 |
+
var hidden = context.getters['isHiddenAllSections'];
|
583 |
+
|
584 |
+
if (hidden) {
|
585 |
+
context.commit('OPEN_ALL_SECTIONS');
|
586 |
+
} else {
|
587 |
+
context.commit('CLOSE_ALL_SECTIONS');
|
588 |
+
}
|
589 |
+
|
590 |
+
LP.Request({
|
591 |
+
type: 'hidden-sections',
|
592 |
+
hidden: context.getters['hiddenSections']
|
593 |
+
});
|
594 |
+
},
|
595 |
+
|
596 |
+
updateSectionsOrder: function updateSectionsOrder(context, order) {
|
597 |
+
LP.Request({
|
598 |
+
type: 'sort-sections',
|
599 |
+
order: JSON.stringify(order)
|
600 |
+
}).then(function (response) {
|
601 |
+
var result = response.body;
|
602 |
+
var order_sections = result.data;
|
603 |
+
context.commit('SORT_SECTION', order_sections);
|
604 |
+
}, function (error) {
|
605 |
+
console.error(error);
|
606 |
+
});
|
607 |
+
},
|
608 |
+
|
609 |
+
toggleSection: function toggleSection(context, section) {
|
610 |
+
if (section.open) {
|
611 |
+
context.commit('CLOSE_SECTION', section);
|
612 |
+
} else {
|
613 |
+
context.commit('OPEN_SECTION', section);
|
614 |
+
}
|
615 |
+
|
616 |
+
LP.Request({
|
617 |
+
type: 'hidden-sections',
|
618 |
+
hidden: context.getters['hiddenSections']
|
619 |
+
});
|
620 |
+
},
|
621 |
+
|
622 |
+
updateSection: function updateSection(context, section) {
|
623 |
+
context.commit('UPDATE_SECTION_REQUEST', section.id);
|
624 |
+
|
625 |
+
LP.Request({
|
626 |
+
type: 'update-section',
|
627 |
+
section: JSON.stringify(section)
|
628 |
+
}).then(function () {
|
629 |
+
context.commit('UPDATE_SECTION_SUCCESS', section.id);
|
630 |
+
}).catch(function () {
|
631 |
+
context.commit('UPDATE_SECTION_FAILURE', section.id);
|
632 |
+
});
|
633 |
+
},
|
634 |
+
|
635 |
+
removeSection: function removeSection(context, payload) {
|
636 |
+
context.commit('REMOVE_SECTION', payload.index);
|
637 |
+
|
638 |
+
LP.Request({
|
639 |
+
type: 'remove-section',
|
640 |
+
section_id: payload.section.id
|
641 |
+
}).then(function (response) {
|
642 |
+
var result = response.body;
|
643 |
+
}, function (error) {
|
644 |
+
console.error(error);
|
645 |
+
});
|
646 |
+
},
|
647 |
+
|
648 |
+
newSection: function newSection(context, name) {
|
649 |
+
var newSection = {
|
650 |
+
type: 'new-section',
|
651 |
+
section_name: name,
|
652 |
+
temp_id: LP.uniqueId()
|
653 |
+
};
|
654 |
+
context.commit('ADD_NEW_SECTION', {
|
655 |
+
id: newSection.temp_id,
|
656 |
+
items: [],
|
657 |
+
open: false,
|
658 |
+
title: newSection.section_name
|
659 |
+
});
|
660 |
+
|
661 |
+
LP.Request(newSection).then(function (response) {
|
662 |
+
var result = response.body;
|
663 |
+
|
664 |
+
if (result.success) {
|
665 |
+
var section = $.extend({}, result.data, { open: true });
|
666 |
+
|
667 |
+
// update course section
|
668 |
+
context.commit('ADD_NEW_SECTION', section);
|
669 |
+
}
|
670 |
+
}, function (error) {
|
671 |
+
console.error(error);
|
672 |
+
});
|
673 |
+
},
|
674 |
+
|
675 |
+
updateSectionItem: function updateSectionItem(context, payload) {
|
676 |
+
context.commit('UPDATE_SECTION_ITEM_REQUEST', payload.item.id);
|
677 |
+
|
678 |
+
LP.Request({
|
679 |
+
type: 'update-section-item',
|
680 |
+
section_id: payload.section_id,
|
681 |
+
item: JSON.stringify(payload.item)
|
682 |
+
|
683 |
+
}).then(function (response) {
|
684 |
+
context.commit('UPDATE_SECTION_ITEM_SUCCESS', payload.item.id);
|
685 |
+
|
686 |
+
var result = response.body;
|
687 |
+
if (result.success) {
|
688 |
+
var item = result.data;
|
689 |
+
|
690 |
+
context.commit('UPDATE_SECTION_ITEM', { section_id: payload.section_id, item: item });
|
691 |
+
}
|
692 |
+
}, function (error) {
|
693 |
+
context.commit('UPDATE_SECTION_ITEM_FAILURE', payload.item.id);
|
694 |
+
console.error(error);
|
695 |
+
});
|
696 |
+
},
|
697 |
+
|
698 |
+
removeSectionItem: function removeSectionItem(context, payload) {
|
699 |
+
var id = payload.item.id;
|
700 |
+
context.commit('REMOVE_SECTION_ITEM', payload);
|
701 |
+
payload.item.temp_id = 0;
|
702 |
+
LP.Request({
|
703 |
+
type: 'remove-section-item',
|
704 |
+
section_id: payload.section_id,
|
705 |
+
item_id: id
|
706 |
+
}).then(function () {
|
707 |
+
context.commit('REMOVE_SECTION_ITEM', payload);
|
708 |
+
});
|
709 |
+
},
|
710 |
+
|
711 |
+
deleteSectionItem: function deleteSectionItem(context, payload) {
|
712 |
+
var id = payload.item.id;
|
713 |
+
context.commit('REMOVE_SECTION_ITEM', payload);
|
714 |
+
payload.item.temp_id = 0;
|
715 |
+
LP.Request({
|
716 |
+
type: 'delete-section-item',
|
717 |
+
section_id: payload.section_id,
|
718 |
+
item_id: id
|
719 |
+
}).then(function () {
|
720 |
+
context.commit('REMOVE_SECTION_ITEM', payload);
|
721 |
+
});
|
722 |
+
},
|
723 |
+
|
724 |
+
newSectionItem: function newSectionItem(context, payload) {
|
725 |
+
|
726 |
+
context.commit('APPEND_EMPTY_ITEM_TO_SECTION', payload);
|
727 |
+
//context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
|
728 |
+
LP.Request({
|
729 |
+
type: 'new-section-item',
|
730 |
+
section_id: payload.section_id,
|
731 |
+
item: JSON.stringify(payload.item)
|
732 |
+
}).then(function (response) {
|
733 |
+
var result = response.body;
|
734 |
+
|
735 |
+
if (result.success) {
|
736 |
+
// context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
|
737 |
+
var items = {};
|
738 |
+
$.each(result.data, function (i, a) {
|
739 |
+
items[a.old_id ? a.old_id : a.id] = a;
|
740 |
+
});
|
741 |
+
context.commit('UPDATE_ITEM_SECTION_BY_ID', {
|
742 |
+
section_id: payload.section_id,
|
743 |
+
items: items
|
744 |
+
});
|
745 |
+
}
|
746 |
+
}, function (error) {
|
747 |
+
console.error(error);
|
748 |
+
});
|
749 |
+
},
|
750 |
+
|
751 |
+
updateSectionItems: function updateSectionItems(context, payload) {
|
752 |
+
LP.Request({
|
753 |
+
type: 'update-section-items',
|
754 |
+
section_id: payload.section_id,
|
755 |
+
items: JSON.stringify(payload.items),
|
756 |
+
last_section: state.sections[state.sections.length - 1] === payload.section_id
|
757 |
+
}).then(function (response) {
|
758 |
+
var result = response.body;
|
759 |
+
|
760 |
+
if (result.success) {
|
761 |
+
// console.log(result);
|
762 |
+
}
|
763 |
+
}, function (error) {
|
764 |
+
console.error(error);
|
765 |
+
});
|
766 |
+
}
|
767 |
+
};
|
768 |
+
|
769 |
+
exports.default = CourseCurriculum;
|
770 |
+
|
771 |
+
/***/ }),
|
772 |
+
/* 36 */
|
773 |
+
/***/ (function(module, exports, __webpack_require__) {
|
774 |
+
|
775 |
+
"use strict";
|
776 |
+
|
777 |
+
|
778 |
+
Object.defineProperty(exports, "__esModule", {
|
779 |
+
value: true
|
780 |
+
});
|
781 |
+
var CourseCurriculum = {
|
782 |
+
'SORT_SECTION': function SORT_SECTION(state, orders) {
|
783 |
+
state.sections = state.sections.map(function (section) {
|
784 |
+
section.order = orders[section.id];
|
785 |
+
|
786 |
+
return section;
|
787 |
+
});
|
788 |
+
},
|
789 |
+
'SET_SECTIONS': function SET_SECTIONS(state, sections) {
|
790 |
+
state.sections = sections;
|
791 |
+
},
|
792 |
+
'ADD_NEW_SECTION': function ADD_NEW_SECTION(state, newSection) {
|
793 |
+
if (newSection.open === undefined) {
|
794 |
+
newSection.open = true;
|
795 |
+
}
|
796 |
+
var pos;
|
797 |
+
|
798 |
+
if (newSection.temp_id) {
|
799 |
+
state.sections.map(function (section, i) {
|
800 |
+
if (newSection.temp_id == section.id) {
|
801 |
+
pos = i;
|
802 |
+
return false;
|
803 |
+
}
|
804 |
+
});
|
805 |
+
}
|
806 |
+
|
807 |
+
if (pos !== undefined) {
|
808 |
+
$Vue.set(state.sections, pos, newSection);
|
809 |
+
} else {
|
810 |
+
state.sections.push(newSection);
|
811 |
+
}
|
812 |
+
},
|
813 |
+
'ADD_EMPTY_SECTION': function ADD_EMPTY_SECTION(state, section) {
|
814 |
+
section.open = true;
|
815 |
+
state.sections.push(section);
|
816 |
+
},
|
817 |
+
'REMOVE_SECTION': function REMOVE_SECTION(state, index) {
|
818 |
+
state.sections.splice(index, 1);
|
819 |
+
},
|
820 |
+
'REMOVE_SECTION_ITEM': function REMOVE_SECTION_ITEM(state, payload) {
|
821 |
+
|
822 |
+
var section = state.sections.find(function (section) {
|
823 |
+
return section.id === payload.section_id;
|
824 |
+
});
|
825 |
+
|
826 |
+
var items = section.items || [],
|
827 |
+
item = payload.item,
|
828 |
+
index = -1;
|
829 |
+
items.forEach(function (it, i) {
|
830 |
+
if (it.id === item.id) {
|
831 |
+
index = i;
|
832 |
+
}
|
833 |
+
});
|
834 |
+
|
835 |
+
if (index !== -1) {
|
836 |
+
if (item.temp_id) {
|
837 |
+
items[index].id = item.temp_id;
|
838 |
+
} else {
|
839 |
+
items.splice(index, 1);
|
840 |
+
}
|
841 |
+
}
|
842 |
+
},
|
843 |
+
'UPDATE_SECTION_ITEMS': function UPDATE_SECTION_ITEMS(state, payload) {
|
844 |
+
var section = state.sections.find(function (section) {
|
845 |
+
return parseInt(section.id) === parseInt(payload.section_id);
|
846 |
+
});
|
847 |
+
|
848 |
+
if (!section) {
|
849 |
+
return;
|
850 |
+
}
|
851 |
+
section.items = payload.items;
|
852 |
+
},
|
853 |
+
'UPDATE_SECTION_ITEM': function UPDATE_SECTION_ITEM(state, payload) {},
|
854 |
+
|
855 |
+
'CLOSE_SECTION': function CLOSE_SECTION(state, section) {
|
856 |
+
state.sections.forEach(function (_section, index) {
|
857 |
+
if (section.id === _section.id) {
|
858 |
+
state.sections[index].open = false;
|
859 |
+
}
|
860 |
+
});
|
861 |
+
},
|
862 |
+
|
863 |
+
'OPEN_SECTION': function OPEN_SECTION(state, section) {
|
864 |
+
state.sections.forEach(function (_section, index) {
|
865 |
+
if (section.id === _section.id) {
|
866 |
+
state.sections[index].open = true;
|
867 |
+
}
|
868 |
+
});
|
869 |
+
},
|
870 |
+
|
871 |
+
'OPEN_ALL_SECTIONS': function OPEN_ALL_SECTIONS(state) {
|
872 |
+
state.sections = state.sections.map(function (_section) {
|
873 |
+
_section.open = true;
|
874 |
+
|
875 |
+
return _section;
|
876 |
+
});
|
877 |
+
},
|
878 |
+
|
879 |
+
'CLOSE_ALL_SECTIONS': function CLOSE_ALL_SECTIONS(state) {
|
880 |
+
state.sections = state.sections.map(function (_section) {
|
881 |
+
_section.open = false;
|
882 |
+
|
883 |
+
return _section;
|
884 |
+
});
|
885 |
+
},
|
886 |
+
|
887 |
+
'UPDATE_SECTION_REQUEST': function UPDATE_SECTION_REQUEST(state, sectionId) {
|
888 |
+
$Vue.set(state.statusUpdateSection, sectionId, 'updating');
|
889 |
+
},
|
890 |
+
|
891 |
+
'UPDATE_SECTION_SUCCESS': function UPDATE_SECTION_SUCCESS(state, sectionId) {
|
892 |
+
$Vue.set(state.statusUpdateSection, sectionId, 'successful');
|
893 |
+
},
|
894 |
+
|
895 |
+
'UPDATE_SECTION_FAILURE': function UPDATE_SECTION_FAILURE(state, sectionId) {
|
896 |
+
$Vue.set(state.statusUpdateSection, sectionId, 'failed');
|
897 |
+
},
|
898 |
+
|
899 |
+
'UPDATE_SECTION_ITEM_REQUEST': function UPDATE_SECTION_ITEM_REQUEST(state, itemId) {
|
900 |
+
$Vue.set(state.statusUpdateSectionItem, itemId, 'updating');
|
901 |
+
},
|
902 |
+
|
903 |
+
'UPDATE_SECTION_ITEM_SUCCESS': function UPDATE_SECTION_ITEM_SUCCESS(state, itemId) {
|
904 |
+
$Vue.set(state.statusUpdateSectionItem, itemId, 'successful');
|
905 |
+
},
|
906 |
+
|
907 |
+
'UPDATE_SECTION_ITEM_FAILURE': function UPDATE_SECTION_ITEM_FAILURE(state, itemId) {
|
908 |
+
$Vue.set(state.statusUpdateSectionItem, itemId, 'failed');
|
909 |
+
},
|
910 |
+
'APPEND_EMPTY_ITEM_TO_SECTION': function APPEND_EMPTY_ITEM_TO_SECTION(state, data) {
|
911 |
+
|
912 |
+
var section = state.sections.find(function (section) {
|
913 |
+
return parseInt(section.id) === parseInt(data.section_id);
|
914 |
+
});
|
915 |
+
|
916 |
+
if (!section) {
|
917 |
+
return;
|
918 |
+
}
|
919 |
+
|
920 |
+
section.items.push({ id: data.item.id, title: data.item.title, type: 'empty-item' });
|
921 |
+
},
|
922 |
+
'UPDATE_ITEM_SECTION_BY_ID': function UPDATE_ITEM_SECTION_BY_ID(state, data) {
|
923 |
+
var section = state.sections.find(function (section) {
|
924 |
+
return parseInt(section.id) === parseInt(data.section_id);
|
925 |
+
});
|
926 |
+
|
927 |
+
if (!section) {
|
928 |
+
return;
|
929 |
+
}
|
930 |
+
|
931 |
+
for (var i = 0; i < section.items.length; i++) {
|
932 |
+
try {
|
933 |
+
if (!section.items[i]) {
|
934 |
+
continue;
|
935 |
+
}
|
936 |
+
|
937 |
+
var item_id = section.items[i].id;
|
938 |
+
if (item_id) {
|
939 |
+
if (data.items[item_id]) {
|
940 |
+
$Vue.set(section.items, i, data.items[item_id]);
|
941 |
+
}
|
942 |
+
}
|
943 |
+
} catch (ex) {
|
944 |
+
console.log(ex);
|
945 |
+
}
|
946 |
+
}
|
947 |
+
|
948 |
+
//section.items.push({id: data.item.id, title: data.item.title, type: 'empty-item'});
|
949 |
+
}
|
950 |
+
};
|
951 |
+
|
952 |
+
exports.default = CourseCurriculum;
|
953 |
+
|
954 |
+
/***/ }),
|
955 |
+
/* 37 */
|
956 |
+
/***/ (function(module, exports, __webpack_require__) {
|
957 |
+
|
958 |
+
"use strict";
|
959 |
+
|
960 |
+
|
961 |
+
Object.defineProperty(exports, "__esModule", {
|
962 |
+
value: true
|
963 |
+
});
|
964 |
+
var CourseCurriculum = {
|
965 |
+
sections: function sections(state) {
|
966 |
+
return state.sections || [];
|
967 |
+
},
|
968 |
+
urlEdit: function urlEdit(state) {
|
969 |
+
return state.urlEdit;
|
970 |
+
},
|
971 |
+
hiddenSections: function hiddenSections(state) {
|
972 |
+
return state.sections.filter(function (section) {
|
973 |
+
return !section.open;
|
974 |
+
}).map(function (section) {
|
975 |
+
return parseInt(section.id);
|
976 |
+
});
|
977 |
+
},
|
978 |
+
isHiddenAllSections: function isHiddenAllSections(state, getters) {
|
979 |
+
var sections = getters['sections'];
|
980 |
+
var hiddenSections = getters['hiddenSections'];
|
981 |
+
|
982 |
+
return hiddenSections.length === sections.length;
|
983 |
+
},
|
984 |
+
statusUpdateSection: function statusUpdateSection(state) {
|
985 |
+
return state.statusUpdateSection;
|
986 |
+
},
|
987 |
+
statusUpdateSectionItem: function statusUpdateSectionItem(state) {
|
988 |
+
return state.statusUpdateSectionItem;
|
989 |
+
}
|
990 |
+
};
|
991 |
+
|
992 |
+
exports.default = CourseCurriculum;
|
993 |
+
|
994 |
+
/***/ }),
|
995 |
+
/* 38 */
|
996 |
+
/***/ (function(module, exports, __webpack_require__) {
|
997 |
+
|
998 |
+
"use strict";
|
999 |
+
|
1000 |
+
|
1001 |
+
Object.defineProperty(exports, "__esModule", {
|
1002 |
+
value: true
|
1003 |
+
});
|
1004 |
+
var Course = {
|
1005 |
+
heartbeat: function heartbeat(state) {
|
1006 |
+
return state.heartbeat;
|
1007 |
+
},
|
1008 |
+
action: function action(state) {
|
1009 |
+
return state.action;
|
1010 |
+
},
|
1011 |
+
id: function id(state) {
|
1012 |
+
return state.course_id;
|
1013 |
+
},
|
1014 |
+
autoDraft: function autoDraft(state) {
|
1015 |
+
return state.auto_draft;
|
1016 |
+
},
|
1017 |
+
disable_curriculum: function disable_curriculum(state) {
|
1018 |
+
return state.disable_curriculum;
|
1019 |
+
},
|
1020 |
+
status: function status(state) {
|
1021 |
+
return state.status || 'error';
|
1022 |
+
},
|
1023 |
+
currentRequest: function currentRequest(state) {
|
1024 |
+
return state.countCurrentRequest || 0;
|
1025 |
+
},
|
1026 |
+
urlAjax: function urlAjax(state) {
|
1027 |
+
return state.ajax;
|
1028 |
+
},
|
1029 |
+
nonce: function nonce(state) {
|
1030 |
+
return state.nonce;
|
1031 |
+
}
|
1032 |
+
};
|
1033 |
+
|
1034 |
+
exports.default = Course;
|
1035 |
+
|
1036 |
+
/***/ }),
|
1037 |
+
/* 39 */
|
1038 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1039 |
+
|
1040 |
+
"use strict";
|
1041 |
+
|
1042 |
+
|
1043 |
+
Object.defineProperty(exports, "__esModule", {
|
1044 |
+
value: true
|
1045 |
+
});
|
1046 |
+
var Course = {
|
1047 |
+
|
1048 |
+
'UPDATE_HEART_BEAT': function UPDATE_HEART_BEAT(state, status) {
|
1049 |
+
state.heartbeat = !!status;
|
1050 |
+
},
|
1051 |
+
|
1052 |
+
'UPDATE_AUTO_DRAFT_STATUS': function UPDATE_AUTO_DRAFT_STATUS(state, status) {
|
1053 |
+
// check auto draft status
|
1054 |
+
state.auto_draft = status;
|
1055 |
+
},
|
1056 |
+
|
1057 |
+
'UPDATE_STATUS': function UPDATE_STATUS(state, status) {
|
1058 |
+
state.status = status;
|
1059 |
+
},
|
1060 |
+
|
1061 |
+
'INCREASE_NUMBER_REQUEST': function INCREASE_NUMBER_REQUEST(state) {
|
1062 |
+
state.countCurrentRequest++;
|
1063 |
+
},
|
1064 |
+
|
1065 |
+
'DECREASE_NUMBER_REQUEST': function DECREASE_NUMBER_REQUEST(state) {
|
1066 |
+
state.countCurrentRequest--;
|
1067 |
+
}
|
1068 |
+
};
|
1069 |
+
|
1070 |
+
exports.default = Course;
|
1071 |
+
|
1072 |
+
/***/ }),
|
1073 |
+
/* 40 */
|
1074 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1075 |
+
|
1076 |
+
"use strict";
|
1077 |
+
|
1078 |
+
|
1079 |
+
Object.defineProperty(exports, "__esModule", {
|
1080 |
+
value: true
|
1081 |
+
});
|
1082 |
+
var Course = {
|
1083 |
+
heartbeat: function heartbeat(context) {
|
1084 |
+
LP.Request({
|
1085 |
+
type: 'heartbeat'
|
1086 |
+
}).then(function (response) {
|
1087 |
+
var result = response.body;
|
1088 |
+
context.commit('UPDATE_HEART_BEAT', !!result.success);
|
1089 |
+
}, function (error) {
|
1090 |
+
context.commit('UPDATE_HEART_BEAT', false);
|
1091 |
+
});
|
1092 |
+
},
|
1093 |
+
|
1094 |
+
draftCourse: function draftCourse(context, payload) {
|
1095 |
+
var auto_draft = context.getters['autoDraft'];
|
1096 |
+
|
1097 |
+
if (auto_draft) {
|
1098 |
+
LP.Request({
|
1099 |
+
type: 'draft-course',
|
1100 |
+
course: JSON.stringify(payload)
|
1101 |
+
}).then(function (response) {
|
1102 |
+
var result = response.body;
|
1103 |
+
|
1104 |
+
if (!result.success) {
|
1105 |
+
return;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
|
1109 |
+
});
|
1110 |
+
}
|
1111 |
+
},
|
1112 |
+
|
1113 |
+
newRequest: function newRequest(context) {
|
1114 |
+
context.commit('INCREASE_NUMBER_REQUEST');
|
1115 |
+
context.commit('UPDATE_STATUS', 'loading');
|
1116 |
+
|
1117 |
+
window.onbeforeunload = function () {
|
1118 |
+
return '';
|
1119 |
+
};
|
1120 |
+
},
|
1121 |
+
|
1122 |
+
requestCompleted: function requestCompleted(context, status) {
|
1123 |
+
context.commit('DECREASE_NUMBER_REQUEST');
|
1124 |
+
|
1125 |
+
if (context.getters.currentRequest === 0) {
|
1126 |
+
context.commit('UPDATE_STATUS', status);
|
1127 |
+
window.onbeforeunload = null;
|
1128 |
+
}
|
1129 |
+
}
|
1130 |
+
};
|
1131 |
+
|
1132 |
+
exports.default = Course;
|
1133 |
+
|
1134 |
+
/***/ })
|
1135 |
+
/******/ ]);
|
1136 |
+
//# sourceMappingURL=course.js.map
|
assets/js/admin/editor/course.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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=28)}([,,,,,,,,function(t,e,n){"use strict";function i(t){var e=window.jQuery,n=Vue.http;t=e.extend({ns:"LPRequest",store:!1},t||{});var i=null;LP.Request=function(o){return i=e("#publishing-action"),o.id=t.store.getters.id,o.nonce=t.store.getters.nonce,o["lp-ajax"]=t.store.getters.action,o.code=t.store.getters.code,i.find("#publish").addClass("disabled"),i.find(".spinner").addClass("is-active"),i.addClass("code-"+o.code),n.post(t.store.getters.urlAjax,o,{emulateJSON:!0,params:{namespace:t.ns,code:o.code}})},n.interceptors.push(function(e,n){if(e.params.namespace!==t.ns)return void n();t.store.dispatch("newRequest"),n(function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success?t.store.dispatch("requestCompleted","successful"):t.store.dispatch("requestCompleted","failed"),i.removeClass("code-"+e.params.code),i.attr("class")||(i.find("#publish").removeClass("disabled"),i.find(".spinner").removeClass("is-active"))})})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=window.jQuery,o=function(t){return{namespaced:!0,state:i.extend({},t),getters:{all:function(t){return t}}}};e.default=o},,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var o=n(8),s=i(o),u=n(29),c=i(u);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,(0,window.jQuery)(document).ready(function(){window.LP_Curriculum_Store=new $Vuex.Store((0,c.default)(lpAdminCourseEditorSettings)),(0,s.default)({ns:"LPCurriculumRequest",store:LP_Curriculum_Store}),setTimeout(function(){window.LP_Course_Editor=new $Vue({el:"#admin-editor-lp_course",template:"<lp-course-editor></lp-course-editor>"})},100)})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(30),s=i(o),u=n(34),c=i(u),r=n(12),d=i(r),a=n(38),f=i(a),_=n(39),E=i(_),m=n(40),S=i(m),l=window.jQuery,T=function(t){var e=l.extend({},t.root);return e.status="success",e.heartbeat=!0,e.countCurrentRequest=0,{state:e,getters:f.default,mutations:E.default,actions:S.default,modules:{ci:(0,s.default)(t),i18n:(0,d.default)(t.i18n),ss:(0,c.default)(t)}}};e.default=T},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=a.extend({},t.chooseItems);return e.sectionId=!1,e.pagination="",e.status="",{namespaced:!0,state:e,getters:s.default,mutations:c.default,actions:d.default}};var o=n(31),s=i(o),u=n(32),c=i(u),r=n(33),d=i(r),a=jQuery},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={status:function(t){return t.status},pagination:function(t){return t.pagination},items:function(t,e){return t.items.map(function(t){var n=e.addedItems.find(function(e){return t.id===e.id});return t.added=!!n,t})},addedItems:function(t){return t.addedItems},isOpen:function(t){return t.open},types:function(t){return t.types},section:function(){return state.sectionId}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={TOGGLE:function(t){t.open=!t.open},SET_SECTION:function(t,e){t.sectionId=e},SET_LIST_ITEMS:function(t,e){t.items=e},ADD_ITEM:function(t,e){t.addedItems.push(e)},REMOVE_ADDED_ITEM:function(t,e){t.addedItems.forEach(function(n,i){n.id===e.id&&t.addedItems.splice(i,1)})},RESET:function(t){t.addedItems=[],t.items=[]},UPDATE_PAGINATION:function(t,e){t.pagination=e},SEARCH_ITEMS_REQUEST:function(t){t.status="loading"},SEARCH_ITEMS_SUCCESS:function(t){t.status="successful"},SEARCH_ITEMS_FAILURE:function(t){t.status="failed"}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={toggle:function(t){t.commit("TOGGLE")},open:function(t,e){t.commit("SET_SECTION",e),t.commit("RESET"),t.commit("TOGGLE")},searchItems:function(t,e){t.commit("SEARCH_ITEMS_REQUEST"),LP.Request({type:"search-items",query:e.query,item_type:e.type,page:e.page,exclude:JSON.stringify([])}).then(function(e){var n=e.body;if(n.success){var i=n.data;t.commit("SET_LIST_ITEMS",i.items),t.commit("UPDATE_PAGINATION",i.pagination),t.commit("SEARCH_ITEMS_SUCCESS")}},function(e){t.commit("SEARCH_ITEMS_FAILURE"),console.error(e)})},addItem:function(t,e){t.commit("ADD_ITEM",e)},removeItem:function(t,e){t.commit("REMOVE_ADDED_ITEM",e)},addItemsToSection:function(t){var e=t.getters.addedItems;e.length>0&&LP.Request({type:"add-items-to-section",section_id:t.getters.section,items:JSON.stringify(e)}).then(function(e){var n=e.body;if(n.success){t.commit("TOGGLE");var i=n.data;t.commit("ss/UPDATE_SECTION_ITEMS",{section_id:t.getters.section,items:i},{root:!0})}},function(t){console.error(t)})}};e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=a.extend({},t.sections);return e.statusUpdateSection={},e.statusUpdateSectionItem={},e.sections=e.sections.map(function(t){var n=e.hidden_sections,i=n.find(function(e){return parseInt(t.id)===parseInt(e)});return t.open=!i,t}),{namespaced:!0,state:e,getters:d.default,mutations:c.default,actions:s.default}};var o=n(35),s=i(o),u=n(36),c=i(u),r=n(37),d=i(r),a=jQuery},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={toggleAllSections:function(t){t.getters.isHiddenAllSections?t.commit("OPEN_ALL_SECTIONS"):t.commit("CLOSE_ALL_SECTIONS"),LP.Request({type:"hidden-sections",hidden:t.getters.hiddenSections})},updateSectionsOrder:function(t,e){LP.Request({type:"sort-sections",order:JSON.stringify(e)}).then(function(e){var n=e.body,i=n.data;t.commit("SORT_SECTION",i)},function(t){console.error(t)})},toggleSection:function(t,e){e.open?t.commit("CLOSE_SECTION",e):t.commit("OPEN_SECTION",e),LP.Request({type:"hidden-sections",hidden:t.getters.hiddenSections})},updateSection:function(t,e){t.commit("UPDATE_SECTION_REQUEST",e.id),LP.Request({type:"update-section",section:JSON.stringify(e)}).then(function(){t.commit("UPDATE_SECTION_SUCCESS",e.id)}).catch(function(){t.commit("UPDATE_SECTION_FAILURE",e.id)})},removeSection:function(t,e){t.commit("REMOVE_SECTION",e.index),LP.Request({type:"remove-section",section_id:e.section.id}).then(function(t){t.body},function(t){console.error(t)})},newSection:function(t,e){var n={type:"new-section",section_name:e,temp_id:LP.uniqueId()};t.commit("ADD_NEW_SECTION",{id:n.temp_id,items:[],open:!1,title:n.section_name}),LP.Request(n).then(function(e){var n=e.body;if(n.success){var i=$.extend({},n.data,{open:!0});t.commit("ADD_NEW_SECTION",i)}},function(t){console.error(t)})},updateSectionItem:function(t,e){t.commit("UPDATE_SECTION_ITEM_REQUEST",e.item.id),LP.Request({type:"update-section-item",section_id:e.section_id,item:JSON.stringify(e.item)}).then(function(n){t.commit("UPDATE_SECTION_ITEM_SUCCESS",e.item.id);var i=n.body;if(i.success){var o=i.data;t.commit("UPDATE_SECTION_ITEM",{section_id:e.section_id,item:o})}},function(n){t.commit("UPDATE_SECTION_ITEM_FAILURE",e.item.id),console.error(n)})},removeSectionItem:function(t,e){var n=e.item.id;t.commit("REMOVE_SECTION_ITEM",e),e.item.temp_id=0,LP.Request({type:"remove-section-item",section_id:e.section_id,item_id:n}).then(function(){t.commit("REMOVE_SECTION_ITEM",e)})},deleteSectionItem:function(t,e){var n=e.item.id;t.commit("REMOVE_SECTION_ITEM",e),e.item.temp_id=0,LP.Request({type:"delete-section-item",section_id:e.section_id,item_id:n}).then(function(){t.commit("REMOVE_SECTION_ITEM",e)})},newSectionItem:function(t,e){t.commit("APPEND_EMPTY_ITEM_TO_SECTION",e),LP.Request({type:"new-section-item",section_id:e.section_id,item:JSON.stringify(e.item)}).then(function(n){var i=n.body;if(i.success){var o={};$.each(i.data,function(t,e){o[e.old_id?e.old_id:e.id]=e}),t.commit("UPDATE_ITEM_SECTION_BY_ID",{section_id:e.section_id,items:o})}},function(t){console.error(t)})},updateSectionItems:function(t,e){LP.Request({type:"update-section-items",section_id:e.section_id,items:JSON.stringify(e.items),last_section:state.sections[state.sections.length-1]===e.section_id}).then(function(t){t.body.success},function(t){console.error(t)})}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={SORT_SECTION:function(t,e){t.sections=t.sections.map(function(t){return t.order=e[t.id],t})},SET_SECTIONS:function(t,e){t.sections=e},ADD_NEW_SECTION:function(t,e){void 0===e.open&&(e.open=!0);var n;e.temp_id&&t.sections.map(function(t,i){if(e.temp_id==t.id)return n=i,!1}),void 0!==n?$Vue.set(t.sections,n,e):t.sections.push(e)},ADD_EMPTY_SECTION:function(t,e){e.open=!0,t.sections.push(e)},REMOVE_SECTION:function(t,e){t.sections.splice(e,1)},REMOVE_SECTION_ITEM:function(t,e){var n=t.sections.find(function(t){return t.id===e.section_id}),i=n.items||[],o=e.item,s=-1;i.forEach(function(t,e){t.id===o.id&&(s=e)}),-1!==s&&(o.temp_id?i[s].id=o.temp_id:i.splice(s,1))},UPDATE_SECTION_ITEMS:function(t,e){var n=t.sections.find(function(t){return parseInt(t.id)===parseInt(e.section_id)});n&&(n.items=e.items)},UPDATE_SECTION_ITEM:function(t,e){},CLOSE_SECTION:function(t,e){t.sections.forEach(function(n,i){e.id===n.id&&(t.sections[i].open=!1)})},OPEN_SECTION:function(t,e){t.sections.forEach(function(n,i){e.id===n.id&&(t.sections[i].open=!0)})},OPEN_ALL_SECTIONS:function(t){t.sections=t.sections.map(function(t){return t.open=!0,t})},CLOSE_ALL_SECTIONS:function(t){t.sections=t.sections.map(function(t){return t.open=!1,t})},UPDATE_SECTION_REQUEST:function(t,e){$Vue.set(t.statusUpdateSection,e,"updating")},UPDATE_SECTION_SUCCESS:function(t,e){$Vue.set(t.statusUpdateSection,e,"successful")},UPDATE_SECTION_FAILURE:function(t,e){$Vue.set(t.statusUpdateSection,e,"failed")},UPDATE_SECTION_ITEM_REQUEST:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"updating")},UPDATE_SECTION_ITEM_SUCCESS:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"successful")},UPDATE_SECTION_ITEM_FAILURE:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"failed")},APPEND_EMPTY_ITEM_TO_SECTION:function(t,e){var n=t.sections.find(function(t){return parseInt(t.id)===parseInt(e.section_id)});n&&n.items.push({id:e.item.id,title:e.item.title,type:"empty-item"})},UPDATE_ITEM_SECTION_BY_ID:function(t,e){var n=t.sections.find(function(t){return parseInt(t.id)===parseInt(e.section_id)});if(n)for(var i=0;i<n.items.length;i++)try{if(!n.items[i])continue;var o=n.items[i].id;o&&e.items[o]&&$Vue.set(n.items,i,e.items[o])}catch(t){console.log(t)}}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={sections:function(t){return t.sections||[]},urlEdit:function(t){return t.urlEdit},hiddenSections:function(t){return t.sections.filter(function(t){return!t.open}).map(function(t){return parseInt(t.id)})},isHiddenAllSections:function(t,e){var n=e.sections;return e.hiddenSections.length===n.length},statusUpdateSection:function(t){return t.statusUpdateSection},statusUpdateSectionItem:function(t){return t.statusUpdateSectionItem}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={heartbeat:function(t){return t.heartbeat},action:function(t){return t.action},id:function(t){return t.course_id},autoDraft:function(t){return t.auto_draft},disable_curriculum:function(t){return t.disable_curriculum},status:function(t){return t.status||"error"},currentRequest:function(t){return t.countCurrentRequest||0},urlAjax:function(t){return t.ajax},nonce:function(t){return t.nonce}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={UPDATE_HEART_BEAT:function(t,e){t.heartbeat=!!e},UPDATE_AUTO_DRAFT_STATUS:function(t,e){t.auto_draft=e},UPDATE_STATUS:function(t,e){t.status=e},INCREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest--}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={heartbeat:function(t){LP.Request({type:"heartbeat"}).then(function(e){var n=e.body;t.commit("UPDATE_HEART_BEAT",!!n.success)},function(e){t.commit("UPDATE_HEART_BEAT",!1)})},draftCourse:function(t,e){t.getters.autoDraft&&LP.Request({type:"draft-course",course:JSON.stringify(e)}).then(function(e){e.body.success&&t.commit("UPDATE_AUTO_DRAFT_STATUS",!1)})},newRequest:function(t){t.commit("INCREASE_NUMBER_REQUEST"),t.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(t,e){t.commit("DECREASE_NUMBER_REQUEST"),0===t.getters.currentRequest&&(t.commit("UPDATE_STATUS",e),window.onbeforeunload=null)}};e.default=i}]);
|
assets/js/admin/editor/question.js
ADDED
@@ -0,0 +1,469 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 54);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 54:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
var _http = __webpack_require__(8);
|
75 |
+
|
76 |
+
var _http2 = _interopRequireDefault(_http);
|
77 |
+
|
78 |
+
var _question = __webpack_require__(55);
|
79 |
+
|
80 |
+
var _question2 = _interopRequireDefault(_question);
|
81 |
+
|
82 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
83 |
+
|
84 |
+
window.$Vue = window.$Vue || Vue;
|
85 |
+
window.$Vuex = window.$Vuex || Vuex;
|
86 |
+
|
87 |
+
var $ = window.jQuery;
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Init app.
|
91 |
+
*
|
92 |
+
* @since 3.0.0
|
93 |
+
*/
|
94 |
+
$(document).ready(function () {
|
95 |
+
window.LP_Question_Store = new $Vuex.Store((0, _question2.default)(lp_question_editor));
|
96 |
+
|
97 |
+
(0, _http2.default)({ ns: 'LPQuestionEditorRequest', store: LP_Question_Store });
|
98 |
+
|
99 |
+
setTimeout(function () {
|
100 |
+
window.LP_Question_Editor = new $Vue({
|
101 |
+
el: '#admin-editor-lp_question',
|
102 |
+
template: '<lp-question-editor></lp-question-editor>'
|
103 |
+
});
|
104 |
+
}, 100);
|
105 |
+
});
|
106 |
+
|
107 |
+
/***/ }),
|
108 |
+
|
109 |
+
/***/ 55:
|
110 |
+
/***/ (function(module, exports, __webpack_require__) {
|
111 |
+
|
112 |
+
"use strict";
|
113 |
+
|
114 |
+
|
115 |
+
Object.defineProperty(exports, "__esModule", {
|
116 |
+
value: true
|
117 |
+
});
|
118 |
+
|
119 |
+
var _question = __webpack_require__(56);
|
120 |
+
|
121 |
+
var _question2 = _interopRequireDefault(_question);
|
122 |
+
|
123 |
+
var _question3 = __webpack_require__(57);
|
124 |
+
|
125 |
+
var _question4 = _interopRequireDefault(_question3);
|
126 |
+
|
127 |
+
var _question5 = __webpack_require__(58);
|
128 |
+
|
129 |
+
var _question6 = _interopRequireDefault(_question5);
|
130 |
+
|
131 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
132 |
+
|
133 |
+
var $ = window.jQuery;
|
134 |
+
var Question = function Question(data) {
|
135 |
+
var state = $.extend({
|
136 |
+
status: 'successful',
|
137 |
+
countCurrentRequest: 0,
|
138 |
+
i18n: $.extend({}, data.i18n)
|
139 |
+
}, data.root);
|
140 |
+
|
141 |
+
return {
|
142 |
+
state: state,
|
143 |
+
getters: _question2.default,
|
144 |
+
mutations: _question4.default,
|
145 |
+
actions: _question6.default
|
146 |
+
};
|
147 |
+
};
|
148 |
+
|
149 |
+
exports.default = Question;
|
150 |
+
|
151 |
+
/***/ }),
|
152 |
+
|
153 |
+
/***/ 56:
|
154 |
+
/***/ (function(module, exports, __webpack_require__) {
|
155 |
+
|
156 |
+
"use strict";
|
157 |
+
|
158 |
+
|
159 |
+
Object.defineProperty(exports, "__esModule", {
|
160 |
+
value: true
|
161 |
+
});
|
162 |
+
var Question = {
|
163 |
+
id: function id(state) {
|
164 |
+
return state.id;
|
165 |
+
},
|
166 |
+
type: function type(state) {
|
167 |
+
return state.type;
|
168 |
+
},
|
169 |
+
code: function code(state) {
|
170 |
+
return Date.now();
|
171 |
+
},
|
172 |
+
|
173 |
+
autoDraft: function autoDraft(state) {
|
174 |
+
return state.auto_draft;
|
175 |
+
},
|
176 |
+
answers: function answers(state) {
|
177 |
+
return Object.values(state.answers) || [];
|
178 |
+
},
|
179 |
+
settings: function settings(state) {
|
180 |
+
return state.setting;
|
181 |
+
},
|
182 |
+
types: function types(state) {
|
183 |
+
return state.questionTypes || [];
|
184 |
+
},
|
185 |
+
numberCorrect: function numberCorrect(state) {
|
186 |
+
var correct = 0;
|
187 |
+
Object.keys(state.answers).forEach(function (key) {
|
188 |
+
if (state.answers[key].is_true === 'yes') {
|
189 |
+
correct += 1;
|
190 |
+
}
|
191 |
+
});
|
192 |
+
return correct;
|
193 |
+
},
|
194 |
+
status: function status(state) {
|
195 |
+
return state.status;
|
196 |
+
},
|
197 |
+
currentRequest: function currentRequest(state) {
|
198 |
+
return state.countCurrentRequest || 0;
|
199 |
+
},
|
200 |
+
action: function action(state) {
|
201 |
+
return state.action;
|
202 |
+
},
|
203 |
+
nonce: function nonce(state) {
|
204 |
+
return state.nonce;
|
205 |
+
},
|
206 |
+
externalComponent: function externalComponent(state) {
|
207 |
+
return state.externalComponent || [];
|
208 |
+
},
|
209 |
+
state: function state(_state) {
|
210 |
+
return _state;
|
211 |
+
},
|
212 |
+
i18n: function i18n(state) {
|
213 |
+
return state.i18n;
|
214 |
+
}
|
215 |
+
};
|
216 |
+
|
217 |
+
exports.default = Question;
|
218 |
+
|
219 |
+
/***/ }),
|
220 |
+
|
221 |
+
/***/ 57:
|
222 |
+
/***/ (function(module, exports, __webpack_require__) {
|
223 |
+
|
224 |
+
"use strict";
|
225 |
+
|
226 |
+
|
227 |
+
Object.defineProperty(exports, "__esModule", {
|
228 |
+
value: true
|
229 |
+
});
|
230 |
+
var Question = {
|
231 |
+
|
232 |
+
'UPDATE_STATUS': function UPDATE_STATUS(state, status) {
|
233 |
+
state.status = status;
|
234 |
+
},
|
235 |
+
|
236 |
+
'UPDATE_AUTO_DRAFT_STATUS': function UPDATE_AUTO_DRAFT_STATUS(state, status) {
|
237 |
+
state.auto_draft = status;
|
238 |
+
},
|
239 |
+
|
240 |
+
'CHANGE_QUESTION_TYPE': function CHANGE_QUESTION_TYPE(state, question) {
|
241 |
+
state.answers = question.answers;
|
242 |
+
state.type = question.type;
|
243 |
+
},
|
244 |
+
|
245 |
+
'SET_ANSWERS': function SET_ANSWERS(state, answers) {
|
246 |
+
state.answers = answers;
|
247 |
+
},
|
248 |
+
|
249 |
+
'DELETE_ANSWER': function DELETE_ANSWER(state, id) {
|
250 |
+
for (var i = 0, n = state.answers.length; i < n; i++) {
|
251 |
+
if (state.answers[i].question_answer_id == id) {
|
252 |
+
state.answers[i].question_answer_id = LP.uniqueId();
|
253 |
+
break;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
},
|
257 |
+
'ADD_NEW_ANSWER': function ADD_NEW_ANSWER(state, answer) {
|
258 |
+
state.answers.push(answer);
|
259 |
+
},
|
260 |
+
'UPDATE_ANSWERS': function UPDATE_ANSWERS(state, answers) {
|
261 |
+
state.answers = answers;
|
262 |
+
},
|
263 |
+
|
264 |
+
'INCREASE_NUMBER_REQUEST': function INCREASE_NUMBER_REQUEST(state) {
|
265 |
+
state.countCurrentRequest++;
|
266 |
+
},
|
267 |
+
|
268 |
+
'DECREASE_NUMBER_REQUEST': function DECREASE_NUMBER_REQUEST(state) {
|
269 |
+
state.countCurrentRequest--;
|
270 |
+
}
|
271 |
+
};
|
272 |
+
|
273 |
+
exports.default = Question;
|
274 |
+
|
275 |
+
/***/ }),
|
276 |
+
|
277 |
+
/***/ 58:
|
278 |
+
/***/ (function(module, exports, __webpack_require__) {
|
279 |
+
|
280 |
+
"use strict";
|
281 |
+
|
282 |
+
|
283 |
+
Object.defineProperty(exports, "__esModule", {
|
284 |
+
value: true
|
285 |
+
});
|
286 |
+
var Question = {
|
287 |
+
|
288 |
+
changeQuestionType: function changeQuestionType(context, payload) {
|
289 |
+
LP.Request({
|
290 |
+
type: 'change-question-type',
|
291 |
+
question_type: payload.type,
|
292 |
+
draft_question: context.getters.autoDraft ? JSON.stringify(payload.question) : ''
|
293 |
+
}).then(function (response) {
|
294 |
+
var result = response.body;
|
295 |
+
|
296 |
+
if (result.success) {
|
297 |
+
context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
|
298 |
+
context.commit('CHANGE_QUESTION_TYPE', result.data);
|
299 |
+
}
|
300 |
+
});
|
301 |
+
},
|
302 |
+
|
303 |
+
updateAnswersOrder: function updateAnswersOrder(context, order) {
|
304 |
+
LP.Request({
|
305 |
+
type: 'sort-answer',
|
306 |
+
order: order
|
307 |
+
}).then(function (response) {
|
308 |
+
var result = response.body;
|
309 |
+
if (result.success) {
|
310 |
+
// context.commit('SET_ANSWERS', result.data);
|
311 |
+
}
|
312 |
+
});
|
313 |
+
},
|
314 |
+
|
315 |
+
updateAnswerTitle: function updateAnswerTitle(context, answer) {
|
316 |
+
if (typeof answer.question_answer_id == 'undefined') {
|
317 |
+
return;
|
318 |
+
}
|
319 |
+
answer = JSON.stringify(answer);
|
320 |
+
LP.Request({
|
321 |
+
type: 'update-answer-title',
|
322 |
+
answer: answer
|
323 |
+
});
|
324 |
+
},
|
325 |
+
|
326 |
+
updateCorrectAnswer: function updateCorrectAnswer(context, correct) {
|
327 |
+
LP.Request({
|
328 |
+
type: 'change-correct',
|
329 |
+
correct: JSON.stringify(correct)
|
330 |
+
}).then(function (response) {
|
331 |
+
var result = response.body;
|
332 |
+
if (result.success) {
|
333 |
+
context.commit('UPDATE_ANSWERS', result.data);
|
334 |
+
context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
|
335 |
+
}
|
336 |
+
});
|
337 |
+
},
|
338 |
+
|
339 |
+
deleteAnswer: function deleteAnswer(context, payload) {
|
340 |
+
|
341 |
+
context.commit('DELETE_ANSWER', payload.id);
|
342 |
+
LP.Request({
|
343 |
+
type: 'delete-answer',
|
344 |
+
answer_id: payload.id
|
345 |
+
}).then(function (response) {
|
346 |
+
var result = response.body;
|
347 |
+
|
348 |
+
if (result.success) {
|
349 |
+
context.commit('SET_ANSWERS', result.data);
|
350 |
+
} else {
|
351 |
+
// notice error
|
352 |
+
}
|
353 |
+
});
|
354 |
+
},
|
355 |
+
|
356 |
+
newAnswer: function newAnswer(context, data) {
|
357 |
+
context.commit('ADD_NEW_ANSWER', data.answer);
|
358 |
+
LP.Request({
|
359 |
+
type: 'new-answer'
|
360 |
+
}).then(function (response) {
|
361 |
+
var result = response.body;
|
362 |
+
|
363 |
+
if (result.success) {
|
364 |
+
context.commit('UPDATE_ANSWERS', result.data);
|
365 |
+
} else {
|
366 |
+
// notice error
|
367 |
+
}
|
368 |
+
});
|
369 |
+
},
|
370 |
+
|
371 |
+
newRequest: function newRequest(context) {
|
372 |
+
context.commit('INCREASE_NUMBER_REQUEST');
|
373 |
+
context.commit('UPDATE_STATUS', 'loading');
|
374 |
+
|
375 |
+
window.onbeforeunload = function () {
|
376 |
+
return '';
|
377 |
+
};
|
378 |
+
},
|
379 |
+
|
380 |
+
requestCompleted: function requestCompleted(context, status) {
|
381 |
+
context.commit('DECREASE_NUMBER_REQUEST');
|
382 |
+
|
383 |
+
if (context.getters.currentRequest === 0) {
|
384 |
+
context.commit('UPDATE_STATUS', status);
|
385 |
+
window.onbeforeunload = null;
|
386 |
+
}
|
387 |
+
}
|
388 |
+
};
|
389 |
+
|
390 |
+
exports.default = Question;
|
391 |
+
|
392 |
+
/***/ }),
|
393 |
+
|
394 |
+
/***/ 8:
|
395 |
+
/***/ (function(module, exports, __webpack_require__) {
|
396 |
+
|
397 |
+
"use strict";
|
398 |
+
|
399 |
+
|
400 |
+
Object.defineProperty(exports, "__esModule", {
|
401 |
+
value: true
|
402 |
+
});
|
403 |
+
exports.default = HTTP;
|
404 |
+
function HTTP(options) {
|
405 |
+
var $ = window.jQuery;
|
406 |
+
var $VueHTTP = Vue.http;
|
407 |
+
|
408 |
+
options = $.extend({
|
409 |
+
ns: 'LPRequest',
|
410 |
+
store: false
|
411 |
+
}, options || {});
|
412 |
+
|
413 |
+
var $publishingAction = null;
|
414 |
+
|
415 |
+
LP.Request = function (payload) {
|
416 |
+
$publishingAction = $('#publishing-action');
|
417 |
+
|
418 |
+
payload['id'] = options.store.getters.id;
|
419 |
+
payload['nonce'] = options.store.getters.nonce;
|
420 |
+
payload['lp-ajax'] = options.store.getters.action;
|
421 |
+
payload['code'] = options.store.getters.code;
|
422 |
+
|
423 |
+
$publishingAction.find('#publish').addClass('disabled');
|
424 |
+
$publishingAction.find('.spinner').addClass('is-active');
|
425 |
+
$publishingAction.addClass('code-' + payload['code']);
|
426 |
+
|
427 |
+
return $VueHTTP.post(options.store.getters.urlAjax, payload, {
|
428 |
+
emulateJSON: true,
|
429 |
+
params: {
|
430 |
+
namespace: options.ns,
|
431 |
+
code: payload['code']
|
432 |
+
}
|
433 |
+
});
|
434 |
+
};
|
435 |
+
|
436 |
+
$VueHTTP.interceptors.push(function (request, next) {
|
437 |
+
if (request.params['namespace'] !== options.ns) {
|
438 |
+
next();
|
439 |
+
return;
|
440 |
+
}
|
441 |
+
|
442 |
+
options.store.dispatch('newRequest');
|
443 |
+
|
444 |
+
next(function (response) {
|
445 |
+
if (!jQuery.isPlainObject(response.body)) {
|
446 |
+
response.body = LP.parseJSON(response.body);
|
447 |
+
}
|
448 |
+
|
449 |
+
var body = response.body;
|
450 |
+
var result = body.success || false;
|
451 |
+
|
452 |
+
if (result) {
|
453 |
+
options.store.dispatch('requestCompleted', 'successful');
|
454 |
+
} else {
|
455 |
+
options.store.dispatch('requestCompleted', 'failed');
|
456 |
+
}
|
457 |
+
$publishingAction.removeClass('code-' + request.params.code);
|
458 |
+
if (!$publishingAction.attr('class')) {
|
459 |
+
$publishingAction.find('#publish').removeClass('disabled');
|
460 |
+
$publishingAction.find('.spinner').removeClass('is-active');
|
461 |
+
}
|
462 |
+
});
|
463 |
+
});
|
464 |
+
}
|
465 |
+
|
466 |
+
/***/ })
|
467 |
+
|
468 |
+
/******/ });
|
469 |
+
//# sourceMappingURL=question.js.map
|
assets/js/admin/editor/question.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(u){if(n[u])return n[u].exports;var r=n[u]={i:u,l:!1,exports:{}};return e[u].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,u){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:u})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=54)}({54:function(e,t,n){"use strict";function u(e){return e&&e.__esModule?e:{default:e}}var r=n(8),o=u(r),s=n(55),i=u(s);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,(0,window.jQuery)(document).ready(function(){window.LP_Question_Store=new $Vuex.Store((0,i.default)(lp_question_editor)),(0,o.default)({ns:"LPQuestionEditorRequest",store:LP_Question_Store}),setTimeout(function(){window.LP_Question_Editor=new $Vue({el:"#admin-editor-lp_question",template:"<lp-question-editor></lp-question-editor>"})},100)})},55:function(e,t,n){"use strict";function u(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(56),o=u(r),s=n(57),i=u(s),c=n(58),a=u(c),d=window.jQuery,f=function(e){return{state:d.extend({status:"successful",countCurrentRequest:0,i18n:d.extend({},e.i18n)},e.root),getters:o.default,mutations:i.default,actions:a.default}};t.default=f},56:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u={id:function(e){return e.id},type:function(e){return e.type},code:function(e){return Date.now()},autoDraft:function(e){return e.auto_draft},answers:function(e){return Object.values(e.answers)||[]},settings:function(e){return e.setting},types:function(e){return e.questionTypes||[]},numberCorrect:function(e){var t=0;return Object.keys(e.answers).forEach(function(n){"yes"===e.answers[n].is_true&&(t+=1)}),t},status:function(e){return e.status},currentRequest:function(e){return e.countCurrentRequest||0},action:function(e){return e.action},nonce:function(e){return e.nonce},externalComponent:function(e){return e.externalComponent||[]},state:function(e){return e},i18n:function(e){return e.i18n}};t.default=u},57:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u={UPDATE_STATUS:function(e,t){e.status=t},UPDATE_AUTO_DRAFT_STATUS:function(e,t){e.auto_draft=t},CHANGE_QUESTION_TYPE:function(e,t){e.answers=t.answers,e.type=t.type},SET_ANSWERS:function(e,t){e.answers=t},DELETE_ANSWER:function(e,t){for(var n=0,u=e.answers.length;n<u;n++)if(e.answers[n].question_answer_id==t){e.answers[n].question_answer_id=LP.uniqueId();break}},ADD_NEW_ANSWER:function(e,t){e.answers.push(t)},UPDATE_ANSWERS:function(e,t){e.answers=t},INCREASE_NUMBER_REQUEST:function(e){e.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(e){e.countCurrentRequest--}};t.default=u},58:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u={changeQuestionType:function(e,t){LP.Request({type:"change-question-type",question_type:t.type,draft_question:e.getters.autoDraft?JSON.stringify(t.question):""}).then(function(t){var n=t.body;n.success&&(e.commit("UPDATE_AUTO_DRAFT_STATUS",!1),e.commit("CHANGE_QUESTION_TYPE",n.data))})},updateAnswersOrder:function(e,t){LP.Request({type:"sort-answer",order:t}).then(function(e){e.body.success})},updateAnswerTitle:function(e,t){void 0!==t.question_answer_id&&(t=JSON.stringify(t),LP.Request({type:"update-answer-title",answer:t}))},updateCorrectAnswer:function(e,t){LP.Request({type:"change-correct",correct:JSON.stringify(t)}).then(function(t){var n=t.body;n.success&&(e.commit("UPDATE_ANSWERS",n.data),e.commit("UPDATE_AUTO_DRAFT_STATUS",!1))})},deleteAnswer:function(e,t){e.commit("DELETE_ANSWER",t.id),LP.Request({type:"delete-answer",answer_id:t.id}).then(function(t){var n=t.body;n.success&&e.commit("SET_ANSWERS",n.data)})},newAnswer:function(e,t){e.commit("ADD_NEW_ANSWER",t.answer),LP.Request({type:"new-answer"}).then(function(t){var n=t.body;n.success&&e.commit("UPDATE_ANSWERS",n.data)})},newRequest:function(e){e.commit("INCREASE_NUMBER_REQUEST"),e.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(e,t){e.commit("DECREASE_NUMBER_REQUEST"),0===e.getters.currentRequest&&(e.commit("UPDATE_STATUS",t),window.onbeforeunload=null)}};t.default=u},8:function(e,t,n){"use strict";function u(e){var t=window.jQuery,n=Vue.http;e=t.extend({ns:"LPRequest",store:!1},e||{});var u=null;LP.Request=function(r){return u=t("#publishing-action"),r.id=e.store.getters.id,r.nonce=e.store.getters.nonce,r["lp-ajax"]=e.store.getters.action,r.code=e.store.getters.code,u.find("#publish").addClass("disabled"),u.find(".spinner").addClass("is-active"),u.addClass("code-"+r.code),n.post(e.store.getters.urlAjax,r,{emulateJSON:!0,params:{namespace:e.ns,code:r.code}})},n.interceptors.push(function(t,n){if(t.params.namespace!==e.ns)return void n();e.store.dispatch("newRequest"),n(function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success?e.store.dispatch("requestCompleted","successful"):e.store.dispatch("requestCompleted","failed"),u.removeClass("code-"+t.params.code),u.attr("class")||(u.find("#publish").removeClass("disabled"),u.find(".spinner").removeClass("is-active"))})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=u}});
|
assets/js/admin/editor/quiz.js
ADDED
@@ -0,0 +1,1252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 41);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ([
|
67 |
+
/* 0 */,
|
68 |
+
/* 1 */,
|
69 |
+
/* 2 */,
|
70 |
+
/* 3 */,
|
71 |
+
/* 4 */,
|
72 |
+
/* 5 */,
|
73 |
+
/* 6 */,
|
74 |
+
/* 7 */,
|
75 |
+
/* 8 */
|
76 |
+
/***/ (function(module, exports, __webpack_require__) {
|
77 |
+
|
78 |
+
"use strict";
|
79 |
+
|
80 |
+
|
81 |
+
Object.defineProperty(exports, "__esModule", {
|
82 |
+
value: true
|
83 |
+
});
|
84 |
+
exports.default = HTTP;
|
85 |
+
function HTTP(options) {
|
86 |
+
var $ = window.jQuery;
|
87 |
+
var $VueHTTP = Vue.http;
|
88 |
+
|
89 |
+
options = $.extend({
|
90 |
+
ns: 'LPRequest',
|
91 |
+
store: false
|
92 |
+
}, options || {});
|
93 |
+
|
94 |
+
var $publishingAction = null;
|
95 |
+
|
96 |
+
LP.Request = function (payload) {
|
97 |
+
$publishingAction = $('#publishing-action');
|
98 |
+
|
99 |
+
payload['id'] = options.store.getters.id;
|
100 |
+
payload['nonce'] = options.store.getters.nonce;
|
101 |
+
payload['lp-ajax'] = options.store.getters.action;
|
102 |
+
payload['code'] = options.store.getters.code;
|
103 |
+
|
104 |
+
$publishingAction.find('#publish').addClass('disabled');
|
105 |
+
$publishingAction.find('.spinner').addClass('is-active');
|
106 |
+
$publishingAction.addClass('code-' + payload['code']);
|
107 |
+
|
108 |
+
return $VueHTTP.post(options.store.getters.urlAjax, payload, {
|
109 |
+
emulateJSON: true,
|
110 |
+
params: {
|
111 |
+
namespace: options.ns,
|
112 |
+
code: payload['code']
|
113 |
+
}
|
114 |
+
});
|
115 |
+
};
|
116 |
+
|
117 |
+
$VueHTTP.interceptors.push(function (request, next) {
|
118 |
+
if (request.params['namespace'] !== options.ns) {
|
119 |
+
next();
|
120 |
+
return;
|
121 |
+
}
|
122 |
+
|
123 |
+
options.store.dispatch('newRequest');
|
124 |
+
|
125 |
+
next(function (response) {
|
126 |
+
if (!jQuery.isPlainObject(response.body)) {
|
127 |
+
response.body = LP.parseJSON(response.body);
|
128 |
+
}
|
129 |
+
|
130 |
+
var body = response.body;
|
131 |
+
var result = body.success || false;
|
132 |
+
|
133 |
+
if (result) {
|
134 |
+
options.store.dispatch('requestCompleted', 'successful');
|
135 |
+
} else {
|
136 |
+
options.store.dispatch('requestCompleted', 'failed');
|
137 |
+
}
|
138 |
+
$publishingAction.removeClass('code-' + request.params.code);
|
139 |
+
if (!$publishingAction.attr('class')) {
|
140 |
+
$publishingAction.find('#publish').removeClass('disabled');
|
141 |
+
$publishingAction.find('.spinner').removeClass('is-active');
|
142 |
+
}
|
143 |
+
});
|
144 |
+
});
|
145 |
+
}
|
146 |
+
|
147 |
+
/***/ }),
|
148 |
+
/* 9 */,
|
149 |
+
/* 10 */,
|
150 |
+
/* 11 */,
|
151 |
+
/* 12 */
|
152 |
+
/***/ (function(module, exports, __webpack_require__) {
|
153 |
+
|
154 |
+
"use strict";
|
155 |
+
|
156 |
+
|
157 |
+
Object.defineProperty(exports, "__esModule", {
|
158 |
+
value: true
|
159 |
+
});
|
160 |
+
var $ = window.jQuery;
|
161 |
+
var i18n = function i18n(i18n) {
|
162 |
+
var state = $.extend({}, i18n);
|
163 |
+
var getters = {
|
164 |
+
all: function all(state) {
|
165 |
+
return state;
|
166 |
+
}
|
167 |
+
};
|
168 |
+
|
169 |
+
return {
|
170 |
+
namespaced: true,
|
171 |
+
state: state,
|
172 |
+
getters: getters
|
173 |
+
};
|
174 |
+
};
|
175 |
+
|
176 |
+
exports.default = i18n;
|
177 |
+
|
178 |
+
/***/ }),
|
179 |
+
/* 13 */,
|
180 |
+
/* 14 */,
|
181 |
+
/* 15 */,
|
182 |
+
/* 16 */,
|
183 |
+
/* 17 */,
|
184 |
+
/* 18 */,
|
185 |
+
/* 19 */,
|
186 |
+
/* 20 */,
|
187 |
+
/* 21 */,
|
188 |
+
/* 22 */,
|
189 |
+
/* 23 */,
|
190 |
+
/* 24 */,
|
191 |
+
/* 25 */,
|
192 |
+
/* 26 */,
|
193 |
+
/* 27 */,
|
194 |
+
/* 28 */,
|
195 |
+
/* 29 */,
|
196 |
+
/* 30 */,
|
197 |
+
/* 31 */,
|
198 |
+
/* 32 */,
|
199 |
+
/* 33 */,
|
200 |
+
/* 34 */,
|
201 |
+
/* 35 */,
|
202 |
+
/* 36 */,
|
203 |
+
/* 37 */,
|
204 |
+
/* 38 */,
|
205 |
+
/* 39 */,
|
206 |
+
/* 40 */,
|
207 |
+
/* 41 */
|
208 |
+
/***/ (function(module, exports, __webpack_require__) {
|
209 |
+
|
210 |
+
"use strict";
|
211 |
+
|
212 |
+
|
213 |
+
var _quiz = __webpack_require__(42);
|
214 |
+
|
215 |
+
var _quiz2 = _interopRequireDefault(_quiz);
|
216 |
+
|
217 |
+
var _http = __webpack_require__(8);
|
218 |
+
|
219 |
+
var _http2 = _interopRequireDefault(_http);
|
220 |
+
|
221 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
222 |
+
|
223 |
+
window.$Vue = window.$Vue || Vue;
|
224 |
+
window.$Vuex = window.$Vuex || Vuex;
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Init app.
|
228 |
+
*
|
229 |
+
* @since 3.0.0
|
230 |
+
*/
|
231 |
+
|
232 |
+
window.jQuery(document).ready(function () {
|
233 |
+
window.LP_Quiz_Store = new $Vuex.Store((0, _quiz2.default)(lp_quiz_editor));
|
234 |
+
(0, _http2.default)({ ns: 'LPListQuizQuestionsRequest', store: LP_Quiz_Store });
|
235 |
+
|
236 |
+
setTimeout(function () {
|
237 |
+
window.LP_Quiz_Editor = new $Vue({
|
238 |
+
el: '#admin-editor-lp_quiz',
|
239 |
+
template: '<lp-quiz-editor></lp-quiz-editor>'
|
240 |
+
});
|
241 |
+
}, 100);
|
242 |
+
});
|
243 |
+
|
244 |
+
/***/ }),
|
245 |
+
/* 42 */
|
246 |
+
/***/ (function(module, exports, __webpack_require__) {
|
247 |
+
|
248 |
+
"use strict";
|
249 |
+
|
250 |
+
|
251 |
+
Object.defineProperty(exports, "__esModule", {
|
252 |
+
value: true
|
253 |
+
});
|
254 |
+
|
255 |
+
var _quiz = __webpack_require__(43);
|
256 |
+
|
257 |
+
var _quiz2 = _interopRequireDefault(_quiz);
|
258 |
+
|
259 |
+
var _quiz3 = __webpack_require__(44);
|
260 |
+
|
261 |
+
var _quiz4 = _interopRequireDefault(_quiz3);
|
262 |
+
|
263 |
+
var _quiz5 = __webpack_require__(45);
|
264 |
+
|
265 |
+
var _quiz6 = _interopRequireDefault(_quiz5);
|
266 |
+
|
267 |
+
var _modalQuizItems = __webpack_require__(46);
|
268 |
+
|
269 |
+
var _modalQuizItems2 = _interopRequireDefault(_modalQuizItems);
|
270 |
+
|
271 |
+
var _i18n = __webpack_require__(12);
|
272 |
+
|
273 |
+
var _i18n2 = _interopRequireDefault(_i18n);
|
274 |
+
|
275 |
+
var _questionList = __webpack_require__(50);
|
276 |
+
|
277 |
+
var _questionList2 = _interopRequireDefault(_questionList);
|
278 |
+
|
279 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
280 |
+
|
281 |
+
var $ = window.jQuery;
|
282 |
+
var Quiz = function Quiz(data) {
|
283 |
+
var state = $.extend({
|
284 |
+
status: 'success',
|
285 |
+
heartbeat: true,
|
286 |
+
countCurrentRequest: 0
|
287 |
+
}, data.root);
|
288 |
+
|
289 |
+
return {
|
290 |
+
state: state,
|
291 |
+
getters: _quiz2.default,
|
292 |
+
mutations: _quiz4.default,
|
293 |
+
actions: _quiz6.default,
|
294 |
+
modules: {
|
295 |
+
cqi: (0, _modalQuizItems2.default)(data),
|
296 |
+
i18n: (0, _i18n2.default)(data.i18n),
|
297 |
+
lqs: (0, _questionList2.default)(data)
|
298 |
+
}
|
299 |
+
};
|
300 |
+
};
|
301 |
+
|
302 |
+
exports.default = Quiz;
|
303 |
+
|
304 |
+
/***/ }),
|
305 |
+
/* 43 */
|
306 |
+
/***/ (function(module, exports, __webpack_require__) {
|
307 |
+
|
308 |
+
"use strict";
|
309 |
+
|
310 |
+
|
311 |
+
Object.defineProperty(exports, "__esModule", {
|
312 |
+
value: true
|
313 |
+
});
|
314 |
+
var Quiz = {
|
315 |
+
heartbeat: function heartbeat(state) {
|
316 |
+
return state.heartbeat;
|
317 |
+
},
|
318 |
+
questionTypes: function questionTypes(state) {
|
319 |
+
return state.types;
|
320 |
+
},
|
321 |
+
defaultNewQuestionType: function defaultNewQuestionType(state) {
|
322 |
+
return state.default_new;
|
323 |
+
},
|
324 |
+
action: function action(state) {
|
325 |
+
return state.action;
|
326 |
+
},
|
327 |
+
id: function id(state) {
|
328 |
+
return state.quiz_id;
|
329 |
+
},
|
330 |
+
status: function status(state) {
|
331 |
+
return state.status || 'error';
|
332 |
+
},
|
333 |
+
currentRequest: function currentRequest(state) {
|
334 |
+
return state.countCurrentRequest || 0;
|
335 |
+
},
|
336 |
+
nonce: function nonce(state) {
|
337 |
+
return state.nonce;
|
338 |
+
}
|
339 |
+
};
|
340 |
+
|
341 |
+
exports.default = Quiz;
|
342 |
+
|
343 |
+
/***/ }),
|
344 |
+
/* 44 */
|
345 |
+
/***/ (function(module, exports, __webpack_require__) {
|
346 |
+
|
347 |
+
"use strict";
|
348 |
+
|
349 |
+
|
350 |
+
Object.defineProperty(exports, "__esModule", {
|
351 |
+
value: true
|
352 |
+
});
|
353 |
+
var Quiz = {
|
354 |
+
|
355 |
+
'UPDATE_HEART_BEAT': function UPDATE_HEART_BEAT(state, status) {
|
356 |
+
state.heartbeat = !!status;
|
357 |
+
},
|
358 |
+
|
359 |
+
'UPDATE_STATUS': function UPDATE_STATUS(state, status) {
|
360 |
+
state.status = status;
|
361 |
+
},
|
362 |
+
|
363 |
+
'UPDATE_NEW_QUESTION_TYPE': function UPDATE_NEW_QUESTION_TYPE(state, type) {
|
364 |
+
state.default_new = type;
|
365 |
+
},
|
366 |
+
|
367 |
+
'INCREASE_NUMBER_REQUEST': function INCREASE_NUMBER_REQUEST(state) {
|
368 |
+
state.countCurrentRequest++;
|
369 |
+
},
|
370 |
+
|
371 |
+
'DECREASE_NUMBER_REQUEST': function DECREASE_NUMBER_REQUEST(state) {
|
372 |
+
state.countCurrentRequest--;
|
373 |
+
}
|
374 |
+
};
|
375 |
+
|
376 |
+
exports.default = Quiz;
|
377 |
+
|
378 |
+
/***/ }),
|
379 |
+
/* 45 */
|
380 |
+
/***/ (function(module, exports, __webpack_require__) {
|
381 |
+
|
382 |
+
"use strict";
|
383 |
+
|
384 |
+
|
385 |
+
Object.defineProperty(exports, "__esModule", {
|
386 |
+
value: true
|
387 |
+
});
|
388 |
+
var Quiz = {
|
389 |
+
heartbeat: function heartbeat(context) {
|
390 |
+
LP.Request({
|
391 |
+
type: 'heartbeat'
|
392 |
+
}).then(function (response) {
|
393 |
+
var result = response.body;
|
394 |
+
context.commit('UPDATE_HEART_BEAT', !!result.success);
|
395 |
+
}, function (error) {
|
396 |
+
context.commit('UPDATE_HEART_BEAT', false);
|
397 |
+
});
|
398 |
+
},
|
399 |
+
|
400 |
+
newRequest: function newRequest(context) {
|
401 |
+
context.commit('INCREASE_NUMBER_REQUEST');
|
402 |
+
context.commit('UPDATE_STATUS', 'loading');
|
403 |
+
|
404 |
+
window.onbeforeunload = function () {
|
405 |
+
return '';
|
406 |
+
};
|
407 |
+
},
|
408 |
+
|
409 |
+
requestCompleted: function requestCompleted(context, status) {
|
410 |
+
context.commit('DECREASE_NUMBER_REQUEST');
|
411 |
+
|
412 |
+
if (context.getters.currentRequest === 0) {
|
413 |
+
context.commit('UPDATE_STATUS', status);
|
414 |
+
window.onbeforeunload = null;
|
415 |
+
}
|
416 |
+
}
|
417 |
+
};
|
418 |
+
|
419 |
+
exports.default = Quiz;
|
420 |
+
|
421 |
+
/***/ }),
|
422 |
+
/* 46 */
|
423 |
+
/***/ (function(module, exports, __webpack_require__) {
|
424 |
+
|
425 |
+
"use strict";
|
426 |
+
|
427 |
+
|
428 |
+
Object.defineProperty(exports, "__esModule", {
|
429 |
+
value: true
|
430 |
+
});
|
431 |
+
|
432 |
+
var _modalQuizItems = __webpack_require__(47);
|
433 |
+
|
434 |
+
var _modalQuizItems2 = _interopRequireDefault(_modalQuizItems);
|
435 |
+
|
436 |
+
var _modalQuizItems3 = __webpack_require__(48);
|
437 |
+
|
438 |
+
var _modalQuizItems4 = _interopRequireDefault(_modalQuizItems3);
|
439 |
+
|
440 |
+
var _modalQuizItems5 = __webpack_require__(49);
|
441 |
+
|
442 |
+
var _modalQuizItems6 = _interopRequireDefault(_modalQuizItems5);
|
443 |
+
|
444 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
445 |
+
|
446 |
+
var $ = window.jQuery;
|
447 |
+
var Quiz = function Quiz(data) {
|
448 |
+
var state = $.extend({
|
449 |
+
quizId: false,
|
450 |
+
pagination: '',
|
451 |
+
status: ''
|
452 |
+
}, data.chooseItems);
|
453 |
+
|
454 |
+
return {
|
455 |
+
namespaced: true,
|
456 |
+
state: state,
|
457 |
+
getters: _modalQuizItems2.default,
|
458 |
+
mutations: _modalQuizItems4.default,
|
459 |
+
actions: _modalQuizItems6.default
|
460 |
+
};
|
461 |
+
};
|
462 |
+
|
463 |
+
exports.default = Quiz;
|
464 |
+
|
465 |
+
/***/ }),
|
466 |
+
/* 47 */
|
467 |
+
/***/ (function(module, exports, __webpack_require__) {
|
468 |
+
|
469 |
+
"use strict";
|
470 |
+
|
471 |
+
|
472 |
+
Object.defineProperty(exports, "__esModule", {
|
473 |
+
value: true
|
474 |
+
});
|
475 |
+
var ModalQuizItems = {
|
476 |
+
status: function status(state) {
|
477 |
+
return state.status;
|
478 |
+
},
|
479 |
+
pagination: function pagination(state) {
|
480 |
+
return state.pagination;
|
481 |
+
},
|
482 |
+
items: function items(state, _getters) {
|
483 |
+
return state.items.map(function (item) {
|
484 |
+
var find = _getters.addedItems.find(function (_item) {
|
485 |
+
return item.id === _item.id;
|
486 |
+
});
|
487 |
+
|
488 |
+
item.added = !!find;
|
489 |
+
|
490 |
+
return item;
|
491 |
+
});
|
492 |
+
},
|
493 |
+
code: function code(state) {
|
494 |
+
return Date.now();
|
495 |
+
},
|
496 |
+
addedItems: function addedItems(state) {
|
497 |
+
return state.addedItems;
|
498 |
+
},
|
499 |
+
isOpen: function isOpen(state) {
|
500 |
+
return state.open;
|
501 |
+
},
|
502 |
+
quiz: function quiz(state) {
|
503 |
+
return state.quizId;
|
504 |
+
}
|
505 |
+
};
|
506 |
+
|
507 |
+
exports.default = ModalQuizItems;
|
508 |
+
|
509 |
+
/***/ }),
|
510 |
+
/* 48 */
|
511 |
+
/***/ (function(module, exports, __webpack_require__) {
|
512 |
+
|
513 |
+
"use strict";
|
514 |
+
|
515 |
+
|
516 |
+
Object.defineProperty(exports, "__esModule", {
|
517 |
+
value: true
|
518 |
+
});
|
519 |
+
var ModalQuizItems = {
|
520 |
+
'TOGGLE': function TOGGLE(state) {
|
521 |
+
state.open = !state.open;
|
522 |
+
},
|
523 |
+
'SET_QUIZ': function SET_QUIZ(state, quizId) {
|
524 |
+
state.quizId = quizId;
|
525 |
+
},
|
526 |
+
'SET_LIST_ITEMS': function SET_LIST_ITEMS(state, items) {
|
527 |
+
state.items = items;
|
528 |
+
},
|
529 |
+
'ADD_ITEM': function ADD_ITEM(state, item) {
|
530 |
+
state.addedItems.push(item);
|
531 |
+
},
|
532 |
+
'REMOVE_ADDED_ITEM': function REMOVE_ADDED_ITEM(state, item) {
|
533 |
+
state.addedItems.forEach(function (_item, index) {
|
534 |
+
if (_item.id === item.id) {
|
535 |
+
state.addedItems.splice(index, 1);
|
536 |
+
}
|
537 |
+
});
|
538 |
+
},
|
539 |
+
'RESET': function RESET(state) {
|
540 |
+
state.addedItems = [];
|
541 |
+
state.items = [];
|
542 |
+
},
|
543 |
+
'UPDATE_PAGINATION': function UPDATE_PAGINATION(state, pagination) {
|
544 |
+
state.pagination = pagination;
|
545 |
+
},
|
546 |
+
'SEARCH_ITEM_REQUEST': function SEARCH_ITEM_REQUEST(state) {
|
547 |
+
state.status = 'loading';
|
548 |
+
},
|
549 |
+
'SEARCH_ITEM_SUCCESS': function SEARCH_ITEM_SUCCESS(state) {
|
550 |
+
state.status = 'successful';
|
551 |
+
},
|
552 |
+
'SEARCH_ITEM_FAIL': function SEARCH_ITEM_FAIL(state) {
|
553 |
+
state.status = 'fail';
|
554 |
+
}
|
555 |
+
};
|
556 |
+
|
557 |
+
exports.default = ModalQuizItems;
|
558 |
+
|
559 |
+
/***/ }),
|
560 |
+
/* 49 */
|
561 |
+
/***/ (function(module, exports, __webpack_require__) {
|
562 |
+
|
563 |
+
"use strict";
|
564 |
+
|
565 |
+
|
566 |
+
Object.defineProperty(exports, "__esModule", {
|
567 |
+
value: true
|
568 |
+
});
|
569 |
+
var ModalQuizItems = {
|
570 |
+
|
571 |
+
toggle: function toggle(context) {
|
572 |
+
context.commit('TOGGLE');
|
573 |
+
},
|
574 |
+
|
575 |
+
// open modal
|
576 |
+
open: function open(context, quizId) {
|
577 |
+
context.commit('SET_QUIZ', quizId);
|
578 |
+
context.commit('RESET');
|
579 |
+
context.commit('TOGGLE');
|
580 |
+
},
|
581 |
+
|
582 |
+
// query available question
|
583 |
+
searchItems: function searchItems(context, payload) {
|
584 |
+
context.commit('SEARCH_ITEM_REQUEST');
|
585 |
+
|
586 |
+
LP.Request({
|
587 |
+
type: 'search-items',
|
588 |
+
query: payload.query,
|
589 |
+
page: payload.page,
|
590 |
+
exclude: JSON.stringify([])
|
591 |
+
}).then(function (response) {
|
592 |
+
var result = response.body;
|
593 |
+
|
594 |
+
if (!result.success) {
|
595 |
+
return;
|
596 |
+
}
|
597 |
+
|
598 |
+
var data = result.data;
|
599 |
+
|
600 |
+
context.commit('SET_LIST_ITEMS', data.items);
|
601 |
+
context.commit('UPDATE_PAGINATION', data.pagination);
|
602 |
+
context.commit('SEARCH_ITEM_SUCCESS');
|
603 |
+
}, function (error) {
|
604 |
+
context.commit('SEARCH_ITEMS_FAIL');
|
605 |
+
|
606 |
+
console.log(error);
|
607 |
+
});
|
608 |
+
},
|
609 |
+
|
610 |
+
// add question
|
611 |
+
addItem: function addItem(context, item) {
|
612 |
+
context.commit('ADD_ITEM', item);
|
613 |
+
},
|
614 |
+
|
615 |
+
// remove question
|
616 |
+
removeItem: function removeItem(context, index) {
|
617 |
+
context.commit('REMOVE_ADDED_ITEM', index);
|
618 |
+
},
|
619 |
+
|
620 |
+
addQuestionsToQuiz: function addQuestionsToQuiz(context, quiz) {
|
621 |
+
var items = context.getters.addedItems;
|
622 |
+
if (items.length > 0) {
|
623 |
+
LP.Request({
|
624 |
+
type: 'add-questions-to-quiz',
|
625 |
+
items: JSON.stringify(items),
|
626 |
+
draft_quiz: JSON.stringify(quiz)
|
627 |
+
}).then(function (response) {
|
628 |
+
var result = response.body;
|
629 |
+
|
630 |
+
if (result.success) {
|
631 |
+
var questions = result.data;
|
632 |
+
|
633 |
+
// update quiz list questions
|
634 |
+
context.commit('lqs/SET_QUESTIONS', questions, { root: true });
|
635 |
+
context.commit('TOGGLE');
|
636 |
+
}
|
637 |
+
}, function (error) {
|
638 |
+
console.log(error);
|
639 |
+
});
|
640 |
+
}
|
641 |
+
}
|
642 |
+
};
|
643 |
+
|
644 |
+
exports.default = ModalQuizItems;
|
645 |
+
|
646 |
+
/***/ }),
|
647 |
+
/* 50 */
|
648 |
+
/***/ (function(module, exports, __webpack_require__) {
|
649 |
+
|
650 |
+
"use strict";
|
651 |
+
|
652 |
+
|
653 |
+
Object.defineProperty(exports, "__esModule", {
|
654 |
+
value: true
|
655 |
+
});
|
656 |
+
|
657 |
+
var _questionList = __webpack_require__(51);
|
658 |
+
|
659 |
+
var _questionList2 = _interopRequireDefault(_questionList);
|
660 |
+
|
661 |
+
var _questionList3 = __webpack_require__(52);
|
662 |
+
|
663 |
+
var _questionList4 = _interopRequireDefault(_questionList3);
|
664 |
+
|
665 |
+
var _questionList5 = __webpack_require__(53);
|
666 |
+
|
667 |
+
var _questionList6 = _interopRequireDefault(_questionList5);
|
668 |
+
|
669 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
670 |
+
|
671 |
+
var $ = window.jQuery;
|
672 |
+
var QuestionList = function QuestionList(data) {
|
673 |
+
var listQuestions = data.listQuestions;
|
674 |
+
var state = $.extend({
|
675 |
+
statusUpdateQuestions: {},
|
676 |
+
statusUpdateQuestionItem: {},
|
677 |
+
statusUpdateQuestionAnswer: {},
|
678 |
+
questions: listQuestions.questions.map(function (question) {
|
679 |
+
var hiddenQuestions = listQuestions.hidden_questions;
|
680 |
+
var find = hiddenQuestions.find(function (questionId) {
|
681 |
+
return parseInt(question.id) === parseInt(questionId);
|
682 |
+
});
|
683 |
+
|
684 |
+
question.open = !find;
|
685 |
+
|
686 |
+
return question;
|
687 |
+
})
|
688 |
+
}, listQuestions);
|
689 |
+
|
690 |
+
return {
|
691 |
+
namespaced: true,
|
692 |
+
state: state,
|
693 |
+
getters: _questionList2.default,
|
694 |
+
mutations: _questionList4.default,
|
695 |
+
actions: _questionList6.default
|
696 |
+
};
|
697 |
+
};
|
698 |
+
|
699 |
+
exports.default = QuestionList;
|
700 |
+
|
701 |
+
/***/ }),
|
702 |
+
/* 51 */
|
703 |
+
/***/ (function(module, exports, __webpack_require__) {
|
704 |
+
|
705 |
+
"use strict";
|
706 |
+
|
707 |
+
|
708 |
+
Object.defineProperty(exports, "__esModule", {
|
709 |
+
value: true
|
710 |
+
});
|
711 |
+
var QuestionList = {
|
712 |
+
listQuestions: function listQuestions(state) {
|
713 |
+
return state.questions || [];
|
714 |
+
},
|
715 |
+
questionsOrder: function questionsOrder(state) {
|
716 |
+
return state.order || [];
|
717 |
+
},
|
718 |
+
externalComponent: function externalComponent(state) {
|
719 |
+
return state.externalComponent || [];
|
720 |
+
},
|
721 |
+
hiddenQuestionsSettings: function hiddenQuestionsSettings(state) {
|
722 |
+
return state.hidden_questions_settings || [];
|
723 |
+
},
|
724 |
+
hiddenQuestions: function hiddenQuestions(state) {
|
725 |
+
return state.questions.filter(function (question) {
|
726 |
+
return !question.open;
|
727 |
+
}).map(function (question) {
|
728 |
+
return parseInt(question.id);
|
729 |
+
});
|
730 |
+
},
|
731 |
+
isHiddenListQuestions: function isHiddenListQuestions(state, getters) {
|
732 |
+
var questions = getters['listQuestions'];
|
733 |
+
var hiddenQuestions = getters['hiddenQuestions'];
|
734 |
+
|
735 |
+
return questions.length === hiddenQuestions.length;
|
736 |
+
},
|
737 |
+
disableUpdateList: function disableUpdateList(state) {
|
738 |
+
return state.disableUpdateList;
|
739 |
+
},
|
740 |
+
statusUpdateQuestions: function statusUpdateQuestions(state) {
|
741 |
+
return state.statusUpdateQuestions;
|
742 |
+
},
|
743 |
+
statusUpdateQuestionItem: function statusUpdateQuestionItem(state) {
|
744 |
+
return state.statusUpdateQuestionItem;
|
745 |
+
},
|
746 |
+
statusUpdateQuestionAnswer: function statusUpdateQuestionAnswer(state) {
|
747 |
+
return state.statusUpdateQuestionAnswer;
|
748 |
+
}
|
749 |
+
};
|
750 |
+
|
751 |
+
exports.default = QuestionList;
|
752 |
+
|
753 |
+
/***/ }),
|
754 |
+
/* 52 */
|
755 |
+
/***/ (function(module, exports, __webpack_require__) {
|
756 |
+
|
757 |
+
"use strict";
|
758 |
+
|
759 |
+
|
760 |
+
Object.defineProperty(exports, "__esModule", {
|
761 |
+
value: true
|
762 |
+
});
|
763 |
+
var QuestionList = {
|
764 |
+
'SORT_QUESTIONS': function SORT_QUESTIONS(state, orders) {
|
765 |
+
state.questions = state.questions.map(function (question) {
|
766 |
+
question.order = orders[question.id];
|
767 |
+
return question;
|
768 |
+
});
|
769 |
+
},
|
770 |
+
'SORT_QUESTION_ANSWERS': function SORT_QUESTION_ANSWERS(state, orders) {
|
771 |
+
state.questions = state.questions.map(function (question) {
|
772 |
+
question.answers.answer_order = orders[question.answers.question_answer_id];
|
773 |
+
return question;
|
774 |
+
});
|
775 |
+
},
|
776 |
+
'ADD_QUESTION_ANSWER': function ADD_QUESTION_ANSWER(state, payload) {
|
777 |
+
state.questions = state.questions.map(function (question) {
|
778 |
+
if (question.id === payload.question_id) {
|
779 |
+
var found = false;
|
780 |
+
if (payload.answer.temp_id) {
|
781 |
+
for (var i = 0, n = question.answers.length; i < n; i++) {
|
782 |
+
if (question.answers[i].question_answer_id == payload.answer.temp_id) {
|
783 |
+
found = true;
|
784 |
+
$Vue.set(question.answers, i, payload.answer);
|
785 |
+
}
|
786 |
+
}
|
787 |
+
}
|
788 |
+
|
789 |
+
!found && question.answers.push(payload.answer);
|
790 |
+
return question;
|
791 |
+
} else {
|
792 |
+
return question;
|
793 |
+
}
|
794 |
+
});
|
795 |
+
},
|
796 |
+
'CHANGE_QUESTION_CORRECT_ANSWERS': function CHANGE_QUESTION_CORRECT_ANSWERS(state, data) {
|
797 |
+
state.questions = state.questions.map(function (question) {
|
798 |
+
if (parseInt(question.id) === data.id) {
|
799 |
+
question.answers = data.answers;
|
800 |
+
}
|
801 |
+
return question;
|
802 |
+
});
|
803 |
+
},
|
804 |
+
'SET_QUESTIONS': function SET_QUESTIONS(state, questions) {
|
805 |
+
state.questions = questions;
|
806 |
+
},
|
807 |
+
'ADD_NEW_QUESTION': function ADD_NEW_QUESTION(state, question) {
|
808 |
+
var found = false;
|
809 |
+
if (question.temp_id) {
|
810 |
+
for (var i = 0, n = state.questions.length; i < n; i++) {
|
811 |
+
if (state.questions[i].id === question.temp_id) {
|
812 |
+
$Vue.set(state.questions, i, question);
|
813 |
+
found = true;
|
814 |
+
break;
|
815 |
+
}
|
816 |
+
}
|
817 |
+
}
|
818 |
+
if (!found) {
|
819 |
+
var _last_child = $('.lp-list-questions .main > div:last-child');
|
820 |
+
if (_last_child.length) {
|
821 |
+
var _offset = _last_child.offset().top;
|
822 |
+
$('html,body').animate({ scrollTop: _offset });
|
823 |
+
}
|
824 |
+
|
825 |
+
state.questions.push(question);
|
826 |
+
}
|
827 |
+
},
|
828 |
+
'CHANGE_QUESTION_TYPE': function CHANGE_QUESTION_TYPE(state, data) {
|
829 |
+
state.questions = state.questions.map(function (question) {
|
830 |
+
if (parseInt(question.id) === data.id) {
|
831 |
+
question.answers = data.answers;
|
832 |
+
question.type = data.type;
|
833 |
+
question.open = true;
|
834 |
+
}
|
835 |
+
return question;
|
836 |
+
});
|
837 |
+
},
|
838 |
+
'REMOVE_QUESTION': function REMOVE_QUESTION(state, item) {
|
839 |
+
var questions = state.questions,
|
840 |
+
index = questions.indexOf(item);
|
841 |
+
|
842 |
+
if (item.temp_id) {
|
843 |
+
state.questions[index].id = item.temp_id;
|
844 |
+
} else {
|
845 |
+
state.questions.splice(index, 1);
|
846 |
+
}
|
847 |
+
},
|
848 |
+
'DELETE_QUESTION_ANSWER': function DELETE_QUESTION_ANSWER(state, payload) {
|
849 |
+
var question_id = payload.question_id,
|
850 |
+
answer_id = payload.answer_id;
|
851 |
+
|
852 |
+
state.questions = state.questions.map(function (question) {
|
853 |
+
if (question.id === question_id) {
|
854 |
+
var answers = question.answers;
|
855 |
+
answers.forEach(function (answer) {
|
856 |
+
if (answer.question_answer_id === answer_id) {
|
857 |
+
var index = answers.indexOf(answer);
|
858 |
+
answers.splice(index, 1);
|
859 |
+
}
|
860 |
+
});
|
861 |
+
}
|
862 |
+
return question;
|
863 |
+
});
|
864 |
+
},
|
865 |
+
'REMOVE_QUESTIONS': function REMOVE_QUESTIONS() {
|
866 |
+
// code
|
867 |
+
},
|
868 |
+
'CLOSE_QUESTION': function CLOSE_QUESTION(state, question) {
|
869 |
+
state.questions.forEach(function (_question, index) {
|
870 |
+
if (question.id === _question.id) {
|
871 |
+
state.questions[index].open = false;
|
872 |
+
}
|
873 |
+
});
|
874 |
+
},
|
875 |
+
'OPEN_QUESTION': function OPEN_QUESTION(state, question) {
|
876 |
+
state.questions.forEach(function (_question, index) {
|
877 |
+
if (question.id === _question.id) {
|
878 |
+
state.questions[index].open = true;
|
879 |
+
}
|
880 |
+
});
|
881 |
+
},
|
882 |
+
'CLOSE_LIST_QUESTIONS': function CLOSE_LIST_QUESTIONS(state) {
|
883 |
+
state.questions = state.questions.map(function (_question) {
|
884 |
+
_question.open = false;
|
885 |
+
|
886 |
+
return _question;
|
887 |
+
});
|
888 |
+
},
|
889 |
+
'OPEN_LIST_QUESTIONS': function OPEN_LIST_QUESTIONS(state) {
|
890 |
+
state.questions = state.questions.map(function (_question) {
|
891 |
+
_question.open = true;
|
892 |
+
|
893 |
+
return _question;
|
894 |
+
});
|
895 |
+
},
|
896 |
+
'UPDATE_QUESTION_REQUEST': function UPDATE_QUESTION_REQUEST(state, questionId) {
|
897 |
+
$Vue.set(state.statusUpdateQuestionItem, questionId, 'updating');
|
898 |
+
},
|
899 |
+
'UPDATE_QUESTION_SUCCESS': function UPDATE_QUESTION_SUCCESS(state, questionID) {
|
900 |
+
$Vue.set(state.statusUpdateQuestionItem, questionID, 'successful');
|
901 |
+
},
|
902 |
+
'UPDATE_QUESTION_FAILURE': function UPDATE_QUESTION_FAILURE(state, questionID) {
|
903 |
+
$Vue.set(state.statusUpdateQuestionItem, questionID, 'failed');
|
904 |
+
},
|
905 |
+
|
906 |
+
'UPDATE_QUESTION_ANSWER_REQUEST': function UPDATE_QUESTION_ANSWER_REQUEST(state, question_id) {
|
907 |
+
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'updating');
|
908 |
+
},
|
909 |
+
'UPDATE_QUESTION_ANSWER_SUCCESS': function UPDATE_QUESTION_ANSWER_SUCCESS(state, question_id) {
|
910 |
+
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'successful');
|
911 |
+
},
|
912 |
+
'UPDATE_QUESTION_ANSWER_FAIL': function UPDATE_QUESTION_ANSWER_FAIL(state, question_id) {
|
913 |
+
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'failed');
|
914 |
+
},
|
915 |
+
'DELETE_ANSWER': function DELETE_ANSWER(state, data) {
|
916 |
+
console.log('A');
|
917 |
+
state.questions.map(function (question, index) {
|
918 |
+
if (question.id == data.question_id) {
|
919 |
+
for (var i = 0, n = question.answers.length; i < n; i++) {
|
920 |
+
if (question.answers[i].question_answer_id == data.answer_id) {
|
921 |
+
question.answers[i].question_answer_id = data.temp_id;
|
922 |
+
//state.questions[index].answers.splice(i, 1);
|
923 |
+
break;
|
924 |
+
}
|
925 |
+
}
|
926 |
+
return false;
|
927 |
+
}
|
928 |
+
});
|
929 |
+
}
|
930 |
+
};
|
931 |
+
|
932 |
+
exports.default = QuestionList;
|
933 |
+
|
934 |
+
/***/ }),
|
935 |
+
/* 53 */
|
936 |
+
/***/ (function(module, exports, __webpack_require__) {
|
937 |
+
|
938 |
+
"use strict";
|
939 |
+
|
940 |
+
|
941 |
+
Object.defineProperty(exports, "__esModule", {
|
942 |
+
value: true
|
943 |
+
});
|
944 |
+
var QuestionList = {
|
945 |
+
|
946 |
+
toggleAll: function toggleAll(context) {
|
947 |
+
var hidden = context.getters['isHiddenListQuestions'];
|
948 |
+
|
949 |
+
if (hidden) {
|
950 |
+
context.commit('OPEN_LIST_QUESTIONS');
|
951 |
+
} else {
|
952 |
+
context.commit('CLOSE_LIST_QUESTIONS');
|
953 |
+
}
|
954 |
+
|
955 |
+
LP.Request({
|
956 |
+
type: 'hidden-questions',
|
957 |
+
hidden: context.getters['hiddenQuestions']
|
958 |
+
});
|
959 |
+
},
|
960 |
+
|
961 |
+
updateQuizQuestionsHidden: function updateQuizQuestionsHidden(context, data) {
|
962 |
+
LP.Request($.extend({}, data, {
|
963 |
+
type: 'update-quiz-questions-hidden'
|
964 |
+
}));
|
965 |
+
},
|
966 |
+
|
967 |
+
newQuestion: function newQuestion(context, payload) {
|
968 |
+
var newQuestion = JSON.parse(JSON.stringify(payload.question));
|
969 |
+
newQuestion.settings = {};
|
970 |
+
context.commit('ADD_NEW_QUESTION', newQuestion);
|
971 |
+
LP.Request({
|
972 |
+
type: 'new-question',
|
973 |
+
question: JSON.stringify(payload.question),
|
974 |
+
draft_quiz: JSON.stringify(payload.quiz)
|
975 |
+
}).then(function (response) {
|
976 |
+
var result = response.body;
|
977 |
+
|
978 |
+
if (result.success) {
|
979 |
+
// update new question type
|
980 |
+
context.commit('UPDATE_NEW_QUESTION_TYPE', payload.question.type, { root: true });
|
981 |
+
// update list quiz questions
|
982 |
+
context.commit('ADD_NEW_QUESTION', result.data);
|
983 |
+
context.commit('CLOSE_LIST_QUESTIONS');
|
984 |
+
context.commit('OPEN_QUESTION', result.data);
|
985 |
+
}
|
986 |
+
}, function (error) {
|
987 |
+
console.log(error);
|
988 |
+
});
|
989 |
+
},
|
990 |
+
|
991 |
+
updateQuestionsOrder: function updateQuestionsOrder(context, order) {
|
992 |
+
LP.Request({
|
993 |
+
type: 'sort-questions',
|
994 |
+
order: JSON.stringify(order)
|
995 |
+
}).then(function (response) {
|
996 |
+
context.commit('SORT_QUESTIONS', order);
|
997 |
+
}, function (error) {
|
998 |
+
console.log(error);
|
999 |
+
});
|
1000 |
+
},
|
1001 |
+
|
1002 |
+
updateQuestionTitle: function updateQuestionTitle(context, question) {
|
1003 |
+
|
1004 |
+
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
1005 |
+
|
1006 |
+
LP.Request({
|
1007 |
+
type: 'update-question-title',
|
1008 |
+
question: JSON.stringify(question)
|
1009 |
+
}).then(function () {
|
1010 |
+
context.commit('UPDATE_QUESTION_SUCCESS', question.id);
|
1011 |
+
}).catch(function () {
|
1012 |
+
context.commit('UPDATE_QUESTION_FAILURE', question.id);
|
1013 |
+
});
|
1014 |
+
},
|
1015 |
+
|
1016 |
+
changeQuestionType: function changeQuestionType(context, payload) {
|
1017 |
+
|
1018 |
+
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
1019 |
+
|
1020 |
+
LP.Request({
|
1021 |
+
type: 'change-question-type',
|
1022 |
+
question_id: payload.question_id,
|
1023 |
+
question_type: payload.type
|
1024 |
+
}).then(function (response) {
|
1025 |
+
var result = response.body;
|
1026 |
+
|
1027 |
+
if (result.success) {
|
1028 |
+
var question = result.data;
|
1029 |
+
context.commit('CHANGE_QUESTION_TYPE', question);
|
1030 |
+
context.commit('UPDATE_NEW_QUESTION_TYPE', question.type.key, { root: true });
|
1031 |
+
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
1032 |
+
}
|
1033 |
+
}).catch(function () {
|
1034 |
+
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
1035 |
+
});
|
1036 |
+
},
|
1037 |
+
|
1038 |
+
isHiddenQuestionsSettings: function isHiddenQuestionsSettings(context, id) {},
|
1039 |
+
|
1040 |
+
cloneQuestion: function cloneQuestion(context, question) {
|
1041 |
+
LP.Request({
|
1042 |
+
type: 'clone-question',
|
1043 |
+
question: JSON.stringify(question)
|
1044 |
+
}).then(function (response) {
|
1045 |
+
var result = response.body;
|
1046 |
+
|
1047 |
+
if (result.success) {
|
1048 |
+
var question = result.data;
|
1049 |
+
|
1050 |
+
context.commit('ADD_NEW_QUESTION', result.data);
|
1051 |
+
context.commit('UPDATE_NEW_QUESTION_TYPE', question.type.key, { root: true });
|
1052 |
+
}
|
1053 |
+
}, function (error) {
|
1054 |
+
console.log(error);
|
1055 |
+
});
|
1056 |
+
},
|
1057 |
+
|
1058 |
+
removeQuestion: function removeQuestion(context, question) {
|
1059 |
+
var question_id = question.id;
|
1060 |
+
question.temp_id = LP.uniqueId();
|
1061 |
+
context.commit('REMOVE_QUESTION', question);
|
1062 |
+
|
1063 |
+
LP.Request({
|
1064 |
+
type: 'remove-question',
|
1065 |
+
question_id: question_id
|
1066 |
+
}).then(function (response) {
|
1067 |
+
var result = response.body;
|
1068 |
+
|
1069 |
+
if (result.success) {
|
1070 |
+
question.id = question.temp_id;
|
1071 |
+
question.temp_id = 0;
|
1072 |
+
context.commit('REMOVE_QUESTION', question);
|
1073 |
+
}
|
1074 |
+
}, function (error) {
|
1075 |
+
console.error(error);
|
1076 |
+
});
|
1077 |
+
},
|
1078 |
+
|
1079 |
+
deleteQuestion: function deleteQuestion(context, question) {
|
1080 |
+
var question_id = question.id;
|
1081 |
+
question.temp_id = LP.uniqueId();
|
1082 |
+
context.commit('REMOVE_QUESTION', question);
|
1083 |
+
LP.Request({
|
1084 |
+
type: 'delete-question',
|
1085 |
+
question_id: question_id
|
1086 |
+
}).then(function () {
|
1087 |
+
question.id = question.temp_id;
|
1088 |
+
question.temp_id = 0;
|
1089 |
+
context.commit('REMOVE_QUESTION', question);
|
1090 |
+
context.commit('UPDATE_QUESTION_SUCCESS', question.id);
|
1091 |
+
}).catch(function () {
|
1092 |
+
context.commit('UPDATE_QUESTION_FAILURE', question.id);
|
1093 |
+
});
|
1094 |
+
},
|
1095 |
+
|
1096 |
+
toggleQuestion: function toggleQuestion(context, question) {
|
1097 |
+
if (question.open) {
|
1098 |
+
context.commit('CLOSE_QUESTION', question);
|
1099 |
+
} else {
|
1100 |
+
context.commit('OPEN_QUESTION', question);
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
LP.Request({
|
1104 |
+
type: 'hidden-questions',
|
1105 |
+
hidden: context.getters['hiddenQuestions']
|
1106 |
+
});
|
1107 |
+
},
|
1108 |
+
|
1109 |
+
updateQuestionAnswersOrder: function updateQuestionAnswersOrder(context, payload) {
|
1110 |
+
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
1111 |
+
|
1112 |
+
LP.Request({
|
1113 |
+
type: 'sort-question-answers',
|
1114 |
+
question_id: payload.question_id,
|
1115 |
+
order: JSON.stringify(payload.order)
|
1116 |
+
}).then(function (response) {
|
1117 |
+
var result = response.body,
|
1118 |
+
order = result.data;
|
1119 |
+
context.commit('SORT_QUESTION_ANSWERS', order);
|
1120 |
+
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
1121 |
+
}, function (error) {
|
1122 |
+
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
1123 |
+
console.log(error);
|
1124 |
+
});
|
1125 |
+
},
|
1126 |
+
|
1127 |
+
updateQuestionAnswerTitle: function updateQuestionAnswerTitle(context, payload) {
|
1128 |
+
|
1129 |
+
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
1130 |
+
|
1131 |
+
LP.Request({
|
1132 |
+
type: 'update-question-answer-title',
|
1133 |
+
question_id: parseInt(payload.question_id),
|
1134 |
+
answer: JSON.stringify(payload.answer)
|
1135 |
+
}).then(function () {
|
1136 |
+
context.commit('UPDATE_QUESTION_ANSWER_SUCCESS', parseInt(payload.question_id));
|
1137 |
+
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
1138 |
+
}).catch(function () {
|
1139 |
+
context.commit('UPDATE_QUESTION_ANSWER_FAILURE', parseInt(payload.question_id));
|
1140 |
+
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
1141 |
+
});
|
1142 |
+
},
|
1143 |
+
|
1144 |
+
updateQuestionCorrectAnswer: function updateQuestionCorrectAnswer(context, payload) {
|
1145 |
+
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
1146 |
+
|
1147 |
+
LP.Request({
|
1148 |
+
type: 'change-question-correct-answer',
|
1149 |
+
question_id: payload.question_id,
|
1150 |
+
correct: JSON.stringify(payload.correct)
|
1151 |
+
}).then(function (response) {
|
1152 |
+
var result = response.body;
|
1153 |
+
if (result.success) {
|
1154 |
+
context.commit('CHANGE_QUESTION_CORRECT_ANSWERS', result.data);
|
1155 |
+
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
1156 |
+
}
|
1157 |
+
}, function (error) {
|
1158 |
+
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
1159 |
+
console.log(error);
|
1160 |
+
});
|
1161 |
+
},
|
1162 |
+
|
1163 |
+
deleteQuestionAnswer: function deleteQuestionAnswer(context, payload) {
|
1164 |
+
payload.temp_id = LP.uniqueId();
|
1165 |
+
context.commit('DELETE_ANSWER', payload);
|
1166 |
+
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
1167 |
+
|
1168 |
+
LP.Request({
|
1169 |
+
type: 'delete-question-answer',
|
1170 |
+
question_id: payload.question_id,
|
1171 |
+
answer_id: payload.answer_id
|
1172 |
+
}).then(function (response) {
|
1173 |
+
var result = response.body;
|
1174 |
+
|
1175 |
+
if (result.success) {
|
1176 |
+
context.commit('DELETE_QUESTION_ANSWER', {
|
1177 |
+
question_id: payload.question_id,
|
1178 |
+
answer_id: payload.temp_id
|
1179 |
+
//answer_id: payload.answer_id
|
1180 |
+
});
|
1181 |
+
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
1182 |
+
}
|
1183 |
+
}, function (error) {
|
1184 |
+
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
1185 |
+
console.log(error);
|
1186 |
+
});
|
1187 |
+
},
|
1188 |
+
|
1189 |
+
newQuestionAnswer: function newQuestionAnswer(context, data) {
|
1190 |
+
var temp_id = LP.uniqueId(),
|
1191 |
+
question_id = data.question_id;
|
1192 |
+
context.commit('UPDATE_QUESTION_REQUEST', question_id);
|
1193 |
+
context.commit('ADD_QUESTION_ANSWER', {
|
1194 |
+
question_id: question_id,
|
1195 |
+
answer: { 'text': LP_Quiz_Store.getters['i18n/all'].new_option, 'question_answer_id': temp_id }
|
1196 |
+
});
|
1197 |
+
LP.Request({
|
1198 |
+
type: 'new-question-answer',
|
1199 |
+
question_id: question_id,
|
1200 |
+
question_answer_id: temp_id
|
1201 |
+
}).then(function (response) {
|
1202 |
+
var result = response.body;
|
1203 |
+
if (result.success) {
|
1204 |
+
var answer = result.data;
|
1205 |
+
context.commit('ADD_QUESTION_ANSWER', { question_id: question_id, answer: answer });
|
1206 |
+
context.commit('UPDATE_QUESTION_SUCCESS', question_id);
|
1207 |
+
|
1208 |
+
data.success && setTimeout(function () {
|
1209 |
+
data.success.apply(data.context, [answer]);
|
1210 |
+
}, 300);
|
1211 |
+
}
|
1212 |
+
}, function (error) {
|
1213 |
+
context.commit('UPDATE_QUESTION_FAILURE', question_id);
|
1214 |
+
console.error(error);
|
1215 |
+
});
|
1216 |
+
},
|
1217 |
+
|
1218 |
+
updateQuestionContent: function updateQuestionContent(context, question) {
|
1219 |
+
|
1220 |
+
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
1221 |
+
|
1222 |
+
LP.Request({
|
1223 |
+
type: 'update-question-content',
|
1224 |
+
question: JSON.stringify(question)
|
1225 |
+
}).then(function () {
|
1226 |
+
context.commit('UPDATE_QUESTION_SUCCESS', question.id);
|
1227 |
+
}).catch(function () {
|
1228 |
+
context.commit('UPDATE_QUESTION_FAILURE', question.id);
|
1229 |
+
});
|
1230 |
+
},
|
1231 |
+
|
1232 |
+
updateQuestionMeta: function updateQuestionMeta(context, payload) {
|
1233 |
+
|
1234 |
+
context.commit('UPDATE_QUESTION_REQUEST', payload.question.id);
|
1235 |
+
|
1236 |
+
LP.Request({
|
1237 |
+
type: 'update-question-meta',
|
1238 |
+
question: JSON.stringify(payload.question),
|
1239 |
+
meta_key: payload.meta_key
|
1240 |
+
}).then(function () {
|
1241 |
+
context.commit('UPDATE_QUESTION_SUCCESS', payload.question.id);
|
1242 |
+
}).catch(function () {
|
1243 |
+
context.commit('UPDATE_QUESTION_FAILURE', payload.question.id);
|
1244 |
+
});
|
1245 |
+
}
|
1246 |
+
};
|
1247 |
+
|
1248 |
+
exports.default = QuestionList;
|
1249 |
+
|
1250 |
+
/***/ })
|
1251 |
+
/******/ ]);
|
1252 |
+
//# sourceMappingURL=quiz.js.map
|
assets/js/admin/editor/quiz.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){function e(i){if(n[i])return n[i].exports;var u=n[i]={i:i,l:!1,exports:{}};return t[i].call(u.exports,u,u.exports,e),u.l=!0,u.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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=41)}([,,,,,,,,function(t,e,n){"use strict";function i(t){var e=window.jQuery,n=Vue.http;t=e.extend({ns:"LPRequest",store:!1},t||{});var i=null;LP.Request=function(u){return i=e("#publishing-action"),u.id=t.store.getters.id,u.nonce=t.store.getters.nonce,u["lp-ajax"]=t.store.getters.action,u.code=t.store.getters.code,i.find("#publish").addClass("disabled"),i.find(".spinner").addClass("is-active"),i.addClass("code-"+u.code),n.post(t.store.getters.urlAjax,u,{emulateJSON:!0,params:{namespace:t.ns,code:u.code}})},n.interceptors.push(function(e,n){if(e.params.namespace!==t.ns)return void n();t.store.dispatch("newRequest"),n(function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success?t.store.dispatch("requestCompleted","successful"):t.store.dispatch("requestCompleted","failed"),i.removeClass("code-"+e.params.code),i.attr("class")||(i.find("#publish").removeClass("disabled"),i.find(".spinner").removeClass("is-active"))})})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=window.jQuery,u=function(t){return{namespaced:!0,state:i.extend({},t),getters:{all:function(t){return t}}}};e.default=u},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var u=n(42),o=i(u),s=n(8),r=i(s);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,window.jQuery(document).ready(function(){window.LP_Quiz_Store=new $Vuex.Store((0,o.default)(lp_quiz_editor)),(0,r.default)({ns:"LPListQuizQuestionsRequest",store:LP_Quiz_Store}),setTimeout(function(){window.LP_Quiz_Editor=new $Vue({el:"#admin-editor-lp_quiz",template:"<lp-quiz-editor></lp-quiz-editor>"})},100)})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var u=n(43),o=i(u),s=n(44),r=i(s),c=n(45),d=i(c),a=n(46),_=i(a),E=n(12),f=i(E),m=n(50),S=i(m),T=window.jQuery,U=function(t){return{state:T.extend({status:"success",heartbeat:!0,countCurrentRequest:0},t.root),getters:o.default,mutations:r.default,actions:d.default,modules:{cqi:(0,_.default)(t),i18n:(0,f.default)(t.i18n),lqs:(0,S.default)(t)}}};e.default=U},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={heartbeat:function(t){return t.heartbeat},questionTypes:function(t){return t.types},defaultNewQuestionType:function(t){return t.default_new},action:function(t){return t.action},id:function(t){return t.quiz_id},status:function(t){return t.status||"error"},currentRequest:function(t){return t.countCurrentRequest||0},nonce:function(t){return t.nonce}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={UPDATE_HEART_BEAT:function(t,e){t.heartbeat=!!e},UPDATE_STATUS:function(t,e){t.status=e},UPDATE_NEW_QUESTION_TYPE:function(t,e){t.default_new=e},INCREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest--}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={heartbeat:function(t){LP.Request({type:"heartbeat"}).then(function(e){var n=e.body;t.commit("UPDATE_HEART_BEAT",!!n.success)},function(e){t.commit("UPDATE_HEART_BEAT",!1)})},newRequest:function(t){t.commit("INCREASE_NUMBER_REQUEST"),t.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(t,e){t.commit("DECREASE_NUMBER_REQUEST"),0===t.getters.currentRequest&&(t.commit("UPDATE_STATUS",e),window.onbeforeunload=null)}};e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var u=n(47),o=i(u),s=n(48),r=i(s),c=n(49),d=i(c),a=window.jQuery,_=function(t){return{namespaced:!0,state:a.extend({quizId:!1,pagination:"",status:""},t.chooseItems),getters:o.default,mutations:r.default,actions:d.default}};e.default=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={status:function(t){return t.status},pagination:function(t){return t.pagination},items:function(t,e){return t.items.map(function(t){var n=e.addedItems.find(function(e){return t.id===e.id});return t.added=!!n,t})},code:function(t){return Date.now()},addedItems:function(t){return t.addedItems},isOpen:function(t){return t.open},quiz:function(t){return t.quizId}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={TOGGLE:function(t){t.open=!t.open},SET_QUIZ:function(t,e){t.quizId=e},SET_LIST_ITEMS:function(t,e){t.items=e},ADD_ITEM:function(t,e){t.addedItems.push(e)},REMOVE_ADDED_ITEM:function(t,e){t.addedItems.forEach(function(n,i){n.id===e.id&&t.addedItems.splice(i,1)})},RESET:function(t){t.addedItems=[],t.items=[]},UPDATE_PAGINATION:function(t,e){t.pagination=e},SEARCH_ITEM_REQUEST:function(t){t.status="loading"},SEARCH_ITEM_SUCCESS:function(t){t.status="successful"},SEARCH_ITEM_FAIL:function(t){t.status="fail"}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={toggle:function(t){t.commit("TOGGLE")},open:function(t,e){t.commit("SET_QUIZ",e),t.commit("RESET"),t.commit("TOGGLE")},searchItems:function(t,e){t.commit("SEARCH_ITEM_REQUEST"),LP.Request({type:"search-items",query:e.query,page:e.page,exclude:JSON.stringify([])}).then(function(e){var n=e.body;if(n.success){var i=n.data;t.commit("SET_LIST_ITEMS",i.items),t.commit("UPDATE_PAGINATION",i.pagination),t.commit("SEARCH_ITEM_SUCCESS")}},function(e){t.commit("SEARCH_ITEMS_FAIL"),console.log(e)})},addItem:function(t,e){t.commit("ADD_ITEM",e)},removeItem:function(t,e){t.commit("REMOVE_ADDED_ITEM",e)},addQuestionsToQuiz:function(t,e){var n=t.getters.addedItems;n.length>0&&LP.Request({type:"add-questions-to-quiz",items:JSON.stringify(n),draft_quiz:JSON.stringify(e)}).then(function(e){var n=e.body;if(n.success){var i=n.data;t.commit("lqs/SET_QUESTIONS",i,{root:!0}),t.commit("TOGGLE")}},function(t){console.log(t)})}};e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var u=n(51),o=i(u),s=n(52),r=i(s),c=n(53),d=i(c),a=window.jQuery,_=function(t){var e=t.listQuestions;return{namespaced:!0,state:a.extend({statusUpdateQuestions:{},statusUpdateQuestionItem:{},statusUpdateQuestionAnswer:{},questions:e.questions.map(function(t){var n=e.hidden_questions,i=n.find(function(e){return parseInt(t.id)===parseInt(e)});return t.open=!i,t})},e),getters:o.default,mutations:r.default,actions:d.default}};e.default=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={listQuestions:function(t){return t.questions||[]},questionsOrder:function(t){return t.order||[]},externalComponent:function(t){return t.externalComponent||[]},hiddenQuestionsSettings:function(t){return t.hidden_questions_settings||[]},hiddenQuestions:function(t){return t.questions.filter(function(t){return!t.open}).map(function(t){return parseInt(t.id)})},isHiddenListQuestions:function(t,e){var n=e.listQuestions,i=e.hiddenQuestions;return n.length===i.length},disableUpdateList:function(t){return t.disableUpdateList},statusUpdateQuestions:function(t){return t.statusUpdateQuestions},statusUpdateQuestionItem:function(t){return t.statusUpdateQuestionItem},statusUpdateQuestionAnswer:function(t){return t.statusUpdateQuestionAnswer}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={SORT_QUESTIONS:function(t,e){t.questions=t.questions.map(function(t){return t.order=e[t.id],t})},SORT_QUESTION_ANSWERS:function(t,e){t.questions=t.questions.map(function(t){return t.answers.answer_order=e[t.answers.question_answer_id],t})},ADD_QUESTION_ANSWER:function(t,e){t.questions=t.questions.map(function(t){if(t.id===e.question_id){var n=!1;if(e.answer.temp_id)for(var i=0,u=t.answers.length;i<u;i++)t.answers[i].question_answer_id==e.answer.temp_id&&(n=!0,$Vue.set(t.answers,i,e.answer));return!n&&t.answers.push(e.answer),t}return t})},CHANGE_QUESTION_CORRECT_ANSWERS:function(t,e){t.questions=t.questions.map(function(t){return parseInt(t.id)===e.id&&(t.answers=e.answers),t})},SET_QUESTIONS:function(t,e){t.questions=e},ADD_NEW_QUESTION:function(t,e){var n=!1;if(e.temp_id)for(var i=0,u=t.questions.length;i<u;i++)if(t.questions[i].id===e.temp_id){$Vue.set(t.questions,i,e),n=!0;break}if(!n){var o=$(".lp-list-questions .main > div:last-child");if(o.length){var s=o.offset().top;$("html,body").animate({scrollTop:s})}t.questions.push(e)}},CHANGE_QUESTION_TYPE:function(t,e){t.questions=t.questions.map(function(t){return parseInt(t.id)===e.id&&(t.answers=e.answers,t.type=e.type,t.open=!0),t})},REMOVE_QUESTION:function(t,e){var n=t.questions,i=n.indexOf(e);e.temp_id?t.questions[i].id=e.temp_id:t.questions.splice(i,1)},DELETE_QUESTION_ANSWER:function(t,e){var n=e.question_id,i=e.answer_id;t.questions=t.questions.map(function(t){if(t.id===n){var e=t.answers;e.forEach(function(t){if(t.question_answer_id===i){var n=e.indexOf(t);e.splice(n,1)}})}return t})},REMOVE_QUESTIONS:function(){},CLOSE_QUESTION:function(t,e){t.questions.forEach(function(n,i){e.id===n.id&&(t.questions[i].open=!1)})},OPEN_QUESTION:function(t,e){t.questions.forEach(function(n,i){e.id===n.id&&(t.questions[i].open=!0)})},CLOSE_LIST_QUESTIONS:function(t){t.questions=t.questions.map(function(t){return t.open=!1,t})},OPEN_LIST_QUESTIONS:function(t){t.questions=t.questions.map(function(t){return t.open=!0,t})},UPDATE_QUESTION_REQUEST:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"updating")},UPDATE_QUESTION_SUCCESS:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"successful")},UPDATE_QUESTION_FAILURE:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"failed")},UPDATE_QUESTION_ANSWER_REQUEST:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"updating")},UPDATE_QUESTION_ANSWER_SUCCESS:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"successful")},UPDATE_QUESTION_ANSWER_FAIL:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"failed")},DELETE_ANSWER:function(t,e){console.log("A"),t.questions.map(function(t,n){if(t.id==e.question_id){for(var i=0,u=t.answers.length;i<u;i++)if(t.answers[i].question_answer_id==e.answer_id){t.answers[i].question_answer_id=e.temp_id;break}return!1}})}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={toggleAll:function(t){t.getters.isHiddenListQuestions?t.commit("OPEN_LIST_QUESTIONS"):t.commit("CLOSE_LIST_QUESTIONS"),LP.Request({type:"hidden-questions",hidden:t.getters.hiddenQuestions})},updateQuizQuestionsHidden:function(t,e){LP.Request($.extend({},e,{type:"update-quiz-questions-hidden"}))},newQuestion:function(t,e){var n=JSON.parse(JSON.stringify(e.question));n.settings={},t.commit("ADD_NEW_QUESTION",n),LP.Request({type:"new-question",question:JSON.stringify(e.question),draft_quiz:JSON.stringify(e.quiz)}).then(function(n){var i=n.body;i.success&&(t.commit("UPDATE_NEW_QUESTION_TYPE",e.question.type,{root:!0}),t.commit("ADD_NEW_QUESTION",i.data),t.commit("CLOSE_LIST_QUESTIONS"),t.commit("OPEN_QUESTION",i.data))},function(t){console.log(t)})},updateQuestionsOrder:function(t,e){LP.Request({type:"sort-questions",order:JSON.stringify(e)}).then(function(n){t.commit("SORT_QUESTIONS",e)},function(t){console.log(t)})},updateQuestionTitle:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.id),LP.Request({type:"update-question-title",question:JSON.stringify(e)}).then(function(){t.commit("UPDATE_QUESTION_SUCCESS",e.id)}).catch(function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)})},changeQuestionType:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"change-question-type",question_id:e.question_id,question_type:e.type}).then(function(n){var i=n.body;if(i.success){var u=i.data;t.commit("CHANGE_QUESTION_TYPE",u),t.commit("UPDATE_NEW_QUESTION_TYPE",u.type.key,{root:!0}),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)}}).catch(function(){t.commit("UPDATE_QUESTION_FAILURE",e.question_id)})},isHiddenQuestionsSettings:function(t,e){},cloneQuestion:function(t,e){LP.Request({type:"clone-question",question:JSON.stringify(e)}).then(function(e){var n=e.body;if(n.success){var i=n.data;t.commit("ADD_NEW_QUESTION",n.data),t.commit("UPDATE_NEW_QUESTION_TYPE",i.type.key,{root:!0})}},function(t){console.log(t)})},removeQuestion:function(t,e){var n=e.id;e.temp_id=LP.uniqueId(),t.commit("REMOVE_QUESTION",e),LP.Request({type:"remove-question",question_id:n}).then(function(n){n.body.success&&(e.id=e.temp_id,e.temp_id=0,t.commit("REMOVE_QUESTION",e))},function(t){console.error(t)})},deleteQuestion:function(t,e){var n=e.id;e.temp_id=LP.uniqueId(),t.commit("REMOVE_QUESTION",e),LP.Request({type:"delete-question",question_id:n}).then(function(){e.id=e.temp_id,e.temp_id=0,t.commit("REMOVE_QUESTION",e),t.commit("UPDATE_QUESTION_SUCCESS",e.id)}).catch(function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)})},toggleQuestion:function(t,e){e.open?t.commit("CLOSE_QUESTION",e):t.commit("OPEN_QUESTION",e),LP.Request({type:"hidden-questions",hidden:t.getters.hiddenQuestions})},updateQuestionAnswersOrder:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"sort-question-answers",question_id:e.question_id,order:JSON.stringify(e.order)}).then(function(n){var i=n.body,u=i.data;t.commit("SORT_QUESTION_ANSWERS",u),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)},function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)})},updateQuestionAnswerTitle:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"update-question-answer-title",question_id:parseInt(e.question_id),answer:JSON.stringify(e.answer)}).then(function(){t.commit("UPDATE_QUESTION_ANSWER_SUCCESS",parseInt(e.question_id)),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)}).catch(function(){t.commit("UPDATE_QUESTION_ANSWER_FAILURE",parseInt(e.question_id)),t.commit("UPDATE_QUESTION_FAILURE",e.question_id)})},updateQuestionCorrectAnswer:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"change-question-correct-answer",question_id:e.question_id,correct:JSON.stringify(e.correct)}).then(function(n){var i=n.body;i.success&&(t.commit("CHANGE_QUESTION_CORRECT_ANSWERS",i.data),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id))},function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)})},deleteQuestionAnswer:function(t,e){e.temp_id=LP.uniqueId(),t.commit("DELETE_ANSWER",e),t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"delete-question-answer",question_id:e.question_id,answer_id:e.answer_id}).then(function(n){n.body.success&&(t.commit("DELETE_QUESTION_ANSWER",{question_id:e.question_id,answer_id:e.temp_id}),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id))},function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)})},newQuestionAnswer:function(t,e){var n=LP.uniqueId(),i=e.question_id;t.commit("UPDATE_QUESTION_REQUEST",i),t.commit("ADD_QUESTION_ANSWER",{question_id:i,answer:{text:LP_Quiz_Store.getters["i18n/all"].new_option,question_answer_id:n}}),LP.Request({type:"new-question-answer",question_id:i,question_answer_id:n}).then(function(n){var u=n.body;if(u.success){var o=u.data;t.commit("ADD_QUESTION_ANSWER",{question_id:i,answer:o}),t.commit("UPDATE_QUESTION_SUCCESS",i),e.success&&setTimeout(function(){e.success.apply(e.context,[o])},300)}},function(e){t.commit("UPDATE_QUESTION_FAILURE",i),console.error(e)})},updateQuestionContent:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.id),LP.Request({type:"update-question-content",question:JSON.stringify(e)}).then(function(){t.commit("UPDATE_QUESTION_SUCCESS",e.id)}).catch(function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)})},updateQuestionMeta:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question.id),LP.Request({type:"update-question-meta",question:JSON.stringify(e.question),meta_key:e.meta_key}).then(function(){t.commit("UPDATE_QUESTION_SUCCESS",e.question.id)}).catch(function(){t.commit("UPDATE_QUESTION_FAILURE",e.question.id)})}};e.default=i}]);
|
assets/js/admin/index.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?php // Silence is golden.
|
|
assets/js/admin/learnpress.js
ADDED
@@ -0,0 +1,1071 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 16);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 16:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
var _tools = __webpack_require__(17);
|
75 |
+
|
76 |
+
var _tools2 = _interopRequireDefault(_tools);
|
77 |
+
|
78 |
+
var _statistic = __webpack_require__(9);
|
79 |
+
|
80 |
+
var _statistic2 = _interopRequireDefault(_statistic);
|
81 |
+
|
82 |
+
var _syncData = __webpack_require__(18);
|
83 |
+
|
84 |
+
var _syncData2 = _interopRequireDefault(_syncData);
|
85 |
+
|
86 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
87 |
+
|
88 |
+
var $ = jQuery; // Include;
|
89 |
+
|
90 |
+
var $doc = $(document);
|
91 |
+
var $win = $(window);
|
92 |
+
|
93 |
+
var makePaymentsSortable = function makePaymentsSortable() {
|
94 |
+
// Make payments sortable
|
95 |
+
$('.learn-press-payments.sortable tbody').sortable({
|
96 |
+
handle: '.dashicons-menu',
|
97 |
+
helper: function helper(e, ui) {
|
98 |
+
ui.children().each(function () {
|
99 |
+
$(this).width($(this).width());
|
100 |
+
});
|
101 |
+
return ui;
|
102 |
+
},
|
103 |
+
axis: 'y',
|
104 |
+
start: function start(event, ui) {},
|
105 |
+
stop: function stop(event, ui) {},
|
106 |
+
update: function update(event, ui) {
|
107 |
+
|
108 |
+
var order = $(this).children().map(function () {
|
109 |
+
return $(this).find('input[name="payment-order"]').val();
|
110 |
+
}).get();
|
111 |
+
|
112 |
+
$.post({
|
113 |
+
url: '',
|
114 |
+
data: {
|
115 |
+
'lp-ajax': 'update-payment-order',
|
116 |
+
order: order
|
117 |
+
},
|
118 |
+
success: function success(response) {}
|
119 |
+
});
|
120 |
+
}
|
121 |
+
});
|
122 |
+
};
|
123 |
+
|
124 |
+
var initTooltips = function initTooltips() {
|
125 |
+
$('.learn-press-tooltip').each(function () {
|
126 |
+
var $el = $(this),
|
127 |
+
args = $.extend({ title: 'data-tooltip', offset: 10, gravity: 's' }, $el.data());
|
128 |
+
$el.tipsy(args);
|
129 |
+
});
|
130 |
+
};
|
131 |
+
|
132 |
+
var initSelect2 = function initSelect2() {
|
133 |
+
if ($.fn.select2) {
|
134 |
+
$('.lp-select-2 select').select2();
|
135 |
+
}
|
136 |
+
};
|
137 |
+
|
138 |
+
var initSingleCoursePermalink = function initSingleCoursePermalink() {
|
139 |
+
$doc.on('change', '.learn-press-single-course-permalink input[type="radio"]', function () {
|
140 |
+
var $check = $(this),
|
141 |
+
$row = $check.closest('.learn-press-single-course-permalink');
|
142 |
+
if ($row.hasClass('custom-base')) {
|
143 |
+
$row.find('input[type="text"]').prop('readonly', false);
|
144 |
+
} else {
|
145 |
+
$row.siblings('.custom-base').find('input[type="text"]').prop('readonly', true);
|
146 |
+
}
|
147 |
+
}).on('change', 'input.learn-press-course-base', function () {
|
148 |
+
$('#course_permalink_structure').val($(this).val());
|
149 |
+
}).on('focus', '#course_permalink_structure', function () {
|
150 |
+
$('#learn_press_custom_permalink').click();
|
151 |
+
}).on('change', '#learn_press_courses_page_id', function () {
|
152 |
+
$('tr.learn-press-courses-page-id').toggleClass('hide-if-js', !parseInt(this.value));
|
153 |
+
});
|
154 |
+
};
|
155 |
+
|
156 |
+
var togglePaymentStatus = function togglePaymentStatus(e) {
|
157 |
+
e.preventDefault();
|
158 |
+
var $row = $(this).closest('tr'),
|
159 |
+
$button = $(this),
|
160 |
+
status = $row.find('.status').hasClass('enabled') ? 'no' : 'yes';
|
161 |
+
|
162 |
+
$.ajax({
|
163 |
+
url: '',
|
164 |
+
data: {
|
165 |
+
'lp-ajax': 'update-payment-status',
|
166 |
+
status: status,
|
167 |
+
id: $row.data('payment')
|
168 |
+
},
|
169 |
+
success: function success(response) {
|
170 |
+
response = LP.parseJSON(response);
|
171 |
+
for (var i in response) {
|
172 |
+
$('#payment-' + i + ' .status').toggleClass('enabled', response[i]);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
});
|
176 |
+
};
|
177 |
+
|
178 |
+
var updateEmailStatus = function updateEmailStatus() {
|
179 |
+
(function () {
|
180 |
+
$.post({
|
181 |
+
url: window.location.href,
|
182 |
+
data: {
|
183 |
+
'lp-ajax': 'update_email_status',
|
184 |
+
status: $(this).parent().hasClass('enabled') ? 'no' : 'yes',
|
185 |
+
id: $(this).data('id')
|
186 |
+
},
|
187 |
+
dataType: 'text',
|
188 |
+
success: $.proxy(function (res) {
|
189 |
+
res = LP.parseJSON(res);
|
190 |
+
for (var i in res) {
|
191 |
+
$('#email-' + i + ' .status').toggleClass('enabled', res[i]);
|
192 |
+
}
|
193 |
+
}, this)
|
194 |
+
});
|
195 |
+
}).apply(this);
|
196 |
+
};
|
197 |
+
|
198 |
+
var toggleSalePriceSchedule = function toggleSalePriceSchedule() {
|
199 |
+
var $el = $(this),
|
200 |
+
id = $el.attr('id');
|
201 |
+
|
202 |
+
if (id === '_lp_sale_price_schedule') {
|
203 |
+
$(this).hide();
|
204 |
+
$('#field-_lp_sale_start, #field-_lp_sale_end').removeClass('hide-if-js');
|
205 |
+
$win.trigger('resize.calculate-tab');
|
206 |
+
} else {
|
207 |
+
$('#_lp_sale_price_schedule').show();
|
208 |
+
$('#field-_lp_sale_start, #field-_lp_sale_end').addClass('hide-if-js').find('#_lp_sale_start, #_lp_sale_end').val('');
|
209 |
+
$win.trigger('resize.calculate-tab');
|
210 |
+
}
|
211 |
+
|
212 |
+
return false;
|
213 |
+
};
|
214 |
+
|
215 |
+
var callbackFilterTemplates = function callbackFilterTemplates() {
|
216 |
+
var $link = $(this);
|
217 |
+
|
218 |
+
if ($link.hasClass('current')) {
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
|
222 |
+
var $templatesList = $('#learn-press-template-files'),
|
223 |
+
$templates = $templatesList.find('tr[data-template]'),
|
224 |
+
template = $link.data('template'),
|
225 |
+
filter = $link.data('filter');
|
226 |
+
|
227 |
+
$link.addClass('current').siblings('a').removeClass('current');
|
228 |
+
|
229 |
+
if (!template) {
|
230 |
+
|
231 |
+
if (!filter) {
|
232 |
+
$templates.removeClass('hide-if-js');
|
233 |
+
} else {
|
234 |
+
$templates.map(function () {
|
235 |
+
$(this).toggleClass('hide-if-js', $(this).data('filter-' + filter) !== 'yes');
|
236 |
+
});
|
237 |
+
}
|
238 |
+
} else {
|
239 |
+
$templates.map(function () {
|
240 |
+
$(this).toggleClass('hide-if-js', $(this).data('template') !== template);
|
241 |
+
});
|
242 |
+
}
|
243 |
+
|
244 |
+
$('#learn-press-no-templates').toggleClass('hide-if-js', !!$templatesList.find('tr.template-row:not(.hide-if-js):first').length);
|
245 |
+
|
246 |
+
return false;
|
247 |
+
};
|
248 |
+
|
249 |
+
var toggleEmails = function toggleEmails(e) {
|
250 |
+
e.preventDefault();
|
251 |
+
var $button = $(this),
|
252 |
+
status = $button.data('status');
|
253 |
+
|
254 |
+
$.ajax({
|
255 |
+
url: '',
|
256 |
+
data: {
|
257 |
+
'lp-ajax': 'update_email_status',
|
258 |
+
status: status
|
259 |
+
},
|
260 |
+
success: function success(response) {
|
261 |
+
response = LP.parseJSON(response);
|
262 |
+
for (var i in response) {
|
263 |
+
$('#email-' + i + ' .status').toggleClass('enabled', response[i]);
|
264 |
+
}
|
265 |
+
}
|
266 |
+
});
|
267 |
+
};
|
268 |
+
|
269 |
+
var duplicatePost = function duplicatePost(e) {
|
270 |
+
e.preventDefault();
|
271 |
+
|
272 |
+
var _self = $(this),
|
273 |
+
_id = _self.data('post-id');
|
274 |
+
|
275 |
+
$.ajax({
|
276 |
+
url: '',
|
277 |
+
data: {
|
278 |
+
'lp-ajax': 'duplicator',
|
279 |
+
id: _id
|
280 |
+
},
|
281 |
+
success: function success(response) {
|
282 |
+
response = LP.parseJSON(response);
|
283 |
+
|
284 |
+
if (response.success) {
|
285 |
+
window.location.href = response.data;
|
286 |
+
} else {
|
287 |
+
alert(response.data);
|
288 |
+
}
|
289 |
+
}
|
290 |
+
});
|
291 |
+
};
|
292 |
+
|
293 |
+
var importCourses = function importCourses() {
|
294 |
+
var $container = $('#learn-press-install-sample-data-notice'),
|
295 |
+
action = $(this).attr('data-action');
|
296 |
+
if (!action) {
|
297 |
+
return;
|
298 |
+
}
|
299 |
+
e.preventDefault();
|
300 |
+
|
301 |
+
if (action === 'yes') {
|
302 |
+
$container.find('.install-sample-data-notice').slideUp().siblings('.install-sample-data-loading').slideDown();
|
303 |
+
} else {
|
304 |
+
$container.fadeOut();
|
305 |
+
}
|
306 |
+
$.ajax({
|
307 |
+
url: ajaxurl,
|
308 |
+
dataType: 'html',
|
309 |
+
type: 'post',
|
310 |
+
data: {
|
311 |
+
action: 'learnpress_install_sample_data',
|
312 |
+
yes: action
|
313 |
+
},
|
314 |
+
success: function success(response) {
|
315 |
+
response = LP.parseJSON(response);
|
316 |
+
if (response.url) {
|
317 |
+
$.ajax({
|
318 |
+
url: response.url,
|
319 |
+
success: function success() {
|
320 |
+
$container.find('.install-sample-data-notice').html(response.message).slideDown().siblings('.install-sample-data-loading').slideUp();
|
321 |
+
}
|
322 |
+
});
|
323 |
+
} else {
|
324 |
+
$container.find('.install-sample-data-notice').html(response.message).slideDown().siblings('.install-sample-data-loading').slideUp();
|
325 |
+
}
|
326 |
+
}
|
327 |
+
});
|
328 |
+
};
|
329 |
+
|
330 |
+
var onChangeCoursePrices = function onChangeCoursePrices(e) {
|
331 |
+
var _self = $(this),
|
332 |
+
_price = $('#_lp_price'),
|
333 |
+
_sale_price = $('#_lp_sale_price'),
|
334 |
+
_target = $(e.target).attr('id');
|
335 |
+
_self.find('#field-_lp_price div, #field-_lp_sale_price div').remove('.learn-press-tip-floating');
|
336 |
+
if (parseInt(_sale_price.val()) >= parseInt(_price.val())) {
|
337 |
+
if (_target === '_lp_price') {
|
338 |
+
_price.parent('.rwmb-input').append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_price + '</div>');
|
339 |
+
} else if (_target === '_lp_sale_price') {
|
340 |
+
_sale_price.parent('.rwmb-input').append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_price + '</div>');
|
341 |
+
}
|
342 |
+
}
|
343 |
+
};
|
344 |
+
|
345 |
+
var onChangeSaleStartDate = function onChangeSaleStartDate(e) {
|
346 |
+
var _sale_start_date = $(this),
|
347 |
+
_sale_end_date = $('#_lp_sale_end'),
|
348 |
+
_start_date = Date.parse(_sale_start_date.val()),
|
349 |
+
_end_date = Date.parse(_sale_end_date.val()),
|
350 |
+
_parent_start = _sale_start_date.parent('.rwmb-input'),
|
351 |
+
_parent_end = _sale_end_date.parent('.rwmb-input');
|
352 |
+
|
353 |
+
if (!_start_date) {
|
354 |
+
_parent_start.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_invalid_date + '</div>');
|
355 |
+
}
|
356 |
+
|
357 |
+
$('#field-_lp_sale_start div, #field-_lp_sale_end div').remove('.learn-press-tip-floating');
|
358 |
+
|
359 |
+
if (_start_date > _end_date) {
|
360 |
+
_parent_start.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_start_date + '</div>');
|
361 |
+
}
|
362 |
+
};
|
363 |
+
|
364 |
+
var onChangeSaleEndDate = function onChangeSaleEndDate(e) {
|
365 |
+
var _sale_end_date = $(this),
|
366 |
+
_sale_start_date = $('#_lp_sale_start'),
|
367 |
+
_start_date = Date.parse(_sale_start_date.val()),
|
368 |
+
_end_date = Date.parse(_sale_end_date.val()),
|
369 |
+
_parent_start = _sale_start_date.parent('.rwmb-input'),
|
370 |
+
_parent_end = _sale_end_date.parent('.rwmb-input');
|
371 |
+
|
372 |
+
if (!_end_date) {
|
373 |
+
_parent_end.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_invalid_date + '</div>');
|
374 |
+
}
|
375 |
+
|
376 |
+
$('#field-_lp_sale_start div, #field-_lp_sale_end div').remove('.learn-press-tip-floating');
|
377 |
+
if (_start_date > _end_date) {
|
378 |
+
_parent_end.append('<div class="learn-press-tip-floating">' + lpAdminCourseEditorSettings.i18n.notice_sale_end_date + '</div>');
|
379 |
+
}
|
380 |
+
};
|
381 |
+
|
382 |
+
var onReady = function onReady() {
|
383 |
+
makePaymentsSortable();
|
384 |
+
initSelect2();
|
385 |
+
initTooltips();
|
386 |
+
initSingleCoursePermalink();
|
387 |
+
|
388 |
+
$('.learn-press-tabs').LP('AdminTab');
|
389 |
+
|
390 |
+
$(document).on('click', '.learn-press-payments .status .dashicons', togglePaymentStatus).on('click', '.change-email-status', updateEmailStatus).on('click', '#_lp_sale_price_schedule', toggleSalePriceSchedule).on('click', '#_lp_sale_price_schedule_cancel', toggleSalePriceSchedule).on('click', '.learn-press-filter-template', callbackFilterTemplates).on('click', '#learn-press-enable-emails, #learn-press-disable-emails', toggleEmails).on('click', '.lp-duplicate-row-action .lp-duplicate-post', duplicatePost).on('click', '#learn-press-install-sample-data-notice a', importCourses).on('input', '#meta-box-tab-course_payment', onChangeCoursePrices).on('change', '#_lp_sale_start', onChangeSaleStartDate).on('change', '#_lp_sale_end', onChangeSaleEndDate);
|
391 |
+
};
|
392 |
+
|
393 |
+
$(document).ready(onReady);
|
394 |
+
|
395 |
+
/***/ }),
|
396 |
+
|
397 |
+
/***/ 17:
|
398 |
+
/***/ (function(module, exports, __webpack_require__) {
|
399 |
+
|
400 |
+
"use strict";
|
401 |
+
|
402 |
+
|
403 |
+
;(function ($) {
|
404 |
+
|
405 |
+
var $doc = $(document),
|
406 |
+
isRunning = false;
|
407 |
+
|
408 |
+
var installSampleCourse = function installSampleCourse(e) {
|
409 |
+
e.preventDefault();
|
410 |
+
|
411 |
+
var $button = $(this);
|
412 |
+
|
413 |
+
if (isRunning) {
|
414 |
+
return;
|
415 |
+
}
|
416 |
+
|
417 |
+
if (!confirm(lpGlobalSettings.i18n.confirm_install_sample_data)) {
|
418 |
+
return;
|
419 |
+
}
|
420 |
+
|
421 |
+
$button.addClass('disabled').html($button.data('installing-text'));
|
422 |
+
$('.lp-install-sample-data-response').remove();
|
423 |
+
isRunning = true;
|
424 |
+
$.ajax({
|
425 |
+
url: $button.attr('href'),
|
426 |
+
data: $('.lp-install-sample-data-options').serializeJSON(),
|
427 |
+
success: function success(response) {
|
428 |
+
$button.removeClass('disabled').html($button.data('text'));
|
429 |
+
isRunning = false;
|
430 |
+
$(response).insertBefore($button.parent());
|
431 |
+
},
|
432 |
+
error: function error() {
|
433 |
+
$button.removeClass('disabled').html($button.data('text'));
|
434 |
+
isRunning = false;
|
435 |
+
}
|
436 |
+
});
|
437 |
+
};
|
438 |
+
|
439 |
+
var uninstallSampleCourse = function uninstallSampleCourse(e) {
|
440 |
+
e.preventDefault();
|
441 |
+
|
442 |
+
var $button = $(this);
|
443 |
+
|
444 |
+
if (isRunning) {
|
445 |
+
return;
|
446 |
+
}
|
447 |
+
|
448 |
+
if (!confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)) {
|
449 |
+
return;
|
450 |
+
}
|
451 |
+
|
452 |
+
$button.addClass('disabled').html($button.data('uninstalling-text'));
|
453 |
+
isRunning = true;
|
454 |
+
$.ajax({
|
455 |
+
url: $button.attr('href'),
|
456 |
+
success: function success(response) {
|
457 |
+
$button.removeClass('disabled').html($button.data('text'));
|
458 |
+
isRunning = false;
|
459 |
+
},
|
460 |
+
error: function error() {
|
461 |
+
$button.removeClass('disabled').html($button.data('text'));
|
462 |
+
isRunning = false;
|
463 |
+
}
|
464 |
+
});
|
465 |
+
};
|
466 |
+
|
467 |
+
var clearHardCache = function clearHardCache(e) {
|
468 |
+
e.preventDefault();
|
469 |
+
var $button = $(this);
|
470 |
+
|
471 |
+
if ($button.hasClass('disabled')) {
|
472 |
+
return;
|
473 |
+
}
|
474 |
+
|
475 |
+
$button.addClass('disabled').html($button.data('cleaning-text'));
|
476 |
+
$.ajax({
|
477 |
+
url: $button.attr('href'),
|
478 |
+
data: {},
|
479 |
+
success: function success(response) {
|
480 |
+
$button.removeClass('disabled').html($button.data('text'));
|
481 |
+
},
|
482 |
+
error: function error() {
|
483 |
+
$button.removeClass('disabled').html($button.data('text'));
|
484 |
+
}
|
485 |
+
});
|
486 |
+
};
|
487 |
+
|
488 |
+
var toggleHardCache = function toggleHardCache() {
|
489 |
+
$.ajax({
|
490 |
+
url: 'admin.php?page=lp-toggle-hard-cache-option',
|
491 |
+
data: { v: this.checked ? 'yes' : 'no' },
|
492 |
+
success: function success(response) {},
|
493 |
+
error: function error() {}
|
494 |
+
});
|
495 |
+
};
|
496 |
+
|
497 |
+
var toggleOptions = function toggleOptions(e) {
|
498 |
+
e.preventDefault();
|
499 |
+
$('.lp-install-sample-data-options').toggleClass('hide-if-js');
|
500 |
+
};
|
501 |
+
|
502 |
+
$doc.on('click', '#learn-press-install-sample-data', installSampleCourse).on('click', '#learn-press-uninstall-sample-data', uninstallSampleCourse).on('click', '#learn-press-clear-cache', clearHardCache).on('click', 'input[name="enable_hard_cache"]', toggleHardCache).on('click', '#learn-press-install-sample-data-options', toggleOptions);
|
503 |
+
})(jQuery);
|
504 |
+
|
505 |
+
/***/ }),
|
506 |
+
|
507 |
+
/***/ 18:
|
508 |
+
/***/ (function(module, exports, __webpack_require__) {
|
509 |
+
|
510 |
+
"use strict";
|
511 |
+
|
512 |
+
|
513 |
+
;(function ($) {
|
514 |
+
var Sync_Base = {
|
515 |
+
id: 'sync-base',
|
516 |
+
syncing: false,
|
517 |
+
items: false,
|
518 |
+
completed: false,
|
519 |
+
callback: null,
|
520 |
+
methodGetItems: '',
|
521 |
+
itemsKey: '',
|
522 |
+
chunkSize: 50,
|
523 |
+
sync: function sync(callback) {
|
524 |
+
if (this.syncing) {
|
525 |
+
return;
|
526 |
+
}
|
527 |
+
|
528 |
+
this.callback = callback;
|
529 |
+
|
530 |
+
if (this.items === false) {
|
531 |
+
this.get_items();
|
532 |
+
} else {
|
533 |
+
if (!this.dispatch()) {
|
534 |
+
this.completed = true;
|
535 |
+
this.callToCallback();
|
536 |
+
return;
|
537 |
+
}
|
538 |
+
}
|
539 |
+
|
540 |
+
this.syncing = true;
|
541 |
+
},
|
542 |
+
init: function init() {
|
543 |
+
this.syncing = false;
|
544 |
+
this.items = false;
|
545 |
+
this.completed = false;
|
546 |
+
},
|
547 |
+
is_completed: function is_completed() {
|
548 |
+
return this.completed;
|
549 |
+
},
|
550 |
+
dispatch: function dispatch() {
|
551 |
+
var that = this,
|
552 |
+
items = this.items ? this.items.splice(0, this.chunkSize) : false;
|
553 |
+
if (!items || items.length === 0) {
|
554 |
+
return false;
|
555 |
+
}
|
556 |
+
$.ajax({
|
557 |
+
url: '',
|
558 |
+
data: {
|
559 |
+
'lp-ajax': this.id,
|
560 |
+
sync: items
|
561 |
+
},
|
562 |
+
method: 'post',
|
563 |
+
success: function success(response) {
|
564 |
+
response = LP.parseJSON(response);
|
565 |
+
that.syncing = false;
|
566 |
+
if (response.result !== 'success') {
|
567 |
+
that.completed = true;
|
568 |
+
}
|
569 |
+
that.callToCallback();
|
570 |
+
if (that.is_completed()) {
|
571 |
+
return;
|
572 |
+
}
|
573 |
+
|
574 |
+
that.sync(that.callback);
|
575 |
+
}
|
576 |
+
});
|
577 |
+
|
578 |
+
return true;
|
579 |
+
},
|
580 |
+
callToCallback: function callToCallback() {
|
581 |
+
this.callback && this.callback.call(this);
|
582 |
+
},
|
583 |
+
get_items: function get_items() {
|
584 |
+
var that = this;
|
585 |
+
$.ajax({
|
586 |
+
url: '',
|
587 |
+
data: {
|
588 |
+
'lp-ajax': this.id,
|
589 |
+
sync: this.methodGetItems
|
590 |
+
},
|
591 |
+
success: function success(response) {
|
592 |
+
that.syncing = false;
|
593 |
+
response = LP.parseJSON(response);
|
594 |
+
if (response[that.itemsKey]) {
|
595 |
+
that.items = response[that.itemsKey];
|
596 |
+
that.sync(that.callback);
|
597 |
+
} else {
|
598 |
+
that.completed = true;
|
599 |
+
that.items = [];
|
600 |
+
that.callToCallback();
|
601 |
+
}
|
602 |
+
}
|
603 |
+
});
|
604 |
+
}
|
605 |
+
};
|
606 |
+
|
607 |
+
var Sync_Course_Orders = $.extend({}, Sync_Base, {
|
608 |
+
id: 'sync-course-orders',
|
609 |
+
methodGetItems: 'get-courses',
|
610 |
+
itemsKey: 'courses'
|
611 |
+
});
|
612 |
+
|
613 |
+
var Sync_User_Courses = $.extend({}, Sync_Base, {
|
614 |
+
id: 'sync-user-courses',
|
615 |
+
methodGetItems: 'get-users',
|
616 |
+
itemsKey: 'users',
|
617 |
+
chunkSize: 500
|
618 |
+
});
|
619 |
+
|
620 |
+
var Sync_User_Orders = $.extend({}, Sync_Base, {
|
621 |
+
id: 'sync-user-orders',
|
622 |
+
methodGetItems: 'get-users',
|
623 |
+
itemsKey: 'users',
|
624 |
+
chunkSize: 500
|
625 |
+
});
|
626 |
+
|
627 |
+
var Sync_Course_Final_Quiz = $.extend({}, Sync_Base, {
|
628 |
+
id: 'sync-course-final-quiz',
|
629 |
+
methodGetItems: 'get-courses',
|
630 |
+
itemsKey: 'courses',
|
631 |
+
chunkSize: 500
|
632 |
+
});
|
633 |
+
|
634 |
+
var Sync_Remove_Older_Data = $.extend({}, Sync_Base, {
|
635 |
+
id: 'sync-remove-older-data',
|
636 |
+
methodGetItems: 'remove-older-data',
|
637 |
+
itemsKey: '_nothing_here',
|
638 |
+
chunkSize: 500
|
639 |
+
});
|
640 |
+
|
641 |
+
var Sync_Calculate_Course_Results = $.extend({}, Sync_Base, {
|
642 |
+
id: 'sync-calculate-course-results',
|
643 |
+
methodGetItems: 'get-users',
|
644 |
+
itemsKey: 'users',
|
645 |
+
chunkSize: 1
|
646 |
+
});
|
647 |
+
|
648 |
+
window.LP_Sync_Data = {
|
649 |
+
syncs: [],
|
650 |
+
syncing: 0,
|
651 |
+
options: {},
|
652 |
+
start: function start(options) {
|
653 |
+
this.syncs = [];
|
654 |
+
this.options = $.extend({
|
655 |
+
onInit: function onInit() {},
|
656 |
+
onStart: function onStart() {},
|
657 |
+
onCompleted: function onCompleted() {},
|
658 |
+
onCompletedAll: function onCompletedAll() {}
|
659 |
+
}, options || {});
|
660 |
+
|
661 |
+
if (!this.get_syncs()) {
|
662 |
+
return;
|
663 |
+
}
|
664 |
+
this.reset();
|
665 |
+
this.options.onInit.call(this);
|
666 |
+
var that = this,
|
667 |
+
syncing = 0,
|
668 |
+
totalSyncs = this.syncs.length,
|
669 |
+
syncCallback = function syncCallback($sync) {
|
670 |
+
|
671 |
+
if ($sync.is_completed()) {
|
672 |
+
syncing++;
|
673 |
+
that.options.onCompleted.call(that, $sync);
|
674 |
+
if (syncing >= totalSyncs) {
|
675 |
+
|
676 |
+
that.options.onCompletedAll.call(that);
|
677 |
+
return;
|
678 |
+
}
|
679 |
+
that.sync(syncing, syncCallback);
|
680 |
+
}
|
681 |
+
};
|
682 |
+
this.sync(syncing, syncCallback);
|
683 |
+
},
|
684 |
+
reset: function reset() {
|
685 |
+
for (var sync in this.syncs) {
|
686 |
+
try {
|
687 |
+
this[this.syncs[sync]].init();
|
688 |
+
} catch (e) {}
|
689 |
+
}
|
690 |
+
},
|
691 |
+
sync: function sync(_sync, callback) {
|
692 |
+
var that = this,
|
693 |
+
$sync = this[this.syncs[_sync]];
|
694 |
+
that.options.onStart.call(that, $sync);
|
695 |
+
$sync.sync(function () {
|
696 |
+
callback.call(that, $sync);
|
697 |
+
});
|
698 |
+
},
|
699 |
+
get_syncs: function get_syncs() {
|
700 |
+
var syncs = $('input[name^="lp-repair"]:checked').serializeJSON()['lp-repair'];
|
701 |
+
if (!syncs) {
|
702 |
+
return false;
|
703 |
+
}
|
704 |
+
|
705 |
+
for (var sync in syncs) {
|
706 |
+
if (syncs[sync] !== 'yes') {
|
707 |
+
continue;
|
708 |
+
}
|
709 |
+
|
710 |
+
sync = sync.replace(/[-]+/g, '_');
|
711 |
+
|
712 |
+
if (!this[sync]) {
|
713 |
+
continue;
|
714 |
+
}
|
715 |
+
|
716 |
+
this.syncs.push(sync);
|
717 |
+
}
|
718 |
+
|
719 |
+
return this.syncs;
|
720 |
+
},
|
721 |
+
get_sync: function get_sync(id) {
|
722 |
+
id = id.replace(/[-]+/g, '_');
|
723 |
+
return this[id];
|
724 |
+
},
|
725 |
+
sync_course_orders: Sync_Course_Orders,
|
726 |
+
sync_user_orders: Sync_User_Orders,
|
727 |
+
sync_user_courses: Sync_User_Courses,
|
728 |
+
sync_course_final_quiz: Sync_Course_Final_Quiz,
|
729 |
+
sync_remove_older_data: Sync_Remove_Older_Data,
|
730 |
+
sync_calculate_course_results: Sync_Calculate_Course_Results
|
731 |
+
};
|
732 |
+
|
733 |
+
$(document).ready(function () {
|
734 |
+
function initSyncs() {
|
735 |
+
var $chkAll = $('#learn-press-check-all-syncs'),
|
736 |
+
$chks = $('#learn-press-syncs').find('[name^="lp-repair"]');
|
737 |
+
|
738 |
+
$chkAll.on('click', function () {
|
739 |
+
$chks.prop('checked', this.checked);
|
740 |
+
});
|
741 |
+
|
742 |
+
$chks.on('click', function () {
|
743 |
+
$chkAll.prop('checked', $chks.filter(':checked').length === $chks.length);
|
744 |
+
});
|
745 |
+
}
|
746 |
+
|
747 |
+
initSyncs();
|
748 |
+
}).on('click', '.lp-button-repair', function () {
|
749 |
+
function getInput(sync) {
|
750 |
+
return $('ul#learn-press-syncs').find('input[name*="' + sync + '"]');
|
751 |
+
}
|
752 |
+
|
753 |
+
LP_Sync_Data.start({
|
754 |
+
onInit: function onInit() {
|
755 |
+
$('ul#learn-press-syncs').children().removeClass('syncing synced');
|
756 |
+
$('.lp-button-repair').prop('disabled', true);
|
757 |
+
},
|
758 |
+
onStart: function onStart($sync) {
|
759 |
+
getInput($sync.id).closest('li').addClass('syncing');
|
760 |
+
},
|
761 |
+
onCompleted: function onCompleted($sync) {
|
762 |
+
getInput($sync.id).closest('li').removeClass('syncing').addClass('synced');
|
763 |
+
},
|
764 |
+
onCompletedAll: function onCompletedAll() {
|
765 |
+
$('ul#learn-press-syncs').children().removeClass('syncing synced');
|
766 |
+
$('.lp-button-repair').prop('disabled', false);
|
767 |
+
}
|
768 |
+
});
|
769 |
+
});
|
770 |
+
})(jQuery);
|
771 |
+
|
772 |
+
/***/ }),
|
773 |
+
|
774 |
+
/***/ 9:
|
775 |
+
/***/ (function(module, exports, __webpack_require__) {
|
776 |
+
|
777 |
+
"use strict";
|
778 |
+
|
779 |
+
|
780 |
+
;(function ($) {
|
781 |
+
$.fn.LP_Chart_Line = function (data, config) {
|
782 |
+
return $.each(this, function () {
|
783 |
+
var $elem = $(this),
|
784 |
+
$canvas = $('<canvas />');
|
785 |
+
$elem.html('');
|
786 |
+
$canvas.appendTo($elem);
|
787 |
+
new Chart($canvas.get(0).getContext('2d')).Line(data, config);
|
788 |
+
});
|
789 |
+
//
|
790 |
+
};
|
791 |
+
|
792 |
+
$.fn.LP_Statistic_Users = function () {
|
793 |
+
if (parseInt($(this).length) === 0) {
|
794 |
+
return;
|
795 |
+
}
|
796 |
+
return $.each(this, function () {
|
797 |
+
var $buttons = $('.chart-buttons button').on('click', function () {
|
798 |
+
var $button = $(this),
|
799 |
+
type = $button.data('type'),
|
800 |
+
from = '',
|
801 |
+
to = '',
|
802 |
+
$container = $('#learn-press-chart');
|
803 |
+
$buttons.not(this).not('[data-type="user-custom-time"]').prop('disabled', false);
|
804 |
+
if (type == 'user-custom-time') {
|
805 |
+
from = $('#user-custom-time input[name="from"]').val();
|
806 |
+
to = $('#user-custom-time input[name="to"]').val();
|
807 |
+
|
808 |
+
if (from == '' || to == '') {
|
809 |
+
return false;
|
810 |
+
}
|
811 |
+
} else {
|
812 |
+
$button.prop('disabled', true);
|
813 |
+
}
|
814 |
+
$container.addClass('loading');
|
815 |
+
$.ajax({
|
816 |
+
url: 'admin-ajax.php',
|
817 |
+
data: {
|
818 |
+
action: 'learnpress_load_chart',
|
819 |
+
type: type,
|
820 |
+
range: [from, to]
|
821 |
+
},
|
822 |
+
dataType: 'text',
|
823 |
+
success: function success(response) {
|
824 |
+
response = LP.parseJSON(response);
|
825 |
+
$container.LP_Chart_Line(response, LP_Chart_Config);
|
826 |
+
$container.removeClass('loading');
|
827 |
+
}
|
828 |
+
});
|
829 |
+
return false;
|
830 |
+
}),
|
831 |
+
$inputs = $('.chart-buttons #user-custom-time input[type="text"]').change(function () {
|
832 |
+
var _valid_date = function _valid_date() {
|
833 |
+
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
834 |
+
return true;
|
835 |
+
}
|
836 |
+
};
|
837 |
+
$buttons.filter('[data-type="user-custom-time"]').prop('disabled', $inputs.filter(function () {
|
838 |
+
return this.value == '';
|
839 |
+
}).get().length || !_valid_date());
|
840 |
+
});
|
841 |
+
});
|
842 |
+
};
|
843 |
+
|
844 |
+
$.fn.LP_Statistic_Courses = function () {
|
845 |
+
if (parseInt($(this).length) === 0) {
|
846 |
+
return;
|
847 |
+
}
|
848 |
+
return $.each(this, function () {
|
849 |
+
var $buttons = $('.chart-buttons button').on('click', function () {
|
850 |
+
var $button = $(this),
|
851 |
+
type = $button.data('type'),
|
852 |
+
from = '',
|
853 |
+
to = '',
|
854 |
+
$container = $('#learn-press-chart');
|
855 |
+
$buttons.not(this).not('[data-type="course-custom-time"]').prop('disabled', false);
|
856 |
+
if (type == 'course-custom-time') {
|
857 |
+
from = $('#course-custom-time input[name="from"]').val();
|
858 |
+
to = $('#course-custom-time input[name="to"]').val();
|
859 |
+
|
860 |
+
if (from == '' || to == '') {
|
861 |
+
return false;
|
862 |
+
}
|
863 |
+
} else {
|
864 |
+
$button.prop('disabled', true);
|
865 |
+
}
|
866 |
+
$container.addClass('loading');
|
867 |
+
$.ajax({
|
868 |
+
url: 'admin-ajax.php',
|
869 |
+
data: {
|
870 |
+
action: 'learnpress_load_chart',
|
871 |
+
type: type,
|
872 |
+
range: [from, to]
|
873 |
+
},
|
874 |
+
dataType: 'text',
|
875 |
+
success: function success(response) {
|
876 |
+
response = LP.parseJSON(response);
|
877 |
+
$container.LP_Chart_Line(response, LP_Chart_Config);
|
878 |
+
$container.removeClass('loading');
|
879 |
+
}
|
880 |
+
});
|
881 |
+
return false;
|
882 |
+
}),
|
883 |
+
$inputs = $('.chart-buttons #course-custom-time input[type="text"]').change(function () {
|
884 |
+
var _valid_date = function _valid_date() {
|
885 |
+
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
886 |
+
return true;
|
887 |
+
}
|
888 |
+
};
|
889 |
+
$buttons.filter('[data-type="course-custom-time"]').prop('disabled', $inputs.filter(function () {
|
890 |
+
return this.value == '';
|
891 |
+
}).get().length || !_valid_date());
|
892 |
+
});
|
893 |
+
});
|
894 |
+
};
|
895 |
+
|
896 |
+
$.fn.LP_Statistic_Orders = function () {
|
897 |
+
if (parseInt($(this).length) === 0) {
|
898 |
+
return;
|
899 |
+
}
|
900 |
+
$('.panel_report_option').hide();
|
901 |
+
$('#panel_report_sales_by_' + $('#report_sales_by').val()).show();
|
902 |
+
$('#report_sales_by').on('change', function () {
|
903 |
+
$('.panel_report_option').hide();
|
904 |
+
$('#panel_report_sales_by_' + $(this).val()).show();
|
905 |
+
if ('date' == $(this).val()) {
|
906 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
907 |
+
}
|
908 |
+
});
|
909 |
+
|
910 |
+
/**
|
911 |
+
* Upgrade Chart for Order Statistics
|
912 |
+
* @returns {Boolean}
|
913 |
+
*/
|
914 |
+
var LP_Statistic_Orders_Upgrade_Chart = function LP_Statistic_Orders_Upgrade_Chart() {
|
915 |
+
var type = '',
|
916 |
+
from = '',
|
917 |
+
to = '',
|
918 |
+
report_sales_by = 'date',
|
919 |
+
cat_id = 0,
|
920 |
+
course_id = 0;
|
921 |
+
report_sales_by = $('#report_sales_by').val();
|
922 |
+
$container = $('#learn-press-chart');
|
923 |
+
$container.addClass('loading');
|
924 |
+
// get type
|
925 |
+
var $buttons = $('.chart-buttons button:disabled').not('[data-type="order-custom-time"]');
|
926 |
+
if (parseInt($buttons.length) > 0) {
|
927 |
+
type = $($buttons[0]).data('type');
|
928 |
+
} else {
|
929 |
+
type = 'order-custom-time';
|
930 |
+
from = $('#order-custom-time input[name="from"]').val();
|
931 |
+
to = $('#order-custom-time input[name="to"]').val();
|
932 |
+
if (from == '' || to == '') {
|
933 |
+
return false;
|
934 |
+
}
|
935 |
+
}
|
936 |
+
if ('course' === report_sales_by) {
|
937 |
+
course_id = $('#report-by-course-id').val();
|
938 |
+
} else if ('category' === report_sales_by) {
|
939 |
+
cat_id = $('#report-by-course-category-id').val();
|
940 |
+
}
|
941 |
+
|
942 |
+
$.ajax({
|
943 |
+
url: 'admin-ajax.php',
|
944 |
+
data: {
|
945 |
+
action: 'learnpress_load_chart',
|
946 |
+
type: type,
|
947 |
+
range: [from, to],
|
948 |
+
report_sales_by: report_sales_by,
|
949 |
+
course_id: course_id,
|
950 |
+
cat_id: cat_id
|
951 |
+
},
|
952 |
+
dataType: 'text',
|
953 |
+
success: function success(response) {
|
954 |
+
response = LP.parseJSON(response);
|
955 |
+
$container.LP_Chart_Line(response, LP_Chart_Config);
|
956 |
+
$container.removeClass('loading');
|
957 |
+
}
|
958 |
+
});
|
959 |
+
};
|
960 |
+
|
961 |
+
$('#report-by-course-id').select2({
|
962 |
+
placeholder: 'Select a course',
|
963 |
+
minimumInputLength: 1,
|
964 |
+
ajax: {
|
965 |
+
url: ajaxurl + '?action=learnpress_search_course',
|
966 |
+
dataType: 'json',
|
967 |
+
quietMillis: 250,
|
968 |
+
data: function data(term, page) {
|
969 |
+
return {
|
970 |
+
q: term // search term
|
971 |
+
};
|
972 |
+
},
|
973 |
+
results: function results(data, page) {
|
974 |
+
return { results: data.items };
|
975 |
+
},
|
976 |
+
cache: true
|
977 |
+
}
|
978 |
+
});
|
979 |
+
|
980 |
+
$('#report-by-course-id').on('change', function () {
|
981 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
982 |
+
});
|
983 |
+
|
984 |
+
$('#report-by-course-category-id').select2({
|
985 |
+
placeholder: 'Select a course',
|
986 |
+
minimumInputLength: 1,
|
987 |
+
ajax: {
|
988 |
+
url: ajaxurl + '?action=learnpress_search_course_category',
|
989 |
+
dataType: 'json',
|
990 |
+
quietMillis: 250,
|
991 |
+
data: function data(term, page) {
|
992 |
+
return {
|
993 |
+
q: term // search term
|
994 |
+
};
|
995 |
+
},
|
996 |
+
results: function results(data, page) {
|
997 |
+
return { results: data.items };
|
998 |
+
},
|
999 |
+
cache: true
|
1000 |
+
}
|
1001 |
+
});
|
1002 |
+
|
1003 |
+
$('#report-by-course-category-id').on('change', function () {
|
1004 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
1005 |
+
});
|
1006 |
+
|
1007 |
+
var $buttons = $('.chart-buttons button').on('click', function () {
|
1008 |
+
var $button = $(this),
|
1009 |
+
type = $button.data('type'),
|
1010 |
+
from = '',
|
1011 |
+
to = '',
|
1012 |
+
$container = $('#learn-press-chart');
|
1013 |
+
$buttons.not(this).not('[data-type="order-custom-time"]').prop('disabled', false);
|
1014 |
+
if (type !== 'order-custom-time') {
|
1015 |
+
$button.prop('disabled', true);
|
1016 |
+
$('#order-custom-time input[name="from"]').val('');
|
1017 |
+
$('#order-custom-time input[name="to"]').val('');
|
1018 |
+
}
|
1019 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
1020 |
+
return false;
|
1021 |
+
});
|
1022 |
+
|
1023 |
+
var $inputs = $('.chart-buttons #order-custom-time input[type="text"]').change(function () {
|
1024 |
+
var _valid_date = function _valid_date() {
|
1025 |
+
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
1026 |
+
return true;
|
1027 |
+
}
|
1028 |
+
};
|
1029 |
+
$buttons.filter('[data-type="order-custom-time"]').prop('disabled', $inputs.filter(function () {
|
1030 |
+
return this.value == '';
|
1031 |
+
}).get().length || !_valid_date());
|
1032 |
+
});
|
1033 |
+
};
|
1034 |
+
$(document).ready(function () {
|
1035 |
+
if (typeof $.fn.datepicker != 'undefined') {
|
1036 |
+
$(".date-picker").datepicker({
|
1037 |
+
dateFormat: 'yy/mm/dd'
|
1038 |
+
});
|
1039 |
+
}
|
1040 |
+
$('.learn-press-statistic-users').LP_Statistic_Users();
|
1041 |
+
$('.learn-press-statistic-courses').LP_Statistic_Courses();
|
1042 |
+
$('.learn-press-statistic-orders').LP_Statistic_Orders();
|
1043 |
+
});
|
1044 |
+
return;
|
1045 |
+
|
1046 |
+
var student_chart;
|
1047 |
+
window.drawStudentsChart = drawStudentsChart = function drawStudentsChart(data, config) {
|
1048 |
+
var $student_chart = $("#lpr-chart-students").clone().attr('style', '').removeAttr("width").removeAttr('height');
|
1049 |
+
$("#lpr-chart-students").replaceWith($student_chart);
|
1050 |
+
$student_chart = $student_chart[0].getContext("2d");
|
1051 |
+
student_chart = new Chart($student_chart).Line(data, config);
|
1052 |
+
};
|
1053 |
+
if (typeof last_seven_days == 'undefined') return;
|
1054 |
+
drawStudentsChart(last_seven_days, config);
|
1055 |
+
|
1056 |
+
var courses_chart;
|
1057 |
+
window.drawCoursesChart = drawCoursesChart = function drawCoursesChart(data, config) {
|
1058 |
+
var $courses_chart = $("#lpr-chart-courses").clone().attr('style', '').removeAttr("width").removeAttr('height');
|
1059 |
+
$("#lpr-chart-courses").replaceWith($courses_chart);
|
1060 |
+
$courses_chart = $courses_chart[0].getContext("2d");
|
1061 |
+
courses_chart = new Chart($courses_chart).Bar(data, config);
|
1062 |
+
};
|
1063 |
+
if (typeof data == 'undefined') return;
|
1064 |
+
|
1065 |
+
drawCoursesChart(data, config);
|
1066 |
+
})(jQuery);
|
1067 |
+
|
1068 |
+
/***/ })
|
1069 |
+
|
1070 |
+
/******/ });
|
1071 |
+
//# sourceMappingURL=learnpress.js.map
|
assets/js/admin/learnpress.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(a){if(s[a])return s[a].exports;var n=s[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var s={};t.m=e,t.c=s,t.d=function(e,s,a){t.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}({16:function(t,s,a){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=a(17),r=(n(i),a(9)),l=(n(r),a(18)),o=(n(l),jQuery),c=o(document),u=o(window),d=function(){o(".learn-press-payments.sortable tbody").sortable({handle:".dashicons-menu",helper:function(e,t){return t.children().each(function(){o(this).width(o(this).width())}),t},axis:"y",start:function(e,t){},stop:function(e,t){},update:function(e,t){var s=o(this).children().map(function(){return o(this).find('input[name="payment-order"]').val()}).get();o.post({url:"",data:{"lp-ajax":"update-payment-order",order:s},success:function(e){}})}})},p=function(){o(".learn-press-tooltip").each(function(){var e=o(this),t=o.extend({title:"data-tooltip",offset:10,gravity:"s"},e.data());e.tipsy(t)})},f=function(){o.fn.select2&&o(".lp-select-2 select").select2()},h=function(){c.on("change",'.learn-press-single-course-permalink input[type="radio"]',function(){var e=o(this),t=e.closest(".learn-press-single-course-permalink");t.hasClass("custom-base")?t.find('input[type="text"]').prop("readonly",!1):t.siblings(".custom-base").find('input[type="text"]').prop("readonly",!0)}).on("change","input.learn-press-course-base",function(){o("#course_permalink_structure").val(o(this).val())}).on("focus","#course_permalink_structure",function(){o("#learn_press_custom_permalink").click()}).on("change","#learn_press_courses_page_id",function(){o("tr.learn-press-courses-page-id").toggleClass("hide-if-js",!parseInt(this.value))})},m=function(e){e.preventDefault();var t=o(this).closest("tr"),s=(o(this),t.find(".status").hasClass("enabled")?"no":"yes");o.ajax({url:"",data:{"lp-ajax":"update-payment-status",status:s,id:t.data("payment")},success:function(e){e=LP.parseJSON(e);for(var t in e)o("#payment-"+t+" .status").toggleClass("enabled",e[t])}})},_=function(){(function(){o.post({url:window.location.href,data:{"lp-ajax":"update_email_status",status:o(this).parent().hasClass("enabled")?"no":"yes",id:o(this).data("id")},dataType:"text",success:o.proxy(function(e){e=LP.parseJSON(e);for(var t in e)o("#email-"+t+" .status").toggleClass("enabled",e[t])},this)})}).apply(this)},y=function(){return"_lp_sale_price_schedule"===o(this).attr("id")?(o(this).hide(),o("#field-_lp_sale_start, #field-_lp_sale_end").removeClass("hide-if-js"),u.trigger("resize.calculate-tab")):(o("#_lp_sale_price_schedule").show(),o("#field-_lp_sale_start, #field-_lp_sale_end").addClass("hide-if-js").find("#_lp_sale_start, #_lp_sale_end").val(""),u.trigger("resize.calculate-tab")),!1},g=function(){var e=o(this);if(e.hasClass("current"))return!1;var t=o("#learn-press-template-files"),s=t.find("tr[data-template]"),a=e.data("template"),n=e.data("filter");return e.addClass("current").siblings("a").removeClass("current"),a?s.map(function(){o(this).toggleClass("hide-if-js",o(this).data("template")!==a)}):n?s.map(function(){o(this).toggleClass("hide-if-js","yes"!==o(this).data("filter-"+n))}):s.removeClass("hide-if-js"),o("#learn-press-no-templates").toggleClass("hide-if-js",!!t.find("tr.template-row:not(.hide-if-js):first").length),!1},v=function(e){e.preventDefault();var t=o(this),s=t.data("status");o.ajax({url:"",data:{"lp-ajax":"update_email_status",status:s},success:function(e){e=LP.parseJSON(e);for(var t in e)o("#email-"+t+" .status").toggleClass("enabled",e[t])}})},b=function(e){e.preventDefault();var t=o(this),s=t.data("post-id");o.ajax({url:"",data:{"lp-ajax":"duplicator",id:s},success:function(e){e=LP.parseJSON(e),e.success?window.location.href=e.data:alert(e.data)}})},C=function(){var t=o("#learn-press-install-sample-data-notice"),s=o(this).attr("data-action");s&&(e.preventDefault(),"yes"===s?t.find(".install-sample-data-notice").slideUp().siblings(".install-sample-data-loading").slideDown():t.fadeOut(),o.ajax({url:ajaxurl,dataType:"html",type:"post",data:{action:"learnpress_install_sample_data",yes:s},success:function(e){e=LP.parseJSON(e),e.url?o.ajax({url:e.url,success:function(){t.find(".install-sample-data-notice").html(e.message).slideDown().siblings(".install-sample-data-loading").slideUp()}}):t.find(".install-sample-data-notice").html(e.message).slideDown().siblings(".install-sample-data-loading").slideUp()}}))},x=function(e){var t=o(this),s=o("#_lp_price"),a=o("#_lp_sale_price"),n=o(e.target).attr("id");t.find("#field-_lp_price div, #field-_lp_sale_price div").remove(".learn-press-tip-floating"),parseInt(a.val())>=parseInt(s.val())&&("_lp_price"===n?s.parent(".rwmb-input").append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_price+"</div>"):"_lp_sale_price"===n&&a.parent(".rwmb-input").append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_sale_price+"</div>"))},k=function(e){var t=o(this),s=o("#_lp_sale_end"),a=Date.parse(t.val()),n=Date.parse(s.val()),i=t.parent(".rwmb-input");s.parent(".rwmb-input");a||i.append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_invalid_date+"</div>"),o("#field-_lp_sale_start div, #field-_lp_sale_end div").remove(".learn-press-tip-floating"),a>n&&i.append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_sale_start_date+"</div>")},j=function(e){var t=o(this),s=o("#_lp_sale_start"),a=Date.parse(s.val()),n=Date.parse(t.val()),i=(s.parent(".rwmb-input"),t.parent(".rwmb-input"));n||i.append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_invalid_date+"</div>"),o("#field-_lp_sale_start div, #field-_lp_sale_end div").remove(".learn-press-tip-floating"),a>n&&i.append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_sale_end_date+"</div>")},S=function(){d(),f(),p(),h(),o(".learn-press-tabs").LP("AdminTab"),o(document).on("click",".learn-press-payments .status .dashicons",m).on("click",".change-email-status",_).on("click","#_lp_sale_price_schedule",y).on("click","#_lp_sale_price_schedule_cancel",y).on("click",".learn-press-filter-template",g).on("click","#learn-press-enable-emails, #learn-press-disable-emails",v).on("click",".lp-duplicate-row-action .lp-duplicate-post",b).on("click","#learn-press-install-sample-data-notice a",C).on("input","#meta-box-tab-course_payment",x).on("change","#_lp_sale_start",k).on("change","#_lp_sale_end",j)};o(document).ready(S)},17:function(e,t,s){"use strict";!function(e){var t=e(document),s=!1,a=function(t){t.preventDefault();var a=e(this);s||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(a.addClass("disabled").html(a.data("installing-text")),e(".lp-install-sample-data-response").remove(),s=!0,e.ajax({url:a.attr("href"),data:e(".lp-install-sample-data-options").serializeJSON(),success:function(t){a.removeClass("disabled").html(a.data("text")),s=!1,e(t).insertBefore(a.parent())},error:function(){a.removeClass("disabled").html(a.data("text")),s=!1}}))},n=function(t){t.preventDefault();var a=e(this);s||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(a.addClass("disabled").html(a.data("uninstalling-text")),s=!0,e.ajax({url:a.attr("href"),success:function(e){a.removeClass("disabled").html(a.data("text")),s=!1},error:function(){a.removeClass("disabled").html(a.data("text")),s=!1}}))},i=function(t){t.preventDefault();var s=e(this);s.hasClass("disabled")||(s.addClass("disabled").html(s.data("cleaning-text")),e.ajax({url:s.attr("href"),data:{},success:function(e){s.removeClass("disabled").html(s.data("text"))},error:function(){s.removeClass("disabled").html(s.data("text"))}}))},r=function(){e.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success:function(e){},error:function(){}})},l=function(t){t.preventDefault(),e(".lp-install-sample-data-options").toggleClass("hide-if-js")};t.on("click","#learn-press-install-sample-data",a).on("click","#learn-press-uninstall-sample-data",n).on("click","#learn-press-clear-cache",i).on("click",'input[name="enable_hard_cache"]',r).on("click","#learn-press-install-sample-data-options",l)}(jQuery)},18:function(e,t,s){"use strict";!function(e){var t={id:"sync-base",syncing:!1,items:!1,completed:!1,callback:null,methodGetItems:"",itemsKey:"",chunkSize:50,sync:function(e){if(!this.syncing){if(this.callback=e,!1===this.items)this.get_items();else if(!this.dispatch())return this.completed=!0,void this.callToCallback();this.syncing=!0}},init:function(){this.syncing=!1,this.items=!1,this.completed=!1},is_completed:function(){return this.completed},dispatch:function(){var t=this,s=!!this.items&&this.items.splice(0,this.chunkSize);return!(!s||0===s.length)&&(e.ajax({url:"",data:{"lp-ajax":this.id,sync:s},method:"post",success:function(e){e=LP.parseJSON(e),t.syncing=!1,"success"!==e.result&&(t.completed=!0),t.callToCallback(),t.is_completed()||t.sync(t.callback)}}),!0)},callToCallback:function(){this.callback&&this.callback.call(this)},get_items:function(){var t=this;e.ajax({url:"",data:{"lp-ajax":this.id,sync:this.methodGetItems},success:function(e){t.syncing=!1,e=LP.parseJSON(e),e[t.itemsKey]?(t.items=e[t.itemsKey],t.sync(t.callback)):(t.completed=!0,t.items=[],t.callToCallback())}})}},s=e.extend({},t,{id:"sync-course-orders",methodGetItems:"get-courses",itemsKey:"courses"}),a=e.extend({},t,{id:"sync-user-courses",methodGetItems:"get-users",itemsKey:"users",chunkSize:500}),n=e.extend({},t,{id:"sync-user-orders",methodGetItems:"get-users",itemsKey:"users",chunkSize:500}),i=e.extend({},t,{id:"sync-course-final-quiz",methodGetItems:"get-courses",itemsKey:"courses",chunkSize:500}),r=e.extend({},t,{id:"sync-remove-older-data",methodGetItems:"remove-older-data",itemsKey:"_nothing_here",chunkSize:500}),l=e.extend({},t,{id:"sync-calculate-course-results",methodGetItems:"get-users",itemsKey:"users",chunkSize:1});window.LP_Sync_Data={syncs:[],syncing:0,options:{},start:function(t){if(this.syncs=[],this.options=e.extend({onInit:function(){},onStart:function(){},onCompleted:function(){},onCompletedAll:function(){}},t||{}),this.get_syncs()){this.reset(),this.options.onInit.call(this);var s=this,a=0,n=this.syncs.length,i=function e(t){if(t.is_completed()){if(a++,s.options.onCompleted.call(s,t),a>=n)return void s.options.onCompletedAll.call(s);s.sync(a,e)}};this.sync(a,i)}},reset:function(){for(var e in this.syncs)try{this[this.syncs[e]].init()}catch(e){}},sync:function(e,t){var s=this,a=this[this.syncs[e]];s.options.onStart.call(s,a),a.sync(function(){t.call(s,a)})},get_syncs:function(){var t=e('input[name^="lp-repair"]:checked').serializeJSON()["lp-repair"];if(!t)return!1;for(var s in t)"yes"===t[s]&&(s=s.replace(/[-]+/g,"_"),this[s]&&this.syncs.push(s));return this.syncs},get_sync:function(e){return e=e.replace(/[-]+/g,"_"),this[e]},sync_course_orders:s,sync_user_orders:n,sync_user_courses:a,sync_course_final_quiz:i,sync_remove_older_data:r,sync_calculate_course_results:l},e(document).ready(function(){!function(){var t=e("#learn-press-check-all-syncs"),s=e("#learn-press-syncs").find('[name^="lp-repair"]');t.on("click",function(){s.prop("checked",this.checked)}),s.on("click",function(){t.prop("checked",s.filter(":checked").length===s.length)})}()}).on("click",".lp-button-repair",function(){function t(t){return e("ul#learn-press-syncs").find('input[name*="'+t+'"]')}LP_Sync_Data.start({onInit:function(){e("ul#learn-press-syncs").children().removeClass("syncing synced"),e(".lp-button-repair").prop("disabled",!0)},onStart:function(e){t(e.id).closest("li").addClass("syncing")},onCompleted:function(e){t(e.id).closest("li").removeClass("syncing").addClass("synced")},onCompletedAll:function(){e("ul#learn-press-syncs").children().removeClass("syncing synced"),e(".lp-button-repair").prop("disabled",!1)}})})}(jQuery)},9:function(e,t,s){"use strict";!function(e){return e.fn.LP_Chart_Line=function(t,s){return e.each(this,function(){var a=e(this),n=e("<canvas />");a.html(""),n.appendTo(a),new Chart(n.get(0).getContext("2d")).Line(t,s)})},e.fn.LP_Statistic_Users=function(){if(0!==parseInt(e(this).length))return e.each(this,function(){var t=e(".chart-buttons button").on("click",function(){var s=e(this),a=s.data("type"),n="",i="",r=e("#learn-press-chart");if(t.not(this).not('[data-type="user-custom-time"]').prop("disabled",!1),"user-custom-time"==a){if(n=e('#user-custom-time input[name="from"]').val(),i=e('#user-custom-time input[name="to"]').val(),""==n||""==i)return!1}else s.prop("disabled",!0);return r.addClass("loading"),e.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:a,range:[n,i]},dataType:"text",success:function(e){e=LP.parseJSON(e),r.LP_Chart_Line(e,LP_Chart_Config),r.removeClass("loading")}}),!1}),s=e('.chart-buttons #user-custom-time input[type="text"]').change(function(){t.filter('[data-type="user-custom-time"]').prop("disabled",s.filter(function(){return""==this.value}).get().length||!function(){if(new Date(s[0].value)<new Date(s[1].value))return!0}())})})},e.fn.LP_Statistic_Courses=function(){if(0!==parseInt(e(this).length))return e.each(this,function(){var t=e(".chart-buttons button").on("click",function(){var s=e(this),a=s.data("type"),n="",i="",r=e("#learn-press-chart");if(t.not(this).not('[data-type="course-custom-time"]').prop("disabled",!1),"course-custom-time"==a){if(n=e('#course-custom-time input[name="from"]').val(),i=e('#course-custom-time input[name="to"]').val(),""==n||""==i)return!1}else s.prop("disabled",!0);return r.addClass("loading"),e.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:a,range:[n,i]},dataType:"text",success:function(e){e=LP.parseJSON(e),r.LP_Chart_Line(e,LP_Chart_Config),r.removeClass("loading")}}),!1}),s=e('.chart-buttons #course-custom-time input[type="text"]').change(function(){t.filter('[data-type="course-custom-time"]').prop("disabled",s.filter(function(){return""==this.value}).get().length||!function(){if(new Date(s[0].value)<new Date(s[1].value))return!0}())})})},e.fn.LP_Statistic_Orders=function(){if(0!==parseInt(e(this).length)){e(".panel_report_option").hide(),e("#panel_report_sales_by_"+e("#report_sales_by").val()).show(),e("#report_sales_by").on("change",function(){e(".panel_report_option").hide(),e("#panel_report_sales_by_"+e(this).val()).show(),"date"==e(this).val()&&t()});var t=function(){var t="",s="",a="",n="date",i=0,r=0;n=e("#report_sales_by").val(),$container=e("#learn-press-chart"),$container.addClass("loading");var l=e(".chart-buttons button:disabled").not('[data-type="order-custom-time"]');if(parseInt(l.length)>0)t=e(l[0]).data("type");else if(t="order-custom-time",s=e('#order-custom-time input[name="from"]').val(),a=e('#order-custom-time input[name="to"]').val(),""==s||""==a)return!1;"course"===n?r=e("#report-by-course-id").val():"category"===n&&(i=e("#report-by-course-category-id").val()),e.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:t,range:[s,a],report_sales_by:n,course_id:r,cat_id:i},dataType:"text",success:function(e){e=LP.parseJSON(e),$container.LP_Chart_Line(e,LP_Chart_Config),$container.removeClass("loading")}})};e("#report-by-course-id").select2({placeholder:"Select a course",minimumInputLength:1,ajax:{url:ajaxurl+"?action=learnpress_search_course",dataType:"json",quietMillis:250,data:function(e,t){return{q:e}},results:function(e,t){return{results:e.items}},cache:!0}}),e("#report-by-course-id").on("change",function(){t()}),e("#report-by-course-category-id").select2({placeholder:"Select a course",minimumInputLength:1,ajax:{url:ajaxurl+"?action=learnpress_search_course_category",dataType:"json",quietMillis:250,data:function(e,t){return{q:e}},results:function(e,t){return{results:e.items}},cache:!0}}),e("#report-by-course-category-id").on("change",function(){t()});var s=e(".chart-buttons button").on("click",function(){var a=e(this),n=a.data("type");e("#learn-press-chart");return s.not(this).not('[data-type="order-custom-time"]').prop("disabled",!1),"order-custom-time"!==n&&(a.prop("disabled",!0),e('#order-custom-time input[name="from"]').val(""),e('#order-custom-time input[name="to"]').val("")),t(),!1}),a=e('.chart-buttons #order-custom-time input[type="text"]').change(function(){s.filter('[data-type="order-custom-time"]').prop("disabled",a.filter(function(){return""==this.value}).get().length||!function(){if(new Date(a[0].value)<new Date(a[1].value))return!0}())})}},void e(document).ready(function(){void 0!==e.fn.datepicker&&e(".date-picker").datepicker({dateFormat:"yy/mm/dd"}),e(".learn-press-statistic-users").LP_Statistic_Users(),e(".learn-press-statistic-courses").LP_Statistic_Courses(),e(".learn-press-statistic-orders").LP_Statistic_Orders()})}(jQuery)}});
|
assets/js/admin/meta-box-order.js
DELETED
@@ -1,461 +0,0 @@
|
|
1 |
-
;
|
2 |
-
(function ($) {
|
3 |
-
"use strict";
|
4 |
-
window.$Vue = window.$Vue || Vue;
|
5 |
-
|
6 |
-
$(document).ready(function () {
|
7 |
-
|
8 |
-
var $listItems = $('.list-order-items').find('tbody'),
|
9 |
-
$listUsers = $('#list-users'),
|
10 |
-
template = function (templateHTML, data) {
|
11 |
-
return _.template(templateHTML, {
|
12 |
-
evaluate: /<#([\s\S]+?)#>/g,
|
13 |
-
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
14 |
-
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
15 |
-
})(data);
|
16 |
-
},
|
17 |
-
advancedListOptions = {
|
18 |
-
template: '#tmpl-order-advanced-list-item',
|
19 |
-
onRemove: function () {
|
20 |
-
if (this.$el.children().length === 0) {
|
21 |
-
this.$el.append('<li class="user-guest">' + orderOptions.i18n_guest + '</li>')
|
22 |
-
}
|
23 |
-
console.log(this.$el)
|
24 |
-
},
|
25 |
-
onAdd: function () {
|
26 |
-
this.$el.find('.user-guest').remove();
|
27 |
-
}
|
28 |
-
},
|
29 |
-
orderOptions = lpMetaBoxOrderSettings;
|
30 |
-
|
31 |
-
function getAddedUsers() {
|
32 |
-
return $('#list-users').children().map(function () {
|
33 |
-
return $(this).data('id')
|
34 |
-
}).get();
|
35 |
-
}
|
36 |
-
|
37 |
-
function getAddedItems() {
|
38 |
-
return $('.list-order-items tbody').children('.order-item-row').map(function () {
|
39 |
-
return $(this).data('id')
|
40 |
-
}).get();
|
41 |
-
}
|
42 |
-
|
43 |
-
if ($listUsers.length) {
|
44 |
-
$listUsers.advancedList(advancedListOptions);
|
45 |
-
if (orderOptions.users) {
|
46 |
-
_.forEach(orderOptions.users, function (userData, userId) {
|
47 |
-
$listUsers.advancedList('add', [
|
48 |
-
template(orderOptions.userTextFormat, userData),
|
49 |
-
userId
|
50 |
-
]);
|
51 |
-
})
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
$listItems.on('click', '.remove-order-item', function (e) {
|
56 |
-
e.preventDefault();
|
57 |
-
var $item = $(this).closest('tr'),
|
58 |
-
item_id = $item.data('item_id');
|
59 |
-
|
60 |
-
$item.remove();
|
61 |
-
if ($listItems.children(':not(.no-order-items)').length === 0) {
|
62 |
-
$listItems.find('.no-order-items').show();
|
63 |
-
}
|
64 |
-
|
65 |
-
$Vue.http.post(
|
66 |
-
window.location.href, {
|
67 |
-
order_id: $('#post_ID').val(),
|
68 |
-
items: [item_id],
|
69 |
-
'lp-ajax': 'remove_items_from_order'
|
70 |
-
}, {
|
71 |
-
emulateJSON: true,
|
72 |
-
params: {}
|
73 |
-
}
|
74 |
-
).then(function (response) {
|
75 |
-
var result = LP.parseJSON(response.body || response.bodyText);
|
76 |
-
$('.order-subtotal').html(result.order_data.subtotal_html);
|
77 |
-
$('.order-total').html(result.order_data.total_html);
|
78 |
-
});
|
79 |
-
});
|
80 |
-
|
81 |
-
$('.order-date.date-picker').on('change', function () {
|
82 |
-
var m = this.value.split('-');
|
83 |
-
['aa', 'mm', 'jj'].forEach(function (v, k) {
|
84 |
-
$('input[name="' + v + '"]').val(m[k]);
|
85 |
-
});
|
86 |
-
}).datepicker({
|
87 |
-
dateFormat: 'yy-mm-dd',
|
88 |
-
numberOfMonths: 1,
|
89 |
-
showButtonPanel: true,
|
90 |
-
select: function () {
|
91 |
-
console.log(arguments)
|
92 |
-
}
|
93 |
-
});
|
94 |
-
|
95 |
-
$('#learn-press-add-order-item').on('click', function () {
|
96 |
-
LP.$modalSearchItems.open({
|
97 |
-
data: {
|
98 |
-
postType: 'lp_course',
|
99 |
-
context: 'order-items',
|
100 |
-
contextId: $('#post_ID').val(),
|
101 |
-
exclude: getAddedItems(),
|
102 |
-
show: true
|
103 |
-
},
|
104 |
-
callbacks: {
|
105 |
-
addItems: function () {
|
106 |
-
var that = this;
|
107 |
-
$Vue.http.post(
|
108 |
-
window.location.href, {
|
109 |
-
order_id: this.contextId,
|
110 |
-
items: this.selected,
|
111 |
-
'lp-ajax': 'add_items_to_order'
|
112 |
-
}, {
|
113 |
-
emulateJSON: true,
|
114 |
-
params: {}
|
115 |
-
}
|
116 |
-
).then(function (response) {
|
117 |
-
var result = LP.parseJSON(response.body || response.bodyText),
|
118 |
-
$noItem = $listItems.find('.no-order-items').hide();
|
119 |
-
$(result.item_html).insertBefore($noItem);
|
120 |
-
$('.order-subtotal').html(result.order_data.subtotal_html);
|
121 |
-
$('.order-total').html(result.order_data.total_html);
|
122 |
-
});
|
123 |
-
this.close();
|
124 |
-
}
|
125 |
-
}
|
126 |
-
});
|
127 |
-
});
|
128 |
-
|
129 |
-
$(document).on('click', '.change-user', function (e) {
|
130 |
-
e.preventDefault();
|
131 |
-
LP.$modalSearchUsers.open({
|
132 |
-
data: {
|
133 |
-
context: 'order-items',
|
134 |
-
contextId: $('#post_ID').val(),
|
135 |
-
show: true,
|
136 |
-
multiple: $(this).data('multiple') === 'yes',
|
137 |
-
exclude: getAddedUsers(),
|
138 |
-
textFormat: orderOptions.userTextFormat
|
139 |
-
},
|
140 |
-
callbacks: {
|
141 |
-
addUsers: function (data) {
|
142 |
-
if (this.multiple) {
|
143 |
-
if (!$listUsers.length) {
|
144 |
-
$listUsers = $(LP.template('tmpl-order-data-user')({multiple: true}));
|
145 |
-
$listUsers.advancedList(advancedListOptions);
|
146 |
-
|
147 |
-
$('.order-data-user').replaceWith($listUsers);
|
148 |
-
}
|
149 |
-
for (var i = 0; i < this.selected.length; i++) {
|
150 |
-
$listUsers.advancedList('add', [template(this.textFormat, this.selected[i]), this.selected[i].id]);
|
151 |
-
}
|
152 |
-
} else {
|
153 |
-
var $html = LP.template('tmpl-order-data-user')({
|
154 |
-
name: template(this.textFormat, this.selected[0]),
|
155 |
-
id: this.selected[0].id
|
156 |
-
});
|
157 |
-
|
158 |
-
$('.order-data-user').replaceWith($html);
|
159 |
-
}
|
160 |
-
|
161 |
-
this.close();
|
162 |
-
}
|
163 |
-
}
|
164 |
-
});
|
165 |
-
});
|
166 |
-
});
|
167 |
-
/*
|
168 |
-
var LP_Order_View = window.LP_Order_View = Backbone.View.extend({
|
169 |
-
el: 'body',
|
170 |
-
events: {
|
171 |
-
'click #learn-press-add-order-item': '_addItem',
|
172 |
-
'click #learn-press-calculate-order-total': 'calculateTotal',
|
173 |
-
'click #learn-press-courses-result a[data-id]': 'addItem',
|
174 |
-
'click .remove-order-item': 'removeItem',
|
175 |
-
'keyup #learn-press-search-item-term': 'searchItems',
|
176 |
-
'change select[name="order-status"]': '_updateDescription'
|
177 |
-
},
|
178 |
-
initialize: function () {
|
179 |
-
_.bindAll(this, 'resetModal', 'updateModal', '_updateDescription');
|
180 |
-
LP.Hook.addAction('learn_press_message_box_before_resize', this.resetModal);
|
181 |
-
LP.Hook.addAction('learn_press_message_box_resize', this.updateModal);
|
182 |
-
|
183 |
-
var $selectUsers = this.$('#order-customer');
|
184 |
-
if ($selectUsers.attr('multiple') == 'multiple') {
|
185 |
-
$selectUsers.select2({
|
186 |
-
width: $('#minor-publishing .misc-pub-section').innerWidth() - 20
|
187 |
-
});
|
188 |
-
}
|
189 |
-
var $add_new_h2 = $('body.post-type-lp_order').find('.page-title-action, .add-new-h2'),
|
190 |
-
$add_h2 = $('<a href="post-new.php?post_type=lp_order&multi-users=yes" class="page-title-action add-new-h2">Add order multiple users</a>');
|
191 |
-
$add_h2
|
192 |
-
.insertAfter($add_new_h2);
|
193 |
-
|
194 |
-
$('.wp-list-table #order_status').css('width', '135px');
|
195 |
-
|
196 |
-
$('select[name="order-status"]').on('change', function () {
|
197 |
-
var $sel = $(this),
|
198 |
-
$sec = $('.order-action-section'),
|
199 |
-
status = $sel.data('status'),
|
200 |
-
order_id = +$sel.closest('tr.type-lp_order').find('td.column-title strong a.row-title').text().replace('#', '');
|
201 |
-
|
202 |
-
// console.log(order_id);
|
203 |
-
// console.log($sel.val());
|
204 |
-
|
205 |
-
$.ajax({
|
206 |
-
url: LP_Settings.ajax,
|
207 |
-
data: {
|
208 |
-
action: 'learnpress_update_order_status',
|
209 |
-
order_id: order_id,
|
210 |
-
value: $sel.val(),
|
211 |
-
},
|
212 |
-
dataType: 'text',
|
213 |
-
type: 'post',
|
214 |
-
success: function (response) {
|
215 |
-
LP.log(response);
|
216 |
-
response = LP.parseJSON(response);
|
217 |
-
if (response.result === 'success') {
|
218 |
-
var $order_table = that.$('.order-items'),
|
219 |
-
$no_item = $order_table.find('.no-order-items');
|
220 |
-
$(response.item_html).insertBefore($no_item);
|
221 |
-
$order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
|
222 |
-
$order_table.find('.order-total').html(response.order_data.total_html);
|
223 |
-
|
224 |
-
$item.remove();
|
225 |
-
$no_item.addClass('hide-if-js');
|
226 |
-
}
|
227 |
-
}
|
228 |
-
});
|
229 |
-
|
230 |
-
$sec.toggleClass('hide-if-js', status != $sel.val());
|
231 |
-
}).trigger('init');
|
232 |
-
|
233 |
-
|
234 |
-
$(document).on('learn_press_modal_search_items_response', this.addItem2);
|
235 |
-
this.userSuggest();
|
236 |
-
},
|
237 |
-
_updateDescription: function (e) {
|
238 |
-
var $sel = $(e.target),
|
239 |
-
$option = $sel.find('option:selected');
|
240 |
-
$sel.siblings('.description').hide().html($option.attr('data-desc'))
|
241 |
-
.removeClass(function (c, d) {
|
242 |
-
var m = d.match(/(lp-.*)\s?/);
|
243 |
-
return m ? m[0] : '';
|
244 |
-
}).addClass($option.val()).show();
|
245 |
-
},
|
246 |
-
userSuggest: function () {
|
247 |
-
var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
|
248 |
-
var position = {offset: '0, -1'};
|
249 |
-
if (typeof isRtl !== 'undefined' && isRtl) {
|
250 |
-
position.my = 'right top';
|
251 |
-
position.at = 'right bottom';
|
252 |
-
}
|
253 |
-
$('.wp-suggest-user').each(function () {
|
254 |
-
var $this = $(this),
|
255 |
-
autocompleteType = ( typeof $this.data('autocompleteType') !== 'undefined' ) ? $this.data('autocompleteType') : 'add',
|
256 |
-
autocompleteField = ( typeof $this.data('autocompleteField') !== 'undefined' ) ? $this.data('autocompleteField') : 'user_login';
|
257 |
-
|
258 |
-
$this.autocomplete({
|
259 |
-
source: LP_Settings.ajax + '?action=learnpress_search_users&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
|
260 |
-
delay: 500,
|
261 |
-
minLength: 2,
|
262 |
-
position: position,
|
263 |
-
open: function () {
|
264 |
-
$(this).addClass('open');
|
265 |
-
},
|
266 |
-
close: function () {
|
267 |
-
$(this).removeClass('open');
|
268 |
-
},
|
269 |
-
select: function (a, b) {
|
270 |
-
LP.log(a, b);
|
271 |
-
}
|
272 |
-
});
|
273 |
-
});
|
274 |
-
},
|
275 |
-
resetModal: function (height, $app) {
|
276 |
-
this.$('#learn-press-courses-result').css('height', height - 120).css('overflow', 'auto');
|
277 |
-
},
|
278 |
-
updateModal: function ($app) {
|
279 |
-
this.$('#learn-press-courses-result').css('height', '').css('overflow', '');
|
280 |
-
},
|
281 |
-
showFormItems: function (type) {
|
282 |
-
var $form = LP.ModalSearchItems({
|
283 |
-
template: 'tmpl-learn-press-search-items',
|
284 |
-
type: 'lp_course',
|
285 |
-
//section : $button.closest('.curriculum-section'),
|
286 |
-
context: 'course-items',
|
287 |
-
context_id: $('#post_ID').val(),
|
288 |
-
//exclude : this.getSelectedItems(),
|
289 |
-
notices: false
|
290 |
-
});
|
291 |
-
LP.MessageBox.show($form.$el);
|
292 |
-
$form.$el.find('header input').focus();
|
293 |
-
|
294 |
-
},
|
295 |
-
_addItem: function (e) {
|
296 |
-
this.showFormItems('lp_course', 'add-lp_course')
|
297 |
-
// var $form = $('#learn-press-modal-add-order-courses');
|
298 |
-
// if ($form.length == 0) {
|
299 |
-
// $form = $(wp.template('learn-press-modal-add-order-courses')());
|
300 |
-
// }
|
301 |
-
// LP.MessageBox.show($form);
|
302 |
-
},
|
303 |
-
addItem2: function (e, $view, $items) {
|
304 |
-
var that = this;
|
305 |
-
var selected = $items; //$form.find('li:visible input:checked'),
|
306 |
-
if (e.ctrlKey) {
|
307 |
-
//return true;
|
308 |
-
}
|
309 |
-
var ids = [];
|
310 |
-
selected.each(function () {
|
311 |
-
ids.push($(this).data('id'));
|
312 |
-
});
|
313 |
-
|
314 |
-
$.ajax({
|
315 |
-
url: LP_Settings.ajax,
|
316 |
-
data: {
|
317 |
-
action: 'learnpress_add_item_to_order',
|
318 |
-
order_id: parseInt($('input#post_ID').val()),
|
319 |
-
item_id: ids,
|
320 |
-
nonce: $('#learn-press-modal-add-order-courses').attr('data-nonce')
|
321 |
-
},
|
322 |
-
dataType: 'text',
|
323 |
-
type: 'post',
|
324 |
-
success: function (response) {
|
325 |
-
LP.log(response);
|
326 |
-
response = LP.parseJSON(response);
|
327 |
-
if (response.result === 'success') {
|
328 |
-
var $order_table = $('.order-items'),
|
329 |
-
$no_item = $order_table.find('.no-order-items');
|
330 |
-
$(response.item_html).insertBefore($no_item);
|
331 |
-
$order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
|
332 |
-
$order_table.find('.order-total').html(response.order_data.total_html);
|
333 |
-
|
334 |
-
selected.each(function () {
|
335 |
-
console.log($(this));
|
336 |
-
$(this).remove();
|
337 |
-
});
|
338 |
-
$no_item.addClass('hide-if-js');
|
339 |
-
}
|
340 |
-
}
|
341 |
-
});
|
342 |
-
|
343 |
-
return false;
|
344 |
-
// restart sortable
|
345 |
-
// _makeListSortable();
|
346 |
-
},
|
347 |
-
addItem: function (e, ids) {
|
348 |
-
console.log('add item to order');
|
349 |
-
|
350 |
-
var that = this,
|
351 |
-
$item = $(e.target);
|
352 |
-
if (e.ctrlKey) {
|
353 |
-
//return true;
|
354 |
-
}
|
355 |
-
$.ajax({
|
356 |
-
url: LP_Settings.ajax,
|
357 |
-
data: {
|
358 |
-
action: 'learnpress_add_item_to_order',
|
359 |
-
order_id: parseInt($('input#post_ID').val()),
|
360 |
-
item_id: parseInt($item.attr('data-id')),
|
361 |
-
nonce: $('#learn-press-modal-add-order-courses').attr('data-nonce')
|
362 |
-
},
|
363 |
-
dataType: 'text',
|
364 |
-
type: 'post',
|
365 |
-
success: function (response) {
|
366 |
-
LP.log(response);
|
367 |
-
response = LP.parseJSON(response);
|
368 |
-
if (response.result === 'success') {
|
369 |
-
var $order_table = that.$('.order-items'),
|
370 |
-
$no_item = $order_table.find('.no-order-items');
|
371 |
-
$(response.item_html).insertBefore($no_item);
|
372 |
-
$order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
|
373 |
-
$order_table.find('.order-total').html(response.order_data.total_html);
|
374 |
-
|
375 |
-
$item.remove();
|
376 |
-
$no_item.addClass('hide-if-js');
|
377 |
-
}
|
378 |
-
}
|
379 |
-
});
|
380 |
-
|
381 |
-
return false;
|
382 |
-
},
|
383 |
-
removeItem: function (e) {
|
384 |
-
e.preventDefault();
|
385 |
-
var that = this,
|
386 |
-
$item = $(e.target).closest('tr'),
|
387 |
-
item_id = parseInt($item.attr('data-item_id'));
|
388 |
-
if (!item_id) {
|
389 |
-
return;
|
390 |
-
}
|
391 |
-
$.ajax({
|
392 |
-
url: LP_Settings.ajax,
|
393 |
-
data: {
|
394 |
-
action: 'learnpress_remove_order_item',
|
395 |
-
order_id: $('#post_ID').val(),
|
396 |
-
item_id: item_id,
|
397 |
-
remove_nonce: $item.attr('data-remove_nonce')
|
398 |
-
},
|
399 |
-
type: 'post',
|
400 |
-
dataType: 'text',
|
401 |
-
success: function (response) {
|
402 |
-
response = LP.parseJSON(response);
|
403 |
-
if (response.result === 'success') {
|
404 |
-
var $order_table = that.$('.order-items'),
|
405 |
-
$no_item = $order_table.find('.no-order-items'),
|
406 |
-
$other_items = $item.siblings().filter(function () {
|
407 |
-
return !$(this).is($no_item);
|
408 |
-
});
|
409 |
-
$order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
|
410 |
-
$order_table.find('.order-total').html(response.order_data.total_html);
|
411 |
-
$item.remove();
|
412 |
-
$other_items.length == 0 && $no_item.removeClass('hide-if-js');
|
413 |
-
}
|
414 |
-
}
|
415 |
-
});
|
416 |
-
},
|
417 |
-
calculateTotal: function (e) {
|
418 |
-
LP.log(e);
|
419 |
-
},
|
420 |
-
fetchResults: function (results) {
|
421 |
-
var $list = this.$('#learn-press-courses-result'),
|
422 |
-
$t = $list.find('li').filter(function () {
|
423 |
-
return $(this).hasClass('lp-search-no-results') ? true : $(this).remove() && false;
|
424 |
-
});
|
425 |
-
_.each(results, function (i, k) {
|
426 |
-
$('<li><a href="' + i.permalink + '" data-id="' + k + '">' + i.title + '</a></li>').insertBefore($t);
|
427 |
-
});
|
428 |
-
},
|
429 |
-
searchItems: function (e) {
|
430 |
-
var that = this,
|
431 |
-
$input = $(e.target),
|
432 |
-
timer = $input.data('timer'),
|
433 |
-
term = $input.val(),
|
434 |
-
_search = function () {
|
435 |
-
$.ajax({
|
436 |
-
url: LP_Settings.ajax,
|
437 |
-
data: {
|
438 |
-
action: 'learnpress_search_courses',
|
439 |
-
nonce: $input.attr('data-nonce'),
|
440 |
-
term: term
|
441 |
-
},
|
442 |
-
type: 'get',
|
443 |
-
dataType: 'text',
|
444 |
-
success: function (response) {
|
445 |
-
response = LP.parseJSON(response);
|
446 |
-
that.fetchResults(response);
|
447 |
-
}
|
448 |
-
});
|
449 |
-
};
|
450 |
-
timer && clearTimeout(timer);
|
451 |
-
if ((term + '').length >= 3) {
|
452 |
-
timer = setTimeout(_search, 250);
|
453 |
-
$input.data('timer', timer);
|
454 |
-
}
|
455 |
-
}
|
456 |
-
});
|
457 |
-
|
458 |
-
$(document).ready(function () {
|
459 |
-
new LP_Order_View();
|
460 |
-
});*/
|
461 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal-search-items.js
DELETED
@@ -1,145 +0,0 @@
|
|
1 |
-
/*global jQuery, Backbone, _ */
|
2 |
-
(function ($, _) {
|
3 |
-
'use strict';
|
4 |
-
window.$Vue = window.$Vue || Vue;
|
5 |
-
var $VueHTTP = $Vue.http;
|
6 |
-
|
7 |
-
$(document).ready(function () {
|
8 |
-
$Vue.component('learn-press-modal-search-items', {
|
9 |
-
template: '#learn-press-modal-search-items',
|
10 |
-
data: function () {
|
11 |
-
return {
|
12 |
-
paged: 1,
|
13 |
-
term: '',
|
14 |
-
hasItems: false,
|
15 |
-
selected: []
|
16 |
-
}
|
17 |
-
},
|
18 |
-
watch: {
|
19 |
-
show: function (value) {
|
20 |
-
if (value) {
|
21 |
-
$(this.$refs.search).focus();
|
22 |
-
}
|
23 |
-
}
|
24 |
-
},
|
25 |
-
props: ['postType', 'context', 'contextId', 'show', 'callbacks', 'exclude'],
|
26 |
-
created: function () {
|
27 |
-
},
|
28 |
-
mounted: function () {
|
29 |
-
this.term = '';
|
30 |
-
this.paged = 1;
|
31 |
-
this.search();
|
32 |
-
},
|
33 |
-
methods: {
|
34 |
-
doSearch: function (e) {
|
35 |
-
this.term = e.target.value;
|
36 |
-
this.paged = 1;
|
37 |
-
this.search();
|
38 |
-
},
|
39 |
-
search: _.debounce(function (term) {
|
40 |
-
$('#modal-search-items').addClass('loading');
|
41 |
-
var that = this;
|
42 |
-
$VueHTTP.post(
|
43 |
-
window.location.href, {
|
44 |
-
type: this.postType,
|
45 |
-
context: this.context,
|
46 |
-
context_id: this.contextId,
|
47 |
-
term: term || this.term,
|
48 |
-
paged: this.paged,
|
49 |
-
exclude: this.exclude,
|
50 |
-
'lp-ajax': 'modal_search_items'
|
51 |
-
}, {
|
52 |
-
emulateJSON: true,
|
53 |
-
params: {}
|
54 |
-
}
|
55 |
-
).then(function (response) {
|
56 |
-
var result = LP.parseJSON(response.body || response.bodyText);
|
57 |
-
that.hasItems = !!_.size(result.items);
|
58 |
-
|
59 |
-
$('#modal-search-items').removeClass('loading');
|
60 |
-
|
61 |
-
$(that.$el).find('.search-results').html(result.html).find('input[type="checkbox"]').each(function () {
|
62 |
-
var id = parseInt($(this).val());
|
63 |
-
if (_.indexOf(that.selected, id) >= 0) {
|
64 |
-
this.checked = true;
|
65 |
-
}
|
66 |
-
});
|
67 |
-
_.debounce(function () {
|
68 |
-
$(that.$el).find('.search-nav').html(result.nav).find('a, span').addClass('button').filter('span').addClass('disabled');
|
69 |
-
}, 10)();
|
70 |
-
});
|
71 |
-
}, 500),
|
72 |
-
loadPage: function (e) {
|
73 |
-
e.preventDefault();
|
74 |
-
var $button = $(e.target);
|
75 |
-
if ($button.is('span')) {
|
76 |
-
return;
|
77 |
-
}
|
78 |
-
if ($button.hasClass('next')) {
|
79 |
-
this.paged++;
|
80 |
-
} else if ($button.hasClass('prev')) {
|
81 |
-
this.paged--;
|
82 |
-
} else {
|
83 |
-
var paged = $button.html();
|
84 |
-
this.paged = parseInt(paged);
|
85 |
-
}
|
86 |
-
this.search();
|
87 |
-
},
|
88 |
-
selectItem: function (e) {
|
89 |
-
var $select = $(e.target).closest('li'),
|
90 |
-
$chk = $select.find('input[type="checkbox"]'),
|
91 |
-
id = parseInt($chk.val()),
|
92 |
-
pos = _.indexOf(this.selected, id);
|
93 |
-
|
94 |
-
if ($chk.is(':checked')) {
|
95 |
-
if (pos === -1) {
|
96 |
-
this.selected.push(id);
|
97 |
-
}
|
98 |
-
} else {
|
99 |
-
if (pos >= 0) {
|
100 |
-
this.selected.splice(pos, 1);
|
101 |
-
}
|
102 |
-
}
|
103 |
-
},
|
104 |
-
addItems: function () {
|
105 |
-
var close = true;
|
106 |
-
if (this.callbacks && this.callbacks.addItems) {
|
107 |
-
this.callbacks.addItems.call(this);
|
108 |
-
}
|
109 |
-
$(document).triggerHandler('learn-press/add-order-items', this.selected);
|
110 |
-
},
|
111 |
-
close: function () {
|
112 |
-
this.$emit('close');
|
113 |
-
}
|
114 |
-
}
|
115 |
-
});
|
116 |
-
|
117 |
-
window.LP.$modalSearchItems = new $Vue({
|
118 |
-
el: '#vue-modal-search-items',
|
119 |
-
data: {
|
120 |
-
show: false,
|
121 |
-
term: '',
|
122 |
-
postType: '',
|
123 |
-
callbacks: {},
|
124 |
-
exclude: '',
|
125 |
-
context: ''
|
126 |
-
},
|
127 |
-
methods: {
|
128 |
-
open: function (options) {
|
129 |
-
_.each(options.data, function (v, k) {
|
130 |
-
this[k] = v;
|
131 |
-
}, this);
|
132 |
-
|
133 |
-
this.callbacks = options.callbacks;
|
134 |
-
this.focusSearch();
|
135 |
-
},
|
136 |
-
close: function () {
|
137 |
-
this.show = false;
|
138 |
-
},
|
139 |
-
focusSearch: _.debounce(function () {
|
140 |
-
$('input[name="search"]', this.$el).focus();
|
141 |
-
}, 200)
|
142 |
-
}
|
143 |
-
});
|
144 |
-
});
|
145 |
-
}(jQuery, _));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal-search-users.js
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
/*global jQuery, Backbone, _ */
|
2 |
-
( function ($, _) {
|
3 |
-
'use strict';
|
4 |
-
window.$Vue = window.$Vue || Vue;
|
5 |
-
|
6 |
-
var $VueHTTP = $Vue.http;
|
7 |
-
|
8 |
-
$(document).ready(function () {
|
9 |
-
$Vue.component('learn-press-modal-search-users', {
|
10 |
-
template: '#learn-press-modal-search-users',
|
11 |
-
data: function () {
|
12 |
-
return {
|
13 |
-
paged: 1,
|
14 |
-
term: '',
|
15 |
-
hasUsers: false,
|
16 |
-
selected: []
|
17 |
-
}
|
18 |
-
},
|
19 |
-
watch: {
|
20 |
-
show: function (value) {
|
21 |
-
if (value) {
|
22 |
-
$(this.$refs.search).focus();
|
23 |
-
}
|
24 |
-
}
|
25 |
-
},
|
26 |
-
props: ['multiple', 'context', 'contextId', 'show', 'callbacks', 'textFormat', 'exclude'],
|
27 |
-
created: function () {
|
28 |
-
|
29 |
-
},
|
30 |
-
methods: {
|
31 |
-
doSearch: function (e) {
|
32 |
-
this.term = e.target.value;
|
33 |
-
this.paged = 1;
|
34 |
-
this.search();
|
35 |
-
},
|
36 |
-
search: _.debounce(function (term) {
|
37 |
-
var that = this;
|
38 |
-
$VueHTTP.post(
|
39 |
-
window.location.href, {
|
40 |
-
type: this.postType,
|
41 |
-
context: this.context,
|
42 |
-
context_id: this.contextId,
|
43 |
-
term: term || this.term,
|
44 |
-
paged: this.paged,
|
45 |
-
multiple: this.multiple ? 'yes': 'no',
|
46 |
-
text_format: this.textFormat,
|
47 |
-
exclude: this.exclude,
|
48 |
-
'lp-ajax': 'modal_search_users'
|
49 |
-
}, {
|
50 |
-
emulateJSON: true,
|
51 |
-
params: {}
|
52 |
-
}
|
53 |
-
).then(function (response) {
|
54 |
-
|
55 |
-
var result = LP.parseJSON(response.body || response.bodyText);
|
56 |
-
that.hasUsers = !!_.size(result.users);
|
57 |
-
|
58 |
-
$(that.$el).find('.search-results').html(result.html).find('input[type="checkbox"]').each(function () {
|
59 |
-
var id = parseInt($(this).val());
|
60 |
-
if (_.indexOf(that.selected, id) >= 0) {
|
61 |
-
this.checked = true;
|
62 |
-
}
|
63 |
-
});
|
64 |
-
_.debounce(function () {
|
65 |
-
$(that.$el).find('.search-nav').html(result.nav).find('a, span').addClass('button').filter('span').addClass('disabled');
|
66 |
-
}, 10)();
|
67 |
-
});
|
68 |
-
}, 500),
|
69 |
-
loadPage: function (e) {
|
70 |
-
e.preventDefault();
|
71 |
-
var $button = $(e.target);
|
72 |
-
if ($button.is('span')) {
|
73 |
-
return;
|
74 |
-
}
|
75 |
-
if ($button.hasClass('next')) {
|
76 |
-
this.paged++;
|
77 |
-
} else if ($button.hasClass('prev')) {
|
78 |
-
this.paged--;
|
79 |
-
} else {
|
80 |
-
var paged = $button.html();
|
81 |
-
this.paged = parseInt(paged);
|
82 |
-
}
|
83 |
-
this.search();
|
84 |
-
},
|
85 |
-
selectItem: function (e) {
|
86 |
-
var $select = $(e.target).closest('li'),
|
87 |
-
$chk = $select.find('input[type="checkbox"]'),
|
88 |
-
id = parseInt($chk.val()),
|
89 |
-
//pos = _.indexOf(this.selected, id),
|
90 |
-
pos = _.findLastIndex(this.selected, {id: id});
|
91 |
-
if(this.multiple) {
|
92 |
-
if ($chk.is(':checked')) {
|
93 |
-
if (pos === -1) {
|
94 |
-
this.selected.push($select.closest('li').data('data'));
|
95 |
-
}
|
96 |
-
} else {
|
97 |
-
if (pos >= 0) {
|
98 |
-
this.selected.splice(pos, 1);
|
99 |
-
}
|
100 |
-
}
|
101 |
-
}else{
|
102 |
-
e.preventDefault();
|
103 |
-
this.selected = [$select.closest('li').data('data')];
|
104 |
-
this.addUsers();
|
105 |
-
}
|
106 |
-
},
|
107 |
-
addUsers:function(){
|
108 |
-
var $els = $(this.$el).find('.lp-result-item');
|
109 |
-
if(this.callbacks && this.callbacks.addUsers){
|
110 |
-
this.callbacks.addUsers.call(this, this.selected);
|
111 |
-
}
|
112 |
-
$(document).triggerHandler('learn-press/modal-add-users', this.selected);
|
113 |
-
},
|
114 |
-
close: function () {
|
115 |
-
this.$emit('close');
|
116 |
-
}
|
117 |
-
}
|
118 |
-
});
|
119 |
-
|
120 |
-
window.LP.$modalSearchUsers = new $Vue({
|
121 |
-
el: '#vue-modal-search-users',
|
122 |
-
data: {
|
123 |
-
show: false,
|
124 |
-
term: '',
|
125 |
-
multiple: false,
|
126 |
-
callbacks: {},
|
127 |
-
textFormat: '{{display_name}} ({{email}})',
|
128 |
-
exclude: 0
|
129 |
-
},
|
130 |
-
methods: {
|
131 |
-
open: function (options) {
|
132 |
-
_.each(options.data, function (v, k) {
|
133 |
-
this[k] = v;
|
134 |
-
}, this);
|
135 |
-
this.callbacks = options.callbacks;
|
136 |
-
this.focusSearch();
|
137 |
-
},
|
138 |
-
close: function () {
|
139 |
-
this.show = false;
|
140 |
-
},
|
141 |
-
focusSearch: _.debounce(function(){
|
142 |
-
$('input[name="search"]', this.$el).focus();
|
143 |
-
}, 200)
|
144 |
-
}
|
145 |
-
});
|
146 |
-
});
|
147 |
-
|
148 |
-
}(jQuery, _));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/pages/setup.js
ADDED
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 60);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 10:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
Object.defineProperty(exports, "__esModule", {
|
75 |
+
value: true
|
76 |
+
});
|
77 |
+
exports.default = isEmail;
|
78 |
+
/**
|
79 |
+
* Validate is an email.
|
80 |
+
*
|
81 |
+
* @param email
|
82 |
+
* @return {boolean}
|
83 |
+
*/
|
84 |
+
function isEmail(email) {
|
85 |
+
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
86 |
+
return re.test(email);
|
87 |
+
};
|
88 |
+
|
89 |
+
/***/ }),
|
90 |
+
|
91 |
+
/***/ 60:
|
92 |
+
/***/ (function(module, exports, __webpack_require__) {
|
93 |
+
|
94 |
+
"use strict";
|
95 |
+
|
96 |
+
|
97 |
+
var _emailValidator = __webpack_require__(10);
|
98 |
+
|
99 |
+
var _emailValidator2 = _interopRequireDefault(_emailValidator);
|
100 |
+
|
101 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
102 |
+
|
103 |
+
;(function ($) {
|
104 |
+
"use strict";
|
105 |
+
|
106 |
+
var $main, $setupForm;
|
107 |
+
|
108 |
+
var checkForm = function checkForm($form) {
|
109 |
+
var $emails = $form.find('input[type="email"]'),
|
110 |
+
valid = true;
|
111 |
+
|
112 |
+
$emails.each(function () {
|
113 |
+
var $this = $(this);
|
114 |
+
$this.css('border-color', '');
|
115 |
+
|
116 |
+
switch ($this.attr('name')) {
|
117 |
+
case 'settings[paypal][paypal_email]':
|
118 |
+
case 'settings[paypal][paypal_sandbox_email]':
|
119 |
+
if (!$this.closest('tr').prev().find('input[type="checkbox"]').is(':checked')) {
|
120 |
+
return;
|
121 |
+
}
|
122 |
+
break;
|
123 |
+
}
|
124 |
+
if (!(0, _emailValidator2.default)(this.value)) {
|
125 |
+
valid = false;
|
126 |
+
$this.css('border-color', '#FF0000');
|
127 |
+
}
|
128 |
+
});
|
129 |
+
|
130 |
+
return valid;
|
131 |
+
};
|
132 |
+
|
133 |
+
var blockContent = function blockContent(block) {
|
134 |
+
$main.toggleClass('loading', block === undefined ? true : block);
|
135 |
+
};
|
136 |
+
|
137 |
+
var getFormData = function getFormData(more) {
|
138 |
+
var data = $setupForm.serializeJSON();
|
139 |
+
|
140 |
+
return $.extend(data, more || {});
|
141 |
+
};
|
142 |
+
|
143 |
+
var replaceMainContent = function replaceMainContent(newContent) {
|
144 |
+
var $newContent = $(newContent);
|
145 |
+
$main.replaceWith($newContent);
|
146 |
+
$main = $newContent;
|
147 |
+
};
|
148 |
+
|
149 |
+
var navPages = function navPages(e) {
|
150 |
+
e.preventDefault();
|
151 |
+
var loadUrl = $(this).attr('href');
|
152 |
+
|
153 |
+
if (!checkForm($setupForm)) {
|
154 |
+
return;
|
155 |
+
}
|
156 |
+
|
157 |
+
$main.addClass('loading');
|
158 |
+
$.post({
|
159 |
+
url: loadUrl,
|
160 |
+
data: getFormData(),
|
161 |
+
success: function success(res) {
|
162 |
+
var $html = $(res);
|
163 |
+
replaceMainContent($html.contents().filter('#main'));
|
164 |
+
|
165 |
+
LP.setUrl(loadUrl);
|
166 |
+
|
167 |
+
$('.learn-press-dropdown-pages').LP('DropdownPages');
|
168 |
+
$('.learn-press-tip').LP('QuickTip');
|
169 |
+
$main.removeClass('loading');
|
170 |
+
}
|
171 |
+
});
|
172 |
+
};
|
173 |
+
|
174 |
+
var updateCurrency = function updateCurrency() {
|
175 |
+
var m = $(this).children(':selected').html().match(/\((.*)\)/),
|
176 |
+
symbol = m ? m[1] : '';
|
177 |
+
$('#currency-pos').children().each(function () {
|
178 |
+
|
179 |
+
var $option = $(this),
|
180 |
+
text = $option.html();
|
181 |
+
|
182 |
+
switch ($option.val()) {
|
183 |
+
case 'left':
|
184 |
+
text = text.replace(/\( (.*)69/, '( ' + symbol + '69');
|
185 |
+
break;
|
186 |
+
case 'right':
|
187 |
+
text = text.replace(/9([^0-9]*) \)/, '9' + symbol + ' )');
|
188 |
+
break;
|
189 |
+
case 'left_with_space':
|
190 |
+
text = text.replace(/\( (.*) 6/, '( ' + symbol + ' 6');
|
191 |
+
break;
|
192 |
+
case 'right_with_space':
|
193 |
+
text = text.replace(/9 (.*) \)/, '9 ' + symbol + ' )');
|
194 |
+
break;
|
195 |
+
}
|
196 |
+
$option.html(text);
|
197 |
+
});
|
198 |
+
};
|
199 |
+
|
200 |
+
var updatePrice = function updatePrice() {
|
201 |
+
$.post({
|
202 |
+
url: '',
|
203 |
+
dataType: 'html',
|
204 |
+
data: getFormData({
|
205 |
+
'lp-ajax': 'get-price-format'
|
206 |
+
}),
|
207 |
+
success: function success(res) {
|
208 |
+
$('#preview-price').html(res);
|
209 |
+
}
|
210 |
+
});
|
211 |
+
};
|
212 |
+
|
213 |
+
var createPages = function createPages(e) {
|
214 |
+
e.preventDefault();
|
215 |
+
blockContent();
|
216 |
+
$.post({
|
217 |
+
url: $(this).attr('href'),
|
218 |
+
dataType: 'html',
|
219 |
+
data: getFormData({
|
220 |
+
'lp-ajax': 'setup-create-pages'
|
221 |
+
}),
|
222 |
+
success: function success(res) {
|
223 |
+
replaceMainContent($(res).contents().filter('#main'));
|
224 |
+
$('.learn-press-dropdown-pages').LP('DropdownPages');
|
225 |
+
blockContent(false);
|
226 |
+
}
|
227 |
+
});
|
228 |
+
};
|
229 |
+
|
230 |
+
var installSampleCourse = function installSampleCourse(e) {
|
231 |
+
e.preventDefault();
|
232 |
+
|
233 |
+
var $button = $(this);
|
234 |
+
blockContent();
|
235 |
+
|
236 |
+
$.post({
|
237 |
+
url: $(this).attr('href'),
|
238 |
+
dataType: 'html',
|
239 |
+
data: {},
|
240 |
+
success: function success(res) {
|
241 |
+
blockContent(false);
|
242 |
+
$button.replaceWith($(res).find('a:first').addClass('button button-primary'));
|
243 |
+
}
|
244 |
+
});
|
245 |
+
};
|
246 |
+
|
247 |
+
function onReady() {
|
248 |
+
|
249 |
+
$main = $('#main');
|
250 |
+
$setupForm = $('#learn-press-setup-form');
|
251 |
+
|
252 |
+
$(document).on('click', '.buttons .button', navPages).on('change', '#currency', updateCurrency).on('change', 'input, select', updatePrice).on('click', '#create-pages', createPages).on('click', '#install-sample-course', installSampleCourse);
|
253 |
+
}
|
254 |
+
|
255 |
+
$(document).ready(onReady);
|
256 |
+
})(jQuery);
|
257 |
+
|
258 |
+
/***/ })
|
259 |
+
|
260 |
+
/******/ });
|
261 |
+
//# sourceMappingURL=setup.js.map
|
assets/js/admin/pages/setup.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=60)}({10:function(e,t,n){"use strict";function r(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},60:function(e,t,n){"use strict";var r=n(10),a=function(e){return e&&e.__esModule?e:{default:e}}(r);!function(e){function t(){n=e("#main"),r=e("#learn-press-setup-form"),e(document).on("click",".buttons .button",u).on("change","#currency",l).on("change","input, select",p).on("click","#create-pages",f).on("click","#install-sample-course",d)}var n,r,c=function(t){var n=t.find('input[type="email"]'),r=!0;return n.each(function(){var t=e(this);switch(t.css("border-color",""),t.attr("name")){case"settings[paypal][paypal_email]":case"settings[paypal][paypal_sandbox_email]":if(!t.closest("tr").prev().find('input[type="checkbox"]').is(":checked"))return}(0,a.default)(this.value)||(r=!1,t.css("border-color","#FF0000"))}),r},s=function(e){n.toggleClass("loading",void 0===e||e)},i=function(t){var n=r.serializeJSON();return e.extend(n,t||{})},o=function(t){var r=e(t);n.replaceWith(r),n=r},u=function(t){t.preventDefault();var a=e(this).attr("href");c(r)&&(n.addClass("loading"),e.post({url:a,data:i(),success:function(t){var r=e(t);o(r.contents().filter("#main")),LP.setUrl(a),e(".learn-press-dropdown-pages").LP("DropdownPages"),e(".learn-press-tip").LP("QuickTip"),n.removeClass("loading")}}))},l=function(){var t=e(this).children(":selected").html().match(/\((.*)\)/),n=t?t[1]:"";e("#currency-pos").children().each(function(){var t=e(this),r=t.html();switch(t.val()){case"left":r=r.replace(/\( (.*)69/,"( "+n+"69");break;case"right":r=r.replace(/9([^0-9]*) \)/,"9"+n+" )");break;case"left_with_space":r=r.replace(/\( (.*) 6/,"( "+n+" 6");break;case"right_with_space":r=r.replace(/9 (.*) \)/,"9 "+n+" )")}t.html(r)})},p=function(){e.post({url:"",dataType:"html",data:i({"lp-ajax":"get-price-format"}),success:function(t){e("#preview-price").html(t)}})},f=function(t){t.preventDefault(),s(),e.post({url:e(this).attr("href"),dataType:"html",data:i({"lp-ajax":"setup-create-pages"}),success:function(t){o(e(t).contents().filter("#main")),e(".learn-press-dropdown-pages").LP("DropdownPages"),s(!1)}})},d=function(t){t.preventDefault();var n=e(this);s(),e.post({url:e(this).attr("href"),dataType:"html",data:{},success:function(t){s(!1),n.replaceWith(e(t).find("a:first").addClass("button button-primary"))}})};e(document).ready(t)}(jQuery)}});
|
assets/js/admin/pages/statistic.js
ADDED
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 9);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 9:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
;(function ($) {
|
75 |
+
$.fn.LP_Chart_Line = function (data, config) {
|
76 |
+
return $.each(this, function () {
|
77 |
+
var $elem = $(this),
|
78 |
+
$canvas = $('<canvas />');
|
79 |
+
$elem.html('');
|
80 |
+
$canvas.appendTo($elem);
|
81 |
+
new Chart($canvas.get(0).getContext('2d')).Line(data, config);
|
82 |
+
});
|
83 |
+
//
|
84 |
+
};
|
85 |
+
|
86 |
+
$.fn.LP_Statistic_Users = function () {
|
87 |
+
if (parseInt($(this).length) === 0) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
return $.each(this, function () {
|
91 |
+
var $buttons = $('.chart-buttons button').on('click', function () {
|
92 |
+
var $button = $(this),
|
93 |
+
type = $button.data('type'),
|
94 |
+
from = '',
|
95 |
+
to = '',
|
96 |
+
$container = $('#learn-press-chart');
|
97 |
+
$buttons.not(this).not('[data-type="user-custom-time"]').prop('disabled', false);
|
98 |
+
if (type == 'user-custom-time') {
|
99 |
+
from = $('#user-custom-time input[name="from"]').val();
|
100 |
+
to = $('#user-custom-time input[name="to"]').val();
|
101 |
+
|
102 |
+
if (from == '' || to == '') {
|
103 |
+
return false;
|
104 |
+
}
|
105 |
+
} else {
|
106 |
+
$button.prop('disabled', true);
|
107 |
+
}
|
108 |
+
$container.addClass('loading');
|
109 |
+
$.ajax({
|
110 |
+
url: 'admin-ajax.php',
|
111 |
+
data: {
|
112 |
+
action: 'learnpress_load_chart',
|
113 |
+
type: type,
|
114 |
+
range: [from, to]
|
115 |
+
},
|
116 |
+
dataType: 'text',
|
117 |
+
success: function success(response) {
|
118 |
+
response = LP.parseJSON(response);
|
119 |
+
$container.LP_Chart_Line(response, LP_Chart_Config);
|
120 |
+
$container.removeClass('loading');
|
121 |
+
}
|
122 |
+
});
|
123 |
+
return false;
|
124 |
+
}),
|
125 |
+
$inputs = $('.chart-buttons #user-custom-time input[type="text"]').change(function () {
|
126 |
+
var _valid_date = function _valid_date() {
|
127 |
+
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
128 |
+
return true;
|
129 |
+
}
|
130 |
+
};
|
131 |
+
$buttons.filter('[data-type="user-custom-time"]').prop('disabled', $inputs.filter(function () {
|
132 |
+
return this.value == '';
|
133 |
+
}).get().length || !_valid_date());
|
134 |
+
});
|
135 |
+
});
|
136 |
+
};
|
137 |
+
|
138 |
+
$.fn.LP_Statistic_Courses = function () {
|
139 |
+
if (parseInt($(this).length) === 0) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
return $.each(this, function () {
|
143 |
+
var $buttons = $('.chart-buttons button').on('click', function () {
|
144 |
+
var $button = $(this),
|
145 |
+
type = $button.data('type'),
|
146 |
+
from = '',
|
147 |
+
to = '',
|
148 |
+
$container = $('#learn-press-chart');
|
149 |
+
$buttons.not(this).not('[data-type="course-custom-time"]').prop('disabled', false);
|
150 |
+
if (type == 'course-custom-time') {
|
151 |
+
from = $('#course-custom-time input[name="from"]').val();
|
152 |
+
to = $('#course-custom-time input[name="to"]').val();
|
153 |
+
|
154 |
+
if (from == '' || to == '') {
|
155 |
+
return false;
|
156 |
+
}
|
157 |
+
} else {
|
158 |
+
$button.prop('disabled', true);
|
159 |
+
}
|
160 |
+
$container.addClass('loading');
|
161 |
+
$.ajax({
|
162 |
+
url: 'admin-ajax.php',
|
163 |
+
data: {
|
164 |
+
action: 'learnpress_load_chart',
|
165 |
+
type: type,
|
166 |
+
range: [from, to]
|
167 |
+
},
|
168 |
+
dataType: 'text',
|
169 |
+
success: function success(response) {
|
170 |
+
response = LP.parseJSON(response);
|
171 |
+
$container.LP_Chart_Line(response, LP_Chart_Config);
|
172 |
+
$container.removeClass('loading');
|
173 |
+
}
|
174 |
+
});
|
175 |
+
return false;
|
176 |
+
}),
|
177 |
+
$inputs = $('.chart-buttons #course-custom-time input[type="text"]').change(function () {
|
178 |
+
var _valid_date = function _valid_date() {
|
179 |
+
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
180 |
+
return true;
|
181 |
+
}
|
182 |
+
};
|
183 |
+
$buttons.filter('[data-type="course-custom-time"]').prop('disabled', $inputs.filter(function () {
|
184 |
+
return this.value == '';
|
185 |
+
}).get().length || !_valid_date());
|
186 |
+
});
|
187 |
+
});
|
188 |
+
};
|
189 |
+
|
190 |
+
$.fn.LP_Statistic_Orders = function () {
|
191 |
+
if (parseInt($(this).length) === 0) {
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
$('.panel_report_option').hide();
|
195 |
+
$('#panel_report_sales_by_' + $('#report_sales_by').val()).show();
|
196 |
+
$('#report_sales_by').on('change', function () {
|
197 |
+
$('.panel_report_option').hide();
|
198 |
+
$('#panel_report_sales_by_' + $(this).val()).show();
|
199 |
+
if ('date' == $(this).val()) {
|
200 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
201 |
+
}
|
202 |
+
});
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Upgrade Chart for Order Statistics
|
206 |
+
* @returns {Boolean}
|
207 |
+
*/
|
208 |
+
var LP_Statistic_Orders_Upgrade_Chart = function LP_Statistic_Orders_Upgrade_Chart() {
|
209 |
+
var type = '',
|
210 |
+
from = '',
|
211 |
+
to = '',
|
212 |
+
report_sales_by = 'date',
|
213 |
+
cat_id = 0,
|
214 |
+
course_id = 0;
|
215 |
+
report_sales_by = $('#report_sales_by').val();
|
216 |
+
$container = $('#learn-press-chart');
|
217 |
+
$container.addClass('loading');
|
218 |
+
// get type
|
219 |
+
var $buttons = $('.chart-buttons button:disabled').not('[data-type="order-custom-time"]');
|
220 |
+
if (parseInt($buttons.length) > 0) {
|
221 |
+
type = $($buttons[0]).data('type');
|
222 |
+
} else {
|
223 |
+
type = 'order-custom-time';
|
224 |
+
from = $('#order-custom-time input[name="from"]').val();
|
225 |
+
to = $('#order-custom-time input[name="to"]').val();
|
226 |
+
if (from == '' || to == '') {
|
227 |
+
return false;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
if ('course' === report_sales_by) {
|
231 |
+
course_id = $('#report-by-course-id').val();
|
232 |
+
} else if ('category' === report_sales_by) {
|
233 |
+
cat_id = $('#report-by-course-category-id').val();
|
234 |
+
}
|
235 |
+
|
236 |
+
$.ajax({
|
237 |
+
url: 'admin-ajax.php',
|
238 |
+
data: {
|
239 |
+
action: 'learnpress_load_chart',
|
240 |
+
type: type,
|
241 |
+
range: [from, to],
|
242 |
+
report_sales_by: report_sales_by,
|
243 |
+
course_id: course_id,
|
244 |
+
cat_id: cat_id
|
245 |
+
},
|
246 |
+
dataType: 'text',
|
247 |
+
success: function success(response) {
|
248 |
+
response = LP.parseJSON(response);
|
249 |
+
$container.LP_Chart_Line(response, LP_Chart_Config);
|
250 |
+
$container.removeClass('loading');
|
251 |
+
}
|
252 |
+
});
|
253 |
+
};
|
254 |
+
|
255 |
+
$('#report-by-course-id').select2({
|
256 |
+
placeholder: 'Select a course',
|
257 |
+
minimumInputLength: 1,
|
258 |
+
ajax: {
|
259 |
+
url: ajaxurl + '?action=learnpress_search_course',
|
260 |
+
dataType: 'json',
|
261 |
+
quietMillis: 250,
|
262 |
+
data: function data(term, page) {
|
263 |
+
return {
|
264 |
+
q: term // search term
|
265 |
+
};
|
266 |
+
},
|
267 |
+
results: function results(data, page) {
|
268 |
+
return { results: data.items };
|
269 |
+
},
|
270 |
+
cache: true
|
271 |
+
}
|
272 |
+
});
|
273 |
+
|
274 |
+
$('#report-by-course-id').on('change', function () {
|
275 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
276 |
+
});
|
277 |
+
|
278 |
+
$('#report-by-course-category-id').select2({
|
279 |
+
placeholder: 'Select a course',
|
280 |
+
minimumInputLength: 1,
|
281 |
+
ajax: {
|
282 |
+
url: ajaxurl + '?action=learnpress_search_course_category',
|
283 |
+
dataType: 'json',
|
284 |
+
quietMillis: 250,
|
285 |
+
data: function data(term, page) {
|
286 |
+
return {
|
287 |
+
q: term // search term
|
288 |
+
};
|
289 |
+
},
|
290 |
+
results: function results(data, page) {
|
291 |
+
return { results: data.items };
|
292 |
+
},
|
293 |
+
cache: true
|
294 |
+
}
|
295 |
+
});
|
296 |
+
|
297 |
+
$('#report-by-course-category-id').on('change', function () {
|
298 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
299 |
+
});
|
300 |
+
|
301 |
+
var $buttons = $('.chart-buttons button').on('click', function () {
|
302 |
+
var $button = $(this),
|
303 |
+
type = $button.data('type'),
|
304 |
+
from = '',
|
305 |
+
to = '',
|
306 |
+
$container = $('#learn-press-chart');
|
307 |
+
$buttons.not(this).not('[data-type="order-custom-time"]').prop('disabled', false);
|
308 |
+
if (type !== 'order-custom-time') {
|
309 |
+
$button.prop('disabled', true);
|
310 |
+
$('#order-custom-time input[name="from"]').val('');
|
311 |
+
$('#order-custom-time input[name="to"]').val('');
|
312 |
+
}
|
313 |
+
LP_Statistic_Orders_Upgrade_Chart();
|
314 |
+
return false;
|
315 |
+
});
|
316 |
+
|
317 |
+
var $inputs = $('.chart-buttons #order-custom-time input[type="text"]').change(function () {
|
318 |
+
var _valid_date = function _valid_date() {
|
319 |
+
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
320 |
+
return true;
|
321 |
+
}
|
322 |
+
};
|
323 |
+
$buttons.filter('[data-type="order-custom-time"]').prop('disabled', $inputs.filter(function () {
|
324 |
+
return this.value == '';
|
325 |
+
}).get().length || !_valid_date());
|
326 |
+
});
|
327 |
+
};
|
328 |
+
$(document).ready(function () {
|
329 |
+
if (typeof $.fn.datepicker != 'undefined') {
|
330 |
+
$(".date-picker").datepicker({
|
331 |
+
dateFormat: 'yy/mm/dd'
|
332 |
+
});
|
333 |
+
}
|
334 |
+
$('.learn-press-statistic-users').LP_Statistic_Users();
|
335 |
+
$('.learn-press-statistic-courses').LP_Statistic_Courses();
|
336 |
+
$('.learn-press-statistic-orders').LP_Statistic_Orders();
|
337 |
+
});
|
338 |
+
return;
|
339 |
+
|
340 |
+
var student_chart;
|
341 |
+
window.drawStudentsChart = drawStudentsChart = function drawStudentsChart(data, config) {
|
342 |
+
var $student_chart = $("#lpr-chart-students").clone().attr('style', '').removeAttr("width").removeAttr('height');
|
343 |
+
$("#lpr-chart-students").replaceWith($student_chart);
|
344 |
+
$student_chart = $student_chart[0].getContext("2d");
|
345 |
+
student_chart = new Chart($student_chart).Line(data, config);
|
346 |
+
};
|
347 |
+
if (typeof last_seven_days == 'undefined') return;
|
348 |
+
drawStudentsChart(last_seven_days, config);
|
349 |
+
|
350 |
+
var courses_chart;
|
351 |
+
window.drawCoursesChart = drawCoursesChart = function drawCoursesChart(data, config) {
|
352 |
+
var $courses_chart = $("#lpr-chart-courses").clone().attr('style', '').removeAttr("width").removeAttr('height');
|
353 |
+
$("#lpr-chart-courses").replaceWith($courses_chart);
|
354 |
+
$courses_chart = $courses_chart[0].getContext("2d");
|
355 |
+
courses_chart = new Chart($courses_chart).Bar(data, config);
|
356 |
+
};
|
357 |
+
if (typeof data == 'undefined') return;
|
358 |
+
|
359 |
+
drawCoursesChart(data, config);
|
360 |
+
})(jQuery);
|
361 |
+
|
362 |
+
/***/ })
|
363 |
+
|
364 |
+
/******/ });
|
365 |
+
//# sourceMappingURL=statistic.js.map
|
assets/js/admin/pages/statistic.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){function e(a){if(r[a])return r[a].exports;var n=r[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};e.m=t,e.c=r,e.d=function(t,r,a){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=9)}({9:function(t,e,r){"use strict";!function(t){return t.fn.LP_Chart_Line=function(e,r){return t.each(this,function(){var a=t(this),n=t("<canvas />");a.html(""),n.appendTo(a),new Chart(n.get(0).getContext("2d")).Line(e,r)})},t.fn.LP_Statistic_Users=function(){if(0!==parseInt(t(this).length))return t.each(this,function(){var e=t(".chart-buttons button").on("click",function(){var r=t(this),a=r.data("type"),n="",o="",s=t("#learn-press-chart");if(e.not(this).not('[data-type="user-custom-time"]').prop("disabled",!1),"user-custom-time"==a){if(n=t('#user-custom-time input[name="from"]').val(),o=t('#user-custom-time input[name="to"]').val(),""==n||""==o)return!1}else r.prop("disabled",!0);return s.addClass("loading"),t.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:a,range:[n,o]},dataType:"text",success:function(t){t=LP.parseJSON(t),s.LP_Chart_Line(t,LP_Chart_Config),s.removeClass("loading")}}),!1}),r=t('.chart-buttons #user-custom-time input[type="text"]').change(function(){e.filter('[data-type="user-custom-time"]').prop("disabled",r.filter(function(){return""==this.value}).get().length||!function(){if(new Date(r[0].value)<new Date(r[1].value))return!0}())})})},t.fn.LP_Statistic_Courses=function(){if(0!==parseInt(t(this).length))return t.each(this,function(){var e=t(".chart-buttons button").on("click",function(){var r=t(this),a=r.data("type"),n="",o="",s=t("#learn-press-chart");if(e.not(this).not('[data-type="course-custom-time"]').prop("disabled",!1),"course-custom-time"==a){if(n=t('#course-custom-time input[name="from"]').val(),o=t('#course-custom-time input[name="to"]').val(),""==n||""==o)return!1}else r.prop("disabled",!0);return s.addClass("loading"),t.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:a,range:[n,o]},dataType:"text",success:function(t){t=LP.parseJSON(t),s.LP_Chart_Line(t,LP_Chart_Config),s.removeClass("loading")}}),!1}),r=t('.chart-buttons #course-custom-time input[type="text"]').change(function(){e.filter('[data-type="course-custom-time"]').prop("disabled",r.filter(function(){return""==this.value}).get().length||!function(){if(new Date(r[0].value)<new Date(r[1].value))return!0}())})})},t.fn.LP_Statistic_Orders=function(){if(0!==parseInt(t(this).length)){t(".panel_report_option").hide(),t("#panel_report_sales_by_"+t("#report_sales_by").val()).show(),t("#report_sales_by").on("change",function(){t(".panel_report_option").hide(),t("#panel_report_sales_by_"+t(this).val()).show(),"date"==t(this).val()&&e()});var e=function(){var e="",r="",a="",n="date",o=0,s=0;n=t("#report_sales_by").val(),$container=t("#learn-press-chart"),$container.addClass("loading");var i=t(".chart-buttons button:disabled").not('[data-type="order-custom-time"]');if(parseInt(i.length)>0)e=t(i[0]).data("type");else if(e="order-custom-time",r=t('#order-custom-time input[name="from"]').val(),a=t('#order-custom-time input[name="to"]').val(),""==r||""==a)return!1;"course"===n?s=t("#report-by-course-id").val():"category"===n&&(o=t("#report-by-course-category-id").val()),t.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:e,range:[r,a],report_sales_by:n,course_id:s,cat_id:o},dataType:"text",success:function(t){t=LP.parseJSON(t),$container.LP_Chart_Line(t,LP_Chart_Config),$container.removeClass("loading")}})};t("#report-by-course-id").select2({placeholder:"Select a course",minimumInputLength:1,ajax:{url:ajaxurl+"?action=learnpress_search_course",dataType:"json",quietMillis:250,data:function(t,e){return{q:t}},results:function(t,e){return{results:t.items}},cache:!0}}),t("#report-by-course-id").on("change",function(){e()}),t("#report-by-course-category-id").select2({placeholder:"Select a course",minimumInputLength:1,ajax:{url:ajaxurl+"?action=learnpress_search_course_category",dataType:"json",quietMillis:250,data:function(t,e){return{q:t}},results:function(t,e){return{results:t.items}},cache:!0}}),t("#report-by-course-category-id").on("change",function(){e()});var r=t(".chart-buttons button").on("click",function(){var a=t(this),n=a.data("type");t("#learn-press-chart");return r.not(this).not('[data-type="order-custom-time"]').prop("disabled",!1),"order-custom-time"!==n&&(a.prop("disabled",!0),t('#order-custom-time input[name="from"]').val(""),t('#order-custom-time input[name="to"]').val("")),e(),!1}),a=t('.chart-buttons #order-custom-time input[type="text"]').change(function(){r.filter('[data-type="order-custom-time"]').prop("disabled",a.filter(function(){return""==this.value}).get().length||!function(){if(new Date(a[0].value)<new Date(a[1].value))return!0}())})}},void t(document).ready(function(){void 0!==t.fn.datepicker&&t(".date-picker").datepicker({dateFormat:"yy/mm/dd"}),t(".learn-press-statistic-users").LP_Statistic_Users(),t(".learn-press-statistic-courses").LP_Statistic_Courses(),t(".learn-press-statistic-orders").LP_Statistic_Orders()})}(jQuery)}});
|
assets/js/admin/partial/meta-box-order.js
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 59);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 59:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
;
|
75 |
+
(function ($) {
|
76 |
+
"use strict";
|
77 |
+
|
78 |
+
window.$Vue = window.$Vue || Vue;
|
79 |
+
|
80 |
+
$(document).ready(function () {
|
81 |
+
|
82 |
+
var $listItems = $('.list-order-items').find('tbody'),
|
83 |
+
$listUsers = $('#list-users'),
|
84 |
+
template = function template(templateHTML, data) {
|
85 |
+
return _.template(templateHTML, {
|
86 |
+
evaluate: /<#([\s\S]+?)#>/g,
|
87 |
+
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
88 |
+
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
89 |
+
})(data);
|
90 |
+
},
|
91 |
+
advancedListOptions = {
|
92 |
+
template: '#tmpl-order-advanced-list-item',
|
93 |
+
onRemove: function onRemove() {
|
94 |
+
if (this.$el.children().length === 0) {
|
95 |
+
this.$el.append('<li class="user-guest">' + orderOptions.i18n_guest + '</li>');
|
96 |
+
}
|
97 |
+
console.log(this.$el);
|
98 |
+
},
|
99 |
+
onAdd: function onAdd() {
|
100 |
+
this.$el.find('.user-guest').remove();
|
101 |
+
}
|
102 |
+
},
|
103 |
+
orderOptions = lpMetaBoxOrderSettings;
|
104 |
+
|
105 |
+
function getAddedUsers() {
|
106 |
+
return $('#list-users').children().map(function () {
|
107 |
+
return $(this).data('id');
|
108 |
+
}).get();
|
109 |
+
}
|
110 |
+
|
111 |
+
function getAddedItems() {
|
112 |
+
return $('.list-order-items tbody').children('.order-item-row').map(function () {
|
113 |
+
return $(this).data('id');
|
114 |
+
}).get();
|
115 |
+
}
|
116 |
+
|
117 |
+
if ($listUsers.length) {
|
118 |
+
$listUsers.LP('AdvancedList', advancedListOptions);
|
119 |
+
if (orderOptions.users) {
|
120 |
+
_.forEach(orderOptions.users, function (userData, userId) {
|
121 |
+
$listUsers.LP('AdvancedList', 'add', [template(orderOptions.userTextFormat, userData), userId]);
|
122 |
+
});
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
$listItems.on('click', '.remove-order-item', function (e) {
|
127 |
+
e.preventDefault();
|
128 |
+
var $item = $(this).closest('tr'),
|
129 |
+
item_id = $item.data('item_id');
|
130 |
+
|
131 |
+
$item.remove();
|
132 |
+
if ($listItems.children(':not(.no-order-items)').length === 0) {
|
133 |
+
$listItems.find('.no-order-items').show();
|
134 |
+
}
|
135 |
+
|
136 |
+
$Vue.http.post(window.location.href, {
|
137 |
+
order_id: $('#post_ID').val(),
|
138 |
+
items: [item_id],
|
139 |
+
'lp-ajax': 'remove_items_from_order'
|
140 |
+
}, {
|
141 |
+
emulateJSON: true,
|
142 |
+
params: {}
|
143 |
+
}).then(function (response) {
|
144 |
+
var result = LP.parseJSON(response.body || response.bodyText);
|
145 |
+
$('.order-subtotal').html(result.order_data.subtotal_html);
|
146 |
+
$('.order-total').html(result.order_data.total_html);
|
147 |
+
});
|
148 |
+
});
|
149 |
+
|
150 |
+
$('.order-date.date-picker').on('change', function () {
|
151 |
+
var m = this.value.split('-');
|
152 |
+
['aa', 'mm', 'jj'].forEach(function (v, k) {
|
153 |
+
$('input[name="' + v + '"]').val(m[k]);
|
154 |
+
});
|
155 |
+
}).datepicker({
|
156 |
+
dateFormat: 'yy-mm-dd',
|
157 |
+
numberOfMonths: 1,
|
158 |
+
showButtonPanel: true,
|
159 |
+
select: function select() {
|
160 |
+
console.log(arguments);
|
161 |
+
}
|
162 |
+
});
|
163 |
+
|
164 |
+
$('#learn-press-add-order-item').on('click', function () {
|
165 |
+
LP.$modalSearchItems.open({
|
166 |
+
data: {
|
167 |
+
postType: 'lp_course',
|
168 |
+
context: 'order-items',
|
169 |
+
contextId: $('#post_ID').val(),
|
170 |
+
exclude: getAddedItems(),
|
171 |
+
show: true
|
172 |
+
},
|
173 |
+
callbacks: {
|
174 |
+
addItems: function addItems() {
|
175 |
+
var that = this;
|
176 |
+
$Vue.http.post(window.location.href, {
|
177 |
+
order_id: this.contextId,
|
178 |
+
items: this.selected,
|
179 |
+
'lp-ajax': 'add_items_to_order'
|
180 |
+
}, {
|
181 |
+
emulateJSON: true,
|
182 |
+
params: {}
|
183 |
+
}).then(function (response) {
|
184 |
+
var result = LP.parseJSON(response.body || response.bodyText),
|
185 |
+
$noItem = $listItems.find('.no-order-items').hide();
|
186 |
+
$(result.item_html).insertBefore($noItem);
|
187 |
+
$('.order-subtotal').html(result.order_data.subtotal_html);
|
188 |
+
$('.order-total').html(result.order_data.total_html);
|
189 |
+
});
|
190 |
+
this.close();
|
191 |
+
}
|
192 |
+
}
|
193 |
+
});
|
194 |
+
});
|
195 |
+
|
196 |
+
$(document).on('click', '.change-user', function (e) {
|
197 |
+
e.preventDefault();
|
198 |
+
LP.$modalSearchUsers.open({
|
199 |
+
data: {
|
200 |
+
context: 'order-items',
|
201 |
+
contextId: $('#post_ID').val(),
|
202 |
+
show: true,
|
203 |
+
multiple: $(this).data('multiple') === 'yes',
|
204 |
+
exclude: getAddedUsers(),
|
205 |
+
textFormat: orderOptions.userTextFormat
|
206 |
+
},
|
207 |
+
callbacks: {
|
208 |
+
addUsers: function addUsers(data) {
|
209 |
+
|
210 |
+
if (this.multiple) {
|
211 |
+
if (!$listUsers.length) {
|
212 |
+
$listUsers = $(LP.template('tmpl-order-data-user')({ multiple: true }));
|
213 |
+
$listUsers.LP('AdvancedList', advancedListOptions);
|
214 |
+
|
215 |
+
$('.order-data-user').replaceWith($listUsers);
|
216 |
+
}
|
217 |
+
for (var i = 0; i < this.selected.length; i++) {
|
218 |
+
$listUsers.LP('AdvancedList', 'add', [template(this.textFormat, this.selected[i]), this.selected[i].id]);
|
219 |
+
}
|
220 |
+
} else {
|
221 |
+
var $html = LP.template('tmpl-order-data-user')({
|
222 |
+
name: template(this.textFormat, this.selected[0]),
|
223 |
+
id: this.selected[0].id
|
224 |
+
});
|
225 |
+
|
226 |
+
$('.order-data-user').replaceWith($html);
|
227 |
+
}
|
228 |
+
|
229 |
+
this.close();
|
230 |
+
}
|
231 |
+
}
|
232 |
+
});
|
233 |
+
});
|
234 |
+
});
|
235 |
+
})(jQuery);
|
236 |
+
|
237 |
+
/***/ })
|
238 |
+
|
239 |
+
/******/ });
|
240 |
+
//# sourceMappingURL=meta-box-order.js.map
|
assets/js/admin/partial/meta-box-order.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=59)}({59:function(e,t,r){"use strict";!function(e){window.$Vue=window.$Vue||Vue,e(document).ready(function(){function t(){return e("#list-users").children().map(function(){return e(this).data("id")}).get()}function r(){return e(".list-order-items tbody").children(".order-item-row").map(function(){return e(this).data("id")}).get()}var o=e(".list-order-items").find("tbody"),n=e("#list-users"),a=function(e,t){return _.template(e,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})(t)},s={template:"#tmpl-order-advanced-list-item",onRemove:function(){0===this.$el.children().length&&this.$el.append('<li class="user-guest">'+i.i18n_guest+"</li>"),console.log(this.$el)},onAdd:function(){this.$el.find(".user-guest").remove()}},i=lpMetaBoxOrderSettings;n.length&&(n.LP("AdvancedList",s),i.users&&_.forEach(i.users,function(e,t){n.LP("AdvancedList","add",[a(i.userTextFormat,e),t])})),o.on("click",".remove-order-item",function(t){t.preventDefault();var r=e(this).closest("tr"),n=r.data("item_id");r.remove(),0===o.children(":not(.no-order-items)").length&&o.find(".no-order-items").show(),$Vue.http.post(window.location.href,{order_id:e("#post_ID").val(),items:[n],"lp-ajax":"remove_items_from_order"},{emulateJSON:!0,params:{}}).then(function(t){var r=LP.parseJSON(t.body||t.bodyText);e(".order-subtotal").html(r.order_data.subtotal_html),e(".order-total").html(r.order_data.total_html)})}),e(".order-date.date-picker").on("change",function(){var t=this.value.split("-");["aa","mm","jj"].forEach(function(r,o){e('input[name="'+r+'"]').val(t[o])})}).datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,select:function(){console.log(arguments)}}),e("#learn-press-add-order-item").on("click",function(){LP.$modalSearchItems.open({data:{postType:"lp_course",context:"order-items",contextId:e("#post_ID").val(),exclude:r(),show:!0},callbacks:{addItems:function(){$Vue.http.post(window.location.href,{order_id:this.contextId,items:this.selected,"lp-ajax":"add_items_to_order"},{emulateJSON:!0,params:{}}).then(function(t){var r=LP.parseJSON(t.body||t.bodyText),n=o.find(".no-order-items").hide();e(r.item_html).insertBefore(n),e(".order-subtotal").html(r.order_data.subtotal_html),e(".order-total").html(r.order_data.total_html)}),this.close()}}})}),e(document).on("click",".change-user",function(r){r.preventDefault(),LP.$modalSearchUsers.open({data:{context:"order-items",contextId:e("#post_ID").val(),show:!0,multiple:"yes"===e(this).data("multiple"),exclude:t(),textFormat:i.userTextFormat},callbacks:{addUsers:function(t){if(this.multiple){n.length||(n=e(LP.template("tmpl-order-data-user")({multiple:!0})),n.LP("AdvancedList",s),e(".order-data-user").replaceWith(n));for(var r=0;r<this.selected.length;r++)n.LP("AdvancedList","add",[a(this.textFormat,this.selected[r]),this.selected[r].id])}else{var o=LP.template("tmpl-order-data-user")({name:a(this.textFormat,this.selected[0]),id:this.selected[0].id});e(".order-data-user").replaceWith(o)}this.close()}}})})})}(jQuery)}});
|
assets/js/admin/question-editor.js
DELETED
@@ -1,330 +0,0 @@
|
|
1 |
-
;
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Helpers
|
5 |
-
*
|
6 |
-
* @since 3.0.0
|
7 |
-
*/
|
8 |
-
(function (exports) {
|
9 |
-
function cloneObject(object) {
|
10 |
-
return JSON.parse(JSON.stringify(object));
|
11 |
-
}
|
12 |
-
|
13 |
-
exports.LP_Helpers = {
|
14 |
-
cloneObject: cloneObject
|
15 |
-
};
|
16 |
-
})(window);
|
17 |
-
|
18 |
-
window.$Vue = window.$Vue || Vue;
|
19 |
-
window.$Vuex = window.$Vuex || Vuex;
|
20 |
-
|
21 |
-
var $VueHTTP = Vue.http;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Root Store
|
25 |
-
*
|
26 |
-
* @since 3.0.0
|
27 |
-
*/
|
28 |
-
(function (exports, helpers, data) {
|
29 |
-
|
30 |
-
var state = helpers.cloneObject(data.root),
|
31 |
-
i18n = helpers.cloneObject(data.i18n);
|
32 |
-
|
33 |
-
state.status = 'successful';
|
34 |
-
state.countCurrentRequest = 0;
|
35 |
-
|
36 |
-
var getters = {
|
37 |
-
id: function (state) {
|
38 |
-
return state.id;
|
39 |
-
},
|
40 |
-
type: function (state) {
|
41 |
-
return state.type;
|
42 |
-
},
|
43 |
-
code: function (state) {
|
44 |
-
return Date.now();
|
45 |
-
}
|
46 |
-
,
|
47 |
-
autoDraft: function (state) {
|
48 |
-
return state.auto_draft;
|
49 |
-
},
|
50 |
-
answers: function (state) {
|
51 |
-
return Object.values(state.answers) || [];
|
52 |
-
},
|
53 |
-
settings: function (state) {
|
54 |
-
return state.setting;
|
55 |
-
},
|
56 |
-
types: function (state) {
|
57 |
-
return state.questionTypes || [];
|
58 |
-
},
|
59 |
-
numberCorrect: function (state) {
|
60 |
-
var correct = 0;
|
61 |
-
Object.keys(state.answers).forEach(function (key) {
|
62 |
-
if (state.answers[key].is_true === 'yes') {
|
63 |
-
correct += 1;
|
64 |
-
}
|
65 |
-
});
|
66 |
-
return correct;
|
67 |
-
},
|
68 |
-
status: function (state) {
|
69 |
-
return state.status;
|
70 |
-
},
|
71 |
-
currentRequest: function (state) {
|
72 |
-
return state.countCurrentRequest || 0;
|
73 |
-
},
|
74 |
-
action: function (state) {
|
75 |
-
return state.action;
|
76 |
-
},
|
77 |
-
nonce: function (state) {
|
78 |
-
return state.nonce;
|
79 |
-
},
|
80 |
-
externalComponent: function (state) {
|
81 |
-
return state.externalComponent || [];
|
82 |
-
},
|
83 |
-
state: function (state) {
|
84 |
-
return state;
|
85 |
-
},
|
86 |
-
i18n: function (state) {
|
87 |
-
return i18n;
|
88 |
-
}
|
89 |
-
};
|
90 |
-
|
91 |
-
var mutations = {
|
92 |
-
|
93 |
-
'UPDATE_STATUS': function (state, status) {
|
94 |
-
state.status = status;
|
95 |
-
},
|
96 |
-
|
97 |
-
'UPDATE_AUTO_DRAFT_STATUS': function (state, status) {
|
98 |
-
state.auto_draft = status;
|
99 |
-
},
|
100 |
-
|
101 |
-
'CHANGE_QUESTION_TYPE': function (state, question) {
|
102 |
-
state.answers = question.answers;
|
103 |
-
state.type = question.type;
|
104 |
-
},
|
105 |
-
|
106 |
-
'SET_ANSWERS': function (state, answers) {
|
107 |
-
state.answers = answers;
|
108 |
-
},
|
109 |
-
|
110 |
-
'DELETE_ANSWER': function (state, id) {
|
111 |
-
for (var i = 0, n = state.answers.length; i < n; i++) {
|
112 |
-
if (state.answers[i].question_answer_id == id) {
|
113 |
-
state.answers[i].question_answer_id = LP.uniqueId();
|
114 |
-
break;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
},
|
118 |
-
'ADD_NEW_ANSWER': function (state, answer) {
|
119 |
-
state.answers.push(answer);
|
120 |
-
},
|
121 |
-
'UPDATE_ANSWERS': function (state, answers) {
|
122 |
-
state.answers = answers;
|
123 |
-
},
|
124 |
-
|
125 |
-
'INCREASE_NUMBER_REQUEST': function (state) {
|
126 |
-
state.countCurrentRequest++;
|
127 |
-
},
|
128 |
-
|
129 |
-
'DECREASE_NUMBER_REQUEST': function (state) {
|
130 |
-
state.countCurrentRequest--;
|
131 |
-
}
|
132 |
-
};
|
133 |
-
|
134 |
-
var actions = {
|
135 |
-
|
136 |
-
changeQuestionType: function (context, payload) {
|
137 |
-
LP.Request({
|
138 |
-
type: 'change-question-type',
|
139 |
-
question_type: payload.type,
|
140 |
-
draft_question: context.getters.autoDraft ? JSON.stringify(payload.question) : ''
|
141 |
-
}).then(function (response) {
|
142 |
-
var result = response.body;
|
143 |
-
|
144 |
-
if (result.success) {
|
145 |
-
context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
|
146 |
-
context.commit('CHANGE_QUESTION_TYPE', result.data);
|
147 |
-
}
|
148 |
-
})
|
149 |
-
},
|
150 |
-
|
151 |
-
updateAnswersOrder: function (context, order) {
|
152 |
-
LP.Request({
|
153 |
-
type: 'sort-answer',
|
154 |
-
order: order
|
155 |
-
}).then(
|
156 |
-
function (response) {
|
157 |
-
var result = response.body;
|
158 |
-
if (result.success) {
|
159 |
-
// context.commit('SET_ANSWERS', result.data);
|
160 |
-
}
|
161 |
-
}
|
162 |
-
)
|
163 |
-
},
|
164 |
-
|
165 |
-
updateAnswerTitle: function (context, answer) {
|
166 |
-
if (typeof answer.question_answer_id == 'undefined') {
|
167 |
-
return;
|
168 |
-
}
|
169 |
-
answer = JSON.stringify(answer);
|
170 |
-
LP.Request({
|
171 |
-
type: 'update-answer-title',
|
172 |
-
answer: answer
|
173 |
-
})
|
174 |
-
},
|
175 |
-
|
176 |
-
updateCorrectAnswer: function (context, correct) {
|
177 |
-
LP.Request({
|
178 |
-
type: 'change-correct',
|
179 |
-
correct: JSON.stringify(correct)
|
180 |
-
}).then(
|
181 |
-
function (response) {
|
182 |
-
var result = response.body;
|
183 |
-
if (result.success) {
|
184 |
-
context.commit('UPDATE_ANSWERS', result.data);
|
185 |
-
context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
|
186 |
-
}
|
187 |
-
}
|
188 |
-
)
|
189 |
-
},
|
190 |
-
|
191 |
-
deleteAnswer: function (context, payload) {
|
192 |
-
|
193 |
-
context.commit('DELETE_ANSWER', payload.id);
|
194 |
-
LP.Request({
|
195 |
-
type: 'delete-answer',
|
196 |
-
answer_id: payload.id
|
197 |
-
}).then(
|
198 |
-
function (response) {
|
199 |
-
var result = response.body;
|
200 |
-
|
201 |
-
if (result.success) {
|
202 |
-
context.commit('SET_ANSWERS', result.data);
|
203 |
-
} else {
|
204 |
-
// notice error
|
205 |
-
}
|
206 |
-
})
|
207 |
-
},
|
208 |
-
|
209 |
-
newAnswer: function (context, data) {
|
210 |
-
context.commit('ADD_NEW_ANSWER', data.answer);
|
211 |
-
LP.Request({
|
212 |
-
type: 'new-answer'
|
213 |
-
}).then(
|
214 |
-
function (response) {
|
215 |
-
var result = response.body;
|
216 |
-
|
217 |
-
if (result.success) {
|
218 |
-
context.commit('UPDATE_ANSWERS', result.data);
|
219 |
-
} else {
|
220 |
-
// notice error
|
221 |
-
}
|
222 |
-
})
|
223 |
-
},
|
224 |
-
|
225 |
-
newRequest: function (context) {
|
226 |
-
context.commit('INCREASE_NUMBER_REQUEST');
|
227 |
-
context.commit('UPDATE_STATUS', 'loading');
|
228 |
-
|
229 |
-
window.onbeforeunload = function () {
|
230 |
-
return '';
|
231 |
-
}
|
232 |
-
},
|
233 |
-
|
234 |
-
requestCompleted: function (context, status) {
|
235 |
-
context.commit('DECREASE_NUMBER_REQUEST');
|
236 |
-
|
237 |
-
if (context.getters.currentRequest === 0) {
|
238 |
-
context.commit('UPDATE_STATUS', status);
|
239 |
-
window.onbeforeunload = null;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
};
|
243 |
-
|
244 |
-
exports.LP_Question_Store = new $Vuex.Store({
|
245 |
-
state: state,
|
246 |
-
getters: getters,
|
247 |
-
mutations: mutations,
|
248 |
-
actions: actions
|
249 |
-
});
|
250 |
-
|
251 |
-
})(window, LP_Helpers, lp_question_editor);
|
252 |
-
|
253 |
-
|
254 |
-
/**
|
255 |
-
* HTTP
|
256 |
-
*
|
257 |
-
* @since 3.0.0
|
258 |
-
*/
|
259 |
-
(function (exports, $store) {
|
260 |
-
var $ = jQuery,
|
261 |
-
$publishingAction = null;
|
262 |
-
|
263 |
-
LP.Request = function (payload) {
|
264 |
-
$publishingAction = $('#publishing-action');
|
265 |
-
|
266 |
-
payload['id'] = $store.getters.id;
|
267 |
-
payload['nonce'] = $store.getters.nonce;
|
268 |
-
payload['lp-ajax'] = $store.getters.action;
|
269 |
-
payload['code'] = $store.getters.code;
|
270 |
-
|
271 |
-
$publishingAction.find('#publish').addClass('disabled');
|
272 |
-
$publishingAction.find('.spinner').addClass('is-active');
|
273 |
-
$publishingAction.addClass('code-' + payload['code']);
|
274 |
-
|
275 |
-
return $VueHTTP.post($store.getters.urlAjax,
|
276 |
-
payload,
|
277 |
-
{
|
278 |
-
emulateJSON: true,
|
279 |
-
params: {
|
280 |
-
namespace: 'LPQuestionEditorRequest',
|
281 |
-
code: payload['code'],
|
282 |
-
}
|
283 |
-
});
|
284 |
-
};
|
285 |
-
|
286 |
-
$VueHTTP.interceptors.push(function (request, next) {
|
287 |
-
if (request.params['namespace'] !== 'LPQuestionEditorRequest') {
|
288 |
-
next();
|
289 |
-
return;
|
290 |
-
}
|
291 |
-
|
292 |
-
$store.dispatch('newRequest');
|
293 |
-
|
294 |
-
next(function (response) {
|
295 |
-
if (!jQuery.isPlainObject(response.body)) {
|
296 |
-
response.body = LP.parseJSON(response.body);
|
297 |
-
}
|
298 |
-
|
299 |
-
var body = response.body;
|
300 |
-
var result = body.success || false;
|
301 |
-
|
302 |
-
if (result) {
|
303 |
-
$store.dispatch('requestCompleted', 'successful');
|
304 |
-
} else {
|
305 |
-
$store.dispatch('requestCompleted', 'failed');
|
306 |
-
}
|
307 |
-
$publishingAction.removeClass('code-' + request.params.code);
|
308 |
-
if (!$publishingAction.attr('class')) {
|
309 |
-
$publishingAction.find('#publish').removeClass('disabled');
|
310 |
-
$publishingAction.find('.spinner').removeClass('is-active');
|
311 |
-
}
|
312 |
-
|
313 |
-
});
|
314 |
-
});
|
315 |
-
})(window, LP_Question_Store);
|
316 |
-
|
317 |
-
|
318 |
-
/**
|
319 |
-
* Init app.
|
320 |
-
*
|
321 |
-
* @since 3.0.0
|
322 |
-
*/
|
323 |
-
(function ($, $store) {
|
324 |
-
$(document).ready(function () {
|
325 |
-
window.LP_Question_Editor = new $Vue({
|
326 |
-
el: '#admin-editor-lp_question',
|
327 |
-
template: '<lp-question-editor></lp-question-editor>'
|
328 |
-
});
|
329 |
-
});
|
330 |
-
})(jQuery, LP_Question_Store);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/quiz-editor.js
DELETED
@@ -1,1002 +0,0 @@
|
|
1 |
-
;
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Helpers
|
5 |
-
*
|
6 |
-
* @since 3.0.0
|
7 |
-
*/
|
8 |
-
(function (exports) {
|
9 |
-
function cloneObject(object) {
|
10 |
-
return JSON.parse(JSON.stringify(object));
|
11 |
-
}
|
12 |
-
|
13 |
-
exports.LP_Helpers = {
|
14 |
-
cloneObject: cloneObject
|
15 |
-
};
|
16 |
-
})(window);
|
17 |
-
|
18 |
-
window.$Vue = window.$Vue || Vue;
|
19 |
-
window.$Vuex = window.$Vuex || Vuex;
|
20 |
-
|
21 |
-
var $VueHTTP = Vue.http;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Choose quiz items modal store.
|
25 |
-
*
|
26 |
-
* @since 3.0.0
|
27 |
-
*/
|
28 |
-
var LP_Choose_Quiz_Items_Modal_Store = (function (exports, helpers, data) {
|
29 |
-
|
30 |
-
var state = helpers.cloneObject(data.chooseItems);
|
31 |
-
state.quizId = false;
|
32 |
-
state.pagination = '';
|
33 |
-
state.status = '';
|
34 |
-
|
35 |
-
var getters = {
|
36 |
-
status: function (state) {
|
37 |
-
return state.status;
|
38 |
-
},
|
39 |
-
pagination: function (state) {
|
40 |
-
return state.pagination;
|
41 |
-
},
|
42 |
-
items: function (state, _getters) {
|
43 |
-
return state.items.map(function (item) {
|
44 |
-
var find = _getters.addedItems.find(function (_item) {
|
45 |
-
return item.id === _item.id;
|
46 |
-
});
|
47 |
-
|
48 |
-
item.added = !!find;
|
49 |
-
|
50 |
-
return item;
|
51 |
-
});
|
52 |
-
},
|
53 |
-
code: function (state) {
|
54 |
-
return Date.now();
|
55 |
-
},
|
56 |
-
addedItems: function (state) {
|
57 |
-
return state.addedItems;
|
58 |
-
},
|
59 |
-
isOpen: function (state) {
|
60 |
-
return state.open;
|
61 |
-
},
|
62 |
-
quiz: function (state) {
|
63 |
-
return state.quizId;
|
64 |
-
}
|
65 |
-
};
|
66 |
-
|
67 |
-
var mutations = {
|
68 |
-
'TOGGLE': function (state) {
|
69 |
-
state.open = !state.open;
|
70 |
-
},
|
71 |
-
'SET_QUIZ': function (state, quizId) {
|
72 |
-
state.quizId = quizId;
|
73 |
-
},
|
74 |
-
'SET_LIST_ITEMS': function (state, items) {
|
75 |
-
state.items = items;
|
76 |
-
},
|
77 |
-
'ADD_ITEM': function (state, item) {
|
78 |
-
state.addedItems.push(item);
|
79 |
-
},
|
80 |
-
'REMOVE_ADDED_ITEM': function (state, item) {
|
81 |
-
state.addedItems.forEach(function (_item, index) {
|
82 |
-
if (_item.id === item.id) {
|
83 |
-
state.addedItems.splice(index, 1);
|
84 |
-
}
|
85 |
-
})
|
86 |
-
},
|
87 |
-
'RESET': function (state) {
|
88 |
-
state.addedItems = [];
|
89 |
-
state.items = [];
|
90 |
-
},
|
91 |
-
'UPDATE_PAGINATION': function (state, pagination) {
|
92 |
-
state.pagination = pagination;
|
93 |
-
},
|
94 |
-
'SEARCH_ITEM_REQUEST': function (state) {
|
95 |
-
state.status = 'loading';
|
96 |
-
},
|
97 |
-
'SEARCH_ITEM_SUCCESS': function (state) {
|
98 |
-
state.status = 'successful';
|
99 |
-
},
|
100 |
-
'SEARCH_ITEM_FAIL': function (state) {
|
101 |
-
state.status = 'fail';
|
102 |
-
}
|
103 |
-
};
|
104 |
-
|
105 |
-
var actions = {
|
106 |
-
|
107 |
-
toggle: function (context) {
|
108 |
-
context.commit('TOGGLE');
|
109 |
-
},
|
110 |
-
|
111 |
-
// open modal
|
112 |
-
open: function (context, quizId) {
|
113 |
-
context.commit('SET_QUIZ', quizId);
|
114 |
-
context.commit('RESET');
|
115 |
-
context.commit('TOGGLE');
|
116 |
-
},
|
117 |
-
|
118 |
-
// query available question
|
119 |
-
searchItems: function (context, payload) {
|
120 |
-
context.commit('SEARCH_ITEM_REQUEST');
|
121 |
-
|
122 |
-
LP.Request({
|
123 |
-
type: 'search-items',
|
124 |
-
query: payload.query,
|
125 |
-
page: payload.page,
|
126 |
-
exclude: JSON.stringify([])
|
127 |
-
}).then(
|
128 |
-
function (response) {
|
129 |
-
var result = response.body;
|
130 |
-
|
131 |
-
if (!result.success) {
|
132 |
-
return;
|
133 |
-
}
|
134 |
-
|
135 |
-
var data = result.data;
|
136 |
-
|
137 |
-
context.commit('SET_LIST_ITEMS', data.items);
|
138 |
-
context.commit('UPDATE_PAGINATION', data.pagination);
|
139 |
-
context.commit('SEARCH_ITEM_SUCCESS');
|
140 |
-
},
|
141 |
-
function (error) {
|
142 |
-
context.commit('SEARCH_ITEMS_FAIL');
|
143 |
-
|
144 |
-
console.log(error);
|
145 |
-
}
|
146 |
-
);
|
147 |
-
},
|
148 |
-
|
149 |
-
// add question
|
150 |
-
addItem: function (context, item) {
|
151 |
-
context.commit('ADD_ITEM', item);
|
152 |
-
},
|
153 |
-
|
154 |
-
// remove question
|
155 |
-
removeItem: function (context, index) {
|
156 |
-
context.commit('REMOVE_ADDED_ITEM', index);
|
157 |
-
},
|
158 |
-
|
159 |
-
addQuestionsToQuiz: function (context, quiz) {
|
160 |
-
var items = context.getters.addedItems;
|
161 |
-
|
162 |
-
if (items.length > 0) {
|
163 |
-
LP.Request({
|
164 |
-
type: 'add-questions-to-quiz',
|
165 |
-
items: JSON.stringify(items),
|
166 |
-
draft_quiz: JSON.stringify(quiz)
|
167 |
-
}).then(
|
168 |
-
function (response) {
|
169 |
-
var result = response.body;
|
170 |
-
|
171 |
-
if (result.success) {
|
172 |
-
var questions = result.data;
|
173 |
-
|
174 |
-
// update quiz list questions
|
175 |
-
context.commit('lqs/SET_QUESTIONS', questions, {root: true});
|
176 |
-
context.commit('TOGGLE');
|
177 |
-
}
|
178 |
-
},
|
179 |
-
function (error) {
|
180 |
-
console.log(error);
|
181 |
-
}
|
182 |
-
)
|
183 |
-
}
|
184 |
-
}
|
185 |
-
};
|
186 |
-
|
187 |
-
return {
|
188 |
-
namespaced: true,
|
189 |
-
state: state,
|
190 |
-
getters: getters,
|
191 |
-
mutations: mutations,
|
192 |
-
actions: actions
|
193 |
-
}
|
194 |
-
|
195 |
-
})(window, LP_Helpers, lp_quiz_editor);
|
196 |
-
|
197 |
-
/**
|
198 |
-
* I18n Store
|
199 |
-
*
|
200 |
-
* @since 3.0.0
|
201 |
-
*/
|
202 |
-
var LP_Quiz_i18n_Store = (function (helpers, data) {
|
203 |
-
|
204 |
-
var state = helpers.cloneObject(data.i18n);
|
205 |
-
|
206 |
-
var getters = {
|
207 |
-
all: function (state) {
|
208 |
-
return state;
|
209 |
-
}
|
210 |
-
};
|
211 |
-
|
212 |
-
return {
|
213 |
-
namespaced: true,
|
214 |
-
state: state,
|
215 |
-
getters: getters
|
216 |
-
}
|
217 |
-
|
218 |
-
})(LP_Helpers, lp_quiz_editor);
|
219 |
-
|
220 |
-
/**
|
221 |
-
* List quiz questions store.
|
222 |
-
*
|
223 |
-
* @since 3.0.0
|
224 |
-
*/
|
225 |
-
var LP_List_Quiz_Questions_Store = (function (helpers, data, $) {
|
226 |
-
|
227 |
-
var state = helpers.cloneObject(data.listQuestions);
|
228 |
-
|
229 |
-
state.statusUpdateQuestions = {};
|
230 |
-
state.statusUpdateQuestionItem = {};
|
231 |
-
state.statusUpdateQuestionAnswer = {};
|
232 |
-
|
233 |
-
state.questions = state.questions.map(function (question) {
|
234 |
-
var hiddenQuestions = state.hidden_questions;
|
235 |
-
var find = hiddenQuestions.find(function (questionId) {
|
236 |
-
return parseInt(question.id) === parseInt(questionId);
|
237 |
-
});
|
238 |
-
|
239 |
-
question.open = !find;
|
240 |
-
|
241 |
-
return question;
|
242 |
-
});
|
243 |
-
|
244 |
-
var getters = {
|
245 |
-
listQuestions: function (state) {
|
246 |
-
return state.questions || [];
|
247 |
-
},
|
248 |
-
questionsOrder: function (state) {
|
249 |
-
return state.order || [];
|
250 |
-
},
|
251 |
-
externalComponent: function (state) {
|
252 |
-
return state.externalComponent || [];
|
253 |
-
},
|
254 |
-
hiddenQuestionsSettings: function (state) {
|
255 |
-
return state.hidden_questions_settings || [];
|
256 |
-
},
|
257 |
-
hiddenQuestions: function (state) {
|
258 |
-
return state.questions
|
259 |
-
.filter(function (question) {
|
260 |
-
return !question.open;
|
261 |
-
})
|
262 |
-
.map(function (question) {
|
263 |
-
return parseInt(question.id);
|
264 |
-
})
|
265 |
-
},
|
266 |
-
isHiddenListQuestions: function (state, getters) {
|
267 |
-
var questions = getters['listQuestions'];
|
268 |
-
var hiddenQuestions = getters['hiddenQuestions'];
|
269 |
-
|
270 |
-
return questions.length === hiddenQuestions.length;
|
271 |
-
},
|
272 |
-
disableUpdateList: function (state) {
|
273 |
-
return state.disableUpdateList;
|
274 |
-
},
|
275 |
-
statusUpdateQuestions: function (state) {
|
276 |
-
return state.statusUpdateQuestions;
|
277 |
-
},
|
278 |
-
statusUpdateQuestionItem: function (state) {
|
279 |
-
return state.statusUpdateQuestionItem;
|
280 |
-
},
|
281 |
-
statusUpdateQuestionAnswer: function (state) {
|
282 |
-
return state.statusUpdateQuestionAnswer;
|
283 |
-
}
|
284 |
-
};
|
285 |
-
|
286 |
-
var mutations = {
|
287 |
-
'SORT_QUESTIONS': function (state, orders) {
|
288 |
-
state.questions = state.questions.map(function (question) {
|
289 |
-
question.order = orders[question.id];
|
290 |
-
return question;
|
291 |
-
});
|
292 |
-
},
|
293 |
-
'SORT_QUESTION_ANSWERS': function (state, orders) {
|
294 |
-
state.questions = state.questions.map(function (question) {
|
295 |
-
question.answers.answer_order = orders[question.answers.question_answer_id];
|
296 |
-
return question;
|
297 |
-
})
|
298 |
-
},
|
299 |
-
'ADD_QUESTION_ANSWER': function (state, payload) {
|
300 |
-
state.questions = state.questions.map(function (question) {
|
301 |
-
if (question.id === payload.question_id) {
|
302 |
-
var found = false;
|
303 |
-
if (payload.answer.temp_id) {
|
304 |
-
for (var i = 0, n = question.answers.length; i < n; i++) {
|
305 |
-
if (question.answers[i].question_answer_id == payload.answer.temp_id) {
|
306 |
-
found = true;
|
307 |
-
$Vue.set(question.answers, i, payload.answer);
|
308 |
-
}
|
309 |
-
}
|
310 |
-
}
|
311 |
-
|
312 |
-
!found && question.answers.push(payload.answer);
|
313 |
-
return question;
|
314 |
-
} else {
|
315 |
-
return question;
|
316 |
-
}
|
317 |
-
})
|
318 |
-
},
|
319 |
-
'CHANGE_QUESTION_CORRECT_ANSWERS': function (state, data) {
|
320 |
-
state.questions = state.questions.map(function (question) {
|
321 |
-
if (parseInt(question.id) === data.id) {
|
322 |
-
question.answers = data.answers;
|
323 |
-
}
|
324 |
-
return question;
|
325 |
-
});
|
326 |
-
},
|
327 |
-
'SET_QUESTIONS': function (state, questions) {
|
328 |
-
state.questions = questions;
|
329 |
-
},
|
330 |
-
'ADD_NEW_QUESTION': function (state, question) {
|
331 |
-
var found = false;
|
332 |
-
if (question.temp_id) {
|
333 |
-
for (var i = 0, n = state.questions.length; i < n; i++) {
|
334 |
-
if (state.questions[i].id === question.temp_id) {
|
335 |
-
$Vue.set(state.questions, i, question);
|
336 |
-
found = true;
|
337 |
-
break;
|
338 |
-
}
|
339 |
-
}
|
340 |
-
}
|
341 |
-
if (!found) {
|
342 |
-
var _last_child = $('.lp-list-questions .main > div:last-child');
|
343 |
-
if (_last_child.length) {
|
344 |
-
var _offset = _last_child.offset().top;
|
345 |
-
$('html,body').animate({scrollTop: _offset});
|
346 |
-
}
|
347 |
-
|
348 |
-
state.questions.push(question);
|
349 |
-
}
|
350 |
-
},
|
351 |
-
'CHANGE_QUESTION_TYPE': function (state, data) {
|
352 |
-
state.questions = state.questions.map(function (question) {
|
353 |
-
if (parseInt(question.id) === data.id) {
|
354 |
-
question.answers = data.answers;
|
355 |
-
question.type = data.type;
|
356 |
-
question.open = true;
|
357 |
-
}
|
358 |
-
return question;
|
359 |
-
});
|
360 |
-
},
|
361 |
-
'REMOVE_QUESTION': function (state, item) {
|
362 |
-
var questions = state.questions,
|
363 |
-
index = questions.indexOf(item);
|
364 |
-
|
365 |
-
if (item.temp_id) {
|
366 |
-
state.questions[index].id = item.temp_id;
|
367 |
-
} else {
|
368 |
-
state.questions.splice(index, 1);
|
369 |
-
}
|
370 |
-
},
|
371 |
-
'DELETE_QUESTION_ANSWER': function (state, payload) {
|
372 |
-
var question_id = payload.question_id,
|
373 |
-
answer_id = payload.answer_id;
|
374 |
-
|
375 |
-
state.questions = state.questions.map(function (question) {
|
376 |
-
if (question.id === question_id) {
|
377 |
-
var answers = question.answers;
|
378 |
-
answers.forEach(function (answer) {
|
379 |
-
if (answer.question_answer_id === answer_id) {
|
380 |
-
var index = answers.indexOf(answer);
|
381 |
-
answers.splice(index, 1);
|
382 |
-
}
|
383 |
-
})
|
384 |
-
}
|
385 |
-
return question;
|
386 |
-
});
|
387 |
-
},
|
388 |
-
'REMOVE_QUESTIONS': function () {
|
389 |
-
// code
|
390 |
-
},
|
391 |
-
'CLOSE_QUESTION': function (state, question) {
|
392 |
-
state.questions.forEach(function (_question, index) {
|
393 |
-
if (question.id === _question.id) {
|
394 |
-
state.questions[index].open = false;
|
395 |
-
}
|
396 |
-
});
|
397 |
-
},
|
398 |
-
'OPEN_QUESTION': function (state, question) {
|
399 |
-
state.questions.forEach(function (_question, index) {
|
400 |
-
if ((question.id) === _question.id) {
|
401 |
-
state.questions[index].open = true;
|
402 |
-
}
|
403 |
-
});
|
404 |
-
},
|
405 |
-
'CLOSE_LIST_QUESTIONS': function (state) {
|
406 |
-
state.questions = state.questions.map(function (_question) {
|
407 |
-
_question.open = false;
|
408 |
-
|
409 |
-
return _question;
|
410 |
-
});
|
411 |
-
},
|
412 |
-
'OPEN_LIST_QUESTIONS': function (state) {
|
413 |
-
state.questions = state.questions.map(function (_question) {
|
414 |
-
_question.open = true;
|
415 |
-
|
416 |
-
return _question;
|
417 |
-
})
|
418 |
-
},
|
419 |
-
'UPDATE_QUESTION_REQUEST': function (state, questionId) {
|
420 |
-
$Vue.set(state.statusUpdateQuestionItem, questionId, 'updating');
|
421 |
-
},
|
422 |
-
'UPDATE_QUESTION_SUCCESS': function (state, questionID) {
|
423 |
-
$Vue.set(state.statusUpdateQuestionItem, questionID, 'successful');
|
424 |
-
},
|
425 |
-
'UPDATE_QUESTION_FAILURE': function (state, questionID) {
|
426 |
-
$Vue.set(state.statusUpdateQuestionItem, questionID, 'failed')
|
427 |
-
},
|
428 |
-
|
429 |
-
'UPDATE_QUESTION_ANSWER_REQUEST': function (state, question_id) {
|
430 |
-
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'updating');
|
431 |
-
},
|
432 |
-
'UPDATE_QUESTION_ANSWER_SUCCESS': function (state, question_id) {
|
433 |
-
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'successful');
|
434 |
-
},
|
435 |
-
'UPDATE_QUESTION_ANSWER_FAIL': function (state, question_id) {
|
436 |
-
$Vue.set(state.statusUpdateQuestionAnswer, question_id, 'failed');
|
437 |
-
},
|
438 |
-
'DELETE_ANSWER': function (state, data) {
|
439 |
-
state.questions.map(function (question, index) {
|
440 |
-
if (question.id == data.question_id) {
|
441 |
-
for (var i = 0, n = question.answers.length; i < n; i++) {
|
442 |
-
if (question.answers[i].question_answer_id == data.answer_id) {
|
443 |
-
question.answers[i].question_answer_id = data.temp_id;
|
444 |
-
//state.questions[index].answers.splice(i, 1);
|
445 |
-
break;
|
446 |
-
}
|
447 |
-
}
|
448 |
-
return false;
|
449 |
-
}
|
450 |
-
})
|
451 |
-
|
452 |
-
}
|
453 |
-
};
|
454 |
-
|
455 |
-
var actions = {
|
456 |
-
|
457 |
-
toggleAll: function (context) {
|
458 |
-
var hidden = context.getters['isHiddenListQuestions'];
|
459 |
-
|
460 |
-
if (hidden) {
|
461 |
-
context.commit('OPEN_LIST_QUESTIONS');
|
462 |
-
} else {
|
463 |
-
context.commit('CLOSE_LIST_QUESTIONS');
|
464 |
-
}
|
465 |
-
|
466 |
-
LP.Request({
|
467 |
-
type: 'hidden-questions',
|
468 |
-
hidden: context.getters['hiddenQuestions']
|
469 |
-
})
|
470 |
-
},
|
471 |
-
|
472 |
-
updateQuizQuestionsHidden: function (context, data) {
|
473 |
-
LP.Request($.extend({}, data, {
|
474 |
-
type: 'update-quiz-questions-hidden'
|
475 |
-
}));
|
476 |
-
},
|
477 |
-
|
478 |
-
newQuestion: function (context, payload) {
|
479 |
-
var newQuestion = JSON.parse(JSON.stringify(payload.question));
|
480 |
-
newQuestion.settings = {};
|
481 |
-
context.commit('ADD_NEW_QUESTION', newQuestion);
|
482 |
-
LP.Request({
|
483 |
-
type: 'new-question',
|
484 |
-
question: JSON.stringify(payload.question),
|
485 |
-
draft_quiz: JSON.stringify(payload.quiz)
|
486 |
-
}).then(
|
487 |
-
function (response) {
|
488 |
-
var result = response.body;
|
489 |
-
|
490 |
-
if (result.success) {
|
491 |
-
// update new question type
|
492 |
-
context.commit('UPDATE_NEW_QUESTION_TYPE', payload.question.type, {root: true});
|
493 |
-
// update list quiz questions
|
494 |
-
context.commit('ADD_NEW_QUESTION', result.data);
|
495 |
-
context.commit('CLOSE_LIST_QUESTIONS');
|
496 |
-
context.commit('OPEN_QUESTION', result.data);
|
497 |
-
}
|
498 |
-
},
|
499 |
-
function (error) {
|
500 |
-
console.log(error);
|
501 |
-
}
|
502 |
-
);
|
503 |
-
},
|
504 |
-
|
505 |
-
updateQuestionsOrder: function (context, order) {
|
506 |
-
LP.Request({
|
507 |
-
type: 'sort-questions',
|
508 |
-
order: JSON.stringify(order)
|
509 |
-
}).then(
|
510 |
-
function (response) {
|
511 |
-
context.commit('SORT_QUESTIONS', order);
|
512 |
-
},
|
513 |
-
function (error) {
|
514 |
-
console.log(error);
|
515 |
-
}
|
516 |
-
);
|
517 |
-
},
|
518 |
-
|
519 |
-
updateQuestionTitle: function (context, question) {
|
520 |
-
|
521 |
-
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
522 |
-
|
523 |
-
LP.Request({
|
524 |
-
type: 'update-question-title',
|
525 |
-
question: JSON.stringify(question)
|
526 |
-
}).then(
|
527 |
-
function () {
|
528 |
-
context.commit('UPDATE_QUESTION_SUCCESS', question.id);
|
529 |
-
}
|
530 |
-
).catch(
|
531 |
-
function () {
|
532 |
-
context.commit('UPDATE_QUESTION_FAILURE', question.id);
|
533 |
-
})
|
534 |
-
},
|
535 |
-
|
536 |
-
changeQuestionType: function (context, payload) {
|
537 |
-
|
538 |
-
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
539 |
-
|
540 |
-
LP.Request({
|
541 |
-
type: 'change-question-type',
|
542 |
-
question_id: payload.question_id,
|
543 |
-
question_type: payload.type
|
544 |
-
}).then(function (response) {
|
545 |
-
var result = response.body;
|
546 |
-
|
547 |
-
if (result.success) {
|
548 |
-
var question = result.data;
|
549 |
-
context.commit('CHANGE_QUESTION_TYPE', question);
|
550 |
-
context.commit('UPDATE_NEW_QUESTION_TYPE', question.type.key, {root: true});
|
551 |
-
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
552 |
-
}
|
553 |
-
}).catch(function () {
|
554 |
-
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
555 |
-
|
556 |
-
})
|
557 |
-
},
|
558 |
-
|
559 |
-
isHiddenQuestionsSettings: function (context, id) {
|
560 |
-
},
|
561 |
-
|
562 |
-
cloneQuestion: function (context, question) {
|
563 |
-
LP.Request({
|
564 |
-
type: 'clone-question',
|
565 |
-
question: JSON.stringify(question)
|
566 |
-
}).then(
|
567 |
-
function (response) {
|
568 |
-
var result = response.body;
|
569 |
-
|
570 |
-
if (result.success) {
|
571 |
-
var question = result.data;
|
572 |
-
|
573 |
-
context.commit('ADD_NEW_QUESTION', result.data);
|
574 |
-
context.commit('UPDATE_NEW_QUESTION_TYPE', question.type.key, {root: true})
|
575 |
-
}
|
576 |
-
},
|
577 |
-
function (error) {
|
578 |
-
console.log(error);
|
579 |
-
}
|
580 |
-
)
|
581 |
-
},
|
582 |
-
|
583 |
-
removeQuestion: function (context, question) {
|
584 |
-
var question_id = question.id;
|
585 |
-
question.temp_id = LP.uniqueId();
|
586 |
-
context.commit('REMOVE_QUESTION', question);
|
587 |
-
|
588 |
-
LP.Request({
|
589 |
-
type: 'remove-question',
|
590 |
-
question_id: question_id
|
591 |
-
}).then(
|
592 |
-
function (response) {
|
593 |
-
var result = response.body;
|
594 |
-
|
595 |
-
if (result.success) {
|
596 |
-
question.id = question.temp_id;
|
597 |
-
question.temp_id = 0;
|
598 |
-
context.commit('REMOVE_QUESTION', question);
|
599 |
-
}
|
600 |
-
},
|
601 |
-
function (error) {
|
602 |
-
console.error(error);
|
603 |
-
}
|
604 |
-
)
|
605 |
-
},
|
606 |
-
|
607 |
-
deleteQuestion: function (context, question) {
|
608 |
-
var question_id = question.id;
|
609 |
-
question.temp_id = LP.uniqueId();
|
610 |
-
context.commit('REMOVE_QUESTION', question);
|
611 |
-
LP.Request({
|
612 |
-
type: 'delete-question',
|
613 |
-
question_id: question_id
|
614 |
-
})
|
615 |
-
.then(function () {
|
616 |
-
question.id = question.temp_id;
|
617 |
-
question.temp_id = 0;
|
618 |
-
context.commit('REMOVE_QUESTION', question);
|
619 |
-
context.commit('UPDATE_QUESTION_SUCCESS', question.id);
|
620 |
-
})
|
621 |
-
.catch(function () {
|
622 |
-
context.commit('UPDATE_QUESTION_FAILURE', question.id);
|
623 |
-
})
|
624 |
-
},
|
625 |
-
|
626 |
-
toggleQuestion: function (context, question) {
|
627 |
-
if (question.open) {
|
628 |
-
context.commit('CLOSE_QUESTION', question);
|
629 |
-
} else {
|
630 |
-
context.commit('OPEN_QUESTION', question);
|
631 |
-
}
|
632 |
-
|
633 |
-
LP.Request({
|
634 |
-
type: 'hidden-questions',
|
635 |
-
hidden: context.getters['hiddenQuestions']
|
636 |
-
}
|
637 |
-
)
|
638 |
-
},
|
639 |
-
|
640 |
-
updateQuestionAnswersOrder: function (context, payload) {
|
641 |
-
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
642 |
-
|
643 |
-
LP.Request({
|
644 |
-
type: 'sort-question-answers',
|
645 |
-
question_id: payload.question_id,
|
646 |
-
order: JSON.stringify(payload.order)
|
647 |
-
}).then(
|
648 |
-
function (response) {
|
649 |
-
var result = response.body,
|
650 |
-
order = result.data;
|
651 |
-
context.commit('SORT_QUESTION_ANSWERS', order);
|
652 |
-
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
653 |
-
},
|
654 |
-
function (error) {
|
655 |
-
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
656 |
-
console.log(error);
|
657 |
-
}
|
658 |
-
)
|
659 |
-
},
|
660 |
-
|
661 |
-
updateQuestionAnswerTitle: function (context, payload) {
|
662 |
-
|
663 |
-
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
664 |
-
|
665 |
-
LP.Request({
|
666 |
-
type: 'update-question-answer-title',
|
667 |
-
question_id: parseInt(payload.question_id),
|
668 |
-
answer: JSON.stringify(payload.answer)
|
669 |
-
}).then(
|
670 |
-
function () {
|
671 |
-
context.commit('UPDATE_QUESTION_ANSWER_SUCCESS', parseInt(payload.question_id));
|
672 |
-
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
673 |
-
}
|
674 |
-
).catch(
|
675 |
-
function () {
|
676 |
-
context.commit('UPDATE_QUESTION_ANSWER_FAILURE', parseInt(payload.question_id));
|
677 |
-
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
678 |
-
})
|
679 |
-
},
|
680 |
-
|
681 |
-
updateQuestionCorrectAnswer: function (context, payload) {
|
682 |
-
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
683 |
-
|
684 |
-
LP.Request({
|
685 |
-
type: 'change-question-correct-answer',
|
686 |
-
question_id: payload.question_id,
|
687 |
-
correct: JSON.stringify(payload.correct)
|
688 |
-
}).then(
|
689 |
-
function (response) {
|
690 |
-
var result = response.body;
|
691 |
-
if (result.success) {
|
692 |
-
context.commit('CHANGE_QUESTION_CORRECT_ANSWERS', result.data);
|
693 |
-
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
694 |
-
}
|
695 |
-
},
|
696 |
-
function (error) {
|
697 |
-
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
698 |
-
console.log(error);
|
699 |
-
}
|
700 |
-
)
|
701 |
-
},
|
702 |
-
|
703 |
-
deleteQuestionAnswer: function (context, payload) {
|
704 |
-
payload.temp_id = LP.uniqueId();
|
705 |
-
context.commit('DELETE_ANSWER', payload);
|
706 |
-
context.commit('UPDATE_QUESTION_REQUEST', payload.question_id);
|
707 |
-
|
708 |
-
LP.Request({
|
709 |
-
type: 'delete-question-answer',
|
710 |
-
question_id: payload.question_id,
|
711 |
-
answer_id: payload.answer_id
|
712 |
-
}).then(
|
713 |
-
function (response) {
|
714 |
-
var result = response.body;
|
715 |
-
|
716 |
-
if (result.success) {
|
717 |
-
context.commit('DELETE_QUESTION_ANSWER', {
|
718 |
-
question_id: payload.question_id,
|
719 |
-
answer_id: payload.temp_id
|
720 |
-
//answer_id: payload.answer_id
|
721 |
-
});
|
722 |
-
context.commit('UPDATE_QUESTION_SUCCESS', payload.question_id);
|
723 |
-
}
|
724 |
-
},
|
725 |
-
function (error) {
|
726 |
-
context.commit('UPDATE_QUESTION_FAILURE', payload.question_id);
|
727 |
-
console.log(error);
|
728 |
-
}
|
729 |
-
)
|
730 |
-
},
|
731 |
-
|
732 |
-
newQuestionAnswer: function (context, data) {
|
733 |
-
var temp_id = LP.uniqueId(),
|
734 |
-
question_id = data.question_id;
|
735 |
-
context.commit('UPDATE_QUESTION_REQUEST', question_id);
|
736 |
-
context.commit('ADD_QUESTION_ANSWER', {
|
737 |
-
question_id: question_id,
|
738 |
-
answer: {'text': LP_Quiz_Store.getters['i18n/all'].new_option, 'question_answer_id': temp_id}
|
739 |
-
});
|
740 |
-
LP.Request({
|
741 |
-
type: 'new-question-answer',
|
742 |
-
question_id: question_id,
|
743 |
-
question_answer_id: temp_id
|
744 |
-
})
|
745 |
-
.then(
|
746 |
-
function (response) {
|
747 |
-
var result = response.body;
|
748 |
-
if (result.success) {
|
749 |
-
var answer = result.data;
|
750 |
-
context.commit('ADD_QUESTION_ANSWER', {question_id: question_id, answer: answer});
|
751 |
-
context.commit('UPDATE_QUESTION_SUCCESS', question_id);
|
752 |
-
|
753 |
-
data.success && setTimeout(function () {
|
754 |
-
data.success.apply(data.context, [answer]);
|
755 |
-
}, 300);
|
756 |
-
}
|
757 |
-
},
|
758 |
-
function (error) {
|
759 |
-
context.commit('UPDATE_QUESTION_FAILURE', question_id);
|
760 |
-
console.error(error);
|
761 |
-
}
|
762 |
-
)
|
763 |
-
},
|
764 |
-
|
765 |
-
updateQuestionContent: function (context, question) {
|
766 |
-
|
767 |
-
context.commit('UPDATE_QUESTION_REQUEST', question.id);
|
768 |
-
|
769 |
-
LP.Request({
|
770 |
-
type: 'update-question-content',
|
771 |
-
question: JSON.stringify(question)
|
772 |
-
}).then(
|
773 |
-
function () {
|
774 |
-
context.commit('UPDATE_QUESTION_SUCCESS', question.id);
|
775 |
-
}
|
776 |
-
).catch(
|
777 |
-
function () {
|
778 |
-
context.commit('UPDATE_QUESTION_FAILURE', question.id);
|
779 |
-
})
|
780 |
-
},
|
781 |
-
|
782 |
-
updateQuestionMeta: function (context, payload) {
|
783 |
-
|
784 |
-
context.commit('UPDATE_QUESTION_REQUEST', payload.question.id);
|
785 |
-
|
786 |
-
LP.Request({
|
787 |
-
type: 'update-question-meta',
|
788 |
-
question: JSON.stringify(payload.question),
|
789 |
-
meta_key: payload.meta_key
|
790 |
-
}).then(
|
791 |
-
function () {
|
792 |
-
context.commit('UPDATE_QUESTION_SUCCESS', payload.question.id);
|
793 |
-
}
|
794 |
-
).catch(
|
795 |
-
function () {
|
796 |
-
context.commit('UPDATE_QUESTION_FAILURE', payload.question.id);
|
797 |
-
})
|
798 |
-
}
|
799 |
-
};
|
800 |
-
|
801 |
-
return {
|
802 |
-
namespaced: true,
|
803 |
-
state: state,
|
804 |
-
getters: getters,
|
805 |
-
mutations: mutations,
|
806 |
-
actions: actions
|
807 |
-
}
|
808 |
-
|
809 |
-
})(LP_Helpers, lp_quiz_editor, jQuery);
|
810 |
-
|
811 |
-
/**
|
812 |
-
* Root Store
|
813 |
-
*
|
814 |
-
* @since 3.0.0
|
815 |
-
*/
|
816 |
-
(function (exports, helpers, data) {
|
817 |
-
|
818 |
-
var state = helpers.cloneObject(data.root);
|
819 |
-
|
820 |
-
state.status = 'success';
|
821 |
-
state.heartbeat = true;
|
822 |
-
state.countCurrentRequest = 0;
|
823 |
-
|
824 |
-
var getters = {
|
825 |
-
heartbeat: function (state) {
|
826 |
-
return state.heartbeat;
|
827 |
-
},
|
828 |
-
questionTypes: function (state) {
|
829 |
-
return state.types;
|
830 |
-
},
|
831 |
-
defaultNewQuestionType: function (state) {
|
832 |
-
return state.default_new
|
833 |
-
},
|
834 |
-
action: function (state) {
|
835 |
-
return state.action;
|
836 |
-
},
|
837 |
-
id: function (state) {
|
838 |
-
return state.quiz_id;
|
839 |
-
},
|
840 |
-
status: function (state) {
|
841 |
-
return state.status || 'error';
|
842 |
-
},
|
843 |
-
currentRequest: function (state) {
|
844 |
-
return state.countCurrentRequest || 0;
|
845 |
-
},
|
846 |
-
nonce: function (state) {
|
847 |
-
return state.nonce;
|
848 |
-
}
|
849 |
-
};
|
850 |
-
|
851 |
-
var mutations = {
|
852 |
-
|
853 |
-
'UPDATE_HEART_BEAT': function (state, status) {
|
854 |
-
state.heartbeat = !!status;
|
855 |
-
},
|
856 |
-
|
857 |
-
'UPDATE_STATUS': function (state, status) {
|
858 |
-
state.status = status;
|
859 |
-
},
|
860 |
-
|
861 |
-
'UPDATE_NEW_QUESTION_TYPE': function (state, type) {
|
862 |
-
state.default_new = type;
|
863 |
-
},
|
864 |
-
|
865 |
-
'INCREASE_NUMBER_REQUEST': function (state) {
|
866 |
-
state.countCurrentRequest++;
|
867 |
-
},
|
868 |
-
|
869 |
-
'DECREASE_NUMBER_REQUEST': function (state) {
|
870 |
-
state.countCurrentRequest--;
|
871 |
-
}
|
872 |
-
};
|
873 |
-
|
874 |
-
var actions = {
|
875 |
-
heartbeat: function (context) {
|
876 |
-
LP.Request({
|
877 |
-
type: 'heartbeat'
|
878 |
-
}
|
879 |
-
)
|
880 |
-
.then(
|
881 |
-
function (response) {
|
882 |
-
var result = response.body;
|
883 |
-
context.commit('UPDATE_HEART_BEAT', !!result.success);
|
884 |
-
},
|
885 |
-
function (error) {
|
886 |
-
context.commit('UPDATE_HEART_BEAT', false);
|
887 |
-
}
|
888 |
-
);
|
889 |
-
},
|
890 |
-
|
891 |
-
newRequest: function (context) {
|
892 |
-
context.commit('INCREASE_NUMBER_REQUEST');
|
893 |
-
context.commit('UPDATE_STATUS', 'loading');
|
894 |
-
|
895 |
-
window.onbeforeunload = function () {
|
896 |
-
return '';
|
897 |
-
}
|
898 |
-
},
|
899 |
-
|
900 |
-
requestComplete: function (context, status) {
|
901 |
-
context.commit('DECREASE_NUMBER_REQUEST');
|
902 |
-
|
903 |
-
if (context.getters.currentRequest === 0) {
|
904 |
-
context.commit('UPDATE_STATUS', status);
|
905 |
-
window.onbeforeunload = null;
|
906 |
-
}
|
907 |
-
}
|
908 |
-
};
|
909 |
-
|
910 |
-
exports.LP_Quiz_Store = new $Vuex.Store({
|
911 |
-
state: state,
|
912 |
-
getters: getters,
|
913 |
-
mutations: mutations,
|
914 |
-
actions: actions,
|
915 |
-
modules: {
|
916 |
-
cqi: LP_Choose_Quiz_Items_Modal_Store,
|
917 |
-
i18n: LP_Quiz_i18n_Store,
|
918 |
-
lqs: LP_List_Quiz_Questions_Store
|
919 |
-
}
|
920 |
-
});
|
921 |
-
|
922 |
-
})(window, LP_Helpers, lp_quiz_editor);
|
923 |
-
|
924 |
-
|
925 |
-
/**
|
926 |
-
* HTTP
|
927 |
-
*
|
928 |
-
* @since 3.0.0
|
929 |
-
*/
|
930 |
-
(function (exports, $store) {
|
931 |
-
var $ = jQuery,
|
932 |
-
$publishingAction = null;
|
933 |
-
|
934 |
-
LP.Request = function (payload) {
|
935 |
-
payload['id'] = $store.getters.id;
|
936 |
-
payload['nonce'] = $store.getters.nonce;
|
937 |
-
payload['lp-ajax'] = $store.getters.action;
|
938 |
-
payload['code'] = Date.now();
|
939 |
-
|
940 |
-
$publishingAction = $('#publishing-action');
|
941 |
-
|
942 |
-
$publishingAction.find('#publish').addClass('disabled');
|
943 |
-
$publishingAction.find('.spinner').addClass('is-active');
|
944 |
-
$publishingAction.addClass('code-' + payload['code']);
|
945 |
-
|
946 |
-
return $VueHTTP.post($store.getters.urlAjax,
|
947 |
-
payload, {
|
948 |
-
emulateJSON: true,
|
949 |
-
params: {
|
950 |
-
namespace: 'LPListQuizQuestionsRequest',
|
951 |
-
code: payload['code'],
|
952 |
-
}
|
953 |
-
});
|
954 |
-
};
|
955 |
-
|
956 |
-
$VueHTTP.interceptors.push(function (request, next) {
|
957 |
-
if (request.params['namespace'] !== 'LPListQuizQuestionsRequest') {
|
958 |
-
next();
|
959 |
-
return;
|
960 |
-
}
|
961 |
-
|
962 |
-
$store.dispatch('newRequest');
|
963 |
-
|
964 |
-
next(function (response) {
|
965 |
-
|
966 |
-
if (!jQuery.isPlainObject(response.body)) {
|
967 |
-
response.body = LP.parseJSON(response.body);
|
968 |
-
}
|
969 |
-
|
970 |
-
var body = response.body,
|
971 |
-
result = body.success || false;
|
972 |
-
|
973 |
-
if (result) {
|
974 |
-
$store.dispatch('requestComplete', 'success');
|
975 |
-
} else {
|
976 |
-
$store.dispatch('requestComplete', 'fail');
|
977 |
-
}
|
978 |
-
|
979 |
-
$publishingAction.removeClass('code-' + request.params.code);
|
980 |
-
if (!$publishingAction.attr('class')) {
|
981 |
-
$publishingAction.find('#publish').removeClass('disabled');
|
982 |
-
$publishingAction.find('.spinner').removeClass('is-active');
|
983 |
-
}
|
984 |
-
|
985 |
-
});
|
986 |
-
});
|
987 |
-
|
988 |
-
})(window, LP_Quiz_Store);
|
989 |
-
|
990 |
-
/**
|
991 |
-
* Init app.
|
992 |
-
*
|
993 |
-
* @since 3.0.0
|
994 |
-
*/
|
995 |
-
(function ($, $store) {
|
996 |
-
$(document).ready(function () {
|
997 |
-
window.LP_Quiz_Editor = new $Vue({
|
998 |
-
el: '#admin-editor-lp_quiz',
|
999 |
-
template: '<lp-quiz-editor></lp-quiz-editor>'
|
1000 |
-
});
|
1001 |
-
});
|
1002 |
-
})(jQuery, LP_Quiz_Store);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/settings.js
DELETED
@@ -1,235 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
var $doc = $(document),
|
3 |
-
oldData = false;
|
4 |
-
return '';
|
5 |
-
|
6 |
-
function addPageToAllDropdowns(args) {
|
7 |
-
var position = $.inArray(args.ID + "", args.positions);
|
8 |
-
$('.learn-press-dropdown-pages').each(function () {
|
9 |
-
var $select = $(this),
|
10 |
-
$new_option = $('<option value="' + args.ID + '">' + args.name + '</option>')
|
11 |
-
if (position == 0) {
|
12 |
-
$('option', $select).each(function () {
|
13 |
-
if (parseInt($(this).val())) {
|
14 |
-
$new_option.insertBefore($(this));
|
15 |
-
return false;
|
16 |
-
}
|
17 |
-
})
|
18 |
-
} else if (position == args.positions.length - 1) {
|
19 |
-
$select.append($new_option);
|
20 |
-
} else {
|
21 |
-
$new_option.insertAfter($('option[value="' + args.positions[position - 1] + '"]', $select));
|
22 |
-
}
|
23 |
-
});
|
24 |
-
}
|
25 |
-
|
26 |
-
function _insertVariableToEditor(edId, variable) {
|
27 |
-
var ed = null,
|
28 |
-
editorId = null,
|
29 |
-
activeEditor = tinyMCE.activeEditor;
|
30 |
-
for (editorId in tinyMCE.editors) {
|
31 |
-
if (editorId == edId) {
|
32 |
-
break;
|
33 |
-
}
|
34 |
-
editorId = null;
|
35 |
-
}
|
36 |
-
if (!editorId) {
|
37 |
-
_insertVariableToTextarea(edId, variable);
|
38 |
-
return;
|
39 |
-
}
|
40 |
-
if (activeEditor && $(activeEditor.getElement()).attr('id') == editorId) {
|
41 |
-
activeEditor.execCommand('insertHTML', false, variable);
|
42 |
-
if ($(activeEditor.getElement()).is(':visible')) {
|
43 |
-
_insertVariableToTextarea(edId, variable);
|
44 |
-
}
|
45 |
-
} else {
|
46 |
-
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
function _insertVariableToTextarea(eId, varibale) {
|
51 |
-
var $el = $('#' + eId).get(0);
|
52 |
-
if (document.selection) {
|
53 |
-
$el.focus();
|
54 |
-
sel = document.selection.createRange();
|
55 |
-
sel.text = varibale;
|
56 |
-
$el.focus();
|
57 |
-
}
|
58 |
-
else if ($el.selectionStart || $el.selectionStart == '0') {
|
59 |
-
var startPos = $el.selectionStart;
|
60 |
-
var endPos = $el.selectionEnd;
|
61 |
-
var scrollTop = $el.scrollTop;
|
62 |
-
$el.value = $el.value.substring(0, startPos) + varibale + $el.value.substring(endPos, $el.value.length);
|
63 |
-
$el.focus();
|
64 |
-
$el.selectionStart = startPos + varibale.length;
|
65 |
-
$el.selectionEnd = startPos + varibale.length;
|
66 |
-
$el.scrollTop = scrollTop;
|
67 |
-
} else {
|
68 |
-
$el.value += varibale;
|
69 |
-
$el.focus();
|
70 |
-
}
|
71 |
-
}
|
72 |
-
|
73 |
-
function _ready() {
|
74 |
-
|
75 |
-
/*var $generate_thumbnail = $('input[name="learn_press_generate_course_thumbnail"]').on('click', function () {
|
76 |
-
var toggle = !($(this).is(':checked'));
|
77 |
-
console.log(toggle);
|
78 |
-
$('.single-course-thumbnail').toggleClass('hide-if-js', toggle);
|
79 |
-
$('.archive-course-thumbnail').toggleClass('hide-if-js', toggle);
|
80 |
-
});
|
81 |
-
$generate_thumbnail.filter(':checked').trigger('change');
|
82 |
-
*/
|
83 |
-
$('#learn_press_email_formats').change(function () {
|
84 |
-
$('.learn-press-email-template.' + this.value).removeClass('hide-if-js').siblings().addClass('hide-if-js');
|
85 |
-
});
|
86 |
-
$('.learn-press-email-variables').each(function () {
|
87 |
-
var $list = $(this),
|
88 |
-
hasEditor = $list.hasClass('has-editor');
|
89 |
-
$list.on('click', 'li', function () {
|
90 |
-
if (hasEditor) {
|
91 |
-
_insertVariableToEditor($list.attr('data-target'), $(this).data('variable'));
|
92 |
-
} else {
|
93 |
-
_insertVariableToTextarea($list.attr('data-target'), $(this).data('variable'));
|
94 |
-
}
|
95 |
-
})
|
96 |
-
});
|
97 |
-
|
98 |
-
$('.learn-press-dropdown-pages').each(function () {
|
99 |
-
$(this).change(function () {
|
100 |
-
var $select = $(this),
|
101 |
-
thisId = $select.attr('id'),
|
102 |
-
$actions = $select.siblings('.learn-press-quick-add-page-actions');
|
103 |
-
$select.siblings('[data-id="' + thisId + '"]').hide();
|
104 |
-
$actions.addClass('hide-if-js');
|
105 |
-
if (this.value != 'add_new_page') {
|
106 |
-
if (parseInt(this.value)) {
|
107 |
-
$actions.find('a.edit-page').attr('href', 'post.php?post=' + this.value + '&action=edit');
|
108 |
-
$actions.find('a.view-page').attr('href', LP_Settings.siteurl + '?page_id=' + this.value);
|
109 |
-
$actions.removeClass('hide-if-js');
|
110 |
-
$select.attr('data-selected', this.value);
|
111 |
-
}
|
112 |
-
return;
|
113 |
-
}
|
114 |
-
;
|
115 |
-
$select.attr('disabled', true);
|
116 |
-
$('.learn-press-quick-add-page-inline.' + thisId).removeClass('hide-if-js').find('input').focus().val('');
|
117 |
-
});
|
118 |
-
});
|
119 |
-
|
120 |
-
$doc.on('click', '.learn-press-quick-add-page-inline button', function () {
|
121 |
-
var $form = $(this).parent(),
|
122 |
-
$input = $form.find('input'),
|
123 |
-
$select = $form.siblings('select'),
|
124 |
-
page_name = $input.val();
|
125 |
-
if (!page_name) {
|
126 |
-
alert('Please enter the name of page');
|
127 |
-
$input.focus();
|
128 |
-
return;
|
129 |
-
}
|
130 |
-
|
131 |
-
$.ajax({
|
132 |
-
url : LP_Settings.ajax,
|
133 |
-
data : {
|
134 |
-
action : 'learnpress_create_page',
|
135 |
-
page_name: page_name
|
136 |
-
},
|
137 |
-
type : 'post',
|
138 |
-
dataType: 'html',
|
139 |
-
success : function (response) {
|
140 |
-
response = LP.parseJSON(response);
|
141 |
-
if (response.page) {
|
142 |
-
addPageToAllDropdowns({
|
143 |
-
ID : response.page.ID,
|
144 |
-
name : response.page.post_title,
|
145 |
-
positions: response.positions
|
146 |
-
});
|
147 |
-
$select.val(response.page.ID).removeAttr('disabled').focus().trigger('change');
|
148 |
-
$form.addClass('hide-if-js');
|
149 |
-
} else if (response.error) {
|
150 |
-
alert(response.error);
|
151 |
-
$select.removeAttr('disabled')
|
152 |
-
}
|
153 |
-
$select.siblings('button').show();
|
154 |
-
}
|
155 |
-
});
|
156 |
-
}).on('click', '.learn-press-quick-add-page-inline a', function (e) {
|
157 |
-
e.preventDefault();
|
158 |
-
var $select = $(this).parent().addClass('hide-if-js').siblings('select');
|
159 |
-
$select.val($select.attr('data-selected')).removeAttr('disabled').trigger('change');
|
160 |
-
$select.siblings('button').show();
|
161 |
-
}).on('click', '.button-quick-add-page', function (e) {
|
162 |
-
var $button = $(this),
|
163 |
-
id = $button.data('id');
|
164 |
-
$button.siblings('select#' + id).val('add_new_page').trigger('change');
|
165 |
-
}).on('keypress keydown', '.learn-press-quick-add-page-inline input[type="text"]', function (e) {
|
166 |
-
if (e.keyCode == 13 && e.type == 'keypress') {
|
167 |
-
e.preventDefault();
|
168 |
-
$(this).siblings('button').trigger('click')
|
169 |
-
} else if (e.keyCode == 27 && e.type == 'keydown') {
|
170 |
-
$(this).siblings('a').trigger('click')
|
171 |
-
}
|
172 |
-
}).on('change update', '#learn_press_required_review', function (e) {
|
173 |
-
var $depend = $('input[name="learn_press_enable_edit_published"]').closest('tr');
|
174 |
-
$depend.toggleClass('hide-if-js', !e.target.checked).find('input[type="checkbox"]').prop('disabled', !e.target.checked)
|
175 |
-
}).on('change update', '#learn_press_auto_redirect_next_lesson', function (e) {
|
176 |
-
var $depend = $('#learn_press_auto_redirect_message, #learn_press_auto_redirect_time').closest('tr');
|
177 |
-
$depend.toggleClass('hide-if-js', !e.target.checked);
|
178 |
-
}).on('change', '.learn-press-single-course-permalink input[type="radio"]', function () {
|
179 |
-
var $check = $(this),
|
180 |
-
$row = $check.closest('.learn-press-single-course-permalink');
|
181 |
-
if ($row.hasClass('custom-base')) {
|
182 |
-
$row.find('input[type="text"]').prop('readonly', false);
|
183 |
-
} else {
|
184 |
-
$row.siblings('.custom-base').find('input[type="text"]').prop('readonly', true);
|
185 |
-
}
|
186 |
-
});
|
187 |
-
|
188 |
-
$('#learn_press_required_review, #learn_press_auto_redirect_next_lesson').trigger('update');
|
189 |
-
$('#learn-press-admin-settings').on('click', '.nav-tab, .subsubsub > li > a', function (e) {
|
190 |
-
e.preventDefault();
|
191 |
-
var redirect = $(this).attr('href'),
|
192 |
-
data = $('#mainform').serialize();
|
193 |
-
if (data != oldData) {
|
194 |
-
$('#learn-press-updating-message').show();
|
195 |
-
$.ajax({
|
196 |
-
url : window.location.href,
|
197 |
-
data : data,
|
198 |
-
type : 'post',
|
199 |
-
dataType: 'html',
|
200 |
-
success : function (res) {
|
201 |
-
$('#learn-press-updating-message').hide();
|
202 |
-
$('#learn-press-updated-message').show();
|
203 |
-
window.location.href = redirect;
|
204 |
-
}
|
205 |
-
});
|
206 |
-
} else {
|
207 |
-
window.location.href = redirect;
|
208 |
-
}
|
209 |
-
});
|
210 |
-
if ($('#learn-press-admin-settings .subsubsub').length) {
|
211 |
-
$('#learn-press-admin-settings').removeClass('no-subtabs');
|
212 |
-
}
|
213 |
-
$('.learn-press-settings-wrap').addClass('ready')
|
214 |
-
.on('click', '#learn-press-reset-settings', function () {
|
215 |
-
if (!confirm($(this).data('text'))) {
|
216 |
-
return false;
|
217 |
-
}
|
218 |
-
});
|
219 |
-
|
220 |
-
// hold current settings to know if user changed anything
|
221 |
-
oldData = $('#mainform').serialize();
|
222 |
-
|
223 |
-
(function () {
|
224 |
-
$('.learn-press-dropdown-pages').each(function () {
|
225 |
-
var $sel = $(this);
|
226 |
-
$sel.css('width', $sel.width() + 50).find('option').each(function () {
|
227 |
-
$(this).html($(this).html().replace(/ /g, ''));
|
228 |
-
});
|
229 |
-
$sel.select2();
|
230 |
-
});
|
231 |
-
})();
|
232 |
-
}
|
233 |
-
|
234 |
-
$doc.ready(_ready);
|
235 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/setup.js
DELETED
@@ -1,153 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
|
3 |
-
"use strict";
|
4 |
-
|
5 |
-
function init() {
|
6 |
-
function validateEmail(email) {
|
7 |
-
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
8 |
-
return re.test(email);
|
9 |
-
}
|
10 |
-
|
11 |
-
function checkForm($form) {
|
12 |
-
var $emails = $form.find('input[type="email"]'),
|
13 |
-
valid = true;
|
14 |
-
$emails.each(function () {
|
15 |
-
var $this = $(this);
|
16 |
-
$this.css('border-color', '');
|
17 |
-
|
18 |
-
switch ($this.attr('name')) {
|
19 |
-
case 'settings[paypal][paypal_email]':
|
20 |
-
case 'settings[paypal][paypal_sandbox_email]':
|
21 |
-
if (!$this.closest('tr').prev().find('input[type="checkbox"]').is(':checked')) {
|
22 |
-
return;
|
23 |
-
}
|
24 |
-
break;
|
25 |
-
}
|
26 |
-
if (!validateEmail(this.value)) {
|
27 |
-
valid = false;
|
28 |
-
$this.css('border-color', '#FF0000');
|
29 |
-
}
|
30 |
-
});
|
31 |
-
|
32 |
-
return valid;
|
33 |
-
}
|
34 |
-
|
35 |
-
function blockContent(block) {
|
36 |
-
$('#main').toggleClass('loading', block === undefined ? true : block);
|
37 |
-
}
|
38 |
-
|
39 |
-
function getFormData(more) {
|
40 |
-
var data = $('#learn-press-setup-form').serializeJSON();
|
41 |
-
|
42 |
-
return $.extend(data, more || {});
|
43 |
-
}
|
44 |
-
|
45 |
-
function replaceMainContent(newContent) {
|
46 |
-
var $newContent = $(newContent);
|
47 |
-
$main.replaceWith($newContent);
|
48 |
-
$main = $newContent;
|
49 |
-
}
|
50 |
-
|
51 |
-
var $main = $('#main');
|
52 |
-
|
53 |
-
$(document).on('click', '.buttons .button', function (e) {
|
54 |
-
e.preventDefault();
|
55 |
-
var $form = $('#learn-press-setup-form'),
|
56 |
-
loadUrl = $(this).attr('href'),
|
57 |
-
$main = $('#main');
|
58 |
-
|
59 |
-
if (!checkForm($form)) {
|
60 |
-
return;
|
61 |
-
}
|
62 |
-
|
63 |
-
$main.addClass('loading');
|
64 |
-
$.post({
|
65 |
-
url: loadUrl,
|
66 |
-
data: getFormData(),
|
67 |
-
success: function (res) {
|
68 |
-
var $html = $(res);
|
69 |
-
replaceMainContent($html.contents().filter('#main'));
|
70 |
-
|
71 |
-
LP.setUrl(loadUrl);
|
72 |
-
|
73 |
-
$('.learn-press-dropdown-pages').dropdownPages();
|
74 |
-
$('.learn-press-tip').QuickTip();
|
75 |
-
$main.removeClass('loading');
|
76 |
-
}
|
77 |
-
});
|
78 |
-
}).on('change', '#currency', function () {
|
79 |
-
var m = $(this).children(':selected').html().match(/\((.*)\)/),
|
80 |
-
symbol = m ? m[1] : '';
|
81 |
-
$('#currency-pos').children().each(function () {
|
82 |
-
|
83 |
-
var $option = $(this),
|
84 |
-
text = $option.html();
|
85 |
-
|
86 |
-
switch ($option.val()) {
|
87 |
-
case 'left':
|
88 |
-
text = text.replace(/\( (.*)69/, '( ' + symbol + '69');
|
89 |
-
break;
|
90 |
-
case 'right':
|
91 |
-
text = text.replace(/9([^0-9]*) \)/, '9' + symbol + ' )');
|
92 |
-
break;
|
93 |
-
case 'left_with_space':
|
94 |
-
text = text.replace(/\( (.*) 6/, '( ' + symbol + ' 6');
|
95 |
-
break;
|
96 |
-
case 'right_with_space':
|
97 |
-
text = text.replace(/9 (.*) \)/, '9 ' + symbol + ' )');
|
98 |
-
break;
|
99 |
-
}
|
100 |
-
$option.html(text);
|
101 |
-
});
|
102 |
-
}).on('change', 'input, select', function () {
|
103 |
-
var $form = $('#learn-press-setup-form'),
|
104 |
-
loadUrl = '',
|
105 |
-
$main = $('#main');
|
106 |
-
$.post({
|
107 |
-
url: loadUrl,
|
108 |
-
dataType: 'html',
|
109 |
-
data: getFormData({
|
110 |
-
'lp-ajax': 'get-price-format'
|
111 |
-
}
|
112 |
-
),
|
113 |
-
success: function (res) {
|
114 |
-
$('#preview-price').html(res);
|
115 |
-
}
|
116 |
-
});
|
117 |
-
}).on('click', '#create-pages', function (e) {
|
118 |
-
e.preventDefault();
|
119 |
-
blockContent();
|
120 |
-
$.post({
|
121 |
-
url: $(this).attr('href'),
|
122 |
-
dataType: 'html',
|
123 |
-
data: getFormData({
|
124 |
-
'lp-ajax': 'setup-create-pages'
|
125 |
-
}
|
126 |
-
),
|
127 |
-
success: function (res) {
|
128 |
-
replaceMainContent($(res).contents().filter('#main'));
|
129 |
-
$('.learn-press-dropdown-pages').dropdownPages();
|
130 |
-
blockContent(false);
|
131 |
-
}
|
132 |
-
});
|
133 |
-
}).on('click', '#install-sample-course', function (e) {
|
134 |
-
e.preventDefault();
|
135 |
-
|
136 |
-
var $button = $(this);
|
137 |
-
blockContent();
|
138 |
-
|
139 |
-
$.post({
|
140 |
-
url: $(this).attr('href'),
|
141 |
-
dataType: 'html',
|
142 |
-
data: {},
|
143 |
-
success: function (res) {
|
144 |
-
blockContent(false);
|
145 |
-
$button.replaceWith($(res).find('a:first').addClass('button button-primary'));
|
146 |
-
}
|
147 |
-
});
|
148 |
-
})
|
149 |
-
}
|
150 |
-
|
151 |
-
$(document).ready(init)
|
152 |
-
|
153 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/statistic.js
DELETED
@@ -1,286 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
$.fn.LP_Chart_Line = function (data, config) {
|
3 |
-
return $.each(this, function () {
|
4 |
-
var $elem = $(this),
|
5 |
-
$canvas = $('<canvas />');
|
6 |
-
$elem.html('');
|
7 |
-
$canvas.appendTo($elem);
|
8 |
-
new Chart($canvas.get(0).getContext('2d')).Line(data, config);
|
9 |
-
});
|
10 |
-
//
|
11 |
-
}
|
12 |
-
|
13 |
-
$.fn.LP_Statistic_Users = function () {
|
14 |
-
if(parseInt($(this).length)===0){
|
15 |
-
return;
|
16 |
-
}
|
17 |
-
return $.each(this, function () {
|
18 |
-
var $buttons = $('.chart-buttons button').on('click', function () {
|
19 |
-
var $button = $(this),
|
20 |
-
type = $button.data('type'),
|
21 |
-
from = '', to = '',
|
22 |
-
$container = $('#learn-press-chart');
|
23 |
-
$buttons.not(this).not('[data-type="user-custom-time"]').prop('disabled', false);
|
24 |
-
if (type == 'user-custom-time') {
|
25 |
-
from = $('#user-custom-time input[name="from"]').val();
|
26 |
-
to = $('#user-custom-time input[name="to"]').val();
|
27 |
-
|
28 |
-
if (from == '' || to == '') {
|
29 |
-
return false;
|
30 |
-
}
|
31 |
-
} else {
|
32 |
-
$button.prop('disabled', true)
|
33 |
-
}
|
34 |
-
$container.addClass('loading')
|
35 |
-
$.ajax({
|
36 |
-
url : 'admin-ajax.php',
|
37 |
-
data : {
|
38 |
-
action: 'learnpress_load_chart',
|
39 |
-
type : type,
|
40 |
-
range : [from, to]
|
41 |
-
},
|
42 |
-
dataType: 'text',
|
43 |
-
success : function (response) {
|
44 |
-
response = LP.parseJSON(response);
|
45 |
-
$container.LP_Chart_Line(response, LP_Chart_Config);
|
46 |
-
$container.removeClass('loading');
|
47 |
-
}
|
48 |
-
});
|
49 |
-
return false;
|
50 |
-
}),
|
51 |
-
$inputs = $('.chart-buttons #user-custom-time input[type="text"]').change(function () {
|
52 |
-
var _valid_date = function () {
|
53 |
-
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
54 |
-
return true;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
$buttons.filter('[data-type="user-custom-time"]').prop('disabled', $inputs.filter(function () {
|
58 |
-
return this.value == '';
|
59 |
-
}).get().length || !_valid_date());
|
60 |
-
})
|
61 |
-
});
|
62 |
-
}
|
63 |
-
|
64 |
-
$.fn.LP_Statistic_Courses = function () {
|
65 |
-
if(parseInt($(this).length)===0){
|
66 |
-
return;
|
67 |
-
}
|
68 |
-
return $.each(this, function () {
|
69 |
-
var $buttons = $('.chart-buttons button').on('click', function () {
|
70 |
-
var $button = $(this),
|
71 |
-
type = $button.data('type'),
|
72 |
-
from = '', to = '',
|
73 |
-
$container = $('#learn-press-chart');
|
74 |
-
$buttons.not(this).not('[data-type="course-custom-time"]').prop('disabled', false);
|
75 |
-
if ( type == 'course-custom-time' ) {
|
76 |
-
from = $('#course-custom-time input[name="from"]').val();
|
77 |
-
to = $('#course-custom-time input[name="to"]').val();
|
78 |
-
|
79 |
-
if (from == '' || to == '') {
|
80 |
-
return false;
|
81 |
-
}
|
82 |
-
} else {
|
83 |
-
$button.prop('disabled', true)
|
84 |
-
}
|
85 |
-
$container.addClass('loading')
|
86 |
-
$.ajax({
|
87 |
-
url : 'admin-ajax.php',
|
88 |
-
data : {
|
89 |
-
action: 'learnpress_load_chart',
|
90 |
-
type : type,
|
91 |
-
range : [from, to]
|
92 |
-
},
|
93 |
-
dataType: 'text',
|
94 |
-
success : function (response) {
|
95 |
-
response = LP.parseJSON(response);
|
96 |
-
$container.LP_Chart_Line(response, LP_Chart_Config);
|
97 |
-
$container.removeClass('loading');
|
98 |
-
}
|
99 |
-
});
|
100 |
-
return false;
|
101 |
-
}),
|
102 |
-
$inputs = $('.chart-buttons #course-custom-time input[type="text"]').change(function () {
|
103 |
-
var _valid_date = function () {
|
104 |
-
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
105 |
-
return true;
|
106 |
-
}
|
107 |
-
}
|
108 |
-
$buttons.filter('[data-type="course-custom-time"]').prop('disabled', $inputs.filter(function () {
|
109 |
-
return this.value == '';
|
110 |
-
}).get().length || !_valid_date());
|
111 |
-
})
|
112 |
-
});
|
113 |
-
}
|
114 |
-
|
115 |
-
$.fn.LP_Statistic_Orders = function () {
|
116 |
-
if(parseInt($(this).length)===0){
|
117 |
-
return;
|
118 |
-
}
|
119 |
-
$('.panel_report_option').hide();
|
120 |
-
$('#panel_report_sales_by_'+$('#report_sales_by').val()).show();
|
121 |
-
$('#report_sales_by').on('change', function(){
|
122 |
-
$('.panel_report_option').hide();
|
123 |
-
$('#panel_report_sales_by_'+$(this).val()).show();
|
124 |
-
if('date'==$(this).val()){
|
125 |
-
LP_Statistic_Orders_Upgrade_Chart();
|
126 |
-
}
|
127 |
-
});
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Upgrade Chart for Order Statistics
|
131 |
-
* @returns {Boolean}
|
132 |
-
*/
|
133 |
-
var LP_Statistic_Orders_Upgrade_Chart =function(){
|
134 |
-
var type = '', from = '', to = '', report_sales_by = 'date', cat_id = 0, course_id = 0;
|
135 |
-
report_sales_by = $('#report_sales_by').val();
|
136 |
-
$container = $('#learn-press-chart');
|
137 |
-
$container.addClass('loading');
|
138 |
-
// get type
|
139 |
-
var $buttons = $('.chart-buttons button:disabled').not('[data-type="order-custom-time"]');
|
140 |
-
if( parseInt( $buttons.length ) > 0 ) {
|
141 |
-
type = $($buttons[0]).data('type');
|
142 |
-
} else {
|
143 |
-
type = 'order-custom-time';
|
144 |
-
from = $('#order-custom-time input[name="from"]').val();
|
145 |
-
to = $('#order-custom-time input[name="to"]').val();
|
146 |
-
if (from == '' || to == '') {
|
147 |
-
return false;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
if( 'course' === report_sales_by ) {
|
151 |
-
course_id = $('#report-by-course-id').val();
|
152 |
-
} else if( 'category' === report_sales_by ) {
|
153 |
-
cat_id = $('#report-by-course-category-id').val();
|
154 |
-
}
|
155 |
-
|
156 |
-
$.ajax({
|
157 |
-
url : 'admin-ajax.php',
|
158 |
-
data : {
|
159 |
-
action: 'learnpress_load_chart',
|
160 |
-
type : type,
|
161 |
-
range : [from, to],
|
162 |
-
report_sales_by: report_sales_by,
|
163 |
-
course_id: course_id,
|
164 |
-
cat_id: cat_id
|
165 |
-
},
|
166 |
-
dataType: 'text',
|
167 |
-
success : function (response) {
|
168 |
-
response = LP.parseJSON(response);
|
169 |
-
$container.LP_Chart_Line(response, LP_Chart_Config);
|
170 |
-
$container.removeClass('loading');
|
171 |
-
}
|
172 |
-
});
|
173 |
-
};
|
174 |
-
|
175 |
-
|
176 |
-
$('#report-by-course-id').select2({
|
177 |
-
placeholder:'Select a course',
|
178 |
-
minimumInputLength: 1,
|
179 |
-
ajax: {
|
180 |
-
url: ajaxurl+'?action=learnpress_search_course',
|
181 |
-
dataType: 'json',
|
182 |
-
quietMillis: 250,
|
183 |
-
data: function (term, page) {
|
184 |
-
return {
|
185 |
-
q: term, // search term
|
186 |
-
};
|
187 |
-
},
|
188 |
-
results: function ( data, page ) {
|
189 |
-
return { results: data.items };
|
190 |
-
},
|
191 |
-
cache: true
|
192 |
-
}
|
193 |
-
});
|
194 |
-
|
195 |
-
$('#report-by-course-id').on('change', function(){
|
196 |
-
LP_Statistic_Orders_Upgrade_Chart();
|
197 |
-
});
|
198 |
-
|
199 |
-
$('#report-by-course-category-id').select2({
|
200 |
-
placeholder:'Select a course',
|
201 |
-
minimumInputLength: 1,
|
202 |
-
ajax: {
|
203 |
-
url: ajaxurl+'?action=learnpress_search_course_category',
|
204 |
-
dataType: 'json',
|
205 |
-
quietMillis: 250,
|
206 |
-
data: function (term, page) {
|
207 |
-
return {
|
208 |
-
q: term, // search term
|
209 |
-
};
|
210 |
-
},
|
211 |
-
results: function ( data, page ) {
|
212 |
-
return { results: data.items };
|
213 |
-
},
|
214 |
-
cache: true
|
215 |
-
}
|
216 |
-
});
|
217 |
-
|
218 |
-
$('#report-by-course-category-id').on('change', function(){
|
219 |
-
LP_Statistic_Orders_Upgrade_Chart();
|
220 |
-
});
|
221 |
-
|
222 |
-
var $buttons = $('.chart-buttons button').on('click', function () {
|
223 |
-
var $button = $(this),
|
224 |
-
type = $button.data('type'),
|
225 |
-
from = '', to = '',
|
226 |
-
$container = $('#learn-press-chart');
|
227 |
-
$buttons.not(this).not('[data-type="order-custom-time"]').prop('disabled', false);
|
228 |
-
if (type !== 'order-custom-time') {
|
229 |
-
$button.prop('disabled', true);
|
230 |
-
$('#order-custom-time input[name="from"]').val('');
|
231 |
-
$('#order-custom-time input[name="to"]').val('');
|
232 |
-
}
|
233 |
-
LP_Statistic_Orders_Upgrade_Chart();
|
234 |
-
return false;
|
235 |
-
});
|
236 |
-
|
237 |
-
var $inputs = $('.chart-buttons #order-custom-time input[type="text"]').change(function () {
|
238 |
-
var _valid_date = function () {
|
239 |
-
if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
|
240 |
-
return true;
|
241 |
-
}
|
242 |
-
}
|
243 |
-
$buttons.filter('[data-type="order-custom-time"]').prop('disabled', $inputs.filter(function () {
|
244 |
-
return this.value == '';
|
245 |
-
}).get().length || !_valid_date());
|
246 |
-
});
|
247 |
-
|
248 |
-
}
|
249 |
-
;
|
250 |
-
$(document).ready(function () {
|
251 |
-
if (typeof $.fn.datepicker != 'undefined') {
|
252 |
-
$(".date-picker").datepicker({
|
253 |
-
dateFormat: 'yy/mm/dd'
|
254 |
-
});
|
255 |
-
}
|
256 |
-
$('.learn-press-statistic-users').LP_Statistic_Users();
|
257 |
-
$('.learn-press-statistic-courses').LP_Statistic_Courses();
|
258 |
-
$('.learn-press-statistic-orders').LP_Statistic_Orders();
|
259 |
-
|
260 |
-
});
|
261 |
-
return;
|
262 |
-
|
263 |
-
var student_chart;
|
264 |
-
window.drawStudentsChart = drawStudentsChart = function (data, config) {
|
265 |
-
var $student_chart = $("#lpr-chart-students").clone().attr('style', '').removeAttr("width").removeAttr('height');
|
266 |
-
$("#lpr-chart-students").replaceWith($student_chart);
|
267 |
-
$student_chart = $student_chart[0].getContext("2d");
|
268 |
-
student_chart = new Chart($student_chart).Line(data, config);
|
269 |
-
}
|
270 |
-
if (typeof last_seven_days == 'undefined') return;
|
271 |
-
drawStudentsChart(last_seven_days, config);
|
272 |
-
|
273 |
-
|
274 |
-
var courses_chart;
|
275 |
-
window.drawCoursesChart = drawCoursesChart = function (data, config) {
|
276 |
-
var $courses_chart = $("#lpr-chart-courses").clone().attr('style', '').removeAttr("width").removeAttr('height');
|
277 |
-
$("#lpr-chart-courses").replaceWith($courses_chart);
|
278 |
-
$courses_chart = $courses_chart[0].getContext("2d");
|
279 |
-
courses_chart = new Chart($courses_chart).Bar(data, config);
|
280 |
-
}
|
281 |
-
if (typeof data == 'undefined') return;
|
282 |
-
|
283 |
-
drawCoursesChart(data, config);
|
284 |
-
|
285 |
-
})(jQuery);
|
286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/sync-data.js
DELETED
@@ -1,268 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
var Sync_Base = {
|
3 |
-
id: 'sync-base',
|
4 |
-
syncing: false,
|
5 |
-
items: false,
|
6 |
-
completed: false,
|
7 |
-
callback: null,
|
8 |
-
methodGetItems: '',
|
9 |
-
itemsKey: '',
|
10 |
-
chunkSize: 50,
|
11 |
-
sync: function (callback) {
|
12 |
-
if (this.syncing) {
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
this.callback = callback;
|
17 |
-
|
18 |
-
if (this.items === false) {
|
19 |
-
this.get_items();
|
20 |
-
} else {
|
21 |
-
if (!this.dispatch()) {
|
22 |
-
this.completed = true;
|
23 |
-
this.callToCallback();
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
this.syncing = true;
|
29 |
-
},
|
30 |
-
init: function () {
|
31 |
-
this.syncing = false;
|
32 |
-
this.items = false;
|
33 |
-
this.completed = false;
|
34 |
-
},
|
35 |
-
is_completed: function () {
|
36 |
-
return this.completed;
|
37 |
-
},
|
38 |
-
dispatch: function () {
|
39 |
-
var that = this,
|
40 |
-
items = this.items ? this.items.splice(0, this.chunkSize) : false;
|
41 |
-
if (!items || items.length === 0) {
|
42 |
-
return false;
|
43 |
-
}
|
44 |
-
$.ajax({
|
45 |
-
url: '',
|
46 |
-
data: {
|
47 |
-
'lp-ajax': this.id,
|
48 |
-
sync: items
|
49 |
-
},
|
50 |
-
method: 'post',
|
51 |
-
success: function (response) {
|
52 |
-
response = LP.parseJSON(response)
|
53 |
-
that.syncing = false;
|
54 |
-
if (response.result !== 'success') {
|
55 |
-
that.completed = true;
|
56 |
-
}
|
57 |
-
that.callToCallback();
|
58 |
-
if (that.is_completed()) {
|
59 |
-
return;
|
60 |
-
}
|
61 |
-
|
62 |
-
that.sync(that.callback);
|
63 |
-
}
|
64 |
-
});
|
65 |
-
|
66 |
-
return true;
|
67 |
-
},
|
68 |
-
callToCallback: function () {
|
69 |
-
this.callback && this.callback.call(this);
|
70 |
-
},
|
71 |
-
get_items: function () {
|
72 |
-
var that = this;
|
73 |
-
$.ajax({
|
74 |
-
url: '',
|
75 |
-
data: {
|
76 |
-
'lp-ajax': this.id,
|
77 |
-
sync: this.methodGetItems
|
78 |
-
},
|
79 |
-
success: function (response) {
|
80 |
-
that.syncing = false;
|
81 |
-
response = LP.parseJSON(response);
|
82 |
-
if (response[that.itemsKey]) {
|
83 |
-
that.items = response[that.itemsKey];
|
84 |
-
that.sync(that.callback);
|
85 |
-
} else {
|
86 |
-
that.completed = true;
|
87 |
-
that.items = [];
|
88 |
-
that.callToCallback();
|
89 |
-
}
|
90 |
-
}
|
91 |
-
});
|
92 |
-
}
|
93 |
-
};
|
94 |
-
|
95 |
-
var Sync_Course_Orders = $.extend({}, Sync_Base, {
|
96 |
-
id: 'sync-course-orders',
|
97 |
-
methodGetItems: 'get-courses',
|
98 |
-
itemsKey: 'courses'
|
99 |
-
});
|
100 |
-
|
101 |
-
var Sync_User_Courses = $.extend({}, Sync_Base, {
|
102 |
-
id: 'sync-user-courses',
|
103 |
-
methodGetItems: 'get-users',
|
104 |
-
itemsKey: 'users',
|
105 |
-
chunkSize: 500
|
106 |
-
});
|
107 |
-
|
108 |
-
var Sync_User_Orders = $.extend({}, Sync_Base, {
|
109 |
-
id: 'sync-user-orders',
|
110 |
-
methodGetItems: 'get-users',
|
111 |
-
itemsKey: 'users',
|
112 |
-
chunkSize: 500
|
113 |
-
});
|
114 |
-
|
115 |
-
var Sync_Course_Final_Quiz = $.extend({}, Sync_Base, {
|
116 |
-
id: 'sync-course-final-quiz',
|
117 |
-
methodGetItems: 'get-courses',
|
118 |
-
itemsKey: 'courses',
|
119 |
-
chunkSize: 500
|
120 |
-
});
|
121 |
-
|
122 |
-
var Sync_Remove_Older_Data = $.extend({}, Sync_Base, {
|
123 |
-
id: 'sync-remove-older-data',
|
124 |
-
methodGetItems: 'remove-older-data',
|
125 |
-
itemsKey: '_nothing_here',
|
126 |
-
chunkSize: 500
|
127 |
-
});
|
128 |
-
|
129 |
-
var Sync_Calculate_Course_Results = $.extend({}, Sync_Base, {
|
130 |
-
id: 'sync-calculate-course-results',
|
131 |
-
methodGetItems: 'get-users',
|
132 |
-
itemsKey: 'users',
|
133 |
-
chunkSize: 1
|
134 |
-
});
|
135 |
-
|
136 |
-
|
137 |
-
window.LP_Sync_Data = {
|
138 |
-
syncs: [],
|
139 |
-
syncing: 0,
|
140 |
-
options: {},
|
141 |
-
start: function (options) {
|
142 |
-
this.syncs = [];
|
143 |
-
this.options = $.extend({
|
144 |
-
onInit: function () {
|
145 |
-
},
|
146 |
-
onStart: function () {
|
147 |
-
|
148 |
-
},
|
149 |
-
onCompleted: function () {
|
150 |
-
|
151 |
-
},
|
152 |
-
onCompletedAll: function () {
|
153 |
-
|
154 |
-
}
|
155 |
-
}, options || {});
|
156 |
-
|
157 |
-
if (!this.get_syncs()) {
|
158 |
-
return;
|
159 |
-
}
|
160 |
-
this.reset();
|
161 |
-
this.options.onInit.call(this);
|
162 |
-
var that = this,
|
163 |
-
syncing = 0,
|
164 |
-
totalSyncs = this.syncs.length,
|
165 |
-
syncCallback = function ($sync) {
|
166 |
-
|
167 |
-
if ($sync.is_completed()) {
|
168 |
-
syncing++;
|
169 |
-
that.options.onCompleted.call(that, $sync)
|
170 |
-
if (syncing >= totalSyncs) {
|
171 |
-
|
172 |
-
that.options.onCompletedAll.call(that)
|
173 |
-
return;
|
174 |
-
}
|
175 |
-
that.sync(syncing, syncCallback)
|
176 |
-
}
|
177 |
-
};
|
178 |
-
this.sync(syncing, syncCallback);
|
179 |
-
},
|
180 |
-
reset: function () {
|
181 |
-
for (var sync in this.syncs) {
|
182 |
-
try {
|
183 |
-
this[this.syncs[sync]].init();
|
184 |
-
} catch (e) {
|
185 |
-
}
|
186 |
-
}
|
187 |
-
},
|
188 |
-
sync: function (sync, callback) {
|
189 |
-
var that = this,
|
190 |
-
$sync = this[this.syncs[sync]];
|
191 |
-
that.options.onStart.call(that, $sync);
|
192 |
-
$sync.sync(function () {
|
193 |
-
callback.call(that, $sync)
|
194 |
-
})
|
195 |
-
},
|
196 |
-
get_syncs: function () {
|
197 |
-
var syncs = $('input[name^="lp-repair"]:checked').serializeJSON()['lp-repair'];
|
198 |
-
if (!syncs) {
|
199 |
-
return false;
|
200 |
-
}
|
201 |
-
|
202 |
-
for (var sync in syncs) {
|
203 |
-
if (syncs[sync] !== 'yes') {
|
204 |
-
continue;
|
205 |
-
}
|
206 |
-
|
207 |
-
sync = sync.replace(/[-]+/g, '_');
|
208 |
-
|
209 |
-
if (!this[sync]) {
|
210 |
-
continue;
|
211 |
-
}
|
212 |
-
|
213 |
-
this.syncs.push(sync);
|
214 |
-
}
|
215 |
-
|
216 |
-
return this.syncs;
|
217 |
-
},
|
218 |
-
get_sync: function (id) {
|
219 |
-
id = id.replace(/[-]+/g, '_');
|
220 |
-
return this[id];
|
221 |
-
},
|
222 |
-
sync_course_orders: Sync_Course_Orders,
|
223 |
-
sync_user_orders: Sync_User_Orders,
|
224 |
-
sync_user_courses: Sync_User_Courses,
|
225 |
-
sync_course_final_quiz: Sync_Course_Final_Quiz,
|
226 |
-
sync_remove_older_data: Sync_Remove_Older_Data,
|
227 |
-
sync_calculate_course_results: Sync_Calculate_Course_Results
|
228 |
-
}
|
229 |
-
|
230 |
-
$(document).ready(function () {
|
231 |
-
function initSyncs() {
|
232 |
-
var $chkAll = $('#learn-press-check-all-syncs'),
|
233 |
-
$chks = $('#learn-press-syncs').find('[name^="lp-repair"]');
|
234 |
-
|
235 |
-
$chkAll.on('click', function () {
|
236 |
-
$chks.prop('checked', this.checked)
|
237 |
-
});
|
238 |
-
|
239 |
-
$chks.on('click', function () {
|
240 |
-
$chkAll.prop('checked', $chks.filter(':checked').length === $chks.length);
|
241 |
-
})
|
242 |
-
}
|
243 |
-
|
244 |
-
initSyncs();
|
245 |
-
}).on('click', '.lp-button-repair', function () {
|
246 |
-
function getInput(sync) {
|
247 |
-
return $('ul#learn-press-syncs').find('input[name*="' + sync + '"]')
|
248 |
-
}
|
249 |
-
|
250 |
-
LP_Sync_Data.start({
|
251 |
-
onInit: function () {
|
252 |
-
$('ul#learn-press-syncs').children().removeClass('syncing synced');
|
253 |
-
$('.lp-button-repair').prop('disabled', true);
|
254 |
-
},
|
255 |
-
onStart: function ($sync) {
|
256 |
-
getInput($sync.id).closest('li').addClass('syncing');
|
257 |
-
},
|
258 |
-
onCompleted: function ($sync) {
|
259 |
-
getInput($sync.id).closest('li').removeClass('syncing').addClass('synced');
|
260 |
-
},
|
261 |
-
onCompletedAll: function () {
|
262 |
-
$('ul#learn-press-syncs').children().removeClass('syncing synced');
|
263 |
-
$('.lp-button-repair').prop('disabled', false);
|
264 |
-
}
|
265 |
-
});
|
266 |
-
});
|
267 |
-
|
268 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/update.js
DELETED
@@ -1,238 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
var Package = function (data) {
|
5 |
-
this.data = data;
|
6 |
-
|
7 |
-
var currentIndex = -1,
|
8 |
-
currentVersion = null,
|
9 |
-
currentPackage = null,
|
10 |
-
versions = Object.keys(this.data);
|
11 |
-
|
12 |
-
this.reset = function (current) {
|
13 |
-
current = (current === undefined || current > versions.length - 1 || current < 0 ) ? 0 : current;
|
14 |
-
currentIndex = current;
|
15 |
-
currentVersion = versions[current];
|
16 |
-
currentPackage = this.data[currentVersion];
|
17 |
-
|
18 |
-
return currentPackage;
|
19 |
-
}
|
20 |
-
|
21 |
-
this.next = function () {
|
22 |
-
if (currentIndex >= versions.length - 1) {
|
23 |
-
return false;
|
24 |
-
}
|
25 |
-
|
26 |
-
currentIndex++;
|
27 |
-
this.reset(currentIndex);
|
28 |
-
|
29 |
-
return currentPackage;
|
30 |
-
}
|
31 |
-
|
32 |
-
this.prev = function () {
|
33 |
-
if (currentIndex <= 0) {
|
34 |
-
return false;
|
35 |
-
}
|
36 |
-
|
37 |
-
currentIndex--;
|
38 |
-
this.reset(currentIndex);
|
39 |
-
|
40 |
-
return currentPackage;
|
41 |
-
}
|
42 |
-
|
43 |
-
this.currentVersion = function () {
|
44 |
-
return currentVersion;
|
45 |
-
}
|
46 |
-
|
47 |
-
this.hasPackage = function () {
|
48 |
-
return versions.length
|
49 |
-
}
|
50 |
-
|
51 |
-
this.getPercentCompleted = function () {
|
52 |
-
return (currentIndex) / versions.length;
|
53 |
-
}
|
54 |
-
|
55 |
-
this.getTotal = function () {
|
56 |
-
return versions.length;
|
57 |
-
}
|
58 |
-
|
59 |
-
if (!this.data) {
|
60 |
-
return;
|
61 |
-
}
|
62 |
-
|
63 |
-
}
|
64 |
-
var UpdaterSettings = {
|
65 |
-
el: '#learn-press-updater',
|
66 |
-
data: {
|
67 |
-
packages: null,
|
68 |
-
status: '',
|
69 |
-
force: false,
|
70 |
-
},
|
71 |
-
watch: {
|
72 |
-
packages: function (newPackages, oldPackages) {
|
73 |
-
if (newPackages) {
|
74 |
-
|
75 |
-
}
|
76 |
-
}
|
77 |
-
},
|
78 |
-
mounted: function () {
|
79 |
-
$(this.$el).show();
|
80 |
-
},
|
81 |
-
methods: {
|
82 |
-
getUpdatePackages: function (callback) {
|
83 |
-
var that = this;
|
84 |
-
$.ajax({
|
85 |
-
url: lpGlobalSettings.admin_url,
|
86 |
-
data: {
|
87 |
-
'lp-ajax': 'get-update-packages',
|
88 |
-
force: this.force,
|
89 |
-
_wpnonce: lpGlobalSettings._wpnonce
|
90 |
-
},
|
91 |
-
success: function (res) {
|
92 |
-
var packages = LP.parseJSON(res);
|
93 |
-
that.packages = new Package(packages);
|
94 |
-
callback && callback.call(that)
|
95 |
-
}
|
96 |
-
})
|
97 |
-
},
|
98 |
-
start: function (e, force) {
|
99 |
-
this.packages = null;
|
100 |
-
this.force = force;
|
101 |
-
this.getUpdatePackages(function () {
|
102 |
-
if (this.packages.hasPackage()) {
|
103 |
-
var p = this.packages.next();
|
104 |
-
this.status = 'updating';
|
105 |
-
this.doUpdate(p);
|
106 |
-
}
|
107 |
-
});
|
108 |
-
},
|
109 |
-
getPackages: function () {
|
110 |
-
return this.packages ? this.packages.data : {};
|
111 |
-
},
|
112 |
-
hasPackage: function () {
|
113 |
-
return !$.isEmptyObject(this.getPackages());
|
114 |
-
},
|
115 |
-
updateButtonClass: function () {
|
116 |
-
return {
|
117 |
-
'disabled': this.status === 'updating'
|
118 |
-
}
|
119 |
-
},
|
120 |
-
doUpdate: function (p, i) {
|
121 |
-
var that = this;
|
122 |
-
|
123 |
-
p = p ? p : this.packages.next();
|
124 |
-
i = i ? i : 1;
|
125 |
-
|
126 |
-
if (p) {
|
127 |
-
$.ajax({
|
128 |
-
url: lpGlobalSettings.admin_url,
|
129 |
-
data: {
|
130 |
-
'lp-ajax': 'do-update-package',
|
131 |
-
package: p,
|
132 |
-
version: this.packages.currentVersion(),
|
133 |
-
_wpnonce: lpGlobalSettings._wpnonce,
|
134 |
-
force: this.force,
|
135 |
-
i: i
|
136 |
-
},
|
137 |
-
success: function (res) {
|
138 |
-
var response = LP.parseJSON(res),
|
139 |
-
$status = $(that.$el).find('.updater-progress-status');
|
140 |
-
if (response.done === 'yes') {
|
141 |
-
that.update(that.packages.getPercentCompleted() * 100);
|
142 |
-
that.doUpdate();
|
143 |
-
} else {
|
144 |
-
var newWidth = that.packages.getPercentCompleted() * 100;
|
145 |
-
if (response.percent) {
|
146 |
-
var stepWidth = 1 / that.packages.getTotal();
|
147 |
-
newWidth += (stepWidth * response.percent);
|
148 |
-
}
|
149 |
-
|
150 |
-
that.update(newWidth);
|
151 |
-
that.doUpdate(p, ++i);
|
152 |
-
}
|
153 |
-
},
|
154 |
-
error: function () {
|
155 |
-
that.doUpdate(p, i);
|
156 |
-
}
|
157 |
-
});
|
158 |
-
|
159 |
-
} else {
|
160 |
-
that.update(100).addClass('completed');
|
161 |
-
setTimeout(function (x) {
|
162 |
-
x.status = 'completed';
|
163 |
-
}, 2000, this);
|
164 |
-
}
|
165 |
-
},
|
166 |
-
update: function (value) {
|
167 |
-
return $(this.$el).find('.updater-progress-status').css('width', value + '%').attr('data-value', parseInt(value));
|
168 |
-
}
|
169 |
-
}
|
170 |
-
};
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
function init() {
|
175 |
-
|
176 |
-
window.lpGlobalSettings = window.lpGlobalSettings || {};
|
177 |
-
|
178 |
-
if($('#learn-press-updater').length) {
|
179 |
-
var Updater = new Vue(UpdaterSettings);
|
180 |
-
}
|
181 |
-
|
182 |
-
|
183 |
-
// return;
|
184 |
-
//
|
185 |
-
// var i18n = window.lpUpdateSettings || {};
|
186 |
-
// $(document).on('click', '#button-update', function (e) {
|
187 |
-
// e.preventDefault();
|
188 |
-
// var $form = $('#learn-press-update-form'),
|
189 |
-
// loadUrl = $(this).attr('href'),
|
190 |
-
// $main = $('#main').addClass('loading');
|
191 |
-
// $('.learn-press-message').remove();
|
192 |
-
// $.post({
|
193 |
-
// url: loadUrl,
|
194 |
-
// data: $form.serializeJSON(),
|
195 |
-
// success: function (res) {
|
196 |
-
// $(res).insertBefore($form);
|
197 |
-
// $main.removeClass('loading');
|
198 |
-
// }
|
199 |
-
// });
|
200 |
-
// }).on('click', '.lp-button-upgrade', function (e) {
|
201 |
-
// e.preventDefault();
|
202 |
-
//
|
203 |
-
// if (!confirm(i18n.i18n_confirm)) {
|
204 |
-
// return false;
|
205 |
-
// }
|
206 |
-
//
|
207 |
-
// var $btn = $(this),
|
208 |
-
// url = $btn.addClass('disabled').attr('href'),
|
209 |
-
// context = $btn.data('context');
|
210 |
-
// $.post({
|
211 |
-
// url: url,
|
212 |
-
// data: {
|
213 |
-
// context: context
|
214 |
-
// },
|
215 |
-
// success: function (res) {
|
216 |
-
// var $msg = $(res);
|
217 |
-
// if (context == 'message') {
|
218 |
-
// $btn.closest('.notice').replaceWith($msg);
|
219 |
-
// } else {
|
220 |
-
// $msg.insertBefore($btn);
|
221 |
-
// }
|
222 |
-
// }
|
223 |
-
// });
|
224 |
-
// }).on('click', '#skip-notice-install', function(){
|
225 |
-
// $.post({
|
226 |
-
// url: '',
|
227 |
-
// data: {
|
228 |
-
// 'lp-ajax': 'skip-notice-install'
|
229 |
-
// }
|
230 |
-
// });
|
231 |
-
//
|
232 |
-
// $('#notice-install').fadeOut();
|
233 |
-
// });
|
234 |
-
}
|
235 |
-
|
236 |
-
$(document).ready(init);
|
237 |
-
|
238 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/utils.js
CHANGED
@@ -1 +1,2730 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 19);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ([
|
67 |
+
/* 0 */
|
68 |
+
/***/ (function(module, exports, __webpack_require__) {
|
69 |
+
|
70 |
+
"use strict";
|
71 |
+
|
72 |
+
|
73 |
+
Object.defineProperty(exports, "__esModule", {
|
74 |
+
value: true
|
75 |
+
});
|
76 |
+
|
77 |
+
exports.default = function () {
|
78 |
+
window.LP = window.LP || {};
|
79 |
+
|
80 |
+
if (typeof arguments[0] === 'string') {
|
81 |
+
LP[arguments[0]] = LP[arguments[0]] || {};
|
82 |
+
LP[arguments[0]] = jQuery.extend(LP[arguments[0]], arguments[1]);
|
83 |
+
} else {
|
84 |
+
LP = jQuery.extend(LP, arguments[0]);
|
85 |
+
}
|
86 |
+
};
|
87 |
+
|
88 |
+
/***/ }),
|
89 |
+
/* 1 */
|
90 |
+
/***/ (function(module, exports, __webpack_require__) {
|
91 |
+
|
92 |
+
"use strict";
|
93 |
+
|
94 |
+
|
95 |
+
Object.defineProperty(exports, "__esModule", {
|
96 |
+
value: true
|
97 |
+
});
|
98 |
+
|
99 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**
|
100 |
+
* Utility functions may use for both admin and frontend.
|
101 |
+
*
|
102 |
+
* @version 3.2.6
|
103 |
+
*/
|
104 |
+
|
105 |
+
var _extend = __webpack_require__(0);
|
106 |
+
|
107 |
+
var _extend2 = _interopRequireDefault(_extend);
|
108 |
+
|
109 |
+
var _fn = __webpack_require__(2);
|
110 |
+
|
111 |
+
var _fn2 = _interopRequireDefault(_fn);
|
112 |
+
|
113 |
+
var _quickTip = __webpack_require__(3);
|
114 |
+
|
115 |
+
var _quickTip2 = _interopRequireDefault(_quickTip);
|
116 |
+
|
117 |
+
var _messageBox = __webpack_require__(4);
|
118 |
+
|
119 |
+
var _messageBox2 = _interopRequireDefault(_messageBox);
|
120 |
+
|
121 |
+
var _eventCallback = __webpack_require__(5);
|
122 |
+
|
123 |
+
var _eventCallback2 = _interopRequireDefault(_eventCallback);
|
124 |
+
|
125 |
+
var _hook = __webpack_require__(6);
|
126 |
+
|
127 |
+
var _hook2 = _interopRequireDefault(_hook);
|
128 |
+
|
129 |
+
var _jquery = __webpack_require__(7);
|
130 |
+
|
131 |
+
var jplugins = _interopRequireWildcard(_jquery);
|
132 |
+
|
133 |
+
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; } }
|
134 |
+
|
135 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
136 |
+
|
137 |
+
var $ = jQuery;
|
138 |
+
|
139 |
+
String.prototype.getQueryVar = function (name) {
|
140 |
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
141 |
+
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
142 |
+
results = regex.exec(this);
|
143 |
+
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
144 |
+
};
|
145 |
+
|
146 |
+
String.prototype.addQueryVar = function (name, value) {
|
147 |
+
var url = this,
|
148 |
+
m = url.split('#');
|
149 |
+
url = m[0];
|
150 |
+
if (name.match(/\[/)) {
|
151 |
+
url += url.match(/\?/) ? '&' : '?';
|
152 |
+
url += name + '=' + value;
|
153 |
+
} else {
|
154 |
+
if (url.indexOf('&' + name + '=') != -1 || url.indexOf('?' + name + '=') != -1) {
|
155 |
+
url = url.replace(new RegExp(name + "=([^&#]*)", 'g'), name + '=' + value);
|
156 |
+
} else {
|
157 |
+
url += url.match(/\?/) ? '&' : '?';
|
158 |
+
url += name + '=' + value;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
return url + (m[1] ? '#' + m[1] : '');
|
162 |
+
};
|
163 |
+
|
164 |
+
String.prototype.removeQueryVar = function (name) {
|
165 |
+
var url = this;
|
166 |
+
var m = url.split('#');
|
167 |
+
url = m[0];
|
168 |
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
169 |
+
var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
|
170 |
+
url = url.replace(regex, '');
|
171 |
+
return url + (m[1] ? '#' + m[1] : '');
|
172 |
+
};
|
173 |
+
|
174 |
+
if ($.isEmptyObject("") == false) {
|
175 |
+
$.isEmptyObject = function (a) {
|
176 |
+
var prop;
|
177 |
+
for (prop in a) {
|
178 |
+
if (a.hasOwnProperty(prop)) {
|
179 |
+
return false;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
return true;
|
183 |
+
};
|
184 |
+
}
|
185 |
+
|
186 |
+
var _default = {
|
187 |
+
Hook: _hook2.default,
|
188 |
+
setUrl: function setUrl(url, ember, title) {
|
189 |
+
if (url) {
|
190 |
+
history.pushState({}, title, url);
|
191 |
+
LP.Hook.doAction('learn_press_set_location_url', url);
|
192 |
+
}
|
193 |
+
},
|
194 |
+
toggleGroupSection: function toggleGroupSection(el, target) {
|
195 |
+
var $el = $(el),
|
196 |
+
isHide = $el.hasClass('hide-if-js');
|
197 |
+
if (isHide) {
|
198 |
+
$el.hide().removeClass('hide-if-js');
|
199 |
+
}
|
200 |
+
$el.removeClass('hide-if-js').slideToggle(function () {
|
201 |
+
var $this = $(this);
|
202 |
+
if ($this.is(':visible')) {
|
203 |
+
$(target).addClass('toggle-on').removeClass('toggle-off');
|
204 |
+
} else {
|
205 |
+
$(target).addClass('toggle-off').removeClass('toggle-on');
|
206 |
+
}
|
207 |
+
});
|
208 |
+
},
|
209 |
+
overflow: function overflow(el, v) {
|
210 |
+
var $el = $(el),
|
211 |
+
overflow = $el.css('overflow');
|
212 |
+
if (v) {
|
213 |
+
$el.css('overflow', v).data('overflow', overflow);
|
214 |
+
} else {
|
215 |
+
$el.css('overflow', $el.data('overflow'));
|
216 |
+
}
|
217 |
+
},
|
218 |
+
getUrl: function getUrl() {
|
219 |
+
return window.location.href;
|
220 |
+
},
|
221 |
+
addQueryVar: function addQueryVar(name, value, url) {
|
222 |
+
return (url === undefined ? window.location.href : url).addQueryVar(name, value);
|
223 |
+
},
|
224 |
+
removeQueryVar: function removeQueryVar(name, url) {
|
225 |
+
return (url === undefined ? window.location.href : url).removeQueryVar(name);
|
226 |
+
},
|
227 |
+
reload: function reload(url) {
|
228 |
+
if (!url) {
|
229 |
+
url = window.location.href;
|
230 |
+
}
|
231 |
+
window.location.href = url;
|
232 |
+
},
|
233 |
+
|
234 |
+
parseResponse: function parseResponse(response, type) {
|
235 |
+
var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
236 |
+
if (m) {
|
237 |
+
response = m[1];
|
238 |
+
}
|
239 |
+
return (type || "json") === "json" ? this.parseJSON(response) : response;
|
240 |
+
},
|
241 |
+
parseJSON: function parseJSON(data) {
|
242 |
+
var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
243 |
+
try {
|
244 |
+
if (m) {
|
245 |
+
data = $.parseJSON(m[1]);
|
246 |
+
} else {
|
247 |
+
data = $.parseJSON(data);
|
248 |
+
}
|
249 |
+
} catch (e) {
|
250 |
+
data = {};
|
251 |
+
}
|
252 |
+
return data;
|
253 |
+
},
|
254 |
+
ajax: function ajax(args) {
|
255 |
+
var type = args.type || 'post',
|
256 |
+
dataType = args.dataType || 'json',
|
257 |
+
data = args.action ? $.extend(args.data, { 'lp-ajax': args.action }) : args.data,
|
258 |
+
beforeSend = args.beforeSend || function () {},
|
259 |
+
url = args.url || window.location.href;
|
260 |
+
// console.debug( beforeSend );
|
261 |
+
$.ajax({
|
262 |
+
data: data,
|
263 |
+
url: url,
|
264 |
+
type: type,
|
265 |
+
dataType: 'html',
|
266 |
+
beforeSend: beforeSend.apply(null, args),
|
267 |
+
success: function success(raw) {
|
268 |
+
var response = LP.parseResponse(raw, dataType);
|
269 |
+
$.isFunction(args.success) && args.success(response, raw);
|
270 |
+
},
|
271 |
+
error: function error() {
|
272 |
+
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
273 |
+
}
|
274 |
+
});
|
275 |
+
},
|
276 |
+
doAjax: function doAjax(args) {
|
277 |
+
var type = args.type || 'post',
|
278 |
+
dataType = args.dataType || 'json',
|
279 |
+
action = (args.prefix === undefined || 'learnpress_') + args.action,
|
280 |
+
data = args.action ? $.extend(args.data, { action: action }) : args.data;
|
281 |
+
|
282 |
+
$.ajax({
|
283 |
+
data: data,
|
284 |
+
url: args.url || window.location.href,
|
285 |
+
type: type,
|
286 |
+
dataType: 'html',
|
287 |
+
success: function success(raw) {
|
288 |
+
var response = LP.parseResponse(raw, dataType);
|
289 |
+
$.isFunction(args.success) && args.success(response, raw);
|
290 |
+
},
|
291 |
+
error: function error() {
|
292 |
+
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
293 |
+
}
|
294 |
+
});
|
295 |
+
},
|
296 |
+
|
297 |
+
funcArgs2Array: function funcArgs2Array(args) {
|
298 |
+
var arr = [];
|
299 |
+
for (var i = 0; i < args.length; i++) {
|
300 |
+
arr.push(args[i]);
|
301 |
+
}
|
302 |
+
return arr;
|
303 |
+
},
|
304 |
+
addFilter: function addFilter(action, callback) {
|
305 |
+
var $doc = $(document),
|
306 |
+
event = 'LP.' + action;
|
307 |
+
$doc.on(event, callback);
|
308 |
+
LP.log($doc.data('events'));
|
309 |
+
return this;
|
310 |
+
},
|
311 |
+
applyFilters: function applyFilters() {
|
312 |
+
var $doc = $(document),
|
313 |
+
action = arguments[0],
|
314 |
+
args = this.funcArgs2Array(arguments);
|
315 |
+
if ($doc.hasEvent(action)) {
|
316 |
+
args[0] = 'LP.' + action;
|
317 |
+
return $doc.triggerHandler.apply($doc, args);
|
318 |
+
}
|
319 |
+
return args[1];
|
320 |
+
},
|
321 |
+
addAction: function addAction(action, callback) {
|
322 |
+
return this.addFilter(action, callback);
|
323 |
+
},
|
324 |
+
doAction: function doAction() {
|
325 |
+
var $doc = $(document),
|
326 |
+
action = arguments[0],
|
327 |
+
args = this.funcArgs2Array(arguments);
|
328 |
+
if ($doc.hasEvent(action)) {
|
329 |
+
args[0] = 'LP.' + action;
|
330 |
+
$doc.trigger.apply($doc, args);
|
331 |
+
}
|
332 |
+
},
|
333 |
+
toElement: function toElement(element, args) {
|
334 |
+
if ($(element).length === 0) {
|
335 |
+
return;
|
336 |
+
}
|
337 |
+
args = $.extend({
|
338 |
+
delay: 300,
|
339 |
+
duration: 'slow',
|
340 |
+
offset: 50,
|
341 |
+
container: null,
|
342 |
+
callback: null,
|
343 |
+
invisible: false
|
344 |
+
}, args || {});
|
345 |
+
var $container = $(args.container),
|
346 |
+
rootTop = 0;
|
347 |
+
if ($container.length === 0) {
|
348 |
+
$container = $('body, html');
|
349 |
+
}
|
350 |
+
rootTop = $container.offset().top;
|
351 |
+
var to = $(element).offset().top + $container.scrollTop() - rootTop - args.offset;
|
352 |
+
|
353 |
+
function isElementInView(element, fullyInView) {
|
354 |
+
var pageTop = $container.scrollTop();
|
355 |
+
var pageBottom = pageTop + $container.height();
|
356 |
+
var elementTop = $(element).offset().top - $container.offset().top;
|
357 |
+
var elementBottom = elementTop + $(element).height();
|
358 |
+
|
359 |
+
if (fullyInView === true) {
|
360 |
+
return pageTop < elementTop && pageBottom > elementBottom;
|
361 |
+
} else {
|
362 |
+
return elementTop <= pageBottom && elementBottom >= pageTop;
|
363 |
+
}
|
364 |
+
}
|
365 |
+
|
366 |
+
if (args.invisible && isElementInView(element, true)) {
|
367 |
+
return;
|
368 |
+
}
|
369 |
+
$container.fadeIn(10).delay(args.delay).animate({
|
370 |
+
scrollTop: to
|
371 |
+
}, args.duration, args.callback);
|
372 |
+
},
|
373 |
+
uniqueId: function uniqueId(prefix, more_entropy) {
|
374 |
+
if (typeof prefix === 'undefined') {
|
375 |
+
prefix = '';
|
376 |
+
}
|
377 |
+
|
378 |
+
var retId;
|
379 |
+
var formatSeed = function formatSeed(seed, reqWidth) {
|
380 |
+
seed = parseInt(seed, 10).toString(16); // to hex str
|
381 |
+
if (reqWidth < seed.length) {
|
382 |
+
// so long we split
|
383 |
+
return seed.slice(seed.length - reqWidth);
|
384 |
+
}
|
385 |
+
if (reqWidth > seed.length) {
|
386 |
+
// so short we pad
|
387 |
+
return new Array(1 + (reqWidth - seed.length)).join('0') + seed;
|
388 |
+
}
|
389 |
+
return seed;
|
390 |
+
};
|
391 |
+
|
392 |
+
// BEGIN REDUNDANT
|
393 |
+
if (!this.php_js) {
|
394 |
+
this.php_js = {};
|
395 |
+
}
|
396 |
+
// END REDUNDANT
|
397 |
+
if (!this.php_js.uniqidSeed) {
|
398 |
+
// init seed with big random int
|
399 |
+
this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
|
400 |
+
}
|
401 |
+
this.php_js.uniqidSeed++;
|
402 |
+
|
403 |
+
retId = prefix; // start with prefix, add current milliseconds hex string
|
404 |
+
retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
|
405 |
+
retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
|
406 |
+
if (more_entropy) {
|
407 |
+
// for more entropy we add a float lower to 10
|
408 |
+
retId += (Math.random() * 10).toFixed(8).toString();
|
409 |
+
}
|
410 |
+
|
411 |
+
return retId;
|
412 |
+
},
|
413 |
+
log: function log() {
|
414 |
+
//if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
|
415 |
+
for (var i = 0, n = arguments.length; i < n; i++) {
|
416 |
+
console.log(arguments[i]);
|
417 |
+
}
|
418 |
+
//}
|
419 |
+
},
|
420 |
+
blockContent: function blockContent() {
|
421 |
+
if ($('#learn-press-block-content').length === 0) {
|
422 |
+
$(LP.template('learn-press-template-block-content', {})).appendTo($('body'));
|
423 |
+
}
|
424 |
+
LP.hideMainScrollbar().addClass('block-content');
|
425 |
+
$(document).trigger('learn_press_block_content');
|
426 |
+
},
|
427 |
+
unblockContent: function unblockContent() {
|
428 |
+
setTimeout(function () {
|
429 |
+
LP.showMainScrollbar().removeClass('block-content');
|
430 |
+
$(document).trigger('learn_press_unblock_content');
|
431 |
+
}, 350);
|
432 |
+
},
|
433 |
+
hideMainScrollbar: function hideMainScrollbar(el) {
|
434 |
+
if (!el) {
|
435 |
+
el = 'html, body';
|
436 |
+
}
|
437 |
+
var $el = $(el);
|
438 |
+
$el.each(function () {
|
439 |
+
var $root = $(this),
|
440 |
+
overflow = $root.css('overflow');
|
441 |
+
$root.css('overflow', 'hidden').attr('overflow', overflow);
|
442 |
+
});
|
443 |
+
return $el;
|
444 |
+
},
|
445 |
+
showMainScrollbar: function showMainScrollbar(el) {
|
446 |
+
if (!el) {
|
447 |
+
el = 'html, body';
|
448 |
+
}
|
449 |
+
var $el = $(el);
|
450 |
+
$el.each(function () {
|
451 |
+
var $root = $(this),
|
452 |
+
overflow = $root.attr('overflow');
|
453 |
+
$root.css('overflow', overflow).removeAttr('overflow');
|
454 |
+
});
|
455 |
+
return $el;
|
456 |
+
},
|
457 |
+
template: typeof _ !== 'undefined' ? _.memoize(function (id, data) {
|
458 |
+
var compiled,
|
459 |
+
options = {
|
460 |
+
evaluate: /<#([\s\S]+?)#>/g,
|
461 |
+
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
462 |
+
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
463 |
+
variable: 'data'
|
464 |
+
};
|
465 |
+
|
466 |
+
var tmpl = function tmpl(data) {
|
467 |
+
compiled = compiled || _.template($('#' + id).html(), null, options);
|
468 |
+
return compiled(data);
|
469 |
+
};
|
470 |
+
return data ? tmpl(data) : tmpl;
|
471 |
+
}, function (a, b) {
|
472 |
+
return a + '-' + JSON.stringify(b);
|
473 |
+
}) : function () {
|
474 |
+
return '';
|
475 |
+
},
|
476 |
+
alert: function alert(localize, callback) {
|
477 |
+
var title = '',
|
478 |
+
message = '';
|
479 |
+
if (typeof localize === 'string') {
|
480 |
+
message = localize;
|
481 |
+
} else {
|
482 |
+
if (typeof localize['title'] !== 'undefined') {
|
483 |
+
title = localize['title'];
|
484 |
+
}
|
485 |
+
if (typeof localize['message'] !== 'undefined') {
|
486 |
+
message = localize['message'];
|
487 |
+
}
|
488 |
+
}
|
489 |
+
$.alerts.alert(message, title, function (e) {
|
490 |
+
LP._on_alert_hide();
|
491 |
+
callback && callback(e);
|
492 |
+
});
|
493 |
+
this._on_alert_show();
|
494 |
+
},
|
495 |
+
confirm: function confirm(localize, callback) {
|
496 |
+
var title = '',
|
497 |
+
message = '';
|
498 |
+
|
499 |
+
if (typeof localize === 'string') {
|
500 |
+
message = localize;
|
501 |
+
} else {
|
502 |
+
if (typeof localize['title'] !== 'undefined') {
|
503 |
+
title = localize['title'];
|
504 |
+
}
|
505 |
+
if (typeof localize['message'] !== 'undefined') {
|
506 |
+
message = localize['message'];
|
507 |
+
}
|
508 |
+
}
|
509 |
+
$.alerts.confirm(message, title, function (e) {
|
510 |
+
LP._on_alert_hide();
|
511 |
+
callback && callback(e);
|
512 |
+
});
|
513 |
+
this._on_alert_show();
|
514 |
+
},
|
515 |
+
_on_alert_show: function _on_alert_show() {
|
516 |
+
var $container = $('#popup_container'),
|
517 |
+
$placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container);
|
518 |
+
$container.stop().css('top', '-=50').css('opacity', '0').animate({
|
519 |
+
top: '+=50',
|
520 |
+
opacity: 1
|
521 |
+
}, 250);
|
522 |
+
},
|
523 |
+
_on_alert_hide: function _on_alert_hide() {
|
524 |
+
var $holder = $("#popup_container_placeholder"),
|
525 |
+
$container = $holder.data('xxx');
|
526 |
+
if ($container) {
|
527 |
+
$container.replaceWith($holder);
|
528 |
+
}
|
529 |
+
$container.appendTo($(document.body));
|
530 |
+
$container.stop().animate({
|
531 |
+
top: '+=50',
|
532 |
+
opacity: 0
|
533 |
+
}, 250, function () {
|
534 |
+
$(this).remove();
|
535 |
+
});
|
536 |
+
},
|
537 |
+
sendMessage: function sendMessage(data, object, targetOrigin, transfer) {
|
538 |
+
if ($.isPlainObject(data)) {
|
539 |
+
data = JSON.stringify(data);
|
540 |
+
}
|
541 |
+
object = object || window;
|
542 |
+
targetOrigin = targetOrigin || '*';
|
543 |
+
object.postMessage(data, targetOrigin, transfer);
|
544 |
+
},
|
545 |
+
receiveMessage: function receiveMessage(event, b) {
|
546 |
+
var target = event.origin || event.originalEvent.origin,
|
547 |
+
data = event.data || event.originalEvent.data || '';
|
548 |
+
if (typeof data === 'string' || data instanceof String) {
|
549 |
+
if (data.indexOf('{') === 0) {
|
550 |
+
data = LP.parseJSON(data);
|
551 |
+
}
|
552 |
+
}
|
553 |
+
LP.Hook.doAction('learn_press_receive_message', data, target);
|
554 |
+
}
|
555 |
+
};
|
556 |
+
|
557 |
+
$(document).ready(function () {
|
558 |
+
if (typeof $.alerts !== 'undefined') {
|
559 |
+
$.alerts.overlayColor = '#000';
|
560 |
+
$.alerts.overlayOpacity = 0.5;
|
561 |
+
$.alerts.okButton = lpGlobalSettings.localize.button_ok;
|
562 |
+
$.alerts.cancelButton = lpGlobalSettings.localize.button_cancel;
|
563 |
+
}
|
564 |
+
|
565 |
+
$('.learn-press-message.fixed').each(function () {
|
566 |
+
var $el = $(this),
|
567 |
+
options = $el.data();
|
568 |
+
(function ($el, options) {
|
569 |
+
if (options.delayIn) {
|
570 |
+
setTimeout(function () {
|
571 |
+
$el.show().hide().fadeIn();
|
572 |
+
}, options.delayIn);
|
573 |
+
}
|
574 |
+
if (options.delayOut) {
|
575 |
+
setTimeout(function () {
|
576 |
+
$el.fadeOut();
|
577 |
+
}, options.delayOut + (options.delayIn || 0));
|
578 |
+
}
|
579 |
+
})($el, options);
|
580 |
+
});
|
581 |
+
|
582 |
+
$('body').on('click', '.learn-press-nav-tabs li a', function (e) {
|
583 |
+
e.preventDefault();
|
584 |
+
var $tab = $(this),
|
585 |
+
url = '';
|
586 |
+
$tab.closest('li').addClass('active').siblings().removeClass('active');
|
587 |
+
$($tab.attr('data-tab')).addClass('active').siblings().removeClass('active');
|
588 |
+
$(document).trigger('learn-press/nav-tabs/clicked', $tab);
|
589 |
+
});
|
590 |
+
|
591 |
+
setTimeout(function () {
|
592 |
+
$('.learn-press-nav-tabs li.active:not(.default) a').trigger('click');
|
593 |
+
}, 300);
|
594 |
+
|
595 |
+
$('body.course-item-popup').parent().css('overflow', 'hidden');
|
596 |
+
|
597 |
+
(function () {
|
598 |
+
var timer = null,
|
599 |
+
callback = function callback() {
|
600 |
+
$('.auto-check-lines').checkLines(function (r) {
|
601 |
+
if (r > 1) {
|
602 |
+
$(this).removeClass('single-lines');
|
603 |
+
} else {
|
604 |
+
$(this).addClass('single-lines');
|
605 |
+
}
|
606 |
+
$(this).attr('rows', r);
|
607 |
+
});
|
608 |
+
};
|
609 |
+
$(window).on('resize.check-lines', function () {
|
610 |
+
if (timer) {
|
611 |
+
timer && clearTimeout(timer);
|
612 |
+
timer = setTimeout(callback, 300);
|
613 |
+
} else {
|
614 |
+
callback();
|
615 |
+
}
|
616 |
+
});
|
617 |
+
})();
|
618 |
+
|
619 |
+
$('.learn-press-tooltip, .lp-passing-conditional').LP_Tooltip({ offset: [24, 24] });
|
620 |
+
|
621 |
+
$('.learn-press-icon').LP_Tooltip({ offset: [30, 30] });
|
622 |
+
|
623 |
+
$('.learn-press-message[data-autoclose]').each(function () {
|
624 |
+
var $el = $(this),
|
625 |
+
delay = parseInt($el.data('autoclose'));
|
626 |
+
if (delay) {
|
627 |
+
setTimeout(function ($el) {
|
628 |
+
$el.fadeOut();
|
629 |
+
}, delay, $el);
|
630 |
+
}
|
631 |
+
});
|
632 |
+
|
633 |
+
$(document).on('click', function () {
|
634 |
+
$(document).trigger('learn-press/close-all-quick-tip');
|
635 |
+
});
|
636 |
+
});
|
637 |
+
|
638 |
+
(0, _extend2.default)(_extends({
|
639 |
+
Event_Callback: _eventCallback2.default,
|
640 |
+
MessageBox: _messageBox2.default
|
641 |
+
}, _default));
|
642 |
+
|
643 |
+
exports.default = {
|
644 |
+
fn: _fn2.default,
|
645 |
+
QuickTip: _quickTip2.default
|
646 |
+
};
|
647 |
+
|
648 |
+
/***/ }),
|
649 |
+
/* 2 */
|
650 |
+
/***/ (function(module, exports, __webpack_require__) {
|
651 |
+
|
652 |
+
"use strict";
|
653 |
+
|
654 |
+
|
655 |
+
Object.defineProperty(exports, "__esModule", {
|
656 |
+
value: true
|
657 |
+
});
|
658 |
+
/**
|
659 |
+
* Auto prepend `LP` prefix for jQuery fn plugin name.
|
660 |
+
*
|
661 |
+
* Create : $.fn.LP( 'PLUGIN_NAME', func) <=> $.fn.LP_PLUGIN_NAME
|
662 |
+
* Usage: $(selector).LP('PLUGIN_NAME') <=> $(selector).LP_PLUGIN_NAME()
|
663 |
+
*
|
664 |
+
* @version 3.2.6
|
665 |
+
*/
|
666 |
+
|
667 |
+
var $ = window.jQuery;
|
668 |
+
var exp;
|
669 |
+
|
670 |
+
(function () {
|
671 |
+
|
672 |
+
if ($ === undefined) {
|
673 |
+
return;
|
674 |
+
}
|
675 |
+
|
676 |
+
$.fn.LP = exp = function exp(widget, fn) {
|
677 |
+
if ($.isFunction(fn)) {
|
678 |
+
$.fn['LP_' + widget] = fn;
|
679 |
+
} else if (widget) {
|
680 |
+
var args = [];
|
681 |
+
if (arguments.length > 1) {
|
682 |
+
for (var i = 1; i < arguments.length; i++) {
|
683 |
+
args.push(arguments[i]);
|
684 |
+
}
|
685 |
+
}
|
686 |
+
|
687 |
+
return $.isFunction($(this)['LP_' + widget]) ? $(this)['LP_' + widget].apply(this, args) : this;
|
688 |
+
}
|
689 |
+
return this;
|
690 |
+
};
|
691 |
+
})();
|
692 |
+
|
693 |
+
exports.default = exp;
|
694 |
+
|
695 |
+
/***/ }),
|
696 |
+
/* 3 */
|
697 |
+
/***/ (function(module, exports, __webpack_require__) {
|
698 |
+
|
699 |
+
"use strict";
|
700 |
+
|
701 |
+
|
702 |
+
;(function ($) {
|
703 |
+
function QuickTip(el, options) {
|
704 |
+
var $el = $(el),
|
705 |
+
uniId = $el.attr('data-id') || LP.uniqueId();
|
706 |
+
|
707 |
+
options = $.extend({
|
708 |
+
event: 'hover',
|
709 |
+
autoClose: true,
|
710 |
+
single: true,
|
711 |
+
closeInterval: 1000,
|
712 |
+
arrowOffset: null,
|
713 |
+
tipClass: ''
|
714 |
+
}, options, $el.data());
|
715 |
+
|
716 |
+
$el.attr('data-id', uniId);
|
717 |
+
|
718 |
+
var content = $el.attr('data-content-tip') || $el.html(),
|
719 |
+
$tip = $('<div class="learn-press-tip-floating">' + content + '</div>'),
|
720 |
+
t = null,
|
721 |
+
closeInterval = 0,
|
722 |
+
useData = false,
|
723 |
+
arrowOffset = options.arrowOffset === 'el' ? $el.outerWidth() / 2 : 8,
|
724 |
+
$content = $('#__' + uniId);
|
725 |
+
|
726 |
+
if ($content.length === 0) {
|
727 |
+
$(document.body).append($('<div />').attr('id', '__' + uniId).html(content).css('display', 'none'));
|
728 |
+
}
|
729 |
+
|
730 |
+
content = $content.html();
|
731 |
+
|
732 |
+
$tip.addClass(options.tipClass);
|
733 |
+
|
734 |
+
$el.data('content-tip', content);
|
735 |
+
if ($el.attr('data-content-tip')) {
|
736 |
+
//$el.removeAttr('data-content-tip');
|
737 |
+
useData = true;
|
738 |
+
}
|
739 |
+
|
740 |
+
closeInterval = options.closeInterval;
|
741 |
+
|
742 |
+
if (options.autoClose === false) {
|
743 |
+
$tip.append('<a class="close"></a>');
|
744 |
+
$tip.on('click', '.close', function () {
|
745 |
+
close();
|
746 |
+
});
|
747 |
+
}
|
748 |
+
|
749 |
+
function show() {
|
750 |
+
if (t) {
|
751 |
+
clearTimeout(t);
|
752 |
+
return;
|
753 |
+
}
|
754 |
+
|
755 |
+
if (options.single) {
|
756 |
+
$('.learn-press-tip').not($el).LP('QuickTip', 'close');
|
757 |
+
}
|
758 |
+
|
759 |
+
$tip.appendTo(document.body);
|
760 |
+
var pos = $el.offset();
|
761 |
+
|
762 |
+
$tip.css({
|
763 |
+
top: pos.top - $tip.outerHeight() - 8,
|
764 |
+
left: pos.left - $tip.outerWidth() / 2 + arrowOffset
|
765 |
+
});
|
766 |
+
}
|
767 |
+
|
768 |
+
function hide() {
|
769 |
+
t && clearTimeout(t);
|
770 |
+
t = setTimeout(function () {
|
771 |
+
$tip.detach();
|
772 |
+
t = null;
|
773 |
+
}, closeInterval);
|
774 |
+
}
|
775 |
+
|
776 |
+
function close() {
|
777 |
+
closeInterval = 0;
|
778 |
+
hide();
|
779 |
+
closeInterval = options.closeInterval;
|
780 |
+
}
|
781 |
+
|
782 |
+
function open() {
|
783 |
+
show();
|
784 |
+
}
|
785 |
+
|
786 |
+
if (!useData) {
|
787 |
+
$el.html('');
|
788 |
+
}
|
789 |
+
|
790 |
+
if (options.event === 'click') {
|
791 |
+
$el.on('click', function (e) {
|
792 |
+
e.stopPropagation();
|
793 |
+
show();
|
794 |
+
});
|
795 |
+
}
|
796 |
+
|
797 |
+
$(document).on('learn-press/close-all-quick-tip', function () {
|
798 |
+
close();
|
799 |
+
});
|
800 |
+
$el.hover(function (e) {
|
801 |
+
e.stopPropagation();
|
802 |
+
if (options.event !== 'click') {
|
803 |
+
show();
|
804 |
+
}
|
805 |
+
}, function (e) {
|
806 |
+
e.stopPropagation();
|
807 |
+
if (options.autoClose) {
|
808 |
+
hide();
|
809 |
+
}
|
810 |
+
}).addClass('ready');
|
811 |
+
return {
|
812 |
+
close: close,
|
813 |
+
open: open
|
814 |
+
};
|
815 |
+
}
|
816 |
+
|
817 |
+
$.fn.LP('QuickTip', function (options) {
|
818 |
+
return $.each(this, function () {
|
819 |
+
var $tip = $(this).data('quick-tip');
|
820 |
+
|
821 |
+
if (!$tip) {
|
822 |
+
$tip = new QuickTip(this, options);
|
823 |
+
$(this).data('quick-tip', $tip);
|
824 |
+
}
|
825 |
+
|
826 |
+
if ($.type(options) === 'string') {
|
827 |
+
$tip[options] && $tip[options].apply($tip);
|
828 |
+
}
|
829 |
+
});
|
830 |
+
});
|
831 |
+
})(jQuery);
|
832 |
+
|
833 |
+
/***/ }),
|
834 |
+
/* 4 */
|
835 |
+
/***/ (function(module, exports, __webpack_require__) {
|
836 |
+
|
837 |
+
"use strict";
|
838 |
+
|
839 |
+
|
840 |
+
Object.defineProperty(exports, "__esModule", {
|
841 |
+
value: true
|
842 |
+
});
|
843 |
+
var $ = window.jQuery;
|
844 |
+
var MessageBox = {
|
845 |
+
/*
|
846 |
+
*
|
847 |
+
*/
|
848 |
+
$block: null,
|
849 |
+
$window: null,
|
850 |
+
events: {},
|
851 |
+
instances: [],
|
852 |
+
instance: null,
|
853 |
+
quickConfirm: function quickConfirm(elem, args) {
|
854 |
+
var $e = $(elem);
|
855 |
+
$('[learn-press-quick-confirm]').each(function () {
|
856 |
+
var $ins;
|
857 |
+
($ins = $(this).data('quick-confirm')) && (console.log($ins), $ins.destroy());
|
858 |
+
});
|
859 |
+
!$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm', new function (elem, args) {
|
860 |
+
var $elem = $(elem),
|
861 |
+
$div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem),
|
862 |
+
//($(document.body)),
|
863 |
+
offset = $(elem).position() || { left: 0, top: 0 },
|
864 |
+
timerOut = null,
|
865 |
+
timerHide = null,
|
866 |
+
n = 3,
|
867 |
+
hide = function hide() {
|
868 |
+
$div.fadeOut('fast', function () {
|
869 |
+
$(this).remove();
|
870 |
+
$div.parent().css('position', '');
|
871 |
+
});
|
872 |
+
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
873 |
+
stop();
|
874 |
+
},
|
875 |
+
stop = function stop() {
|
876 |
+
timerHide && clearInterval(timerHide);
|
877 |
+
timerOut && clearInterval(timerOut);
|
878 |
+
},
|
879 |
+
start = function start() {
|
880 |
+
timerOut = setInterval(function () {
|
881 |
+
if (--n == 0) {
|
882 |
+
hide.call($div[0]);
|
883 |
+
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
884 |
+
stop();
|
885 |
+
}
|
886 |
+
$div.find('span').html(' (' + n + ')');
|
887 |
+
}, 1000);
|
888 |
+
|
889 |
+
timerHide = setInterval(function () {
|
890 |
+
if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') {
|
891 |
+
stop();
|
892 |
+
$div.remove();
|
893 |
+
$div.parent().css('position', '');
|
894 |
+
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
895 |
+
}
|
896 |
+
}, 350);
|
897 |
+
};
|
898 |
+
args = $.extend({
|
899 |
+
message: '',
|
900 |
+
data: null,
|
901 |
+
onOk: null,
|
902 |
+
onCancel: null,
|
903 |
+
offset: { top: 0, left: 0 }
|
904 |
+
}, args || {});
|
905 |
+
$div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append('<span> (' + n + ')</span>').css({});
|
906 |
+
$div.click(function () {
|
907 |
+
$.isFunction(args.onOk) && args.onOk(args.data);
|
908 |
+
hide();
|
909 |
+
}).hover(function () {
|
910 |
+
stop();
|
911 |
+
}, function () {
|
912 |
+
start();
|
913 |
+
});
|
914 |
+
//$div.parent().css('position', 'relative');
|
915 |
+
$div.css({
|
916 |
+
left: offset.left + $elem.outerWidth() - $div.outerWidth() + args.offset.left,
|
917 |
+
top: offset.top + $elem.outerHeight() + args.offset.top + 5
|
918 |
+
}).hide().fadeIn('fast');
|
919 |
+
start();
|
920 |
+
|
921 |
+
this.destroy = function () {
|
922 |
+
$div.remove();
|
923 |
+
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
924 |
+
stop();
|
925 |
+
};
|
926 |
+
}(elem, args));
|
927 |
+
},
|
928 |
+
show: function show(message, args) {
|
929 |
+
//this.hide();
|
930 |
+
$.proxy(function () {
|
931 |
+
args = $.extend({
|
932 |
+
title: '',
|
933 |
+
buttons: '',
|
934 |
+
events: false,
|
935 |
+
autohide: false,
|
936 |
+
message: message,
|
937 |
+
data: false,
|
938 |
+
id: LP.uniqueId(),
|
939 |
+
onHide: null
|
940 |
+
}, args || {});
|
941 |
+
|
942 |
+
this.instances.push(args);
|
943 |
+
this.instance = args;
|
944 |
+
|
945 |
+
var $doc = $(document),
|
946 |
+
$body = $(document.body);
|
947 |
+
if (!this.$block) {
|
948 |
+
this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body);
|
949 |
+
}
|
950 |
+
if (!this.$window) {
|
951 |
+
this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
|
952 |
+
this.$window.click(function () {});
|
953 |
+
}
|
954 |
+
//this.events = args.events || {};
|
955 |
+
this._createWindow(message, args.title, args.buttons);
|
956 |
+
this.$block.show();
|
957 |
+
this.$window.show().attr('instance', args.id);
|
958 |
+
$(window).bind('resize.message-box', $.proxy(this.update, this)).bind('scroll.message-box', $.proxy(this.update, this));
|
959 |
+
this.update(true);
|
960 |
+
if (args.autohide) {
|
961 |
+
setTimeout(function () {
|
962 |
+
LP.MessageBox.hide();
|
963 |
+
$.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args);
|
964 |
+
}, args.autohide);
|
965 |
+
}
|
966 |
+
}, this)();
|
967 |
+
},
|
968 |
+
blockUI: function blockUI(message) {
|
969 |
+
|
970 |
+
message = (message !== false ? message ? message : 'Wait a moment' : '') + '<div class="message-box-animation"></div>';
|
971 |
+
this.show(message);
|
972 |
+
},
|
973 |
+
hide: function hide(delay, instance) {
|
974 |
+
if (instance) {
|
975 |
+
this._removeInstance(instance.id);
|
976 |
+
} else if (this.instance) {
|
977 |
+
this._removeInstance(this.instance.id);
|
978 |
+
}
|
979 |
+
if (this.instances.length === 0) {
|
980 |
+
if (this.$block) {
|
981 |
+
this.$block.hide();
|
982 |
+
}
|
983 |
+
if (this.$window) {
|
984 |
+
this.$window.hide();
|
985 |
+
}
|
986 |
+
$(window).unbind('resize.message-box', this.update).unbind('scroll.message-box', this.update);
|
987 |
+
} else {
|
988 |
+
if (this.instance) {
|
989 |
+
this._createWindow(this.instance.message, this.instance.title, this.instance.buttons);
|
990 |
+
}
|
991 |
+
}
|
992 |
+
},
|
993 |
+
update: function update(force) {
|
994 |
+
var that = this,
|
995 |
+
$wrap = this.$window.find('#message-box-wrap'),
|
996 |
+
timer = $wrap.data('timer'),
|
997 |
+
_update = function _update() {
|
998 |
+
LP.Hook.doAction('learn_press_message_box_before_resize', that);
|
999 |
+
var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'),
|
1000 |
+
width = $wrap.outerWidth(),
|
1001 |
+
height = $wrap.outerHeight(),
|
1002 |
+
contentHeight = $content.height(),
|
1003 |
+
windowHeight = $(window).height(),
|
1004 |
+
top = $wrap.offset().top;
|
1005 |
+
if (contentHeight > windowHeight - 50) {
|
1006 |
+
$content.css({
|
1007 |
+
height: windowHeight - 25
|
1008 |
+
});
|
1009 |
+
height = $wrap.outerHeight();
|
1010 |
+
} else {
|
1011 |
+
$content.css("height", "").css('overflow', '');
|
1012 |
+
}
|
1013 |
+
$wrap.css({
|
1014 |
+
marginTop: ($(window).height() - height) / 2
|
1015 |
+
});
|
1016 |
+
LP.Hook.doAction('learn_press_message_box_resize', height, that);
|
1017 |
+
};
|
1018 |
+
if (force) _update();
|
1019 |
+
timer && clearTimeout(timer);
|
1020 |
+
timer = setTimeout(_update, 250);
|
1021 |
+
},
|
1022 |
+
_removeInstance: function _removeInstance(id) {
|
1023 |
+
for (var i = 0; i < this.instances.length; i++) {
|
1024 |
+
if (this.instances[i].id === id) {
|
1025 |
+
|
1026 |
+
this.instances.splice(i, 1);
|
1027 |
+
|
1028 |
+
var len = this.instances.length;
|
1029 |
+
if (len) {
|
1030 |
+
this.instance = this.instances[len - 1];
|
1031 |
+
this.$window.attr('instance', this.instance.id);
|
1032 |
+
} else {
|
1033 |
+
this.instance = false;
|
1034 |
+
this.$window.removeAttr('instance');
|
1035 |
+
}
|
1036 |
+
break;
|
1037 |
+
}
|
1038 |
+
}
|
1039 |
+
},
|
1040 |
+
_getInstance: function _getInstance(id) {
|
1041 |
+
for (var i = 0; i < this.instances.length; i++) {
|
1042 |
+
if (this.instances[i].id === id) {
|
1043 |
+
return this.instances[i];
|
1044 |
+
}
|
1045 |
+
}
|
1046 |
+
},
|
1047 |
+
_createWindow: function _createWindow(message, title, buttons) {
|
1048 |
+
var $wrap = this.$window.find('#message-box-wrap').html('');
|
1049 |
+
if (title) {
|
1050 |
+
$wrap.append('<h3 class="message-box-title">' + title + '</h3>');
|
1051 |
+
}
|
1052 |
+
$wrap.append($('<div class="message-box-content"></div>').html(message));
|
1053 |
+
if (buttons) {
|
1054 |
+
var $buttons = $('<div class="message-box-buttons"></div>');
|
1055 |
+
switch (buttons) {
|
1056 |
+
case 'yesNo':
|
1057 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes'));
|
1058 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_no, 'no'));
|
1059 |
+
break;
|
1060 |
+
case 'okCancel':
|
1061 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
1062 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel'));
|
1063 |
+
break;
|
1064 |
+
default:
|
1065 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
1066 |
+
}
|
1067 |
+
$wrap.append($buttons);
|
1068 |
+
}
|
1069 |
+
},
|
1070 |
+
_createButton: function _createButton(title, type) {
|
1071 |
+
var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + '</button>'),
|
1072 |
+
callback = 'on' + (type.substr(0, 1).toUpperCase() + type.substr(1));
|
1073 |
+
$button.data('callback', callback).click(function () {
|
1074 |
+
var instance = $(this).data('instance'),
|
1075 |
+
callback = instance.events[$(this).data('callback')];
|
1076 |
+
if ($.type(callback) === 'function') {
|
1077 |
+
if (callback.apply(LP.MessageBox, [instance]) === false) {
|
1078 |
+
// return;
|
1079 |
+
} else {
|
1080 |
+
LP.MessageBox.hide(null, instance);
|
1081 |
+
}
|
1082 |
+
} else {
|
1083 |
+
LP.MessageBox.hide(null, instance);
|
1084 |
+
}
|
1085 |
+
}).data('instance', this.instance);
|
1086 |
+
return $button;
|
1087 |
+
}
|
1088 |
+
};
|
1089 |
+
|
1090 |
+
exports.default = MessageBox;
|
1091 |
+
|
1092 |
+
/***/ }),
|
1093 |
+
/* 5 */
|
1094 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1095 |
+
|
1096 |
+
"use strict";
|
1097 |
+
|
1098 |
+
|
1099 |
+
Object.defineProperty(exports, "__esModule", {
|
1100 |
+
value: true
|
1101 |
+
});
|
1102 |
+
/**
|
1103 |
+
* Manage event callbacks.
|
1104 |
+
* Allow add/remove a callback function into custom event of an object.
|
1105 |
+
*
|
1106 |
+
* @constructor
|
1107 |
+
*/
|
1108 |
+
var Event_Callback = function Event_Callback(self) {
|
1109 |
+
var callbacks = {};
|
1110 |
+
var $ = window.jQuery;
|
1111 |
+
|
1112 |
+
this.on = function (event, callback) {
|
1113 |
+
var namespaces = event.split('.'),
|
1114 |
+
namespace = '';
|
1115 |
+
|
1116 |
+
if (namespaces.length > 1) {
|
1117 |
+
event = namespaces[0];
|
1118 |
+
namespace = namespaces[1];
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
if (!callbacks[event]) {
|
1122 |
+
callbacks[event] = [[], {}];
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
if (namespace) {
|
1126 |
+
if (!callbacks[event][1][namespace]) {
|
1127 |
+
callbacks[event][1][namespace] = [];
|
1128 |
+
}
|
1129 |
+
callbacks[event][1][namespace].push(callback);
|
1130 |
+
} else {
|
1131 |
+
callbacks[event][0].push(callback);
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
return self;
|
1135 |
+
};
|
1136 |
+
|
1137 |
+
this.off = function (event, callback) {
|
1138 |
+
var namespaces = event.split('.'),
|
1139 |
+
namespace = '';
|
1140 |
+
|
1141 |
+
if (namespaces.length > 1) {
|
1142 |
+
event = namespaces[0];
|
1143 |
+
namespace = namespaces[1];
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
if (!callbacks[event]) {
|
1147 |
+
return self;
|
1148 |
+
}
|
1149 |
+
var at = -1;
|
1150 |
+
if (!namespace) {
|
1151 |
+
if ($.isFunction(callback)) {
|
1152 |
+
at = callbacks[event][0].indexOf(callback);
|
1153 |
+
if (at < 0) {
|
1154 |
+
return self;
|
1155 |
+
}
|
1156 |
+
callbacks[event][0].splice(at, 1);
|
1157 |
+
} else {
|
1158 |
+
callbacks[event][0] = [];
|
1159 |
+
}
|
1160 |
+
} else {
|
1161 |
+
if (!callbacks[event][1][namespace]) {
|
1162 |
+
return self;
|
1163 |
+
}
|
1164 |
+
|
1165 |
+
if ($.isFunction(callback)) {
|
1166 |
+
at = callbacks[event][1][namespace].indexOf(callback);
|
1167 |
+
if (at < 0) {
|
1168 |
+
return self;
|
1169 |
+
}
|
1170 |
+
callbacks[event][1][namespace].splice(at, 1);
|
1171 |
+
} else {
|
1172 |
+
callbacks[event][1][namespace] = [];
|
1173 |
+
}
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
return self;
|
1177 |
+
};
|
1178 |
+
|
1179 |
+
this.callEvent = function (event, callbackArgs) {
|
1180 |
+
if (!callbacks[event]) {
|
1181 |
+
return;
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
if (callbacks[event][0]) {
|
1185 |
+
for (var i = 0; i < callbacks[event][0].length; i++) {
|
1186 |
+
$.isFunction(callbacks[event][0][i]) && callbacks[event][i][0].apply(self, callbackArgs);
|
1187 |
+
}
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
if (callbacks[event][1]) {
|
1191 |
+
for (var i in callbacks[event][1]) {
|
1192 |
+
for (var j = 0; j < callbacks[event][1][i].length; j++) {
|
1193 |
+
$.isFunction(callbacks[event][1][i][j]) && callbacks[event][1][i][j].apply(self, callbackArgs);
|
1194 |
+
}
|
1195 |
+
}
|
1196 |
+
}
|
1197 |
+
};
|
1198 |
+
};
|
1199 |
+
|
1200 |
+
exports.default = Event_Callback;
|
1201 |
+
|
1202 |
+
/***/ }),
|
1203 |
+
/* 6 */
|
1204 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1205 |
+
|
1206 |
+
"use strict";
|
1207 |
+
|
1208 |
+
|
1209 |
+
Object.defineProperty(exports, "__esModule", {
|
1210 |
+
value: true
|
1211 |
+
});
|
1212 |
+
var Hook = {
|
1213 |
+
hooks: { action: {}, filter: {} },
|
1214 |
+
addAction: function addAction(action, callable, priority, tag) {
|
1215 |
+
this.addHook('action', action, callable, priority, tag);
|
1216 |
+
return this;
|
1217 |
+
},
|
1218 |
+
addFilter: function addFilter(action, callable, priority, tag) {
|
1219 |
+
this.addHook('filter', action, callable, priority, tag);
|
1220 |
+
return this;
|
1221 |
+
},
|
1222 |
+
doAction: function doAction(action) {
|
1223 |
+
this.doHook('action', action, arguments);
|
1224 |
+
return this;
|
1225 |
+
},
|
1226 |
+
applyFilters: function applyFilters(action) {
|
1227 |
+
return this.doHook('filter', action, arguments);
|
1228 |
+
},
|
1229 |
+
removeAction: function removeAction(action, tag) {
|
1230 |
+
this.removeHook('action', action, tag);
|
1231 |
+
return this;
|
1232 |
+
},
|
1233 |
+
removeFilter: function removeFilter(action, priority, tag) {
|
1234 |
+
this.removeHook('filter', action, priority, tag);
|
1235 |
+
return this;
|
1236 |
+
},
|
1237 |
+
addHook: function addHook(hookType, action, callable, priority, tag) {
|
1238 |
+
if (undefined === this.hooks[hookType][action]) {
|
1239 |
+
this.hooks[hookType][action] = [];
|
1240 |
+
}
|
1241 |
+
var hooks = this.hooks[hookType][action];
|
1242 |
+
if (undefined === tag) {
|
1243 |
+
tag = action + '_' + hooks.length;
|
1244 |
+
}
|
1245 |
+
this.hooks[hookType][action].push({ tag: tag, callable: callable, priority: priority });
|
1246 |
+
return this;
|
1247 |
+
},
|
1248 |
+
doHook: function doHook(hookType, action, args) {
|
1249 |
+
|
1250 |
+
// splice args from object into array and remove first index which is the hook name
|
1251 |
+
args = Array.prototype.slice.call(args, 1);
|
1252 |
+
|
1253 |
+
if (undefined !== this.hooks[hookType][action]) {
|
1254 |
+
var hooks = this.hooks[hookType][action],
|
1255 |
+
hook;
|
1256 |
+
//sort by priority
|
1257 |
+
hooks.sort(function (a, b) {
|
1258 |
+
return a["priority"] - b["priority"];
|
1259 |
+
});
|
1260 |
+
for (var i = 0; i < hooks.length; i++) {
|
1261 |
+
hook = hooks[i].callable;
|
1262 |
+
if (typeof hook !== 'function') hook = window[hook];
|
1263 |
+
if ('action' === hookType) {
|
1264 |
+
hook.apply(null, args);
|
1265 |
+
} else {
|
1266 |
+
args[0] = hook.apply(null, args);
|
1267 |
+
}
|
1268 |
+
}
|
1269 |
+
}
|
1270 |
+
if ('filter' === hookType) {
|
1271 |
+
return args[0];
|
1272 |
+
}
|
1273 |
+
return this;
|
1274 |
+
},
|
1275 |
+
removeHook: function removeHook(hookType, action, priority, tag) {
|
1276 |
+
if (undefined !== this.hooks[hookType][action]) {
|
1277 |
+
var hooks = this.hooks[hookType][action];
|
1278 |
+
for (var i = hooks.length - 1; i >= 0; i--) {
|
1279 |
+
if ((undefined === tag || tag === hooks[i].tag) && (undefined === priority || priority === hooks[i].priority)) {
|
1280 |
+
hooks.splice(i, 1);
|
1281 |
+
}
|
1282 |
+
}
|
1283 |
+
}
|
1284 |
+
return this;
|
1285 |
+
}
|
1286 |
+
};
|
1287 |
+
|
1288 |
+
exports.default = Hook;
|
1289 |
+
|
1290 |
+
/***/ }),
|
1291 |
+
/* 7 */
|
1292 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1293 |
+
|
1294 |
+
"use strict";
|
1295 |
+
|
1296 |
+
|
1297 |
+
Object.defineProperty(exports, "__esModule", {
|
1298 |
+
value: true
|
1299 |
+
});
|
1300 |
+
|
1301 |
+
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; };
|
1302 |
+
|
1303 |
+
var $ = window.jQuery;
|
1304 |
+
|
1305 |
+
var serializeJSON = function serializeJSON(path) {
|
1306 |
+
var isInput = $(this).is('input') || $(this).is('select') || $(this).is('textarea');
|
1307 |
+
var unIndexed = isInput ? $(this).serializeArray() : $(this).find('input, select, textarea').serializeArray(),
|
1308 |
+
indexed = {},
|
1309 |
+
validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g,
|
1310 |
+
arrayKeys = {},
|
1311 |
+
end = false;
|
1312 |
+
$.each(unIndexed, function () {
|
1313 |
+
var that = this,
|
1314 |
+
match = this.name.match(/^([0-9a-zA-Z_-]+)/);
|
1315 |
+
if (!match) {
|
1316 |
+
return;
|
1317 |
+
}
|
1318 |
+
var keys = this.name.match(validate),
|
1319 |
+
objPath = "indexed['" + match[0] + "']";
|
1320 |
+
|
1321 |
+
if (keys) {
|
1322 |
+
if (_typeof(indexed[match[0]]) != 'object') {
|
1323 |
+
indexed[match[0]] = {};
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
$.each(keys, function (i, prop) {
|
1327 |
+
prop = prop.replace(/\]|\[/g, '');
|
1328 |
+
var rawPath = objPath.replace(/'|\[|\]/g, ''),
|
1329 |
+
objExp = '',
|
1330 |
+
preObjPath = objPath;
|
1331 |
+
|
1332 |
+
if (prop == '') {
|
1333 |
+
if (arrayKeys[rawPath] == undefined) {
|
1334 |
+
arrayKeys[rawPath] = 0;
|
1335 |
+
} else {
|
1336 |
+
arrayKeys[rawPath]++;
|
1337 |
+
}
|
1338 |
+
objPath += "['" + arrayKeys[rawPath] + "']";
|
1339 |
+
} else {
|
1340 |
+
if (!isNaN(prop)) {
|
1341 |
+
arrayKeys[rawPath] = prop;
|
1342 |
+
}
|
1343 |
+
objPath += "['" + prop + "']";
|
1344 |
+
}
|
1345 |
+
try {
|
1346 |
+
if (i == keys.length - 1) {
|
1347 |
+
objExp = objPath + "=that.value;";
|
1348 |
+
end = true;
|
1349 |
+
} else {
|
1350 |
+
objExp = objPath + "={}";
|
1351 |
+
end = false;
|
1352 |
+
}
|
1353 |
+
|
1354 |
+
var evalString = "" + "if( typeof " + objPath + " == 'undefined'){" + objExp + ";" + "}else{" + "if(end){" + "if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}" + "}";
|
1355 |
+
eval(evalString);
|
1356 |
+
} catch (e) {
|
1357 |
+
console.log('Error:' + e + "\n" + objExp);
|
1358 |
+
}
|
1359 |
+
});
|
1360 |
+
} else {
|
1361 |
+
indexed[match[0]] = this.value;
|
1362 |
+
}
|
1363 |
+
});
|
1364 |
+
if (path) {
|
1365 |
+
path = "['" + path.replace('.', "']['") + "']";
|
1366 |
+
var c = 'try{indexed = indexed' + path + '}catch(ex){console.log(c, ex);}';
|
1367 |
+
eval(c);
|
1368 |
+
}
|
1369 |
+
return indexed;
|
1370 |
+
};
|
1371 |
+
|
1372 |
+
var LP_Tooltip = function LP_Tooltip(options) {
|
1373 |
+
options = $.extend({}, {
|
1374 |
+
offset: [0, 0]
|
1375 |
+
}, options || {});
|
1376 |
+
return $.each(this, function () {
|
1377 |
+
var $el = $(this),
|
1378 |
+
content = $el.data('content');
|
1379 |
+
if (!content || $el.data('LP_Tooltip') !== undefined) {
|
1380 |
+
return;
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
var $tooltip = null;
|
1384 |
+
$el.hover(function (e) {
|
1385 |
+
$tooltip = $('<div class="learn-press-tooltip-bubble"/>').html(content).appendTo($('body')).hide();
|
1386 |
+
var position = $el.offset();
|
1387 |
+
if ($.isArray(options.offset)) {
|
1388 |
+
var top = options.offset[1],
|
1389 |
+
left = options.offset[0];
|
1390 |
+
if ($.isNumeric(left)) {
|
1391 |
+
position.left += left;
|
1392 |
+
} else {}
|
1393 |
+
if ($.isNumeric(top)) {
|
1394 |
+
position.top += top;
|
1395 |
+
} else {}
|
1396 |
+
}
|
1397 |
+
$tooltip.css({
|
1398 |
+
top: position.top,
|
1399 |
+
left: position.left
|
1400 |
+
});
|
1401 |
+
$tooltip.fadeIn();
|
1402 |
+
}, function () {
|
1403 |
+
$tooltip && $tooltip.remove();
|
1404 |
+
});
|
1405 |
+
$el.data('tooltip', true);
|
1406 |
+
});
|
1407 |
+
};
|
1408 |
+
|
1409 |
+
var hasEvent = function hasEvent(name) {
|
1410 |
+
var events = $(this).data('events');
|
1411 |
+
if (typeof events.LP == 'undefined') {
|
1412 |
+
return false;
|
1413 |
+
}
|
1414 |
+
for (i = 0; i < events.LP.length; i++) {
|
1415 |
+
if (events.LP[i].namespace == name) {
|
1416 |
+
return true;
|
1417 |
+
}
|
1418 |
+
}
|
1419 |
+
return false;
|
1420 |
+
};
|
1421 |
+
|
1422 |
+
var dataToJSON = function dataToJSON() {
|
1423 |
+
var json = {};
|
1424 |
+
$.each(this[0].attributes, function () {
|
1425 |
+
var m = this.name.match(/^data-(.*)/);
|
1426 |
+
if (m) {
|
1427 |
+
json[m[1]] = this.value;
|
1428 |
+
}
|
1429 |
+
});
|
1430 |
+
return json;
|
1431 |
+
};
|
1432 |
+
|
1433 |
+
var rows = function rows() {
|
1434 |
+
var h = $(this).height();
|
1435 |
+
var lh = $(this).css('line-height').replace("px", "");
|
1436 |
+
$(this).attr({ height: h, 'line-height': lh });
|
1437 |
+
return Math.floor(h / parseInt(lh));
|
1438 |
+
};
|
1439 |
+
|
1440 |
+
var checkLines = function checkLines(p) {
|
1441 |
+
return this.each(function () {
|
1442 |
+
var $e = $(this),
|
1443 |
+
rows = $e.rows();
|
1444 |
+
|
1445 |
+
p.call(this, rows);
|
1446 |
+
});
|
1447 |
+
};
|
1448 |
+
|
1449 |
+
var findNext = function findNext(selector) {
|
1450 |
+
var $selector = $(selector),
|
1451 |
+
$root = this.first(),
|
1452 |
+
index = $selector.index($root),
|
1453 |
+
$next = $selector.eq(index + 1);
|
1454 |
+
return $next.length ? $next : false;
|
1455 |
+
};
|
1456 |
+
|
1457 |
+
var findPrev = function findPrev(selector) {
|
1458 |
+
var $selector = $(selector),
|
1459 |
+
$root = this.first(),
|
1460 |
+
index = $selector.index($root),
|
1461 |
+
$prev = $selector.eq(index - 1);
|
1462 |
+
return $prev.length ? $prev : false;
|
1463 |
+
};
|
1464 |
+
|
1465 |
+
var progress = function progress(v) {
|
1466 |
+
return this.each(function () {
|
1467 |
+
var t = parseInt(v / 100 * 360),
|
1468 |
+
timer = null,
|
1469 |
+
$this = $(this);
|
1470 |
+
|
1471 |
+
if (t < 180) {
|
1472 |
+
$this.find('.progress-circle').removeClass('gt-50');
|
1473 |
+
} else {
|
1474 |
+
$this.find('.progress-circle').addClass('gt-50');
|
1475 |
+
}
|
1476 |
+
$this.find('.fill').css({
|
1477 |
+
transform: 'rotate(' + t + 'deg)'
|
1478 |
+
});
|
1479 |
+
});
|
1480 |
+
};
|
1481 |
+
|
1482 |
+
$.fn.serializeJSON = serializeJSON;
|
1483 |
+
$.fn.LP_Tooltip = LP_Tooltip;
|
1484 |
+
$.fn.hasEvent = hasEvent;
|
1485 |
+
$.fn.dataToJSON = dataToJSON;
|
1486 |
+
$.fn.rows = rows;
|
1487 |
+
$.fn.checkLines = checkLines;
|
1488 |
+
$.fn.findNext = findNext;
|
1489 |
+
$.fn.findPrev = findPrev;
|
1490 |
+
$.fn.progress = progress;
|
1491 |
+
|
1492 |
+
exports.default = {
|
1493 |
+
serializeJSON: serializeJSON,
|
1494 |
+
LP_Tooltip: LP_Tooltip,
|
1495 |
+
hasEvent: hasEvent,
|
1496 |
+
dataToJSON: dataToJSON,
|
1497 |
+
rows: rows,
|
1498 |
+
checkLines: checkLines,
|
1499 |
+
findNext: findNext,
|
1500 |
+
findPrev: findPrev,
|
1501 |
+
progress: progress
|
1502 |
+
};
|
1503 |
+
|
1504 |
+
/***/ }),
|
1505 |
+
/* 8 */,
|
1506 |
+
/* 9 */,
|
1507 |
+
/* 10 */
|
1508 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1509 |
+
|
1510 |
+
"use strict";
|
1511 |
+
|
1512 |
+
|
1513 |
+
Object.defineProperty(exports, "__esModule", {
|
1514 |
+
value: true
|
1515 |
+
});
|
1516 |
+
exports.default = isEmail;
|
1517 |
+
/**
|
1518 |
+
* Validate is an email.
|
1519 |
+
*
|
1520 |
+
* @param email
|
1521 |
+
* @return {boolean}
|
1522 |
+
*/
|
1523 |
+
function isEmail(email) {
|
1524 |
+
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
1525 |
+
return re.test(email);
|
1526 |
+
};
|
1527 |
+
|
1528 |
+
/***/ }),
|
1529 |
+
/* 11 */
|
1530 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1531 |
+
|
1532 |
+
"use strict";
|
1533 |
+
|
1534 |
+
|
1535 |
+
/**
|
1536 |
+
* Conditional Logic for metabox fields
|
1537 |
+
*
|
1538 |
+
* @author ThimPress
|
1539 |
+
* @package LearnPress/JS
|
1540 |
+
* @version 3.0.0
|
1541 |
+
*/
|
1542 |
+
;(function ($) {
|
1543 |
+
window.conditional_logic_gray_state = function (state, field) {
|
1544 |
+
if (state) {
|
1545 |
+
$(this).removeClass('disabled');
|
1546 |
+
} else {
|
1547 |
+
$(this).addClass('disabled');
|
1548 |
+
}
|
1549 |
+
};
|
1550 |
+
var Conditional_Logic = window.Conditional_Logic = function (options) {
|
1551 |
+
this.options = $.extend({}, options || {});
|
1552 |
+
this.updateAll();
|
1553 |
+
};
|
1554 |
+
|
1555 |
+
Conditional_Logic.prototype = $.extend(Conditional_Logic.prototype, {
|
1556 |
+
evaluate: function evaluate(changedId, conditionals) {
|
1557 |
+
if (!conditionals) {
|
1558 |
+
return undefined;
|
1559 |
+
}
|
1560 |
+
if (!conditionals || !$.isArray(conditionals.conditional)) {
|
1561 |
+
return undefined;
|
1562 |
+
}
|
1563 |
+
var show = undefined,
|
1564 |
+
controls = conditionals.conditional;
|
1565 |
+
for (var i in controls) {
|
1566 |
+
var _show = this.evaluateRequirement(controls[i]),
|
1567 |
+
operator = (controls[i].combine || 'and').toLowerCase();
|
1568 |
+
if (_show !== undefined && show !== undefined) {
|
1569 |
+
if (operator === 'and') {
|
1570 |
+
show = show && _show;
|
1571 |
+
} else {
|
1572 |
+
show = show || _show;
|
1573 |
+
}
|
1574 |
+
} else if (show === undefined) {
|
1575 |
+
show = _show;
|
1576 |
+
}
|
1577 |
+
}
|
1578 |
+
return show;
|
1579 |
+
},
|
1580 |
+
evaluateRequirement: function evaluateRequirement(requirement) {
|
1581 |
+
if (!requirement) {
|
1582 |
+
return undefined;
|
1583 |
+
}
|
1584 |
+
if (!requirement['field']) {
|
1585 |
+
return undefined;
|
1586 |
+
}
|
1587 |
+
if (requirement['compare'] === undefined) {
|
1588 |
+
requirement['compare'] = '=';
|
1589 |
+
}
|
1590 |
+
var control = $('#field-' + requirement.field);
|
1591 |
+
switch (requirement['state']) {
|
1592 |
+
case 'show':
|
1593 |
+
return control.is(':visible');
|
1594 |
+
break;
|
1595 |
+
case 'hide':
|
1596 |
+
return !control.is(':visible');
|
1597 |
+
break;
|
1598 |
+
default:
|
1599 |
+
var value = '';
|
1600 |
+
switch (this.getFieldType(control)) {
|
1601 |
+
case 'yes-no':
|
1602 |
+
var $chk = control.find('input[type="checkbox"]');
|
1603 |
+
value = $chk.is(':checked') ? $chk.val() : '';
|
1604 |
+
break;
|
1605 |
+
case 'radio':
|
1606 |
+
value = control.find('input:checked').val();
|
1607 |
+
break;
|
1608 |
+
default:
|
1609 |
+
value = control.find('input, select').val();
|
1610 |
+
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
return this.compare(requirement['value'], value, requirement['compare']);
|
1614 |
+
}
|
1615 |
+
},
|
1616 |
+
|
1617 |
+
compare: function compare(value2, value1, operator) {
|
1618 |
+
var show = undefined;
|
1619 |
+
switch (operator) {
|
1620 |
+
case '===':
|
1621 |
+
show = value1 === value2;
|
1622 |
+
break;
|
1623 |
+
case '==':
|
1624 |
+
case '=':
|
1625 |
+
case 'equals':
|
1626 |
+
case 'equal':
|
1627 |
+
show = value1 === value2;
|
1628 |
+
break;
|
1629 |
+
case '!==':
|
1630 |
+
show = value1 !== value2;
|
1631 |
+
break;
|
1632 |
+
case '!=':
|
1633 |
+
case 'not equal':
|
1634 |
+
show = value1 !== value2;
|
1635 |
+
break;
|
1636 |
+
case '>=':
|
1637 |
+
case 'greater or equal':
|
1638 |
+
case 'equal or greater':
|
1639 |
+
show = value1 >= value2;
|
1640 |
+
break;
|
1641 |
+
case '<=':
|
1642 |
+
case 'smaller or equal':
|
1643 |
+
case 'equal or smaller':
|
1644 |
+
show = value1 <= value2;
|
1645 |
+
break;
|
1646 |
+
case '>':
|
1647 |
+
case 'greater':
|
1648 |
+
show = value1 > value2;
|
1649 |
+
break;
|
1650 |
+
case '<':
|
1651 |
+
case 'smaller':
|
1652 |
+
show = value1 < value2;
|
1653 |
+
break;
|
1654 |
+
case 'contains':
|
1655 |
+
case 'in':
|
1656 |
+
var _array, _string;
|
1657 |
+
if ($.isArray(value1) && !$.isArray(value2)) {
|
1658 |
+
_array = value1;
|
1659 |
+
_string = value2;
|
1660 |
+
} else if ($.isArray(value2) && !$.isArray(value1)) {
|
1661 |
+
_array = value2;
|
1662 |
+
_string = value1;
|
1663 |
+
}
|
1664 |
+
if (_array && _string) {
|
1665 |
+
if (-1 === $.inArray(_string, _array)) {
|
1666 |
+
show = false;
|
1667 |
+
}
|
1668 |
+
} else {
|
1669 |
+
if (-1 === value1.indexOf(value2) && -1 === value2.indexOf(value1)) {
|
1670 |
+
show = false;
|
1671 |
+
}
|
1672 |
+
}
|
1673 |
+
break;
|
1674 |
+
default:
|
1675 |
+
show = value1 === value2;
|
1676 |
+
}
|
1677 |
+
if (show !== undefined) {
|
1678 |
+
return show;
|
1679 |
+
}
|
1680 |
+
return true;
|
1681 |
+
},
|
1682 |
+
hasConditional: function hasConditional(source, target) {
|
1683 |
+
if (!this.options.conditionals) {
|
1684 |
+
return;
|
1685 |
+
}
|
1686 |
+
if (!this.options.conditionals[target]) {
|
1687 |
+
return false;
|
1688 |
+
}
|
1689 |
+
for (var i in this.options.conditionals[target]['conditional']) {
|
1690 |
+
if (this.options.conditionals[target]['conditional'][i].field === source) {
|
1691 |
+
return this.options.conditionals[target];
|
1692 |
+
}
|
1693 |
+
}
|
1694 |
+
return false;
|
1695 |
+
},
|
1696 |
+
update: function update(changedField, $fields) {
|
1697 |
+
var $changedField = $(changedField),
|
1698 |
+
id = this.getFieldName($changedField);
|
1699 |
+
$fields = $fields || $('.rwmb-field');
|
1700 |
+
_.forEach($fields, function (field) {
|
1701 |
+
var thisField = $(field),
|
1702 |
+
thisId = this.getFieldName(thisField);
|
1703 |
+
|
1704 |
+
if (thisId === id) {
|
1705 |
+
return;
|
1706 |
+
}
|
1707 |
+
var conditional = this.hasConditional(id, thisId);
|
1708 |
+
|
1709 |
+
if (!conditional) {
|
1710 |
+
return;
|
1711 |
+
}
|
1712 |
+
var show = this.evaluate($changedField, conditional);
|
1713 |
+
|
1714 |
+
if (show !== undefined) {
|
1715 |
+
if (conditional.state === 'hide') {
|
1716 |
+
show = !show;
|
1717 |
+
}
|
1718 |
+
if ($.isFunction(window[conditional.state_callback])) {
|
1719 |
+
window[conditional.state_callback].call(thisField, show, thisField);
|
1720 |
+
} else {
|
1721 |
+
thisField.toggle(show);
|
1722 |
+
}
|
1723 |
+
}
|
1724 |
+
}, this);
|
1725 |
+
},
|
1726 |
+
updateAll: function updateAll() {
|
1727 |
+
var $fields = $('.rwmb-field'),
|
1728 |
+
that = this;
|
1729 |
+
_.forEach($fields, function (field) {
|
1730 |
+
var $field = $(field),
|
1731 |
+
type = this.getFieldType($field),
|
1732 |
+
id = $field.find('.rwmb-field-name').val();
|
1733 |
+
if (!id) {
|
1734 |
+
return;
|
1735 |
+
}
|
1736 |
+
$field.attr('id', 'field-' + id);
|
1737 |
+
|
1738 |
+
if (-1 === _.indexOf(this.supportFields, type)) {
|
1739 |
+
return;
|
1740 |
+
}
|
1741 |
+
$field.find('input, select, textarea').on('change', function () {
|
1742 |
+
that.update($(this).closest('.rwmb-field'), $fields);
|
1743 |
+
}).trigger('change');
|
1744 |
+
}, this);
|
1745 |
+
},
|
1746 |
+
getFieldType: function getFieldType(field) {
|
1747 |
+
var $field = $(field);
|
1748 |
+
if ($field.length === 0) {
|
1749 |
+
return false;
|
1750 |
+
}
|
1751 |
+
var className = $field.get(0).className,
|
1752 |
+
m = className.match(/rwmb-([^\s]*)-wrapper/);
|
1753 |
+
if (m) {
|
1754 |
+
return m[1];
|
1755 |
+
}
|
1756 |
+
return false;
|
1757 |
+
},
|
1758 |
+
getFieldName: function getFieldName(field) {
|
1759 |
+
return $(field).find('.rwmb-field-name').val();
|
1760 |
+
},
|
1761 |
+
supportFields: ['yes-no', 'text', 'number', 'radio']
|
1762 |
+
});
|
1763 |
+
$(document).ready(function () {
|
1764 |
+
if (window.lp_conditional_logic !== undefined) {
|
1765 |
+
new Conditional_Logic({ conditionals: lp_conditional_logic });
|
1766 |
+
}
|
1767 |
+
});
|
1768 |
+
})(jQuery);
|
1769 |
+
|
1770 |
+
/***/ }),
|
1771 |
+
/* 12 */,
|
1772 |
+
/* 13 */,
|
1773 |
+
/* 14 */,
|
1774 |
+
/* 15 */,
|
1775 |
+
/* 16 */,
|
1776 |
+
/* 17 */,
|
1777 |
+
/* 18 */,
|
1778 |
+
/* 19 */
|
1779 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1780 |
+
|
1781 |
+
"use strict";
|
1782 |
+
|
1783 |
+
|
1784 |
+
Object.defineProperty(exports, "__esModule", {
|
1785 |
+
value: true
|
1786 |
+
});
|
1787 |
+
|
1788 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // global utilities
|
1789 |
+
|
1790 |
+
|
1791 |
+
// local utilities
|
1792 |
+
|
1793 |
+
|
1794 |
+
var _utils = __webpack_require__(1);
|
1795 |
+
|
1796 |
+
var Utils = _interopRequireWildcard(_utils);
|
1797 |
+
|
1798 |
+
var _adminNotice = __webpack_require__(20);
|
1799 |
+
|
1800 |
+
var _adminNotice2 = _interopRequireDefault(_adminNotice);
|
1801 |
+
|
1802 |
+
var _advertisement = __webpack_require__(21);
|
1803 |
+
|
1804 |
+
var _advertisement2 = _interopRequireDefault(_advertisement);
|
1805 |
+
|
1806 |
+
var _dropdownPages = __webpack_require__(22);
|
1807 |
+
|
1808 |
+
var _dropdownPages2 = _interopRequireDefault(_dropdownPages);
|
1809 |
+
|
1810 |
+
var _advancedList = __webpack_require__(23);
|
1811 |
+
|
1812 |
+
var _advancedList2 = _interopRequireDefault(_advancedList);
|
1813 |
+
|
1814 |
+
var _adminTabs = __webpack_require__(24);
|
1815 |
+
|
1816 |
+
var _adminTabs2 = _interopRequireDefault(_adminTabs);
|
1817 |
+
|
1818 |
+
var _emailValidator = __webpack_require__(10);
|
1819 |
+
|
1820 |
+
var _emailValidator2 = _interopRequireDefault(_emailValidator);
|
1821 |
+
|
1822 |
+
var _modalSearchUsers = __webpack_require__(25);
|
1823 |
+
|
1824 |
+
var _modalSearchUsers2 = _interopRequireDefault(_modalSearchUsers);
|
1825 |
+
|
1826 |
+
var _modalSearchItems = __webpack_require__(26);
|
1827 |
+
|
1828 |
+
var _modalSearchItems2 = _interopRequireDefault(_modalSearchItems);
|
1829 |
+
|
1830 |
+
var _searchItems = __webpack_require__(27);
|
1831 |
+
|
1832 |
+
var _searchItems2 = _interopRequireDefault(_searchItems);
|
1833 |
+
|
1834 |
+
var _conditionalLogic = __webpack_require__(11);
|
1835 |
+
|
1836 |
+
var _conditionalLogic2 = _interopRequireDefault(_conditionalLogic);
|
1837 |
+
|
1838 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1839 |
+
|
1840 |
+
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; } }
|
1841 |
+
|
1842 |
+
exports.default = _extends({}, Utils, {
|
1843 |
+
dismissNotice: _adminNotice2.default,
|
1844 |
+
Advertisement: _advertisement2.default,
|
1845 |
+
DropdownPages: _dropdownPages2.default,
|
1846 |
+
AdvancedList: _advancedList2.default,
|
1847 |
+
AdminTabs: _adminTabs2.default,
|
1848 |
+
isEmail: _emailValidator2.default,
|
1849 |
+
ModalSearchItems: _modalSearchItems2.default,
|
1850 |
+
ModalSearchUsers: _modalSearchUsers2.default
|
1851 |
+
});
|
1852 |
+
|
1853 |
+
/***/ }),
|
1854 |
+
/* 20 */
|
1855 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1856 |
+
|
1857 |
+
"use strict";
|
1858 |
+
|
1859 |
+
|
1860 |
+
Object.defineProperty(exports, "__esModule", {
|
1861 |
+
value: true
|
1862 |
+
});
|
1863 |
+
|
1864 |
+
var _extend = __webpack_require__(0);
|
1865 |
+
|
1866 |
+
var _extend2 = _interopRequireDefault(_extend);
|
1867 |
+
|
1868 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1869 |
+
|
1870 |
+
var $ = window.jQuery;
|
1871 |
+
|
1872 |
+
var dismissNotice = function dismissNotice(notice, options) {
|
1873 |
+
var hooks = wp.hooks;
|
1874 |
+
|
1875 |
+
options = $.extend({ el: null }, options || {});
|
1876 |
+
|
1877 |
+
hooks && hooks.doAction('before-dismiss-notice', 'LP', notice, options);
|
1878 |
+
$.ajax({
|
1879 |
+
url: '',
|
1880 |
+
data: $.extend({ 'lp-dismiss-notice': notice }, options.data || {}),
|
1881 |
+
dataType: 'text',
|
1882 |
+
success: function success(response) {
|
1883 |
+
|
1884 |
+
response = LP.parseJSON(response);
|
1885 |
+
|
1886 |
+
if (response.dismissed === notice) {
|
1887 |
+
$(options.el).fadeOut();
|
1888 |
+
}
|
1889 |
+
|
1890 |
+
hooks && hooks.doAction('dismissed-notice', 'LP', notice, options);
|
1891 |
+
}
|
1892 |
+
});
|
1893 |
+
};
|
1894 |
+
|
1895 |
+
(function ($) {
|
1896 |
+
|
1897 |
+
if (typeof $ === 'undefined') {
|
1898 |
+
return;
|
1899 |
+
}
|
1900 |
+
|
1901 |
+
$(document).on('click', '.lp-notice [data-dismiss-notice]', function () {
|
1902 |
+
var data = $(this).data();
|
1903 |
+
var notice = data.dismissNotice;
|
1904 |
+
|
1905 |
+
delete data.dismissNotice;
|
1906 |
+
|
1907 |
+
dismissNotice(notice, { data: data, el: $(this).closest('.lp-notice') });
|
1908 |
+
});
|
1909 |
+
})(window.jQuery);
|
1910 |
+
|
1911 |
+
(0, _extend2.default)('Utils', { dismissNotice: dismissNotice });
|
1912 |
+
|
1913 |
+
exports.default = dismissNotice;
|
1914 |
+
|
1915 |
+
/***/ }),
|
1916 |
+
/* 21 */
|
1917 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1918 |
+
|
1919 |
+
"use strict";
|
1920 |
+
|
1921 |
+
|
1922 |
+
;(function ($) {
|
1923 |
+
function LP_Advertisement_Slider(el, options) {
|
1924 |
+
this.options = $.extend({}, options || {});
|
1925 |
+
var $el = $(el),
|
1926 |
+
$items = $el.find('.slide-item'),
|
1927 |
+
$controls = $('<div class="slider-controls"><div class="prev-item"></div><div class="next-item"></div></div>'),
|
1928 |
+
$wrapItems = $('<div class="slider-items"></div>').append($items),
|
1929 |
+
itemIndex = 0,
|
1930 |
+
timer = null;
|
1931 |
+
|
1932 |
+
function init() {
|
1933 |
+
createHTML();
|
1934 |
+
bindEvents();
|
1935 |
+
activeItem();
|
1936 |
+
}
|
1937 |
+
|
1938 |
+
function createHTML() {
|
1939 |
+
$el.append($wrapItems);
|
1940 |
+
$items.each(function () {
|
1941 |
+
$(this).append($controls.clone());
|
1942 |
+
});
|
1943 |
+
}
|
1944 |
+
|
1945 |
+
function activeItem(index) {
|
1946 |
+
index = index !== undefined ? index : itemIndex;
|
1947 |
+
var activeItem = $items.eq(index);
|
1948 |
+
|
1949 |
+
activeItem.show();
|
1950 |
+
// A ha???
|
1951 |
+
setTimeout(function () {
|
1952 |
+
activeItem.addClass('slide-active');
|
1953 |
+
}, 1);
|
1954 |
+
|
1955 |
+
activeItem.siblings().removeClass('slide-active');
|
1956 |
+
|
1957 |
+
timer && clearTimeout(timer);
|
1958 |
+
timer = setTimeout(function () {
|
1959 |
+
activeItem.siblings().hide();
|
1960 |
+
}, 500);
|
1961 |
+
}
|
1962 |
+
|
1963 |
+
function nextItem() {
|
1964 |
+
if (itemIndex < $items.length - 1) {
|
1965 |
+
itemIndex++;
|
1966 |
+
} else {
|
1967 |
+
itemIndex = 0;
|
1968 |
+
}
|
1969 |
+
activeItem(itemIndex);
|
1970 |
+
}
|
1971 |
+
|
1972 |
+
function prevItem() {
|
1973 |
+
if (itemIndex > 0) {
|
1974 |
+
itemIndex--;
|
1975 |
+
} else {
|
1976 |
+
itemIndex = $items.length - 1;
|
1977 |
+
}
|
1978 |
+
activeItem(itemIndex);
|
1979 |
+
}
|
1980 |
+
|
1981 |
+
function bindEvents() {
|
1982 |
+
$el.on('click', '.next-item', nextItem);
|
1983 |
+
$el.on('click', '.prev-item', prevItem);
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
init();
|
1987 |
+
}
|
1988 |
+
|
1989 |
+
$.fn.LP('Advertisement', function (opts) {
|
1990 |
+
return $.each(this, function () {
|
1991 |
+
var $slider = $(this).data('LP_Advertisement_Slider');
|
1992 |
+
if (!$slider) {
|
1993 |
+
$slider = new LP_Advertisement_Slider(this, opts);
|
1994 |
+
$(this).data('LP_Advertisement_Slider', $slider);
|
1995 |
+
}
|
1996 |
+
return this;
|
1997 |
+
});
|
1998 |
+
});
|
1999 |
+
})(jQuery);
|
2000 |
+
|
2001 |
+
/***/ }),
|
2002 |
+
/* 22 */
|
2003 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2004 |
+
|
2005 |
+
"use strict";
|
2006 |
+
|
2007 |
+
|
2008 |
+
;(function () {
|
2009 |
+
var $ = window.jQuery;
|
2010 |
+
|
2011 |
+
if ($ === undefined) {
|
2012 |
+
return;
|
2013 |
+
}
|
2014 |
+
|
2015 |
+
function DropdownPages(el, options) {
|
2016 |
+
this.options = $.extend({
|
2017 |
+
ID: '',
|
2018 |
+
name: 'Add new page'
|
2019 |
+
}, options || {});
|
2020 |
+
var $element = $(el),
|
2021 |
+
$select = $element.find('select'),
|
2022 |
+
$listWrap = $element.find('.list-pages-wrapper'),
|
2023 |
+
$actions = $element.find('.quick-add-page-actions'),
|
2024 |
+
$form = $element.find('.quick-add-page-inline');
|
2025 |
+
|
2026 |
+
function addNewPageToList(args) {
|
2027 |
+
var $new_option = $('<option value="' + args.ID + '">' + args.name + '</option>');
|
2028 |
+
var position = $.inArray(args.ID + "", args.positions);
|
2029 |
+
|
2030 |
+
$('.learn-press-dropdown-pages select').each(function () {
|
2031 |
+
var $sel = $(this),
|
2032 |
+
$option = $new_option.clone();
|
2033 |
+
if (position == 0) {
|
2034 |
+
$('option', $sel).each(function () {
|
2035 |
+
if (parseInt($(this).val())) {
|
2036 |
+
$option.insertBefore($(this));
|
2037 |
+
return false;
|
2038 |
+
}
|
2039 |
+
});
|
2040 |
+
} else if (position == args.positions.length - 1) {
|
2041 |
+
$sel.append($option);
|
2042 |
+
} else {
|
2043 |
+
$option.insertAfter($('option[value="' + args.positions[position - 1] + '"]', $sel));
|
2044 |
+
}
|
2045 |
+
});
|
2046 |
+
}
|
2047 |
+
|
2048 |
+
$select.change(function () {
|
2049 |
+
|
2050 |
+
$actions.addClass('hide-if-js');
|
2051 |
+
if (this.value !== 'add_new_page') {
|
2052 |
+
if (parseInt(this.value)) {
|
2053 |
+
$actions.find('a.edit-page').attr('href', 'post.php?post=' + this.value + '&action=edit');
|
2054 |
+
$actions.find('a.view-page').attr('href', lpGlobalSettings.siteurl + '?page_id=' + this.value);
|
2055 |
+
$actions.removeClass('hide-if-js');
|
2056 |
+
$select.attr('data-selected', this.value);
|
2057 |
+
}
|
2058 |
+
return;
|
2059 |
+
}
|
2060 |
+
$listWrap.addClass('hide-if-js');
|
2061 |
+
$form.removeClass('hide-if-js').find('input').focus().val('');
|
2062 |
+
});
|
2063 |
+
|
2064 |
+
// Select 2
|
2065 |
+
$select.css('width', $select.width() + 50).find('option').each(function () {
|
2066 |
+
$(this).html($(this).html().replace(/ /g, ''));
|
2067 |
+
});
|
2068 |
+
|
2069 |
+
$select.select2({
|
2070 |
+
allowClear: true
|
2071 |
+
});
|
2072 |
+
|
2073 |
+
$select.on('select2:select', function (e) {
|
2074 |
+
var data = e.params.data;
|
2075 |
+
});
|
2076 |
+
|
2077 |
+
$element.on('click', '.quick-add-page-inline button', function () {
|
2078 |
+
var $button = $(this),
|
2079 |
+
$input = $form.find('input'),
|
2080 |
+
page_name = $input.val();
|
2081 |
+
if (!page_name) {
|
2082 |
+
alert('Please enter the name of page');
|
2083 |
+
$input.focus();
|
2084 |
+
return;
|
2085 |
+
}
|
2086 |
+
$button.prop('disabled', true);
|
2087 |
+
$.ajax({
|
2088 |
+
url: lpGlobalSettings.ajax,
|
2089 |
+
data: {
|
2090 |
+
action: 'learnpress_create_page',
|
2091 |
+
page_name: page_name
|
2092 |
+
},
|
2093 |
+
type: 'post',
|
2094 |
+
dataType: 'html',
|
2095 |
+
success: function success(response) {
|
2096 |
+
response = LP.parseJSON(response);
|
2097 |
+
if (response.page) {
|
2098 |
+
addNewPageToList({
|
2099 |
+
ID: response.page.ID,
|
2100 |
+
name: response.page.post_title,
|
2101 |
+
positions: response.positions
|
2102 |
+
});
|
2103 |
+
$select.val(response.page.ID).focus().trigger('change');
|
2104 |
+
$form.addClass('hide-if-js');
|
2105 |
+
} else if (response.error) {
|
2106 |
+
alert(response.error);
|
2107 |
+
}
|
2108 |
+
$button.prop('disabled', false);
|
2109 |
+
$listWrap.removeClass('hide-if-js');
|
2110 |
+
}
|
2111 |
+
});
|
2112 |
+
}).on('click', '.quick-add-page-inline a', function (e) {
|
2113 |
+
e.preventDefault();
|
2114 |
+
$form.addClass('hide-if-js');
|
2115 |
+
$select.val($select.attr('data-selected') + '').removeAttr('disabled').trigger('change');
|
2116 |
+
$listWrap.removeClass('hide-if-js');
|
2117 |
+
}).on('click', '.button-quick-add-page', function (e) {
|
2118 |
+
$select.val('add_new_page').trigger('change');
|
2119 |
+
}).on('keypress keydown', '.quick-add-page-inline input[type="text"]', function (e) {
|
2120 |
+
if (e.keyCode == 13 && e.type == 'keypress') {
|
2121 |
+
e.preventDefault();
|
2122 |
+
$(this).siblings('button').trigger('click');
|
2123 |
+
} else if (e.keyCode == 27 && e.type == 'keydown') {
|
2124 |
+
$(this).siblings('a').trigger('click');
|
2125 |
+
}
|
2126 |
+
});
|
2127 |
+
}
|
2128 |
+
|
2129 |
+
$.fn.LP('DropdownPages', function () {
|
2130 |
+
return $.each(this, function () {
|
2131 |
+
var $instance = $(this).data('DropdownPages');
|
2132 |
+
if (!$instance) {
|
2133 |
+
$instance = new DropdownPages(this, {});
|
2134 |
+
$(this).data('DropdownPages', $instance);
|
2135 |
+
}
|
2136 |
+
return $instance;
|
2137 |
+
});
|
2138 |
+
});
|
2139 |
+
})();
|
2140 |
+
|
2141 |
+
/***/ }),
|
2142 |
+
/* 23 */
|
2143 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2144 |
+
|
2145 |
+
"use strict";
|
2146 |
+
|
2147 |
+
|
2148 |
+
;(function ($) {
|
2149 |
+
/**
|
2150 |
+
* Advanced list.
|
2151 |
+
*
|
2152 |
+
* @param el
|
2153 |
+
* @param options
|
2154 |
+
*/
|
2155 |
+
var AdvancedList = function AdvancedList(el, options) {
|
2156 |
+
var self = this,
|
2157 |
+
$el = $(el).hasClass('advanced-list') ? $(el) : $('.advanced-list', el);
|
2158 |
+
|
2159 |
+
this.options = $.extend({
|
2160 |
+
template: '<li data-id="{{id}}"><span class="remove-item"></span><span>{{text}}</span> </li>'
|
2161 |
+
}, options || {});
|
2162 |
+
this.$el = $el;
|
2163 |
+
|
2164 |
+
/**
|
2165 |
+
* Callback for removing event.
|
2166 |
+
*
|
2167 |
+
* @param e
|
2168 |
+
* @private
|
2169 |
+
*/
|
2170 |
+
function _remove(e) {
|
2171 |
+
e.preventDefault();
|
2172 |
+
remove($el.children().index($(this).closest('li')) + 1);
|
2173 |
+
}
|
2174 |
+
|
2175 |
+
/**
|
2176 |
+
*
|
2177 |
+
* @param e
|
2178 |
+
* @private
|
2179 |
+
*/
|
2180 |
+
function _add(e) {}
|
2181 |
+
|
2182 |
+
/**
|
2183 |
+
* Remove an element at a position from list.
|
2184 |
+
*
|
2185 |
+
* @param at
|
2186 |
+
*/
|
2187 |
+
function remove(at) {
|
2188 |
+
$el.children(':eq(' + (at - 1) + ')').remove();
|
2189 |
+
self.options.onRemove && self.options.onRemove.call(self);
|
2190 |
+
}
|
2191 |
+
|
2192 |
+
/**
|
2193 |
+
* Add new element into list.
|
2194 |
+
*
|
2195 |
+
* @param data
|
2196 |
+
* @param at - Optional. Position where to insert
|
2197 |
+
*/
|
2198 |
+
function add(data, at) {
|
2199 |
+
var options = {},
|
2200 |
+
template = getTemplate();
|
2201 |
+
if ($.isPlainObject(data)) {
|
2202 |
+
options = $.extend({ id: 0, text: '' }, data);
|
2203 |
+
} else if (typeof data === 'string') {
|
2204 |
+
options = {
|
2205 |
+
id: '',
|
2206 |
+
text: data
|
2207 |
+
};
|
2208 |
+
} else if (data[0] !== undefined) {
|
2209 |
+
options = {
|
2210 |
+
id: data[1] ? data[1] : '',
|
2211 |
+
text: data[0]
|
2212 |
+
};
|
2213 |
+
}
|
2214 |
+
|
2215 |
+
// Replace placeholders with related variables
|
2216 |
+
for (var prop in options) {
|
2217 |
+
var reg = new RegExp('\{\{' + prop + '\}\}', 'g');
|
2218 |
+
template = template.replace(reg, options[prop]);
|
2219 |
+
}
|
2220 |
+
|
2221 |
+
template = $(template);
|
2222 |
+
|
2223 |
+
if (at !== undefined) {
|
2224 |
+
var $e = $el.children(':eq(' + (at - 1) + ')');
|
2225 |
+
if ($e.length) {
|
2226 |
+
template.insertBefore($e);
|
2227 |
+
} else {
|
2228 |
+
$el.append(template);
|
2229 |
+
}
|
2230 |
+
} else {
|
2231 |
+
$el.append(template);
|
2232 |
+
}
|
2233 |
+
|
2234 |
+
// Append "\n" between li elements
|
2235 |
+
var $child = $el.children().detach();
|
2236 |
+
$child.each(function () {
|
2237 |
+
$el.append("\n").append(this);
|
2238 |
+
});
|
2239 |
+
self.options.onAdd && self.options.onAdd.call(self);
|
2240 |
+
}
|
2241 |
+
|
2242 |
+
function getTemplate() {
|
2243 |
+
var $container = $(self.options.template);
|
2244 |
+
if ($container.length) {
|
2245 |
+
return $container.html();
|
2246 |
+
}
|
2247 |
+
return self.options.template;
|
2248 |
+
}
|
2249 |
+
|
2250 |
+
$el.on('click', '.remove-item', _remove);
|
2251 |
+
// export
|
2252 |
+
this.add = add;
|
2253 |
+
this.remove = remove;
|
2254 |
+
};
|
2255 |
+
|
2256 |
+
// Export
|
2257 |
+
$.fn.LP('AdvancedList', function (options) {
|
2258 |
+
var args = [];
|
2259 |
+
for (var i = 1; i < arguments.length; i++) {
|
2260 |
+
args.push(arguments[i]);
|
2261 |
+
}
|
2262 |
+
return $.each(this, function () {
|
2263 |
+
var $advancedList = $(this).data('advancedList');
|
2264 |
+
if (!$advancedList) {
|
2265 |
+
$advancedList = new AdvancedList(this, options);
|
2266 |
+
$(this).data('advancedList', $advancedList);
|
2267 |
+
}
|
2268 |
+
|
2269 |
+
// Try to calling to methods of class
|
2270 |
+
if (typeof options === 'string') {
|
2271 |
+
if ($.isFunction($advancedList[options])) {
|
2272 |
+
return $advancedList[options].apply($advancedList, args);
|
2273 |
+
}
|
2274 |
+
}
|
2275 |
+
return this;
|
2276 |
+
});
|
2277 |
+
});
|
2278 |
+
})(jQuery);
|
2279 |
+
|
2280 |
+
/***/ }),
|
2281 |
+
/* 24 */
|
2282 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2283 |
+
|
2284 |
+
"use strict";
|
2285 |
+
|
2286 |
+
|
2287 |
+
/**
|
2288 |
+
* Plugin: Tabs
|
2289 |
+
*/
|
2290 |
+
;(function ($) {
|
2291 |
+
var adminTabs = function adminTabs($el, options) {
|
2292 |
+
var $tabs = $el.find('.tabs-nav').find('li'),
|
2293 |
+
$tabsWrap = $tabs.parent(),
|
2294 |
+
$contents = $el.find('.tabs-content-container > li'),
|
2295 |
+
$currentTab = null,
|
2296 |
+
$currentContent = null;
|
2297 |
+
|
2298 |
+
function selectTab($tab) {
|
2299 |
+
var index = $tabs.index($tab),
|
2300 |
+
url = $tab.find('a').attr('href');
|
2301 |
+
|
2302 |
+
$currentContent = $contents.eq(index);
|
2303 |
+
|
2304 |
+
$tab.addClass('active').siblings('li.active').removeClass('active');
|
2305 |
+
$currentContent.show().css({ visibility: 'hidden' });
|
2306 |
+
calculateHeight($currentContent);
|
2307 |
+
$currentContent.hide();
|
2308 |
+
$currentContent.show();
|
2309 |
+
$currentContent.siblings('li.active').fadeOut(0, function () {
|
2310 |
+
$currentContent.addClass('active').siblings('li.active').removeClass('active');
|
2311 |
+
});
|
2312 |
+
|
2313 |
+
LP.setUrl(url);
|
2314 |
+
}
|
2315 |
+
|
2316 |
+
function calculateHeight($currentContent) {
|
2317 |
+
|
2318 |
+
var contentHeight = $currentContent.height(),
|
2319 |
+
tabsHeight = $tabsWrap.outerHeight();
|
2320 |
+
|
2321 |
+
if (contentHeight < tabsHeight) {
|
2322 |
+
contentHeight = tabsHeight + parseInt($tabsWrap.css('margin')) * 2;
|
2323 |
+
} else {
|
2324 |
+
contentHeight = undefined;
|
2325 |
+
}
|
2326 |
+
$currentContent.css('visibility', '').css({ height: contentHeight });
|
2327 |
+
}
|
2328 |
+
|
2329 |
+
function selectDefaultTab() {
|
2330 |
+
$currentTab = $tabs.filter('.active');
|
2331 |
+
if (!$currentTab.length) {
|
2332 |
+
$currentTab = $tabs.first();
|
2333 |
+
}
|
2334 |
+
$currentTab.find('a').trigger('click');
|
2335 |
+
}
|
2336 |
+
|
2337 |
+
function initEvents() {
|
2338 |
+
$el.on('click', '.tabs-nav a', function (event) {
|
2339 |
+
event.preventDefault();
|
2340 |
+
$currentTab = $(this).parent();
|
2341 |
+
selectTab($currentTab);
|
2342 |
+
});
|
2343 |
+
}
|
2344 |
+
|
2345 |
+
function init() {
|
2346 |
+
initEvents();
|
2347 |
+
selectDefaultTab();
|
2348 |
+
$(window).on('resize.calculate-tab', function () {
|
2349 |
+
var $currentContent = $el.find('.tabs-content-container .active').css('height', '');
|
2350 |
+
calculateHeight($currentContent);
|
2351 |
+
});
|
2352 |
+
}
|
2353 |
+
|
2354 |
+
init();
|
2355 |
+
};
|
2356 |
+
$.fn.LP('AdminTab', function (options) {
|
2357 |
+
options = $.extend({}, options || {});
|
2358 |
+
return $.each(this, function () {
|
2359 |
+
var $el = $(this),
|
2360 |
+
tabs = $el.data('learn-press/tabs');
|
2361 |
+
|
2362 |
+
if (!tabs) {
|
2363 |
+
tabs = new adminTabs($el, options);
|
2364 |
+
$el.data('learn-press/tabs', tabs);
|
2365 |
+
}
|
2366 |
+
return $el;
|
2367 |
+
});
|
2368 |
+
});
|
2369 |
+
})(jQuery);
|
2370 |
+
|
2371 |
+
/***/ }),
|
2372 |
+
/* 25 */
|
2373 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2374 |
+
|
2375 |
+
"use strict";
|
2376 |
+
|
2377 |
+
|
2378 |
+
var $ = window.jQuery;
|
2379 |
+
var _ = window._;
|
2380 |
+
window.$Vue = window.$Vue || window.Vue;
|
2381 |
+
|
2382 |
+
$(document).ready(function () {
|
2383 |
+
var $VueHTTP = $Vue ? $Vue.http : false;
|
2384 |
+
|
2385 |
+
document.getElementById('vue-modal-search-users') && $Vue && function () {
|
2386 |
+
$Vue.component('learn-press-modal-search-users', {
|
2387 |
+
template: '#learn-press-modal-search-users',
|
2388 |
+
data: function data() {
|
2389 |
+
return {
|
2390 |
+
paged: 1,
|
2391 |
+
term: '',
|
2392 |
+
hasUsers: false,
|
2393 |
+
selected: []
|
2394 |
+
};
|
2395 |
+
},
|
2396 |
+
watch: {
|
2397 |
+
show: function show(value) {
|
2398 |
+
if (value) {
|
2399 |
+
$(this.$refs.search).focus();
|
2400 |
+
}
|
2401 |
+
}
|
2402 |
+
},
|
2403 |
+
props: ['multiple', 'context', 'contextId', 'show', 'callbacks', 'textFormat', 'exclude'],
|
2404 |
+
created: function created() {},
|
2405 |
+
methods: {
|
2406 |
+
doSearch: function doSearch(e) {
|
2407 |
+
this.term = e.target.value;
|
2408 |
+
this.paged = 1;
|
2409 |
+
this.search();
|
2410 |
+
},
|
2411 |
+
search: _.debounce(function (term) {
|
2412 |
+
var that = this;
|
2413 |
+
$VueHTTP.post(window.location.href, {
|
2414 |
+
type: this.postType,
|
2415 |
+
context: this.context,
|
2416 |
+
context_id: this.contextId,
|
2417 |
+
term: term || this.term,
|
2418 |
+
paged: this.paged,
|
2419 |
+
multiple: this.multiple ? 'yes' : 'no',
|
2420 |
+
text_format: this.textFormat,
|
2421 |
+
exclude: this.exclude,
|
2422 |
+
'lp-ajax': 'modal_search_users'
|
2423 |
+
}, {
|
2424 |
+
emulateJSON: true,
|
2425 |
+
params: {}
|
2426 |
+
}).then(function (response) {
|
2427 |
+
|
2428 |
+
var result = LP.parseJSON(response.body || response.bodyText);
|
2429 |
+
that.hasUsers = !!_.size(result.users);
|
2430 |
+
|
2431 |
+
$(that.$el).find('.search-results').html(result.html).find('input[type="checkbox"]').each(function () {
|
2432 |
+
var id = parseInt($(this).val());
|
2433 |
+
if (_.indexOf(that.selected, id) >= 0) {
|
2434 |
+
this.checked = true;
|
2435 |
+
}
|
2436 |
+
});
|
2437 |
+
_.debounce(function () {
|
2438 |
+
$(that.$el).find('.search-nav').html(result.nav).find('a, span').addClass('button').filter('span').addClass('disabled');
|
2439 |
+
}, 10)();
|
2440 |
+
});
|
2441 |
+
}, 500),
|
2442 |
+
loadPage: function loadPage(e) {
|
2443 |
+
e.preventDefault();
|
2444 |
+
var $button = $(e.target);
|
2445 |
+
if ($button.is('span')) {
|
2446 |
+
return;
|
2447 |
+
}
|
2448 |
+
if ($button.hasClass('next')) {
|
2449 |
+
this.paged++;
|
2450 |
+
} else if ($button.hasClass('prev')) {
|
2451 |
+
this.paged--;
|
2452 |
+
} else {
|
2453 |
+
var paged = $button.html();
|
2454 |
+
this.paged = parseInt(paged);
|
2455 |
+
}
|
2456 |
+
this.search();
|
2457 |
+
},
|
2458 |
+
selectItem: function selectItem(e) {
|
2459 |
+
var $select = $(e.target).closest('li'),
|
2460 |
+
$chk = $select.find('input[type="checkbox"]'),
|
2461 |
+
id = parseInt($chk.val()),
|
2462 |
+
|
2463 |
+
//pos = _.indexOf(this.selected, id),
|
2464 |
+
pos = _.findLastIndex(this.selected, { id: id });
|
2465 |
+
if (this.multiple) {
|
2466 |
+
if ($chk.is(':checked')) {
|
2467 |
+
if (pos === -1) {
|
2468 |
+
this.selected.push($select.closest('li').data('data'));
|
2469 |
+
}
|
2470 |
+
} else {
|
2471 |
+
if (pos >= 0) {
|
2472 |
+
this.selected.splice(pos, 1);
|
2473 |
+
}
|
2474 |
+
}
|
2475 |
+
} else {
|
2476 |
+
e.preventDefault();
|
2477 |
+
this.selected = [$select.closest('li').data('data')];
|
2478 |
+
this.addUsers();
|
2479 |
+
}
|
2480 |
+
},
|
2481 |
+
addUsers: function addUsers() {
|
2482 |
+
var $els = $(this.$el).find('.lp-result-item');
|
2483 |
+
if (this.callbacks && this.callbacks.addUsers) {
|
2484 |
+
this.callbacks.addUsers.call(this, this.selected);
|
2485 |
+
}
|
2486 |
+
$(document).triggerHandler('learn-press/modal-add-users', this.selected);
|
2487 |
+
},
|
2488 |
+
close: function close() {
|
2489 |
+
this.$emit('close');
|
2490 |
+
}
|
2491 |
+
}
|
2492 |
+
});
|
2493 |
+
|
2494 |
+
window.LP.$modalSearchUsers = new $Vue({
|
2495 |
+
el: '#vue-modal-search-users',
|
2496 |
+
data: {
|
2497 |
+
show: false,
|
2498 |
+
term: '',
|
2499 |
+
multiple: false,
|
2500 |
+
callbacks: {},
|
2501 |
+
textFormat: '{{display_name}} ({{email}})',
|
2502 |
+
exclude: 0
|
2503 |
+
},
|
2504 |
+
methods: {
|
2505 |
+
open: function open(options) {
|
2506 |
+
_.each(options.data, function (v, k) {
|
2507 |
+
this[k] = v;
|
2508 |
+
}, this);
|
2509 |
+
this.callbacks = options.callbacks;
|
2510 |
+
this.focusSearch();
|
2511 |
+
},
|
2512 |
+
close: function close() {
|
2513 |
+
this.show = false;
|
2514 |
+
},
|
2515 |
+
focusSearch: _.debounce(function () {
|
2516 |
+
$('input[name="search"]', this.$el).focus();
|
2517 |
+
}, 200)
|
2518 |
+
}
|
2519 |
+
});
|
2520 |
+
}();
|
2521 |
+
});
|
2522 |
+
|
2523 |
+
/***/ }),
|
2524 |
+
/* 26 */
|
2525 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2526 |
+
|
2527 |
+
"use strict";
|
2528 |
+
|
2529 |
+
|
2530 |
+
var $ = window.jQuery;
|
2531 |
+
var _ = window._;
|
2532 |
+
window.$Vue = window.$Vue || window.Vue;
|
2533 |
+
|
2534 |
+
$(document).ready(function () {
|
2535 |
+
var $VueHTTP = $Vue ? $Vue.http : false;
|
2536 |
+
|
2537 |
+
document.getElementById('vue-modal-search-items') && $Vue && function () {
|
2538 |
+
$Vue.component('learn-press-modal-search-items', {
|
2539 |
+
template: '#learn-press-modal-search-items',
|
2540 |
+
data: function data() {
|
2541 |
+
return {
|
2542 |
+
paged: 1,
|
2543 |
+
term: '',
|
2544 |
+
hasItems: false,
|
2545 |
+
selected: []
|
2546 |
+
};
|
2547 |
+
},
|
2548 |
+
watch: {
|
2549 |
+
show: function show(value) {
|
2550 |
+
if (value) {
|
2551 |
+
$(this.$refs.search).focus();
|
2552 |
+
}
|
2553 |
+
}
|
2554 |
+
},
|
2555 |
+
props: ['postType', 'context', 'contextId', 'show', 'callbacks', 'exclude'],
|
2556 |
+
created: function created() {},
|
2557 |
+
mounted: function mounted() {
|
2558 |
+
this.term = '';
|
2559 |
+
this.paged = 1;
|
2560 |
+
this.search();
|
2561 |
+
},
|
2562 |
+
methods: {
|
2563 |
+
doSearch: function doSearch(e) {
|
2564 |
+
this.term = e.target.value;
|
2565 |
+
this.paged = 1;
|
2566 |
+
this.search();
|
2567 |
+
},
|
2568 |
+
search: _.debounce(function (term) {
|
2569 |
+
$('#modal-search-items').addClass('loading');
|
2570 |
+
var that = this;
|
2571 |
+
$VueHTTP.post(window.location.href, {
|
2572 |
+
type: this.postType,
|
2573 |
+
context: this.context,
|
2574 |
+
context_id: this.contextId,
|
2575 |
+
term: term || this.term,
|
2576 |
+
paged: this.paged,
|
2577 |
+
exclude: this.exclude,
|
2578 |
+
'lp-ajax': 'modal_search_items'
|
2579 |
+
}, {
|
2580 |
+
emulateJSON: true,
|
2581 |
+
params: {}
|
2582 |
+
}).then(function (response) {
|
2583 |
+
var result = LP.parseJSON(response.body || response.bodyText);
|
2584 |
+
that.hasItems = !!_.size(result.items);
|
2585 |
+
|
2586 |
+
$('#modal-search-items').removeClass('loading');
|
2587 |
+
|
2588 |
+
$(that.$el).find('.search-results').html(result.html).find('input[type="checkbox"]').each(function () {
|
2589 |
+
var id = parseInt($(this).val());
|
2590 |
+
if (_.indexOf(that.selected, id) >= 0) {
|
2591 |
+
this.checked = true;
|
2592 |
+
}
|
2593 |
+
});
|
2594 |
+
_.debounce(function () {
|
2595 |
+
$(that.$el).find('.search-nav').html(result.nav).find('a, span').addClass('button').filter('span').addClass('disabled');
|
2596 |
+
}, 10)();
|
2597 |
+
});
|
2598 |
+
}, 500),
|
2599 |
+
loadPage: function loadPage(e) {
|
2600 |
+
e.preventDefault();
|
2601 |
+
var $button = $(e.target);
|
2602 |
+
if ($button.is('span')) {
|
2603 |
+
return;
|
2604 |
+
}
|
2605 |
+
if ($button.hasClass('next')) {
|
2606 |
+
this.paged++;
|
2607 |
+
} else if ($button.hasClass('prev')) {
|
2608 |
+
this.paged--;
|
2609 |
+
} else {
|
2610 |
+
var paged = $button.html();
|
2611 |
+
this.paged = parseInt(paged);
|
2612 |
+
}
|
2613 |
+
this.search();
|
2614 |
+
},
|
2615 |
+
selectItem: function selectItem(e) {
|
2616 |
+
var $select = $(e.target).closest('li'),
|
2617 |
+
$chk = $select.find('input[type="checkbox"]'),
|
2618 |
+
id = parseInt($chk.val()),
|
2619 |
+
pos = _.indexOf(this.selected, id);
|
2620 |
+
|
2621 |
+
if ($chk.is(':checked')) {
|
2622 |
+
if (pos === -1) {
|
2623 |
+
this.selected.push(id);
|
2624 |
+
}
|
2625 |
+
} else {
|
2626 |
+
if (pos >= 0) {
|
2627 |
+
this.selected.splice(pos, 1);
|
2628 |
+
}
|
2629 |
+
}
|
2630 |
+
},
|
2631 |
+
addItems: function addItems() {
|
2632 |
+
var close = true;
|
2633 |
+
if (this.callbacks && this.callbacks.addItems) {
|
2634 |
+
this.callbacks.addItems.call(this);
|
2635 |
+
}
|
2636 |
+
$(document).triggerHandler('learn-press/add-order-items', this.selected);
|
2637 |
+
},
|
2638 |
+
close: function close() {
|
2639 |
+
this.$emit('close');
|
2640 |
+
}
|
2641 |
+
}
|
2642 |
+
});
|
2643 |
+
|
2644 |
+
window.LP.$modalSearchItems = new $Vue({
|
2645 |
+
el: '#vue-modal-search-items',
|
2646 |
+
data: {
|
2647 |
+
show: false,
|
2648 |
+
term: '',
|
2649 |
+
postType: '',
|
2650 |
+
callbacks: {},
|
2651 |
+
exclude: '',
|
2652 |
+
context: ''
|
2653 |
+
},
|
2654 |
+
methods: {
|
2655 |
+
open: function open(options) {
|
2656 |
+
_.each(options.data, function (v, k) {
|
2657 |
+
this[k] = v;
|
2658 |
+
}, this);
|
2659 |
+
|
2660 |
+
this.callbacks = options.callbacks;
|
2661 |
+
this.focusSearch();
|
2662 |
+
},
|
2663 |
+
close: function close() {
|
2664 |
+
this.show = false;
|
2665 |
+
},
|
2666 |
+
focusSearch: _.debounce(function () {
|
2667 |
+
$('input[name="search"]', this.$el).focus();
|
2668 |
+
}, 200)
|
2669 |
+
}
|
2670 |
+
});
|
2671 |
+
}();
|
2672 |
+
});
|
2673 |
+
|
2674 |
+
/***/ }),
|
2675 |
+
/* 27 */
|
2676 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2677 |
+
|
2678 |
+
"use strict";
|
2679 |
+
|
2680 |
+
|
2681 |
+
;(function ($) {
|
2682 |
+
var timer = null,
|
2683 |
+
$wraps = null,
|
2684 |
+
$cloneWraps = null,
|
2685 |
+
onSearch = function onSearch(keyword) {
|
2686 |
+
if (!$cloneWraps) {
|
2687 |
+
$cloneWraps = $wraps.clone();
|
2688 |
+
}
|
2689 |
+
var keywords = keyword.toLowerCase().split(/\s+/).filter(function (a, b) {
|
2690 |
+
return a.length >= 3;
|
2691 |
+
});
|
2692 |
+
var foundItems = function foundItems($w1, $w2) {
|
2693 |
+
return $w1.find('.plugin-card').each(function () {
|
2694 |
+
var $item = $(this),
|
2695 |
+
itemText = $item.find('.item-title').text().toLowerCase(),
|
2696 |
+
itemDesc = $item.find('.column-description, .theme-description').text();
|
2697 |
+
var found = function found() {
|
2698 |
+
var reg = new RegExp(keywords.join('|'), 'ig');
|
2699 |
+
return itemText.match(reg) || itemDesc.match(reg);
|
2700 |
+
};
|
2701 |
+
if (keywords.length) {
|
2702 |
+
if (found()) {
|
2703 |
+
var $clone = $item.clone();
|
2704 |
+
$w2.append($clone);
|
2705 |
+
}
|
2706 |
+
} else {
|
2707 |
+
$w2.append($item.clone());
|
2708 |
+
}
|
2709 |
+
});
|
2710 |
+
};
|
2711 |
+
|
2712 |
+
$wraps.each(function (i) {
|
2713 |
+
var $this = $(this).html(''),
|
2714 |
+
$items = foundItems($cloneWraps.eq(i), $this),
|
2715 |
+
count = $this.children().length;
|
2716 |
+
|
2717 |
+
$this.prev('h2').find('span').html(count);
|
2718 |
+
});
|
2719 |
+
};
|
2720 |
+
$(document).on('keyup', '.lp-search-addon', function (e) {
|
2721 |
+
timer && clearTimeout(timer);
|
2722 |
+
timer = setTimeout(onSearch, 300, e.target.value);
|
2723 |
+
}).ready(function () {
|
2724 |
+
$wraps = $('.addons-browse');
|
2725 |
+
});
|
2726 |
+
})(jQuery);
|
2727 |
+
|
2728 |
+
/***/ })
|
2729 |
+
/******/ ]);
|
2730 |
+
//# sourceMappingURL=utils.js.map
|
assets/js/admin/utils.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=19)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(0),o=i(s),r=n(2),c=i(r),l=n(3),d=i(l),u=n(4),f=i(u),h=n(5),p=i(h),v=n(6),m=i(v),g=n(7),b=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e}(g),jQuery);String.prototype.getQueryVar=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(this);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(e,t){var n=this,i=n.split("#");return n=i[0],e.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=e+"="+t):-1!=n.indexOf("&"+e+"=")||-1!=n.indexOf("?"+e+"=")?n=n.replace(new RegExp(e+"=([^&#]*)","g"),e+"="+t):(n+=n.match(/\?/)?"&":"?",n+=e+"="+t),n+(i[1]?"#"+i[1]:"")},String.prototype.removeQueryVar=function(e){var t=this,n=t.split("#");t=n[0],e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"([[][^=]*)?=([^&#]*)","g");return(t=t.replace(i,""))+(n[1]?"#"+n[1]:"")},0==b.isEmptyObject("")&&(b.isEmptyObject=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0});var y={Hook:m.default,setUrl:function(e,t,n){e&&(history.pushState({},n,e),LP.Hook.doAction("learn_press_set_location_url",e))},toggleGroupSection:function(e,t){var n=b(e);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle(function(){b(this).is(":visible")?b(t).addClass("toggle-on").removeClass("toggle-off"):b(t).addClass("toggle-off").removeClass("toggle-on")})},overflow:function(e,t){var n=b(e),i=n.css("overflow");t?n.css("overflow",t).data("overflow",i):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(e,t,n){return(void 0===n?window.location.href:n).addQueryVar(e,t)},removeQueryVar:function(e,t){return(void 0===t?window.location.href:t).removeQueryVar(e)},reload:function(e){e||(e=window.location.href),window.location.href=e},parseResponse:function(e,t){var n=e.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);return n&&(e=n[1]),"json"===(t||"json")?this.parseJSON(e):e},parseJSON:function(e){var t=(e+"").match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);try{e=t?b.parseJSON(t[1]):b.parseJSON(e)}catch(t){e={}}return e},ajax:function(e){var t=e.type||"post",n=e.dataType||"json",i=e.action?b.extend(e.data,{"lp-ajax":e.action}):e.data,a=e.beforeSend||function(){},s=e.url||window.location.href;b.ajax({data:i,url:s,type:t,dataType:"html",beforeSend:a.apply(null,e),success:function(t){var i=LP.parseResponse(t,n);b.isFunction(e.success)&&e.success(i,t)},error:function(){b.isFunction(e.error)&&e.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(e){var t=e.type||"post",n=e.dataType||"json",i=(void 0===e.prefix||"learnpress_")+e.action,a=e.action?b.extend(e.data,{action:i}):e.data;b.ajax({data:a,url:e.url||window.location.href,type:t,dataType:"html",success:function(t){var i=LP.parseResponse(t,n);b.isFunction(e.success)&&e.success(i,t)},error:function(){b.isFunction(e.error)&&e.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},addFilter:function(e,t){var n=b(document),i="LP."+e;return n.on(i,t),LP.log(n.data("events")),this},applyFilters:function(){var e=b(document),t=arguments[0],n=this.funcArgs2Array(arguments);return e.hasEvent(t)?(n[0]="LP."+t,e.triggerHandler.apply(e,n)):n[1]},addAction:function(e,t){return this.addFilter(e,t)},doAction:function(){var e=b(document),t=arguments[0],n=this.funcArgs2Array(arguments);e.hasEvent(t)&&(n[0]="LP."+t,e.trigger.apply(e,n))},toElement:function(e,t){if(0!==b(e).length){t=b.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},t||{});var n=b(t.container),i=0;0===n.length&&(n=b("body, html")),i=n.offset().top;var a=b(e).offset().top+n.scrollTop()-i-t.offset;t.invisible&&function(e,t){var i=n.scrollTop(),a=i+n.height(),s=b(e).offset().top-n.offset().top,o=s+b(e).height();return!0===t?i<s&&a>o:s<=a&&o>=i}(e,!0)||n.fadeIn(10).delay(t.delay).animate({scrollTop:a},t.duration,t.callback)}},uniqueId:function(e,t){void 0===e&&(e="");var n,i=function(e,t){return e=parseInt(e,10).toString(16),t<e.length?e.slice(e.length-t):t>e.length?new Array(t-e.length+1).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=e,n+=i(parseInt((new Date).getTime()/1e3,10),8),n+=i(this.php_js.uniqidSeed,5),t&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var e=0,t=arguments.length;e<t;e++)console.log(arguments[e])},blockContent:function(){0===b("#learn-press-block-content").length&&b(LP.template("learn-press-template-block-content",{})).appendTo(b("body")),LP.hideMainScrollbar().addClass("block-content"),b(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout(function(){LP.showMainScrollbar().removeClass("block-content"),b(document).trigger("learn_press_unblock_content")},350)},hideMainScrollbar:function(e){e||(e="html, body");var t=b(e);return t.each(function(){var e=b(this),t=e.css("overflow");e.css("overflow","hidden").attr("overflow",t)}),t},showMainScrollbar:function(e){e||(e="html, body");var t=b(e);return t.each(function(){var e=b(this),t=e.attr("overflow");e.css("overflow",t).removeAttr("overflow")}),t},template:"undefined"!=typeof _?_.memoize(function(e,t){var n,i={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},a=function(t){return(n=n||_.template(b("#"+e).html(),null,i))(t)};return t?a(t):a},function(e,t){return e+"-"+JSON.stringify(t)}):function(){return""},alert:function(e,t){var n="",i="";"string"==typeof e?i=e:(void 0!==e.title&&(n=e.title),void 0!==e.message&&(i=e.message)),b.alerts.alert(i,n,function(e){LP._on_alert_hide(),t&&t(e)}),this._on_alert_show()},confirm:function(e,t){var n="",i="";"string"==typeof e?i=e:(void 0!==e.title&&(n=e.title),void 0!==e.message&&(i=e.message)),b.alerts.confirm(i,n,function(e){LP._on_alert_hide(),t&&t(e)}),this._on_alert_show()},_on_alert_show:function(){var e=b("#popup_container");b('<span id="popup_container_placeholder" />').insertAfter(e).data("xxx",e);e.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var e=b("#popup_container_placeholder"),t=e.data("xxx");t&&t.replaceWith(e),t.appendTo(b(document.body)),t.stop().animate({top:"+=50",opacity:0},250,function(){b(this).remove()})},sendMessage:function(e,t,n,i){b.isPlainObject(e)&&(e=JSON.stringify(e)),t=t||window,n=n||"*",t.postMessage(e,n,i)},receiveMessage:function(e,t){var n=e.origin||e.originalEvent.origin,i=e.data||e.originalEvent.data||"";("string"==typeof i||i instanceof String)&&0===i.indexOf("{")&&(i=LP.parseJSON(i)),LP.Hook.doAction("learn_press_receive_message",i,n)}};b(document).ready(function(){void 0!==b.alerts&&(b.alerts.overlayColor="#000",b.alerts.overlayOpacity=.5,b.alerts.okButton=lpGlobalSettings.localize.button_ok,b.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),b(".learn-press-message.fixed").each(function(){var e=b(this),t=e.data();!function(e,t){t.delayIn&&setTimeout(function(){e.show().hide().fadeIn()},t.delayIn),t.delayOut&&setTimeout(function(){e.fadeOut()},t.delayOut+(t.delayIn||0))}(e,t)}),b("body").on("click",".learn-press-nav-tabs li a",function(e){e.preventDefault();var t=b(this);t.closest("li").addClass("active").siblings().removeClass("active"),b(t.attr("data-tab")).addClass("active").siblings().removeClass("active"),b(document).trigger("learn-press/nav-tabs/clicked",t)}),setTimeout(function(){b(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")},300),b("body.course-item-popup").parent().css("overflow","hidden"),function(){var e=null,t=function(){b(".auto-check-lines").checkLines(function(e){e>1?b(this).removeClass("single-lines"):b(this).addClass("single-lines"),b(this).attr("rows",e)})};b(window).on("resize.check-lines",function(){e?(e&&clearTimeout(e),e=setTimeout(t,300)):t()})}(),b(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),b(".learn-press-icon").LP_Tooltip({offset:[30,30]}),b(".learn-press-message[data-autoclose]").each(function(){var e=b(this),t=parseInt(e.data("autoclose"));t&&setTimeout(function(e){e.fadeOut()},t,e)}),b(document).on("click",function(){b(document).trigger("learn-press/close-all-quick-tip")})}),(0,o.default)(a({Event_Callback:p.default,MessageBox:f.default},y)),t.default={fn:c.default,QuickTip:d.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=window.jQuery;!function(){void 0!==a&&(a.fn.LP=i=function(e,t){if(a.isFunction(t))a.fn["LP_"+e]=t;else if(e){var n=[];if(arguments.length>1)for(var i=1;i<arguments.length;i++)n.push(arguments[i]);return a.isFunction(a(this)["LP_"+e])?a(this)["LP_"+e].apply(this,n):this}return this})}(),t.default=i},function(e,t,n){"use strict";!function(e){function t(t,n){function i(){if(u)return void clearTimeout(u);n.single&&e(".learn-press-tip").not(r).LP("QuickTip","close"),d.appendTo(document.body);var t=r.offset();d.css({top:t.top-d.outerHeight()-8,left:t.left-d.outerWidth()/2+p})}function a(){u&&clearTimeout(u),u=setTimeout(function(){d.detach(),u=null},f)}function s(){f=0,a(),f=n.closeInterval}function o(){i()}var r=e(t),c=r.attr("data-id")||LP.uniqueId();n=e.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,r.data()),r.attr("data-id",c);var l=r.attr("data-content-tip")||r.html(),d=e('<div class="learn-press-tip-floating">'+l+"</div>"),u=null,f=0,h=!1,p="el"===n.arrowOffset?r.outerWidth()/2:8,v=e("#__"+c);return 0===v.length&&e(document.body).append(e("<div />").attr("id","__"+c).html(l).css("display","none")),l=v.html(),d.addClass(n.tipClass),r.data("content-tip",l),r.attr("data-content-tip")&&(h=!0),f=n.closeInterval,!1===n.autoClose&&(d.append('<a class="close"></a>'),d.on("click",".close",function(){s()})),h||r.html(""),"click"===n.event&&r.on("click",function(e){e.stopPropagation(),i()}),e(document).on("learn-press/close-all-quick-tip",function(){s()}),r.hover(function(e){e.stopPropagation(),"click"!==n.event&&i()},function(e){e.stopPropagation(),n.autoClose&&a()}).addClass("ready"),{close:s,open:o}}e.fn.LP("QuickTip",function(n){return e.each(this,function(){var i=e(this).data("quick-tip");i||(i=new t(this,n),e(this).data("quick-tip",i)),"string"===e.type(n)&&i[n]&&i[n].apply(i)})})}(jQuery)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=window.jQuery,a={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(e,t){var n=i(e);i("[learn-press-quick-confirm]").each(function(){var e;(e=i(this).data("quick-confirm"))&&(console.log(e),e.destroy())}),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(e,t){var n=i(e),a=i('<span class="learn-press-quick-confirm"></span>').insertAfter(n),s=i(e).position()||{left:0,top:0},o=null,r=null,c=3,l=function(){a.fadeOut("fast",function(){i(this).remove(),a.parent().css("position","")}),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),d()},d=function(){r&&clearInterval(r),o&&clearInterval(o)},u=function(){o=setInterval(function(){0==--c&&(l.call(a[0]),i.isFunction(t.onCancel)&&t.onCancel(t.data),d()),a.find("span").html(" ("+c+")")},1e3),r=setInterval(function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(d(),a.remove(),a.parent().css("position",""),i.isFunction(t.onCancel)&&t.onCancel(t.data))},350)};t=i.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},t||{}),a.html(t.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+c+")</span>").css({}),a.click(function(){i.isFunction(t.onOk)&&t.onOk(t.data),l()}).hover(function(){d()},function(){u()}),a.css({left:s.left+n.outerWidth()-a.outerWidth()+t.offset.left,top:s.top+n.outerHeight()+t.offset.top+5}).hide().fadeIn("fast"),u(),this.destroy=function(){a.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),d()}}(e,t))},show:function(e,t){i.proxy(function(){t=i.extend({title:"",buttons:"",events:!1,autohide:!1,message:e,data:!1,id:LP.uniqueId(),onHide:null},t||{}),this.instances.push(t),this.instance=t;var n=(i(document),i(document.body));this.$block||(this.$block=i('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=i('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click(function(){})),this._createWindow(e,t.title,t.buttons),this.$block.show(),this.$window.show().attr("instance",t.id),i(window).bind("resize.message-box",i.proxy(this.update,this)).bind("scroll.message-box",i.proxy(this.update,this)),this.update(!0),t.autohide&&setTimeout(function(){LP.MessageBox.hide(),i.isFunction(t.onHide)&&t.onHide.call(LP.MessageBox,t)},t.autohide)},this)()},blockUI:function(e){e=(!1!==e?e||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(e)},hide:function(e,t){t?this._removeInstance(t.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),i(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(e){var t=this,n=this.$window.find("#message-box-wrap"),a=n.data("timer"),s=function(){LP.Hook.doAction("learn_press_message_box_before_resize",t);var e=n.find(".message-box-content").css("height","").css("overflow","hidden"),a=(n.outerWidth(),n.outerHeight()),s=e.height(),o=i(window).height();n.offset().top;s>o-50?(e.css({height:o-25}),a=n.outerHeight()):e.css("height","").css("overflow",""),n.css({marginTop:(i(window).height()-a)/2}),LP.Hook.doAction("learn_press_message_box_resize",a,t)};e&&s(),a&&clearTimeout(a),a=setTimeout(s,250)},_removeInstance:function(e){for(var t=0;t<this.instances.length;t++)if(this.instances[t].id===e){this.instances.splice(t,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(e){for(var t=0;t<this.instances.length;t++)if(this.instances[t].id===e)return this.instances[t]},_createWindow:function(e,t,n){var a=this.$window.find("#message-box-wrap").html("");if(t&&a.append('<h3 class="message-box-title">'+t+"</h3>"),a.append(i('<div class="message-box-content"></div>').html(e)),n){var s=i('<div class="message-box-buttons"></div>');switch(n){case"yesNo":s.append(this._createButton(LP_Settings.localize.button_yes,"yes")),s.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":s.append(this._createButton(LP_Settings.localize.button_ok,"ok")),s.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:s.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}a.append(s)}},_createButton:function(e,t){var n=i('<button type="button" class="button message-box-button message-box-button-'+t+'">'+e+"</button>"),a="on"+(t.substr(0,1).toUpperCase()+t.substr(1));return n.data("callback",a).click(function(){var e=i(this).data("instance"),t=e.events[i(this).data("callback")];"function"===i.type(t)?!1===t.apply(LP.MessageBox,[e])||LP.MessageBox.hide(null,e):LP.MessageBox.hide(null,e)}).data("instance",this.instance),n}};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){var t={},n=window.jQuery;this.on=function(n,i){var a=n.split("."),s="";return a.length>1&&(n=a[0],s=a[1]),t[n]||(t[n]=[[],{}]),s?(t[n][1][s]||(t[n][1][s]=[]),t[n][1][s].push(i)):t[n][0].push(i),e},this.off=function(i,a){var s=i.split("."),o="";if(s.length>1&&(i=s[0],o=s[1]),!t[i])return e;var r=-1;if(o){if(!t[i][1][o])return e;if(n.isFunction(a)){if((r=t[i][1][o].indexOf(a))<0)return e;t[i][1][o].splice(r,1)}else t[i][1][o]=[]}else if(n.isFunction(a)){if((r=t[i][0].indexOf(a))<0)return e;t[i][0].splice(r,1)}else t[i][0]=[];return e},this.callEvent=function(i,a){if(t[i]){if(t[i][0])for(var s=0;s<t[i][0].length;s++)n.isFunction(t[i][0][s])&&t[i][s][0].apply(e,a);if(t[i][1])for(var s in t[i][1])for(var o=0;o<t[i][1][s].length;o++)n.isFunction(t[i][1][s][o])&&t[i][1][s][o].apply(e,a)}}};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={hooks:{action:{},filter:{}},addAction:function(e,t,n,i){return this.addHook("action",e,t,n,i),this},addFilter:function(e,t,n,i){return this.addHook("filter",e,t,n,i),this},doAction:function(e){return this.doHook("action",e,arguments),this},applyFilters:function(e){return this.doHook("filter",e,arguments)},removeAction:function(e,t){return this.removeHook("action",e,t),this},removeFilter:function(e,t,n){return this.removeHook("filter",e,t,n),this},addHook:function(e,t,n,i,a){void 0===this.hooks[e][t]&&(this.hooks[e][t]=[]);var s=this.hooks[e][t];return void 0===a&&(a=t+"_"+s.length),this.hooks[e][t].push({tag:a,callable:n,priority:i}),this},doHook:function(e,t,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[e][t]){var i,a=this.hooks[e][t];a.sort(function(e,t){return e.priority-t.priority});for(var s=0;s<a.length;s++)i=a[s].callable,"function"!=typeof i&&(i=window[i]),"action"===e?i.apply(null,n):n[0]=i.apply(null,n)}return"filter"===e?n[0]:this},removeHook:function(e,t,n,i){if(void 0!==this.hooks[e][t])for(var a=this.hooks[e][t],s=a.length-1;s>=0;s--)void 0!==i&&i!==a[s].tag||void 0!==n&&n!==a[s].priority||a.splice(s,1);return this}};t.default=i},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$=window.jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(void 0==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(e){console.log("Error:"+e+"\n"+objExp)}})):indexed[match[0]]=this.value}}),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(e){return e=$.extend({},{offset:[0,0]},e||{}),$.each(this,function(){var t=$(this),n=t.data("content");if(n&&void 0===t.data("LP_Tooltip")){var i=null;t.hover(function(a){i=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var s=t.offset();if($.isArray(e.offset)){var o=e.offset[1],r=e.offset[0];$.isNumeric(r)&&(s.left+=r),$.isNumeric(o)&&(s.top+=o)}i.css({top:s.top,left:s.left}),i.fadeIn()},function(){i&&i.remove()}),t.data("tooltip",!0)}})},hasEvent=function(e){var t=$(this).data("events");if(void 0===t.LP)return!1;for(i=0;i<t.LP.length;i++)if(t.LP[i].namespace==e)return!0;return!1},dataToJSON=function(){var e={};return $.each(this[0].attributes,function(){var t=this.name.match(/^data-(.*)/);t&&(e[t[1]]=this.value)}),e},rows=function(){var e=$(this).height(),t=$(this).css("line-height").replace("px","");return $(this).attr({height:e,"line-height":t}),Math.floor(e/parseInt(t))},checkLines=function(e){return this.each(function(){var t=$(this),n=t.rows();e.call(this,n)})},findNext=function(e){var t=$(e),n=this.first(),i=t.index(n),a=t.eq(i+1);return!!a.length&&a},findPrev=function(e){var t=$(e),n=this.first(),i=t.index(n),a=t.eq(i-1);return!!a.length&&a},progress=function(e){return this.each(function(){var t=parseInt(e/100*360),n=$(this);t<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+t+"deg)"})})};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress,exports.default={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}},,,function(e,t,n){"use strict";function i(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){"use strict";!function(e){window.conditional_logic_gray_state=function(t,n){t?e(this).removeClass("disabled"):e(this).addClass("disabled")};var t=window.Conditional_Logic=function(t){this.options=e.extend({},t||{}),this.updateAll()};t.prototype=e.extend(t.prototype,{evaluate:function(t,n){if(n&&n&&e.isArray(n.conditional)){var i=void 0,a=n.conditional;for(var s in a){var o=this.evaluateRequirement(a[s]),r=(a[s].combine||"and").toLowerCase();void 0!==o&&void 0!==i?i="and"===r?i&&o:i||o:void 0===i&&(i=o)}return i}},evaluateRequirement:function(t){if(t&&t.field){void 0===t.compare&&(t.compare="=");var n=e("#field-"+t.field);switch(t.state){case"show":return n.is(":visible");case"hide":return!n.is(":visible");default:var i="";switch(this.getFieldType(n)){case"yes-no":var a=n.find('input[type="checkbox"]');i=a.is(":checked")?a.val():"";break;case"radio":i=n.find("input:checked").val();break;default:i=n.find("input, select").val()}return this.compare(t.value,i,t.compare)}}},compare:function(t,n,i){var a=void 0;switch(i){case"===":a=n===t;break;case"==":case"=":case"equals":case"equal":a=n===t;break;case"!==":a=n!==t;break;case"!=":case"not equal":a=n!==t;break;case">=":case"greater or equal":case"equal or greater":a=n>=t;break;case"<=":case"smaller or equal":case"equal or smaller":a=n<=t;break;case">":case"greater":a=n>t;break;case"<":case"smaller":a=n<t;break;case"contains":case"in":var s,o;e.isArray(n)&&!e.isArray(t)?(s=n,o=t):e.isArray(t)&&!e.isArray(n)&&(s=t,o=n),s&&o?-1===e.inArray(o,s)&&(a=!1):-1===n.indexOf(t)&&-1===t.indexOf(n)&&(a=!1);break;default:a=n===t}return void 0===a||a},hasConditional:function(e,t){if(this.options.conditionals){if(!this.options.conditionals[t])return!1;for(var n in this.options.conditionals[t].conditional)if(this.options.conditionals[t].conditional[n].field===e)return this.options.conditionals[t];return!1}},update:function(t,n){var i=e(t),a=this.getFieldName(i);n=n||e(".rwmb-field"),_.forEach(n,function(t){var n=e(t),s=this.getFieldName(n);if(s!==a){var o=this.hasConditional(a,s);if(o){var r=this.evaluate(i,o);void 0!==r&&("hide"===o.state&&(r=!r),e.isFunction(window[o.state_callback])?window[o.state_callback].call(n,r,n):n.toggle(r))}}},this)},updateAll:function(){var t=e(".rwmb-field"),n=this;_.forEach(t,function(i){var a=e(i),s=this.getFieldType(a),o=a.find(".rwmb-field-name").val();o&&(a.attr("id","field-"+o),-1!==_.indexOf(this.supportFields,s)&&a.find("input, select, textarea").on("change",function(){n.update(e(this).closest(".rwmb-field"),t)}).trigger("change"))},this)},getFieldType:function(t){var n=e(t);if(0===n.length)return!1;var i=n.get(0).className,a=i.match(/rwmb-([^\s]*)-wrapper/);return!!a&&a[1]},getFieldName:function(t){return e(t).find(".rwmb-field-name").val()},supportFields:["yes-no","text","number","radio"]}),e(document).ready(function(){void 0!==window.lp_conditional_logic&&new t({conditionals:lp_conditional_logic})})}(jQuery)},,,,,,,,function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(s),r=n(20),c=i(r),l=n(21),d=i(l),u=n(22),f=i(u),h=n(23),p=i(h),v=n(24),m=i(v),g=n(10),b=i(g),y=n(25),w=i(y),_=n(26),x=i(_),k=n(27),P=(i(k),n(11));i(P);t.default=a({},o,{dismissNotice:c.default,Advertisement:d.default,DropdownPages:f.default,AdvancedList:p.default,AdminTabs:m.default,isEmail:b.default,ModalSearchItems:x.default,ModalSearchUsers:w.default})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(i),s=window.jQuery,o=function(e,t){var n=wp.hooks;t=s.extend({el:null},t||{}),n&&n.doAction("before-dismiss-notice","LP",e,t),s.ajax({url:"",data:s.extend({"lp-dismiss-notice":e},t.data||{}),dataType:"text",success:function(i){i=LP.parseJSON(i),i.dismissed===e&&s(t.el).fadeOut(),n&&n.doAction("dismissed-notice","LP",e,t)}})};!function(e){void 0!==e&&e(document).on("click",".lp-notice [data-dismiss-notice]",function(){var t=e(this).data(),n=t.dismissNotice;delete t.dismissNotice,o(n,{data:t,el:e(this).closest(".lp-notice")})})}(window.jQuery),(0,a.default)("Utils",{dismissNotice:o}),t.default=o},function(e,t,n){"use strict";!function(e){function t(t,n){function i(){c.append(u),l.each(function(){e(this).append(d.clone())})}function a(e){e=void 0!==e?e:f;var t=l.eq(e);t.show(),setTimeout(function(){t.addClass("slide-active")},1),t.siblings().removeClass("slide-active"),h&&clearTimeout(h),h=setTimeout(function(){t.siblings().hide()},500)}function s(){f<l.length-1?f++:f=0,a(f)}function o(){f>0?f--:f=l.length-1,a(f)}function r(){c.on("click",".next-item",s),c.on("click",".prev-item",o)}this.options=e.extend({},n||{});var c=e(t),l=c.find(".slide-item"),d=e('<div class="slider-controls"><div class="prev-item"></div><div class="next-item"></div></div>'),u=e('<div class="slider-items"></div>').append(l),f=0,h=null;!function(){i(),r(),a()}()}e.fn.LP("Advertisement",function(n){return e.each(this,function(){var i=e(this).data("LP_Advertisement_Slider");return i||(i=new t(this,n),e(this).data("LP_Advertisement_Slider",i)),this})})}(jQuery)},function(e,t,n){"use strict";!function(){function e(e,n){function i(e){var n=t('<option value="'+e.ID+'">'+e.name+"</option>"),i=t.inArray(e.ID+"",e.positions);t(".learn-press-dropdown-pages select").each(function(){var a=t(this),s=n.clone();0==i?t("option",a).each(function(){if(parseInt(t(this).val()))return s.insertBefore(t(this)),!1}):i==e.positions.length-1?a.append(s):s.insertAfter(t('option[value="'+e.positions[i-1]+'"]',a))})}this.options=t.extend({ID:"",name:"Add new page"},n||{});var a=t(e),s=a.find("select"),o=a.find(".list-pages-wrapper"),r=a.find(".quick-add-page-actions"),c=a.find(".quick-add-page-inline");s.change(function(){if(r.addClass("hide-if-js"),"add_new_page"!==this.value)return void(parseInt(this.value)&&(r.find("a.edit-page").attr("href","post.php?post="+this.value+"&action=edit"),r.find("a.view-page").attr("href",lpGlobalSettings.siteurl+"?page_id="+this.value),r.removeClass("hide-if-js"),s.attr("data-selected",this.value)));o.addClass("hide-if-js"),c.removeClass("hide-if-js").find("input").focus().val("")}),s.css("width",s.width()+50).find("option").each(function(){t(this).html(t(this).html().replace(/ /g,""))}),s.select2({allowClear:!0}),s.on("select2:select",function(e){e.params.data}),a.on("click",".quick-add-page-inline button",function(){var e=t(this),n=c.find("input"),a=n.val();if(!a)return alert("Please enter the name of page"),void n.focus();e.prop("disabled",!0),t.ajax({url:lpGlobalSettings.ajax,data:{action:"learnpress_create_page",page_name:a},type:"post",dataType:"html",success:function(t){t=LP.parseJSON(t),t.page?(i({ID:t.page.ID,name:t.page.post_title,positions:t.positions}),s.val(t.page.ID).focus().trigger("change"),c.addClass("hide-if-js")):t.error&&alert(t.error),e.prop("disabled",!1),o.removeClass("hide-if-js")}})}).on("click",".quick-add-page-inline a",function(e){e.preventDefault(),c.addClass("hide-if-js"),s.val(s.attr("data-selected")+"").removeAttr("disabled").trigger("change"),o.removeClass("hide-if-js")}).on("click",".button-quick-add-page",function(e){s.val("add_new_page").trigger("change")}).on("keypress keydown",'.quick-add-page-inline input[type="text"]',function(e){13==e.keyCode&&"keypress"==e.type?(e.preventDefault(),t(this).siblings("button").trigger("click")):27==e.keyCode&&"keydown"==e.type&&t(this).siblings("a").trigger("click")})}var t=window.jQuery;void 0!==t&&t.fn.LP("DropdownPages",function(){return t.each(this,function(){var n=t(this).data("DropdownPages");return n||(n=new e(this,{}),t(this).data("DropdownPages",n)),n})})}()},function(e,t,n){"use strict";!function(e){var t=function(t,n){function i(t){t.preventDefault(),a(c.children().index(e(this).closest("li"))+1)}function a(e){c.children(":eq("+(e-1)+")").remove(),r.options.onRemove&&r.options.onRemove.call(r)}function s(t,n){var i={},a=o();e.isPlainObject(t)?i=e.extend({id:0,text:""},t):"string"==typeof t?i={id:"",text:t}:void 0!==t[0]&&(i={id:t[1]?t[1]:"",text:t[0]});for(var s in i){var l=new RegExp("{{"+s+"}}","g");a=a.replace(l,i[s])}if(a=e(a),void 0!==n){var d=c.children(":eq("+(n-1)+")");d.length?a.insertBefore(d):c.append(a)}else c.append(a);c.children().detach().each(function(){c.append("\n").append(this)}),r.options.onAdd&&r.options.onAdd.call(r)}function o(){var t=e(r.options.template);return t.length?t.html():r.options.template}var r=this,c=e(t).hasClass("advanced-list")?e(t):e(".advanced-list",t);this.options=e.extend({template:'<li data-id="{{id}}"><span class="remove-item"></span><span>{{text}}</span> </li>'},n||{}),this.$el=c,c.on("click",".remove-item",i),this.add=s,this.remove=a};e.fn.LP("AdvancedList",function(n){for(var i=[],a=1;a<arguments.length;a++)i.push(arguments[a]);return e.each(this,function(){var a=e(this).data("advancedList");return a||(a=new t(this,n),e(this).data("advancedList",a)),"string"==typeof n&&e.isFunction(a[n])?a[n].apply(a,i):this})})}(jQuery)},function(e,t,n){"use strict";!function(e){var t=function(t,n){function i(e){var t=r.index(e),n=e.find("a").attr("href");u=l.eq(t),e.addClass("active").siblings("li.active").removeClass("active"),u.show().css({visibility:"hidden"}),a(u),u.hide(),u.show(),u.siblings("li.active").fadeOut(0,function(){u.addClass("active").siblings("li.active").removeClass("active")}),LP.setUrl(n)}function a(e){var t=e.height(),n=c.outerHeight();t=t<n?n+2*parseInt(c.css("margin")):void 0,e.css("visibility","").css({height:t})}function s(){d=r.filter(".active"),d.length||(d=r.first()),d.find("a").trigger("click")}function o(){t.on("click",".tabs-nav a",function(t){t.preventDefault(),d=e(this).parent(),i(d)})}var r=t.find(".tabs-nav").find("li"),c=r.parent(),l=t.find(".tabs-content-container > li"),d=null,u=null;!function(){o(),s(),e(window).on("resize.calculate-tab",function(){a(t.find(".tabs-content-container .active").css("height",""))})}()};e.fn.LP("AdminTab",function(n){return n=e.extend({},n||{}),e.each(this,function(){var i=e(this),a=i.data("learn-press/tabs");return a||(a=new t(i,n),i.data("learn-press/tabs",a)),i})})}(jQuery)},function(e,t,n){"use strict";var i=window.jQuery,a=window._;window.$Vue=window.$Vue||window.Vue,i(document).ready(function(){var e=!!$Vue&&$Vue.http;document.getElementById("vue-modal-search-users")&&$Vue&&function(){$Vue.component("learn-press-modal-search-users",{template:"#learn-press-modal-search-users",data:function(){return{paged:1,term:"",hasUsers:!1,selected:[]}},watch:{show:function(e){e&&i(this.$refs.search).focus()}},props:["multiple","context","contextId","show","callbacks","textFormat","exclude"],created:function(){},methods:{doSearch:function(e){this.term=e.target.value,this.paged=1,this.search()},search:a.debounce(function(t){var n=this;e.post(window.location.href,{type:this.postType,context:this.context,context_id:this.contextId,term:t||this.term,paged:this.paged,multiple:this.multiple?"yes":"no",text_format:this.textFormat,exclude:this.exclude,"lp-ajax":"modal_search_users"},{emulateJSON:!0,params:{}}).then(function(e){var t=LP.parseJSON(e.body||e.bodyText);n.hasUsers=!!a.size(t.users),i(n.$el).find(".search-results").html(t.html).find('input[type="checkbox"]').each(function(){var e=parseInt(i(this).val());a.indexOf(n.selected,e)>=0&&(this.checked=!0)}),a.debounce(function(){i(n.$el).find(".search-nav").html(t.nav).find("a, span").addClass("button").filter("span").addClass("disabled")},10)()})},500),loadPage:function(e){e.preventDefault();var t=i(e.target);if(!t.is("span")){if(t.hasClass("next"))this.paged++;else if(t.hasClass("prev"))this.paged--;else{var n=t.html();this.paged=parseInt(n)}this.search()}},selectItem:function(e){var t=i(e.target).closest("li"),n=t.find('input[type="checkbox"]'),s=parseInt(n.val()),o=a.findLastIndex(this.selected,{id:s});this.multiple?n.is(":checked")?-1===o&&this.selected.push(t.closest("li").data("data")):o>=0&&this.selected.splice(o,1):(e.preventDefault(),this.selected=[t.closest("li").data("data")],this.addUsers())},addUsers:function(){i(this.$el).find(".lp-result-item");this.callbacks&&this.callbacks.addUsers&&this.callbacks.addUsers.call(this,this.selected),i(document).triggerHandler("learn-press/modal-add-users",this.selected)},close:function(){this.$emit("close")}}}),window.LP.$modalSearchUsers=new $Vue({el:"#vue-modal-search-users",data:{show:!1,term:"",multiple:!1,callbacks:{},textFormat:"{{display_name}} ({{email}})",exclude:0},methods:{open:function(e){a.each(e.data,function(e,t){this[t]=e},this),this.callbacks=e.callbacks,this.focusSearch()},close:function(){this.show=!1},focusSearch:a.debounce(function(){i('input[name="search"]',this.$el).focus()},200)}})}()})},function(e,t,n){"use strict";var i=window.jQuery,a=window._;window.$Vue=window.$Vue||window.Vue,i(document).ready(function(){var e=!!$Vue&&$Vue.http;document.getElementById("vue-modal-search-items")&&$Vue&&function(){$Vue.component("learn-press-modal-search-items",{template:"#learn-press-modal-search-items",data:function(){return{paged:1,term:"",hasItems:!1,selected:[]}},watch:{show:function(e){e&&i(this.$refs.search).focus()}},props:["postType","context","contextId","show","callbacks","exclude"],created:function(){},mounted:function(){this.term="",this.paged=1,this.search()},methods:{doSearch:function(e){this.term=e.target.value,this.paged=1,this.search()},search:a.debounce(function(t){i("#modal-search-items").addClass("loading");var n=this;e.post(window.location.href,{type:this.postType,context:this.context,context_id:this.contextId,term:t||this.term,paged:this.paged,exclude:this.exclude,"lp-ajax":"modal_search_items"},{emulateJSON:!0,params:{}}).then(function(e){var t=LP.parseJSON(e.body||e.bodyText);n.hasItems=!!a.size(t.items),i("#modal-search-items").removeClass("loading"),i(n.$el).find(".search-results").html(t.html).find('input[type="checkbox"]').each(function(){var e=parseInt(i(this).val());a.indexOf(n.selected,e)>=0&&(this.checked=!0)}),a.debounce(function(){i(n.$el).find(".search-nav").html(t.nav).find("a, span").addClass("button").filter("span").addClass("disabled")},10)()})},500),loadPage:function(e){e.preventDefault();var t=i(e.target);if(!t.is("span")){if(t.hasClass("next"))this.paged++;else if(t.hasClass("prev"))this.paged--;else{var n=t.html();this.paged=parseInt(n)}this.search()}},selectItem:function(e){var t=i(e.target).closest("li"),n=t.find('input[type="checkbox"]'),s=parseInt(n.val()),o=a.indexOf(this.selected,s);n.is(":checked")?-1===o&&this.selected.push(s):o>=0&&this.selected.splice(o,1)},addItems:function(){this.callbacks&&this.callbacks.addItems&&this.callbacks.addItems.call(this),i(document).triggerHandler("learn-press/add-order-items",this.selected)},close:function(){this.$emit("close")}}}),window.LP.$modalSearchItems=new $Vue({el:"#vue-modal-search-items",data:{show:!1,term:"",postType:"",callbacks:{},exclude:"",context:""},methods:{open:function(e){a.each(e.data,function(e,t){this[t]=e},this),this.callbacks=e.callbacks,this.focusSearch()},close:function(){this.show=!1},focusSearch:a.debounce(function(){i('input[name="search"]',this.$el).focus()},200)}})}()})},function(e,t,n){"use strict";!function(e){var t=null,n=null,i=null,a=function(t){i||(i=n.clone());var a=t.toLowerCase().split(/\s+/).filter(function(e,t){return e.length>=3}),s=function(t,n){return t.find(".plugin-card").each(function(){var t=e(this),i=t.find(".item-title").text().toLowerCase(),s=t.find(".column-description, .theme-description").text();if(a.length){if(function(){var e=new RegExp(a.join("|"),"ig");return i.match(e)||s.match(e)}()){var o=t.clone();n.append(o)}}else n.append(t.clone())})};n.each(function(t){var n=e(this).html(""),a=(s(i.eq(t),n),n.children().length);n.prev("h2").find("span").html(a)})};e(document).on("keyup",".lp-search-addon",function(e){t&&clearTimeout(t),t=setTimeout(a,300,e.target.value)}).ready(function(){n=e(".addons-browse")})}(jQuery)}]);
|
assets/js/admin/utils/_advanced-list.js
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
/**
|
3 |
-
* Advanced list.
|
4 |
-
*
|
5 |
-
* @param el
|
6 |
-
* @param options
|
7 |
-
*/
|
8 |
-
var advancedList = function (el, options) {
|
9 |
-
var self = this,
|
10 |
-
$el = $(el).hasClass('advanced-list') ? $(el) : $('.advanced-list', el);
|
11 |
-
|
12 |
-
this.options = $.extend({
|
13 |
-
template: '<li data-id="{{id}}"><span class="remove-item"></span><span>{{text}}</span> </li>'
|
14 |
-
}, options || {});
|
15 |
-
this.$el = $el;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Callback for removing event.
|
19 |
-
*
|
20 |
-
* @param e
|
21 |
-
* @private
|
22 |
-
*/
|
23 |
-
function _remove(e) {
|
24 |
-
e.preventDefault();
|
25 |
-
remove($el.children().index($(this).closest('li')) + 1)
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
*
|
30 |
-
* @param e
|
31 |
-
* @private
|
32 |
-
*/
|
33 |
-
function _add(e) {
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Remove an element at a position from list.
|
39 |
-
*
|
40 |
-
* @param at
|
41 |
-
*/
|
42 |
-
function remove(at) {
|
43 |
-
$el.children(':eq(' + (at - 1) + ')').remove();
|
44 |
-
self.options.onRemove && self.options.onRemove.call(self);
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Add new element into list.
|
49 |
-
*
|
50 |
-
* @param data
|
51 |
-
* @param at - Optional. Position where to insert
|
52 |
-
*/
|
53 |
-
function add(data, at) {
|
54 |
-
var options = {},
|
55 |
-
template = getTemplate();
|
56 |
-
if ($.isPlainObject(data)) {
|
57 |
-
options = $.extend({id: 0, text: ''}, data)
|
58 |
-
} else if (typeof data === 'string') {
|
59 |
-
options = {
|
60 |
-
id: '',
|
61 |
-
text: data
|
62 |
-
}
|
63 |
-
} else if (data[0] !== undefined) {
|
64 |
-
options = {
|
65 |
-
id: data[1] ? data[1] : '',
|
66 |
-
text: data[0]
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
// Replace placeholders with related variables
|
71 |
-
for (var prop in options) {
|
72 |
-
var reg = new RegExp('\{\{' + prop + '\}\}', 'g')
|
73 |
-
template = template.replace(reg, options[prop]);
|
74 |
-
}
|
75 |
-
|
76 |
-
template = $(template);
|
77 |
-
|
78 |
-
if (at !== undefined) {
|
79 |
-
var $e = $el.children(':eq(' + (at - 1) + ')');
|
80 |
-
if ($e.length) {
|
81 |
-
template.insertBefore($e);
|
82 |
-
} else {
|
83 |
-
$el.append(template)
|
84 |
-
}
|
85 |
-
} else {
|
86 |
-
$el.append(template)
|
87 |
-
}
|
88 |
-
|
89 |
-
// Append "\n" between li elements
|
90 |
-
var $child = $el.children().detach();
|
91 |
-
$child.each(function () {
|
92 |
-
$el.append("\n").append(this);
|
93 |
-
});
|
94 |
-
self.options.onAdd && self.options.onAdd.call(self);
|
95 |
-
}
|
96 |
-
|
97 |
-
function getTemplate() {
|
98 |
-
var $container = $(self.options.template);
|
99 |
-
if ($container.length) {
|
100 |
-
return $container.html();
|
101 |
-
}
|
102 |
-
return self.options.template;
|
103 |
-
}
|
104 |
-
|
105 |
-
$el.on('click', '.remove-item', _remove);
|
106 |
-
// export
|
107 |
-
this.add = add;
|
108 |
-
this.remove = remove;
|
109 |
-
}
|
110 |
-
|
111 |
-
// Export
|
112 |
-
$.fn.advancedList = function (options) {
|
113 |
-
var args = [];
|
114 |
-
for (var i = 1; i < arguments.length; i++) {
|
115 |
-
args.push(arguments[i]);
|
116 |
-
}
|
117 |
-
return $.each(this, function () {
|
118 |
-
var $advancedList = $(this).data('advancedList');
|
119 |
-
if (!$advancedList) {
|
120 |
-
$advancedList = new advancedList(this, options);
|
121 |
-
$(this).data('advancedList', $advancedList);
|
122 |
-
}
|
123 |
-
|
124 |
-
// Try to calling to methods of class
|
125 |
-
if (typeof options === 'string') {
|
126 |
-
if ($.isFunction($advancedList[options])) {
|
127 |
-
return $advancedList[options].apply($advancedList, args);
|
128 |
-
}
|
129 |
-
}
|
130 |
-
return this;
|
131 |
-
})
|
132 |
-
}
|
133 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/utils/_advertisement.js
DELETED
@@ -1,79 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
function LP_Advertisement_Slider(el, options) {
|
3 |
-
this.options = $.extend({}, options || {});
|
4 |
-
var $el = $(el),
|
5 |
-
$items = $el.find('.slide-item'),
|
6 |
-
$controls = $('<div class="slider-controls"><div class="prev-item"></div><div class="next-item"></div></div>'),
|
7 |
-
$wrapItems = $('<div class="slider-items"></div>').append($items),
|
8 |
-
itemIndex = 0,
|
9 |
-
timer = null;
|
10 |
-
|
11 |
-
function init() {
|
12 |
-
createHTML();
|
13 |
-
bindEvents();
|
14 |
-
activeItem();
|
15 |
-
}
|
16 |
-
|
17 |
-
function createHTML() {
|
18 |
-
$el.append($wrapItems);
|
19 |
-
$items.each(function () {
|
20 |
-
$(this).append($controls.clone())
|
21 |
-
})
|
22 |
-
}
|
23 |
-
|
24 |
-
function activeItem(index) {
|
25 |
-
index = index !== undefined ? index : itemIndex;
|
26 |
-
var activeItem = $items.eq(index);
|
27 |
-
|
28 |
-
activeItem.show();
|
29 |
-
// A ha???
|
30 |
-
setTimeout(function () {
|
31 |
-
activeItem.addClass('slide-active');
|
32 |
-
}, 1);
|
33 |
-
|
34 |
-
activeItem.siblings().removeClass('slide-active');
|
35 |
-
|
36 |
-
timer && clearTimeout(timer);
|
37 |
-
timer = setTimeout(function () {
|
38 |
-
activeItem.siblings().hide();
|
39 |
-
}, 500)
|
40 |
-
}
|
41 |
-
|
42 |
-
function nextItem() {
|
43 |
-
if (itemIndex < $items.length - 1) {
|
44 |
-
itemIndex++;
|
45 |
-
} else {
|
46 |
-
itemIndex = 0;
|
47 |
-
}
|
48 |
-
activeItem(itemIndex);
|
49 |
-
}
|
50 |
-
|
51 |
-
function prevItem() {
|
52 |
-
if (itemIndex > 0) {
|
53 |
-
itemIndex--;
|
54 |
-
} else {
|
55 |
-
itemIndex = $items.length - 1;
|
56 |
-
}
|
57 |
-
activeItem(itemIndex);
|
58 |
-
}
|
59 |
-
|
60 |
-
function bindEvents() {
|
61 |
-
$el.on('click', '.next-item', nextItem);
|
62 |
-
$el.on('click', '.prev-item', prevItem);
|
63 |
-
}
|
64 |
-
|
65 |
-
init();
|
66 |
-
}
|
67 |
-
|
68 |
-
$.fn.LP_Advertisement_Slider = function (opts) {
|
69 |
-
return $.each(this, function () {
|
70 |
-
var $slider = $(this).data('LP_Advertisement_Slider');
|
71 |
-
if (!$slider) {
|
72 |
-
$slider = new LP_Advertisement_Slider(this, opts);
|
73 |
-
$(this).data('LP_Advertisement_Slider', $slider);
|
74 |
-
}
|
75 |
-
return this;
|
76 |
-
})
|
77 |
-
};
|
78 |
-
})(jQuery);
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/utils/_cookie.js
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
function login() {
|
2 |
-
alert();
|
3 |
-
}
|
|
|
|
|
|
assets/js/admin/utils/_dropdown-pages.js
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
function dropdownPages(el, options) {
|
3 |
-
this.options = $.extend({
|
4 |
-
ID: '',
|
5 |
-
name: 'Add new page'
|
6 |
-
}, options || {});
|
7 |
-
var $element = $(el),
|
8 |
-
$select = $element.find('select'),
|
9 |
-
$listWrap = $element.find('.list-pages-wrapper'),
|
10 |
-
$actions = $element.find('.quick-add-page-actions'),
|
11 |
-
$form = $element.find('.quick-add-page-inline');
|
12 |
-
|
13 |
-
function addNewPageToList(args) {
|
14 |
-
var $new_option = $('<option value="' + args.ID + '">' + args.name + '</option>');
|
15 |
-
var position = $.inArray(args.ID + "", args.positions);
|
16 |
-
|
17 |
-
$('.learn-press-dropdown-pages select').each(function(){
|
18 |
-
var $sel = $(this),
|
19 |
-
$option = $new_option.clone();
|
20 |
-
if (position == 0) {
|
21 |
-
$('option', $sel).each(function () {
|
22 |
-
if (parseInt($(this).val())) {
|
23 |
-
$option.insertBefore($(this));
|
24 |
-
return false;
|
25 |
-
}
|
26 |
-
})
|
27 |
-
} else if (position == args.positions.length - 1) {
|
28 |
-
$sel.append($option);
|
29 |
-
} else {
|
30 |
-
$option.insertAfter($('option[value="' + args.positions[position - 1] + '"]', $sel));
|
31 |
-
}
|
32 |
-
});
|
33 |
-
}
|
34 |
-
|
35 |
-
$select.change(function () {
|
36 |
-
|
37 |
-
$actions.addClass('hide-if-js');
|
38 |
-
if (this.value !== 'add_new_page') {
|
39 |
-
if (parseInt(this.value)) {
|
40 |
-
$actions.find('a.edit-page').attr('href', 'post.php?post=' + this.value + '&action=edit');
|
41 |
-
$actions.find('a.view-page').attr('href', lpGlobalSettings.siteurl + '?page_id=' + this.value);
|
42 |
-
$actions.removeClass('hide-if-js');
|
43 |
-
$select.attr('data-selected', this.value);
|
44 |
-
}
|
45 |
-
return;
|
46 |
-
}
|
47 |
-
$listWrap.addClass('hide-if-js');
|
48 |
-
$form.removeClass('hide-if-js').find('input').focus().val('');
|
49 |
-
});
|
50 |
-
|
51 |
-
// Select 2
|
52 |
-
$select
|
53 |
-
.css('width', $select.width() + 50)
|
54 |
-
.find('option').each(function () {
|
55 |
-
$(this).html($(this).html().replace(/ /g, ''));
|
56 |
-
});
|
57 |
-
|
58 |
-
$select.select2({
|
59 |
-
allowClear: true
|
60 |
-
});
|
61 |
-
|
62 |
-
$select.on('select2:select', function (e) {
|
63 |
-
var data = e.params.data;
|
64 |
-
});
|
65 |
-
|
66 |
-
$element.on('click', '.quick-add-page-inline button', function () {
|
67 |
-
var $button = $(this),
|
68 |
-
$input = $form.find('input'),
|
69 |
-
page_name = $input.val();
|
70 |
-
if (!page_name) {
|
71 |
-
alert('Please enter the name of page');
|
72 |
-
$input.focus();
|
73 |
-
return;
|
74 |
-
}
|
75 |
-
$button.prop('disabled', true);
|
76 |
-
$.ajax({
|
77 |
-
url: lpGlobalSettings.ajax,
|
78 |
-
data: {
|
79 |
-
action: 'learnpress_create_page',
|
80 |
-
page_name: page_name
|
81 |
-
},
|
82 |
-
type: 'post',
|
83 |
-
dataType: 'html',
|
84 |
-
success: function (response) {
|
85 |
-
response = LP.parseJSON(response);
|
86 |
-
if (response.page) {
|
87 |
-
addNewPageToList({
|
88 |
-
ID: response.page.ID,
|
89 |
-
name: response.page.post_title,
|
90 |
-
positions: response.positions
|
91 |
-
});
|
92 |
-
$select.val(response.page.ID).focus().trigger('change');
|
93 |
-
$form.addClass('hide-if-js');
|
94 |
-
} else if (response.error) {
|
95 |
-
alert(response.error);
|
96 |
-
}
|
97 |
-
$button.prop('disabled', false);
|
98 |
-
$listWrap.removeClass('hide-if-js');
|
99 |
-
}
|
100 |
-
});
|
101 |
-
}).on('click', '.quick-add-page-inline a', function (e) {
|
102 |
-
e.preventDefault();
|
103 |
-
$form.addClass('hide-if-js');
|
104 |
-
$select.val($select.attr('data-selected') + '').removeAttr('disabled').trigger('change');
|
105 |
-
$listWrap.removeClass('hide-if-js');
|
106 |
-
}).on('click', '.button-quick-add-page', function (e) {
|
107 |
-
$select.val('add_new_page').trigger('change');
|
108 |
-
}).on('keypress keydown', '.quick-add-page-inline input[type="text"]', function (e) {
|
109 |
-
if (e.keyCode == 13 && e.type == 'keypress') {
|
110 |
-
e.preventDefault();
|
111 |
-
$(this).siblings('button').trigger('click')
|
112 |
-
} else if (e.keyCode == 27 && e.type == 'keydown') {
|
113 |
-
$(this).siblings('a').trigger('click')
|
114 |
-
}
|
115 |
-
})
|
116 |
-
}
|
117 |
-
|
118 |
-
$.fn.dropdownPages = function () {
|
119 |
-
return $.each(this, function () {
|
120 |
-
var $instance = $(this).data('dropdownPages');
|
121 |
-
if (!$instance) {
|
122 |
-
$instance = new dropdownPages(this, {});
|
123 |
-
$(this).data('dropdownPages', $instance);
|
124 |
-
}
|
125 |
-
return $instance;
|
126 |
-
})
|
127 |
-
}
|
128 |
-
})(jQuery);
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/utils/_search-items.js
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
var timer = null,
|
3 |
-
$wraps = null,
|
4 |
-
$cloneWraps = null,
|
5 |
-
onSearch = function (keyword) {
|
6 |
-
if (!$cloneWraps) {
|
7 |
-
$cloneWraps = $wraps.clone();
|
8 |
-
}
|
9 |
-
keywords = keyword.toLowerCase().split(/\s+/).filter(function (a, b) {
|
10 |
-
return a.length >= 3;
|
11 |
-
});
|
12 |
-
var foundItems = function ($w1, $w2) {
|
13 |
-
return $w1.find('.plugin-card').each(function () {
|
14 |
-
var $item = $(this),
|
15 |
-
itemText = $item.find('.item-title').text().toLowerCase(),
|
16 |
-
itemDesc = $item.find('.column-description, .theme-description').text();
|
17 |
-
var found = function () {
|
18 |
-
var reg = new RegExp(keywords.join('|'), 'ig');
|
19 |
-
return itemText.match(reg) || itemDesc.match(reg)
|
20 |
-
}
|
21 |
-
if (keywords.length) {
|
22 |
-
if (found()) {
|
23 |
-
var $clone = $item.clone();
|
24 |
-
$w2.append($clone);
|
25 |
-
}
|
26 |
-
} else {
|
27 |
-
$w2.append($item.clone());
|
28 |
-
}
|
29 |
-
});
|
30 |
-
}
|
31 |
-
|
32 |
-
$wraps.each(function (i) {
|
33 |
-
var $this = $(this).html(''),
|
34 |
-
$items = foundItems($cloneWraps.eq(i), $this),
|
35 |
-
count = $this.children().length;
|
36 |
-
|
37 |
-
$this.prev('h2').find('span').html(count)
|
38 |
-
});
|
39 |
-
};
|
40 |
-
$(document).on('keyup', '.lp-search-addon', function (e) {
|
41 |
-
timer && clearTimeout(timer);
|
42 |
-
timer = setTimeout(onSearch, 300, e.target.value);
|
43 |
-
}).ready(function () {
|
44 |
-
$wraps = $('.addons-browse');
|
45 |
-
})
|
46 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/frontend/learnpress.js
CHANGED
@@ -1,5 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
;(function ($) {
|
2 |
$(document).ready(function () {
|
3 |
-
$('.learn-press-tip').QuickTip
|
4 |
-
})
|
5 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 61);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 61:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
;(function ($) {
|
75 |
$(document).ready(function () {
|
76 |
+
$('.learn-press-tip').LP('QuickTip');
|
77 |
+
});
|
78 |
+
})(jQuery);
|
79 |
+
|
80 |
+
/***/ })
|
81 |
+
|
82 |
+
/******/ });
|
83 |
+
//# sourceMappingURL=learnpress.js.map
|
assets/js/frontend/learnpress.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=61)}({61:function(n,t,e){"use strict";!function(n){n(document).ready(function(){n(".learn-press-tip").LP("QuickTip")})}(jQuery)}});
|
assets/js/frontend/quiz.bak.js
DELETED
@@ -1,915 +0,0 @@
|
|
1 |
-
;(function ($) {
|
2 |
-
var Quiz = function (args) {
|
3 |
-
this.model = new Quiz.Model(args);
|
4 |
-
this.view = new Quiz.View({
|
5 |
-
model: this.model
|
6 |
-
});
|
7 |
-
this.destroy = function () {
|
8 |
-
this.model.questions.forEach(function (m) {
|
9 |
-
try {
|
10 |
-
m instanceof Model_Question ? (
|
11 |
-
// prevent trigger 'sync' action
|
12 |
-
m.set('id', null),
|
13 |
-
m.destroy()
|
14 |
-
) : false;
|
15 |
-
} catch (ex) {
|
16 |
-
console.log(ex);
|
17 |
-
}
|
18 |
-
});
|
19 |
-
this.model.set('id', null);
|
20 |
-
this.model.destroy();
|
21 |
-
this.view.destroy();
|
22 |
-
this.view.undelegateEvents();
|
23 |
-
};
|
24 |
-
}, Model_Question, List_Questions, windowTarget = parent.window || window;
|
25 |
-
|
26 |
-
Quiz.Model_Question = Model_Question = Backbone.Model.extend({
|
27 |
-
defaults: {
|
28 |
-
//question_id: 0
|
29 |
-
},
|
30 |
-
data: null,
|
31 |
-
view: false,
|
32 |
-
url: function () {
|
33 |
-
return this.urlRoot;
|
34 |
-
},
|
35 |
-
urlRoot: function () {
|
36 |
-
return 'abc';
|
37 |
-
},
|
38 |
-
initialize: function () {
|
39 |
-
},
|
40 |
-
element: function () {
|
41 |
-
return $(this.get('content'));
|
42 |
-
},
|
43 |
-
submit: function (args) {
|
44 |
-
var that = this;
|
45 |
-
args = $.extend({
|
46 |
-
complete: null,
|
47 |
-
data: {}
|
48 |
-
}, args || {});
|
49 |
-
this.fetch({
|
50 |
-
data: $.extend({
|
51 |
-
action: 'learnpress_load_quiz_question',
|
52 |
-
user_id: this.get('user_id'),
|
53 |
-
quiz_id: this.get('quiz_id'),
|
54 |
-
question_id: this.get('id')
|
55 |
-
}, args.data || {}),
|
56 |
-
complete: (function (e) {
|
57 |
-
var response = LP.parseJSON(e.responseText);
|
58 |
-
if (response.result == 'success') {
|
59 |
-
//if (!that.get('content')) {
|
60 |
-
that.set(response.question);
|
61 |
-
if (response.permalink) {
|
62 |
-
LP.setUrl(response.permalink);
|
63 |
-
}
|
64 |
-
//}
|
65 |
-
$.isFunction(args.complete) && args.complete.call(that, response);
|
66 |
-
}
|
67 |
-
})
|
68 |
-
});
|
69 |
-
},
|
70 |
-
check: function (args) {
|
71 |
-
var that = this;
|
72 |
-
if ($.isFunction(args)) {
|
73 |
-
args = {
|
74 |
-
complete: args
|
75 |
-
}
|
76 |
-
} else {
|
77 |
-
args = $.extend({
|
78 |
-
complete: null,
|
79 |
-
data: {}
|
80 |
-
}, args || {});
|
81 |
-
}
|
82 |
-
LP.doAjax({
|
83 |
-
data: $.extend({
|
84 |
-
'lp-ajax': 'check-question',
|
85 |
-
question_id: this.get('id')
|
86 |
-
//question_answer: $('form#learn-press-quiz-question').serializeJSON()
|
87 |
-
}, args.data || {}),
|
88 |
-
dataType: 'html',
|
89 |
-
success: function (response, raw) {
|
90 |
-
var $content = that.get('response');
|
91 |
-
if ($content) {
|
92 |
-
$content.find('.learn-press-question-options').replaceWith($(response).filter('.learn-press-question-options'));
|
93 |
-
}
|
94 |
-
that.set({checked: 'yes', response: $content});
|
95 |
-
$.isFunction(args.complete) && args.complete.call(that, response);
|
96 |
-
}
|
97 |
-
});
|
98 |
-
},
|
99 |
-
showHint: function (args) {
|
100 |
-
var that = this;
|
101 |
-
LP.doAjax({
|
102 |
-
data: $.extend({
|
103 |
-
'lp-ajax': 'get-question-hint',
|
104 |
-
user_id: this.get('user_id'),
|
105 |
-
quiz_id: this.get('quiz_id'),
|
106 |
-
question_id: this.get('id'),
|
107 |
-
question_answer: $('form#learn-press-quiz-question').serializeJSON()
|
108 |
-
}, args.data || {}),
|
109 |
-
success: function (response, raw) {
|
110 |
-
that.set('checked', response.checked);
|
111 |
-
$.isFunction(args.complete) && args.complete.call(that, response);
|
112 |
-
}
|
113 |
-
});
|
114 |
-
}
|
115 |
-
});
|
116 |
-
/**
|
117 |
-
* List Questions
|
118 |
-
*/
|
119 |
-
Quiz.List_Questions = List_Questions = Backbone.Collection.extend({
|
120 |
-
url: 'admin-ajax.php',
|
121 |
-
urlRoot: function () {
|
122 |
-
return '';
|
123 |
-
},
|
124 |
-
len: 0,
|
125 |
-
model: Model_Question,
|
126 |
-
initialize: function () {
|
127 |
-
this.on('add', function (model) {
|
128 |
-
this.listenTo(model, 'change', this.onChange);
|
129 |
-
this.listenTo(model, 'change:hasShowedHint', this.onChangedHint);
|
130 |
-
this.listenTo(model, 'change:checked', function (a) {
|
131 |
-
if (a.changed['checked'] && a.changed['checked'] === 'yes') {
|
132 |
-
var $dom = a.get('response');
|
133 |
-
if ($dom) $dom.find('.button-check-answer').attr('disabled', true);
|
134 |
-
}
|
135 |
-
}, this);
|
136 |
-
model.set('index', this.len++);
|
137 |
-
}, this);
|
138 |
-
this.on('change:view', function () {
|
139 |
-
this.questions.view = this.get('view');
|
140 |
-
});
|
141 |
-
|
142 |
-
},
|
143 |
-
onChangedHint: function (a, b) {
|
144 |
-
|
145 |
-
},
|
146 |
-
onChange: function (a, b) {
|
147 |
-
|
148 |
-
if (a.changed['current']) {
|
149 |
-
if (a.get('current') !== 'yes') {
|
150 |
-
|
151 |
-
} else {
|
152 |
-
this.current = a;
|
153 |
-
for (var i = 0; i < this.length; i++) {
|
154 |
-
var e = this.at(i);
|
155 |
-
if (e.get('id') == a.get('id')) {
|
156 |
-
$('.question-' + e.get('id')).toggleClass('current', true);
|
157 |
-
continue;
|
158 |
-
}
|
159 |
-
if (e.get('current') != 'yes') {
|
160 |
-
continue;
|
161 |
-
}
|
162 |
-
this.stopListening(e, 'change', this.onChange);
|
163 |
-
e.set('current', 'no');
|
164 |
-
this.listenTo(e, 'change', this.onChange);
|
165 |
-
$('.question-' + e.get('id')).toggleClass('current', false)
|
166 |
-
}
|
167 |
-
try {
|
168 |
-
this.view.updateUrl();
|
169 |
-
} catch (e) {
|
170 |
-
}
|
171 |
-
}
|
172 |
-
}
|
173 |
-
}
|
174 |
-
});
|
175 |
-
|
176 |
-
Quiz.Model = Backbone.Model.extend({
|
177 |
-
_args: null,
|
178 |
-
questions: null,
|
179 |
-
initialize: function (args) {
|
180 |
-
_.bindAll(this, 'getQuizData');
|
181 |
-
this._args = args || {};
|
182 |
-
this.on('change:view', function () {
|
183 |
-
this.questions.view = this.get('view');
|
184 |
-
});
|
185 |
-
this._initQuestions();
|
186 |
-
this.set('remainingTime', args.totalTime - args.userTime);
|
187 |
-
LP.Hook.addFilter('learn_press_finish_quiz_data', this.getQuizData);
|
188 |
-
|
189 |
-
this.prepareQuestion({delayTime: this.delayTime})
|
190 |
-
},
|
191 |
-
_initQuestions: function () {
|
192 |
-
this.questions = new List_Questions();
|
193 |
-
_.forEach(this._args.questions, function (q) {
|
194 |
-
this.questions.add(q);
|
195 |
-
}, this);
|
196 |
-
if (this.questions.length && !this.current()) {
|
197 |
-
this.questions.at(0).set('current', 'yes');
|
198 |
-
}
|
199 |
-
},
|
200 |
-
_secondsToDHMS: function (t) {
|
201 |
-
var d = Math.floor(t / (24 * 3600)), t = t - d * 24 * 3600, h = Math.floor(t / 3600), t = t - h * 3600,
|
202 |
-
m = Math.floor(t / 60), s = Math.floor(t - m * 60);
|
203 |
-
return {d: d, h: h, m: m, s: s}
|
204 |
-
},
|
205 |
-
getRemainingTime: function (format) {
|
206 |
-
var t = this.get('remainingTime');
|
207 |
-
if (format == 'dhms') {
|
208 |
-
t = this._secondsToDHMS(t);
|
209 |
-
}
|
210 |
-
return t;
|
211 |
-
},
|
212 |
-
getTotalTime: function (format) {
|
213 |
-
var t = this.get('totalTime');
|
214 |
-
if (format == 'dhms') {
|
215 |
-
t = this._secondsToDHMS(t);
|
216 |
-
}
|
217 |
-
return t;
|
218 |
-
},
|
219 |
-
getUserTime: function (format) {
|
220 |
-
var t = this.get('userTime');
|
221 |
-
if (format == 'dhms') {
|
222 |
-
t = this._secondsToDHMS(t);
|
223 |
-
}
|
224 |
-
return t;
|
225 |
-
},
|
226 |
-
inc: function (seconds) {
|
227 |
-
var userTime = this.get('userTime') + (seconds || 1);
|
228 |
-
var t = {
|
229 |
-
userTime: userTime,
|
230 |
-
remainingTime: Math.max(this.get('totalTime') - userTime, 0)
|
231 |
-
};
|
232 |
-
this.set(t);
|
233 |
-
return t;
|
234 |
-
},
|
235 |
-
decr: function (seconds) {
|
236 |
-
var userTime = this.get('userTime') - (seconds || 1);
|
237 |
-
var t = {
|
238 |
-
userTime: userTime,
|
239 |
-
remainingTime: Math.max(this.get('totalTime') - userTime, 0)
|
240 |
-
};
|
241 |
-
this.set(t);
|
242 |
-
return t;
|
243 |
-
},
|
244 |
-
fetchCurrent: function (callback) {
|
245 |
-
var current = this.getCurrent(),
|
246 |
-
that = this;
|
247 |
-
if (!current) {
|
248 |
-
return;
|
249 |
-
}
|
250 |
-
LP.Hook.doAction('learn_press_before_fetch_question', current.get('id'), that);
|
251 |
-
$.ajax({
|
252 |
-
url: current.get('url'),
|
253 |
-
dataType: 'html',
|
254 |
-
success: function (response) {
|
255 |
-
that.set('response', response);
|
256 |
-
$.isFunction(callback) && callback(response, that);
|
257 |
-
}
|
258 |
-
});
|
259 |
-
},
|
260 |
-
next: function (callback, args) {
|
261 |
-
var next = this.findNext(),
|
262 |
-
that = this,
|
263 |
-
id = 0;
|
264 |
-
if (!next) {
|
265 |
-
return;
|
266 |
-
}
|
267 |
-
id = parseInt(next.get('id'));
|
268 |
-
LP.Hook.doAction('learn_press_before_next_question', id, that);
|
269 |
-
this.select(id, function (args) {
|
270 |
-
LP.Hook.doAction('learn_press_previous_question', id, that);
|
271 |
-
callback && callback.apply(null, arguments);
|
272 |
-
}, args);
|
273 |
-
},
|
274 |
-
prev: function (callback, args) {
|
275 |
-
var prev = this.findPrev(),
|
276 |
-
that = this,
|
277 |
-
id = 0;
|
278 |
-
if (!prev) {
|
279 |
-
return;
|
280 |
-
}
|
281 |
-
id = prev.get('id');
|
282 |
-
LP.Hook.doAction('learn_press_before_previous_question', id, that);
|
283 |
-
this.select(id, function () {
|
284 |
-
LP.Hook.doAction('learn_press_previous_question', id, that);
|
285 |
-
callback && callback.apply(null, arguments);
|
286 |
-
}, args);
|
287 |
-
},
|
288 |
-
select: function (id, callback, args) {
|
289 |
-
var question = this.questions.findWhere({id: parseInt(id)}),
|
290 |
-
that = this,
|
291 |
-
loadedCallback = function () {
|
292 |
-
$.isFunction(callback) && callback(question, that);
|
293 |
-
LP.Hook.doAction('learn_press_select_question', question, that);
|
294 |
-
};
|
295 |
-
if (!question) {
|
296 |
-
return;
|
297 |
-
}
|
298 |
-
if (question.get('current') === 'yes') {
|
299 |
-
windowTarget.LP.unblockContent();
|
300 |
-
return;
|
301 |
-
}
|
302 |
-
LP.Hook.doAction('learn_press_before_select_question', question, that);
|
303 |
-
question.set('current', 'yes');
|
304 |
-
if (question.get('response')) {
|
305 |
-
loadedCallback();
|
306 |
-
$.ajax({
|
307 |
-
url: question.get('url'),
|
308 |
-
data: $.extend({
|
309 |
-
id: question.get('id'),
|
310 |
-
'lp-ajax': 'fetch-question',
|
311 |
-
'lp-update-current-question': true
|
312 |
-
}, args || {}),
|
313 |
-
dataType: 'html'
|
314 |
-
});
|
315 |
-
} else {
|
316 |
-
$.ajax({
|
317 |
-
url: question.get('url'),
|
318 |
-
data: $.extend({
|
319 |
-
id: question.get('id'),
|
320 |
-
data: $('form[name="quiz-question-content"]').serialize(),
|
321 |
-
'lp-ajax': 'fetch-question'
|
322 |
-
}, args || {}),
|
323 |
-
dataType: 'html',
|
324 |
-
success: function (response) {
|
325 |
-
var $html = $(response).contents().find('.learn-press-content-item-summary');
|
326 |
-
question.set('response', $html);
|
327 |
-
loadedCallback();
|
328 |
-
}
|
329 |
-
});
|
330 |
-
}
|
331 |
-
|
332 |
-
/* Prepare next question & prev question */
|
333 |
-
this.prepareQuestion(args)
|
334 |
-
},
|
335 |
-
prepareQuestion: function (args) {
|
336 |
-
|
337 |
-
var next = this.findNext(),
|
338 |
-
prev = this.findPrev();
|
339 |
-
|
340 |
-
if (next) {
|
341 |
-
this.prepareResponse(parseInt(next.get('id')), args);
|
342 |
-
}
|
343 |
-
if (prev) {
|
344 |
-
this.prepareResponse(parseInt(prev.get('id')), args);
|
345 |
-
}
|
346 |
-
},
|
347 |
-
prepareResponse: function (id, args) {
|
348 |
-
|
349 |
-
var question = this.questions.findWhere({id: parseInt(id)}),
|
350 |
-
currentQuestion = this.current();
|
351 |
-
|
352 |
-
if (question.get('response')) {
|
353 |
-
return;
|
354 |
-
}
|
355 |
-
|
356 |
-
$.ajax({
|
357 |
-
url: question.get('url'),
|
358 |
-
data: $.extend({
|
359 |
-
id: question.get('id'),
|
360 |
-
data: $('form[name="quiz-question-content"]').serialize(),
|
361 |
-
'lp-ajax': 'fetch-question',
|
362 |
-
'lp-current-question': currentQuestion.get('id')
|
363 |
-
|
364 |
-
}, args || {}),
|
365 |
-
dataType: 'html',
|
366 |
-
success: function (response) {
|
367 |
-
var $html = $(response).contents().find('.learn-press-content-item-summary');
|
368 |
-
question.set('response', $html);
|
369 |
-
}
|
370 |
-
});
|
371 |
-
},
|
372 |
-
getQuestionPosition: function (question_id) {
|
373 |
-
question_id = question_id || this.get('question_id');
|
374 |
-
return _.indexOf(this.getIds(), question_id);
|
375 |
-
},
|
376 |
-
countQuestions: function () {
|
377 |
-
return this.questions.length;
|
378 |
-
},
|
379 |
-
isLast: function (question_id) {
|
380 |
-
question_id = question_id || this.getCurrent('id');
|
381 |
-
var q = this.questions.findWhere({id: parseInt(question_id)});
|
382 |
-
return q ? q.get('index') == this.questions.length - 1 : false;
|
383 |
-
},
|
384 |
-
isFirst: function (question_id) {
|
385 |
-
question_id = question_id || this.getCurrent('id');
|
386 |
-
var q = this.questions.findWhere({id: parseInt(question_id)});
|
387 |
-
return q ? q.get('index') == 0 : false;
|
388 |
-
},
|
389 |
-
findNext: function (question_id) {
|
390 |
-
question_id = question_id || this.getCurrent('id');
|
391 |
-
var q = this.questions.findWhere({id: parseInt(question_id)}),
|
392 |
-
next = false;
|
393 |
-
if (q) {
|
394 |
-
var index = q.get('index');
|
395 |
-
next = this.questions.at(index + 1);
|
396 |
-
}
|
397 |
-
return next;
|
398 |
-
},
|
399 |
-
findPrev: function (question_id) {
|
400 |
-
question_id = question_id || this.getCurrent('id');
|
401 |
-
var q = this.questions.findWhere({id: parseInt(question_id)}),
|
402 |
-
prev = false;
|
403 |
-
if (q) {
|
404 |
-
var index = q.get('index');
|
405 |
-
prev = this.questions.at(index - 1);
|
406 |
-
}
|
407 |
-
return prev;
|
408 |
-
},
|
409 |
-
getCurrent: function (_field, _default) {
|
410 |
-
var current = this.current(),
|
411 |
-
r = _default;
|
412 |
-
if (current) {
|
413 |
-
r = current.get(_field);
|
414 |
-
}
|
415 |
-
return r;
|
416 |
-
},
|
417 |
-
current: function (create) {
|
418 |
-
var current = this.questions.findWhere({current: 'yes'});
|
419 |
-
if (!current && create) {
|
420 |
-
current = new Model_Question();
|
421 |
-
}
|
422 |
-
return current;
|
423 |
-
},
|
424 |
-
getIds: function () {
|
425 |
-
return $.map(this.get('questions'), function (i, v) {
|
426 |
-
return parseInt(i.id);
|
427 |
-
});
|
428 |
-
},
|
429 |
-
showHint: function (callback, args) {
|
430 |
-
this.current().showHint({
|
431 |
-
complete: callback,
|
432 |
-
data: this.getRequestParams(args)
|
433 |
-
});
|
434 |
-
},
|
435 |
-
checkAnswer: function (callback, args) {
|
436 |
-
if (!args) {
|
437 |
-
args = {};
|
438 |
-
}
|
439 |
-
args.question_answer = this.getQuestionAnswerData(this.current());
|
440 |
-
this.current().check({
|
441 |
-
complete: callback,
|
442 |
-
data: this.getRequestParams(args)
|
443 |
-
});
|
444 |
-
},
|
445 |
-
getRequestParams: function (args) {
|
446 |
-
var defaults = LP.Hook.applyFilters('learn_press_request_quiz_params', {
|
447 |
-
quiz_id: this.get('id'),
|
448 |
-
user_id: this.get('user_id'),
|
449 |
-
course_id: this.get('courseId')
|
450 |
-
});
|
451 |
-
|
452 |
-
return $.extend(defaults, args || {});
|
453 |
-
},
|
454 |
-
getQuestion: function (thing) {
|
455 |
-
var question = false;
|
456 |
-
if ($.isNumeric(thing)) {
|
457 |
-
question = this.questions.findWhere({id: parseInt(thing)});
|
458 |
-
} else if ($.isPlainObject(thing)) {
|
459 |
-
question = this.questions.findWhere(thing);
|
460 |
-
} else if ($.type(thing) == 'undefined' || $.type(thing) == null) {
|
461 |
-
question = this.current();
|
462 |
-
} else if (thing instanceof Model_Question) {
|
463 |
-
question = thing;
|
464 |
-
}
|
465 |
-
return question;
|
466 |
-
},
|
467 |
-
getQuizData: function (data) {
|
468 |
-
data.answers = {};
|
469 |
-
this.questions.forEach(function (model) {
|
470 |
-
data.answers[model.get('id')] = this.getQuestionAnswerData(model);
|
471 |
-
}, this);
|
472 |
-
return data;
|
473 |
-
},
|
474 |
-
getQuestionAnswerData: function (question) {
|
475 |
-
question = this.getQuestion(question);
|
476 |
-
if (!question) {
|
477 |
-
return undefined;
|
478 |
-
}
|
479 |
-
var $html = question.get('response'),
|
480 |
-
answer = {},
|
481 |
-
$form = $('<form />');
|
482 |
-
if ($html) {
|
483 |
-
var $content = $html.find('.quiz-question-content');
|
484 |
-
$form.html($content.clone());
|
485 |
-
answer = $form.serializeJSON();
|
486 |
-
}
|
487 |
-
return LP.Hook.applyFilters('learn_press_question_answer_data', answer, $form, question, this);
|
488 |
-
}
|
489 |
-
});
|
490 |
-
Quiz.View = Backbone.View.extend({
|
491 |
-
el: function () {
|
492 |
-
return 'body';
|
493 |
-
},
|
494 |
-
events: {
|
495 |
-
'click .button-prev-question': '_prevQuestion',
|
496 |
-
'click .button-next-question': '_nextQuestion',
|
497 |
-
'click .button-hint': '_showHint',
|
498 |
-
'click .button-check-answer': '_checkAnswer',
|
499 |
-
'click .quiz-questions-list .question-title': '_selectQuestion',
|
500 |
-
'click .button-start-quiz': '_startQuiz',
|
501 |
-
'click .button-finish-quiz': '_finishQuiz',
|
502 |
-
'click .button-retake-quiz': '_retakeQuiz',
|
503 |
-
'click .button-complete-item': '_completeItem',
|
504 |
-
'click #lp-navigation .nav-link a': '_click_nav_link'
|
505 |
-
},
|
506 |
-
timeout: 0,
|
507 |
-
delayTimeout: 0,
|
508 |
-
delayTime: 0,
|
509 |
-
localized: null,
|
510 |
-
initialize: function () {
|
511 |
-
_.bindAll(this, 'pause', '_onTick', 'itemUrl', '_loadQuestionCompleted', '_checkAnswerCompleted', '_checkAnswer', '_onDestroy', 'destroy');
|
512 |
-
LP.Hook.addAction('learn_press_before_finish_quiz', this.destroy);
|
513 |
-
LP.Hook.addFilter('learn_press_get_current_item_url', this.itemUrl);
|
514 |
-
this.model.current(true).set('response', this.$('.learn-press-content-item-summary'));
|
515 |
-
this.model.set('view', this);
|
516 |
-
this.model.on('destroy', this._onDestroy);
|
517 |
-
this._initCountDown();
|
518 |
-
this.updateButtons();
|
519 |
-
this.windowTarget = windowTarget;
|
520 |
-
this.localized = window.learn_press_single_course_localize || {};
|
521 |
-
$(document).ready(function () {
|
522 |
-
$(window).trigger('load');
|
523 |
-
$(document).trigger('resize');
|
524 |
-
});
|
525 |
-
},
|
526 |
-
_initCountDown: function () {
|
527 |
-
if (this.model.get('status') != 'started' || this.model.get('totalTime') <= 0) {
|
528 |
-
return;
|
529 |
-
}
|
530 |
-
this.updateCountdown();
|
531 |
-
setTimeout($.proxy(function () {
|
532 |
-
this.$('.quiz-countdown').removeClass('hide-if-js');
|
533 |
-
this.start();
|
534 |
-
}, this), 500);
|
535 |
-
},
|
536 |
-
_addLeadingZero: function (n) {
|
537 |
-
return n < 10 ? "0" + n : "" + n;
|
538 |
-
},
|
539 |
-
_onDestroy: function () {
|
540 |
-
this.pause();
|
541 |
-
},
|
542 |
-
_onTick: function () {
|
543 |
-
this.timeout && clearTimeout(this.timeout);
|
544 |
-
var timer = this.model.inc();
|
545 |
-
this.updateCountdown();
|
546 |
-
|
547 |
-
if (timer.remainingTime == 0) {
|
548 |
-
LP.Hook.doAction('learn_press_quiz_timeout', this);
|
549 |
-
this.$('.button-finish-quiz').trigger('click');
|
550 |
-
return;
|
551 |
-
}
|
552 |
-
this.timeout = setTimeout(this._onTick, 1000);
|
553 |
-
},
|
554 |
-
|
555 |
-
_prevQuestion: function (e) {
|
556 |
-
e.preventDefault();
|
557 |
-
var delayTime = this.delayTime;
|
558 |
-
this._beforeFetchQuestion();
|
559 |
-
this.model.prev(this._loadQuestionCompleted, {delayTime: delayTime});
|
560 |
-
},
|
561 |
-
_nextQuestion: function (e) {
|
562 |
-
e.preventDefault();
|
563 |
-
var delayTime = this.delayTime;
|
564 |
-
this._beforeFetchQuestion();
|
565 |
-
this.model.next(this._loadQuestionCompleted, {delayTime: delayTime});
|
566 |
-
|
567 |
-
},
|
568 |
-
_selectQuestion: function (e) {
|
569 |
-
e.preventDefault();
|
570 |
-
if (this.model.get('status') == 'started') {
|
571 |
-
var id = $(e.target).closest('li').attr('data-id'),
|
572 |
-
delayTime = this.delayTime;
|
573 |
-
if (this.model.current().get('id') == id) {
|
574 |
-
return;
|
575 |
-
}
|
576 |
-
this._beforeFetchQuestion();
|
577 |
-
this.model.select(id, this._loadQuestionCompleted, {delayTime: delayTime});
|
578 |
-
}
|
579 |
-
},
|
580 |
-
_beforeFetchQuestion: function () {
|
581 |
-
windowTarget.LP.blockContent();
|
582 |
-
this.pause();
|
583 |
-
this.incrDelay(true);
|
584 |
-
this.model.current(true).set('response', this.$('.learn-press-content-item-summary'));
|
585 |
-
},
|
586 |
-
_loadQuestionCompleted: function (question, model) {
|
587 |
-
var loaded = model.get('loaded'),
|
588 |
-
$newElement = question.get('response'),
|
589 |
-
$oldElement = this.$('.learn-press-content-item-summary');
|
590 |
-
$newElement.show().insertAfter($oldElement);
|
591 |
-
$oldElement.detach();
|
592 |
-
if (this.model.get('show-list')) {
|
593 |
-
$newElement.find('.lp-group-heading-title').addClass('active');
|
594 |
-
$newElement.find('.lp-group-content-wrap').removeClass('hide-if-js');
|
595 |
-
}
|
596 |
-
this.updateButtons();
|
597 |
-
if (model.getCurrent('hasShowedHint') === 'yes') {
|
598 |
-
this.$('.button-hint').attr('disabled', true);
|
599 |
-
this.$('.question-hint-content').removeClass('hide-if-js');
|
600 |
-
} else {
|
601 |
-
this.$('.button-hint').attr('disabled', false);
|
602 |
-
this.$('.question-hint-content').addClass('hide-if-js');
|
603 |
-
}
|
604 |
-
this.start();
|
605 |
-
$(window).trigger('load');
|
606 |
-
$(document).trigger('resize');
|
607 |
-
windowTarget.LP.setUrl(question.get('url'));
|
608 |
-
windowTarget.LP.unblockContent();
|
609 |
-
},
|
610 |
-
_showHint: function (e) {
|
611 |
-
e.preventDefault();
|
612 |
-
this.model.current().set('hasShowedHint', 'yes');
|
613 |
-
this.$('.button-hint').attr('disabled', true);
|
614 |
-
this.$('.learn-press-question-hint').removeClass('hide-if-js');
|
615 |
-
},
|
616 |
-
_showHintCompleted: function (response) {
|
617 |
-
windowTarget.LP.unblockContent();
|
618 |
-
},
|
619 |
-
_checkAnswer: function (e) {
|
620 |
-
e.preventDefault();
|
621 |
-
var that = this,
|
622 |
-
$button = $(e.target),
|
623 |
-
security = $button.data('security');
|
624 |
-
windowTarget.LP.blockContent();
|
625 |
-
this.pause();
|
626 |
-
this.model.checkAnswer(this._checkAnswerCompleted, $button.data());
|
627 |
-
},
|
628 |
-
_checkAnswerCompleted: function (question) {
|
629 |
-
this.start();
|
630 |
-
this.$('.button-check-answer, .button-hint').hide();
|
631 |
-
windowTarget.LP.unblockContent();
|
632 |
-
},
|
633 |
-
updateButtons: function () {
|
634 |
-
if (this.model.get('status') === 'started') {
|
635 |
-
this.$('.button-prev-question').toggleClass('hide-if-js', this.model.isFirst());
|
636 |
-
this.$('.button-next-question').toggleClass('hide-if-js', this.model.isLast());
|
637 |
-
var current = this.model.current();
|
638 |
-
if (current) {
|
639 |
-
this.$('.button-check-answer').toggleClass('hide-if-js', current.get('hasCheckAnswer') !== 'yes');
|
640 |
-
this.$('.button-hint').toggleClass('hide-if-js', current.get('hasHint') !== 'yes');
|
641 |
-
}
|
642 |
-
}
|
643 |
-
},
|
644 |
-
start: function () {
|
645 |
-
if (this.model.get('status') != 'started' || this.model.get('totalTime') <= 0) {
|
646 |
-
return;
|
647 |
-
}
|
648 |
-
this.delayTimeout && clearTimeout(this.delayTimeout);
|
649 |
-
this._onTick();
|
650 |
-
},
|
651 |
-
pause: function () {
|
652 |
-
this.timeout && clearTimeout(this.timeout);
|
653 |
-
},
|
654 |
-
incrDelay: function (t) {
|
655 |
-
if (t) {
|
656 |
-
this.delayTime = 0;
|
657 |
-
}
|
658 |
-
this.delayTimeout && clearTimeout(this.delayTimeout);
|
659 |
-
this.delayTime++;
|
660 |
-
this.delayTimeout = setTimeout($.proxy(function () {
|
661 |
-
this.incrDelay();
|
662 |
-
}, this), 990);
|
663 |
-
},
|
664 |
-
updateCountdown: function () {
|
665 |
-
var totalTime = this.model.getTotalTime('dhms'),
|
666 |
-
remainingTime = this.model.getRemainingTime('dhms'),
|
667 |
-
strTime = [];
|
668 |
-
if (totalTime.d) {
|
669 |
-
strTime.push(this._addLeadingZero(remainingTime.d));
|
670 |
-
}
|
671 |
-
if (totalTime.h) {
|
672 |
-
strTime.push(this._addLeadingZero(remainingTime.h));
|
673 |
-
}
|
674 |
-
strTime.push(this._addLeadingZero(remainingTime.m));
|
675 |
-
strTime.push(this._addLeadingZero(remainingTime.s));
|
676 |
-
var t = parseInt(this.model.get('remainingTime') / this.model.get('totalTime') * 100);// * 360;
|
677 |
-
this.$('.quiz-countdown').attr('data-value', t).attr('data-' + this.model.get('id'), 100).toggleClass('warning-time-over', t < 10).find('.countdown').html(strTime.join(':'));
|
678 |
-
},
|
679 |
-
itemUrl: function (url, item) {
|
680 |
-
if (item.get('id') == this.model.get('id')) {
|
681 |
-
var questionName = this.model.getCurrent('name'), reg;
|
682 |
-
if (questionName && this.model.get('status') !== 'completed') {
|
683 |
-
reg = new RegExp('!' + questionName + '/?$!', '');
|
684 |
-
if (!url.match(reg)) {
|
685 |
-
url = url.replace(/\/$/, '') + '/' + questionName + '/';
|
686 |
-
}
|
687 |
-
}
|
688 |
-
|
689 |
-
}
|
690 |
-
return url;
|
691 |
-
},
|
692 |
-
destroy: function () {
|
693 |
-
this.pause();
|
694 |
-
LP.Hook.removeAction('learn_press_before_finish_quiz');
|
695 |
-
LP.Hook.removeFilter('learn_press_get_current_item_url');
|
696 |
-
},
|
697 |
-
/********************************/
|
698 |
-
_submit: function (args) {
|
699 |
-
var data = {};
|
700 |
-
data = this.model.getQuizData(data);
|
701 |
-
|
702 |
-
args = $.extend({
|
703 |
-
security: '',
|
704 |
-
action: ''
|
705 |
-
}, args || {});
|
706 |
-
windowTarget.LP.blockContent();
|
707 |
-
LP.Hook.doAction('learn_press_before_start_quiz', this.currentItem, this);
|
708 |
-
var $form = this.$('form.quiz-buttons');
|
709 |
-
var qlenght = this.model.questions.length;
|
710 |
-
this.model.questions.forEach(function (m) {
|
711 |
-
var $content = m.get('response');
|
712 |
-
if (!$content) {
|
713 |
-
return;
|
714 |
-
}
|
715 |
-
var $question = '';
|
716 |
-
if (qlenght === 1) {
|
717 |
-
var $question = jQuery('#' + $content.attr('id') + ' .quiz-question-content').clone().hide();
|
718 |
-
} else {
|
719 |
-
var $question = $content.find('.quiz-question-content').clone().hide();
|
720 |
-
}
|
721 |
-
$form.append($question);
|
722 |
-
});
|
723 |
-
$form.find('input[name="security"]').val(args.security);
|
724 |
-
$form.find('input[name="lp-ajax"]').val(args.action);
|
725 |
-
var extraArgs = _.omit(args, ['security', 'action']);
|
726 |
-
_.forEach(extraArgs, function (v, k) {
|
727 |
-
$form.append('<input type="hidden" name="' + k + '" value="' + v + '" />');
|
728 |
-
});
|
729 |
-
$form.submit();
|
730 |
-
},
|
731 |
-
_confirm: function (localize, onYes, onNo) {
|
732 |
-
var that = this,
|
733 |
-
loc = this.localized[localize] || {},
|
734 |
-
message = loc.message || '',
|
735 |
-
title = loc.title || '';
|
736 |
-
windowTarget.jConfirm(message, title, function (confirm) {
|
737 |
-
if (confirm && $.isFunction(onYes)) {
|
738 |
-
onYes.call(that);
|
739 |
-
} else if ($.isFunction(onNo)) {
|
740 |
-
onNo.call(that);
|
741 |
-
}
|
742 |
-
});
|
743 |
-
},
|
744 |
-
_startQuiz: function (e) {
|
745 |
-
var that = this,
|
746 |
-
$button = $(e.target);
|
747 |
-
windowTarget.LP.Hook.doAction('learn_press_before_start_quiz', this);
|
748 |
-
this._submit($button.data());
|
749 |
-
return false;
|
750 |
-
},
|
751 |
-
_finishQuiz: function (e) {
|
752 |
-
var that = this,
|
753 |
-
$button = $(e.target);
|
754 |
-
e.preventDefault();
|
755 |
-
if (typeof e.originalEvent === 'undefined') {
|
756 |
-
windowTarget.LP.Hook.doAction('learn_press_before_finish_quiz', this);
|
757 |
-
that._submit($.extend($button.data(), {auto_finish: 'yes'}));
|
758 |
-
} else {
|
759 |
-
this._confirm('confirm_finish_quiz', function () {
|
760 |
-
windowTarget.LP.Hook.doAction('learn_press_before_finish_quiz', this);
|
761 |
-
that._submit($button.data());
|
762 |
-
});
|
763 |
-
}
|
764 |
-
return false;
|
765 |
-
},
|
766 |
-
_doFinishQuiz: function (security) {
|
767 |
-
var that = this;
|
768 |
-
LP.Hook.doAction('learn_press_before_finish_quiz', that.currentItem, that);
|
769 |
-
that.finishQuiz({
|
770 |
-
security: security,
|
771 |
-
beforeSend: windowTarget.LP.blockContent(),
|
772 |
-
callback: function (response, item) {
|
773 |
-
windowTarget.LP.unblockContent();
|
774 |
-
that.$('#learn-press-content-item').html(response.html.content);
|
775 |
-
windowTarget.LP.setUrl(that.model.get('permalink'));
|
776 |
-
var data = response.course_result;
|
777 |
-
data.messageType = 'update-course';
|
778 |
-
LP.sendMessage(data, windowTarget);
|
779 |
-
}
|
780 |
-
});
|
781 |
-
},
|
782 |
-
_retakeQuiz: function (e) {
|
783 |
-
e.preventDefault();
|
784 |
-
var that = this,
|
785 |
-
$button = $(e.target);
|
786 |
-
this._confirm('confirm_retake_quiz', function () {
|
787 |
-
LP.Hook.doAction('learn_press_before_retake_quiz', this);
|
788 |
-
that._submit($button.data());
|
789 |
-
});
|
790 |
-
return false;
|
791 |
-
},
|
792 |
-
|
793 |
-
complete: function (args) {
|
794 |
-
var that = this;
|
795 |
-
args = $.extend({
|
796 |
-
context: null,
|
797 |
-
callback: null,
|
798 |
-
format: 'json'
|
799 |
-
}, this.toJSON(), args || {});
|
800 |
-
var data = {};
|
801 |
-
|
802 |
-
// Omit unwanted fields
|
803 |
-
_.forEach(args, function (v, k) {
|
804 |
-
if (($.inArray(k, ['content', 'current', 'title', 'url']) == -1) && !$.isFunction(v)) {
|
805 |
-
data[k] = v;
|
806 |
-
}
|
807 |
-
;
|
808 |
-
});
|
809 |
-
LP.ajax({
|
810 |
-
url: this.get('url'),
|
811 |
-
action: 'complete-item',
|
812 |
-
data: data,
|
813 |
-
dataType: 'json',
|
814 |
-
success: function (response) {
|
815 |
-
///response = LP.parseJSON(response);
|
816 |
-
LP.Hook.doAction('learn_press_course_item_completed', response, that);
|
817 |
-
response = LP.Hook.applyFilters('learn_press_course_item_complete_response', response, that);
|
818 |
-
$.isFunction(args.callback) && args.callback.call(args.context, response, that);
|
819 |
-
}
|
820 |
-
});
|
821 |
-
},
|
822 |
-
startQuiz: function (args) {
|
823 |
-
var args = $.extend({
|
824 |
-
course_id: this.model.get('courseId'),
|
825 |
-
quiz_id: this.model.get('id'),
|
826 |
-
security: null
|
827 |
-
}, args || {});
|
828 |
-
var data = this._validateObject(args), that = this;
|
829 |
-
LP.ajax({
|
830 |
-
url: this.model.get('url'),
|
831 |
-
action: 'start-quiz',
|
832 |
-
data: data,
|
833 |
-
dataType: 'json',
|
834 |
-
success: function (response) {
|
835 |
-
$.isFunction(args.callback) && args.callback.call(args.context, response, that);
|
836 |
-
}
|
837 |
-
});
|
838 |
-
},
|
839 |
-
finishQuiz: function (args) {
|
840 |
-
var args = $.extend({
|
841 |
-
course_id: this.model.get('courseId'),
|
842 |
-
quiz_id: this.model.get('id'),
|
843 |
-
security: null
|
844 |
-
}, args || {});
|
845 |
-
var data = this._validateObject(args), that = this;
|
846 |
-
data = LP.Hook.applyFilters('learn_press_finish_quiz_data', data);
|
847 |
-
var beforeSend = args.beforeSend || function () {
|
848 |
-
};
|
849 |
-
LP.ajax({
|
850 |
-
url: this.model.get('url'),
|
851 |
-
action: 'finish-quiz',
|
852 |
-
data: data,
|
853 |
-
dataType: 'json',
|
854 |
-
beforeSend: beforeSend,
|
855 |
-
success: function (response) {
|
856 |
-
windowTarget.LP.unblockContent();
|
857 |
-
$.isFunction(args.callback) && args.callback.call(args.context, response, that);
|
858 |
-
}
|
859 |
-
});
|
860 |
-
},
|
861 |
-
retakeQuiz: function (args) {
|
862 |
-
var args = $.extend({
|
863 |
-
course_id: this.model.get('courseId'),
|
864 |
-
quiz_id: this.model.get('id'),
|
865 |
-
security: null
|
866 |
-
}, args || {});
|
867 |
-
var data = this._validateObject(args), that = this;
|
868 |
-
LP.ajax({
|
869 |
-
url: this.model.get('url'),
|
870 |
-
action: 'retake-quiz',
|
871 |
-
data: data,
|
872 |
-
dataType: 'json',
|
873 |
-
beforeSend: function () {
|
874 |
-
windowTarget.LP.blockContent();
|
875 |
-
},
|
876 |
-
success: function (response) {
|
877 |
-
windowTarget.LP.unblockContent();
|
878 |
-
$.isFunction(args.callback) && args.callback.call(args.context, response, that);
|
879 |
-
}
|
880 |
-
});
|
881 |
-
},
|
882 |
-
_click_nav_link: function (e) {
|
883 |
-
e.preventDefault();
|
884 |
-
var $button = $(e.target);
|
885 |
-
var lesson_id = '';
|
886 |
-
if ($button.prop("tagName").toLowerCase() != 'a') {
|
887 |
-
lesson_id = $button.parent().attr('data-id');
|
888 |
-
} else {
|
889 |
-
lesson_id = $($button).attr('data-id');
|
890 |
-
}
|
891 |
-
$(windowTarget.document).find('.course-item.course-item-' + lesson_id + '.viewable').trigger('click');
|
892 |
-
},
|
893 |
-
_toJSON: function () {
|
894 |
-
// call parent method
|
895 |
-
var json = Course_Item.__super__.toJSON.apply(this, arguments);
|
896 |
-
},
|
897 |
-
_validateObject: function (obj) {
|
898 |
-
var ret = {};
|
899 |
-
for (var i in obj) {
|
900 |
-
if (!$.isFunction(obj[i])) {
|
901 |
-
ret[i] = obj[i];
|
902 |
-
}
|
903 |
-
}
|
904 |
-
return ret;
|
905 |
-
}
|
906 |
-
});
|
907 |
-
|
908 |
-
window.LP_Quiz = Quiz;
|
909 |
-
$(document).ready(function () {
|
910 |
-
if (typeof LP_Quiz_Params != 'undefined') {
|
911 |
-
window.$LP_Quiz = new LP_Quiz($.extend({course: LP.$LP_Course}, LP_Quiz_Params));
|
912 |
-
}
|
913 |
-
windowTarget.LP.unblockContent();
|
914 |
-
});
|
915 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/frontend/utils.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 13);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 13:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
var _utils = __webpack_require__(13);
|
75 |
+
|
76 |
+
var utils = _interopRequireWildcard(_utils);
|
77 |
+
|
78 |
+
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; } }
|
79 |
+
|
80 |
+
/***/ })
|
81 |
+
|
82 |
+
/******/ });
|
83 |
+
//# sourceMappingURL=utils.js.map
|
assets/js/frontend/utils.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(r){function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:n})},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},t.p="",t(t.s=13)}({13:function(r,t,e){"use strict";var n=e(13);!function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);t.default=r}(n)}});
|
assets/js/global.js
CHANGED
@@ -1,1069 +1,709 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
* Manage event callbacks.
|
12 |
-
* Allow add/remove a callback function into custom event of an object.
|
13 |
-
*
|
14 |
-
* @constructor
|
15 |
-
*/
|
16 |
-
window.LP.Event_Callback = function (self) {
|
17 |
-
var callbacks = {};
|
18 |
|
19 |
-
|
20 |
-
var namespaces = event.split('.'),
|
21 |
-
namespace = '';
|
22 |
|
23 |
-
if (namespaces.length > 1) {
|
24 |
-
event = namespaces[0];
|
25 |
-
namespace = namespaces[1];
|
26 |
-
}
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
} else {
|
38 |
-
callbacks[event][0].push(callback);
|
39 |
-
}
|
40 |
|
41 |
-
|
42 |
-
};
|
43 |
|
44 |
-
|
45 |
-
var namespaces = event.split('.'),
|
46 |
-
namespace = '';
|
47 |
|
48 |
-
|
49 |
-
event = namespaces[0];
|
50 |
-
namespace = namespaces[1];
|
51 |
-
}
|
52 |
|
53 |
-
|
54 |
-
return self;
|
55 |
-
}
|
56 |
-
var at = -1;
|
57 |
-
if (!namespace) {
|
58 |
-
if ($.isFunction(callback)) {
|
59 |
-
at = callbacks[event][0].indexOf(callback);
|
60 |
-
if (at < 0) {
|
61 |
-
return self;
|
62 |
-
}
|
63 |
-
callbacks[event][0].splice(at, 1);
|
64 |
-
} else {
|
65 |
-
callbacks[event][0] = [];
|
66 |
-
}
|
67 |
-
} else {
|
68 |
-
if (!callbacks[event][1][namespace]) {
|
69 |
-
return self;
|
70 |
-
}
|
71 |
|
72 |
-
|
73 |
-
at = callbacks[event][1][namespace].indexOf(callback);
|
74 |
-
if (at < 0) {
|
75 |
-
return self;
|
76 |
-
}
|
77 |
-
callbacks[event][1][namespace].splice(at, 1);
|
78 |
-
} else {
|
79 |
-
callbacks[event][1][namespace] = [];
|
80 |
-
}
|
81 |
-
}
|
82 |
|
83 |
-
|
84 |
-
};
|
85 |
|
86 |
-
|
87 |
-
if (!callbacks[event]) {
|
88 |
-
return;
|
89 |
-
}
|
90 |
|
91 |
-
|
92 |
-
for (var i = 0; i < callbacks[event][0].length; i++) {
|
93 |
-
$.isFunction(callbacks[event][0][i]) && callbacks[event][i][0].apply(self, callbackArgs);
|
94 |
-
}
|
95 |
-
}
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
}
|
104 |
}
|
|
|
105 |
};
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
$.each(keys, function (i, prop) {
|
128 |
-
prop = prop.replace(/\]|\[/g, '');
|
129 |
-
var rawPath = objPath.replace(/'|\[|\]/g, ''),
|
130 |
-
objExp = '',
|
131 |
-
preObjPath = objPath;
|
132 |
-
|
133 |
-
if (prop == '') {
|
134 |
-
if (arrayKeys[rawPath] == undefined) {
|
135 |
-
arrayKeys[rawPath] = 0;
|
136 |
-
} else {
|
137 |
-
arrayKeys[rawPath]++;
|
138 |
-
}
|
139 |
-
objPath += "['" + arrayKeys[rawPath] + "']";
|
140 |
-
} else {
|
141 |
-
if (!isNaN(prop)) {
|
142 |
-
arrayKeys[rawPath] = prop;
|
143 |
-
}
|
144 |
-
objPath += "['" + prop + "']";
|
145 |
-
}
|
146 |
-
try {
|
147 |
-
if (i == keys.length - 1) {
|
148 |
-
objExp = objPath + "=that.value;";
|
149 |
-
end = true;
|
150 |
-
} else {
|
151 |
-
objExp = objPath + "={}";
|
152 |
-
end = false;
|
153 |
-
}
|
154 |
-
|
155 |
-
var evalString = "" +
|
156 |
-
"if( typeof " + objPath + " == 'undefined'){" + objExp + ";" +
|
157 |
-
"}else{" +
|
158 |
-
"if(end){" +
|
159 |
-
"if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" +
|
160 |
-
objExp +
|
161 |
-
"}" +
|
162 |
-
"}";
|
163 |
-
eval(evalString);
|
164 |
-
} catch (e) {
|
165 |
-
console.log('Error:' + e + "\n" + objExp);
|
166 |
-
}
|
167 |
-
})
|
168 |
} else {
|
169 |
-
|
170 |
}
|
171 |
});
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
if ((url.indexOf('&' + name + '=') != -1) || (url.indexOf('?' + name + '=') != -1)) {
|
258 |
-
url = url.replace(new RegExp(name + "=([^&#]*)", 'g'), name + '=' + value);
|
259 |
-
} else {
|
260 |
-
url += url.match(/\?/) ? '&' : '?';
|
261 |
-
url += name + '=' + value;
|
262 |
-
}
|
263 |
-
}
|
264 |
-
return url + (m[1] ? '#' + m[1] : '');
|
265 |
-
};
|
266 |
-
String.prototype.removeQueryVar = function (name) {
|
267 |
-
var url = this;
|
268 |
-
var m = url.split('#');
|
269 |
-
url = m[0];
|
270 |
-
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
271 |
-
var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
|
272 |
-
url = url.replace(regex, '');
|
273 |
-
return url + (m[1] ? '#' + m[1] : '');
|
274 |
-
};
|
275 |
-
|
276 |
-
if ($.isEmptyObject("") == false) {
|
277 |
-
$.isEmptyObject = function (a) {
|
278 |
-
for (prop in a) {
|
279 |
-
if (a.hasOwnProperty(prop)) {
|
280 |
-
return false;
|
281 |
-
}
|
282 |
-
}
|
283 |
-
return true;
|
284 |
-
};
|
285 |
-
}
|
286 |
-
|
287 |
-
LP.MessageBox = {
|
288 |
-
/*
|
289 |
-
*
|
290 |
-
*/
|
291 |
-
$block : null,
|
292 |
-
$window : null,
|
293 |
-
events : {},
|
294 |
-
instances : [],
|
295 |
-
instance : null,
|
296 |
-
quickConfirm : function (elem, args) {
|
297 |
-
var $e = $(elem);
|
298 |
-
$('[learn-press-quick-confirm]').each(function () {
|
299 |
-
( $ins = $(this).data('quick-confirm') ) && ( console.log($ins), $ins.destroy() );
|
300 |
-
});
|
301 |
-
!$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm',
|
302 |
-
new (function (elem, args) {
|
303 |
-
var $elem = $(elem),
|
304 |
-
$div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem), //($(document.body)),
|
305 |
-
offset = $(elem).position() || {left: 0, top: 0},
|
306 |
-
timerOut = null,
|
307 |
-
timerHide = null,
|
308 |
-
n = 3,
|
309 |
-
hide = function () {
|
310 |
-
$div.fadeOut('fast', function () {
|
311 |
-
$(this).remove();
|
312 |
-
$div.parent().css('position', '');
|
313 |
-
});
|
314 |
-
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
315 |
-
stop();
|
316 |
-
},
|
317 |
-
stop = function () {
|
318 |
-
timerHide && clearInterval(timerHide);
|
319 |
-
timerOut && clearInterval(timerOut);
|
320 |
-
},
|
321 |
-
start = function () {
|
322 |
-
timerOut = setInterval(function () {
|
323 |
-
if (--n == 0) {
|
324 |
-
hide.call($div[0]);
|
325 |
-
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
326 |
-
stop();
|
327 |
-
}
|
328 |
-
$div.find('span').html(' (' + n + ')');
|
329 |
-
}, 1000);
|
330 |
-
|
331 |
-
timerHide = setInterval(function () {
|
332 |
-
if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') {
|
333 |
-
stop();
|
334 |
-
$div.remove();
|
335 |
-
$div.parent().css('position', '');
|
336 |
-
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
337 |
-
}
|
338 |
-
}, 350);
|
339 |
-
};
|
340 |
-
args = $.extend({
|
341 |
-
message : '',
|
342 |
-
data : null,
|
343 |
-
onOk : null,
|
344 |
-
onCancel: null,
|
345 |
-
offset : {top: 0, left: 0}
|
346 |
-
}, args || {});
|
347 |
-
$div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append('<span> (' + n + ')</span>').css({});
|
348 |
-
$div.click(function () {
|
349 |
-
$.isFunction(args.onOk) && args.onOk(args.data);
|
350 |
-
hide();
|
351 |
-
}).hover(function () {
|
352 |
-
stop();
|
353 |
-
}, function () {
|
354 |
-
start();
|
355 |
-
});
|
356 |
-
//$div.parent().css('position', 'relative');
|
357 |
-
$div.css({
|
358 |
-
left: ( ( offset.left + $elem.outerWidth() ) - $div.outerWidth() ) + args.offset.left,
|
359 |
-
top : offset.top + $elem.outerHeight() + args.offset.top + 5
|
360 |
-
}).hide().fadeIn('fast');
|
361 |
-
start();
|
362 |
-
|
363 |
-
this.destroy = function () {
|
364 |
-
$div.remove();
|
365 |
-
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
366 |
-
stop();
|
367 |
|
368 |
-
|
369 |
-
|
370 |
-
);
|
371 |
-
|
372 |
-
|
373 |
-
//this.hide();
|
374 |
-
$.proxy(function () {
|
375 |
-
args = $.extend({
|
376 |
-
title: '',
|
377 |
-
buttons: '',
|
378 |
-
events: false,
|
379 |
-
autohide: false,
|
380 |
-
message: message,
|
381 |
-
data: false,
|
382 |
-
id: LP.uniqueId(),
|
383 |
-
onHide: null
|
384 |
-
}, args || {});
|
385 |
-
|
386 |
-
this.instances.push(args);
|
387 |
-
this.instance = args;
|
388 |
-
|
389 |
-
var $doc = $(document),
|
390 |
-
$body = $(document.body);
|
391 |
-
if (!this.$block) {
|
392 |
-
this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body);
|
393 |
|
394 |
-
|
395 |
-
|
396 |
-
this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
|
397 |
-
this.$window.click(function () {
|
398 |
-
});
|
399 |
-
}
|
400 |
-
//this.events = args.events || {};
|
401 |
-
this._createWindow(message, args.title, args.buttons);
|
402 |
-
this.$block.show();
|
403 |
-
this.$window.show().attr('instance', args.id);
|
404 |
-
$(window)
|
405 |
-
.bind('resize.message-box', $.proxy(this.update, this))
|
406 |
-
.bind('scroll.message-box', $.proxy(this.update, this));
|
407 |
-
this.update(true);
|
408 |
-
if (args.autohide) {
|
409 |
-
setTimeout(function () {
|
410 |
-
LP.MessageBox.hide();
|
411 |
-
$.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args);
|
412 |
-
}, args.autohide);
|
413 |
-
}
|
414 |
-
}, this)();
|
415 |
-
},
|
416 |
-
blockUI: function (message) {
|
417 |
-
|
418 |
-
message = (message !== false ? (message ? message : 'Wait a moment') : '') + '<div class="message-box-animation"></div>';
|
419 |
-
this.show(message);
|
420 |
-
},
|
421 |
-
hide: function (delay, instance) {
|
422 |
-
if (instance) {
|
423 |
-
this._removeInstance(instance.id);
|
424 |
-
} else if (this.instance) {
|
425 |
-
this._removeInstance(this.instance.id);
|
426 |
-
}
|
427 |
-
if (this.instances.length === 0) {
|
428 |
-
if (this.$block) {
|
429 |
-
this.$block.hide();
|
430 |
-
}
|
431 |
-
if (this.$window) {
|
432 |
-
this.$window.hide();
|
433 |
-
}
|
434 |
-
$(window)
|
435 |
-
.unbind('resize.message-box', this.update)
|
436 |
-
.unbind('scroll.message-box', this.update);
|
437 |
} else {
|
438 |
-
|
439 |
-
this._createWindow(this.instance.message, this.instance.title, this.instance.buttons);
|
440 |
-
}
|
441 |
}
|
|
|
442 |
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
} else {
|
462 |
-
$content.css("height", "").css('overflow', '');
|
463 |
-
}
|
464 |
-
$wrap.css({
|
465 |
-
marginTop: ($(window).height() - height) / 2
|
466 |
-
});
|
467 |
-
LP.Hook.doAction('learn_press_message_box_resize', height, that);
|
468 |
-
};
|
469 |
-
if (force) _update();
|
470 |
-
timer && clearTimeout(timer);
|
471 |
-
timer = setTimeout(_update, 250);
|
472 |
-
},
|
473 |
-
_removeInstance: function (id) {
|
474 |
-
for (var i = 0; i < this.instances.length; i++) {
|
475 |
-
if (this.instances[i].id === id) {
|
476 |
-
|
477 |
-
this.instances.splice(i, 1);
|
478 |
-
|
479 |
-
var len = this.instances.length;
|
480 |
-
if (len) {
|
481 |
-
this.instance = this.instances[len - 1];
|
482 |
-
this.$window.attr('instance', this.instance.id);
|
483 |
-
} else {
|
484 |
-
this.instance = false;
|
485 |
-
this.$window.removeAttr('instance');
|
486 |
-
}
|
487 |
-
break;
|
488 |
-
}
|
489 |
-
}
|
490 |
-
},
|
491 |
-
_getInstance: function (id) {
|
492 |
-
for (var i = 0; i < this.instances.length; i++) {
|
493 |
-
if (this.instances[i].id === id) {
|
494 |
-
return this.instances[i];
|
495 |
-
}
|
496 |
-
}
|
497 |
-
},
|
498 |
-
_createWindow: function (message, title, buttons) {
|
499 |
-
var $wrap = this.$window.find('#message-box-wrap').html('');
|
500 |
-
if (title) {
|
501 |
-
$wrap.append('<h3 class="message-box-title">' + title + '</h3>');
|
502 |
}
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
switch (buttons) {
|
507 |
-
case 'yesNo':
|
508 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes'));
|
509 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_no, 'no'));
|
510 |
-
break;
|
511 |
-
case 'okCancel':
|
512 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
513 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel'));
|
514 |
-
break;
|
515 |
-
default:
|
516 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
517 |
-
}
|
518 |
-
$wrap.append($buttons);
|
519 |
}
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
callback = instance.events[$(this).data('callback')];
|
527 |
-
if ($.type(callback) === 'function') {
|
528 |
-
if (callback.apply(LP.MessageBox, [instance]) === false) {
|
529 |
-
// return;
|
530 |
-
} else {
|
531 |
-
LP.MessageBox.hide(null, instance);
|
532 |
-
}
|
533 |
-
} else {
|
534 |
-
LP.MessageBox.hide(null, instance);
|
535 |
-
}
|
536 |
-
}).data('instance', this.instance);
|
537 |
-
return $button;
|
538 |
}
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
}
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
}
|
569 |
-
|
570 |
-
|
571 |
-
tag = action + '_' + hooks.length;
|
572 |
}
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
if (typeof hook !== 'function')
|
590 |
-
hook = window[hook];
|
591 |
-
if ('action' === hookType) {
|
592 |
-
hook.apply(null, args);
|
593 |
-
} else {
|
594 |
-
args[0] = hook.apply(null, args);
|
595 |
-
}
|
596 |
-
}
|
597 |
}
|
598 |
-
if ('
|
599 |
-
|
600 |
}
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
611 |
}
|
612 |
-
return this;
|
613 |
}
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
}
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
if (isHide) {
|
626 |
-
$el.hide().removeClass('hide-if-js');
|
627 |
}
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
} else {
|
633 |
-
$(
|
634 |
}
|
|
|
635 |
});
|
636 |
-
}
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
$el.css('overflow', v).data('overflow', overflow);
|
642 |
} else {
|
643 |
-
|
644 |
-
}
|
645 |
-
},
|
646 |
-
getUrl: function () {
|
647 |
-
return window.location.href;
|
648 |
-
},
|
649 |
-
addQueryVar: function (name, value, url) {
|
650 |
-
return (url === undefined ? window.location.href : url).addQueryVar(name, value);
|
651 |
-
},
|
652 |
-
removeQueryVar: function (name, url) {
|
653 |
-
return (url === undefined ? window.location.href : url).removeQueryVar(name);
|
654 |
-
},
|
655 |
-
reload: function (url) {
|
656 |
-
if (!url) {
|
657 |
-
url = window.location.href;
|
658 |
}
|
659 |
-
|
660 |
-
|
661 |
|
662 |
-
|
663 |
-
var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
664 |
-
if (m) {
|
665 |
-
response = m[1];
|
666 |
-
}
|
667 |
-
return (type || "json") === "json" ? this.parseJSON(response) : response;
|
668 |
-
},
|
669 |
-
parseJSON: function (data) {
|
670 |
-
var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
671 |
-
try {
|
672 |
-
if (m) {
|
673 |
-
data = $.parseJSON(m[1]);
|
674 |
-
} else {
|
675 |
-
data = $.parseJSON(data);
|
676 |
-
}
|
677 |
-
} catch (e) {
|
678 |
-
data = {};
|
679 |
-
}
|
680 |
-
return data;
|
681 |
-
},
|
682 |
-
ajax: function (args) {
|
683 |
-
var type = args.type || 'post',
|
684 |
-
dataType = args.dataType || 'json',
|
685 |
-
data = args.action ? $.extend(args.data, {'lp-ajax': args.action}) : args.data,
|
686 |
-
beforeSend = args.beforeSend || function () {
|
687 |
-
},
|
688 |
-
url = args.url || window.location.href;
|
689 |
-
// console.debug( beforeSend );
|
690 |
-
$.ajax({
|
691 |
-
data: data,
|
692 |
-
url: url,
|
693 |
-
type: type,
|
694 |
-
dataType: 'html',
|
695 |
-
beforeSend: beforeSend.apply(null, args),
|
696 |
-
success: function (raw) {
|
697 |
-
var response = LP.parseResponse(raw, dataType);
|
698 |
-
$.isFunction(args.success) && args.success(response, raw);
|
699 |
-
},
|
700 |
-
error: function () {
|
701 |
-
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
702 |
-
}
|
703 |
-
});
|
704 |
-
},
|
705 |
-
doAjax: function (args) {
|
706 |
-
var type = args.type || 'post',
|
707 |
-
dataType = args.dataType || 'json',
|
708 |
-
action = ((args.prefix === undefined) || 'learnpress_') + args.action,
|
709 |
-
data = args.action ? $.extend(args.data, {action: action}) : args.data;
|
710 |
-
|
711 |
-
$.ajax({
|
712 |
-
data: data,
|
713 |
-
url: (args.url || window.location.href),
|
714 |
-
type: type,
|
715 |
-
dataType: 'html',
|
716 |
-
success: function (raw) {
|
717 |
-
var response = LP.parseResponse(raw, dataType);
|
718 |
-
$.isFunction(args.success) && args.success(response, raw);
|
719 |
-
},
|
720 |
-
error: function () {
|
721 |
-
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
722 |
-
}
|
723 |
-
});
|
724 |
-
},
|
725 |
|
726 |
-
|
727 |
-
var arr = [];
|
728 |
-
for (var i = 0; i < args.length; i++) {
|
729 |
-
arr.push(args[i]);
|
730 |
-
}
|
731 |
-
return arr;
|
732 |
-
},
|
733 |
-
addFilter: function (action, callback) {
|
734 |
-
var $doc = $(document),
|
735 |
-
event = 'LP.' + action;
|
736 |
-
$doc.on(event, callback);
|
737 |
-
LP.log($doc.data('events'));
|
738 |
-
return this;
|
739 |
-
},
|
740 |
-
applyFilters: function () {
|
741 |
-
var $doc = $(document),
|
742 |
-
action = arguments[0],
|
743 |
-
args = this.funcArgs2Array(arguments);
|
744 |
-
if ($doc.hasEvent(action)) {
|
745 |
-
args[0] = 'LP.' + action;
|
746 |
-
return $doc.triggerHandler.apply($doc, args);
|
747 |
-
}
|
748 |
-
return args[1];
|
749 |
-
},
|
750 |
-
addAction: function (action, callback) {
|
751 |
-
return this.addFilter(action, callback);
|
752 |
-
},
|
753 |
-
doAction: function () {
|
754 |
-
var $doc = $(document),
|
755 |
-
action = arguments[0],
|
756 |
-
args = this.funcArgs2Array(arguments);
|
757 |
-
if ($doc.hasEvent(action)) {
|
758 |
-
args[0] = 'LP.' + action;
|
759 |
-
$doc.trigger.apply($doc, args);
|
760 |
-
}
|
761 |
-
},
|
762 |
-
toElement: function (element, args) {
|
763 |
-
if ($(element).length === 0) {
|
764 |
-
return;
|
765 |
-
}
|
766 |
-
args = $.extend({
|
767 |
-
delay: 300,
|
768 |
-
duration: 'slow',
|
769 |
-
offset: 50,
|
770 |
-
container: null,
|
771 |
-
callback: null,
|
772 |
-
invisible: false
|
773 |
-
}, args || {});
|
774 |
-
var $container = $(args.container),
|
775 |
-
rootTop = 0;
|
776 |
-
if ($container.length === 0) {
|
777 |
-
$container = $('body, html');
|
778 |
-
}
|
779 |
-
rootTop = $container.offset().top;
|
780 |
-
var to = ($(element).offset().top + $container.scrollTop()) - rootTop - args.offset;
|
781 |
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
|
|
|
|
|
|
|
|
787 |
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
}
|
793 |
-
}
|
794 |
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
.delay(args.delay)
|
800 |
-
.animate({
|
801 |
-
scrollTop: to
|
802 |
-
}, args.duration, args.callback);
|
803 |
-
},
|
804 |
-
uniqueId: function (prefix, more_entropy) {
|
805 |
-
if (typeof prefix === 'undefined') {
|
806 |
-
prefix = '';
|
807 |
-
}
|
808 |
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
if (reqWidth < seed.length) { // so long we split
|
814 |
-
return seed.slice(seed.length - reqWidth);
|
815 |
-
}
|
816 |
-
if (reqWidth > seed.length) { // so short we pad
|
817 |
-
return new Array(1 + (reqWidth - seed.length))
|
818 |
-
.join('0') + seed;
|
819 |
-
}
|
820 |
-
return seed;
|
821 |
-
};
|
822 |
|
823 |
-
|
824 |
-
if (!this.php_js) {
|
825 |
-
this.php_js = {};
|
826 |
-
}
|
827 |
-
// END REDUNDANT
|
828 |
-
if (!this.php_js.uniqidSeed) { // init seed with big random int
|
829 |
-
this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
|
830 |
-
}
|
831 |
-
this.php_js.uniqidSeed++;
|
832 |
-
|
833 |
-
retId = prefix; // start with prefix, add current milliseconds hex string
|
834 |
-
retId += formatSeed(parseInt(new Date()
|
835 |
-
.getTime() / 1000, 10), 8);
|
836 |
-
retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
|
837 |
-
if (more_entropy) {
|
838 |
-
// for more entropy we add a float lower to 10
|
839 |
-
retId += (Math.random() * 10)
|
840 |
-
.toFixed(8)
|
841 |
-
.toString();
|
842 |
-
}
|
843 |
|
844 |
-
|
845 |
-
|
846 |
-
log: function () {
|
847 |
-
//if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
|
848 |
-
for (var i = 0, n = arguments.length; i < n; i++) {
|
849 |
-
console.log(arguments[i]);
|
850 |
-
}
|
851 |
-
//}
|
852 |
-
},
|
853 |
-
blockContent: function () {
|
854 |
-
if ($('#learn-press-block-content').length === 0) {
|
855 |
-
$(LP.template('learn-press-template-block-content', {})).appendTo($('body'));
|
856 |
-
}
|
857 |
-
LP.hideMainScrollbar().addClass('block-content');
|
858 |
-
$(document).trigger('learn_press_block_content');
|
859 |
-
},
|
860 |
-
unblockContent: function () {
|
861 |
-
setTimeout(function () {
|
862 |
-
LP.showMainScrollbar().removeClass('block-content');
|
863 |
-
$(document).trigger('learn_press_unblock_content');
|
864 |
-
}, 350);
|
865 |
-
},
|
866 |
-
hideMainScrollbar: function (el) {
|
867 |
-
if (!el) {
|
868 |
-
el = 'html, body';
|
869 |
-
}
|
870 |
-
var $el = $(el);
|
871 |
-
$el.each(function () {
|
872 |
-
var $root = $(this),
|
873 |
-
overflow = $root.css('overflow');
|
874 |
-
$root.css('overflow', 'hidden').attr('overflow', overflow);
|
875 |
-
});
|
876 |
-
return $el;
|
877 |
-
},
|
878 |
-
showMainScrollbar: function (el) {
|
879 |
-
if (!el) {
|
880 |
-
el = 'html, body';
|
881 |
-
}
|
882 |
-
var $el = $(el);
|
883 |
-
$el.each(function () {
|
884 |
-
var $root = $(this),
|
885 |
-
overflow = $root.attr('overflow');
|
886 |
-
$root.css('overflow', overflow).removeAttr('overflow');
|
887 |
-
});
|
888 |
-
return $el;
|
889 |
-
},
|
890 |
-
template: typeof _ !== 'undefined' ? _.memoize(function (id, data) {
|
891 |
-
var compiled,
|
892 |
-
options = {
|
893 |
-
evaluate: /<#([\s\S]+?)#>/g,
|
894 |
-
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
895 |
-
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
896 |
-
variable: 'data'
|
897 |
-
};
|
898 |
-
|
899 |
-
var tmpl = function (data) {
|
900 |
-
compiled = compiled || _.template($('#' + id).html(), null, options);
|
901 |
-
return compiled(data);
|
902 |
-
};
|
903 |
-
return data ? tmpl(data) : tmpl;
|
904 |
-
}, function (a, b) {
|
905 |
-
return a + '-' + JSON.stringify(b);
|
906 |
-
}) : function () {
|
907 |
-
return '';
|
908 |
-
},
|
909 |
-
alert: function (localize, callback) {
|
910 |
-
var title = '',
|
911 |
-
message = '';
|
912 |
-
if (typeof localize === 'string') {
|
913 |
-
message = localize;
|
914 |
-
} else {
|
915 |
-
if (typeof localize['title'] !== 'undefined') {
|
916 |
-
title = localize['title'];
|
917 |
-
}
|
918 |
-
if (typeof localize['message'] !== 'undefined') {
|
919 |
-
message = localize['message'];
|
920 |
-
}
|
921 |
-
}
|
922 |
-
$.alerts.alert(message, title, function (e) {
|
923 |
-
LP._on_alert_hide();
|
924 |
-
callback && callback(e);
|
925 |
-
});
|
926 |
-
this._on_alert_show();
|
927 |
-
},
|
928 |
-
confirm: function (localize, callback) {
|
929 |
-
var title = '',
|
930 |
-
message = '';
|
931 |
-
|
932 |
-
if (typeof localize === 'string') {
|
933 |
-
message = localize;
|
934 |
-
} else {
|
935 |
-
if (typeof localize['title'] !== 'undefined') {
|
936 |
-
title = localize['title'];
|
937 |
-
}
|
938 |
-
if (typeof localize['message'] !== 'undefined') {
|
939 |
-
message = localize['message'];
|
940 |
-
}
|
941 |
-
}
|
942 |
-
$.alerts.confirm(message, title, function (e) {
|
943 |
-
LP._on_alert_hide();
|
944 |
-
callback && callback(e);
|
945 |
-
});
|
946 |
-
this._on_alert_show();
|
947 |
-
|
948 |
-
},
|
949 |
-
_on_alert_show: function () {
|
950 |
-
var $container = $('#popup_container'),
|
951 |
-
$placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container);
|
952 |
-
$container.stop().css('top', '-=50').css('opacity', '0').animate({
|
953 |
-
top: '+=50',
|
954 |
-
opacity: 1
|
955 |
-
}, 250);
|
956 |
-
},
|
957 |
-
_on_alert_hide: function () {
|
958 |
-
var $holder = $("#popup_container_placeholder"),
|
959 |
-
$container = $holder.data('xxx');
|
960 |
-
if ($container) {
|
961 |
-
$container.replaceWith($holder);
|
962 |
-
}
|
963 |
-
$container.appendTo($(document.body))
|
964 |
-
$container.stop().animate({
|
965 |
-
top: '+=50',
|
966 |
-
opacity: 0
|
967 |
-
}, 250, function () {
|
968 |
-
$(this).remove();
|
969 |
-
});
|
970 |
-
},
|
971 |
-
sendMessage: function (data, object, targetOrigin, transfer) {
|
972 |
-
if ($.isPlainObject(data)) {
|
973 |
-
data = JSON.stringify(data);
|
974 |
-
}
|
975 |
-
object = object || window;
|
976 |
-
targetOrigin = targetOrigin || '*';
|
977 |
-
object.postMessage(data, targetOrigin, transfer);
|
978 |
-
},
|
979 |
-
receiveMessage: function (event, b) {
|
980 |
-
var target = event.origin || event.originalEvent.origin,
|
981 |
-
data = event.data || event.originalEvent.data || '';
|
982 |
-
if (typeof data === 'string' || data instanceof String) {
|
983 |
-
if (data.indexOf('{') === 0) {
|
984 |
-
data = LP.parseJSON(data);
|
985 |
-
}
|
986 |
-
}
|
987 |
-
LP.Hook.doAction('learn_press_receive_message', data, target);
|
988 |
-
}
|
989 |
-
}, LP);
|
990 |
|
991 |
-
|
992 |
-
var h = $(this).height();
|
993 |
-
var lh = $(this).css('line-height').replace("px", "");
|
994 |
-
$(this).attr({height: h, 'line-height': lh});
|
995 |
-
return Math.floor(h / parseInt(lh));
|
996 |
-
};
|
997 |
|
998 |
-
$.fn.checkLines = function (p) {
|
999 |
-
return this.each(function () {
|
1000 |
-
var $e = $(this),
|
1001 |
-
rows = $e.rows();
|
1002 |
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1006 |
|
1007 |
-
|
1008 |
-
|
1009 |
-
$root = this.first(),
|
1010 |
-
index = $selector.index($root),
|
1011 |
-
$next = $selector.eq(index + 1);
|
1012 |
-
return $next.length ? $next : false;
|
1013 |
-
};
|
1014 |
|
1015 |
-
|
1016 |
-
var $selector = $(selector),
|
1017 |
-
$root = this.first(),
|
1018 |
-
index = $selector.index($root),
|
1019 |
-
$prev = $selector.eq(index - 1);
|
1020 |
-
return $prev.length ? $prev : false;
|
1021 |
-
};
|
1022 |
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
if (tween.now < 180) {
|
1036 |
-
$(this).find('.progress-circle').removeClass('gt-50');
|
1037 |
-
} else {
|
1038 |
-
$(this).find('.progress-circle').addClass('gt-50');
|
1039 |
}
|
1040 |
-
$(tween.elem).find('.fill').css({
|
1041 |
-
transform: 'rotate(' + tween.end + 'deg)'
|
1042 |
-
});
|
1043 |
}
|
1044 |
-
};
|
1045 |
-
});
|
1046 |
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
|
|
|
|
1052 |
|
1053 |
-
|
1054 |
-
$this.find('.progress-circle').removeClass('gt-50');
|
1055 |
-
} else {
|
1056 |
-
$this.find('.progress-circle').addClass('gt-50');
|
1057 |
-
}
|
1058 |
-
$this.find('.fill').css({
|
1059 |
-
transform: 'rotate(' + t + 'deg)'
|
1060 |
-
});
|
1061 |
|
1062 |
-
|
1063 |
-
|
|
|
|
|
1064 |
|
1065 |
-
var xxx = 0;
|
1066 |
|
|
|
1067 |
function QuickTip(el, options) {
|
1068 |
var $el = $(el),
|
1069 |
uniId = $el.attr('data-id') || LP.uniqueId();
|
@@ -1088,7 +728,7 @@ if (typeof window.LP == 'undefined') {
|
|
1088 |
$content = $('#__' + uniId);
|
1089 |
|
1090 |
if ($content.length === 0) {
|
1091 |
-
$(document.body).append($('<div />').attr('id', '__' + uniId).html(content).css('display', 'none'))
|
1092 |
}
|
1093 |
|
1094 |
content = $content.html();
|
@@ -1107,7 +747,7 @@ if (typeof window.LP == 'undefined') {
|
|
1107 |
$tip.append('<a class="close"></a>');
|
1108 |
$tip.on('click', '.close', function () {
|
1109 |
close();
|
1110 |
-
})
|
1111 |
}
|
1112 |
|
1113 |
function show() {
|
@@ -1117,7 +757,7 @@ if (typeof window.LP == 'undefined') {
|
|
1117 |
}
|
1118 |
|
1119 |
if (options.single) {
|
1120 |
-
$('.learn-press-tip').not($el).
|
1121 |
}
|
1122 |
|
1123 |
$tip.appendTo(document.body);
|
@@ -1155,33 +795,30 @@ if (typeof window.LP == 'undefined') {
|
|
1155 |
$el.on('click', function (e) {
|
1156 |
e.stopPropagation();
|
1157 |
show();
|
1158 |
-
})
|
1159 |
}
|
1160 |
|
1161 |
$(document).on('learn-press/close-all-quick-tip', function () {
|
1162 |
close();
|
1163 |
});
|
1164 |
-
$el.hover(
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
if (options.autoClose) {
|
1174 |
-
hide();
|
1175 |
-
}
|
1176 |
}
|
1177 |
-
).addClass('ready');
|
1178 |
return {
|
1179 |
close: close,
|
1180 |
open: open
|
1181 |
-
}
|
1182 |
}
|
1183 |
|
1184 |
-
$.fn.QuickTip
|
1185 |
return $.each(this, function () {
|
1186 |
var $tip = $(this).data('quick-tip');
|
1187 |
|
@@ -1193,168 +830,700 @@ if (typeof window.LP == 'undefined') {
|
|
1193 |
if ($.type(options) === 'string') {
|
1194 |
$tip[options] && $tip[options].apply($tip);
|
1195 |
}
|
1196 |
-
})
|
1197 |
-
}
|
1198 |
-
|
1199 |
-
function __initSubtabs() {
|
1200 |
-
$('.learn-press-subtabs').each(function () {
|
1201 |
-
var $tabContainer = $(this),
|
1202 |
-
$tabs = $tabContainer.find('a'),
|
1203 |
-
current = null;
|
1204 |
-
$tabs.click(function (e) {
|
1205 |
-
var $tab = $(this),
|
1206 |
-
$contentID = $tab.attr('href');
|
1207 |
-
$tab.parent().addClass('current').siblings().removeClass('current');
|
1208 |
-
current = $($contentID).addClass('current');
|
1209 |
-
current.siblings().removeClass('current');
|
1210 |
-
//LP.setUrl($contentID);
|
1211 |
-
e.preventDefault();
|
1212 |
-
}).filter(function () {
|
1213 |
-
return $(this).attr('href') === window.location.hash;
|
1214 |
-
}).trigger('click');
|
1215 |
-
if (!current) {
|
1216 |
-
$tabs.first().trigger('click');
|
1217 |
-
}
|
1218 |
});
|
1219 |
-
}
|
|
|
1220 |
|
1221 |
-
|
1222 |
-
if (typeof $.alerts !== 'undefined') {
|
1223 |
-
$.alerts.overlayColor = '#000';
|
1224 |
-
$.alerts.overlayOpacity = 0.5;
|
1225 |
-
$.alerts.okButton = lpGlobalSettings.localize.button_ok;
|
1226 |
-
$.alerts.cancelButton = lpGlobalSettings.localize.button_cancel;
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
$('.learn-press-message.fixed').each(function () {
|
1230 |
-
var $el = $(this),
|
1231 |
-
options = $el.data();
|
1232 |
-
(function ($el, options) {
|
1233 |
-
if (options.delayIn) {
|
1234 |
-
setTimeout(function () {
|
1235 |
-
$el.show().hide().fadeIn();
|
1236 |
-
}, options.delayIn);
|
1237 |
-
}
|
1238 |
-
if (options.delayOut) {
|
1239 |
-
setTimeout(function () {
|
1240 |
-
$el.fadeOut();
|
1241 |
-
}, options.delayOut + (options.delayIn || 0));
|
1242 |
-
}
|
1243 |
-
})($el, options);
|
1244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1245 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1247 |
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1259 |
}
|
|
|
1260 |
}
|
1261 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1262 |
|
1263 |
-
|
1264 |
-
var _sale_start_date = $(this),
|
1265 |
-
_sale_end_date = $('#_lp_sale_end'),
|
1266 |
-
_start_date = Date.parse(_sale_start_date.val()),
|
1267 |
-
_end_date = Date.parse(_sale_end_date.val()),
|
1268 |
-
_parent_start = _sale_start_date.parent('.rwmb-input'),
|
1269 |
-
_parent_end = _sale_end_date.parent('.rwmb-input');
|
1270 |
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
|
|
1274 |
|
1275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1276 |
|
1277 |
-
|
1278 |
-
|
|
|
1279 |
}
|
1280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1281 |
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1289 |
|
1290 |
-
if (
|
1291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1292 |
}
|
|
|
1293 |
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
}
|
1298 |
-
}
|
1299 |
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1307 |
});
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
$('body.course-item-popup').parent().css('overflow', 'hidden');
|
1314 |
-
///
|
1315 |
-
(function () {
|
1316 |
-
var timer = null,
|
1317 |
-
callback = function () {
|
1318 |
-
$('.auto-check-lines').checkLines(function (r) {
|
1319 |
-
if (r > 1) {
|
1320 |
-
$(this).removeClass('single-lines');
|
1321 |
-
} else {
|
1322 |
-
$(this).addClass('single-lines');
|
1323 |
-
}
|
1324 |
-
$(this).attr('rows', r);
|
1325 |
-
});
|
1326 |
-
};
|
1327 |
-
$(window).on('resize.check-lines', function () {
|
1328 |
-
if (timer) {
|
1329 |
-
timer && clearTimeout(timer);
|
1330 |
-
timer = setTimeout(callback, 300);
|
1331 |
} else {
|
1332 |
-
|
1333 |
}
|
1334 |
-
}
|
1335 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1336 |
|
1337 |
-
|
1338 |
-
// LP.blockContent();
|
1339 |
-
// });
|
1340 |
|
1341 |
-
|
1342 |
|
1343 |
-
|
|
|
1344 |
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1351 |
}
|
1352 |
-
});
|
1353 |
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1357 |
});
|
1358 |
-
|
1359 |
|
1360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 62);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ({
|
67 |
+
|
68 |
+
/***/ 0:
|
69 |
+
/***/ (function(module, exports, __webpack_require__) {
|
70 |
+
|
71 |
+
"use strict";
|
72 |
+
|
73 |
+
|
74 |
+
Object.defineProperty(exports, "__esModule", {
|
75 |
+
value: true
|
76 |
+
});
|
77 |
+
|
78 |
+
exports.default = function () {
|
79 |
+
window.LP = window.LP || {};
|
80 |
+
|
81 |
+
if (typeof arguments[0] === 'string') {
|
82 |
+
LP[arguments[0]] = LP[arguments[0]] || {};
|
83 |
+
LP[arguments[0]] = jQuery.extend(LP[arguments[0]], arguments[1]);
|
84 |
+
} else {
|
85 |
+
LP = jQuery.extend(LP, arguments[0]);
|
86 |
+
}
|
87 |
+
};
|
88 |
|
89 |
+
/***/ }),
|
90 |
|
91 |
+
/***/ 1:
|
92 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
+
"use strict";
|
|
|
|
|
95 |
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
Object.defineProperty(exports, "__esModule", {
|
98 |
+
value: true
|
99 |
+
});
|
100 |
|
101 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**
|
102 |
+
* Utility functions may use for both admin and frontend.
|
103 |
+
*
|
104 |
+
* @version 3.2.6
|
105 |
+
*/
|
|
|
|
|
|
|
106 |
|
107 |
+
var _extend = __webpack_require__(0);
|
|
|
108 |
|
109 |
+
var _extend2 = _interopRequireDefault(_extend);
|
|
|
|
|
110 |
|
111 |
+
var _fn = __webpack_require__(2);
|
|
|
|
|
|
|
112 |
|
113 |
+
var _fn2 = _interopRequireDefault(_fn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
var _quickTip = __webpack_require__(3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
var _quickTip2 = _interopRequireDefault(_quickTip);
|
|
|
118 |
|
119 |
+
var _messageBox = __webpack_require__(4);
|
|
|
|
|
|
|
120 |
|
121 |
+
var _messageBox2 = _interopRequireDefault(_messageBox);
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
var _eventCallback = __webpack_require__(5);
|
124 |
+
|
125 |
+
var _eventCallback2 = _interopRequireDefault(_eventCallback);
|
126 |
+
|
127 |
+
var _hook = __webpack_require__(6);
|
128 |
+
|
129 |
+
var _hook2 = _interopRequireDefault(_hook);
|
130 |
+
|
131 |
+
var _jquery = __webpack_require__(7);
|
132 |
+
|
133 |
+
var jplugins = _interopRequireWildcard(_jquery);
|
134 |
+
|
135 |
+
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; } }
|
136 |
+
|
137 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
138 |
+
|
139 |
+
var $ = jQuery;
|
140 |
+
|
141 |
+
String.prototype.getQueryVar = function (name) {
|
142 |
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
143 |
+
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
144 |
+
results = regex.exec(this);
|
145 |
+
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
146 |
+
};
|
147 |
+
|
148 |
+
String.prototype.addQueryVar = function (name, value) {
|
149 |
+
var url = this,
|
150 |
+
m = url.split('#');
|
151 |
+
url = m[0];
|
152 |
+
if (name.match(/\[/)) {
|
153 |
+
url += url.match(/\?/) ? '&' : '?';
|
154 |
+
url += name + '=' + value;
|
155 |
+
} else {
|
156 |
+
if (url.indexOf('&' + name + '=') != -1 || url.indexOf('?' + name + '=') != -1) {
|
157 |
+
url = url.replace(new RegExp(name + "=([^&#]*)", 'g'), name + '=' + value);
|
158 |
+
} else {
|
159 |
+
url += url.match(/\?/) ? '&' : '?';
|
160 |
+
url += name + '=' + value;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
return url + (m[1] ? '#' + m[1] : '');
|
164 |
+
};
|
165 |
+
|
166 |
+
String.prototype.removeQueryVar = function (name) {
|
167 |
+
var url = this;
|
168 |
+
var m = url.split('#');
|
169 |
+
url = m[0];
|
170 |
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
171 |
+
var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
|
172 |
+
url = url.replace(regex, '');
|
173 |
+
return url + (m[1] ? '#' + m[1] : '');
|
174 |
+
};
|
175 |
+
|
176 |
+
if ($.isEmptyObject("") == false) {
|
177 |
+
$.isEmptyObject = function (a) {
|
178 |
+
var prop;
|
179 |
+
for (prop in a) {
|
180 |
+
if (a.hasOwnProperty(prop)) {
|
181 |
+
return false;
|
182 |
}
|
183 |
}
|
184 |
+
return true;
|
185 |
};
|
186 |
+
}
|
187 |
+
|
188 |
+
var _default = {
|
189 |
+
Hook: _hook2.default,
|
190 |
+
setUrl: function setUrl(url, ember, title) {
|
191 |
+
if (url) {
|
192 |
+
history.pushState({}, title, url);
|
193 |
+
LP.Hook.doAction('learn_press_set_location_url', url);
|
194 |
+
}
|
195 |
+
},
|
196 |
+
toggleGroupSection: function toggleGroupSection(el, target) {
|
197 |
+
var $el = $(el),
|
198 |
+
isHide = $el.hasClass('hide-if-js');
|
199 |
+
if (isHide) {
|
200 |
+
$el.hide().removeClass('hide-if-js');
|
201 |
+
}
|
202 |
+
$el.removeClass('hide-if-js').slideToggle(function () {
|
203 |
+
var $this = $(this);
|
204 |
+
if ($this.is(':visible')) {
|
205 |
+
$(target).addClass('toggle-on').removeClass('toggle-off');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
} else {
|
207 |
+
$(target).addClass('toggle-off').removeClass('toggle-on');
|
208 |
}
|
209 |
});
|
210 |
+
},
|
211 |
+
overflow: function overflow(el, v) {
|
212 |
+
var $el = $(el),
|
213 |
+
overflow = $el.css('overflow');
|
214 |
+
if (v) {
|
215 |
+
$el.css('overflow', v).data('overflow', overflow);
|
216 |
+
} else {
|
217 |
+
$el.css('overflow', $el.data('overflow'));
|
218 |
}
|
219 |
+
},
|
220 |
+
getUrl: function getUrl() {
|
221 |
+
return window.location.href;
|
222 |
+
},
|
223 |
+
addQueryVar: function addQueryVar(name, value, url) {
|
224 |
+
return (url === undefined ? window.location.href : url).addQueryVar(name, value);
|
225 |
+
},
|
226 |
+
removeQueryVar: function removeQueryVar(name, url) {
|
227 |
+
return (url === undefined ? window.location.href : url).removeQueryVar(name);
|
228 |
+
},
|
229 |
+
reload: function reload(url) {
|
230 |
+
if (!url) {
|
231 |
+
url = window.location.href;
|
232 |
+
}
|
233 |
+
window.location.href = url;
|
234 |
+
},
|
235 |
|
236 |
+
parseResponse: function parseResponse(response, type) {
|
237 |
+
var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
238 |
+
if (m) {
|
239 |
+
response = m[1];
|
240 |
+
}
|
241 |
+
return (type || "json") === "json" ? this.parseJSON(response) : response;
|
242 |
+
},
|
243 |
+
parseJSON: function parseJSON(data) {
|
244 |
+
var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
245 |
+
try {
|
246 |
+
if (m) {
|
247 |
+
data = $.parseJSON(m[1]);
|
248 |
+
} else {
|
249 |
+
data = $.parseJSON(data);
|
250 |
+
}
|
251 |
+
} catch (e) {
|
252 |
+
data = {};
|
253 |
+
}
|
254 |
+
return data;
|
255 |
+
},
|
256 |
+
ajax: function ajax(args) {
|
257 |
+
var type = args.type || 'post',
|
258 |
+
dataType = args.dataType || 'json',
|
259 |
+
data = args.action ? $.extend(args.data, { 'lp-ajax': args.action }) : args.data,
|
260 |
+
beforeSend = args.beforeSend || function () {},
|
261 |
+
url = args.url || window.location.href;
|
262 |
+
// console.debug( beforeSend );
|
263 |
+
$.ajax({
|
264 |
+
data: data,
|
265 |
+
url: url,
|
266 |
+
type: type,
|
267 |
+
dataType: 'html',
|
268 |
+
beforeSend: beforeSend.apply(null, args),
|
269 |
+
success: function success(raw) {
|
270 |
+
var response = LP.parseResponse(raw, dataType);
|
271 |
+
$.isFunction(args.success) && args.success(response, raw);
|
272 |
+
},
|
273 |
+
error: function error() {
|
274 |
+
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
275 |
+
}
|
276 |
+
});
|
277 |
+
},
|
278 |
+
doAjax: function doAjax(args) {
|
279 |
+
var type = args.type || 'post',
|
280 |
+
dataType = args.dataType || 'json',
|
281 |
+
action = (args.prefix === undefined || 'learnpress_') + args.action,
|
282 |
+
data = args.action ? $.extend(args.data, { action: action }) : args.data;
|
283 |
+
|
284 |
+
$.ajax({
|
285 |
+
data: data,
|
286 |
+
url: args.url || window.location.href,
|
287 |
+
type: type,
|
288 |
+
dataType: 'html',
|
289 |
+
success: function success(raw) {
|
290 |
+
var response = LP.parseResponse(raw, dataType);
|
291 |
+
$.isFunction(args.success) && args.success(response, raw);
|
292 |
+
},
|
293 |
+
error: function error() {
|
294 |
+
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
295 |
+
}
|
296 |
+
});
|
297 |
+
},
|
298 |
|
299 |
+
funcArgs2Array: function funcArgs2Array(args) {
|
300 |
+
var arr = [];
|
301 |
+
for (var i = 0; i < args.length; i++) {
|
302 |
+
arr.push(args[i]);
|
303 |
+
}
|
304 |
+
return arr;
|
305 |
+
},
|
306 |
+
addFilter: function addFilter(action, callback) {
|
307 |
+
var $doc = $(document),
|
308 |
+
event = 'LP.' + action;
|
309 |
+
$doc.on(event, callback);
|
310 |
+
LP.log($doc.data('events'));
|
311 |
+
return this;
|
312 |
+
},
|
313 |
+
applyFilters: function applyFilters() {
|
314 |
+
var $doc = $(document),
|
315 |
+
action = arguments[0],
|
316 |
+
args = this.funcArgs2Array(arguments);
|
317 |
+
if ($doc.hasEvent(action)) {
|
318 |
+
args[0] = 'LP.' + action;
|
319 |
+
return $doc.triggerHandler.apply($doc, args);
|
320 |
+
}
|
321 |
+
return args[1];
|
322 |
+
},
|
323 |
+
addAction: function addAction(action, callback) {
|
324 |
+
return this.addFilter(action, callback);
|
325 |
+
},
|
326 |
+
doAction: function doAction() {
|
327 |
+
var $doc = $(document),
|
328 |
+
action = arguments[0],
|
329 |
+
args = this.funcArgs2Array(arguments);
|
330 |
+
if ($doc.hasEvent(action)) {
|
331 |
+
args[0] = 'LP.' + action;
|
332 |
+
$doc.trigger.apply($doc, args);
|
333 |
+
}
|
334 |
+
},
|
335 |
+
toElement: function toElement(element, args) {
|
336 |
+
if ($(element).length === 0) {
|
337 |
+
return;
|
338 |
+
}
|
339 |
+
args = $.extend({
|
340 |
+
delay: 300,
|
341 |
+
duration: 'slow',
|
342 |
+
offset: 50,
|
343 |
+
container: null,
|
344 |
+
callback: null,
|
345 |
+
invisible: false
|
346 |
+
}, args || {});
|
347 |
+
var $container = $(args.container),
|
348 |
+
rootTop = 0;
|
349 |
+
if ($container.length === 0) {
|
350 |
+
$container = $('body, html');
|
351 |
+
}
|
352 |
+
rootTop = $container.offset().top;
|
353 |
+
var to = $(element).offset().top + $container.scrollTop() - rootTop - args.offset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
|
355 |
+
function isElementInView(element, fullyInView) {
|
356 |
+
var pageTop = $container.scrollTop();
|
357 |
+
var pageBottom = pageTop + $container.height();
|
358 |
+
var elementTop = $(element).offset().top - $container.offset().top;
|
359 |
+
var elementBottom = elementTop + $(element).height();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
|
361 |
+
if (fullyInView === true) {
|
362 |
+
return pageTop < elementTop && pageBottom > elementBottom;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
} else {
|
364 |
+
return elementTop <= pageBottom && elementBottom >= pageTop;
|
|
|
|
|
365 |
}
|
366 |
+
}
|
367 |
|
368 |
+
if (args.invisible && isElementInView(element, true)) {
|
369 |
+
return;
|
370 |
+
}
|
371 |
+
$container.fadeIn(10).delay(args.delay).animate({
|
372 |
+
scrollTop: to
|
373 |
+
}, args.duration, args.callback);
|
374 |
+
},
|
375 |
+
uniqueId: function uniqueId(prefix, more_entropy) {
|
376 |
+
if (typeof prefix === 'undefined') {
|
377 |
+
prefix = '';
|
378 |
+
}
|
379 |
+
|
380 |
+
var retId;
|
381 |
+
var formatSeed = function formatSeed(seed, reqWidth) {
|
382 |
+
seed = parseInt(seed, 10).toString(16); // to hex str
|
383 |
+
if (reqWidth < seed.length) {
|
384 |
+
// so long we split
|
385 |
+
return seed.slice(seed.length - reqWidth);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
}
|
387 |
+
if (reqWidth > seed.length) {
|
388 |
+
// so short we pad
|
389 |
+
return new Array(1 + (reqWidth - seed.length)).join('0') + seed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
}
|
391 |
+
return seed;
|
392 |
+
};
|
393 |
+
|
394 |
+
// BEGIN REDUNDANT
|
395 |
+
if (!this.php_js) {
|
396 |
+
this.php_js = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
}
|
398 |
+
// END REDUNDANT
|
399 |
+
if (!this.php_js.uniqidSeed) {
|
400 |
+
// init seed with big random int
|
401 |
+
this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
|
402 |
+
}
|
403 |
+
this.php_js.uniqidSeed++;
|
404 |
+
|
405 |
+
retId = prefix; // start with prefix, add current milliseconds hex string
|
406 |
+
retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
|
407 |
+
retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
|
408 |
+
if (more_entropy) {
|
409 |
+
// for more entropy we add a float lower to 10
|
410 |
+
retId += (Math.random() * 10).toFixed(8).toString();
|
411 |
+
}
|
412 |
+
|
413 |
+
return retId;
|
414 |
+
},
|
415 |
+
log: function log() {
|
416 |
+
//if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
|
417 |
+
for (var i = 0, n = arguments.length; i < n; i++) {
|
418 |
+
console.log(arguments[i]);
|
419 |
+
}
|
420 |
+
//}
|
421 |
+
},
|
422 |
+
blockContent: function blockContent() {
|
423 |
+
if ($('#learn-press-block-content').length === 0) {
|
424 |
+
$(LP.template('learn-press-template-block-content', {})).appendTo($('body'));
|
425 |
+
}
|
426 |
+
LP.hideMainScrollbar().addClass('block-content');
|
427 |
+
$(document).trigger('learn_press_block_content');
|
428 |
+
},
|
429 |
+
unblockContent: function unblockContent() {
|
430 |
+
setTimeout(function () {
|
431 |
+
LP.showMainScrollbar().removeClass('block-content');
|
432 |
+
$(document).trigger('learn_press_unblock_content');
|
433 |
+
}, 350);
|
434 |
+
},
|
435 |
+
hideMainScrollbar: function hideMainScrollbar(el) {
|
436 |
+
if (!el) {
|
437 |
+
el = 'html, body';
|
438 |
+
}
|
439 |
+
var $el = $(el);
|
440 |
+
$el.each(function () {
|
441 |
+
var $root = $(this),
|
442 |
+
overflow = $root.css('overflow');
|
443 |
+
$root.css('overflow', 'hidden').attr('overflow', overflow);
|
444 |
+
});
|
445 |
+
return $el;
|
446 |
+
},
|
447 |
+
showMainScrollbar: function showMainScrollbar(el) {
|
448 |
+
if (!el) {
|
449 |
+
el = 'html, body';
|
450 |
+
}
|
451 |
+
var $el = $(el);
|
452 |
+
$el.each(function () {
|
453 |
+
var $root = $(this),
|
454 |
+
overflow = $root.attr('overflow');
|
455 |
+
$root.css('overflow', overflow).removeAttr('overflow');
|
456 |
+
});
|
457 |
+
return $el;
|
458 |
+
},
|
459 |
+
template: typeof _ !== 'undefined' ? _.memoize(function (id, data) {
|
460 |
+
var compiled,
|
461 |
+
options = {
|
462 |
+
evaluate: /<#([\s\S]+?)#>/g,
|
463 |
+
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
464 |
+
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
465 |
+
variable: 'data'
|
466 |
+
};
|
467 |
+
|
468 |
+
var tmpl = function tmpl(data) {
|
469 |
+
compiled = compiled || _.template($('#' + id).html(), null, options);
|
470 |
+
return compiled(data);
|
471 |
+
};
|
472 |
+
return data ? tmpl(data) : tmpl;
|
473 |
+
}, function (a, b) {
|
474 |
+
return a + '-' + JSON.stringify(b);
|
475 |
+
}) : function () {
|
476 |
+
return '';
|
477 |
+
},
|
478 |
+
alert: function alert(localize, callback) {
|
479 |
+
var title = '',
|
480 |
+
message = '';
|
481 |
+
if (typeof localize === 'string') {
|
482 |
+
message = localize;
|
483 |
+
} else {
|
484 |
+
if (typeof localize['title'] !== 'undefined') {
|
485 |
+
title = localize['title'];
|
486 |
}
|
487 |
+
if (typeof localize['message'] !== 'undefined') {
|
488 |
+
message = localize['message'];
|
|
|
489 |
}
|
490 |
+
}
|
491 |
+
$.alerts.alert(message, title, function (e) {
|
492 |
+
LP._on_alert_hide();
|
493 |
+
callback && callback(e);
|
494 |
+
});
|
495 |
+
this._on_alert_show();
|
496 |
+
},
|
497 |
+
confirm: function confirm(localize, callback) {
|
498 |
+
var title = '',
|
499 |
+
message = '';
|
500 |
+
|
501 |
+
if (typeof localize === 'string') {
|
502 |
+
message = localize;
|
503 |
+
} else {
|
504 |
+
if (typeof localize['title'] !== 'undefined') {
|
505 |
+
title = localize['title'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
}
|
507 |
+
if (typeof localize['message'] !== 'undefined') {
|
508 |
+
message = localize['message'];
|
509 |
}
|
510 |
+
}
|
511 |
+
$.alerts.confirm(message, title, function (e) {
|
512 |
+
LP._on_alert_hide();
|
513 |
+
callback && callback(e);
|
514 |
+
});
|
515 |
+
this._on_alert_show();
|
516 |
+
},
|
517 |
+
_on_alert_show: function _on_alert_show() {
|
518 |
+
var $container = $('#popup_container'),
|
519 |
+
$placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container);
|
520 |
+
$container.stop().css('top', '-=50').css('opacity', '0').animate({
|
521 |
+
top: '+=50',
|
522 |
+
opacity: 1
|
523 |
+
}, 250);
|
524 |
+
},
|
525 |
+
_on_alert_hide: function _on_alert_hide() {
|
526 |
+
var $holder = $("#popup_container_placeholder"),
|
527 |
+
$container = $holder.data('xxx');
|
528 |
+
if ($container) {
|
529 |
+
$container.replaceWith($holder);
|
530 |
+
}
|
531 |
+
$container.appendTo($(document.body));
|
532 |
+
$container.stop().animate({
|
533 |
+
top: '+=50',
|
534 |
+
opacity: 0
|
535 |
+
}, 250, function () {
|
536 |
+
$(this).remove();
|
537 |
+
});
|
538 |
+
},
|
539 |
+
sendMessage: function sendMessage(data, object, targetOrigin, transfer) {
|
540 |
+
if ($.isPlainObject(data)) {
|
541 |
+
data = JSON.stringify(data);
|
542 |
+
}
|
543 |
+
object = object || window;
|
544 |
+
targetOrigin = targetOrigin || '*';
|
545 |
+
object.postMessage(data, targetOrigin, transfer);
|
546 |
+
},
|
547 |
+
receiveMessage: function receiveMessage(event, b) {
|
548 |
+
var target = event.origin || event.originalEvent.origin,
|
549 |
+
data = event.data || event.originalEvent.data || '';
|
550 |
+
if (typeof data === 'string' || data instanceof String) {
|
551 |
+
if (data.indexOf('{') === 0) {
|
552 |
+
data = LP.parseJSON(data);
|
553 |
}
|
|
|
554 |
}
|
555 |
+
LP.Hook.doAction('learn_press_receive_message', data, target);
|
556 |
+
}
|
557 |
+
};
|
558 |
+
|
559 |
+
$(document).ready(function () {
|
560 |
+
if (typeof $.alerts !== 'undefined') {
|
561 |
+
$.alerts.overlayColor = '#000';
|
562 |
+
$.alerts.overlayOpacity = 0.5;
|
563 |
+
$.alerts.okButton = lpGlobalSettings.localize.button_ok;
|
564 |
+
$.alerts.cancelButton = lpGlobalSettings.localize.button_cancel;
|
565 |
+
}
|
566 |
+
|
567 |
+
$('.learn-press-message.fixed').each(function () {
|
568 |
+
var $el = $(this),
|
569 |
+
options = $el.data();
|
570 |
+
(function ($el, options) {
|
571 |
+
if (options.delayIn) {
|
572 |
+
setTimeout(function () {
|
573 |
+
$el.show().hide().fadeIn();
|
574 |
+
}, options.delayIn);
|
575 |
}
|
576 |
+
if (options.delayOut) {
|
577 |
+
setTimeout(function () {
|
578 |
+
$el.fadeOut();
|
579 |
+
}, options.delayOut + (options.delayIn || 0));
|
|
|
|
|
580 |
}
|
581 |
+
})($el, options);
|
582 |
+
});
|
583 |
+
|
584 |
+
$('body').on('click', '.learn-press-nav-tabs li a', function (e) {
|
585 |
+
e.preventDefault();
|
586 |
+
var $tab = $(this),
|
587 |
+
url = '';
|
588 |
+
$tab.closest('li').addClass('active').siblings().removeClass('active');
|
589 |
+
$($tab.attr('data-tab')).addClass('active').siblings().removeClass('active');
|
590 |
+
$(document).trigger('learn-press/nav-tabs/clicked', $tab);
|
591 |
+
});
|
592 |
+
|
593 |
+
setTimeout(function () {
|
594 |
+
$('.learn-press-nav-tabs li.active:not(.default) a').trigger('click');
|
595 |
+
}, 300);
|
596 |
+
|
597 |
+
$('body.course-item-popup').parent().css('overflow', 'hidden');
|
598 |
+
|
599 |
+
(function () {
|
600 |
+
var timer = null,
|
601 |
+
callback = function callback() {
|
602 |
+
$('.auto-check-lines').checkLines(function (r) {
|
603 |
+
if (r > 1) {
|
604 |
+
$(this).removeClass('single-lines');
|
605 |
} else {
|
606 |
+
$(this).addClass('single-lines');
|
607 |
}
|
608 |
+
$(this).attr('rows', r);
|
609 |
});
|
610 |
+
};
|
611 |
+
$(window).on('resize.check-lines', function () {
|
612 |
+
if (timer) {
|
613 |
+
timer && clearTimeout(timer);
|
614 |
+
timer = setTimeout(callback, 300);
|
|
|
615 |
} else {
|
616 |
+
callback();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
617 |
}
|
618 |
+
});
|
619 |
+
})();
|
620 |
|
621 |
+
$('.learn-press-tooltip, .lp-passing-conditional').LP_Tooltip({ offset: [24, 24] });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
|
623 |
+
$('.learn-press-icon').LP_Tooltip({ offset: [30, 30] });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
|
625 |
+
$('.learn-press-message[data-autoclose]').each(function () {
|
626 |
+
var $el = $(this),
|
627 |
+
delay = parseInt($el.data('autoclose'));
|
628 |
+
if (delay) {
|
629 |
+
setTimeout(function ($el) {
|
630 |
+
$el.fadeOut();
|
631 |
+
}, delay, $el);
|
632 |
+
}
|
633 |
+
});
|
634 |
|
635 |
+
$(document).on('click', function () {
|
636 |
+
$(document).trigger('learn-press/close-all-quick-tip');
|
637 |
+
});
|
638 |
+
});
|
|
|
|
|
639 |
|
640 |
+
(0, _extend2.default)(_extends({
|
641 |
+
Event_Callback: _eventCallback2.default,
|
642 |
+
MessageBox: _messageBox2.default
|
643 |
+
}, _default));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
|
645 |
+
exports.default = {
|
646 |
+
fn: _fn2.default,
|
647 |
+
QuickTip: _quickTip2.default
|
648 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
|
650 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
651 |
|
652 |
+
/***/ 2:
|
653 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
654 |
|
655 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
656 |
|
|
|
|
|
|
|
|
|
657 |
|
658 |
+
Object.defineProperty(exports, "__esModule", {
|
659 |
+
value: true
|
660 |
+
});
|
661 |
+
/**
|
662 |
+
* Auto prepend `LP` prefix for jQuery fn plugin name.
|
663 |
+
*
|
664 |
+
* Create : $.fn.LP( 'PLUGIN_NAME', func) <=> $.fn.LP_PLUGIN_NAME
|
665 |
+
* Usage: $(selector).LP('PLUGIN_NAME') <=> $(selector).LP_PLUGIN_NAME()
|
666 |
+
*
|
667 |
+
* @version 3.2.6
|
668 |
+
*/
|
669 |
|
670 |
+
var $ = window.jQuery;
|
671 |
+
var exp;
|
|
|
|
|
|
|
|
|
|
|
672 |
|
673 |
+
(function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
|
675 |
+
if ($ === undefined) {
|
676 |
+
return;
|
677 |
+
}
|
678 |
+
|
679 |
+
$.fn.LP = exp = function exp(widget, fn) {
|
680 |
+
if ($.isFunction(fn)) {
|
681 |
+
$.fn['LP_' + widget] = fn;
|
682 |
+
} else if (widget) {
|
683 |
+
var args = [];
|
684 |
+
if (arguments.length > 1) {
|
685 |
+
for (var i = 1; i < arguments.length; i++) {
|
686 |
+
args.push(arguments[i]);
|
|
|
|
|
|
|
|
|
687 |
}
|
|
|
|
|
|
|
688 |
}
|
|
|
|
|
689 |
|
690 |
+
return $.isFunction($(this)['LP_' + widget]) ? $(this)['LP_' + widget].apply(this, args) : this;
|
691 |
+
}
|
692 |
+
return this;
|
693 |
+
};
|
694 |
+
})();
|
695 |
+
|
696 |
+
exports.default = exp;
|
697 |
|
698 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
699 |
|
700 |
+
/***/ 3:
|
701 |
+
/***/ (function(module, exports, __webpack_require__) {
|
702 |
+
|
703 |
+
"use strict";
|
704 |
|
|
|
705 |
|
706 |
+
;(function ($) {
|
707 |
function QuickTip(el, options) {
|
708 |
var $el = $(el),
|
709 |
uniId = $el.attr('data-id') || LP.uniqueId();
|
728 |
$content = $('#__' + uniId);
|
729 |
|
730 |
if ($content.length === 0) {
|
731 |
+
$(document.body).append($('<div />').attr('id', '__' + uniId).html(content).css('display', 'none'));
|
732 |
}
|
733 |
|
734 |
content = $content.html();
|
747 |
$tip.append('<a class="close"></a>');
|
748 |
$tip.on('click', '.close', function () {
|
749 |
close();
|
750 |
+
});
|
751 |
}
|
752 |
|
753 |
function show() {
|
757 |
}
|
758 |
|
759 |
if (options.single) {
|
760 |
+
$('.learn-press-tip').not($el).LP('QuickTip', 'close');
|
761 |
}
|
762 |
|
763 |
$tip.appendTo(document.body);
|
795 |
$el.on('click', function (e) {
|
796 |
e.stopPropagation();
|
797 |
show();
|
798 |
+
});
|
799 |
}
|
800 |
|
801 |
$(document).on('learn-press/close-all-quick-tip', function () {
|
802 |
close();
|
803 |
});
|
804 |
+
$el.hover(function (e) {
|
805 |
+
e.stopPropagation();
|
806 |
+
if (options.event !== 'click') {
|
807 |
+
show();
|
808 |
+
}
|
809 |
+
}, function (e) {
|
810 |
+
e.stopPropagation();
|
811 |
+
if (options.autoClose) {
|
812 |
+
hide();
|
|
|
|
|
|
|
813 |
}
|
814 |
+
}).addClass('ready');
|
815 |
return {
|
816 |
close: close,
|
817 |
open: open
|
818 |
+
};
|
819 |
}
|
820 |
|
821 |
+
$.fn.LP('QuickTip', function (options) {
|
822 |
return $.each(this, function () {
|
823 |
var $tip = $(this).data('quick-tip');
|
824 |
|
830 |
if ($.type(options) === 'string') {
|
831 |
$tip[options] && $tip[options].apply($tip);
|
832 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
});
|
834 |
+
});
|
835 |
+
})(jQuery);
|
836 |
|
837 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
838 |
|
839 |
+
/***/ 4:
|
840 |
+
/***/ (function(module, exports, __webpack_require__) {
|
841 |
+
|
842 |
+
"use strict";
|
843 |
+
|
844 |
+
|
845 |
+
Object.defineProperty(exports, "__esModule", {
|
846 |
+
value: true
|
847 |
+
});
|
848 |
+
var $ = window.jQuery;
|
849 |
+
var MessageBox = {
|
850 |
+
/*
|
851 |
+
*
|
852 |
+
*/
|
853 |
+
$block: null,
|
854 |
+
$window: null,
|
855 |
+
events: {},
|
856 |
+
instances: [],
|
857 |
+
instance: null,
|
858 |
+
quickConfirm: function quickConfirm(elem, args) {
|
859 |
+
var $e = $(elem);
|
860 |
+
$('[learn-press-quick-confirm]').each(function () {
|
861 |
+
var $ins;
|
862 |
+
($ins = $(this).data('quick-confirm')) && (console.log($ins), $ins.destroy());
|
863 |
});
|
864 |
+
!$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm', new function (elem, args) {
|
865 |
+
var $elem = $(elem),
|
866 |
+
$div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem),
|
867 |
+
//($(document.body)),
|
868 |
+
offset = $(elem).position() || { left: 0, top: 0 },
|
869 |
+
timerOut = null,
|
870 |
+
timerHide = null,
|
871 |
+
n = 3,
|
872 |
+
hide = function hide() {
|
873 |
+
$div.fadeOut('fast', function () {
|
874 |
+
$(this).remove();
|
875 |
+
$div.parent().css('position', '');
|
876 |
+
});
|
877 |
+
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
878 |
+
stop();
|
879 |
+
},
|
880 |
+
stop = function stop() {
|
881 |
+
timerHide && clearInterval(timerHide);
|
882 |
+
timerOut && clearInterval(timerOut);
|
883 |
+
},
|
884 |
+
start = function start() {
|
885 |
+
timerOut = setInterval(function () {
|
886 |
+
if (--n == 0) {
|
887 |
+
hide.call($div[0]);
|
888 |
+
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
889 |
+
stop();
|
890 |
+
}
|
891 |
+
$div.find('span').html(' (' + n + ')');
|
892 |
+
}, 1000);
|
893 |
|
894 |
+
timerHide = setInterval(function () {
|
895 |
+
if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') {
|
896 |
+
stop();
|
897 |
+
$div.remove();
|
898 |
+
$div.parent().css('position', '');
|
899 |
+
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
900 |
+
}
|
901 |
+
}, 350);
|
902 |
+
};
|
903 |
+
args = $.extend({
|
904 |
+
message: '',
|
905 |
+
data: null,
|
906 |
+
onOk: null,
|
907 |
+
onCancel: null,
|
908 |
+
offset: { top: 0, left: 0 }
|
909 |
+
}, args || {});
|
910 |
+
$div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append('<span> (' + n + ')</span>').css({});
|
911 |
+
$div.click(function () {
|
912 |
+
$.isFunction(args.onOk) && args.onOk(args.data);
|
913 |
+
hide();
|
914 |
+
}).hover(function () {
|
915 |
+
stop();
|
916 |
+
}, function () {
|
917 |
+
start();
|
918 |
+
});
|
919 |
+
//$div.parent().css('position', 'relative');
|
920 |
+
$div.css({
|
921 |
+
left: offset.left + $elem.outerWidth() - $div.outerWidth() + args.offset.left,
|
922 |
+
top: offset.top + $elem.outerHeight() + args.offset.top + 5
|
923 |
+
}).hide().fadeIn('fast');
|
924 |
+
start();
|
925 |
+
|
926 |
+
this.destroy = function () {
|
927 |
+
$div.remove();
|
928 |
+
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
929 |
+
stop();
|
930 |
+
};
|
931 |
+
}(elem, args));
|
932 |
+
},
|
933 |
+
show: function show(message, args) {
|
934 |
+
//this.hide();
|
935 |
+
$.proxy(function () {
|
936 |
+
args = $.extend({
|
937 |
+
title: '',
|
938 |
+
buttons: '',
|
939 |
+
events: false,
|
940 |
+
autohide: false,
|
941 |
+
message: message,
|
942 |
+
data: false,
|
943 |
+
id: LP.uniqueId(),
|
944 |
+
onHide: null
|
945 |
+
}, args || {});
|
946 |
+
|
947 |
+
this.instances.push(args);
|
948 |
+
this.instance = args;
|
949 |
|
950 |
+
var $doc = $(document),
|
951 |
+
$body = $(document.body);
|
952 |
+
if (!this.$block) {
|
953 |
+
this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body);
|
954 |
+
}
|
955 |
+
if (!this.$window) {
|
956 |
+
this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
|
957 |
+
this.$window.click(function () {});
|
958 |
+
}
|
959 |
+
//this.events = args.events || {};
|
960 |
+
this._createWindow(message, args.title, args.buttons);
|
961 |
+
this.$block.show();
|
962 |
+
this.$window.show().attr('instance', args.id);
|
963 |
+
$(window).bind('resize.message-box', $.proxy(this.update, this)).bind('scroll.message-box', $.proxy(this.update, this));
|
964 |
+
this.update(true);
|
965 |
+
if (args.autohide) {
|
966 |
+
setTimeout(function () {
|
967 |
+
LP.MessageBox.hide();
|
968 |
+
$.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args);
|
969 |
+
}, args.autohide);
|
970 |
+
}
|
971 |
+
}, this)();
|
972 |
+
},
|
973 |
+
blockUI: function blockUI(message) {
|
974 |
+
|
975 |
+
message = (message !== false ? message ? message : 'Wait a moment' : '') + '<div class="message-box-animation"></div>';
|
976 |
+
this.show(message);
|
977 |
+
},
|
978 |
+
hide: function hide(delay, instance) {
|
979 |
+
if (instance) {
|
980 |
+
this._removeInstance(instance.id);
|
981 |
+
} else if (this.instance) {
|
982 |
+
this._removeInstance(this.instance.id);
|
983 |
+
}
|
984 |
+
if (this.instances.length === 0) {
|
985 |
+
if (this.$block) {
|
986 |
+
this.$block.hide();
|
987 |
+
}
|
988 |
+
if (this.$window) {
|
989 |
+
this.$window.hide();
|
990 |
+
}
|
991 |
+
$(window).unbind('resize.message-box', this.update).unbind('scroll.message-box', this.update);
|
992 |
+
} else {
|
993 |
+
if (this.instance) {
|
994 |
+
this._createWindow(this.instance.message, this.instance.title, this.instance.buttons);
|
995 |
+
}
|
996 |
+
}
|
997 |
+
},
|
998 |
+
update: function update(force) {
|
999 |
+
var that = this,
|
1000 |
+
$wrap = this.$window.find('#message-box-wrap'),
|
1001 |
+
timer = $wrap.data('timer'),
|
1002 |
+
_update = function _update() {
|
1003 |
+
LP.Hook.doAction('learn_press_message_box_before_resize', that);
|
1004 |
+
var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'),
|
1005 |
+
width = $wrap.outerWidth(),
|
1006 |
+
height = $wrap.outerHeight(),
|
1007 |
+
contentHeight = $content.height(),
|
1008 |
+
windowHeight = $(window).height(),
|
1009 |
+
top = $wrap.offset().top;
|
1010 |
+
if (contentHeight > windowHeight - 50) {
|
1011 |
+
$content.css({
|
1012 |
+
height: windowHeight - 25
|
1013 |
+
});
|
1014 |
+
height = $wrap.outerHeight();
|
1015 |
+
} else {
|
1016 |
+
$content.css("height", "").css('overflow', '');
|
1017 |
+
}
|
1018 |
+
$wrap.css({
|
1019 |
+
marginTop: ($(window).height() - height) / 2
|
1020 |
+
});
|
1021 |
+
LP.Hook.doAction('learn_press_message_box_resize', height, that);
|
1022 |
+
};
|
1023 |
+
if (force) _update();
|
1024 |
+
timer && clearTimeout(timer);
|
1025 |
+
timer = setTimeout(_update, 250);
|
1026 |
+
},
|
1027 |
+
_removeInstance: function _removeInstance(id) {
|
1028 |
+
for (var i = 0; i < this.instances.length; i++) {
|
1029 |
+
if (this.instances[i].id === id) {
|
1030 |
+
|
1031 |
+
this.instances.splice(i, 1);
|
1032 |
+
|
1033 |
+
var len = this.instances.length;
|
1034 |
+
if (len) {
|
1035 |
+
this.instance = this.instances[len - 1];
|
1036 |
+
this.$window.attr('instance', this.instance.id);
|
1037 |
+
} else {
|
1038 |
+
this.instance = false;
|
1039 |
+
this.$window.removeAttr('instance');
|
1040 |
}
|
1041 |
+
break;
|
1042 |
}
|
1043 |
+
}
|
1044 |
+
},
|
1045 |
+
_getInstance: function _getInstance(id) {
|
1046 |
+
for (var i = 0; i < this.instances.length; i++) {
|
1047 |
+
if (this.instances[i].id === id) {
|
1048 |
+
return this.instances[i];
|
1049 |
+
}
|
1050 |
+
}
|
1051 |
+
},
|
1052 |
+
_createWindow: function _createWindow(message, title, buttons) {
|
1053 |
+
var $wrap = this.$window.find('#message-box-wrap').html('');
|
1054 |
+
if (title) {
|
1055 |
+
$wrap.append('<h3 class="message-box-title">' + title + '</h3>');
|
1056 |
+
}
|
1057 |
+
$wrap.append($('<div class="message-box-content"></div>').html(message));
|
1058 |
+
if (buttons) {
|
1059 |
+
var $buttons = $('<div class="message-box-buttons"></div>');
|
1060 |
+
switch (buttons) {
|
1061 |
+
case 'yesNo':
|
1062 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes'));
|
1063 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_no, 'no'));
|
1064 |
+
break;
|
1065 |
+
case 'okCancel':
|
1066 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
1067 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel'));
|
1068 |
+
break;
|
1069 |
+
default:
|
1070 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
1071 |
+
}
|
1072 |
+
$wrap.append($buttons);
|
1073 |
+
}
|
1074 |
+
},
|
1075 |
+
_createButton: function _createButton(title, type) {
|
1076 |
+
var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + '</button>'),
|
1077 |
+
callback = 'on' + (type.substr(0, 1).toUpperCase() + type.substr(1));
|
1078 |
+
$button.data('callback', callback).click(function () {
|
1079 |
+
var instance = $(this).data('instance'),
|
1080 |
+
callback = instance.events[$(this).data('callback')];
|
1081 |
+
if ($.type(callback) === 'function') {
|
1082 |
+
if (callback.apply(LP.MessageBox, [instance]) === false) {
|
1083 |
+
// return;
|
1084 |
+
} else {
|
1085 |
+
LP.MessageBox.hide(null, instance);
|
1086 |
+
}
|
1087 |
+
} else {
|
1088 |
+
LP.MessageBox.hide(null, instance);
|
1089 |
+
}
|
1090 |
+
}).data('instance', this.instance);
|
1091 |
+
return $button;
|
1092 |
+
}
|
1093 |
+
};
|
1094 |
|
1095 |
+
exports.default = MessageBox;
|
|
|
|
|
|
|
|
|
|
|
|
|
1096 |
|
1097 |
+
/***/ }),
|
1098 |
+
|
1099 |
+
/***/ 5:
|
1100 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1101 |
|
1102 |
+
"use strict";
|
1103 |
+
|
1104 |
+
|
1105 |
+
Object.defineProperty(exports, "__esModule", {
|
1106 |
+
value: true
|
1107 |
+
});
|
1108 |
+
/**
|
1109 |
+
* Manage event callbacks.
|
1110 |
+
* Allow add/remove a callback function into custom event of an object.
|
1111 |
+
*
|
1112 |
+
* @constructor
|
1113 |
+
*/
|
1114 |
+
var Event_Callback = function Event_Callback(self) {
|
1115 |
+
var callbacks = {};
|
1116 |
+
var $ = window.jQuery;
|
1117 |
+
|
1118 |
+
this.on = function (event, callback) {
|
1119 |
+
var namespaces = event.split('.'),
|
1120 |
+
namespace = '';
|
1121 |
+
|
1122 |
+
if (namespaces.length > 1) {
|
1123 |
+
event = namespaces[0];
|
1124 |
+
namespace = namespaces[1];
|
1125 |
+
}
|
1126 |
+
|
1127 |
+
if (!callbacks[event]) {
|
1128 |
+
callbacks[event] = [[], {}];
|
1129 |
+
}
|
1130 |
|
1131 |
+
if (namespace) {
|
1132 |
+
if (!callbacks[event][1][namespace]) {
|
1133 |
+
callbacks[event][1][namespace] = [];
|
1134 |
}
|
1135 |
+
callbacks[event][1][namespace].push(callback);
|
1136 |
+
} else {
|
1137 |
+
callbacks[event][0].push(callback);
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
return self;
|
1141 |
+
};
|
1142 |
+
|
1143 |
+
this.off = function (event, callback) {
|
1144 |
+
var namespaces = event.split('.'),
|
1145 |
+
namespace = '';
|
1146 |
+
|
1147 |
+
if (namespaces.length > 1) {
|
1148 |
+
event = namespaces[0];
|
1149 |
+
namespace = namespaces[1];
|
1150 |
+
}
|
1151 |
|
1152 |
+
if (!callbacks[event]) {
|
1153 |
+
return self;
|
1154 |
+
}
|
1155 |
+
var at = -1;
|
1156 |
+
if (!namespace) {
|
1157 |
+
if ($.isFunction(callback)) {
|
1158 |
+
at = callbacks[event][0].indexOf(callback);
|
1159 |
+
if (at < 0) {
|
1160 |
+
return self;
|
1161 |
+
}
|
1162 |
+
callbacks[event][0].splice(at, 1);
|
1163 |
+
} else {
|
1164 |
+
callbacks[event][0] = [];
|
1165 |
+
}
|
1166 |
+
} else {
|
1167 |
+
if (!callbacks[event][1][namespace]) {
|
1168 |
+
return self;
|
1169 |
+
}
|
1170 |
|
1171 |
+
if ($.isFunction(callback)) {
|
1172 |
+
at = callbacks[event][1][namespace].indexOf(callback);
|
1173 |
+
if (at < 0) {
|
1174 |
+
return self;
|
1175 |
+
}
|
1176 |
+
callbacks[event][1][namespace].splice(at, 1);
|
1177 |
+
} else {
|
1178 |
+
callbacks[event][1][namespace] = [];
|
1179 |
}
|
1180 |
+
}
|
1181 |
|
1182 |
+
return self;
|
1183 |
+
};
|
1184 |
+
|
1185 |
+
this.callEvent = function (event, callbackArgs) {
|
1186 |
+
if (!callbacks[event]) {
|
1187 |
+
return;
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
if (callbacks[event][0]) {
|
1191 |
+
for (var i = 0; i < callbacks[event][0].length; i++) {
|
1192 |
+
$.isFunction(callbacks[event][0][i]) && callbacks[event][i][0].apply(self, callbackArgs);
|
1193 |
}
|
1194 |
+
}
|
1195 |
|
1196 |
+
if (callbacks[event][1]) {
|
1197 |
+
for (var i in callbacks[event][1]) {
|
1198 |
+
for (var j = 0; j < callbacks[event][1][i].length; j++) {
|
1199 |
+
$.isFunction(callbacks[event][1][i][j]) && callbacks[event][1][i][j].apply(self, callbackArgs);
|
1200 |
+
}
|
1201 |
+
}
|
1202 |
+
}
|
1203 |
+
};
|
1204 |
+
};
|
1205 |
+
|
1206 |
+
exports.default = Event_Callback;
|
1207 |
+
|
1208 |
+
/***/ }),
|
1209 |
+
|
1210 |
+
/***/ 6:
|
1211 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1212 |
+
|
1213 |
+
"use strict";
|
1214 |
+
|
1215 |
+
|
1216 |
+
Object.defineProperty(exports, "__esModule", {
|
1217 |
+
value: true
|
1218 |
+
});
|
1219 |
+
var Hook = {
|
1220 |
+
hooks: { action: {}, filter: {} },
|
1221 |
+
addAction: function addAction(action, callable, priority, tag) {
|
1222 |
+
this.addHook('action', action, callable, priority, tag);
|
1223 |
+
return this;
|
1224 |
+
},
|
1225 |
+
addFilter: function addFilter(action, callable, priority, tag) {
|
1226 |
+
this.addHook('filter', action, callable, priority, tag);
|
1227 |
+
return this;
|
1228 |
+
},
|
1229 |
+
doAction: function doAction(action) {
|
1230 |
+
this.doHook('action', action, arguments);
|
1231 |
+
return this;
|
1232 |
+
},
|
1233 |
+
applyFilters: function applyFilters(action) {
|
1234 |
+
return this.doHook('filter', action, arguments);
|
1235 |
+
},
|
1236 |
+
removeAction: function removeAction(action, tag) {
|
1237 |
+
this.removeHook('action', action, tag);
|
1238 |
+
return this;
|
1239 |
+
},
|
1240 |
+
removeFilter: function removeFilter(action, priority, tag) {
|
1241 |
+
this.removeHook('filter', action, priority, tag);
|
1242 |
+
return this;
|
1243 |
+
},
|
1244 |
+
addHook: function addHook(hookType, action, callable, priority, tag) {
|
1245 |
+
if (undefined === this.hooks[hookType][action]) {
|
1246 |
+
this.hooks[hookType][action] = [];
|
1247 |
+
}
|
1248 |
+
var hooks = this.hooks[hookType][action];
|
1249 |
+
if (undefined === tag) {
|
1250 |
+
tag = action + '_' + hooks.length;
|
1251 |
+
}
|
1252 |
+
this.hooks[hookType][action].push({ tag: tag, callable: callable, priority: priority });
|
1253 |
+
return this;
|
1254 |
+
},
|
1255 |
+
doHook: function doHook(hookType, action, args) {
|
1256 |
+
|
1257 |
+
// splice args from object into array and remove first index which is the hook name
|
1258 |
+
args = Array.prototype.slice.call(args, 1);
|
1259 |
+
|
1260 |
+
if (undefined !== this.hooks[hookType][action]) {
|
1261 |
+
var hooks = this.hooks[hookType][action],
|
1262 |
+
hook;
|
1263 |
+
//sort by priority
|
1264 |
+
hooks.sort(function (a, b) {
|
1265 |
+
return a["priority"] - b["priority"];
|
1266 |
});
|
1267 |
+
for (var i = 0; i < hooks.length; i++) {
|
1268 |
+
hook = hooks[i].callable;
|
1269 |
+
if (typeof hook !== 'function') hook = window[hook];
|
1270 |
+
if ('action' === hookType) {
|
1271 |
+
hook.apply(null, args);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1272 |
} else {
|
1273 |
+
args[0] = hook.apply(null, args);
|
1274 |
}
|
1275 |
+
}
|
1276 |
+
}
|
1277 |
+
if ('filter' === hookType) {
|
1278 |
+
return args[0];
|
1279 |
+
}
|
1280 |
+
return this;
|
1281 |
+
},
|
1282 |
+
removeHook: function removeHook(hookType, action, priority, tag) {
|
1283 |
+
if (undefined !== this.hooks[hookType][action]) {
|
1284 |
+
var hooks = this.hooks[hookType][action];
|
1285 |
+
for (var i = hooks.length - 1; i >= 0; i--) {
|
1286 |
+
if ((undefined === tag || tag === hooks[i].tag) && (undefined === priority || priority === hooks[i].priority)) {
|
1287 |
+
hooks.splice(i, 1);
|
1288 |
+
}
|
1289 |
+
}
|
1290 |
+
}
|
1291 |
+
return this;
|
1292 |
+
}
|
1293 |
+
};
|
1294 |
|
1295 |
+
exports.default = Hook;
|
|
|
|
|
1296 |
|
1297 |
+
/***/ }),
|
1298 |
|
1299 |
+
/***/ 62:
|
1300 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1301 |
|
1302 |
+
"use strict";
|
1303 |
+
|
1304 |
+
|
1305 |
+
var _utils = __webpack_require__(1);
|
1306 |
+
|
1307 |
+
var _utils2 = _interopRequireDefault(_utils);
|
1308 |
+
|
1309 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1310 |
+
|
1311 |
+
/***/ }),
|
1312 |
+
|
1313 |
+
/***/ 7:
|
1314 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1315 |
+
|
1316 |
+
"use strict";
|
1317 |
+
|
1318 |
+
|
1319 |
+
Object.defineProperty(exports, "__esModule", {
|
1320 |
+
value: true
|
1321 |
+
});
|
1322 |
+
|
1323 |
+
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; };
|
1324 |
+
|
1325 |
+
var $ = window.jQuery;
|
1326 |
+
|
1327 |
+
var serializeJSON = function serializeJSON(path) {
|
1328 |
+
var isInput = $(this).is('input') || $(this).is('select') || $(this).is('textarea');
|
1329 |
+
var unIndexed = isInput ? $(this).serializeArray() : $(this).find('input, select, textarea').serializeArray(),
|
1330 |
+
indexed = {},
|
1331 |
+
validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g,
|
1332 |
+
arrayKeys = {},
|
1333 |
+
end = false;
|
1334 |
+
$.each(unIndexed, function () {
|
1335 |
+
var that = this,
|
1336 |
+
match = this.name.match(/^([0-9a-zA-Z_-]+)/);
|
1337 |
+
if (!match) {
|
1338 |
+
return;
|
1339 |
+
}
|
1340 |
+
var keys = this.name.match(validate),
|
1341 |
+
objPath = "indexed['" + match[0] + "']";
|
1342 |
+
|
1343 |
+
if (keys) {
|
1344 |
+
if (_typeof(indexed[match[0]]) != 'object') {
|
1345 |
+
indexed[match[0]] = {};
|
1346 |
}
|
|
|
1347 |
|
1348 |
+
$.each(keys, function (i, prop) {
|
1349 |
+
prop = prop.replace(/\]|\[/g, '');
|
1350 |
+
var rawPath = objPath.replace(/'|\[|\]/g, ''),
|
1351 |
+
objExp = '',
|
1352 |
+
preObjPath = objPath;
|
1353 |
+
|
1354 |
+
if (prop == '') {
|
1355 |
+
if (arrayKeys[rawPath] == undefined) {
|
1356 |
+
arrayKeys[rawPath] = 0;
|
1357 |
+
} else {
|
1358 |
+
arrayKeys[rawPath]++;
|
1359 |
+
}
|
1360 |
+
objPath += "['" + arrayKeys[rawPath] + "']";
|
1361 |
+
} else {
|
1362 |
+
if (!isNaN(prop)) {
|
1363 |
+
arrayKeys[rawPath] = prop;
|
1364 |
+
}
|
1365 |
+
objPath += "['" + prop + "']";
|
1366 |
+
}
|
1367 |
+
try {
|
1368 |
+
if (i == keys.length - 1) {
|
1369 |
+
objExp = objPath + "=that.value;";
|
1370 |
+
end = true;
|
1371 |
+
} else {
|
1372 |
+
objExp = objPath + "={}";
|
1373 |
+
end = false;
|
1374 |
+
}
|
1375 |
+
|
1376 |
+
var evalString = "" + "if( typeof " + objPath + " == 'undefined'){" + objExp + ";" + "}else{" + "if(end){" + "if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}" + "}";
|
1377 |
+
eval(evalString);
|
1378 |
+
} catch (e) {
|
1379 |
+
console.log('Error:' + e + "\n" + objExp);
|
1380 |
+
}
|
1381 |
+
});
|
1382 |
+
} else {
|
1383 |
+
indexed[match[0]] = this.value;
|
1384 |
+
}
|
1385 |
+
});
|
1386 |
+
if (path) {
|
1387 |
+
path = "['" + path.replace('.', "']['") + "']";
|
1388 |
+
var c = 'try{indexed = indexed' + path + '}catch(ex){console.log(c, ex);}';
|
1389 |
+
eval(c);
|
1390 |
+
}
|
1391 |
+
return indexed;
|
1392 |
+
};
|
1393 |
+
|
1394 |
+
var LP_Tooltip = function LP_Tooltip(options) {
|
1395 |
+
options = $.extend({}, {
|
1396 |
+
offset: [0, 0]
|
1397 |
+
}, options || {});
|
1398 |
+
return $.each(this, function () {
|
1399 |
+
var $el = $(this),
|
1400 |
+
content = $el.data('content');
|
1401 |
+
if (!content || $el.data('LP_Tooltip') !== undefined) {
|
1402 |
+
return;
|
1403 |
+
}
|
1404 |
+
|
1405 |
+
var $tooltip = null;
|
1406 |
+
$el.hover(function (e) {
|
1407 |
+
$tooltip = $('<div class="learn-press-tooltip-bubble"/>').html(content).appendTo($('body')).hide();
|
1408 |
+
var position = $el.offset();
|
1409 |
+
if ($.isArray(options.offset)) {
|
1410 |
+
var top = options.offset[1],
|
1411 |
+
left = options.offset[0];
|
1412 |
+
if ($.isNumeric(left)) {
|
1413 |
+
position.left += left;
|
1414 |
+
} else {}
|
1415 |
+
if ($.isNumeric(top)) {
|
1416 |
+
position.top += top;
|
1417 |
+
} else {}
|
1418 |
+
}
|
1419 |
+
$tooltip.css({
|
1420 |
+
top: position.top,
|
1421 |
+
left: position.left
|
1422 |
+
});
|
1423 |
+
$tooltip.fadeIn();
|
1424 |
+
}, function () {
|
1425 |
+
$tooltip && $tooltip.remove();
|
1426 |
+
});
|
1427 |
+
$el.data('tooltip', true);
|
1428 |
});
|
1429 |
+
};
|
1430 |
|
1431 |
+
var hasEvent = function hasEvent(name) {
|
1432 |
+
var events = $(this).data('events');
|
1433 |
+
if (typeof events.LP == 'undefined') {
|
1434 |
+
return false;
|
1435 |
+
}
|
1436 |
+
for (i = 0; i < events.LP.length; i++) {
|
1437 |
+
if (events.LP[i].namespace == name) {
|
1438 |
+
return true;
|
1439 |
+
}
|
1440 |
+
}
|
1441 |
+
return false;
|
1442 |
+
};
|
1443 |
+
|
1444 |
+
var dataToJSON = function dataToJSON() {
|
1445 |
+
var json = {};
|
1446 |
+
$.each(this[0].attributes, function () {
|
1447 |
+
var m = this.name.match(/^data-(.*)/);
|
1448 |
+
if (m) {
|
1449 |
+
json[m[1]] = this.value;
|
1450 |
+
}
|
1451 |
+
});
|
1452 |
+
return json;
|
1453 |
+
};
|
1454 |
+
|
1455 |
+
var rows = function rows() {
|
1456 |
+
var h = $(this).height();
|
1457 |
+
var lh = $(this).css('line-height').replace("px", "");
|
1458 |
+
$(this).attr({ height: h, 'line-height': lh });
|
1459 |
+
return Math.floor(h / parseInt(lh));
|
1460 |
+
};
|
1461 |
+
|
1462 |
+
var checkLines = function checkLines(p) {
|
1463 |
+
return this.each(function () {
|
1464 |
+
var $e = $(this),
|
1465 |
+
rows = $e.rows();
|
1466 |
+
|
1467 |
+
p.call(this, rows);
|
1468 |
+
});
|
1469 |
+
};
|
1470 |
+
|
1471 |
+
var findNext = function findNext(selector) {
|
1472 |
+
var $selector = $(selector),
|
1473 |
+
$root = this.first(),
|
1474 |
+
index = $selector.index($root),
|
1475 |
+
$next = $selector.eq(index + 1);
|
1476 |
+
return $next.length ? $next : false;
|
1477 |
+
};
|
1478 |
+
|
1479 |
+
var findPrev = function findPrev(selector) {
|
1480 |
+
var $selector = $(selector),
|
1481 |
+
$root = this.first(),
|
1482 |
+
index = $selector.index($root),
|
1483 |
+
$prev = $selector.eq(index - 1);
|
1484 |
+
return $prev.length ? $prev : false;
|
1485 |
+
};
|
1486 |
+
|
1487 |
+
var progress = function progress(v) {
|
1488 |
+
return this.each(function () {
|
1489 |
+
var t = parseInt(v / 100 * 360),
|
1490 |
+
timer = null,
|
1491 |
+
$this = $(this);
|
1492 |
+
|
1493 |
+
if (t < 180) {
|
1494 |
+
$this.find('.progress-circle').removeClass('gt-50');
|
1495 |
+
} else {
|
1496 |
+
$this.find('.progress-circle').addClass('gt-50');
|
1497 |
+
}
|
1498 |
+
$this.find('.fill').css({
|
1499 |
+
transform: 'rotate(' + t + 'deg)'
|
1500 |
+
});
|
1501 |
+
});
|
1502 |
+
};
|
1503 |
+
|
1504 |
+
$.fn.serializeJSON = serializeJSON;
|
1505 |
+
$.fn.LP_Tooltip = LP_Tooltip;
|
1506 |
+
$.fn.hasEvent = hasEvent;
|
1507 |
+
$.fn.dataToJSON = dataToJSON;
|
1508 |
+
$.fn.rows = rows;
|
1509 |
+
$.fn.checkLines = checkLines;
|
1510 |
+
$.fn.findNext = findNext;
|
1511 |
+
$.fn.findPrev = findPrev;
|
1512 |
+
$.fn.progress = progress;
|
1513 |
+
|
1514 |
+
exports.default = {
|
1515 |
+
serializeJSON: serializeJSON,
|
1516 |
+
LP_Tooltip: LP_Tooltip,
|
1517 |
+
hasEvent: hasEvent,
|
1518 |
+
dataToJSON: dataToJSON,
|
1519 |
+
rows: rows,
|
1520 |
+
checkLines: checkLines,
|
1521 |
+
findNext: findNext,
|
1522 |
+
findPrev: findPrev,
|
1523 |
+
progress: progress
|
1524 |
+
};
|
1525 |
+
|
1526 |
+
/***/ })
|
1527 |
+
|
1528 |
+
/******/ });
|
1529 |
+
//# sourceMappingURL=global.js.map
|
assets/js/global.min.js
CHANGED
@@ -1,600 +1 @@
|
|
1 |
-
if (typeof window.LP == "undefined") {
|
2 |
-
window.LP = {}
|
3 |
-
}
|
4 |
-
(function ($) {
|
5 |
-
$.fn.serializeJSON = function () {
|
6 |
-
var unIndexed = $(this).serializeArray(), indexed = {}, validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g, arrayKeys = {}, end = false;
|
7 |
-
$.each(unIndexed, function () {
|
8 |
-
var that = this, match = this.name.match(/^([0-9a-zA-Z_-]+)/);
|
9 |
-
if (!match) {
|
10 |
-
return
|
11 |
-
}
|
12 |
-
var keys = this.name.match(validate), objPath = "indexed['" + match[0] + "']";
|
13 |
-
if (keys) {
|
14 |
-
if (typeof indexed[match[0]] != "object") {
|
15 |
-
indexed[match[0]] = {}
|
16 |
-
}
|
17 |
-
$.each(keys, function (i, prop) {
|
18 |
-
prop = prop.replace(/\]|\[/g, "");
|
19 |
-
var rawPath = objPath.replace(/'|\[|\]/g, ""), objExp = "", preObjPath = objPath;
|
20 |
-
if (prop == "") {
|
21 |
-
if (arrayKeys[rawPath] == undefined) {
|
22 |
-
arrayKeys[rawPath] = 0
|
23 |
-
} else {
|
24 |
-
arrayKeys[rawPath]++
|
25 |
-
}
|
26 |
-
objPath += "['" + arrayKeys[rawPath] + "']"
|
27 |
-
} else {
|
28 |
-
if (!isNaN(prop)) {
|
29 |
-
arrayKeys[rawPath] = prop
|
30 |
-
}
|
31 |
-
objPath += "['" + prop + "']"
|
32 |
-
}
|
33 |
-
try {
|
34 |
-
if (i == keys.length - 1) {
|
35 |
-
objExp = objPath + "=that.value;";
|
36 |
-
end = true
|
37 |
-
} else {
|
38 |
-
objExp = objPath + "={}";
|
39 |
-
end = false
|
40 |
-
}
|
41 |
-
var evalString = "if( typeof " + objPath + " == 'undefined'){" + objExp + ";}else{if(end){if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}}";
|
42 |
-
eval(evalString)
|
43 |
-
} catch (e) {
|
44 |
-
console.log("Error:" + e + "\n" + objExp)
|
45 |
-
}
|
46 |
-
})
|
47 |
-
} else {
|
48 |
-
indexed[match[0]] = this.value
|
49 |
-
}
|
50 |
-
indexed["how-old-are-you"] = 11
|
51 |
-
});
|
52 |
-
return indexed
|
53 |
-
};
|
54 |
-
$.fn.hasEvent = function (name) {
|
55 |
-
var events = $(this).data("events");
|
56 |
-
if (typeof events.LP == "undefined") {
|
57 |
-
return false
|
58 |
-
}
|
59 |
-
for (i = 0; i < events.LP.length; i++) {
|
60 |
-
if (events.LP[i].namespace == name) {
|
61 |
-
return true
|
62 |
-
}
|
63 |
-
}
|
64 |
-
return false
|
65 |
-
};
|
66 |
-
$.fn.dataToJSON = function () {
|
67 |
-
var json = {};
|
68 |
-
$.each(this[0].attributes, function () {
|
69 |
-
var m = this.name.match(/^data-(.*)/);
|
70 |
-
if (m) {
|
71 |
-
json[m[1]] = this.value
|
72 |
-
}
|
73 |
-
});
|
74 |
-
return json
|
75 |
-
};
|
76 |
-
String.prototype.getQueryVar = function (name) {
|
77 |
-
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
78 |
-
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(this);
|
79 |
-
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "))
|
80 |
-
};
|
81 |
-
String.prototype.addQueryVar = function (name, value) {
|
82 |
-
var url = this;
|
83 |
-
if (name.match(/\[/)) {
|
84 |
-
url += url.match(/\?/) ? "&" : "?";
|
85 |
-
url += name + "=" + value
|
86 |
-
} else {
|
87 |
-
if ((url.indexOf("&" + name + "=") != -1) || (url.indexOf("?" + name + "=") != -1)) {
|
88 |
-
url = url.replace(new RegExp(name + "=([^&#]*)", "g"), name + "=" + value)
|
89 |
-
} else {
|
90 |
-
url += url.match(/\?/) ? "&" : "?";
|
91 |
-
url += name + "=" + value
|
92 |
-
}
|
93 |
-
}
|
94 |
-
return url
|
95 |
-
};
|
96 |
-
String.prototype.removeQueryVar = function (name) {
|
97 |
-
var url = this;
|
98 |
-
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
99 |
-
var regex = new RegExp("[\\?&]" + name + "([[][^=]*)?=([^&#]*)", "g");
|
100 |
-
url = url.replace(regex, "");
|
101 |
-
return url
|
102 |
-
};
|
103 |
-
LP.MessageBox = {
|
104 |
-
$block : null,
|
105 |
-
$window : null,
|
106 |
-
events : {},
|
107 |
-
instances : [],
|
108 |
-
instance : null,
|
109 |
-
quickConfirm : function (elem, args) {
|
110 |
-
var $e = $(elem);
|
111 |
-
$("[learn-press-quick-confirm]").each(function () {
|
112 |
-
($ins = $(this).data("quick-confirm")) && (console.log($ins), $ins.destroy())
|
113 |
-
});
|
114 |
-
!$e.attr("learn-press-quick-confirm") && $e.attr("learn-press-quick-confirm", "true").data("quick-confirm", new (function (elem, args) {
|
115 |
-
var $elem = $(elem), $div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem), offset = $(elem).position() || {
|
116 |
-
left: 0,
|
117 |
-
top : 0
|
118 |
-
}, timerOut = null, timerHide = null, n = 3, hide = function () {
|
119 |
-
$div.fadeOut("fast", function () {
|
120 |
-
$(this).remove();
|
121 |
-
$div.parent().css("position", "")
|
122 |
-
});
|
123 |
-
$elem.removeAttr("learn-press-quick-confirm").data("quick-confirm", undefined);
|
124 |
-
stop()
|
125 |
-
}, stop = function () {
|
126 |
-
timerHide && clearInterval(timerHide);
|
127 |
-
timerOut && clearInterval(timerOut)
|
128 |
-
}, start = function () {
|
129 |
-
timerOut = setInterval(function () {
|
130 |
-
if (--n == 0) {
|
131 |
-
hide.call($div[0]);
|
132 |
-
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
133 |
-
stop()
|
134 |
-
}
|
135 |
-
$div.find("span").html(" (" + n + ")")
|
136 |
-
}, 1000);
|
137 |
-
timerHide = setInterval(function () {
|
138 |
-
if (!$elem.is(":visible") || $elem.css("visibility") == "hidden") {
|
139 |
-
stop();
|
140 |
-
$div.remove();
|
141 |
-
$div.parent().css("position", "");
|
142 |
-
$.isFunction(args.onCancel) && args.onCancel(args.data)
|
143 |
-
}
|
144 |
-
}, 350)
|
145 |
-
};
|
146 |
-
args = $.extend({
|
147 |
-
message : "",
|
148 |
-
data : null,
|
149 |
-
onOk : null,
|
150 |
-
onCancel: null,
|
151 |
-
offset : {top: 0, left: 0}
|
152 |
-
}, args || {});
|
153 |
-
$div.html(args.message || $elem.attr("data-confirm-remove") || "Are you sure?").append("<span> (" + n + ")</span>").css({});
|
154 |
-
$div.click(function () {
|
155 |
-
$.isFunction(args.onOk) && args.onOk(args.data);
|
156 |
-
hide()
|
157 |
-
}).hover(function () {
|
158 |
-
stop()
|
159 |
-
}, function () {
|
160 |
-
start()
|
161 |
-
});
|
162 |
-
$div.css({
|
163 |
-
left: ((offset.left + $elem.outerWidth()) - $div.outerWidth()) + args.offset.left,
|
164 |
-
top : offset.top + $elem.outerHeight() + args.offset.top + 5
|
165 |
-
}).hide().fadeIn("fast");
|
166 |
-
start();
|
167 |
-
this.destroy = function () {
|
168 |
-
$div.remove();
|
169 |
-
$elem.removeAttr("learn-press-quick-confirm").data("quick-confirm", undefined);
|
170 |
-
stop();
|
171 |
-
console.log("die")
|
172 |
-
}
|
173 |
-
})(elem, args))
|
174 |
-
},
|
175 |
-
show : function (message, args) {
|
176 |
-
$.proxy(function () {
|
177 |
-
args = $.extend({
|
178 |
-
title : "",
|
179 |
-
buttons : "",
|
180 |
-
events : false,
|
181 |
-
autohide: false,
|
182 |
-
message : message,
|
183 |
-
data : false,
|
184 |
-
id : LP.uniqueId(),
|
185 |
-
onHide : null
|
186 |
-
}, args || {});
|
187 |
-
this.instances.push(args);
|
188 |
-
this.instance = args;
|
189 |
-
var $doc = $(document), $body = $(document.body);
|
190 |
-
if (!this.$block) {
|
191 |
-
this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body)
|
192 |
-
}
|
193 |
-
if (!this.$window) {
|
194 |
-
this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
|
195 |
-
this.$window.click(function () {
|
196 |
-
})
|
197 |
-
}
|
198 |
-
this._createWindow(message, args.title, args.buttons);
|
199 |
-
this.$block.show();
|
200 |
-
this.$window.show().attr("instance", args.id);
|
201 |
-
$(window).bind("resize.message-box", $.proxy(this.update, this)).bind("scroll.message-box", $.proxy(this.update, this));
|
202 |
-
this.update(true);
|
203 |
-
if (args.autohide) {
|
204 |
-
setTimeout(function () {
|
205 |
-
LP.MessageBox.hide();
|
206 |
-
$.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args)
|
207 |
-
}, args.autohide)
|
208 |
-
}
|
209 |
-
}, this)()
|
210 |
-
},
|
211 |
-
blockUI : function (message) {
|
212 |
-
message = (message !== false ? (message ? message : "Wait a moment") : "") + '<div class="message-box-animation"></div>';
|
213 |
-
this.show(message)
|
214 |
-
},
|
215 |
-
hide : function (delay, instance) {
|
216 |
-
if (instance) {
|
217 |
-
this._removeInstance(instance.id)
|
218 |
-
} else {
|
219 |
-
if (this.instance) {
|
220 |
-
this._removeInstance(this.instance.id)
|
221 |
-
}
|
222 |
-
}
|
223 |
-
if (this.instances.length == 0) {
|
224 |
-
if (this.$block) {
|
225 |
-
this.$block.hide()
|
226 |
-
}
|
227 |
-
if (this.$window) {
|
228 |
-
this.$window.hide()
|
229 |
-
}
|
230 |
-
$(window).unbind("resize.message-box", this.update).unbind("scroll.message-box", this.update)
|
231 |
-
} else {
|
232 |
-
if (this.instance) {
|
233 |
-
this._createWindow(this.instance.message, this.instance.title, this.instance.buttons)
|
234 |
-
}
|
235 |
-
}
|
236 |
-
},
|
237 |
-
update : function (force) {
|
238 |
-
var that = this, $wrap = this.$window.find("#message-box-wrap"), timer = $wrap.data("timer"), _update = function () {
|
239 |
-
LP.Hook.doAction("learn_press_message_box_before_resize", that);
|
240 |
-
var $content = $wrap.find(".message-box-content").css("height", "").css("overflow", "hidden"), width = $wrap.outerWidth(), height = $wrap.outerHeight(), contentHeight = $content.height(), windowHeight = $(window).height(), top = $wrap.offset().top;
|
241 |
-
if (contentHeight > windowHeight - 50) {
|
242 |
-
$content.css({height: windowHeight - 50});
|
243 |
-
height = $wrap.outerHeight()
|
244 |
-
} else {
|
245 |
-
$content.css("height", "").css("overflow", "")
|
246 |
-
}
|
247 |
-
$wrap.css({marginTop: ($(window).height() - height) / 2});
|
248 |
-
LP.Hook.doAction("learn_press_message_box_resize", height, that)
|
249 |
-
};
|
250 |
-
if (force) {
|
251 |
-
_update()
|
252 |
-
}
|
253 |
-
timer && clearTimeout(timer);
|
254 |
-
timer = setTimeout(_update, 250)
|
255 |
-
},
|
256 |
-
_removeInstance: function (id) {
|
257 |
-
for (var i = 0; i < this.instances.length; i++) {
|
258 |
-
if (this.instances[i].id == id) {
|
259 |
-
this.instances.splice(i, 1);
|
260 |
-
var len = this.instances.length;
|
261 |
-
if (len) {
|
262 |
-
this.instance = this.instances[len - 1];
|
263 |
-
this.$window.attr("instance", this.instance.id)
|
264 |
-
} else {
|
265 |
-
this.instance = false;
|
266 |
-
this.$window.removeAttr("instance")
|
267 |
-
}
|
268 |
-
break
|
269 |
-
}
|
270 |
-
}
|
271 |
-
},
|
272 |
-
_getInstance : function (id) {
|
273 |
-
for (var i = 0; i < this.instances.length; i++) {
|
274 |
-
if (this.instances[i].id == id) {
|
275 |
-
return this.instances[i];
|
276 |
-
break
|
277 |
-
}
|
278 |
-
}
|
279 |
-
},
|
280 |
-
_createWindow : function (message, title, buttons) {
|
281 |
-
var $wrap = this.$window.find("#message-box-wrap").html("");
|
282 |
-
if (title) {
|
283 |
-
$wrap.append('<h3 class="message-box-title">' + title + "</h3>")
|
284 |
-
}
|
285 |
-
$wrap.append($('<div class="message-box-content"></div>').html(message));
|
286 |
-
if (buttons) {
|
287 |
-
var $buttons = $('<div class="message-box-buttons"></div>');
|
288 |
-
switch (buttons) {
|
289 |
-
case"yesNo":
|
290 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_yes, "yes"));
|
291 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_no, "no"));
|
292 |
-
break;
|
293 |
-
case"okCancel":
|
294 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_ok, "ok"));
|
295 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_cancel, "cancel"));
|
296 |
-
break;
|
297 |
-
default:
|
298 |
-
$buttons.append(this._createButton(LP_Settings.localize.button_ok, "ok"))
|
299 |
-
}
|
300 |
-
$wrap.append($buttons)
|
301 |
-
}
|
302 |
-
},
|
303 |
-
_createButton : function (title, type) {
|
304 |
-
var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + "</button>"), callback = "on" + (type.substr(0, 1).toUpperCase() + type.substr(1));
|
305 |
-
$button.data("callback", callback).click(function () {
|
306 |
-
var instance = $(this).data("instance"), callback = instance.events[$(this).data("callback")];
|
307 |
-
if ($.type(callback) == "function") {
|
308 |
-
if (callback.apply(LP.MessageBox, [instance]) === false) {
|
309 |
-
return
|
310 |
-
} else {
|
311 |
-
LP.MessageBox.hide(null, instance)
|
312 |
-
}
|
313 |
-
} else {
|
314 |
-
LP.MessageBox.hide(null, instance)
|
315 |
-
}
|
316 |
-
}).data("instance", this.instance);
|
317 |
-
return $button
|
318 |
-
}
|
319 |
-
};
|
320 |
-
LP.Hook = {
|
321 |
-
hooks : {action: {}, filter: {}}, addAction: function (action, callable, priority, tag) {
|
322 |
-
this.addHook("action", action, callable, priority, tag);
|
323 |
-
return this
|
324 |
-
}, addFilter : function (action, callable, priority, tag) {
|
325 |
-
this.addHook("filter", action, callable, priority, tag);
|
326 |
-
return this
|
327 |
-
}, doAction : function (action) {
|
328 |
-
this.doHook("action", action, arguments);
|
329 |
-
return this
|
330 |
-
}, applyFilters: function (action) {
|
331 |
-
return this.doHook("filter", action, arguments)
|
332 |
-
}, removeAction: function (action, tag) {
|
333 |
-
this.removeHook("action", action, tag);
|
334 |
-
return this
|
335 |
-
}, removeFilter: function (action, priority, tag) {
|
336 |
-
this.removeHook("filter", action, priority, tag);
|
337 |
-
return this
|
338 |
-
}, addHook : function (hookType, action, callable, priority, tag) {
|
339 |
-
if (undefined == this.hooks[hookType][action]) {
|
340 |
-
this.hooks[hookType][action] = []
|
341 |
-
}
|
342 |
-
var hooks = this.hooks[hookType][action];
|
343 |
-
if (undefined == tag) {
|
344 |
-
tag = action + "_" + hooks.length
|
345 |
-
}
|
346 |
-
this.hooks[hookType][action].push({tag: tag, callable: callable, priority: priority});
|
347 |
-
return this
|
348 |
-
}, doHook : function (hookType, action, args) {
|
349 |
-
args = Array.prototype.slice.call(args, 1);
|
350 |
-
if (undefined != this.hooks[hookType][action]) {
|
351 |
-
var hooks = this.hooks[hookType][action], hook;
|
352 |
-
hooks.sort(function (a, b) {
|
353 |
-
return a.priority - b.priority
|
354 |
-
});
|
355 |
-
for (var i = 0; i < hooks.length; i++) {
|
356 |
-
hook = hooks[i].callable;
|
357 |
-
if (typeof hook != "function") {
|
358 |
-
hook = window[hook]
|
359 |
-
}
|
360 |
-
if ("action" == hookType) {
|
361 |
-
hook.apply(null, args)
|
362 |
-
} else {
|
363 |
-
args[0] = hook.apply(null, args)
|
364 |
-
}
|
365 |
-
}
|
366 |
-
}
|
367 |
-
if ("filter" == hookType) {
|
368 |
-
return args[0]
|
369 |
-
}
|
370 |
-
return this
|
371 |
-
}, removeHook : function (hookType, action, priority, tag) {
|
372 |
-
if (undefined != this.hooks[hookType][action]) {
|
373 |
-
var hooks = this.hooks[hookType][action];
|
374 |
-
for (var i = hooks.length - 1; i >= 0; i--) {
|
375 |
-
if ((undefined == tag || tag == hooks[i].tag) && (undefined == priority || priority == hooks[i].priority)) {
|
376 |
-
hooks.splice(i, 1)
|
377 |
-
}
|
378 |
-
}
|
379 |
-
}
|
380 |
-
return this
|
381 |
-
}
|
382 |
-
};
|
383 |
-
LP = $.extend({
|
384 |
-
setUrl : function (url, title) {
|
385 |
-
history.pushState({}, title, url)
|
386 |
-
}, getUrl : function () {
|
387 |
-
return window.location.href
|
388 |
-
}, addQueryVar : function (name, value, url) {
|
389 |
-
return (url == undefined ? window.location.href : url).addQueryVar(name, value)
|
390 |
-
}, removeQueryVar: function (name, url) {
|
391 |
-
return (url == undefined ? window.location.href : url).removeQueryVar(name)
|
392 |
-
}, reload : function (url) {
|
393 |
-
if (!url) {
|
394 |
-
url = window.location.href
|
395 |
-
}
|
396 |
-
window.location.href = url
|
397 |
-
}, parseJSON : function (data) {
|
398 |
-
var m = data.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
399 |
-
try {
|
400 |
-
if (m) {
|
401 |
-
data = $.parseJSON(m[1])
|
402 |
-
} else {
|
403 |
-
data = $.parseJSON(data)
|
404 |
-
}
|
405 |
-
} catch (e) {
|
406 |
-
LP.log(e);
|
407 |
-
data = {}
|
408 |
-
}
|
409 |
-
return data
|
410 |
-
}, parseResponse : function (response, type) {
|
411 |
-
var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
412 |
-
if (m) {
|
413 |
-
response = m[1]
|
414 |
-
}
|
415 |
-
return (type || "json") == "json" ? this.parseJSON(response) : response
|
416 |
-
}, ajax : function (args) {
|
417 |
-
var type = args.type || "post", dataType = args.dataType || "json", data = args.action ? $.extend(args.data, {"lp-ajax": args.action}) : args.data, url = args.url || window.location.href;
|
418 |
-
$.ajax({
|
419 |
-
data : data, url: url, type: type, dataType: "html", success: function (raw) {
|
420 |
-
var response = LP.parseResponse(raw, dataType);
|
421 |
-
$.isFunction(args.success) && args.success(response, raw)
|
422 |
-
}, error: function () {
|
423 |
-
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array())
|
424 |
-
}
|
425 |
-
})
|
426 |
-
}, doAjax : function (args) {
|
427 |
-
var type = args.type || "post", dataType = args.dataType || "json", action = ((args.prefix == undefined) || "learnpress_") + args.action, data = args.action ? $.extend(args.data, {action: action}) : args.data;
|
428 |
-
$.ajax({
|
429 |
-
data : data,
|
430 |
-
url : (args.url || window.location.href),
|
431 |
-
type : type,
|
432 |
-
dataType: "html",
|
433 |
-
success : function (raw) {
|
434 |
-
var response = LP.parseResponse(raw, dataType);
|
435 |
-
$.isFunction(args.success) && args.success(response, raw)
|
436 |
-
},
|
437 |
-
error : function () {
|
438 |
-
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array())
|
439 |
-
}
|
440 |
-
})
|
441 |
-
}, funcArgs2Array: function (args) {
|
442 |
-
var arr = [];
|
443 |
-
for (var i = 0; i < args.length; i++) {
|
444 |
-
arr.push(args[i])
|
445 |
-
}
|
446 |
-
return arr
|
447 |
-
}, addFilter : function (action, callback) {
|
448 |
-
var $doc = $(document), event = "LP." + action;
|
449 |
-
$doc.on(event, callback);
|
450 |
-
LP.log($doc.data("events"));
|
451 |
-
return this
|
452 |
-
}, applyFilters : function () {
|
453 |
-
var $doc = $(document), action = arguments[0], args = this.funcArgs2Array(arguments);
|
454 |
-
if ($doc.hasEvent(action)) {
|
455 |
-
args[0] = "LP." + action;
|
456 |
-
return $doc.triggerHandler.apply($doc, args)
|
457 |
-
}
|
458 |
-
return args[1]
|
459 |
-
}, addAction : function (action, callback) {
|
460 |
-
return this.addFilter(action, callback)
|
461 |
-
}, doAction : function () {
|
462 |
-
var $doc = $(document), action = arguments[0], args = this.funcArgs2Array(arguments);
|
463 |
-
if ($doc.hasEvent(action)) {
|
464 |
-
args[0] = "LP." + action;
|
465 |
-
$doc.trigger.apply($doc, args)
|
466 |
-
}
|
467 |
-
}, toElement : function (element, args) {
|
468 |
-
if ($(element).length == 0) {
|
469 |
-
return
|
470 |
-
}
|
471 |
-
args = $.extend({delay: 300, duration: "slow", offset: 50, callback: null}, args || {});
|
472 |
-
$("body, html").fadeIn(10).delay(args.delay).animate({scrollTop: $(element).offset().top - args.offset}, args.duration, args.callback)
|
473 |
-
}, uniqueId : function (prefix, more_entropy) {
|
474 |
-
if (typeof prefix === "undefined") {
|
475 |
-
prefix = ""
|
476 |
-
}
|
477 |
-
var retId;
|
478 |
-
var formatSeed = function (seed, reqWidth) {
|
479 |
-
seed = parseInt(seed, 10).toString(16);
|
480 |
-
if (reqWidth < seed.length) {
|
481 |
-
return seed.slice(seed.length - reqWidth)
|
482 |
-
}
|
483 |
-
if (reqWidth > seed.length) {
|
484 |
-
return Array(1 + (reqWidth - seed.length)).join("0") + seed
|
485 |
-
}
|
486 |
-
return seed
|
487 |
-
};
|
488 |
-
if (!this.php_js) {
|
489 |
-
this.php_js = {}
|
490 |
-
}
|
491 |
-
if (!this.php_js.uniqidSeed) {
|
492 |
-
this.php_js.uniqidSeed = Math.floor(Math.random() * 123456789)
|
493 |
-
}
|
494 |
-
this.php_js.uniqidSeed++;
|
495 |
-
retId = prefix;
|
496 |
-
retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
|
497 |
-
retId += formatSeed(this.php_js.uniqidSeed, 5);
|
498 |
-
if (more_entropy) {
|
499 |
-
retId += (Math.random() * 10).toFixed(8).toString()
|
500 |
-
}
|
501 |
-
return retId
|
502 |
-
}, log : function () {
|
503 |
-
for (var i = 0, n = arguments.length; i < n; i++) {
|
504 |
-
console.log(arguments[i])
|
505 |
-
}
|
506 |
-
}, template : _.memoize(function (id, data) {
|
507 |
-
var compiled, options = {
|
508 |
-
evaluate : /<#([\s\S]+?)#>/g,
|
509 |
-
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
510 |
-
escape : /\{\{([^\}]+?)\}\}(?!\})/g,
|
511 |
-
variable : "data"
|
512 |
-
};
|
513 |
-
var tmpl = function (data) {
|
514 |
-
compiled = compiled || _.template($("#" + id).html(), null, options);
|
515 |
-
return compiled(data)
|
516 |
-
};
|
517 |
-
return data ? tmpl(data) : tmpl
|
518 |
-
}, function (a, b) {
|
519 |
-
return JSON.stringify(b)
|
520 |
-
}), alert : function (localize, callback) {
|
521 |
-
var title = "", message = "";
|
522 |
-
if (typeof localize == "string") {
|
523 |
-
message = localize
|
524 |
-
} else {
|
525 |
-
if (typeof localize.title != "undefined") {
|
526 |
-
title = localize.title
|
527 |
-
}
|
528 |
-
if (typeof localize.message != "undefined") {
|
529 |
-
message = localize.message
|
530 |
-
}
|
531 |
-
}
|
532 |
-
$.alerts.alert(message, title, function (e) {
|
533 |
-
LP._on_alert_hide();
|
534 |
-
callback && callback(e)
|
535 |
-
});
|
536 |
-
this._on_alert_show()
|
537 |
-
}, confirm : function (localize, callback) {
|
538 |
-
var title = "", message = "";
|
539 |
-
if (typeof localize == "string") {
|
540 |
-
message = localize
|
541 |
-
} else {
|
542 |
-
if (typeof localize.title != "undefined") {
|
543 |
-
title = localize.title
|
544 |
-
}
|
545 |
-
if (typeof localize.message != "undefined") {
|
546 |
-
message = localize.message
|
547 |
-
}
|
548 |
-
}
|
549 |
-
$.alerts.confirm(message, title, function (e) {
|
550 |
-
LP._on_alert_hide();
|
551 |
-
callback && callback(e)
|
552 |
-
});
|
553 |
-
this._on_alert_show()
|
554 |
-
}, _on_alert_show: function () {
|
555 |
-
var $container = $("#popup_container"), $placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data("xxx", $container);
|
556 |
-
$container.stop().css("top", "-=50").css("opacity", "0").animate({top: "+=50", opacity: 1}, 250)
|
557 |
-
}, _on_alert_hide: function () {
|
558 |
-
var $holder = $("#popup_container_placeholder"), $container = $holder.data("xxx");
|
559 |
-
if ($container) {
|
560 |
-
$container.replaceWith($holder)
|
561 |
-
}
|
562 |
-
$container.appendTo($(document.body));
|
563 |
-
$container.stop().animate({top: "+=50", opacity: 0}, 250, function () {
|
564 |
-
$(this).remove()
|
565 |
-
})
|
566 |
-
}
|
567 |
-
}, LP);
|
568 |
-
$.fn.findNext = function (selector) {
|
569 |
-
var $selector = $(selector), $root = this.first(), index = $selector.index($root), $next = $selector.eq(index + 1);
|
570 |
-
return $next.length ? $next : false
|
571 |
-
};
|
572 |
-
$.fn.findPrev = function (selector) {
|
573 |
-
var $selector = $(selector), $root = this.first(), index = $selector.index($root), $prev = $selector.eq(index - 1);
|
574 |
-
return $prev.length ? $prev : false
|
575 |
-
};
|
576 |
-
function __initSubtabs() {
|
577 |
-
$(".learn-press-subtabs").each(function () {
|
578 |
-
var $tabContainer = $(this), $tabs = $tabContainer.find("a"), current = null;
|
579 |
-
$tabs.click(function (e) {
|
580 |
-
var $tab = $(this), $contentID = $tab.attr("href");
|
581 |
-
$tab.parent().addClass("current").siblings().removeClass("current");
|
582 |
-
current = $($contentID).addClass("current");
|
583 |
-
current.siblings().removeClass("current");
|
584 |
-
e.preventDefault()
|
585 |
-
}).filter(function () {
|
586 |
-
return $(this).attr("href") == window.location.hash
|
587 |
-
}).trigger("click");
|
588 |
-
if (!current) {
|
589 |
-
$tabs.first().trigger("click")
|
590 |
-
}
|
591 |
-
})
|
592 |
-
}
|
593 |
-
|
594 |
-
$(document).ready(function () {
|
595 |
-
if (typeof $.alerts != "undefined") {
|
596 |
-
$.alerts.overlayColor = "#000";
|
597 |
-
$.alerts.overlayOpacity = 0.5
|
598 |
-
}
|
599 |
-
})
|
600 |
-
})(jQuery);
|
1 |
+
!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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=62)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}},1:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(0),s=i(a),r=n(2),c=i(r),l=n(3),u=i(l),d=n(4),f=i(d),p=n(5),h=i(p),v=n(6),g=i(v),m=n(7),y=(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]);e.default=t}(m),jQuery);String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)"),n=e.exec(this);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,i=n.split("#");return n=i[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(i[1]?"#"+i[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(i,""))+(n[1]?"#"+n[1]:"")},0==y.isEmptyObject("")&&(y.isEmptyObject=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0});var b={Hook:g.default,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=y(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle(function(){y(this).is(":visible")?y(e).addClass("toggle-on").removeClass("toggle-off"):y(e).addClass("toggle-off").removeClass("toggle-on")})},overflow:function(t,e){var n=y(t),i=n.css("overflow");e?n.css("overflow",e).data("overflow",i):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){var e=(t+"").match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);try{t=e?y.parseJSON(e[1]):y.parseJSON(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",i=t.action?y.extend(t.data,{"lp-ajax":t.action}):t.data,o=t.beforeSend||function(){},a=t.url||window.location.href;y.ajax({data:i,url:a,type:e,dataType:"html",beforeSend:o.apply(null,t),success:function(e){var i=LP.parseResponse(e,n);y.isFunction(t.success)&&t.success(i,e)},error:function(){y.isFunction(t.error)&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",i=(void 0===t.prefix||"learnpress_")+t.action,o=t.action?y.extend(t.data,{action:i}):t.data;y.ajax({data:o,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var i=LP.parseResponse(e,n);y.isFunction(t.success)&&t.success(i,e)},error:function(){y.isFunction(t.error)&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},addFilter:function(t,e){var n=y(document),i="LP."+t;return n.on(i,e),LP.log(n.data("events")),this},applyFilters:function(){var t=y(document),e=arguments[0],n=this.funcArgs2Array(arguments);return t.hasEvent(e)?(n[0]="LP."+e,t.triggerHandler.apply(t,n)):n[1]},addAction:function(t,e){return this.addFilter(t,e)},doAction:function(){var t=y(document),e=arguments[0],n=this.funcArgs2Array(arguments);t.hasEvent(e)&&(n[0]="LP."+e,t.trigger.apply(t,n))},toElement:function(t,e){if(0!==y(t).length){e=y.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},e||{});var n=y(e.container),i=0;0===n.length&&(n=y("body, html")),i=n.offset().top;var o=y(t).offset().top+n.scrollTop()-i-e.offset;e.invisible&&function(t,e){var i=n.scrollTop(),o=i+n.height(),a=y(t).offset().top-n.offset().top,s=a+y(t).height();return!0===e?i<a&&o>s:a<=o&&s>=i}(t,!0)||n.fadeIn(10).delay(e.delay).animate({scrollTop:o},e.duration,e.callback)}},uniqueId:function(t,e){void 0===t&&(t="");var n,i=function(t,e){return t=parseInt(t,10).toString(16),e<t.length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=i(parseInt((new Date).getTime()/1e3,10),8),n+=i(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t<e;t++)console.log(arguments[t])},blockContent:function(){0===y("#learn-press-block-content").length&&y(LP.template("learn-press-template-block-content",{})).appendTo(y("body")),LP.hideMainScrollbar().addClass("block-content"),y(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout(function(){LP.showMainScrollbar().removeClass("block-content"),y(document).trigger("learn_press_unblock_content")},350)},hideMainScrollbar:function(t){t||(t="html, body");var e=y(t);return e.each(function(){var t=y(this),e=t.css("overflow");t.css("overflow","hidden").attr("overflow",e)}),e},showMainScrollbar:function(t){t||(t="html, body");var e=y(t);return e.each(function(){var t=y(this),e=t.attr("overflow");t.css("overflow",e).removeAttr("overflow")}),e},template:"undefined"!=typeof _?_.memoize(function(t,e){var n,i={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=function(e){return(n=n||_.template(y("#"+t).html(),null,i))(e)};return e?o(e):o},function(t,e){return t+"-"+JSON.stringify(e)}):function(){return""},alert:function(t,e){var n="",i="";"string"==typeof t?i=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(i=t.message)),y.alerts.alert(i,n,function(t){LP._on_alert_hide(),e&&e(t)}),this._on_alert_show()},confirm:function(t,e){var n="",i="";"string"==typeof t?i=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(i=t.message)),y.alerts.confirm(i,n,function(t){LP._on_alert_hide(),e&&e(t)}),this._on_alert_show()},_on_alert_show:function(){var t=y("#popup_container");y('<span id="popup_container_placeholder" />').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=y("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(y(document.body)),e.stop().animate({top:"+=50",opacity:0},250,function(){y(this).remove()})},sendMessage:function(t,e,n,i){y.isPlainObject(t)&&(t=JSON.stringify(t)),e=e||window,n=n||"*",e.postMessage(t,n,i)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,i=t.data||t.originalEvent.data||"";("string"==typeof i||i instanceof String)&&0===i.indexOf("{")&&(i=LP.parseJSON(i)),LP.Hook.doAction("learn_press_receive_message",i,n)}};y(document).ready(function(){void 0!==y.alerts&&(y.alerts.overlayColor="#000",y.alerts.overlayOpacity=.5,y.alerts.okButton=lpGlobalSettings.localize.button_ok,y.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),y(".learn-press-message.fixed").each(function(){var t=y(this),e=t.data();!function(t,e){e.delayIn&&setTimeout(function(){t.show().hide().fadeIn()},e.delayIn),e.delayOut&&setTimeout(function(){t.fadeOut()},e.delayOut+(e.delayIn||0))}(t,e)}),y("body").on("click",".learn-press-nav-tabs li a",function(t){t.preventDefault();var e=y(this);e.closest("li").addClass("active").siblings().removeClass("active"),y(e.attr("data-tab")).addClass("active").siblings().removeClass("active"),y(document).trigger("learn-press/nav-tabs/clicked",e)}),setTimeout(function(){y(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")},300),y("body.course-item-popup").parent().css("overflow","hidden"),function(){var t=null,e=function(){y(".auto-check-lines").checkLines(function(t){t>1?y(this).removeClass("single-lines"):y(this).addClass("single-lines"),y(this).attr("rows",t)})};y(window).on("resize.check-lines",function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})}(),y(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),y(".learn-press-icon").LP_Tooltip({offset:[30,30]}),y(".learn-press-message[data-autoclose]").each(function(){var t=y(this),e=parseInt(t.data("autoclose"));e&&setTimeout(function(t){t.fadeOut()},e,t)}),y(document).on("click",function(){y(document).trigger("learn-press/close-all-quick-tip")})}),(0,s.default)(o({Event_Callback:h.default,MessageBox:f.default},b)),e.default={fn:c.default,QuickTip:u.default}},2:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=window.jQuery;!function(){void 0!==o&&(o.fn.LP=i=function(t,e){if(o.isFunction(e))o.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var i=1;i<arguments.length;i++)n.push(arguments[i]);return o.isFunction(o(this)["LP_"+t])?o(this)["LP_"+t].apply(this,n):this}return this})}(),e.default=i},3:function(t,e,n){"use strict";!function(t){function e(e,n){function i(){if(d)return void clearTimeout(d);n.single&&t(".learn-press-tip").not(r).LP("QuickTip","close"),u.appendTo(document.body);var e=r.offset();u.css({top:e.top-u.outerHeight()-8,left:e.left-u.outerWidth()/2+h})}function o(){d&&clearTimeout(d),d=setTimeout(function(){u.detach(),d=null},f)}function a(){f=0,o(),f=n.closeInterval}function s(){i()}var r=t(e),c=r.attr("data-id")||LP.uniqueId();n=t.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,r.data()),r.attr("data-id",c);var l=r.attr("data-content-tip")||r.html(),u=t('<div class="learn-press-tip-floating">'+l+"</div>"),d=null,f=0,p=!1,h="el"===n.arrowOffset?r.outerWidth()/2:8,v=t("#__"+c);return 0===v.length&&t(document.body).append(t("<div />").attr("id","__"+c).html(l).css("display","none")),l=v.html(),u.addClass(n.tipClass),r.data("content-tip",l),r.attr("data-content-tip")&&(p=!0),f=n.closeInterval,!1===n.autoClose&&(u.append('<a class="close"></a>'),u.on("click",".close",function(){a()})),p||r.html(""),"click"===n.event&&r.on("click",function(t){t.stopPropagation(),i()}),t(document).on("learn-press/close-all-quick-tip",function(){a()}),r.hover(function(t){t.stopPropagation(),"click"!==n.event&&i()},function(t){t.stopPropagation(),n.autoClose&&o()}).addClass("ready"),{close:a,open:s}}t.fn.LP("QuickTip",function(n){return t.each(this,function(){var i=t(this).data("quick-tip");i||(i=new e(this,n),t(this).data("quick-tip",i)),"string"===t.type(n)&&i[n]&&i[n].apply(i)})})}(jQuery)},4:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=window.jQuery,o={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(t,e){var n=i(t);i("[learn-press-quick-confirm]").each(function(){var t;(t=i(this).data("quick-confirm"))&&(console.log(t),t.destroy())}),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(t,e){var n=i(t),o=i('<span class="learn-press-quick-confirm"></span>').insertAfter(n),a=i(t).position()||{left:0,top:0},s=null,r=null,c=3,l=function(){o.fadeOut("fast",function(){i(this).remove(),o.parent().css("position","")}),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){r&&clearInterval(r),s&&clearInterval(s)},d=function(){s=setInterval(function(){0==--c&&(l.call(o[0]),i.isFunction(e.onCancel)&&e.onCancel(e.data),u()),o.find("span").html(" ("+c+")")},1e3),r=setInterval(function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),o.remove(),o.parent().css("position",""),i.isFunction(e.onCancel)&&e.onCancel(e.data))},350)};e=i.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),o.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+c+")</span>").css({}),o.click(function(){i.isFunction(e.onOk)&&e.onOk(e.data),l()}).hover(function(){u()},function(){d()}),o.css({left:a.left+n.outerWidth()-o.outerWidth()+e.offset.left,top:a.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),d(),this.destroy=function(){o.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){i.proxy(function(){e=i.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;var n=(i(document),i(document.body));this.$block||(this.$block=i('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=i('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click(function(){})),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),i(window).bind("resize.message-box",i.proxy(this.update,this)).bind("scroll.message-box",i.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout(function(){LP.MessageBox.hide(),i.isFunction(e.onHide)&&e.onHide.call(LP.MessageBox,e)},e.autohide)},this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),i(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),o=n.data("timer"),a=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),o=(n.outerWidth(),n.outerHeight()),a=t.height(),s=i(window).height();n.offset().top;a>s-50?(t.css({height:s-25}),o=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(i(window).height()-o)/2}),LP.Hook.doAction("learn_press_message_box_resize",o,e)};t&&a(),o&&clearTimeout(o),o=setTimeout(a,250)},_removeInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t){this.instances.splice(e,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t)return this.instances[e]},_createWindow:function(t,e,n){var o=this.$window.find("#message-box-wrap").html("");if(e&&o.append('<h3 class="message-box-title">'+e+"</h3>"),o.append(i('<div class="message-box-content"></div>').html(t)),n){var a=i('<div class="message-box-buttons"></div>');switch(n){case"yesNo":a.append(this._createButton(LP_Settings.localize.button_yes,"yes")),a.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":a.append(this._createButton(LP_Settings.localize.button_ok,"ok")),a.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:a.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}o.append(a)}},_createButton:function(t,e){var n=i('<button type="button" class="button message-box-button message-box-button-'+e+'">'+t+"</button>"),o="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",o).click(function(){var t=i(this).data("instance"),e=t.events[i(this).data("callback")];"function"===i.type(e)?!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t):LP.MessageBox.hide(null,t)}).data("instance",this.instance),n}};e.default=o},5:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){var e={},n=window.jQuery;this.on=function(n,i){var o=n.split("."),a="";return o.length>1&&(n=o[0],a=o[1]),e[n]||(e[n]=[[],{}]),a?(e[n][1][a]||(e[n][1][a]=[]),e[n][1][a].push(i)):e[n][0].push(i),t},this.off=function(i,o){var a=i.split("."),s="";if(a.length>1&&(i=a[0],s=a[1]),!e[i])return t;var r=-1;if(s){if(!e[i][1][s])return t;if(n.isFunction(o)){if((r=e[i][1][s].indexOf(o))<0)return t;e[i][1][s].splice(r,1)}else e[i][1][s]=[]}else if(n.isFunction(o)){if((r=e[i][0].indexOf(o))<0)return t;e[i][0].splice(r,1)}else e[i][0]=[];return t},this.callEvent=function(i,o){if(e[i]){if(e[i][0])for(var a=0;a<e[i][0].length;a++)n.isFunction(e[i][0][a])&&e[i][a][0].apply(t,o);if(e[i][1])for(var a in e[i][1])for(var s=0;s<e[i][1][a].length;s++)n.isFunction(e[i][1][a][s])&&e[i][1][a][s].apply(t,o)}}};e.default=i},6:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={hooks:{action:{},filter:{}},addAction:function(t,e,n,i){return this.addHook("action",t,e,n,i),this},addFilter:function(t,e,n,i){return this.addHook("filter",t,e,n,i),this},doAction:function(t){return this.doHook("action",t,arguments),this},applyFilters:function(t){return this.doHook("filter",t,arguments)},removeAction:function(t,e){return this.removeHook("action",t,e),this},removeFilter:function(t,e,n){return this.removeHook("filter",t,e,n),this},addHook:function(t,e,n,i,o){void 0===this.hooks[t][e]&&(this.hooks[t][e]=[]);var a=this.hooks[t][e];return void 0===o&&(o=e+"_"+a.length),this.hooks[t][e].push({tag:o,callable:n,priority:i}),this},doHook:function(t,e,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[t][e]){var i,o=this.hooks[t][e];o.sort(function(t,e){return t.priority-e.priority});for(var a=0;a<o.length;a++)i=o[a].callable,"function"!=typeof i&&(i=window[i]),"action"===t?i.apply(null,n):n[0]=i.apply(null,n)}return"filter"===t?n[0]:this},removeHook:function(t,e,n,i){if(void 0!==this.hooks[t][e])for(var o=this.hooks[t][e],a=o.length-1;a>=0;a--)void 0!==i&&i!==o[a].tag||void 0!==n&&n!==o[a].priority||o.splice(a,1);return this}};e.default=i},62:function(t,e,n){"use strict";var i=n(1);!function(t){t&&t.__esModule}(i)},7:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="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},$=window.jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(void 0==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(t){console.log("Error:"+t+"\n"+objExp)}})):indexed[match[0]]=this.value}}),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(t){return t=$.extend({},{offset:[0,0]},t||{}),$.each(this,function(){var e=$(this),n=e.data("content");if(n&&void 0===e.data("LP_Tooltip")){var i=null;e.hover(function(o){i=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var a=e.offset();if($.isArray(t.offset)){var s=t.offset[1],r=t.offset[0];$.isNumeric(r)&&(a.left+=r),$.isNumeric(s)&&(a.top+=s)}i.css({top:a.top,left:a.left}),i.fadeIn()},function(){i&&i.remove()}),e.data("tooltip",!0)}})},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i<e.LP.length;i++)if(e.LP[i].namespace==t)return!0;return!1},dataToJSON=function(){var t={};return $.each(this[0].attributes,function(){var e=this.name.match(/^data-(.*)/);e&&(t[e[1]]=this.value)}),t},rows=function(){var t=$(this).height(),e=$(this).css("line-height").replace("px","");return $(this).attr({height:t,"line-height":e}),Math.floor(t/parseInt(e))},checkLines=function(t){return this.each(function(){var e=$(this),n=e.rows();t.call(this,n)})},findNext=function(t){var e=$(t),n=this.first(),i=e.index(n),o=e.eq(i+1);return!!o.length&&o},findPrev=function(t){var e=$(t),n=this.first(),i=e.index(n),o=e.eq(i-1);return!!o.length&&o},progress=function(t){return this.each(function(){var e=parseInt(t/100*360),n=$(this);e<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+e+"deg)"})})};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress,exports.default={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}}});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/index.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?php // Silence is golden.
|
|
assets/js/utils.js
ADDED
@@ -0,0 +1,1506 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ([
|
67 |
+
/* 0 */
|
68 |
+
/***/ (function(module, exports, __webpack_require__) {
|
69 |
+
|
70 |
+
"use strict";
|
71 |
+
|
72 |
+
|
73 |
+
Object.defineProperty(exports, "__esModule", {
|
74 |
+
value: true
|
75 |
+
});
|
76 |
+
|
77 |
+
exports.default = function () {
|
78 |
+
window.LP = window.LP || {};
|
79 |
+
|
80 |
+
if (typeof arguments[0] === 'string') {
|
81 |
+
LP[arguments[0]] = LP[arguments[0]] || {};
|
82 |
+
LP[arguments[0]] = jQuery.extend(LP[arguments[0]], arguments[1]);
|
83 |
+
} else {
|
84 |
+
LP = jQuery.extend(LP, arguments[0]);
|
85 |
+
}
|
86 |
+
};
|
87 |
+
|
88 |
+
/***/ }),
|
89 |
+
/* 1 */
|
90 |
+
/***/ (function(module, exports, __webpack_require__) {
|
91 |
+
|
92 |
+
"use strict";
|
93 |
+
|
94 |
+
|
95 |
+
Object.defineProperty(exports, "__esModule", {
|
96 |
+
value: true
|
97 |
+
});
|
98 |
+
|
99 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**
|
100 |
+
* Utility functions may use for both admin and frontend.
|
101 |
+
*
|
102 |
+
* @version 3.2.6
|
103 |
+
*/
|
104 |
+
|
105 |
+
var _extend = __webpack_require__(0);
|
106 |
+
|
107 |
+
var _extend2 = _interopRequireDefault(_extend);
|
108 |
+
|
109 |
+
var _fn = __webpack_require__(2);
|
110 |
+
|
111 |
+
var _fn2 = _interopRequireDefault(_fn);
|
112 |
+
|
113 |
+
var _quickTip = __webpack_require__(3);
|
114 |
+
|
115 |
+
var _quickTip2 = _interopRequireDefault(_quickTip);
|
116 |
+
|
117 |
+
var _messageBox = __webpack_require__(4);
|
118 |
+
|
119 |
+
var _messageBox2 = _interopRequireDefault(_messageBox);
|
120 |
+
|
121 |
+
var _eventCallback = __webpack_require__(5);
|
122 |
+
|
123 |
+
var _eventCallback2 = _interopRequireDefault(_eventCallback);
|
124 |
+
|
125 |
+
var _hook = __webpack_require__(6);
|
126 |
+
|
127 |
+
var _hook2 = _interopRequireDefault(_hook);
|
128 |
+
|
129 |
+
var _jquery = __webpack_require__(7);
|
130 |
+
|
131 |
+
var jplugins = _interopRequireWildcard(_jquery);
|
132 |
+
|
133 |
+
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; } }
|
134 |
+
|
135 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
136 |
+
|
137 |
+
var $ = jQuery;
|
138 |
+
|
139 |
+
String.prototype.getQueryVar = function (name) {
|
140 |
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
141 |
+
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
142 |
+
results = regex.exec(this);
|
143 |
+
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
144 |
+
};
|
145 |
+
|
146 |
+
String.prototype.addQueryVar = function (name, value) {
|
147 |
+
var url = this,
|
148 |
+
m = url.split('#');
|
149 |
+
url = m[0];
|
150 |
+
if (name.match(/\[/)) {
|
151 |
+
url += url.match(/\?/) ? '&' : '?';
|
152 |
+
url += name + '=' + value;
|
153 |
+
} else {
|
154 |
+
if (url.indexOf('&' + name + '=') != -1 || url.indexOf('?' + name + '=') != -1) {
|
155 |
+
url = url.replace(new RegExp(name + "=([^&#]*)", 'g'), name + '=' + value);
|
156 |
+
} else {
|
157 |
+
url += url.match(/\?/) ? '&' : '?';
|
158 |
+
url += name + '=' + value;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
return url + (m[1] ? '#' + m[1] : '');
|
162 |
+
};
|
163 |
+
|
164 |
+
String.prototype.removeQueryVar = function (name) {
|
165 |
+
var url = this;
|
166 |
+
var m = url.split('#');
|
167 |
+
url = m[0];
|
168 |
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
169 |
+
var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
|
170 |
+
url = url.replace(regex, '');
|
171 |
+
return url + (m[1] ? '#' + m[1] : '');
|
172 |
+
};
|
173 |
+
|
174 |
+
if ($.isEmptyObject("") == false) {
|
175 |
+
$.isEmptyObject = function (a) {
|
176 |
+
var prop;
|
177 |
+
for (prop in a) {
|
178 |
+
if (a.hasOwnProperty(prop)) {
|
179 |
+
return false;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
return true;
|
183 |
+
};
|
184 |
+
}
|
185 |
+
|
186 |
+
var _default = {
|
187 |
+
Hook: _hook2.default,
|
188 |
+
setUrl: function setUrl(url, ember, title) {
|
189 |
+
if (url) {
|
190 |
+
history.pushState({}, title, url);
|
191 |
+
LP.Hook.doAction('learn_press_set_location_url', url);
|
192 |
+
}
|
193 |
+
},
|
194 |
+
toggleGroupSection: function toggleGroupSection(el, target) {
|
195 |
+
var $el = $(el),
|
196 |
+
isHide = $el.hasClass('hide-if-js');
|
197 |
+
if (isHide) {
|
198 |
+
$el.hide().removeClass('hide-if-js');
|
199 |
+
}
|
200 |
+
$el.removeClass('hide-if-js').slideToggle(function () {
|
201 |
+
var $this = $(this);
|
202 |
+
if ($this.is(':visible')) {
|
203 |
+
$(target).addClass('toggle-on').removeClass('toggle-off');
|
204 |
+
} else {
|
205 |
+
$(target).addClass('toggle-off').removeClass('toggle-on');
|
206 |
+
}
|
207 |
+
});
|
208 |
+
},
|
209 |
+
overflow: function overflow(el, v) {
|
210 |
+
var $el = $(el),
|
211 |
+
overflow = $el.css('overflow');
|
212 |
+
if (v) {
|
213 |
+
$el.css('overflow', v).data('overflow', overflow);
|
214 |
+
} else {
|
215 |
+
$el.css('overflow', $el.data('overflow'));
|
216 |
+
}
|
217 |
+
},
|
218 |
+
getUrl: function getUrl() {
|
219 |
+
return window.location.href;
|
220 |
+
},
|
221 |
+
addQueryVar: function addQueryVar(name, value, url) {
|
222 |
+
return (url === undefined ? window.location.href : url).addQueryVar(name, value);
|
223 |
+
},
|
224 |
+
removeQueryVar: function removeQueryVar(name, url) {
|
225 |
+
return (url === undefined ? window.location.href : url).removeQueryVar(name);
|
226 |
+
},
|
227 |
+
reload: function reload(url) {
|
228 |
+
if (!url) {
|
229 |
+
url = window.location.href;
|
230 |
+
}
|
231 |
+
window.location.href = url;
|
232 |
+
},
|
233 |
+
|
234 |
+
parseResponse: function parseResponse(response, type) {
|
235 |
+
var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
236 |
+
if (m) {
|
237 |
+
response = m[1];
|
238 |
+
}
|
239 |
+
return (type || "json") === "json" ? this.parseJSON(response) : response;
|
240 |
+
},
|
241 |
+
parseJSON: function parseJSON(data) {
|
242 |
+
var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);
|
243 |
+
try {
|
244 |
+
if (m) {
|
245 |
+
data = $.parseJSON(m[1]);
|
246 |
+
} else {
|
247 |
+
data = $.parseJSON(data);
|
248 |
+
}
|
249 |
+
} catch (e) {
|
250 |
+
data = {};
|
251 |
+
}
|
252 |
+
return data;
|
253 |
+
},
|
254 |
+
ajax: function ajax(args) {
|
255 |
+
var type = args.type || 'post',
|
256 |
+
dataType = args.dataType || 'json',
|
257 |
+
data = args.action ? $.extend(args.data, { 'lp-ajax': args.action }) : args.data,
|
258 |
+
beforeSend = args.beforeSend || function () {},
|
259 |
+
url = args.url || window.location.href;
|
260 |
+
// console.debug( beforeSend );
|
261 |
+
$.ajax({
|
262 |
+
data: data,
|
263 |
+
url: url,
|
264 |
+
type: type,
|
265 |
+
dataType: 'html',
|
266 |
+
beforeSend: beforeSend.apply(null, args),
|
267 |
+
success: function success(raw) {
|
268 |
+
var response = LP.parseResponse(raw, dataType);
|
269 |
+
$.isFunction(args.success) && args.success(response, raw);
|
270 |
+
},
|
271 |
+
error: function error() {
|
272 |
+
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
273 |
+
}
|
274 |
+
});
|
275 |
+
},
|
276 |
+
doAjax: function doAjax(args) {
|
277 |
+
var type = args.type || 'post',
|
278 |
+
dataType = args.dataType || 'json',
|
279 |
+
action = (args.prefix === undefined || 'learnpress_') + args.action,
|
280 |
+
data = args.action ? $.extend(args.data, { action: action }) : args.data;
|
281 |
+
|
282 |
+
$.ajax({
|
283 |
+
data: data,
|
284 |
+
url: args.url || window.location.href,
|
285 |
+
type: type,
|
286 |
+
dataType: 'html',
|
287 |
+
success: function success(raw) {
|
288 |
+
var response = LP.parseResponse(raw, dataType);
|
289 |
+
$.isFunction(args.success) && args.success(response, raw);
|
290 |
+
},
|
291 |
+
error: function error() {
|
292 |
+
$.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
|
293 |
+
}
|
294 |
+
});
|
295 |
+
},
|
296 |
+
|
297 |
+
funcArgs2Array: function funcArgs2Array(args) {
|
298 |
+
var arr = [];
|
299 |
+
for (var i = 0; i < args.length; i++) {
|
300 |
+
arr.push(args[i]);
|
301 |
+
}
|
302 |
+
return arr;
|
303 |
+
},
|
304 |
+
addFilter: function addFilter(action, callback) {
|
305 |
+
var $doc = $(document),
|
306 |
+
event = 'LP.' + action;
|
307 |
+
$doc.on(event, callback);
|
308 |
+
LP.log($doc.data('events'));
|
309 |
+
return this;
|
310 |
+
},
|
311 |
+
applyFilters: function applyFilters() {
|
312 |
+
var $doc = $(document),
|
313 |
+
action = arguments[0],
|
314 |
+
args = this.funcArgs2Array(arguments);
|
315 |
+
if ($doc.hasEvent(action)) {
|
316 |
+
args[0] = 'LP.' + action;
|
317 |
+
return $doc.triggerHandler.apply($doc, args);
|
318 |
+
}
|
319 |
+
return args[1];
|
320 |
+
},
|
321 |
+
addAction: function addAction(action, callback) {
|
322 |
+
return this.addFilter(action, callback);
|
323 |
+
},
|
324 |
+
doAction: function doAction() {
|
325 |
+
var $doc = $(document),
|
326 |
+
action = arguments[0],
|
327 |
+
args = this.funcArgs2Array(arguments);
|
328 |
+
if ($doc.hasEvent(action)) {
|
329 |
+
args[0] = 'LP.' + action;
|
330 |
+
$doc.trigger.apply($doc, args);
|
331 |
+
}
|
332 |
+
},
|
333 |
+
toElement: function toElement(element, args) {
|
334 |
+
if ($(element).length === 0) {
|
335 |
+
return;
|
336 |
+
}
|
337 |
+
args = $.extend({
|
338 |
+
delay: 300,
|
339 |
+
duration: 'slow',
|
340 |
+
offset: 50,
|
341 |
+
container: null,
|
342 |
+
callback: null,
|
343 |
+
invisible: false
|
344 |
+
}, args || {});
|
345 |
+
var $container = $(args.container),
|
346 |
+
rootTop = 0;
|
347 |
+
if ($container.length === 0) {
|
348 |
+
$container = $('body, html');
|
349 |
+
}
|
350 |
+
rootTop = $container.offset().top;
|
351 |
+
var to = $(element).offset().top + $container.scrollTop() - rootTop - args.offset;
|
352 |
+
|
353 |
+
function isElementInView(element, fullyInView) {
|
354 |
+
var pageTop = $container.scrollTop();
|
355 |
+
var pageBottom = pageTop + $container.height();
|
356 |
+
var elementTop = $(element).offset().top - $container.offset().top;
|
357 |
+
var elementBottom = elementTop + $(element).height();
|
358 |
+
|
359 |
+
if (fullyInView === true) {
|
360 |
+
return pageTop < elementTop && pageBottom > elementBottom;
|
361 |
+
} else {
|
362 |
+
return elementTop <= pageBottom && elementBottom >= pageTop;
|
363 |
+
}
|
364 |
+
}
|
365 |
+
|
366 |
+
if (args.invisible && isElementInView(element, true)) {
|
367 |
+
return;
|
368 |
+
}
|
369 |
+
$container.fadeIn(10).delay(args.delay).animate({
|
370 |
+
scrollTop: to
|
371 |
+
}, args.duration, args.callback);
|
372 |
+
},
|
373 |
+
uniqueId: function uniqueId(prefix, more_entropy) {
|
374 |
+
if (typeof prefix === 'undefined') {
|
375 |
+
prefix = '';
|
376 |
+
}
|
377 |
+
|
378 |
+
var retId;
|
379 |
+
var formatSeed = function formatSeed(seed, reqWidth) {
|
380 |
+
seed = parseInt(seed, 10).toString(16); // to hex str
|
381 |
+
if (reqWidth < seed.length) {
|
382 |
+
// so long we split
|
383 |
+
return seed.slice(seed.length - reqWidth);
|
384 |
+
}
|
385 |
+
if (reqWidth > seed.length) {
|
386 |
+
// so short we pad
|
387 |
+
return new Array(1 + (reqWidth - seed.length)).join('0') + seed;
|
388 |
+
}
|
389 |
+
return seed;
|
390 |
+
};
|
391 |
+
|
392 |
+
// BEGIN REDUNDANT
|
393 |
+
if (!this.php_js) {
|
394 |
+
this.php_js = {};
|
395 |
+
}
|
396 |
+
// END REDUNDANT
|
397 |
+
if (!this.php_js.uniqidSeed) {
|
398 |
+
// init seed with big random int
|
399 |
+
this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
|
400 |
+
}
|
401 |
+
this.php_js.uniqidSeed++;
|
402 |
+
|
403 |
+
retId = prefix; // start with prefix, add current milliseconds hex string
|
404 |
+
retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
|
405 |
+
retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
|
406 |
+
if (more_entropy) {
|
407 |
+
// for more entropy we add a float lower to 10
|
408 |
+
retId += (Math.random() * 10).toFixed(8).toString();
|
409 |
+
}
|
410 |
+
|
411 |
+
return retId;
|
412 |
+
},
|
413 |
+
log: function log() {
|
414 |
+
//if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
|
415 |
+
for (var i = 0, n = arguments.length; i < n; i++) {
|
416 |
+
console.log(arguments[i]);
|
417 |
+
}
|
418 |
+
//}
|
419 |
+
},
|
420 |
+
blockContent: function blockContent() {
|
421 |
+
if ($('#learn-press-block-content').length === 0) {
|
422 |
+
$(LP.template('learn-press-template-block-content', {})).appendTo($('body'));
|
423 |
+
}
|
424 |
+
LP.hideMainScrollbar().addClass('block-content');
|
425 |
+
$(document).trigger('learn_press_block_content');
|
426 |
+
},
|
427 |
+
unblockContent: function unblockContent() {
|
428 |
+
setTimeout(function () {
|
429 |
+
LP.showMainScrollbar().removeClass('block-content');
|
430 |
+
$(document).trigger('learn_press_unblock_content');
|
431 |
+
}, 350);
|
432 |
+
},
|
433 |
+
hideMainScrollbar: function hideMainScrollbar(el) {
|
434 |
+
if (!el) {
|
435 |
+
el = 'html, body';
|
436 |
+
}
|
437 |
+
var $el = $(el);
|
438 |
+
$el.each(function () {
|
439 |
+
var $root = $(this),
|
440 |
+
overflow = $root.css('overflow');
|
441 |
+
$root.css('overflow', 'hidden').attr('overflow', overflow);
|
442 |
+
});
|
443 |
+
return $el;
|
444 |
+
},
|
445 |
+
showMainScrollbar: function showMainScrollbar(el) {
|
446 |
+
if (!el) {
|
447 |
+
el = 'html, body';
|
448 |
+
}
|
449 |
+
var $el = $(el);
|
450 |
+
$el.each(function () {
|
451 |
+
var $root = $(this),
|
452 |
+
overflow = $root.attr('overflow');
|
453 |
+
$root.css('overflow', overflow).removeAttr('overflow');
|
454 |
+
});
|
455 |
+
return $el;
|
456 |
+
},
|
457 |
+
template: typeof _ !== 'undefined' ? _.memoize(function (id, data) {
|
458 |
+
var compiled,
|
459 |
+
options = {
|
460 |
+
evaluate: /<#([\s\S]+?)#>/g,
|
461 |
+
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
462 |
+
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
463 |
+
variable: 'data'
|
464 |
+
};
|
465 |
+
|
466 |
+
var tmpl = function tmpl(data) {
|
467 |
+
compiled = compiled || _.template($('#' + id).html(), null, options);
|
468 |
+
return compiled(data);
|
469 |
+
};
|
470 |
+
return data ? tmpl(data) : tmpl;
|
471 |
+
}, function (a, b) {
|
472 |
+
return a + '-' + JSON.stringify(b);
|
473 |
+
}) : function () {
|
474 |
+
return '';
|
475 |
+
},
|
476 |
+
alert: function alert(localize, callback) {
|
477 |
+
var title = '',
|
478 |
+
message = '';
|
479 |
+
if (typeof localize === 'string') {
|
480 |
+
message = localize;
|
481 |
+
} else {
|
482 |
+
if (typeof localize['title'] !== 'undefined') {
|
483 |
+
title = localize['title'];
|
484 |
+
}
|
485 |
+
if (typeof localize['message'] !== 'undefined') {
|
486 |
+
message = localize['message'];
|
487 |
+
}
|
488 |
+
}
|
489 |
+
$.alerts.alert(message, title, function (e) {
|
490 |
+
LP._on_alert_hide();
|
491 |
+
callback && callback(e);
|
492 |
+
});
|
493 |
+
this._on_alert_show();
|
494 |
+
},
|
495 |
+
confirm: function confirm(localize, callback) {
|
496 |
+
var title = '',
|
497 |
+
message = '';
|
498 |
+
|
499 |
+
if (typeof localize === 'string') {
|
500 |
+
message = localize;
|
501 |
+
} else {
|
502 |
+
if (typeof localize['title'] !== 'undefined') {
|
503 |
+
title = localize['title'];
|
504 |
+
}
|
505 |
+
if (typeof localize['message'] !== 'undefined') {
|
506 |
+
message = localize['message'];
|
507 |
+
}
|
508 |
+
}
|
509 |
+
$.alerts.confirm(message, title, function (e) {
|
510 |
+
LP._on_alert_hide();
|
511 |
+
callback && callback(e);
|
512 |
+
});
|
513 |
+
this._on_alert_show();
|
514 |
+
},
|
515 |
+
_on_alert_show: function _on_alert_show() {
|
516 |
+
var $container = $('#popup_container'),
|
517 |
+
$placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container);
|
518 |
+
$container.stop().css('top', '-=50').css('opacity', '0').animate({
|
519 |
+
top: '+=50',
|
520 |
+
opacity: 1
|
521 |
+
}, 250);
|
522 |
+
},
|
523 |
+
_on_alert_hide: function _on_alert_hide() {
|
524 |
+
var $holder = $("#popup_container_placeholder"),
|
525 |
+
$container = $holder.data('xxx');
|
526 |
+
if ($container) {
|
527 |
+
$container.replaceWith($holder);
|
528 |
+
}
|
529 |
+
$container.appendTo($(document.body));
|
530 |
+
$container.stop().animate({
|
531 |
+
top: '+=50',
|
532 |
+
opacity: 0
|
533 |
+
}, 250, function () {
|
534 |
+
$(this).remove();
|
535 |
+
});
|
536 |
+
},
|
537 |
+
sendMessage: function sendMessage(data, object, targetOrigin, transfer) {
|
538 |
+
if ($.isPlainObject(data)) {
|
539 |
+
data = JSON.stringify(data);
|
540 |
+
}
|
541 |
+
object = object || window;
|
542 |
+
targetOrigin = targetOrigin || '*';
|
543 |
+
object.postMessage(data, targetOrigin, transfer);
|
544 |
+
},
|
545 |
+
receiveMessage: function receiveMessage(event, b) {
|
546 |
+
var target = event.origin || event.originalEvent.origin,
|
547 |
+
data = event.data || event.originalEvent.data || '';
|
548 |
+
if (typeof data === 'string' || data instanceof String) {
|
549 |
+
if (data.indexOf('{') === 0) {
|
550 |
+
data = LP.parseJSON(data);
|
551 |
+
}
|
552 |
+
}
|
553 |
+
LP.Hook.doAction('learn_press_receive_message', data, target);
|
554 |
+
}
|
555 |
+
};
|
556 |
+
|
557 |
+
$(document).ready(function () {
|
558 |
+
if (typeof $.alerts !== 'undefined') {
|
559 |
+
$.alerts.overlayColor = '#000';
|
560 |
+
$.alerts.overlayOpacity = 0.5;
|
561 |
+
$.alerts.okButton = lpGlobalSettings.localize.button_ok;
|
562 |
+
$.alerts.cancelButton = lpGlobalSettings.localize.button_cancel;
|
563 |
+
}
|
564 |
+
|
565 |
+
$('.learn-press-message.fixed').each(function () {
|
566 |
+
var $el = $(this),
|
567 |
+
options = $el.data();
|
568 |
+
(function ($el, options) {
|
569 |
+
if (options.delayIn) {
|
570 |
+
setTimeout(function () {
|
571 |
+
$el.show().hide().fadeIn();
|
572 |
+
}, options.delayIn);
|
573 |
+
}
|
574 |
+
if (options.delayOut) {
|
575 |
+
setTimeout(function () {
|
576 |
+
$el.fadeOut();
|
577 |
+
}, options.delayOut + (options.delayIn || 0));
|
578 |
+
}
|
579 |
+
})($el, options);
|
580 |
+
});
|
581 |
+
|
582 |
+
$('body').on('click', '.learn-press-nav-tabs li a', function (e) {
|
583 |
+
e.preventDefault();
|
584 |
+
var $tab = $(this),
|
585 |
+
url = '';
|
586 |
+
$tab.closest('li').addClass('active').siblings().removeClass('active');
|
587 |
+
$($tab.attr('data-tab')).addClass('active').siblings().removeClass('active');
|
588 |
+
$(document).trigger('learn-press/nav-tabs/clicked', $tab);
|
589 |
+
});
|
590 |
+
|
591 |
+
setTimeout(function () {
|
592 |
+
$('.learn-press-nav-tabs li.active:not(.default) a').trigger('click');
|
593 |
+
}, 300);
|
594 |
+
|
595 |
+
$('body.course-item-popup').parent().css('overflow', 'hidden');
|
596 |
+
|
597 |
+
(function () {
|
598 |
+
var timer = null,
|
599 |
+
callback = function callback() {
|
600 |
+
$('.auto-check-lines').checkLines(function (r) {
|
601 |
+
if (r > 1) {
|
602 |
+
$(this).removeClass('single-lines');
|
603 |
+
} else {
|
604 |
+
$(this).addClass('single-lines');
|
605 |
+
}
|
606 |
+
$(this).attr('rows', r);
|
607 |
+
});
|
608 |
+
};
|
609 |
+
$(window).on('resize.check-lines', function () {
|
610 |
+
if (timer) {
|
611 |
+
timer && clearTimeout(timer);
|
612 |
+
timer = setTimeout(callback, 300);
|
613 |
+
} else {
|
614 |
+
callback();
|
615 |
+
}
|
616 |
+
});
|
617 |
+
})();
|
618 |
+
|
619 |
+
$('.learn-press-tooltip, .lp-passing-conditional').LP_Tooltip({ offset: [24, 24] });
|
620 |
+
|
621 |
+
$('.learn-press-icon').LP_Tooltip({ offset: [30, 30] });
|
622 |
+
|
623 |
+
$('.learn-press-message[data-autoclose]').each(function () {
|
624 |
+
var $el = $(this),
|
625 |
+
delay = parseInt($el.data('autoclose'));
|
626 |
+
if (delay) {
|
627 |
+
setTimeout(function ($el) {
|
628 |
+
$el.fadeOut();
|
629 |
+
}, delay, $el);
|
630 |
+
}
|
631 |
+
});
|
632 |
+
|
633 |
+
$(document).on('click', function () {
|
634 |
+
$(document).trigger('learn-press/close-all-quick-tip');
|
635 |
+
});
|
636 |
+
});
|
637 |
+
|
638 |
+
(0, _extend2.default)(_extends({
|
639 |
+
Event_Callback: _eventCallback2.default,
|
640 |
+
MessageBox: _messageBox2.default
|
641 |
+
}, _default));
|
642 |
+
|
643 |
+
exports.default = {
|
644 |
+
fn: _fn2.default,
|
645 |
+
QuickTip: _quickTip2.default
|
646 |
+
};
|
647 |
+
|
648 |
+
/***/ }),
|
649 |
+
/* 2 */
|
650 |
+
/***/ (function(module, exports, __webpack_require__) {
|
651 |
+
|
652 |
+
"use strict";
|
653 |
+
|
654 |
+
|
655 |
+
Object.defineProperty(exports, "__esModule", {
|
656 |
+
value: true
|
657 |
+
});
|
658 |
+
/**
|
659 |
+
* Auto prepend `LP` prefix for jQuery fn plugin name.
|
660 |
+
*
|
661 |
+
* Create : $.fn.LP( 'PLUGIN_NAME', func) <=> $.fn.LP_PLUGIN_NAME
|
662 |
+
* Usage: $(selector).LP('PLUGIN_NAME') <=> $(selector).LP_PLUGIN_NAME()
|
663 |
+
*
|
664 |
+
* @version 3.2.6
|
665 |
+
*/
|
666 |
+
|
667 |
+
var $ = window.jQuery;
|
668 |
+
var exp;
|
669 |
+
|
670 |
+
(function () {
|
671 |
+
|
672 |
+
if ($ === undefined) {
|
673 |
+
return;
|
674 |
+
}
|
675 |
+
|
676 |
+
$.fn.LP = exp = function exp(widget, fn) {
|
677 |
+
if ($.isFunction(fn)) {
|
678 |
+
$.fn['LP_' + widget] = fn;
|
679 |
+
} else if (widget) {
|
680 |
+
var args = [];
|
681 |
+
if (arguments.length > 1) {
|
682 |
+
for (var i = 1; i < arguments.length; i++) {
|
683 |
+
args.push(arguments[i]);
|
684 |
+
}
|
685 |
+
}
|
686 |
+
|
687 |
+
return $.isFunction($(this)['LP_' + widget]) ? $(this)['LP_' + widget].apply(this, args) : this;
|
688 |
+
}
|
689 |
+
return this;
|
690 |
+
};
|
691 |
+
})();
|
692 |
+
|
693 |
+
exports.default = exp;
|
694 |
+
|
695 |
+
/***/ }),
|
696 |
+
/* 3 */
|
697 |
+
/***/ (function(module, exports, __webpack_require__) {
|
698 |
+
|
699 |
+
"use strict";
|
700 |
+
|
701 |
+
|
702 |
+
;(function ($) {
|
703 |
+
function QuickTip(el, options) {
|
704 |
+
var $el = $(el),
|
705 |
+
uniId = $el.attr('data-id') || LP.uniqueId();
|
706 |
+
|
707 |
+
options = $.extend({
|
708 |
+
event: 'hover',
|
709 |
+
autoClose: true,
|
710 |
+
single: true,
|
711 |
+
closeInterval: 1000,
|
712 |
+
arrowOffset: null,
|
713 |
+
tipClass: ''
|
714 |
+
}, options, $el.data());
|
715 |
+
|
716 |
+
$el.attr('data-id', uniId);
|
717 |
+
|
718 |
+
var content = $el.attr('data-content-tip') || $el.html(),
|
719 |
+
$tip = $('<div class="learn-press-tip-floating">' + content + '</div>'),
|
720 |
+
t = null,
|
721 |
+
closeInterval = 0,
|
722 |
+
useData = false,
|
723 |
+
arrowOffset = options.arrowOffset === 'el' ? $el.outerWidth() / 2 : 8,
|
724 |
+
$content = $('#__' + uniId);
|
725 |
+
|
726 |
+
if ($content.length === 0) {
|
727 |
+
$(document.body).append($('<div />').attr('id', '__' + uniId).html(content).css('display', 'none'));
|
728 |
+
}
|
729 |
+
|
730 |
+
content = $content.html();
|
731 |
+
|
732 |
+
$tip.addClass(options.tipClass);
|
733 |
+
|
734 |
+
$el.data('content-tip', content);
|
735 |
+
if ($el.attr('data-content-tip')) {
|
736 |
+
//$el.removeAttr('data-content-tip');
|
737 |
+
useData = true;
|
738 |
+
}
|
739 |
+
|
740 |
+
closeInterval = options.closeInterval;
|
741 |
+
|
742 |
+
if (options.autoClose === false) {
|
743 |
+
$tip.append('<a class="close"></a>');
|
744 |
+
$tip.on('click', '.close', function () {
|
745 |
+
close();
|
746 |
+
});
|
747 |
+
}
|
748 |
+
|
749 |
+
function show() {
|
750 |
+
if (t) {
|
751 |
+
clearTimeout(t);
|
752 |
+
return;
|
753 |
+
}
|
754 |
+
|
755 |
+
if (options.single) {
|
756 |
+
$('.learn-press-tip').not($el).LP('QuickTip', 'close');
|
757 |
+
}
|
758 |
+
|
759 |
+
$tip.appendTo(document.body);
|
760 |
+
var pos = $el.offset();
|
761 |
+
|
762 |
+
$tip.css({
|
763 |
+
top: pos.top - $tip.outerHeight() - 8,
|
764 |
+
left: pos.left - $tip.outerWidth() / 2 + arrowOffset
|
765 |
+
});
|
766 |
+
}
|
767 |
+
|
768 |
+
function hide() {
|
769 |
+
t && clearTimeout(t);
|
770 |
+
t = setTimeout(function () {
|
771 |
+
$tip.detach();
|
772 |
+
t = null;
|
773 |
+
}, closeInterval);
|
774 |
+
}
|
775 |
+
|
776 |
+
function close() {
|
777 |
+
closeInterval = 0;
|
778 |
+
hide();
|
779 |
+
closeInterval = options.closeInterval;
|
780 |
+
}
|
781 |
+
|
782 |
+
function open() {
|
783 |
+
show();
|
784 |
+
}
|
785 |
+
|
786 |
+
if (!useData) {
|
787 |
+
$el.html('');
|
788 |
+
}
|
789 |
+
|
790 |
+
if (options.event === 'click') {
|
791 |
+
$el.on('click', function (e) {
|
792 |
+
e.stopPropagation();
|
793 |
+
show();
|
794 |
+
});
|
795 |
+
}
|
796 |
+
|
797 |
+
$(document).on('learn-press/close-all-quick-tip', function () {
|
798 |
+
close();
|
799 |
+
});
|
800 |
+
$el.hover(function (e) {
|
801 |
+
e.stopPropagation();
|
802 |
+
if (options.event !== 'click') {
|
803 |
+
show();
|
804 |
+
}
|
805 |
+
}, function (e) {
|
806 |
+
e.stopPropagation();
|
807 |
+
if (options.autoClose) {
|
808 |
+
hide();
|
809 |
+
}
|
810 |
+
}).addClass('ready');
|
811 |
+
return {
|
812 |
+
close: close,
|
813 |
+
open: open
|
814 |
+
};
|
815 |
+
}
|
816 |
+
|
817 |
+
$.fn.LP('QuickTip', function (options) {
|
818 |
+
return $.each(this, function () {
|
819 |
+
var $tip = $(this).data('quick-tip');
|
820 |
+
|
821 |
+
if (!$tip) {
|
822 |
+
$tip = new QuickTip(this, options);
|
823 |
+
$(this).data('quick-tip', $tip);
|
824 |
+
}
|
825 |
+
|
826 |
+
if ($.type(options) === 'string') {
|
827 |
+
$tip[options] && $tip[options].apply($tip);
|
828 |
+
}
|
829 |
+
});
|
830 |
+
});
|
831 |
+
})(jQuery);
|
832 |
+
|
833 |
+
/***/ }),
|
834 |
+
/* 4 */
|
835 |
+
/***/ (function(module, exports, __webpack_require__) {
|
836 |
+
|
837 |
+
"use strict";
|
838 |
+
|
839 |
+
|
840 |
+
Object.defineProperty(exports, "__esModule", {
|
841 |
+
value: true
|
842 |
+
});
|
843 |
+
var $ = window.jQuery;
|
844 |
+
var MessageBox = {
|
845 |
+
/*
|
846 |
+
*
|
847 |
+
*/
|
848 |
+
$block: null,
|
849 |
+
$window: null,
|
850 |
+
events: {},
|
851 |
+
instances: [],
|
852 |
+
instance: null,
|
853 |
+
quickConfirm: function quickConfirm(elem, args) {
|
854 |
+
var $e = $(elem);
|
855 |
+
$('[learn-press-quick-confirm]').each(function () {
|
856 |
+
var $ins;
|
857 |
+
($ins = $(this).data('quick-confirm')) && (console.log($ins), $ins.destroy());
|
858 |
+
});
|
859 |
+
!$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm', new function (elem, args) {
|
860 |
+
var $elem = $(elem),
|
861 |
+
$div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem),
|
862 |
+
//($(document.body)),
|
863 |
+
offset = $(elem).position() || { left: 0, top: 0 },
|
864 |
+
timerOut = null,
|
865 |
+
timerHide = null,
|
866 |
+
n = 3,
|
867 |
+
hide = function hide() {
|
868 |
+
$div.fadeOut('fast', function () {
|
869 |
+
$(this).remove();
|
870 |
+
$div.parent().css('position', '');
|
871 |
+
});
|
872 |
+
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
873 |
+
stop();
|
874 |
+
},
|
875 |
+
stop = function stop() {
|
876 |
+
timerHide && clearInterval(timerHide);
|
877 |
+
timerOut && clearInterval(timerOut);
|
878 |
+
},
|
879 |
+
start = function start() {
|
880 |
+
timerOut = setInterval(function () {
|
881 |
+
if (--n == 0) {
|
882 |
+
hide.call($div[0]);
|
883 |
+
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
884 |
+
stop();
|
885 |
+
}
|
886 |
+
$div.find('span').html(' (' + n + ')');
|
887 |
+
}, 1000);
|
888 |
+
|
889 |
+
timerHide = setInterval(function () {
|
890 |
+
if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') {
|
891 |
+
stop();
|
892 |
+
$div.remove();
|
893 |
+
$div.parent().css('position', '');
|
894 |
+
$.isFunction(args.onCancel) && args.onCancel(args.data);
|
895 |
+
}
|
896 |
+
}, 350);
|
897 |
+
};
|
898 |
+
args = $.extend({
|
899 |
+
message: '',
|
900 |
+
data: null,
|
901 |
+
onOk: null,
|
902 |
+
onCancel: null,
|
903 |
+
offset: { top: 0, left: 0 }
|
904 |
+
}, args || {});
|
905 |
+
$div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append('<span> (' + n + ')</span>').css({});
|
906 |
+
$div.click(function () {
|
907 |
+
$.isFunction(args.onOk) && args.onOk(args.data);
|
908 |
+
hide();
|
909 |
+
}).hover(function () {
|
910 |
+
stop();
|
911 |
+
}, function () {
|
912 |
+
start();
|
913 |
+
});
|
914 |
+
//$div.parent().css('position', 'relative');
|
915 |
+
$div.css({
|
916 |
+
left: offset.left + $elem.outerWidth() - $div.outerWidth() + args.offset.left,
|
917 |
+
top: offset.top + $elem.outerHeight() + args.offset.top + 5
|
918 |
+
}).hide().fadeIn('fast');
|
919 |
+
start();
|
920 |
+
|
921 |
+
this.destroy = function () {
|
922 |
+
$div.remove();
|
923 |
+
$elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
|
924 |
+
stop();
|
925 |
+
};
|
926 |
+
}(elem, args));
|
927 |
+
},
|
928 |
+
show: function show(message, args) {
|
929 |
+
//this.hide();
|
930 |
+
$.proxy(function () {
|
931 |
+
args = $.extend({
|
932 |
+
title: '',
|
933 |
+
buttons: '',
|
934 |
+
events: false,
|
935 |
+
autohide: false,
|
936 |
+
message: message,
|
937 |
+
data: false,
|
938 |
+
id: LP.uniqueId(),
|
939 |
+
onHide: null
|
940 |
+
}, args || {});
|
941 |
+
|
942 |
+
this.instances.push(args);
|
943 |
+
this.instance = args;
|
944 |
+
|
945 |
+
var $doc = $(document),
|
946 |
+
$body = $(document.body);
|
947 |
+
if (!this.$block) {
|
948 |
+
this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body);
|
949 |
+
}
|
950 |
+
if (!this.$window) {
|
951 |
+
this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
|
952 |
+
this.$window.click(function () {});
|
953 |
+
}
|
954 |
+
//this.events = args.events || {};
|
955 |
+
this._createWindow(message, args.title, args.buttons);
|
956 |
+
this.$block.show();
|
957 |
+
this.$window.show().attr('instance', args.id);
|
958 |
+
$(window).bind('resize.message-box', $.proxy(this.update, this)).bind('scroll.message-box', $.proxy(this.update, this));
|
959 |
+
this.update(true);
|
960 |
+
if (args.autohide) {
|
961 |
+
setTimeout(function () {
|
962 |
+
LP.MessageBox.hide();
|
963 |
+
$.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args);
|
964 |
+
}, args.autohide);
|
965 |
+
}
|
966 |
+
}, this)();
|
967 |
+
},
|
968 |
+
blockUI: function blockUI(message) {
|
969 |
+
|
970 |
+
message = (message !== false ? message ? message : 'Wait a moment' : '') + '<div class="message-box-animation"></div>';
|
971 |
+
this.show(message);
|
972 |
+
},
|
973 |
+
hide: function hide(delay, instance) {
|
974 |
+
if (instance) {
|
975 |
+
this._removeInstance(instance.id);
|
976 |
+
} else if (this.instance) {
|
977 |
+
this._removeInstance(this.instance.id);
|
978 |
+
}
|
979 |
+
if (this.instances.length === 0) {
|
980 |
+
if (this.$block) {
|
981 |
+
this.$block.hide();
|
982 |
+
}
|
983 |
+
if (this.$window) {
|
984 |
+
this.$window.hide();
|
985 |
+
}
|
986 |
+
$(window).unbind('resize.message-box', this.update).unbind('scroll.message-box', this.update);
|
987 |
+
} else {
|
988 |
+
if (this.instance) {
|
989 |
+
this._createWindow(this.instance.message, this.instance.title, this.instance.buttons);
|
990 |
+
}
|
991 |
+
}
|
992 |
+
},
|
993 |
+
update: function update(force) {
|
994 |
+
var that = this,
|
995 |
+
$wrap = this.$window.find('#message-box-wrap'),
|
996 |
+
timer = $wrap.data('timer'),
|
997 |
+
_update = function _update() {
|
998 |
+
LP.Hook.doAction('learn_press_message_box_before_resize', that);
|
999 |
+
var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'),
|
1000 |
+
width = $wrap.outerWidth(),
|
1001 |
+
height = $wrap.outerHeight(),
|
1002 |
+
contentHeight = $content.height(),
|
1003 |
+
windowHeight = $(window).height(),
|
1004 |
+
top = $wrap.offset().top;
|
1005 |
+
if (contentHeight > windowHeight - 50) {
|
1006 |
+
$content.css({
|
1007 |
+
height: windowHeight - 25
|
1008 |
+
});
|
1009 |
+
height = $wrap.outerHeight();
|
1010 |
+
} else {
|
1011 |
+
$content.css("height", "").css('overflow', '');
|
1012 |
+
}
|
1013 |
+
$wrap.css({
|
1014 |
+
marginTop: ($(window).height() - height) / 2
|
1015 |
+
});
|
1016 |
+
LP.Hook.doAction('learn_press_message_box_resize', height, that);
|
1017 |
+
};
|
1018 |
+
if (force) _update();
|
1019 |
+
timer && clearTimeout(timer);
|
1020 |
+
timer = setTimeout(_update, 250);
|
1021 |
+
},
|
1022 |
+
_removeInstance: function _removeInstance(id) {
|
1023 |
+
for (var i = 0; i < this.instances.length; i++) {
|
1024 |
+
if (this.instances[i].id === id) {
|
1025 |
+
|
1026 |
+
this.instances.splice(i, 1);
|
1027 |
+
|
1028 |
+
var len = this.instances.length;
|
1029 |
+
if (len) {
|
1030 |
+
this.instance = this.instances[len - 1];
|
1031 |
+
this.$window.attr('instance', this.instance.id);
|
1032 |
+
} else {
|
1033 |
+
this.instance = false;
|
1034 |
+
this.$window.removeAttr('instance');
|
1035 |
+
}
|
1036 |
+
break;
|
1037 |
+
}
|
1038 |
+
}
|
1039 |
+
},
|
1040 |
+
_getInstance: function _getInstance(id) {
|
1041 |
+
for (var i = 0; i < this.instances.length; i++) {
|
1042 |
+
if (this.instances[i].id === id) {
|
1043 |
+
return this.instances[i];
|
1044 |
+
}
|
1045 |
+
}
|
1046 |
+
},
|
1047 |
+
_createWindow: function _createWindow(message, title, buttons) {
|
1048 |
+
var $wrap = this.$window.find('#message-box-wrap').html('');
|
1049 |
+
if (title) {
|
1050 |
+
$wrap.append('<h3 class="message-box-title">' + title + '</h3>');
|
1051 |
+
}
|
1052 |
+
$wrap.append($('<div class="message-box-content"></div>').html(message));
|
1053 |
+
if (buttons) {
|
1054 |
+
var $buttons = $('<div class="message-box-buttons"></div>');
|
1055 |
+
switch (buttons) {
|
1056 |
+
case 'yesNo':
|
1057 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes'));
|
1058 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_no, 'no'));
|
1059 |
+
break;
|
1060 |
+
case 'okCancel':
|
1061 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
1062 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel'));
|
1063 |
+
break;
|
1064 |
+
default:
|
1065 |
+
$buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
|
1066 |
+
}
|
1067 |
+
$wrap.append($buttons);
|
1068 |
+
}
|
1069 |
+
},
|
1070 |
+
_createButton: function _createButton(title, type) {
|
1071 |
+
var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + '</button>'),
|
1072 |
+
callback = 'on' + (type.substr(0, 1).toUpperCase() + type.substr(1));
|
1073 |
+
$button.data('callback', callback).click(function () {
|
1074 |
+
var instance = $(this).data('instance'),
|
1075 |
+
callback = instance.events[$(this).data('callback')];
|
1076 |
+
if ($.type(callback) === 'function') {
|
1077 |
+
if (callback.apply(LP.MessageBox, [instance]) === false) {
|
1078 |
+
// return;
|
1079 |
+
} else {
|
1080 |
+
LP.MessageBox.hide(null, instance);
|
1081 |
+
}
|
1082 |
+
} else {
|
1083 |
+
LP.MessageBox.hide(null, instance);
|
1084 |
+
}
|
1085 |
+
}).data('instance', this.instance);
|
1086 |
+
return $button;
|
1087 |
+
}
|
1088 |
+
};
|
1089 |
+
|
1090 |
+
exports.default = MessageBox;
|
1091 |
+
|
1092 |
+
/***/ }),
|
1093 |
+
/* 5 */
|
1094 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1095 |
+
|
1096 |
+
"use strict";
|
1097 |
+
|
1098 |
+
|
1099 |
+
Object.defineProperty(exports, "__esModule", {
|
1100 |
+
value: true
|
1101 |
+
});
|
1102 |
+
/**
|
1103 |
+
* Manage event callbacks.
|
1104 |
+
* Allow add/remove a callback function into custom event of an object.
|
1105 |
+
*
|
1106 |
+
* @constructor
|
1107 |
+
*/
|
1108 |
+
var Event_Callback = function Event_Callback(self) {
|
1109 |
+
var callbacks = {};
|
1110 |
+
var $ = window.jQuery;
|
1111 |
+
|
1112 |
+
this.on = function (event, callback) {
|
1113 |
+
var namespaces = event.split('.'),
|
1114 |
+
namespace = '';
|
1115 |
+
|
1116 |
+
if (namespaces.length > 1) {
|
1117 |
+
event = namespaces[0];
|
1118 |
+
namespace = namespaces[1];
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
if (!callbacks[event]) {
|
1122 |
+
callbacks[event] = [[], {}];
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
if (namespace) {
|
1126 |
+
if (!callbacks[event][1][namespace]) {
|
1127 |
+
callbacks[event][1][namespace] = [];
|
1128 |
+
}
|
1129 |
+
callbacks[event][1][namespace].push(callback);
|
1130 |
+
} else {
|
1131 |
+
callbacks[event][0].push(callback);
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
return self;
|
1135 |
+
};
|
1136 |
+
|
1137 |
+
this.off = function (event, callback) {
|
1138 |
+
var namespaces = event.split('.'),
|
1139 |
+
namespace = '';
|
1140 |
+
|
1141 |
+
if (namespaces.length > 1) {
|
1142 |
+
event = namespaces[0];
|
1143 |
+
namespace = namespaces[1];
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
if (!callbacks[event]) {
|
1147 |
+
return self;
|
1148 |
+
}
|
1149 |
+
var at = -1;
|
1150 |
+
if (!namespace) {
|
1151 |
+
if ($.isFunction(callback)) {
|
1152 |
+
at = callbacks[event][0].indexOf(callback);
|
1153 |
+
if (at < 0) {
|
1154 |
+
return self;
|
1155 |
+
}
|
1156 |
+
callbacks[event][0].splice(at, 1);
|
1157 |
+
} else {
|
1158 |
+
callbacks[event][0] = [];
|
1159 |
+
}
|
1160 |
+
} else {
|
1161 |
+
if (!callbacks[event][1][namespace]) {
|
1162 |
+
return self;
|
1163 |
+
}
|
1164 |
+
|
1165 |
+
if ($.isFunction(callback)) {
|
1166 |
+
at = callbacks[event][1][namespace].indexOf(callback);
|
1167 |
+
if (at < 0) {
|
1168 |
+
return self;
|
1169 |
+
}
|
1170 |
+
callbacks[event][1][namespace].splice(at, 1);
|
1171 |
+
} else {
|
1172 |
+
callbacks[event][1][namespace] = [];
|
1173 |
+
}
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
return self;
|
1177 |
+
};
|
1178 |
+
|
1179 |
+
this.callEvent = function (event, callbackArgs) {
|
1180 |
+
if (!callbacks[event]) {
|
1181 |
+
return;
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
if (callbacks[event][0]) {
|
1185 |
+
for (var i = 0; i < callbacks[event][0].length; i++) {
|
1186 |
+
$.isFunction(callbacks[event][0][i]) && callbacks[event][i][0].apply(self, callbackArgs);
|
1187 |
+
}
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
if (callbacks[event][1]) {
|
1191 |
+
for (var i in callbacks[event][1]) {
|
1192 |
+
for (var j = 0; j < callbacks[event][1][i].length; j++) {
|
1193 |
+
$.isFunction(callbacks[event][1][i][j]) && callbacks[event][1][i][j].apply(self, callbackArgs);
|
1194 |
+
}
|
1195 |
+
}
|
1196 |
+
}
|
1197 |
+
};
|
1198 |
+
};
|
1199 |
+
|
1200 |
+
exports.default = Event_Callback;
|
1201 |
+
|
1202 |
+
/***/ }),
|
1203 |
+
/* 6 */
|
1204 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1205 |
+
|
1206 |
+
"use strict";
|
1207 |
+
|
1208 |
+
|
1209 |
+
Object.defineProperty(exports, "__esModule", {
|
1210 |
+
value: true
|
1211 |
+
});
|
1212 |
+
var Hook = {
|
1213 |
+
hooks: { action: {}, filter: {} },
|
1214 |
+
addAction: function addAction(action, callable, priority, tag) {
|
1215 |
+
this.addHook('action', action, callable, priority, tag);
|
1216 |
+
return this;
|
1217 |
+
},
|
1218 |
+
addFilter: function addFilter(action, callable, priority, tag) {
|
1219 |
+
this.addHook('filter', action, callable, priority, tag);
|
1220 |
+
return this;
|
1221 |
+
},
|
1222 |
+
doAction: function doAction(action) {
|
1223 |
+
this.doHook('action', action, arguments);
|
1224 |
+
return this;
|
1225 |
+
},
|
1226 |
+
applyFilters: function applyFilters(action) {
|
1227 |
+
return this.doHook('filter', action, arguments);
|
1228 |
+
},
|
1229 |
+
removeAction: function removeAction(action, tag) {
|
1230 |
+
this.removeHook('action', action, tag);
|
1231 |
+
return this;
|
1232 |
+
},
|
1233 |
+
removeFilter: function removeFilter(action, priority, tag) {
|
1234 |
+
this.removeHook('filter', action, priority, tag);
|
1235 |
+
return this;
|
1236 |
+
},
|
1237 |
+
addHook: function addHook(hookType, action, callable, priority, tag) {
|
1238 |
+
if (undefined === this.hooks[hookType][action]) {
|
1239 |
+
this.hooks[hookType][action] = [];
|
1240 |
+
}
|
1241 |
+
var hooks = this.hooks[hookType][action];
|
1242 |
+
if (undefined === tag) {
|
1243 |
+
tag = action + '_' + hooks.length;
|
1244 |
+
}
|
1245 |
+
this.hooks[hookType][action].push({ tag: tag, callable: callable, priority: priority });
|
1246 |
+
return this;
|
1247 |
+
},
|
1248 |
+
doHook: function doHook(hookType, action, args) {
|
1249 |
+
|
1250 |
+
// splice args from object into array and remove first index which is the hook name
|
1251 |
+
args = Array.prototype.slice.call(args, 1);
|
1252 |
+
|
1253 |
+
if (undefined !== this.hooks[hookType][action]) {
|
1254 |
+
var hooks = this.hooks[hookType][action],
|
1255 |
+
hook;
|
1256 |
+
//sort by priority
|
1257 |
+
hooks.sort(function (a, b) {
|
1258 |
+
return a["priority"] - b["priority"];
|
1259 |
+
});
|
1260 |
+
for (var i = 0; i < hooks.length; i++) {
|
1261 |
+
hook = hooks[i].callable;
|
1262 |
+
if (typeof hook !== 'function') hook = window[hook];
|
1263 |
+
if ('action' === hookType) {
|
1264 |
+
hook.apply(null, args);
|
1265 |
+
} else {
|
1266 |
+
args[0] = hook.apply(null, args);
|
1267 |
+
}
|
1268 |
+
}
|
1269 |
+
}
|
1270 |
+
if ('filter' === hookType) {
|
1271 |
+
return args[0];
|
1272 |
+
}
|
1273 |
+
return this;
|
1274 |
+
},
|
1275 |
+
removeHook: function removeHook(hookType, action, priority, tag) {
|
1276 |
+
if (undefined !== this.hooks[hookType][action]) {
|
1277 |
+
var hooks = this.hooks[hookType][action];
|
1278 |
+
for (var i = hooks.length - 1; i >= 0; i--) {
|
1279 |
+
if ((undefined === tag || tag === hooks[i].tag) && (undefined === priority || priority === hooks[i].priority)) {
|
1280 |
+
hooks.splice(i, 1);
|
1281 |
+
}
|
1282 |
+
}
|
1283 |
+
}
|
1284 |
+
return this;
|
1285 |
+
}
|
1286 |
+
};
|
1287 |
+
|
1288 |
+
exports.default = Hook;
|
1289 |
+
|
1290 |
+
/***/ }),
|
1291 |
+
/* 7 */
|
1292 |
+
/***/ (function(module, exports, __webpack_require__) {
|
1293 |
+
|
1294 |
+
"use strict";
|
1295 |
+
|
1296 |
+
|
1297 |
+
Object.defineProperty(exports, "__esModule", {
|
1298 |
+
value: true
|
1299 |
+
});
|
1300 |
+
|
1301 |
+
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; };
|
1302 |
+
|
1303 |
+
var $ = window.jQuery;
|
1304 |
+
|
1305 |
+
var serializeJSON = function serializeJSON(path) {
|
1306 |
+
var isInput = $(this).is('input') || $(this).is('select') || $(this).is('textarea');
|
1307 |
+
var unIndexed = isInput ? $(this).serializeArray() : $(this).find('input, select, textarea').serializeArray(),
|
1308 |
+
indexed = {},
|
1309 |
+
validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g,
|
1310 |
+
arrayKeys = {},
|
1311 |
+
end = false;
|
1312 |
+
$.each(unIndexed, function () {
|
1313 |
+
var that = this,
|
1314 |
+
match = this.name.match(/^([0-9a-zA-Z_-]+)/);
|
1315 |
+
if (!match) {
|
1316 |
+
return;
|
1317 |
+
}
|
1318 |
+
var keys = this.name.match(validate),
|
1319 |
+
objPath = "indexed['" + match[0] + "']";
|
1320 |
+
|
1321 |
+
if (keys) {
|
1322 |
+
if (_typeof(indexed[match[0]]) != 'object') {
|
1323 |
+
indexed[match[0]] = {};
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
$.each(keys, function (i, prop) {
|
1327 |
+
prop = prop.replace(/\]|\[/g, '');
|
1328 |
+
var rawPath = objPath.replace(/'|\[|\]/g, ''),
|
1329 |
+
objExp = '',
|
1330 |
+
preObjPath = objPath;
|
1331 |
+
|
1332 |
+
if (prop == '') {
|
1333 |
+
if (arrayKeys[rawPath] == undefined) {
|
1334 |
+
arrayKeys[rawPath] = 0;
|
1335 |
+
} else {
|
1336 |
+
arrayKeys[rawPath]++;
|
1337 |
+
}
|
1338 |
+
objPath += "['" + arrayKeys[rawPath] + "']";
|
1339 |
+
} else {
|
1340 |
+
if (!isNaN(prop)) {
|
1341 |
+
arrayKeys[rawPath] = prop;
|
1342 |
+
}
|
1343 |
+
objPath += "['" + prop + "']";
|
1344 |
+
}
|
1345 |
+
try {
|
1346 |
+
if (i == keys.length - 1) {
|
1347 |
+
objExp = objPath + "=that.value;";
|
1348 |
+
end = true;
|
1349 |
+
} else {
|
1350 |
+
objExp = objPath + "={}";
|
1351 |
+
end = false;
|
1352 |
+
}
|
1353 |
+
|
1354 |
+
var evalString = "" + "if( typeof " + objPath + " == 'undefined'){" + objExp + ";" + "}else{" + "if(end){" + "if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}" + "}";
|
1355 |
+
eval(evalString);
|
1356 |
+
} catch (e) {
|
1357 |
+
console.log('Error:' + e + "\n" + objExp);
|
1358 |
+
}
|
1359 |
+
});
|
1360 |
+
} else {
|
1361 |
+
indexed[match[0]] = this.value;
|
1362 |
+
}
|
1363 |
+
});
|
1364 |
+
if (path) {
|
1365 |
+
path = "['" + path.replace('.', "']['") + "']";
|
1366 |
+
var c = 'try{indexed = indexed' + path + '}catch(ex){console.log(c, ex);}';
|
1367 |
+
eval(c);
|
1368 |
+
}
|
1369 |
+
return indexed;
|
1370 |
+
};
|
1371 |
+
|
1372 |
+
var LP_Tooltip = function LP_Tooltip(options) {
|
1373 |
+
options = $.extend({}, {
|
1374 |
+
offset: [0, 0]
|
1375 |
+
}, options || {});
|
1376 |
+
return $.each(this, function () {
|
1377 |
+
var $el = $(this),
|
1378 |
+
content = $el.data('content');
|
1379 |
+
if (!content || $el.data('LP_Tooltip') !== undefined) {
|
1380 |
+
return;
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
var $tooltip = null;
|
1384 |
+
$el.hover(function (e) {
|
1385 |
+
$tooltip = $('<div class="learn-press-tooltip-bubble"/>').html(content).appendTo($('body')).hide();
|
1386 |
+
var position = $el.offset();
|
1387 |
+
if ($.isArray(options.offset)) {
|
1388 |
+
var top = options.offset[1],
|
1389 |
+
left = options.offset[0];
|
1390 |
+
if ($.isNumeric(left)) {
|
1391 |
+
position.left += left;
|
1392 |
+
} else {}
|
1393 |
+
if ($.isNumeric(top)) {
|
1394 |
+
position.top += top;
|
1395 |
+
} else {}
|
1396 |
+
}
|
1397 |
+
$tooltip.css({
|
1398 |
+
top: position.top,
|
1399 |
+
left: position.left
|
1400 |
+
});
|
1401 |
+
$tooltip.fadeIn();
|
1402 |
+
}, function () {
|
1403 |
+
$tooltip && $tooltip.remove();
|
1404 |
+
});
|
1405 |
+
$el.data('tooltip', true);
|
1406 |
+
});
|
1407 |
+
};
|
1408 |
+
|
1409 |
+
var hasEvent = function hasEvent(name) {
|
1410 |
+
var events = $(this).data('events');
|
1411 |
+
if (typeof events.LP == 'undefined') {
|
1412 |
+
return false;
|
1413 |
+
}
|
1414 |
+
for (i = 0; i < events.LP.length; i++) {
|
1415 |
+
if (events.LP[i].namespace == name) {
|
1416 |
+
return true;
|
1417 |
+
}
|
1418 |
+
}
|
1419 |
+
return false;
|
1420 |
+
};
|
1421 |
+
|
1422 |
+
var dataToJSON = function dataToJSON() {
|
1423 |
+
var json = {};
|
1424 |
+
$.each(this[0].attributes, function () {
|
1425 |
+
var m = this.name.match(/^data-(.*)/);
|
1426 |
+
if (m) {
|
1427 |
+
json[m[1]] = this.value;
|
1428 |
+
}
|
1429 |
+
});
|
1430 |
+
return json;
|
1431 |
+
};
|
1432 |
+
|
1433 |
+
var rows = function rows() {
|
1434 |
+
var h = $(this).height();
|
1435 |
+
var lh = $(this).css('line-height').replace("px", "");
|
1436 |
+
$(this).attr({ height: h, 'line-height': lh });
|
1437 |
+
return Math.floor(h / parseInt(lh));
|
1438 |
+
};
|
1439 |
+
|
1440 |
+
var checkLines = function checkLines(p) {
|
1441 |
+
return this.each(function () {
|
1442 |
+
var $e = $(this),
|
1443 |
+
rows = $e.rows();
|
1444 |
+
|
1445 |
+
p.call(this, rows);
|
1446 |
+
});
|
1447 |
+
};
|
1448 |
+
|
1449 |
+
var findNext = function findNext(selector) {
|
1450 |
+
var $selector = $(selector),
|
1451 |
+
$root = this.first(),
|
1452 |
+
index = $selector.index($root),
|
1453 |
+
$next = $selector.eq(index + 1);
|
1454 |
+
return $next.length ? $next : false;
|
1455 |
+
};
|
1456 |
+
|
1457 |
+
var findPrev = function findPrev(selector) {
|
1458 |
+
var $selector = $(selector),
|
1459 |
+
$root = this.first(),
|
1460 |
+
index = $selector.index($root),
|
1461 |
+
$prev = $selector.eq(index - 1);
|
1462 |
+
return $prev.length ? $prev : false;
|
1463 |
+
};
|
1464 |
+
|
1465 |
+
var progress = function progress(v) {
|
1466 |
+
return this.each(function () {
|
1467 |
+
var t = parseInt(v / 100 * 360),
|
1468 |
+
timer = null,
|
1469 |
+
$this = $(this);
|
1470 |
+
|
1471 |
+
if (t < 180) {
|
1472 |
+
$this.find('.progress-circle').removeClass('gt-50');
|
1473 |
+
} else {
|
1474 |
+
$this.find('.progress-circle').addClass('gt-50');
|
1475 |
+
}
|
1476 |
+
$this.find('.fill').css({
|
1477 |
+
transform: 'rotate(' + t + 'deg)'
|
1478 |
+
});
|
1479 |
+
});
|
1480 |
+
};
|
1481 |
+
|
1482 |
+
$.fn.serializeJSON = serializeJSON;
|
1483 |
+
$.fn.LP_Tooltip = LP_Tooltip;
|
1484 |
+
$.fn.hasEvent = hasEvent;
|
1485 |
+
$.fn.dataToJSON = dataToJSON;
|
1486 |
+
$.fn.rows = rows;
|
1487 |
+
$.fn.checkLines = checkLines;
|
1488 |
+
$.fn.findNext = findNext;
|
1489 |
+
$.fn.findPrev = findPrev;
|
1490 |
+
$.fn.progress = progress;
|
1491 |
+
|
1492 |
+
exports.default = {
|
1493 |
+
serializeJSON: serializeJSON,
|
1494 |
+
LP_Tooltip: LP_Tooltip,
|
1495 |
+
hasEvent: hasEvent,
|
1496 |
+
dataToJSON: dataToJSON,
|
1497 |
+
rows: rows,
|
1498 |
+
checkLines: checkLines,
|
1499 |
+
findNext: findNext,
|
1500 |
+
findPrev: findPrev,
|
1501 |
+
progress: progress
|
1502 |
+
};
|
1503 |
+
|
1504 |
+
/***/ })
|
1505 |
+
/******/ ]);
|
1506 |
+
//# sourceMappingURL=utils.js.map
|
assets/js/utils.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(0),s=i(a),r=n(2),c=i(r),l=n(3),u=i(l),d=n(4),f=i(d),p=n(5),h=i(p),v=n(6),g=i(v),m=n(7),y=(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]);e.default=t}(m),jQuery);String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)"),n=e.exec(this);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,i=n.split("#");return n=i[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(i[1]?"#"+i[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(i,""))+(n[1]?"#"+n[1]:"")},0==y.isEmptyObject("")&&(y.isEmptyObject=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0});var b={Hook:g.default,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=y(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle(function(){y(this).is(":visible")?y(e).addClass("toggle-on").removeClass("toggle-off"):y(e).addClass("toggle-off").removeClass("toggle-on")})},overflow:function(t,e){var n=y(t),i=n.css("overflow");e?n.css("overflow",e).data("overflow",i):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){var e=(t+"").match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);try{t=e?y.parseJSON(e[1]):y.parseJSON(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",i=t.action?y.extend(t.data,{"lp-ajax":t.action}):t.data,o=t.beforeSend||function(){},a=t.url||window.location.href;y.ajax({data:i,url:a,type:e,dataType:"html",beforeSend:o.apply(null,t),success:function(e){var i=LP.parseResponse(e,n);y.isFunction(t.success)&&t.success(i,e)},error:function(){y.isFunction(t.error)&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",i=(void 0===t.prefix||"learnpress_")+t.action,o=t.action?y.extend(t.data,{action:i}):t.data;y.ajax({data:o,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var i=LP.parseResponse(e,n);y.isFunction(t.success)&&t.success(i,e)},error:function(){y.isFunction(t.error)&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},addFilter:function(t,e){var n=y(document),i="LP."+t;return n.on(i,e),LP.log(n.data("events")),this},applyFilters:function(){var t=y(document),e=arguments[0],n=this.funcArgs2Array(arguments);return t.hasEvent(e)?(n[0]="LP."+e,t.triggerHandler.apply(t,n)):n[1]},addAction:function(t,e){return this.addFilter(t,e)},doAction:function(){var t=y(document),e=arguments[0],n=this.funcArgs2Array(arguments);t.hasEvent(e)&&(n[0]="LP."+e,t.trigger.apply(t,n))},toElement:function(t,e){if(0!==y(t).length){e=y.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},e||{});var n=y(e.container),i=0;0===n.length&&(n=y("body, html")),i=n.offset().top;var o=y(t).offset().top+n.scrollTop()-i-e.offset;e.invisible&&function(t,e){var i=n.scrollTop(),o=i+n.height(),a=y(t).offset().top-n.offset().top,s=a+y(t).height();return!0===e?i<a&&o>s:a<=o&&s>=i}(t,!0)||n.fadeIn(10).delay(e.delay).animate({scrollTop:o},e.duration,e.callback)}},uniqueId:function(t,e){void 0===t&&(t="");var n,i=function(t,e){return t=parseInt(t,10).toString(16),e<t.length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=i(parseInt((new Date).getTime()/1e3,10),8),n+=i(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t<e;t++)console.log(arguments[t])},blockContent:function(){0===y("#learn-press-block-content").length&&y(LP.template("learn-press-template-block-content",{})).appendTo(y("body")),LP.hideMainScrollbar().addClass("block-content"),y(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout(function(){LP.showMainScrollbar().removeClass("block-content"),y(document).trigger("learn_press_unblock_content")},350)},hideMainScrollbar:function(t){t||(t="html, body");var e=y(t);return e.each(function(){var t=y(this),e=t.css("overflow");t.css("overflow","hidden").attr("overflow",e)}),e},showMainScrollbar:function(t){t||(t="html, body");var e=y(t);return e.each(function(){var t=y(this),e=t.attr("overflow");t.css("overflow",e).removeAttr("overflow")}),e},template:"undefined"!=typeof _?_.memoize(function(t,e){var n,i={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=function(e){return(n=n||_.template(y("#"+t).html(),null,i))(e)};return e?o(e):o},function(t,e){return t+"-"+JSON.stringify(e)}):function(){return""},alert:function(t,e){var n="",i="";"string"==typeof t?i=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(i=t.message)),y.alerts.alert(i,n,function(t){LP._on_alert_hide(),e&&e(t)}),this._on_alert_show()},confirm:function(t,e){var n="",i="";"string"==typeof t?i=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(i=t.message)),y.alerts.confirm(i,n,function(t){LP._on_alert_hide(),e&&e(t)}),this._on_alert_show()},_on_alert_show:function(){var t=y("#popup_container");y('<span id="popup_container_placeholder" />').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=y("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(y(document.body)),e.stop().animate({top:"+=50",opacity:0},250,function(){y(this).remove()})},sendMessage:function(t,e,n,i){y.isPlainObject(t)&&(t=JSON.stringify(t)),e=e||window,n=n||"*",e.postMessage(t,n,i)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,i=t.data||t.originalEvent.data||"";("string"==typeof i||i instanceof String)&&0===i.indexOf("{")&&(i=LP.parseJSON(i)),LP.Hook.doAction("learn_press_receive_message",i,n)}};y(document).ready(function(){void 0!==y.alerts&&(y.alerts.overlayColor="#000",y.alerts.overlayOpacity=.5,y.alerts.okButton=lpGlobalSettings.localize.button_ok,y.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),y(".learn-press-message.fixed").each(function(){var t=y(this),e=t.data();!function(t,e){e.delayIn&&setTimeout(function(){t.show().hide().fadeIn()},e.delayIn),e.delayOut&&setTimeout(function(){t.fadeOut()},e.delayOut+(e.delayIn||0))}(t,e)}),y("body").on("click",".learn-press-nav-tabs li a",function(t){t.preventDefault();var e=y(this);e.closest("li").addClass("active").siblings().removeClass("active"),y(e.attr("data-tab")).addClass("active").siblings().removeClass("active"),y(document).trigger("learn-press/nav-tabs/clicked",e)}),setTimeout(function(){y(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")},300),y("body.course-item-popup").parent().css("overflow","hidden"),function(){var t=null,e=function(){y(".auto-check-lines").checkLines(function(t){t>1?y(this).removeClass("single-lines"):y(this).addClass("single-lines"),y(this).attr("rows",t)})};y(window).on("resize.check-lines",function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})}(),y(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),y(".learn-press-icon").LP_Tooltip({offset:[30,30]}),y(".learn-press-message[data-autoclose]").each(function(){var t=y(this),e=parseInt(t.data("autoclose"));e&&setTimeout(function(t){t.fadeOut()},e,t)}),y(document).on("click",function(){y(document).trigger("learn-press/close-all-quick-tip")})}),(0,s.default)(o({Event_Callback:h.default,MessageBox:f.default},b)),e.default={fn:c.default,QuickTip:u.default}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=window.jQuery;!function(){void 0!==o&&(o.fn.LP=i=function(t,e){if(o.isFunction(e))o.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var i=1;i<arguments.length;i++)n.push(arguments[i]);return o.isFunction(o(this)["LP_"+t])?o(this)["LP_"+t].apply(this,n):this}return this})}(),e.default=i},function(t,e,n){"use strict";!function(t){function e(e,n){function i(){if(d)return void clearTimeout(d);n.single&&t(".learn-press-tip").not(r).LP("QuickTip","close"),u.appendTo(document.body);var e=r.offset();u.css({top:e.top-u.outerHeight()-8,left:e.left-u.outerWidth()/2+h})}function o(){d&&clearTimeout(d),d=setTimeout(function(){u.detach(),d=null},f)}function a(){f=0,o(),f=n.closeInterval}function s(){i()}var r=t(e),c=r.attr("data-id")||LP.uniqueId();n=t.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,r.data()),r.attr("data-id",c);var l=r.attr("data-content-tip")||r.html(),u=t('<div class="learn-press-tip-floating">'+l+"</div>"),d=null,f=0,p=!1,h="el"===n.arrowOffset?r.outerWidth()/2:8,v=t("#__"+c);return 0===v.length&&t(document.body).append(t("<div />").attr("id","__"+c).html(l).css("display","none")),l=v.html(),u.addClass(n.tipClass),r.data("content-tip",l),r.attr("data-content-tip")&&(p=!0),f=n.closeInterval,!1===n.autoClose&&(u.append('<a class="close"></a>'),u.on("click",".close",function(){a()})),p||r.html(""),"click"===n.event&&r.on("click",function(t){t.stopPropagation(),i()}),t(document).on("learn-press/close-all-quick-tip",function(){a()}),r.hover(function(t){t.stopPropagation(),"click"!==n.event&&i()},function(t){t.stopPropagation(),n.autoClose&&o()}).addClass("ready"),{close:a,open:s}}t.fn.LP("QuickTip",function(n){return t.each(this,function(){var i=t(this).data("quick-tip");i||(i=new e(this,n),t(this).data("quick-tip",i)),"string"===t.type(n)&&i[n]&&i[n].apply(i)})})}(jQuery)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=window.jQuery,o={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(t,e){var n=i(t);i("[learn-press-quick-confirm]").each(function(){var t;(t=i(this).data("quick-confirm"))&&(console.log(t),t.destroy())}),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(t,e){var n=i(t),o=i('<span class="learn-press-quick-confirm"></span>').insertAfter(n),a=i(t).position()||{left:0,top:0},s=null,r=null,c=3,l=function(){o.fadeOut("fast",function(){i(this).remove(),o.parent().css("position","")}),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){r&&clearInterval(r),s&&clearInterval(s)},d=function(){s=setInterval(function(){0==--c&&(l.call(o[0]),i.isFunction(e.onCancel)&&e.onCancel(e.data),u()),o.find("span").html(" ("+c+")")},1e3),r=setInterval(function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),o.remove(),o.parent().css("position",""),i.isFunction(e.onCancel)&&e.onCancel(e.data))},350)};e=i.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),o.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+c+")</span>").css({}),o.click(function(){i.isFunction(e.onOk)&&e.onOk(e.data),l()}).hover(function(){u()},function(){d()}),o.css({left:a.left+n.outerWidth()-o.outerWidth()+e.offset.left,top:a.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),d(),this.destroy=function(){o.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){i.proxy(function(){e=i.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;var n=(i(document),i(document.body));this.$block||(this.$block=i('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=i('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click(function(){})),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),i(window).bind("resize.message-box",i.proxy(this.update,this)).bind("scroll.message-box",i.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout(function(){LP.MessageBox.hide(),i.isFunction(e.onHide)&&e.onHide.call(LP.MessageBox,e)},e.autohide)},this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),i(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),o=n.data("timer"),a=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),o=(n.outerWidth(),n.outerHeight()),a=t.height(),s=i(window).height();n.offset().top;a>s-50?(t.css({height:s-25}),o=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(i(window).height()-o)/2}),LP.Hook.doAction("learn_press_message_box_resize",o,e)};t&&a(),o&&clearTimeout(o),o=setTimeout(a,250)},_removeInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t){this.instances.splice(e,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t)return this.instances[e]},_createWindow:function(t,e,n){var o=this.$window.find("#message-box-wrap").html("");if(e&&o.append('<h3 class="message-box-title">'+e+"</h3>"),o.append(i('<div class="message-box-content"></div>').html(t)),n){var a=i('<div class="message-box-buttons"></div>');switch(n){case"yesNo":a.append(this._createButton(LP_Settings.localize.button_yes,"yes")),a.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":a.append(this._createButton(LP_Settings.localize.button_ok,"ok")),a.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:a.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}o.append(a)}},_createButton:function(t,e){var n=i('<button type="button" class="button message-box-button message-box-button-'+e+'">'+t+"</button>"),o="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",o).click(function(){var t=i(this).data("instance"),e=t.events[i(this).data("callback")];"function"===i.type(e)?!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t):LP.MessageBox.hide(null,t)}).data("instance",this.instance),n}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){var e={},n=window.jQuery;this.on=function(n,i){var o=n.split("."),a="";return o.length>1&&(n=o[0],a=o[1]),e[n]||(e[n]=[[],{}]),a?(e[n][1][a]||(e[n][1][a]=[]),e[n][1][a].push(i)):e[n][0].push(i),t},this.off=function(i,o){var a=i.split("."),s="";if(a.length>1&&(i=a[0],s=a[1]),!e[i])return t;var r=-1;if(s){if(!e[i][1][s])return t;if(n.isFunction(o)){if((r=e[i][1][s].indexOf(o))<0)return t;e[i][1][s].splice(r,1)}else e[i][1][s]=[]}else if(n.isFunction(o)){if((r=e[i][0].indexOf(o))<0)return t;e[i][0].splice(r,1)}else e[i][0]=[];return t},this.callEvent=function(i,o){if(e[i]){if(e[i][0])for(var a=0;a<e[i][0].length;a++)n.isFunction(e[i][0][a])&&e[i][a][0].apply(t,o);if(e[i][1])for(var a in e[i][1])for(var s=0;s<e[i][1][a].length;s++)n.isFunction(e[i][1][a][s])&&e[i][1][a][s].apply(t,o)}}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={hooks:{action:{},filter:{}},addAction:function(t,e,n,i){return this.addHook("action",t,e,n,i),this},addFilter:function(t,e,n,i){return this.addHook("filter",t,e,n,i),this},doAction:function(t){return this.doHook("action",t,arguments),this},applyFilters:function(t){return this.doHook("filter",t,arguments)},removeAction:function(t,e){return this.removeHook("action",t,e),this},removeFilter:function(t,e,n){return this.removeHook("filter",t,e,n),this},addHook:function(t,e,n,i,o){void 0===this.hooks[t][e]&&(this.hooks[t][e]=[]);var a=this.hooks[t][e];return void 0===o&&(o=e+"_"+a.length),this.hooks[t][e].push({tag:o,callable:n,priority:i}),this},doHook:function(t,e,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[t][e]){var i,o=this.hooks[t][e];o.sort(function(t,e){return t.priority-e.priority});for(var a=0;a<o.length;a++)i=o[a].callable,"function"!=typeof i&&(i=window[i]),"action"===t?i.apply(null,n):n[0]=i.apply(null,n)}return"filter"===t?n[0]:this},removeHook:function(t,e,n,i){if(void 0!==this.hooks[t][e])for(var o=this.hooks[t][e],a=o.length-1;a>=0;a--)void 0!==i&&i!==o[a].tag||void 0!==n&&n!==o[a].priority||o.splice(a,1);return this}};e.default=i},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="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},$=window.jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(void 0==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(t){console.log("Error:"+t+"\n"+objExp)}})):indexed[match[0]]=this.value}}),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(t){return t=$.extend({},{offset:[0,0]},t||{}),$.each(this,function(){var e=$(this),n=e.data("content");if(n&&void 0===e.data("LP_Tooltip")){var i=null;e.hover(function(o){i=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var a=e.offset();if($.isArray(t.offset)){var s=t.offset[1],r=t.offset[0];$.isNumeric(r)&&(a.left+=r),$.isNumeric(s)&&(a.top+=s)}i.css({top:a.top,left:a.left}),i.fadeIn()},function(){i&&i.remove()}),e.data("tooltip",!0)}})},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i<e.LP.length;i++)if(e.LP[i].namespace==t)return!0;return!1},dataToJSON=function(){var t={};return $.each(this[0].attributes,function(){var e=this.name.match(/^data-(.*)/);e&&(t[e[1]]=this.value)}),t},rows=function(){var t=$(this).height(),e=$(this).css("line-height").replace("px","");return $(this).attr({height:t,"line-height":e}),Math.floor(t/parseInt(e))},checkLines=function(t){return this.each(function(){var e=$(this),n=e.rows();t.call(this,n)})},findNext=function(t){var e=$(t),n=this.first(),i=e.index(n),o=e.eq(i+1);return!!o.length&&o},findPrev=function(t){var e=$(t),n=this.first(),i=e.index(n),o=e.eq(i-1);return!!o.length&&o},progress=function(t){return this.each(function(){var e=parseInt(t/100*360),n=$(this);e<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+e+"deg)"})})};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress,exports.default={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}}]);
|
assets/js/vendor/Chart.bundle.min.js
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* Chart.js
|
3 |
-
* http://chartjs.org/
|
4 |
-
* Version: 2.5.0
|
5 |
-
*
|
6 |
-
* Copyright 2017 Nick Downie
|
7 |
-
* Released under the MIT license
|
8 |
-
* https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
|
9 |
-
*/
|
10 |
-
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Chart=t()}}(function(){var t;return function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[o]={exports:{}};e[o][0].call(d.exports,function(t){var n=e[o][1][t];return a(n?n:t)},d,d.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(t,e,n){function i(t){if(t){var e=/^#([a-fA-F0-9]{3})$/,n=/^#([a-fA-F0-9]{6})$/,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,r=/(\w+)/,o=[0,0,0],s=1,l=t.match(e);if(l){l=l[1];for(var u=0;u<o.length;u++)o[u]=parseInt(l[u]+l[u],16)}else if(l=t.match(n)){l=l[1];for(var u=0;u<o.length;u++)o[u]=parseInt(l.slice(2*u,2*u+2),16)}else if(l=t.match(i)){for(var u=0;u<o.length;u++)o[u]=parseInt(l[u+1]);s=parseFloat(l[4])}else if(l=t.match(a)){for(var u=0;u<o.length;u++)o[u]=Math.round(2.55*parseFloat(l[u+1]));s=parseFloat(l[4])}else if(l=t.match(r)){if("transparent"==l[1])return[0,0,0,0];if(o=x[l[1]],!o)return}for(var u=0;u<o.length;u++)o[u]=b(o[u],0,255);return s=s||0==s?b(s,0,1):1,o[3]=s,o}}function a(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=b(parseInt(n[1]),0,360),r=b(parseFloat(n[2]),0,100),o=b(parseFloat(n[3]),0,100),s=b(isNaN(i)?1:i,0,1);return[a,r,o,s]}}}function r(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=b(parseInt(n[1]),0,360),r=b(parseFloat(n[2]),0,100),o=b(parseFloat(n[3]),0,100),s=b(isNaN(i)?1:i,0,1);return[a,r,o,s]}}}function o(t){var e=i(t);return e&&e.slice(0,3)}function s(t){var e=a(t);return e&&e.slice(0,3)}function l(t){var e=i(t);return e?e[3]:(e=a(t))?e[3]:(e=r(t))?e[3]:void 0}function u(t){return"#"+y(t[0])+y(t[1])+y(t[2])}function d(t,e){return e<1||t[3]&&t[3]<1?c(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function c(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function h(t,e){if(e<1||t[3]&&t[3]<1)return f(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"}function f(t,e){var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgba("+n+"%, "+i+"%, "+a+"%, "+(e||t[3]||1)+")"}function g(t,e){return e<1||t[3]&&t[3]<1?m(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function m(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function v(t){return k[t.slice(0,3)]}function b(t,e,n){return Math.min(Math.max(e,t),n)}function y(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var x=t(5);e.exports={getRgba:i,getHsla:a,getRgb:o,getHsl:s,getHwb:r,getAlpha:l,hexString:u,rgbString:d,rgbaString:c,percentString:h,percentaString:f,hslString:g,hslaString:m,hwbString:p,keyword:v};var k={};for(var _ in x)k[x[_]]=_},{5:5}],2:[function(t,e,n){var i=t(4),a=t(1),r=function(t){if(t instanceof r)return t;if(!(this instanceof r))return new r(t);this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;if("string"==typeof t)if(e=a.getRgba(t))this.setValues("rgb",e);else if(e=a.getHsla(t))this.setValues("hsl",e);else{if(!(e=a.getHwb(t)))throw new Error('Unable to parse color from string "'+t+'"');this.setValues("hwb",e)}else if("object"==typeof t)if(e=t,void 0!==e.r||void 0!==e.red)this.setValues("rgb",e);else if(void 0!==e.l||void 0!==e.lightness)this.setValues("hsl",e);else if(void 0!==e.v||void 0!==e.value)this.setValues("hsv",e);else if(void 0!==e.w||void 0!==e.whiteness)this.setValues("hwb",e);else{if(void 0===e.c&&void 0===e.cyan)throw new Error("Unable to parse color from object "+JSON.stringify(t));this.setValues("cmyk",e)}};r.prototype={rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new r,i=this.values,a=n.values;for(var o in i)i.hasOwnProperty(o)&&(t=i[o],e={}.toString.call(t),"[object Array]"===e?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return n}},r.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},r.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},r.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},r.prototype.setValues=function(t,e){var n,a=this.values,r=this.spaces,o=this.maxes,s=1;if("alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];s=e.a}else if(void 0!==e[r[t][0]]){var l=r[t];for(n=0;n<t.length;n++)a[t][n]=e[l[n]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;var u;for(n=0;n<t.length;n++)u=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(u);for(var d in r)d!==t&&(a[d]=i[t][d](a[t]));return!0},r.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},r.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.Color=r),e.exports=r},{1:1,4:4}],3:[function(t,e,n){function i(t){var e,n,i,a=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),e=Math.min(60*e,360),e<0&&(e+=360),i=(s+l)/2,n=l==s?0:i<=.5?u/(l+s):u/(2-l-s),[e,100*n,100*i]}function a(t){var e,n,i,a=t[0],r=t[1],o=t[2],s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return n=0==l?0:u/l*1e3/10,l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),e=Math.min(60*e,360),e<0&&(e+=360),i=l/255*1e3/10,[e,n,i]}function o(t){var e=t[0],n=t[1],a=t[2],r=i(t)[0],o=1/255*Math.min(e,Math.min(n,a)),a=1-1/255*Math.max(e,Math.max(n,a));return[r,100*o,100*a]}function s(t){var e,n,i,a,r=t[0]/255,o=t[1]/255,s=t[2]/255;return a=Math.min(1-r,1-o,1-s),e=(1-r-a)/(1-a)||0,n=(1-o-a)/(1-a)||0,i=(1-s-a)/(1-a)||0,[100*e,100*n,100*i,100*a]}function l(t){return K[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var a=.4124*e+.3576*n+.1805*i,r=.2126*e+.7152*n+.0722*i,o=.0193*e+.1192*n+.9505*i;return[100*a,100*r,100*o]}function d(t){var e,n,i,a=u(t),r=a[0],o=a[1],s=a[2];return r/=95.047,o/=100,s/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*o-16,n=500*(r-o),i=200*(o-s),[e,n,i]}function c(t){return Y(d(t))}function h(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return r=255*l,[r,r,r];n=l<.5?l*(1+s):l+s-l*s,e=2*l-n,a=[0,0,0];for(var u=0;u<3;u++)i=o+1/3*-(u-1),i<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a}function f(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return 0===r?[0,0,0]:(r*=2,a*=r<=1?r:2-r,n=(r+a)/2,e=2*a/(r+a),[i,100*e,100*n])}function m(t){return o(h(t))}function p(t){return s(h(t))}function v(t){return l(h(t))}function y(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r)),i=255*i;switch(a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}}function x(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return n=(2-a)*r,e=a*r,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]}function k(t){return o(y(t))}function _(t){return s(y(t))}function w(t){return l(y(t))}function S(t){var e,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),e=Math.floor(6*o),n=1-l,i=6*o-e,0!=(1&e)&&(i=1-i),a=s+i*(n-s),e){default:case 6:case 0:r=n,g=a,b=s;break;case 1:r=a,g=n,b=s;break;case 2:r=s,g=n,b=a;break;case 3:r=s,g=a,b=n;break;case 4:r=a,g=s,b=n;break;case 5:r=n,g=s,b=a}return[255*r,255*g,255*b]}function M(t){return i(S(t))}function D(t){return a(S(t))}function C(t){return s(S(t))}function T(t){return l(S(t))}function P(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*i]}function I(t){return i(P(t))}function A(t){return a(P(t))}function F(t){return o(P(t))}function O(t){return l(P(t))}function R(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return e=3.2406*a+r*-1.5372+o*-.4986,n=a*-.9689+1.8758*r+.0415*o,i=.0557*a+r*-.204+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function L(t){var e,n,i,a=t[0],r=t[1],o=t[2];return a/=95.047,r/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*r-16,n=500*(a-r),i=200*(r-o),[e,n,i]}function V(t){return Y(L(t))}function W(t){var e,n,i,a,r=t[0],o=t[1],s=t[2];return r<=8?(n=100*r/903.3,a=7.787*(n/100)+16/116):(n=100*Math.pow((r+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),i=i/108.883<=.008859?i=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3),[e,n,i]}function Y(t){var e,n,i,a=t[0],r=t[1],o=t[2];return e=Math.atan2(o,r),n=360*e/2/Math.PI,n<0&&(n+=360),i=Math.sqrt(r*r+o*o),[a,i,n]}function B(t){return R(W(t))}function z(t){var e,n,i,a=t[0],r=t[1],o=t[2];return i=o/360*2*Math.PI,e=r*Math.cos(i),n=r*Math.sin(i),[a,e,n]}function N(t){return W(z(t))}function H(t){return B(z(t))}function E(t){return J[t]}function U(t){return i(E(t))}function j(t){return a(E(t))}function G(t){return o(E(t))}function q(t){return s(E(t))}function Z(t){return d(E(t))}function X(t){return u(E(t))}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:d,rgb2lch:c,hsl2rgb:h,hsl2hsv:f,hsl2hwb:m,hsl2cmyk:p,hsl2keyword:v,hsv2rgb:y,hsv2hsl:x,hsv2hwb:k,hsv2cmyk:_,hsv2keyword:w,hwb2rgb:S,hwb2hsl:M,hwb2hsv:D,hwb2cmyk:C,hwb2keyword:T,cmyk2rgb:P,cmyk2hsl:I,cmyk2hsv:A,cmyk2hwb:F,cmyk2keyword:O,keyword2rgb:E,keyword2hsl:U,keyword2hsv:j,keyword2hwb:G,keyword2cmyk:q,keyword2lab:Z,keyword2xyz:X,xyz2rgb:R,xyz2lab:L,xyz2lch:V,lab2xyz:W,lab2rgb:B,lab2lch:Y,lch2lab:z,lch2xyz:N,lch2rgb:H};var J={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},K={};for(var Q in J)K[JSON.stringify(J[Q])]=Q},{}],4:[function(t,e,n){var i=t(3),a=function(){return new u};for(var r in i){a[r+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(r);var o=/(\w+)2(\w+)/.exec(r),s=o[1],l=o[2];a[s]=a[s]||{},a[s][l]=a[r]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a<n.length;a++)n[a]=Math.round(n[a]);return n}}(r)}var u=function(){this.convs={}};u.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=a[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){u.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=a},{3:3}],5:[function(t,e,n){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],6:[function(e,n,i){!function(e,a){"object"==typeof i&&"undefined"!=typeof n?n.exports=a():"function"==typeof t&&t.amd?t(a):e.moment=a()}(this,function(){"use strict";function t(){return vi.apply(null,arguments)}function i(t){vi=t}function a(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){var e;for(e in t)return!1;return!0}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){for(var n in e)d(e,n)&&(t[n]=e[n]);return d(e,"toString")&&(t.toString=e.toString),d(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,n,i){return ye(t,e,n,i,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function g(t){return null==t._pf&&(t._pf=f()),t._pf}function m(t){if(null==t._isValid){var e=g(t),n=yi.call(e.parsedDateParts,function(t){return null!=t}),i=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(i=i&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return i;t._isValid=i}return t._isValid}function p(t){var e=h(NaN);return null!=t?c(g(e),t):g(e).userInvalidated=!0,e}function v(t){return void 0===t}function b(t,e){var n,i,a;if(v(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),v(e._i)||(t._i=e._i),v(e._f)||(t._f=e._f),v(e._l)||(t._l=e._l),v(e._strict)||(t._strict=e._strict),v(e._tzm)||(t._tzm=e._tzm),v(e._isUTC)||(t._isUTC=e._isUTC),v(e._offset)||(t._offset=e._offset),v(e._pf)||(t._pf=g(e)),v(e._locale)||(t._locale=e._locale),xi.length>0)for(n in xi)i=xi[n],a=e[i],v(a)||(t[i]=a);return t}function y(e){b(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),ki===!1&&(ki=!0,t.updateOffset(this),ki=!1)}function x(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function k(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function _(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=k(e)),n}function w(t,e,n){var i,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(i=0;i<a;i++)(n&&t[i]!==e[i]||!n&&_(t[i])!==_(e[i]))&&o++;return o+r}function S(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function M(e,n){var i=!0;return c(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),i){for(var a,r=[],o=0;o<arguments.length;o++){if(a="","object"==typeof arguments[o]){a+="\n["+o+"] ";for(var s in arguments[0])a+=s+": "+arguments[0][s]+", ";a=a.slice(0,-2)}else a=arguments[o];r.push(a)}S(e+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return n.apply(this,arguments)},n)}function D(e,n){null!=t.deprecationHandler&&t.deprecationHandler(e,n),_i[e]||(S(n),_i[e]=!0)}function C(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function T(t){var e,n;for(n in t)e=t[n],C(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function P(t,e){var n,i=c({},t);for(n in e)d(e,n)&&(r(t[n])&&r(e[n])?(i[n]={},c(i[n],t[n]),c(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)d(t,n)&&!d(e,n)&&r(t[n])&&(i[n]=c({},i[n]));return i}function I(t){null!=t&&this.set(t)}function A(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return C(i)?i.call(e,n):i}function F(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function O(){return this._invalidDate}function R(t){return this._ordinal.replace("%d",t)}function L(t,e,n,i){var a=this._relativeTime[n];return C(a)?a(t,e,n,i):a.replace(/%d/i,t)}function V(t,e){var n=this._relativeTime[t>0?"future":"past"];return C(n)?n(e):n.replace(/%s/i,e)}function W(t,e){var n=t.toLowerCase();Fi[n]=Fi[n+"s"]=Fi[e]=t}function Y(t){return"string"==typeof t?Fi[t]||Fi[t.toLowerCase()]:void 0}function B(t){var e,n,i={};for(n in t)d(t,n)&&(e=Y(n),e&&(i[e]=t[n]));return i}function z(t,e){Oi[t]=e}function N(t){var e=[];for(var n in t)e.push({unit:n,priority:Oi[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function H(e,n){return function(i){return null!=i?(U(this,e,i),t.updateOffset(this,n),this):E(this,e)}}function E(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function U(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function j(t){return t=Y(t),C(this[t])?this[t]():this}function G(t,e){if("object"==typeof t){t=B(t);for(var n=N(t),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit])}else if(t=Y(t),C(this[t]))return this[t](e);return this}function q(t,e,n){var i=""+Math.abs(t),a=e-i.length,r=t>=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}function Z(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(Wi[t]=a),e&&(Wi[e[0]]=function(){return q(a.apply(this,arguments),e[1],e[2])}),n&&(Wi[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function J(t){var e,n,i=t.match(Ri);for(e=0,n=i.length;e<n;e++)Wi[i[e]]?i[e]=Wi[i[e]]:i[e]=X(i[e]);return function(e){var a,r="";for(a=0;a<n;a++)r+=i[a]instanceof Function?i[a].call(e,t):i[a];return r}}function K(t,e){return t.isValid()?(e=Q(e,t.localeData()),Vi[e]=Vi[e]||J(e),Vi[e](t)):t.localeData().invalidDate()}function Q(t,e){function n(t){return e.longDateFormat(t)||t}var i=5;for(Li.lastIndex=0;i>=0&&Li.test(t);)t=t.replace(Li,n),Li.lastIndex=0,i-=1;return t}function $(t,e,n){ea[t]=C(e)?e:function(t,i){return t&&n?n:e}}function tt(t,e){return d(ea,t)?ea[t](e._strict,e._locale):new RegExp(et(t))}function et(t){return nt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,a){return e||n||i||a}))}function nt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),s(e)&&(i=function(t,n){n[e]=_(t)}),n=0;n<t.length;n++)na[t[n]]=i}function at(t,e){it(t,function(t,n,i,a){i._w=i._w||{},e(t,i._w,i,a)})}function rt(t,e,n){null!=e&&d(na,t)&&na[t](e,n._a,n,t)}function ot(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function st(t,e){return t?a(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||fa).test(e)?"format":"standalone"][t.month()]:this._months}function lt(t,e){return t?a(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[fa.test(e)?"format":"standalone"][t.month()]:this._monthsShort}function ut(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=h([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===e?(a=ha.call(this._shortMonthsParse,o),a!==-1?a:null):(a=ha.call(this._longMonthsParse,o),a!==-1?a:null):"MMM"===e?(a=ha.call(this._shortMonthsParse,o),a!==-1?a:(a=ha.call(this._longMonthsParse,o),a!==-1?a:null)):(a=ha.call(this._longMonthsParse,o),a!==-1?a:(a=ha.call(this._shortMonthsParse,o),a!==-1?a:null))}function dt(t,e,n){var i,a,r;if(this._monthsParseExact)return ut.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=h([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}}function ct(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=_(e);else if(e=t.localeData().monthsParse(e),!s(e))return t;return n=Math.min(t.date(),ot(t.year(),e)),
|
11 |
-
t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function ht(e){return null!=e?(ct(this,e),t.updateOffset(this,!0),this):E(this,"Month")}function ft(){return ot(this.year(),this.month())}function gt(t){return this._monthsParseExact?(d(this,"_monthsRegex")||pt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=pa),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function mt(t){return this._monthsParseExact?(d(this,"_monthsRegex")||pt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=va),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function pt(){function t(t,e){return e.length-t.length}var e,n,i=[],a=[],r=[];for(e=0;e<12;e++)n=h([2e3,e]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)i[e]=nt(i[e]),a[e]=nt(a[e]);for(e=0;e<24;e++)r[e]=nt(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function vt(t){return bt(t)?366:365}function bt(t){return t%4===0&&t%100!==0||t%400===0}function yt(){return bt(this.year())}function xt(t,e,n,i,a,r,o){var s=new Date(t,e,n,i,a,r,o);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function kt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function _t(t,e,n){var i=7+e-n,a=(7+kt(t,0,i).getUTCDay()-e)%7;return-a+i-1}function wt(t,e,n,i,a){var r,o,s=(7+n-i)%7,l=_t(t,i,a),u=1+7*(e-1)+s+l;return u<=0?(r=t-1,o=vt(r)+u):u>vt(t)?(r=t+1,o=u-vt(t)):(r=t,o=u),{year:r,dayOfYear:o}}function St(t,e,n){var i,a,r=_t(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?(a=t.year()-1,i=o+Mt(a,e,n)):o>Mt(t.year(),e,n)?(i=o-Mt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Mt(t,e,n){var i=_t(t,e,n),a=_t(t+1,e,n);return(vt(t)-i+a)/7}function Dt(t){return St(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Tt(){return this._week.doy}function Pt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function It(t){var e=St(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function At(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Ft(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ot(t,e){return t?a(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Rt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Lt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Vt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?(a=ha.call(this._weekdaysParse,o),a!==-1?a:null):"ddd"===e?(a=ha.call(this._shortWeekdaysParse,o),a!==-1?a:null):(a=ha.call(this._minWeekdaysParse,o),a!==-1?a:null):"dddd"===e?(a=ha.call(this._weekdaysParse,o),a!==-1?a:(a=ha.call(this._shortWeekdaysParse,o),a!==-1?a:(a=ha.call(this._minWeekdaysParse,o),a!==-1?a:null))):"ddd"===e?(a=ha.call(this._shortWeekdaysParse,o),a!==-1?a:(a=ha.call(this._weekdaysParse,o),a!==-1?a:(a=ha.call(this._minWeekdaysParse,o),a!==-1?a:null))):(a=ha.call(this._minWeekdaysParse,o),a!==-1?a:(a=ha.call(this._weekdaysParse,o),a!==-1?a:(a=ha.call(this._shortWeekdaysParse,o),a!==-1?a:null)))}function Wt(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Vt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=h([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function Yt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=At(t,this.localeData()),this.add(t-e,"d")):e}function Bt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function zt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Ft(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Nt(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Ut.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=wa),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ht(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Ut.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Sa),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Et(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Ut.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ma),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ut(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=h([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=nt(s[e]),l[e]=nt(l[e]),u[e]=nt(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function jt(){return this.hours()%12||12}function Gt(){return this.hours()||24}function qt(t,e){Z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Zt(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Jt(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Kt(t){return t?t.toLowerCase().replace("_","-"):t}function Qt(t){for(var e,n,i,a,r=0;r<t.length;){for(a=Kt(t[r]).split("-"),e=a.length,n=Kt(t[r+1]),n=n?n.split("-"):null;e>0;){if(i=$t(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&w(a,n,!0)>=e-1)break;e--}r++}return null}function $t(t){var i=null;if(!Ia[t]&&"undefined"!=typeof n&&n&&n.exports)try{i=Da._abbr,e("./locale/"+t),te(i)}catch(t){}return Ia[t]}function te(t,e){var n;return t&&(n=v(e)?ie(t):ee(t,e),n&&(Da=n)),Da._abbr}function ee(t,e){if(null!==e){var n=Pa;if(e.abbr=t,null!=Ia[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ia[t]._config;else if(null!=e.parentLocale){if(null==Ia[e.parentLocale])return Aa[e.parentLocale]||(Aa[e.parentLocale]=[]),Aa[e.parentLocale].push({name:t,config:e}),null;n=Ia[e.parentLocale]._config}return Ia[t]=new I(P(n,e)),Aa[t]&&Aa[t].forEach(function(t){ee(t.name,t.config)}),te(t),Ia[t]}return delete Ia[t],null}function ne(t,e){if(null!=e){var n,i=Pa;null!=Ia[t]&&(i=Ia[t]._config),e=P(i,e),n=new I(e),n.parentLocale=Ia[t],Ia[t]=n,te(t)}else null!=Ia[t]&&(null!=Ia[t].parentLocale?Ia[t]=Ia[t].parentLocale:null!=Ia[t]&&delete Ia[t]);return Ia[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Da;if(!a(t)){if(e=$t(t))return e;t=[t]}return Qt(t)}function ae(){return Mi(Ia)}function re(t){var e,n=t._a;return n&&g(t).overflow===-2&&(e=n[aa]<0||n[aa]>11?aa:n[ra]<1||n[ra]>ot(n[ia],n[aa])?ra:n[oa]<0||n[oa]>24||24===n[oa]&&(0!==n[sa]||0!==n[la]||0!==n[ua])?oa:n[sa]<0||n[sa]>59?sa:n[la]<0||n[la]>59?la:n[ua]<0||n[ua]>999?ua:-1,g(t)._overflowDayOfYear&&(e<ia||e>ra)&&(e=ra),g(t)._overflowWeeks&&e===-1&&(e=da),g(t)._overflowWeekday&&e===-1&&(e=ca),g(t).overflow=e),t}function oe(t){var e,n,i,a,r,o,s=t._i,l=Fa.exec(s)||Oa.exec(s);if(l){for(g(t).iso=!0,e=0,n=La.length;e<n;e++)if(La[e][1].exec(l[1])){a=La[e][0],i=La[e][2]!==!1;break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,n=Va.length;e<n;e++)if(Va[e][1].exec(l[3])){r=(l[2]||" ")+Va[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(l[4]){if(!Ra.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),he(t)}else t._isValid=!1}function se(e){var n=Wa.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(oe(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function le(t,e,n){return null!=t?t:null!=e?e:n}function ue(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function de(t){var e,n,i,a,r=[];if(!t._d){for(i=ue(t),t._w&&null==t._a[ra]&&null==t._a[aa]&&ce(t),t._dayOfYear&&(a=le(t._a[ia],i[ia]),t._dayOfYear>vt(a)&&(g(t)._overflowDayOfYear=!0),n=kt(a,0,t._dayOfYear),t._a[aa]=n.getUTCMonth(),t._a[ra]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[oa]&&0===t._a[sa]&&0===t._a[la]&&0===t._a[ua]&&(t._nextDay=!0,t._a[oa]=0),t._d=(t._useUTC?kt:xt).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[oa]=24)}}function ce(t){var e,n,i,a,r,o,s,l;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)r=1,o=4,n=le(e.GG,t._a[ia],St(xe(),1,4).year),i=le(e.W,1),a=le(e.E,1),(a<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=St(xe(),r,o);n=le(e.gg,t._a[ia],u.year),i=le(e.w,u.week),null!=e.d?(a=e.d,(a<0||a>6)&&(l=!0)):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Mt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=wt(n,i,a,r,o),t._a[ia]=s.year,t._dayOfYear=s.dayOfYear)}function he(e){if(e._f===t.ISO_8601)return void oe(e);e._a=[],g(e).empty=!0;var n,i,a,r,o,s=""+e._i,l=s.length,u=0;for(a=Q(e._f,e._locale).match(Ri)||[],n=0;n<a.length;n++)r=a[n],i=(s.match(tt(r,e))||[])[0],i&&(o=s.substr(0,s.indexOf(i)),o.length>0&&g(e).unusedInput.push(o),s=s.slice(s.indexOf(i)+i.length),u+=i.length),Wi[r]?(i?g(e).empty=!1:g(e).unusedTokens.push(r),rt(r,i,e)):e._strict&&!i&&g(e).unusedTokens.push(r);g(e).charsLeftOver=l-u,s.length>0&&g(e).unusedInput.push(s),e._a[oa]<=12&&g(e).bigHour===!0&&e._a[oa]>0&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[oa]=fe(e._locale,e._a[oa],e._meridiem),de(e),re(e)}function fe(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function ge(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)r=0,e=b({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],he(e),m(e)&&(r+=g(e).charsLeftOver,r+=10*g(e).unusedTokens.length,g(e).score=r,(null==i||r<i)&&(i=r,n=e));c(t,n||e)}function me(t){if(!t._d){var e=B(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),de(t)}}function pe(t){var e=new y(re(ve(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ve(t){var e=t._i,n=t._f;return t._locale=t._locale||ie(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),x(e)?new y(re(e)):(l(e)?t._d=e:a(n)?ge(t):n?he(t):be(t),m(t)||(t._d=null),t))}function be(e){var n=e._i;void 0===n?e._d=new Date(t.now()):l(n)?e._d=new Date(n.valueOf()):"string"==typeof n?se(e):a(n)?(e._a=u(n.slice(0),function(t){return parseInt(t,10)}),de(e)):"object"==typeof n?me(e):s(n)?e._d=new Date(n):t.createFromInputFallback(e)}function ye(t,e,n,i,s){var l={};return n!==!0&&n!==!1||(i=n,n=void 0),(r(t)&&o(t)||a(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=n,l._i=t,l._f=e,l._strict=i,pe(l)}function xe(t,e,n,i){return ye(t,e,n,i,!1)}function ke(t,e){var n,i;if(1===e.length&&a(e[0])&&(e=e[0]),!e.length)return xe();for(n=e[0],i=1;i<e.length;++i)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n}function _e(){var t=[].slice.call(arguments,0);return ke("isBefore",t)}function we(){var t=[].slice.call(arguments,0);return ke("isAfter",t)}function Se(t){var e=B(t),n=e.year||0,i=e.quarter||0,a=e.month||0,r=e.week||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*i+12*n,this._data={},this._locale=ie(),this._bubble()}function Me(t){return t instanceof Se}function De(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function Ce(t,e){Z(t,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+q(~~(t/60),2)+e+q(~~t%60,2)})}function Te(t,e){var n=(e||"").match(t);if(null===n)return null;var i=n[n.length-1]||[],a=(i+"").match(Na)||["-",0,0],r=+(60*a[1])+_(a[2]);return 0===r?0:"+"===a[0]?r:-r}function Pe(e,n){var i,a;return n._isUTC?(i=n.clone(),a=(x(e)||l(e)?e.valueOf():xe(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+a),t.updateOffset(i,!1),i):xe(e).local()}function Ie(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ae(e,n){var i,a=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(e=Te(Qi,e),null===e)return this}else Math.abs(e)<16&&(e*=60);return!this._isUTC&&n&&(i=Ie(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),a!==e&&(!n||this._changeInProgress?qe(this,He(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?a:Ie(this)}function Fe(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Oe(t){return this.utcOffset(0,t)}function Re(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ie(this),"m")),this}function Le(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var t=Te(Ki,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Ve(t){return!!this.isValid()&&(t=t?xe(t).utcOffset():0,(this.utcOffset()-t)%60===0)}function We(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ye(){if(!v(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),t=ve(t),t._a){var e=t._isUTC?h(t._a):xe(t._a);this._isDSTShifted=this.isValid()&&w(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Be(){return!!this.isValid()&&!this._isUTC}function ze(){return!!this.isValid()&&this._isUTC}function Ne(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function He(t,e){var n,i,a,r=t,o=null;return Me(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(r={},e?r[e]=t:r.milliseconds=t):(o=Ha.exec(t))?(n="-"===o[1]?-1:1,r={y:0,d:_(o[ra])*n,h:_(o[oa])*n,m:_(o[sa])*n,s:_(o[la])*n,ms:_(De(1e3*o[ua]))*n}):(o=Ea.exec(t))?(n="-"===o[1]?-1:1,r={y:Ee(o[2],n),M:Ee(o[3],n),w:Ee(o[4],n),d:Ee(o[5],n),h:Ee(o[6],n),m:Ee(o[7],n),s:Ee(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(a=je(xe(r.from),xe(r.to)),r={},r.ms=a.milliseconds,r.M=a.months),i=new Se(r),Me(t)&&d(t,"_locale")&&(i._locale=t._locale),i}function Ee(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ue(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function je(t,e){var n;return t.isValid()&&e.isValid()?(e=Pe(e,t),t.isBefore(e)?n=Ue(t,e):(n=Ue(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ge(t,e){return function(n,i){var a,r;return null===i||isNaN(+i)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),n="string"==typeof n?+n:n,a=He(n,i),qe(this,a,t),this}}function qe(e,n,i,a){var r=n._milliseconds,o=De(n._days),s=De(n._months);e.isValid()&&(a=null==a||a,r&&e._d.setTime(e._d.valueOf()+r*i),o&&U(e,"Date",E(e,"Date")+o*i),s&&ct(e,E(e,"Month")+s*i),a&&t.updateOffset(e,o||s))}function Ze(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Xe(e,n){var i=e||xe(),a=Pe(i,this).startOf("day"),r=t.calendarFormat(this,a)||"sameElse",o=n&&(C(n[r])?n[r].call(this,i):n[r]);return this.format(o||this.localeData().calendar(r,this,xe(i)))}function Je(){return new y(this)}function Ke(t,e){var n=x(t)?t:xe(t);return!(!this.isValid()||!n.isValid())&&(e=Y(v(e)?"millisecond":e),"millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())}function Qe(t,e){var n=x(t)?t:xe(t);return!(!this.isValid()||!n.isValid())&&(e=Y(v(e)?"millisecond":e),"millisecond"===e?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())}function $e(t,e,n,i){return i=i||"()",("("===i[0]?this.isAfter(t,n):!this.isBefore(t,n))&&(")"===i[1]?this.isBefore(e,n):!this.isAfter(e,n))}function tn(t,e){var n,i=x(t)?t:xe(t);return!(!this.isValid()||!i.isValid())&&(e=Y(e||"millisecond"),"millisecond"===e?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))}function en(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function nn(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function an(t,e,n){var i,a,r,o;return this.isValid()?(i=Pe(t,this),i.isValid()?(a=6e4*(i.utcOffset()-this.utcOffset()),e=Y(e),"year"===e||"month"===e||"quarter"===e?(o=rn(this,i),"quarter"===e?o/=3:"year"===e&&(o/=12)):(r=this-i,o="second"===e?r/1e3:"minute"===e?r/6e4:"hour"===e?r/36e5:"day"===e?(r-a)/864e5:"week"===e?(r-a)/6048e5:r),n?o:k(o)):NaN):NaN}function rn(t,e){var n,i,a=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(a,"months");return e-r<0?(n=t.clone().add(a-1,"months"),i=(e-r)/(r-n)):(n=t.clone().add(a+1,"months"),i=(e-r)/(n-r)),-(a+i)||0}function on(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function sn(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?C(Date.prototype.toISOString)?this.toDate().toISOString():K(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):K(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function ln(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",r=e+'[")]';return this.format(n+i+a+r)}function un(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=K(this,e);return this.localeData().postformat(n)}function dn(t,e){return this.isValid()&&(x(t)&&t.isValid()||xe(t).isValid())?He({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function cn(t){return this.from(xe(),t)}function hn(t,e){return this.isValid()&&(x(t)&&t.isValid()||xe(t).isValid())?He({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function fn(t){return this.to(xe(),t)}function gn(t){var e;return void 0===t?this._locale._abbr:(e=ie(t),null!=e&&(this._locale=e),this)}function mn(){return this._locale}function pn(t){switch(t=Y(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function vn(t){return t=Y(t),void 0===t||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))}function bn(){return this._d.valueOf()-6e4*(this._offset||0)}function yn(){return Math.floor(this.valueOf()/1e3)}function xn(){return new Date(this.valueOf())}function kn(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function _n(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function wn(){return this.isValid()?this.toISOString():null}function Sn(){return m(this)}function Mn(){return c({},g(this))}function Dn(){return g(this).overflow}function Cn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Tn(t,e){Z(0,[t,t.length],0,e)}function Pn(t){return On.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function In(t){return On.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function An(){return Mt(this.year(),1,4)}function Fn(){var t=this.localeData()._week;return Mt(this.year(),t.dow,t.doy)}function On(t,e,n,i,a){var r;return null==t?St(this,i,a).year:(r=Mt(t,i,a),e>r&&(e=r),Rn.call(this,t,e,n,i,a))}function Rn(t,e,n,i,a){var r=wt(t,e,n,i,a),o=kt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Ln(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Vn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Wn(t,e){e[ua]=_(1e3*("0."+t))}function Yn(){return this._isUTC?"UTC":""}function Bn(){return this._isUTC?"Coordinated Universal Time":""}function zn(t){return xe(1e3*t)}function Nn(){return xe.apply(null,arguments).parseZone()}function Hn(t){return t}function En(t,e,n,i){var a=ie(),r=h().set(i,e);return a[n](r,t)}function Un(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return En(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=En(t,i,n,"month");return a}function jn(t,e,n,i){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var a=ie(),r=t?a._week.dow:0;if(null!=n)return En(e,(n+r)%7,i,"day");var o,l=[];for(o=0;o<7;o++)l[o]=En(e,(o+r)%7,i,"day");return l}function Gn(t,e){return Un(t,e,"months")}function qn(t,e){return Un(t,e,"monthsShort")}function Zn(t,e,n){return jn(t,e,n,"weekdays")}function Xn(t,e,n){return jn(t,e,n,"weekdaysShort")}function Jn(t,e,n){return jn(t,e,n,"weekdaysMin")}function Kn(){var t=this._data;return this._milliseconds=tr(this._milliseconds),this._days=tr(this._days),this._months=tr(this._months),t.milliseconds=tr(t.milliseconds),t.seconds=tr(t.seconds),t.minutes=tr(t.minutes),t.hours=tr(t.hours),t.months=tr(t.months),t.years=tr(t.years),this}function Qn(t,e,n,i){var a=He(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function $n(t,e){return Qn(this,t,e,1)}function ti(t,e){return Qn(this,t,e,-1)}function ei(t){return t<0?Math.floor(t):Math.ceil(t)}function ni(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*ei(ai(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=k(r/1e3),l.seconds=t%60,e=k(t/60),l.minutes=e%60,n=k(e/60),l.hours=n%24,o+=k(n/24),a=k(ii(o)),s+=a,o-=ei(ai(a)),i=k(s/12),s%=12,l.days=o,l.months=s,l.years=i,this}function ii(t){return 4800*t/146097}function ai(t){return 146097*t/4800}function ri(t){var e,n,i=this._milliseconds;if(t=Y(t),"month"===t||"year"===t)return e=this._days+i/864e5,n=this._months+ii(e),"month"===t?n:n/12;switch(e=this._days+Math.round(ai(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function oi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12)}function si(t){return function(){return this.as(t)}}function li(t){return t=Y(t),this[t+"s"]()}function ui(t){return function(){return this._data[t]}}function di(){return k(this.days()/7)}function ci(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}function hi(t,e,n){var i=He(t).abs(),a=pr(i.as("s")),r=pr(i.as("m")),o=pr(i.as("h")),s=pr(i.as("d")),l=pr(i.as("M")),u=pr(i.as("y")),d=a<vr.s&&["s",a]||r<=1&&["m"]||r<vr.m&&["mm",r]||o<=1&&["h"]||o<vr.h&&["hh",o]||s<=1&&["d"]||s<vr.d&&["dd",s]||l<=1&&["M"]||l<vr.M&&["MM",l]||u<=1&&["y"]||["yy",u];return d[2]=e,d[3]=+t>0,d[4]=n,ci.apply(null,d)}function fi(t){return void 0===t?pr:"function"==typeof t&&(pr=t,!0)}function gi(t,e){return void 0!==vr[t]&&(void 0===e?vr[t]:(vr[t]=e,!0))}function mi(t){var e=this.localeData(),n=hi(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function pi(){var t,e,n,i=br(this._milliseconds)/1e3,a=br(this._days),r=br(this._months);t=k(i/60),e=k(t/60),i%=60,t%=60,n=k(r/12),r%=12;var o=n,s=r,l=a,u=e,d=t,c=i,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||d||c?"T":"")+(u?u+"H":"")+(d?d+"M":"")+(c?c+"S":""):"P0D"}var vi,bi;bi=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};var yi=bi,xi=t.momentProperties=[],ki=!1,_i={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var wi;wi=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)d(t,e)&&n.push(e);return n};var Si,Mi=wi,Di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ci={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ti="Invalid date",Pi="%d",Ii=/\d{1,2}/,Ai={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Fi={},Oi={},Ri=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Li=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Vi={},Wi={},Yi=/\d/,Bi=/\d\d/,zi=/\d{3}/,Ni=/\d{4}/,Hi=/[+-]?\d{6}/,Ei=/\d\d?/,Ui=/\d\d\d\d?/,ji=/\d\d\d\d\d\d?/,Gi=/\d{1,3}/,qi=/\d{1,4}/,Zi=/[+-]?\d{1,6}/,Xi=/\d+/,Ji=/[+-]?\d+/,Ki=/Z|[+-]\d\d:?\d\d/gi,Qi=/Z|[+-]\d\d(?::?\d\d)?/gi,$i=/[+-]?\d+(\.\d{1,3})?/,ta=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ea={},na={},ia=0,aa=1,ra=2,oa=3,sa=4,la=5,ua=6,da=7,ca=8;Si=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};var ha=Si;Z("M",["MM",2],"Mo",function(){return this.month()+1}),Z("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Z("MMMM",0,0,function(t){return this.localeData().months(this,t)}),W("month","M"),z("month",8),$("M",Ei),$("MM",Ei,Bi),$("MMM",function(t,e){return e.monthsShortRegex(t)}),$("MMMM",function(t,e){return e.monthsRegex(t)}),it(["M","MM"],function(t,e){e[aa]=_(t)-1}),it(["MMM","MMMM"],function(t,e,n,i){var a=n._locale.monthsParse(t,i,n._strict);null!=a?e[aa]=a:g(n).invalidMonth=t});var fa=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ga="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ma="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),pa=ta,va=ta;Z("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),Z(0,["YY",2],0,function(){return this.year()%100}),Z(0,["YYYY",4],0,"year"),Z(0,["YYYYY",5],0,"year"),Z(0,["YYYYYY",6,!0],0,"year"),W("year","y"),z("year",1),$("Y",Ji),$("YY",Ei,Bi),$("YYYY",qi,Ni),$("YYYYY",Zi,Hi),$("YYYYYY",Zi,Hi),it(["YYYYY","YYYYYY"],ia),it("YYYY",function(e,n){n[ia]=2===e.length?t.parseTwoDigitYear(e):_(e)}),it("YY",function(e,n){n[ia]=t.parseTwoDigitYear(e)}),it("Y",function(t,e){e[ia]=parseInt(t,10)}),t.parseTwoDigitYear=function(t){return _(t)+(_(t)>68?1900:2e3)};var ba=H("FullYear",!0);Z("w",["ww",2],"wo","week"),Z("W",["WW",2],"Wo","isoWeek"),W("week","w"),W("isoWeek","W"),z("week",5),z("isoWeek",5),$("w",Ei),$("ww",Ei,Bi),$("W",Ei),$("WW",Ei,Bi),at(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=_(t)});var ya={dow:0,doy:6};Z("d",0,"do","day"),Z("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Z("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Z("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Z("e",0,0,"weekday"),Z("E",0,0,"isoWeekday"),W("day","d"),W("weekday","e"),W("isoWeekday","E"),z("day",11),z("weekday",11),z("isoWeekday",11),$("d",Ei),$("e",Ei),$("E",Ei),$("dd",function(t,e){return e.weekdaysMinRegex(t)}),$("ddd",function(t,e){return e.weekdaysShortRegex(t)}),$("dddd",function(t,e){return e.weekdaysRegex(t)}),at(["dd","ddd","dddd"],function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t}),at(["d","e","E"],function(t,e,n,i){e[i]=_(t)});var xa="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ka="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_a="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wa=ta,Sa=ta,Ma=ta;Z("H",["HH",2],0,"hour"),Z("h",["hh",2],0,jt),Z("k",["kk",2],0,Gt),Z("hmm",0,0,function(){return""+jt.apply(this)+q(this.minutes(),2)}),Z("hmmss",0,0,function(){return""+jt.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),Z("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),Z("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)}),qt("a",!0),qt("A",!1),W("hour","h"),z("hour",13),$("a",Zt),$("A",Zt),$("H",Ei),$("h",Ei),$("HH",Ei,Bi),$("hh",Ei,Bi),$("hmm",Ui),$("hmmss",ji),$("Hmm",Ui),$("Hmmss",ji),it(["H","HH"],oa),it(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),it(["h","hh"],function(t,e,n){e[oa]=_(t),g(n).bigHour=!0}),it("hmm",function(t,e,n){var i=t.length-2;e[oa]=_(t.substr(0,i)),e[sa]=_(t.substr(i)),g(n).bigHour=!0}),it("hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[oa]=_(t.substr(0,i)),e[sa]=_(t.substr(i,2)),e[la]=_(t.substr(a)),g(n).bigHour=!0}),it("Hmm",function(t,e,n){var i=t.length-2;e[oa]=_(t.substr(0,i)),e[sa]=_(t.substr(i))}),it("Hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[oa]=_(t.substr(0,i)),e[sa]=_(t.substr(i,2)),e[la]=_(t.substr(a))});var Da,Ca=/[ap]\.?m?\.?/i,Ta=H("Hours",!0),Pa={calendar:Di,longDateFormat:Ci,invalidDate:Ti,ordinal:Pi,ordinalParse:Ii,relativeTime:Ai,months:ga,monthsShort:ma,week:ya,weekdays:xa,weekdaysMin:_a,weekdaysShort:ka,meridiemParse:Ca},Ia={},Aa={},Fa=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Oa=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ra=/Z|[+-]\d\d(?::?\d\d)?/,La=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Va=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Wa=/^\/?Date\((\-?\d+)/i;
|
12 |
-
t.createFromInputFallback=M("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),t.ISO_8601=function(){};var Ya=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=xe.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:p()}),Ba=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=xe.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:p()}),za=function(){return Date.now?Date.now():+new Date};Ce("Z",":"),Ce("ZZ",""),$("Z",Qi),$("ZZ",Qi),it(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Te(Qi,t)});var Na=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Ha=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ea=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;He.fn=Se.prototype;var Ua=Ge(1,"add"),ja=Ge(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ga=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});Z(0,["gg",2],0,function(){return this.weekYear()%100}),Z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Tn("gggg","weekYear"),Tn("ggggg","weekYear"),Tn("GGGG","isoWeekYear"),Tn("GGGGG","isoWeekYear"),W("weekYear","gg"),W("isoWeekYear","GG"),z("weekYear",1),z("isoWeekYear",1),$("G",Ji),$("g",Ji),$("GG",Ei,Bi),$("gg",Ei,Bi),$("GGGG",qi,Ni),$("gggg",qi,Ni),$("GGGGG",Zi,Hi),$("ggggg",Zi,Hi),at(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=_(t)}),at(["gg","GG"],function(e,n,i,a){n[a]=t.parseTwoDigitYear(e)}),Z("Q",0,"Qo","quarter"),W("quarter","Q"),z("quarter",7),$("Q",Yi),it("Q",function(t,e){e[aa]=3*(_(t)-1)}),Z("D",["DD",2],"Do","date"),W("date","D"),z("date",9),$("D",Ei),$("DD",Ei,Bi),$("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),it(["D","DD"],ra),it("Do",function(t,e){e[ra]=_(t.match(Ei)[0],10)});var qa=H("Date",!0);Z("DDD",["DDDD",3],"DDDo","dayOfYear"),W("dayOfYear","DDD"),z("dayOfYear",4),$("DDD",Gi),$("DDDD",zi),it(["DDD","DDDD"],function(t,e,n){n._dayOfYear=_(t)}),Z("m",["mm",2],0,"minute"),W("minute","m"),z("minute",14),$("m",Ei),$("mm",Ei,Bi),it(["m","mm"],sa);var Za=H("Minutes",!1);Z("s",["ss",2],0,"second"),W("second","s"),z("second",15),$("s",Ei),$("ss",Ei,Bi),it(["s","ss"],la);var Xa=H("Seconds",!1);Z("S",0,0,function(){return~~(this.millisecond()/100)}),Z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Z(0,["SSS",3],0,"millisecond"),Z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),W("millisecond","ms"),z("millisecond",16),$("S",Gi,Yi),$("SS",Gi,Bi),$("SSS",Gi,zi);var Ja;for(Ja="SSSS";Ja.length<=9;Ja+="S")$(Ja,Xi);for(Ja="S";Ja.length<=9;Ja+="S")it(Ja,Wn);var Ka=H("Milliseconds",!1);Z("z",0,0,"zoneAbbr"),Z("zz",0,0,"zoneName");var Qa=y.prototype;Qa.add=Ua,Qa.calendar=Xe,Qa.clone=Je,Qa.diff=an,Qa.endOf=vn,Qa.format=un,Qa.from=dn,Qa.fromNow=cn,Qa.to=hn,Qa.toNow=fn,Qa.get=j,Qa.invalidAt=Dn,Qa.isAfter=Ke,Qa.isBefore=Qe,Qa.isBetween=$e,Qa.isSame=tn,Qa.isSameOrAfter=en,Qa.isSameOrBefore=nn,Qa.isValid=Sn,Qa.lang=Ga,Qa.locale=gn,Qa.localeData=mn,Qa.max=Ba,Qa.min=Ya,Qa.parsingFlags=Mn,Qa.set=G,Qa.startOf=pn,Qa.subtract=ja,Qa.toArray=kn,Qa.toObject=_n,Qa.toDate=xn,Qa.toISOString=sn,Qa.inspect=ln,Qa.toJSON=wn,Qa.toString=on,Qa.unix=yn,Qa.valueOf=bn,Qa.creationData=Cn,Qa.year=ba,Qa.isLeapYear=yt,Qa.weekYear=Pn,Qa.isoWeekYear=In,Qa.quarter=Qa.quarters=Ln,Qa.month=ht,Qa.daysInMonth=ft,Qa.week=Qa.weeks=Pt,Qa.isoWeek=Qa.isoWeeks=It,Qa.weeksInYear=Fn,Qa.isoWeeksInYear=An,Qa.date=qa,Qa.day=Qa.days=Yt,Qa.weekday=Bt,Qa.isoWeekday=zt,Qa.dayOfYear=Vn,Qa.hour=Qa.hours=Ta,Qa.minute=Qa.minutes=Za,Qa.second=Qa.seconds=Xa,Qa.millisecond=Qa.milliseconds=Ka,Qa.utcOffset=Ae,Qa.utc=Oe,Qa.local=Re,Qa.parseZone=Le,Qa.hasAlignedHourOffset=Ve,Qa.isDST=We,Qa.isLocal=Be,Qa.isUtcOffset=ze,Qa.isUtc=Ne,Qa.isUTC=Ne,Qa.zoneAbbr=Yn,Qa.zoneName=Bn,Qa.dates=M("dates accessor is deprecated. Use date instead.",qa),Qa.months=M("months accessor is deprecated. Use month instead",ht),Qa.years=M("years accessor is deprecated. Use year instead",ba),Qa.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Fe),Qa.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ye);var $a=I.prototype;$a.calendar=A,$a.longDateFormat=F,$a.invalidDate=O,$a.ordinal=R,$a.preparse=Hn,$a.postformat=Hn,$a.relativeTime=L,$a.pastFuture=V,$a.set=T,$a.months=st,$a.monthsShort=lt,$a.monthsParse=dt,$a.monthsRegex=mt,$a.monthsShortRegex=gt,$a.week=Dt,$a.firstDayOfYear=Tt,$a.firstDayOfWeek=Ct,$a.weekdays=Ot,$a.weekdaysMin=Lt,$a.weekdaysShort=Rt,$a.weekdaysParse=Wt,$a.weekdaysRegex=Nt,$a.weekdaysShortRegex=Ht,$a.weekdaysMinRegex=Et,$a.isPM=Xt,$a.meridiem=Jt,te("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=M("moment.lang is deprecated. Use moment.locale instead.",te),t.langData=M("moment.langData is deprecated. Use moment.localeData instead.",ie);var tr=Math.abs,er=si("ms"),nr=si("s"),ir=si("m"),ar=si("h"),rr=si("d"),or=si("w"),sr=si("M"),lr=si("y"),ur=ui("milliseconds"),dr=ui("seconds"),cr=ui("minutes"),hr=ui("hours"),fr=ui("days"),gr=ui("months"),mr=ui("years"),pr=Math.round,vr={s:45,m:45,h:22,d:26,M:11},br=Math.abs,yr=Se.prototype;return yr.abs=Kn,yr.add=$n,yr.subtract=ti,yr.as=ri,yr.asMilliseconds=er,yr.asSeconds=nr,yr.asMinutes=ir,yr.asHours=ar,yr.asDays=rr,yr.asWeeks=or,yr.asMonths=sr,yr.asYears=lr,yr.valueOf=oi,yr._bubble=ni,yr.get=li,yr.milliseconds=ur,yr.seconds=dr,yr.minutes=cr,yr.hours=hr,yr.days=fr,yr.weeks=di,yr.months=gr,yr.years=mr,yr.humanize=mi,yr.toISOString=pi,yr.toString=pi,yr.toJSON=pi,yr.locale=gn,yr.localeData=mn,yr.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",pi),yr.lang=Ga,Z("X",0,0,"unix"),Z("x",0,0,"valueOf"),$("x",Ji),$("X",$i),it("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,n){n._d=new Date(_(t))}),t.version="2.17.1",i(xe),t.fn=Qa,t.min=_e,t.max=we,t.now=za,t.utc=h,t.unix=zn,t.months=Gn,t.isDate=l,t.locale=te,t.invalid=p,t.duration=He,t.isMoment=x,t.weekdays=Zn,t.parseZone=Nn,t.localeData=ie,t.isDuration=Me,t.monthsShort=qn,t.weekdaysMin=Jn,t.defineLocale=ee,t.updateLocale=ne,t.locales=ae,t.weekdaysShort=Xn,t.normalizeUnits=Y,t.relativeTimeRounding=fi,t.relativeTimeThreshold=gi,t.calendarFormat=Ze,t.prototype=Qa,t})},{}],7:[function(t,e,n){var i=t(28)();t(26)(i),t(42)(i),t(22)(i),t(31)(i),t(25)(i),t(21)(i),t(23)(i),t(24)(i),t(29)(i),t(33)(i),t(34)(i),t(32)(i),t(35)(i),t(30)(i),t(27)(i),t(36)(i),t(37)(i),t(38)(i),t(39)(i),t(40)(i),t(45)(i),t(43)(i),t(44)(i),t(46)(i),t(47)(i),t(48)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i),window.Chart=e.exports=i},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,42:42,43:43,44:44,45:45,46:46,47:47,48:48,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(t){t.Bar=function(e,n){return n.type="bar",new t(e,n)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(t){t.Bubble=function(e,n){return n.type="bubble",new t(e,n)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){t.Doughnut=function(e,n){return n.type="doughnut",new t(e,n)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){t.Line=function(e,n){return n.type="line",new t(e,n)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){t.PolarArea=function(e,n){return n.type="polarArea",new t(e,n)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(t){t.Radar=function(e,n){return n.type="radar",new t(e,n)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t){var e={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-1"}],yAxes:[{type:"linear",position:"left",id:"y-axis-1"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}};t.defaults.scatter=e,t.controllers.scatter=t.controllers.line,t.Scatter=function(e,n){return n.type="scatter",new t(e,n)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.bar={hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}},t.controllers.bar=t.DatasetController.extend({dataElementType:t.elements.Rectangle,initialize:function(e,n){t.DatasetController.prototype.initialize.call(this,e,n);var i=this,a=i.getMeta(),r=i.getDataset();a.stack=r.stack,a.bar=!0},getStackCount:function(){var t=this,n=t.getMeta(),i=t.getScaleForId(n.yAxisID),a=[];return e.each(t.chart.data.datasets,function(e,n){var r=t.chart.getDatasetMeta(n);r.bar&&t.chart.isDatasetVisible(n)&&(i.options.stacked===!1||i.options.stacked===!0&&a.indexOf(r.stack)===-1||void 0===i.options.stacked&&(void 0===r.stack||a.indexOf(r.stack)===-1))&&a.push(r.stack)},t),a.length},update:function(t){var n=this;e.each(n.getMeta().data,function(e,i){n.updateElement(e,i,t)},n)},updateElement:function(t,n,i){var a=this,r=a.getMeta(),o=a.getScaleForId(r.xAxisID),s=a.getScaleForId(r.yAxisID),l=s.getBasePixel(),u=a.chart.options.elements.rectangle,d=t.custom||{},c=a.getDataset();t._xScale=o,t._yScale=s,t._datasetIndex=a.index,t._index=n;var h=a.getRuler(n);t._model={x:a.calculateBarX(n,a.index,h),y:i?l:a.calculateBarY(n,a.index),label:a.chart.data.labels[n],datasetLabel:c.label,horizontal:!1,base:i?l:a.calculateBarBase(a.index,n),width:a.calculateBarWidth(h),backgroundColor:d.backgroundColor?d.backgroundColor:e.getValueAtIndexOrDefault(c.backgroundColor,n,u.backgroundColor),borderSkipped:d.borderSkipped?d.borderSkipped:u.borderSkipped,borderColor:d.borderColor?d.borderColor:e.getValueAtIndexOrDefault(c.borderColor,n,u.borderColor),borderWidth:d.borderWidth?d.borderWidth:e.getValueAtIndexOrDefault(c.borderWidth,n,u.borderWidth)},t.pivot()},calculateBarBase:function(t,e){var n=this,i=n.getMeta(),a=n.getScaleForId(i.yAxisID),r=a.getBaseValue(),o=r;if(a.options.stacked===!0||void 0===a.options.stacked&&void 0!==i.stack){for(var s=n.chart,l=s.data.datasets,u=Number(l[t].data[e]),d=0;d<t;d++){var c=l[d],h=s.getDatasetMeta(d);if(h.bar&&h.yAxisID===a.id&&s.isDatasetVisible(d)&&i.stack===h.stack){var f=Number(c.data[e]);r+=u<0?Math.min(f,o):Math.max(f,o)}}return a.getPixelForValue(r)}return a.getBasePixel()},getRuler:function(){var t=this,e=t.getMeta(),n=t.getScaleForId(e.xAxisID),i=t.getStackCount(),a=n.width/n.ticks.length,r=a*n.options.categoryPercentage,o=(a-a*n.options.categoryPercentage)/2,s=r/i,l=s*n.options.barPercentage,u=s-s*n.options.barPercentage;return{stackCount:i,tickWidth:a,categoryWidth:r,categorySpacing:o,fullBarWidth:s,barWidth:l,barSpacing:u}},calculateBarWidth:function(t){var e=this,n=e.getMeta(),i=e.getScaleForId(n.xAxisID);return i.options.barThickness?i.options.barThickness:t.barWidth},getStackIndex:function(t){var e,n,i=this,a=i.chart.getDatasetMeta(t),r=i.getScaleForId(a.yAxisID),o=[a.stack];for(n=0;n<t;++n)e=this.chart.getDatasetMeta(n),e.bar&&this.chart.isDatasetVisible(n)&&(r.options.stacked===!1||r.options.stacked===!0&&o.indexOf(e.stack)===-1||void 0===r.options.stacked&&(void 0===e.stack||o.indexOf(e.stack)===-1))&&o.push(e.stack);return o.length-1},calculateBarX:function(t,e,n){var i=this,a=i.getMeta(),r=i.getScaleForId(a.xAxisID),o=i.getStackIndex(e),s=r.getPixelForValue(null,t,e,i.chart.isCombo);return s-=i.chart.isCombo?n.tickWidth/2:0,s+n.barWidth/2+n.categorySpacing+n.barWidth*o+n.barSpacing/2+n.barSpacing*o},calculateBarY:function(t,e){var n=this,i=n.getMeta(),a=n.getScaleForId(i.yAxisID),r=Number(n.getDataset().data[t]);if(a.options.stacked||void 0===a.options.stacked&&void 0!==i.stack){for(var o=a.getBaseValue(),s=o,l=o,u=0;u<e;u++){var d=n.chart.data.datasets[u],c=n.chart.getDatasetMeta(u);if(c.bar&&c.yAxisID===a.id&&n.chart.isDatasetVisible(u)&&i.stack===c.stack){var h=Number(d.data[t]);h<0?l+=h||0:s+=h||0}}return r<0?a.getPixelForValue(l+r):a.getPixelForValue(s+r)}return a.getPixelForValue(r)},draw:function(e){var n,i,a=this,r=e||1,o=a.getMeta().data,s=a.getDataset();for(t.canvasHelpers.clipArea(a.chart.chart.ctx,a.chart.chartArea),n=0,i=o.length;n<i;++n){var l=s.data[n];null===l||void 0===l||isNaN(l)||o[n].transition(r).draw()}t.canvasHelpers.unclipArea(a.chart.chart.ctx)},setHoverStyle:function(t){var n=this.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},r=t._model;r.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:e.getValueAtIndexOrDefault(n.hoverBackgroundColor,i,e.getHoverColor(r.backgroundColor)),r.borderColor=a.hoverBorderColor?a.hoverBorderColor:e.getValueAtIndexOrDefault(n.hoverBorderColor,i,e.getHoverColor(r.borderColor)),r.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:e.getValueAtIndexOrDefault(n.hoverBorderWidth,i,r.borderWidth)},removeHoverStyle:function(t){var n=this.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},r=t._model,o=this.chart.options.elements.rectangle;r.backgroundColor=a.backgroundColor?a.backgroundColor:e.getValueAtIndexOrDefault(n.backgroundColor,i,o.backgroundColor),r.borderColor=a.borderColor?a.borderColor:e.getValueAtIndexOrDefault(n.borderColor,i,o.borderColor),r.borderWidth=a.borderWidth?a.borderWidth:e.getValueAtIndexOrDefault(n.borderWidth,i,o.borderWidth)}}),t.defaults.horizontalBar={hover:{mode:"label"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var n="";return t.length>0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(n=e.labels[t[0].index])),n},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n+": "+t.xLabel}}}},t.controllers.horizontalBar=t.controllers.bar.extend({getStackCount:function(){var t=this,n=t.getMeta(),i=t.getScaleForId(n.xAxisID),a=[];return e.each(t.chart.data.datasets,function(e,n){var r=t.chart.getDatasetMeta(n);r.bar&&t.chart.isDatasetVisible(n)&&(i.options.stacked===!1||i.options.stacked===!0&&a.indexOf(r.stack)===-1||void 0===i.options.stacked&&(void 0===r.stack||a.indexOf(r.stack)===-1))&&a.push(r.stack)},t),a.length},updateElement:function(t,n,i){var a=this,r=a.getMeta(),o=a.getScaleForId(r.xAxisID),s=a.getScaleForId(r.yAxisID),l=o.getBasePixel(),u=t.custom||{},d=a.getDataset(),c=a.chart.options.elements.rectangle;t._xScale=o,t._yScale=s,t._datasetIndex=a.index,t._index=n;var h=a.getRuler(n);t._model={x:i?l:a.calculateBarX(n,a.index),y:a.calculateBarY(n,a.index,h),label:a.chart.data.labels[n],datasetLabel:d.label,horizontal:!0,base:i?l:a.calculateBarBase(a.index,n),height:a.calculateBarHeight(h),backgroundColor:u.backgroundColor?u.backgroundColor:e.getValueAtIndexOrDefault(d.backgroundColor,n,c.backgroundColor),borderSkipped:u.borderSkipped?u.borderSkipped:c.borderSkipped,borderColor:u.borderColor?u.borderColor:e.getValueAtIndexOrDefault(d.borderColor,n,c.borderColor),borderWidth:u.borderWidth?u.borderWidth:e.getValueAtIndexOrDefault(d.borderWidth,n,c.borderWidth)},t.pivot()},calculateBarBase:function(t,e){var n=this,i=n.getMeta(),a=n.getScaleForId(i.xAxisID),r=a.getBaseValue(),o=r;if(a.options.stacked||void 0===a.options.stacked&&void 0!==i.stack){for(var s=n.chart,l=s.data.datasets,u=Number(l[t].data[e]),d=0;d<t;d++){var c=l[d],h=s.getDatasetMeta(d);if(h.bar&&h.xAxisID===a.id&&s.isDatasetVisible(d)&&i.stack===h.stack){var f=Number(c.data[e]);r+=u<0?Math.min(f,o):Math.max(f,o)}}return a.getPixelForValue(r)}return a.getBasePixel()},getRuler:function(){var t=this,e=t.getMeta(),n=t.getScaleForId(e.yAxisID),i=t.getStackCount(),a=n.height/n.ticks.length,r=a*n.options.categoryPercentage,o=(a-a*n.options.categoryPercentage)/2,s=r/i,l=s*n.options.barPercentage,u=s-s*n.options.barPercentage;return{stackCount:i,tickHeight:a,categoryHeight:r,categorySpacing:o,fullBarHeight:s,barHeight:l,barSpacing:u}},calculateBarHeight:function(t){var e=this,n=e.getMeta(),i=e.getScaleForId(n.yAxisID);return i.options.barThickness?i.options.barThickness:t.barHeight},getStackIndex:function(t){var e,n,i=this,a=i.chart.getDatasetMeta(t),r=i.getScaleForId(a.xAxisID),o=[a.stack];for(n=0;n<t;++n)e=this.chart.getDatasetMeta(n),e.bar&&this.chart.isDatasetVisible(n)&&(r.options.stacked===!1||r.options.stacked===!0&&o.indexOf(e.stack)===-1||void 0===r.options.stacked&&(void 0===e.stack||o.indexOf(e.stack)===-1))&&o.push(e.stack);return o.length-1},calculateBarX:function(t,e){var n=this,i=n.getMeta(),a=n.getScaleForId(i.xAxisID),r=Number(n.getDataset().data[t]);if(a.options.stacked||void 0===a.options.stacked&&void 0!==i.stack){for(var o=a.getBaseValue(),s=o,l=o,u=0;u<e;u++){var d=n.chart.data.datasets[u],c=n.chart.getDatasetMeta(u);if(c.bar&&c.xAxisID===a.id&&n.chart.isDatasetVisible(u)&&i.stack===c.stack){var h=Number(d.data[t]);h<0?l+=h||0:s+=h||0}}return r<0?a.getPixelForValue(l+r):a.getPixelForValue(s+r)}return a.getPixelForValue(r)},calculateBarY:function(t,e,n){var i=this,a=i.getMeta(),r=i.getScaleForId(a.yAxisID),o=i.getStackIndex(e),s=r.getPixelForValue(null,t,e,i.chart.isCombo);return s-=i.chart.isCombo?n.tickHeight/2:0,s+n.barHeight/2+n.categorySpacing+n.barHeight*o+n.barSpacing/2+n.barSpacing*o}})}},{}],16:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.bubble={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}},t.controllers.bubble=t.DatasetController.extend({dataElementType:t.elements.Point,update:function(t){var n=this,i=n.getMeta(),a=i.data;e.each(a,function(e,i){n.updateElement(e,i,t)})},updateElement:function(n,i,a){var r=this,o=r.getMeta(),s=r.getScaleForId(o.xAxisID),l=r.getScaleForId(o.yAxisID),u=n.custom||{},d=r.getDataset(),c=d.data[i],h=r.chart.options.elements.point,f=r.index;e.extend(n,{_xScale:s,_yScale:l,_datasetIndex:f,_index:i,_model:{x:a?s.getPixelForDecimal(.5):s.getPixelForValue("object"==typeof c?c:NaN,i,f,r.chart.isCombo),y:a?l.getBasePixel():l.getPixelForValue(c,i,f),radius:a?0:u.radius?u.radius:r.getRadius(c),hitRadius:u.hitRadius?u.hitRadius:e.getValueAtIndexOrDefault(d.hitRadius,i,h.hitRadius)}}),t.DatasetController.prototype.removeHoverStyle.call(r,n,h);var g=n._model;g.skip=u.skip?u.skip:isNaN(g.x)||isNaN(g.y),n.pivot()},getRadius:function(t){return t.r||this.chart.options.elements.point.radius},setHoverStyle:function(n){var i=this;t.DatasetController.prototype.setHoverStyle.call(i,n);var a=i.chart.data.datasets[n._datasetIndex],r=n._index,o=n.custom||{},s=n._model;s.radius=o.hoverRadius?o.hoverRadius:e.getValueAtIndexOrDefault(a.hoverRadius,r,i.chart.options.elements.point.hoverRadius)+i.getRadius(a.data[r])},removeHoverStyle:function(e){var n=this;t.DatasetController.prototype.removeHoverStyle.call(n,e,n.chart.options.elements.point);var i=n.chart.data.datasets[e._datasetIndex].data[e._index],a=e.custom||{},r=e._model;r.radius=a.radius?a.radius:n.getRadius(i)}})}},{}],17:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n=t.defaults;n.doughnut={animation:{animateRotate:!0,animateScale:!1},aspectRatio:1,hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var n=t.data;return n.labels.length&&n.datasets.length?n.labels.map(function(i,a){var r=t.getDatasetMeta(0),o=n.datasets[0],s=r.data[a],l=s&&s.custom||{},u=e.getValueAtIndexOrDefault,d=t.options.elements.arc,c=l.backgroundColor?l.backgroundColor:u(o.backgroundColor,a,d.backgroundColor),h=l.borderColor?l.borderColor:u(o.borderColor,a,d.borderColor),f=l.borderWidth?l.borderWidth:u(o.borderWidth,a,d.borderWidth);return{text:i,fillStyle:c,strokeStyle:h,lineWidth:f,hidden:isNaN(o.data[a])||r.data[a].hidden,index:a}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)a=o.getDatasetMeta(n),a.data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:Math.PI*-.5,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,n){var i=n.labels[t.index],a=": "+n.datasets[t.datasetIndex].data[t.index];return e.isArray(i)?(i=i.slice(),i[0]+=a):i+=a,i}}}},n.pie=e.clone(n.doughnut),e.extend(n.pie,{cutoutPercentage:0}),t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:t.elements.Arc,linkScales:e.noop,getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var n=this,i=n.chart,a=i.chartArea,r=i.options,o=r.elements.arc,s=a.right-a.left-o.borderWidth,l=a.bottom-a.top-o.borderWidth,u=Math.min(s,l),d={x:0,y:0},c=n.getMeta(),h=r.cutoutPercentage,f=r.circumference;if(f<2*Math.PI){var g=r.rotation%(2*Math.PI);g+=2*Math.PI*(g>=Math.PI?-1:g<-Math.PI?1:0);var m=g+f,p={x:Math.cos(g),y:Math.sin(g)},v={x:Math.cos(m),y:Math.sin(m)},b=g<=0&&0<=m||g<=2*Math.PI&&2*Math.PI<=m,y=g<=.5*Math.PI&&.5*Math.PI<=m||g<=2.5*Math.PI&&2.5*Math.PI<=m,x=g<=-Math.PI&&-Math.PI<=m||g<=Math.PI&&Math.PI<=m,k=g<=.5*-Math.PI&&.5*-Math.PI<=m||g<=1.5*Math.PI&&1.5*Math.PI<=m,_=h/100,w={x:x?-1:Math.min(p.x*(p.x<0?1:_),v.x*(v.x<0?1:_)),y:k?-1:Math.min(p.y*(p.y<0?1:_),v.y*(v.y<0?1:_))},S={x:b?1:Math.max(p.x*(p.x>0?1:_),v.x*(v.x>0?1:_)),y:y?1:Math.max(p.y*(p.y>0?1:_),v.y*(v.y>0?1:_))},M={width:.5*(S.x-w.x),height:.5*(S.y-w.y)};u=Math.min(s/M.width,l/M.height),d={x:(S.x+w.x)*-.5,y:(S.y+w.y)*-.5}}i.borderWidth=n.getMaxBorderWidth(c.data),i.outerRadius=Math.max((u-i.borderWidth)/2,0),i.innerRadius=Math.max(h?i.outerRadius/100*h:0,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),i.offsetX=d.x*i.outerRadius,i.offsetY=d.y*i.outerRadius,c.total=n.calculateTotal(),n.outerRadius=i.outerRadius-i.radiusLength*n.getRingIndex(n.index),n.innerRadius=Math.max(n.outerRadius-i.radiusLength,0),e.each(c.data,function(e,i){n.updateElement(e,i,t)})},updateElement:function(t,n,i){var a=this,r=a.chart,o=r.chartArea,s=r.options,l=s.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=s.rotation,h=s.rotation,f=a.getDataset(),g=i&&l.animateRotate?0:t.hidden?0:a.calculateCircumference(f.data[n])*(s.circumference/(2*Math.PI)),m=i&&l.animateScale?0:a.innerRadius,p=i&&l.animateScale?0:a.outerRadius,v=e.getValueAtIndexOrDefault;e.extend(t,{_datasetIndex:a.index,_index:n,_model:{x:u+r.offsetX,y:d+r.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:p,innerRadius:m,label:v(f.label,n,r.data.labels[n])}});var b=t._model;this.removeHoverStyle(t),i&&l.animateRotate||(0===n?b.startAngle=s.rotation:b.startAngle=a.getMeta().data[n-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,n=this.getDataset(),i=this.getMeta(),a=0;return e.each(i.data,function(e,i){t=n.data[i],isNaN(t)||e.hidden||(a+=Math.abs(t))}),a},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,r=t.length,o=0;o<r;o++)e=t[o]._model?t[o]._model.borderWidth:0,n=t[o]._chart?t[o]._chart.config.data.datasets[a].hoverBorderWidth:0,i=e>i?e:i,i=n>i?n:i;return i}})}},{}],18:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return n.getValueOrDefault(t.showLine,e.showLines)}var n=t.helpers;t.defaults.line={showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}},t.controllers.line=t.DatasetController.extend({datasetElementType:t.elements.Line,dataElementType:t.elements.Point,update:function(t){var i,a,r,o=this,s=o.getMeta(),l=s.dataset,u=s.data||[],d=o.chart.options,c=d.elements.line,h=o.getScaleForId(s.yAxisID),f=o.getDataset(),g=e(f,d);for(g&&(r=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=h,l._datasetIndex=o.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:r.tension?r.tension:n.getValueOrDefault(f.lineTension,c.tension),backgroundColor:r.backgroundColor?r.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:f.borderWidth||c.borderWidth,borderColor:r.borderColor?r.borderColor:f.borderColor||c.borderColor,borderCapStyle:r.borderCapStyle?r.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:r.borderDash?r.borderDash:f.borderDash||c.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:r.fill?r.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:r.steppedLine?r.steppedLine:n.getValueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:r.cubicInterpolationMode?r.cubicInterpolationMode:n.getValueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode),scaleTop:h.top,scaleBottom:h.bottom,scaleZero:h.getBasePixel()},l.pivot()),i=0,a=u.length;i<a;++i)o.updateElement(u[i],i,t);for(g&&0!==l._model.tension&&o.updateBezierControlPoints(),i=0,a=u.length;i<a;++i)u[i].pivot()},getPointBackgroundColor:function(t,e){var i=this.chart.options.elements.point.backgroundColor,a=this.getDataset(),r=t.custom||{};return r.backgroundColor?i=r.backgroundColor:a.pointBackgroundColor?i=n.getValueAtIndexOrDefault(a.pointBackgroundColor,e,i):a.backgroundColor&&(i=a.backgroundColor),i},getPointBorderColor:function(t,e){var i=this.chart.options.elements.point.borderColor,a=this.getDataset(),r=t.custom||{};return r.borderColor?i=r.borderColor:a.pointBorderColor?i=n.getValueAtIndexOrDefault(a.pointBorderColor,e,i):a.borderColor&&(i=a.borderColor),i},getPointBorderWidth:function(t,e){var i=this.chart.options.elements.point.borderWidth,a=this.getDataset(),r=t.custom||{};return isNaN(r.borderWidth)?isNaN(a.pointBorderWidth)?isNaN(a.borderWidth)||(i=a.borderWidth):i=n.getValueAtIndexOrDefault(a.pointBorderWidth,e,i):i=r.borderWidth,i},updateElement:function(t,e,i){var a,r,o=this,s=o.getMeta(),l=t.custom||{},u=o.getDataset(),d=o.index,c=u.data[e],h=o.getScaleForId(s.yAxisID),f=o.getScaleForId(s.xAxisID),g=o.chart.options.elements.point,m=o.chart.data.labels||[],p=1===m.length||1===u.data.length||o.chart.isCombo;void 0!==u.radius&&void 0===u.pointRadius&&(u.pointRadius=u.radius),void 0!==u.hitRadius&&void 0===u.pointHitRadius&&(u.pointHitRadius=u.hitRadius),a=f.getPixelForValue("object"==typeof c?c:NaN,e,d,p),r=i?h.getBasePixel():o.calculatePointY(c,e,d),t._xScale=f,t._yScale=h,t._datasetIndex=d,t._index=e,t._model={x:a,y:r,skip:l.skip||isNaN(a)||isNaN(r),radius:l.radius||n.getValueAtIndexOrDefault(u.pointRadius,e,g.radius),pointStyle:l.pointStyle||n.getValueAtIndexOrDefault(u.pointStyle,e,g.pointStyle),backgroundColor:o.getPointBackgroundColor(t,e),borderColor:o.getPointBorderColor(t,e),borderWidth:o.getPointBorderWidth(t,e),tension:s.dataset._model?s.dataset._model.tension:0,steppedLine:!!s.dataset._model&&s.dataset._model.steppedLine,hitRadius:l.hitRadius||n.getValueAtIndexOrDefault(u.pointHitRadius,e,g.hitRadius)}},calculatePointY:function(t,e,n){var i,a,r,o=this,s=o.chart,l=o.getMeta(),u=o.getScaleForId(l.yAxisID),d=0,c=0;if(u.options.stacked){for(i=0;i<n;i++)if(a=s.data.datasets[i],r=s.getDatasetMeta(i),"line"===r.type&&r.yAxisID===u.id&&s.isDatasetVisible(i)){var h=Number(u.getRightValue(a.data[e]));h<0?c+=h||0:d+=h||0}var f=Number(u.getRightValue(t));return f<0?u.getPixelForValue(c+f):u.getPixelForValue(d+f)}return u.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,n){return Math.max(Math.min(t,n),e)}var e,i,a,r,o,s=this,l=s.getMeta(),u=s.chart.chartArea,d=l.data||[];if(l.dataset._model.spanGaps&&(d=d.filter(function(t){return!t._model.skip})),"monotone"===l.dataset._model.cubicInterpolationMode)n.splineCurveMonotone(d);else for(e=0,i=d.length;e<i;++e)a=d[e],r=a._model,o=n.splineCurve(n.previousItem(d,e)._model,r,n.nextItem(d,e)._model,l.dataset._model.tension),r.controlPointPreviousX=o.previous.x,r.controlPointPreviousY=o.previous.y,r.controlPointNextX=o.next.x,r.controlPointNextY=o.next.y;if(s.chart.options.elements.line.capBezierPoints)for(e=0,i=d.length;e<i;++e)r=d[e]._model,r.controlPointPreviousX=t(r.controlPointPreviousX,u.left,u.right),r.controlPointPreviousY=t(r.controlPointPreviousY,u.top,u.bottom),r.controlPointNextX=t(r.controlPointNextX,u.left,u.right),r.controlPointNextY=t(r.controlPointNextY,u.top,u.bottom)},draw:function(n){var i,a,r=this,o=r.getMeta(),s=o.data||[],l=n||1;for(i=0,a=s.length;i<a;++i)s[i].transition(l);for(t.canvasHelpers.clipArea(r.chart.chart.ctx,r.chart.chartArea),e(r.getDataset(),r.chart.options)&&o.dataset.transition(l).draw(),t.canvasHelpers.unclipArea(r.chart.chart.ctx),i=0,a=s.length;i<a;++i)s[i].draw(r.chart.chartArea)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},r=t._model;r.radius=a.hoverRadius||n.getValueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),r.backgroundColor=a.hoverBackgroundColor||n.getValueAtIndexOrDefault(e.pointHoverBackgroundColor,i,n.getHoverColor(r.backgroundColor)),r.borderColor=a.hoverBorderColor||n.getValueAtIndexOrDefault(e.pointHoverBorderColor,i,n.getHoverColor(r.borderColor)),r.borderWidth=a.hoverBorderWidth||n.getValueAtIndexOrDefault(e.pointHoverBorderWidth,i,r.borderWidth)},removeHoverStyle:function(t){var e=this,i=e.chart.data.datasets[t._datasetIndex],a=t._index,r=t.custom||{},o=t._model;void 0!==i.radius&&void 0===i.pointRadius&&(i.pointRadius=i.radius),o.radius=r.radius||n.getValueAtIndexOrDefault(i.pointRadius,a,e.chart.options.elements.point.radius),o.backgroundColor=e.getPointBackgroundColor(t,a),o.borderColor=e.getPointBorderColor(t,a),o.borderWidth=e.getPointBorderWidth(t,a)}})}},{}],19:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.polarArea={scale:{type:"radialLinear",lineArc:!0,ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,aspectRatio:1,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("");
|
13 |
-
},legend:{labels:{generateLabels:function(t){var n=t.data;return n.labels.length&&n.datasets.length?n.labels.map(function(i,a){var r=t.getDatasetMeta(0),o=n.datasets[0],s=r.data[a],l=s.custom||{},u=e.getValueAtIndexOrDefault,d=t.options.elements.arc,c=l.backgroundColor?l.backgroundColor:u(o.backgroundColor,a,d.backgroundColor),h=l.borderColor?l.borderColor:u(o.borderColor,a,d.borderColor),f=l.borderWidth?l.borderWidth:u(o.borderWidth,a,d.borderWidth);return{text:i,fillStyle:c,strokeStyle:h,lineWidth:f,hidden:isNaN(o.data[a])||r.data[a].hidden,index:a}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)a=o.getDatasetMeta(n),a.data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}},t.controllers.polarArea=t.DatasetController.extend({dataElementType:t.elements.Arc,linkScales:e.noop,update:function(t){var n=this,i=n.chart,a=i.chartArea,r=n.getMeta(),o=i.options,s=o.elements.arc,l=Math.min(a.right-a.left,a.bottom-a.top);i.outerRadius=Math.max((l-s.borderWidth/2)/2,0),i.innerRadius=Math.max(o.cutoutPercentage?i.outerRadius/100*o.cutoutPercentage:1,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),n.outerRadius=i.outerRadius-i.radiusLength*n.index,n.innerRadius=n.outerRadius-i.radiusLength,r.count=n.countVisibleElements(),e.each(r.data,function(e,i){n.updateElement(e,i,t)})},updateElement:function(t,n,i){for(var a=this,r=a.chart,o=a.getDataset(),s=r.options,l=s.animation,u=r.scale,d=e.getValueAtIndexOrDefault,c=r.data.labels,h=a.calculateCircumference(o.data[n]),f=u.xCenter,g=u.yCenter,m=0,p=a.getMeta(),v=0;v<n;++v)isNaN(o.data[v])||p.data[v].hidden||++m;var b=s.startAngle,y=t.hidden?0:u.getDistanceFromCenterForValue(o.data[n]),x=b+h*m,k=x+(t.hidden?0:h),_=l.animateScale?0:u.getDistanceFromCenterForValue(o.data[n]);e.extend(t,{_datasetIndex:a.index,_index:n,_scale:u,_model:{x:f,y:g,innerRadius:0,outerRadius:i?_:y,startAngle:i&&l.animateRotate?b:x,endAngle:i&&l.animateRotate?b:k,label:d(c,n,c[n])}}),a.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),n=this.getMeta(),i=0;return e.each(n.data,function(e,n){isNaN(t.data[n])||e.hidden||i++}),i},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{}],20:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.radar={aspectRatio:1,scale:{type:"radialLinear"},elements:{line:{tension:0}}},t.controllers.radar=t.DatasetController.extend({datasetElementType:t.elements.Line,dataElementType:t.elements.Point,linkScales:e.noop,update:function(t){var n=this,i=n.getMeta(),a=i.dataset,r=i.data,o=a.custom||{},s=n.getDataset(),l=n.chart.options.elements.line,u=n.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),e.extend(i.dataset,{_datasetIndex:n.index,_children:r,_loop:!0,_model:{tension:o.tension?o.tension:e.getValueOrDefault(s.lineTension,l.tension),backgroundColor:o.backgroundColor?o.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:s.borderWidth||l.borderWidth,borderColor:o.borderColor?o.borderColor:s.borderColor||l.borderColor,fill:o.fill?o.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:o.borderCapStyle?o.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:o.borderDash?o.borderDash:s.borderDash||l.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle,scaleTop:u.top,scaleBottom:u.bottom,scaleZero:u.getBasePosition()}}),i.dataset.pivot(),e.each(r,function(e,i){n.updateElement(e,i,t)},n),n.updateBezierControlPoints()},updateElement:function(t,n,i){var a=this,r=t.custom||{},o=a.getDataset(),s=a.chart.scale,l=a.chart.options.elements.point,u=s.getPointPositionForValue(n,o.data[n]);e.extend(t,{_datasetIndex:a.index,_index:n,_scale:s,_model:{x:i?s.xCenter:u.x,y:i?s.yCenter:u.y,tension:r.tension?r.tension:e.getValueOrDefault(o.lineTension,a.chart.options.elements.line.tension),radius:r.radius?r.radius:e.getValueAtIndexOrDefault(o.pointRadius,n,l.radius),backgroundColor:r.backgroundColor?r.backgroundColor:e.getValueAtIndexOrDefault(o.pointBackgroundColor,n,l.backgroundColor),borderColor:r.borderColor?r.borderColor:e.getValueAtIndexOrDefault(o.pointBorderColor,n,l.borderColor),borderWidth:r.borderWidth?r.borderWidth:e.getValueAtIndexOrDefault(o.pointBorderWidth,n,l.borderWidth),pointStyle:r.pointStyle?r.pointStyle:e.getValueAtIndexOrDefault(o.pointStyle,n,l.pointStyle),hitRadius:r.hitRadius?r.hitRadius:e.getValueAtIndexOrDefault(o.hitRadius,n,l.hitRadius)}}),t._model.skip=r.skip?r.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,n=this.getMeta();e.each(n.data,function(i,a){var r=i._model,o=e.splineCurve(e.previousItem(n.data,a,!0)._model,r,e.nextItem(n.data,a,!0)._model,r.tension);r.controlPointPreviousX=Math.max(Math.min(o.previous.x,t.right),t.left),r.controlPointPreviousY=Math.max(Math.min(o.previous.y,t.bottom),t.top),r.controlPointNextX=Math.max(Math.min(o.next.x,t.right),t.left),r.controlPointNextY=Math.max(Math.min(o.next.y,t.bottom),t.top),i.pivot()})},draw:function(t){var n=this.getMeta(),i=t||1;e.each(n.data,function(t){t.transition(i)}),n.dataset.transition(i).draw(),e.each(n.data,function(t){t.draw()})},setHoverStyle:function(t){var n=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},a=t._index,r=t._model;r.radius=i.hoverRadius?i.hoverRadius:e.getValueAtIndexOrDefault(n.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),r.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:e.getValueAtIndexOrDefault(n.pointHoverBackgroundColor,a,e.getHoverColor(r.backgroundColor)),r.borderColor=i.hoverBorderColor?i.hoverBorderColor:e.getValueAtIndexOrDefault(n.pointHoverBorderColor,a,e.getHoverColor(r.borderColor)),r.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:e.getValueAtIndexOrDefault(n.pointHoverBorderWidth,a,r.borderWidth)},removeHoverStyle:function(t){var n=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},a=t._index,r=t._model,o=this.chart.options.elements.point;r.radius=i.radius?i.radius:e.getValueAtIndexOrDefault(n.radius,a,o.radius),r.backgroundColor=i.backgroundColor?i.backgroundColor:e.getValueAtIndexOrDefault(n.pointBackgroundColor,a,o.backgroundColor),r.borderColor=i.borderColor?i.borderColor:e.getValueAtIndexOrDefault(n.pointBorderColor,a,o.borderColor),r.borderWidth=i.borderWidth?i.borderWidth:e.getValueAtIndexOrDefault(n.pointBorderWidth,a,o.borderWidth)}})}},{}],21:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.animation={duration:1e3,easing:"easeOutQuart",onProgress:e.noop,onComplete:e.noop},t.Animation=t.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a=this;i||(t.animating=!0);for(var r=0;r<a.animations.length;++r)if(a.animations[r].chartInstance===t)return void(a.animations[r].animationObject=e);a.animations.push({chartInstance:t,animationObject:e}),1===a.animations.length&&a.requestAnimationFrame()},cancelAnimation:function(t){var n=e.findIndex(this.animations,function(e){return e.chartInstance===t});n!==-1&&(this.animations.splice(n,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=e.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),n=0;t.dropFrames>1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1);for(var i=0;i<t.animations.length;)null===t.animations[i].animationObject.currentStep&&(t.animations[i].animationObject.currentStep=0),t.animations[i].animationObject.currentStep+=1+n,t.animations[i].animationObject.currentStep>t.animations[i].animationObject.numSteps&&(t.animations[i].animationObject.currentStep=t.animations[i].animationObject.numSteps),t.animations[i].animationObject.render(t.animations[i].chartInstance,t.animations[i].animationObject),t.animations[i].animationObject.onAnimationProgress&&t.animations[i].animationObject.onAnimationProgress.call&&t.animations[i].animationObject.onAnimationProgress.call(t.animations[i].chartInstance,t.animations[i]),t.animations[i].animationObject.currentStep===t.animations[i].animationObject.numSteps?(t.animations[i].animationObject.onAnimationComplete&&t.animations[i].animationObject.onAnimationComplete.call&&t.animations[i].animationObject.onAnimationComplete.call(t.animations[i].chartInstance,t.animations[i]),t.animations[i].chartInstance.animating=!1,t.animations.splice(i,1)):++i;var a=Date.now(),r=(a-e)/t.frameDuration;t.dropFrames+=r,t.animations.length>0&&t.requestAnimationFrame()}}}},{}],22:[function(t,e,n){"use strict";e.exports=function(t){var e=t.canvasHelpers={};e.drawPoint=function(e,n,i,a,r){var o,s,l,u,d,c;if("object"==typeof n&&(o=n.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return void e.drawImage(n,a-n.width/2,r-n.height/2);if(!(isNaN(i)||i<=0)){switch(n){default:e.beginPath(),e.arc(a,r,i,0,2*Math.PI),e.closePath(),e.fill();break;case"triangle":e.beginPath(),s=3*i/Math.sqrt(3),d=s*Math.sqrt(3)/2,e.moveTo(a-s/2,r+d/3),e.lineTo(a+s/2,r+d/3),e.lineTo(a,r-2*d/3),e.closePath(),e.fill();break;case"rect":c=1/Math.SQRT2*i,e.beginPath(),e.fillRect(a-c,r-c,2*c,2*c),e.strokeRect(a-c,r-c,2*c,2*c);break;case"rectRounded":var h=i/Math.SQRT2,f=a-h,g=r-h,m=Math.SQRT2*i;t.helpers.drawRoundedRectangle(e,f,g,m,m,i/2),e.fill();break;case"rectRot":c=1/Math.SQRT2*i,e.beginPath(),e.moveTo(a-c,r),e.lineTo(a,r+c),e.lineTo(a+c,r),e.lineTo(a,r-c),e.closePath(),e.fill();break;case"cross":e.beginPath(),e.moveTo(a,r+i),e.lineTo(a,r-i),e.moveTo(a-i,r),e.lineTo(a+i,r),e.closePath();break;case"crossRot":e.beginPath(),l=Math.cos(Math.PI/4)*i,u=Math.sin(Math.PI/4)*i,e.moveTo(a-l,r-u),e.lineTo(a+l,r+u),e.moveTo(a-l,r+u),e.lineTo(a+l,r-u),e.closePath();break;case"star":e.beginPath(),e.moveTo(a,r+i),e.lineTo(a,r-i),e.moveTo(a-i,r),e.lineTo(a+i,r),l=Math.cos(Math.PI/4)*i,u=Math.sin(Math.PI/4)*i,e.moveTo(a-l,r-u),e.lineTo(a+l,r+u),e.moveTo(a-l,r+u),e.lineTo(a+l,r-u),e.closePath();break;case"line":e.beginPath(),e.moveTo(a-i,r),e.lineTo(a+i,r),e.closePath();break;case"dash":e.beginPath(),e.moveTo(a,r),e.lineTo(a+i,r),e.closePath()}e.stroke()}},e.clipArea=function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},e.unclipArea=function(t){t.restore()}}},{}],23:[function(t,e,n){"use strict";e.exports=function(t){function e(e){e=e||{};var n=e.data=e.data||{};return n.datasets=n.datasets||[],n.labels=n.labels||[],e.options=i.configMerge(t.defaults.global,t.defaults[e.type],e.options||{}),e}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}var i=t.helpers,a=t.plugins,r=t.platform;t.types={},t.instances={},t.controllers={},t.Controller=function(n,a,o){var s=this;a=e(a);var l=r.acquireContext(n,a),u=l&&l.canvas,d=u&&u.height,c=u&&u.width;return o.ctx=l,o.canvas=u,o.config=a,o.width=c,o.height=d,o.aspectRatio=d?c/d:null,s.id=i.uid(),s.chart=o,s.config=a,s.options=a.options,s._bufferedRender=!1,t.instances[s.id]=s,Object.defineProperty(s,"data",{get:function(){return s.config.data}}),l&&u?(s.initialize(),s.update(),s):(console.error("Failed to create chart: can't acquire context from the given item"),s)},i.extend(t.Controller.prototype,{initialize:function(){var t=this;return a.notify(t,"beforeInit"),i.retinaScale(t.chart),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),a.notify(t,"afterInit"),t},clear:function(){return i.clear(this.chart),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.chart,r=e.options,o=n.canvas,s=r.maintainAspectRatio&&n.aspectRatio||null,l=Math.floor(i.getMaximumWidth(o)),u=Math.floor(s?l/s:i.getMaximumHeight(o));if((n.width!==l||n.height!==u)&&(o.width=n.width=l,o.height=n.height=u,o.style.width=l+"px",o.style.height=u+"px",i.retinaScale(n),!t)){var d={width:l,height:u};a.notify(e,"resize",[d]),e.options.onResize&&e.options.onResize(e,d),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;i.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),i.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,a=e.scales={},r=[];n.scales&&(r=r.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear"}}))),n.scale&&r.push({options:n.scale,dtype:"radialLinear",isDefault:!0}),i.each(r,function(n){var r=n.options,o=i.getValueOrDefault(r.type,n.dtype),s=t.scaleService.getScaleConstructor(o);if(s){var l=new s({id:r.id,options:r,ctx:e.chart.ctx,chart:e});a[l.id]=l,n.isDefault&&(e.scale=l)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],a=[];if(i.each(e.data.datasets,function(i,r){var o=e.getDatasetMeta(r);o.type||(o.type=i.type||e.config.type),n.push(o.type),o.controller?o.controller.updateIndex(r):(o.controller=new t.controllers[o.type](e,r),a.push(o.controller))},e),n.length>1)for(var r=1;r<n.length;r++)if(n[r]!==n[r-1]){e.isCombo=!0;break}return a},resetElements:function(){var t=this;i.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t,e){var r=this;if(n(r),a.notify(r,"beforeUpdate")!==!1){r.tooltip._data=r.data;var o=r.buildOrUpdateControllers();i.each(r.data.datasets,function(t,e){r.getDatasetMeta(e).controller.buildOrUpdateElements()},r),r.updateLayout(),i.each(o,function(t){t.reset()}),r.updateDatasets(),a.notify(r,"afterUpdate"),r._bufferedRender?r._bufferedRequest={lazy:e,duration:t}:r.render(t,e)}},updateLayout:function(){var e=this;a.notify(e,"beforeLayout")!==!1&&(t.layoutService.update(this,this.chart.width,this.chart.height),a.notify(e,"afterScaleUpdate"),a.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(a.notify(t,"beforeDatasetsUpdate")!==!1){for(var e=0,n=t.data.datasets.length;e<n;++e)t.getDatasetMeta(e).controller.update();a.notify(t,"afterDatasetsUpdate")}},render:function(e,n){var r=this;if(a.notify(r,"beforeRender")!==!1){var o=r.options.animation,s=function(){a.notify(r,"afterRender");var t=o&&o.onComplete;t&&t.call&&t.call(r)};if(o&&("undefined"!=typeof e&&0!==e||"undefined"==typeof e&&0!==o.duration)){var l=new t.Animation;l.numSteps=(e||o.duration)/16.66,l.easing=o.easing,l.render=function(t,e){var n=i.easingEffects[e.easing],a=e.currentStep/e.numSteps,r=n(a);t.draw(r,a,e.currentStep)},l.onAnimationProgress=o.onProgress,l.onAnimationComplete=s,t.animationService.addAnimation(r,l,e,n)}else r.draw(),s();return r}},draw:function(t){var e=this;e.clear(),void 0!==t&&null!==t||(t=1),a.notify(e,"beforeDraw",[t])!==!1&&(i.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e.tooltip.transition(t).draw(),a.notify(e,"afterDraw",[t]))},drawDatasets:function(t){var e=this;a.notify(e,"beforeDatasetsDraw",[t])!==!1&&(i.each(e.data.datasets,function(n,i){e.isDatasetVisible(i)&&e.getDatasetMeta(i).controller.draw(t)},e,!0),a.notify(e,"afterDatasetsDraw",[t]))},getElementAtEvent:function(e){return t.Interaction.modes.single(this,e)},getElementsAtEvent:function(e){return t.Interaction.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return t.Interaction.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,n,i){var a=t.Interaction.modes[n];return"function"==typeof a?a(this,e,i):[]},getDatasetAtEvent:function(e){return t.Interaction.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroy:function(){var e,n,o,s=this,l=s.chart.canvas;for(s.stop(),n=0,o=s.data.datasets.length;n<o;++n)e=s.getDatasetMeta(n),e.controller&&(e.controller.destroy(),e.controller=null);l&&(s.unbindEvents(),i.clear(s.chart),r.releaseContext(s.chart.ctx),s.chart.canvas=null,s.chart.ctx=null),a.notify(s,"destroy"),delete t.instances[s.id]},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e.chart,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e),e.tooltip.initialize()},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};i.each(t.options.events,function(i){r.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},r.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,i.each(e,function(e,n){r.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"setHoverStyle":"removeHoverStyle";for(a=0,r=t.length;a<r;++a)i=t[a],i&&this.getDatasetMeta(i._datasetIndex).controller[o](i)},eventHandler:function(t){var e=this,n=e.tooltip;if(a.notify(e,"beforeEvent",[t])!==!1){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);i|=n&&n.handleEvent(t),a.notify(e,"afterEvent",[t]);var r=e._bufferedRequest;return r?e.render(r.duration,r.lazy):i&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,n=e.options||{},a=n.hover,r=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,a.mode,a),a.onHover&&a.onHover.call(e,t.native,e.active),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,a.mode,!1),e.active.length&&a.mode&&e.updateHoverStyle(e.active,a.mode,!0),r=!i.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,r}})}},{}],24:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return t._chartjs?void t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),void a.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),r=a.apply(this,e);return i.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),r}})}))}function n(t,e){var n=t._chartjs;if(n){var i=n.listeners,r=i.indexOf(e);r!==-1&&i.splice(r,1),i.length>0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var i=t.helpers,a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;t<e;++t)r[t]=r[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,i=t.getDataset(),a=i.data||(i.data=[]);t._data!==a&&(t._data&&n(t._data,t),e(a,t),t._data=a),t.resyncElements()},update:i.noop,draw:function(t){var e,n,i=t||1,a=this.getMeta().data;for(e=0,n=a.length;e<n;++e)a[e].transition(i).draw()},removeHoverStyle:function(t,e){var n=this.chart.data.datasets[t._datasetIndex],a=t._index,r=t.custom||{},o=i.getValueAtIndexOrDefault,s=t._model;s.backgroundColor=r.backgroundColor?r.backgroundColor:o(n.backgroundColor,a,e.backgroundColor),s.borderColor=r.borderColor?r.borderColor:o(n.borderColor,a,e.borderColor),s.borderWidth=r.borderWidth?r.borderWidth:o(n.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},r=i.getValueAtIndexOrDefault,o=i.getHoverColor,s=t._model;s.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:r(e.hoverBackgroundColor,n,o(s.backgroundColor)),s.borderColor=a.hoverBorderColor?a.hoverBorderColor:r(e.hoverBorderColor,n,o(s.borderColor)),s.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:r(e.hoverBorderWidth,n,s.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=i.inherits}},{}],25:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.elements={},t.Element=function(t){e.extend(this,t),this.initialize.apply(this,arguments)},e.extend(t.Element.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=e.clone(t._model)),t._start=e.clone(t._view),t},transition:function(t){var n=this;return n._view||(n._view=e.clone(n._model)),1===t?(n._view=n._model,n._start=null,n):(n._start||n.pivot(),e.each(n._model,function(i,a){if("_"===a[0]);else if(n._view.hasOwnProperty(a))if(i===n._view[a]);else if("string"==typeof i)try{var r=e.color(n._model[a]).mix(e.color(n._start[a]),t);n._view[a]=r.rgbString()}catch(t){n._view[a]=i}else if("number"==typeof i){var o=void 0!==n._start[a]&&isNaN(n._start[a])===!1?n._start[a]:0;n._view[a]=(n._model[a]-o)*t+o}else n._view[a]=i;else"number"!=typeof i||isNaN(n._view[a])?n._view[a]=i:n._view[a]=i*t},n),n)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return e.isNumber(this._model.x)&&e.isNumber(this._model.y)}}),t.Element.extend=e.inherits}},{}],26:[function(t,e,n){"use strict";var i=t(2);e.exports=function(t){function e(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),t.indexOf("%")!==-1&&(i=i/100*e.parentNode[n])):i=t,i}function n(t){return void 0!==t&&null!==t&&"none"!==t}function a(t,i,a){var r=document.defaultView,o=t.parentNode,s=r.getComputedStyle(t)[i],l=r.getComputedStyle(o)[i],u=n(s),d=n(l),c=Number.POSITIVE_INFINITY;return u||d?Math.min(u?e(s,t,a):c,d?e(l,o,a):c):"none"}var r=t.helpers={};r.each=function(t,e,n,i){var a,o;if(r.isArray(t))if(o=t.length,i)for(a=o-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<o;a++)e.call(n,t[a],a);else if("object"==typeof t){var s=Object.keys(t);for(o=s.length,a=0;a<o;a++)e.call(n,t[s[a]],s[a])}},r.clone=function(t){var e={};return r.each(t,function(t,n){r.isArray(t)?e[n]=t.slice(0):"object"==typeof t&&null!==t?e[n]=r.clone(t):e[n]=t}),e},r.extend=function(t){for(var e=function(e,n){t[n]=e},n=1,i=arguments.length;n<i;n++)r.each(arguments[n],e);return t},r.configMerge=function(e){var n=r.clone(e);return r.each(Array.prototype.slice.call(arguments,1),function(e){r.each(e,function(e,i){var a=n.hasOwnProperty(i),o=a?n[i]:{};"scales"===i?n[i]=r.scaleMerge(o,e):"scale"===i?n[i]=r.configMerge(o,t.scaleService.getScaleDefaults(e.type),e):!a||"object"!=typeof o||r.isArray(o)||null===o||"object"!=typeof e||r.isArray(e)?n[i]=e:n[i]=r.configMerge(o,e)})}),n},r.scaleMerge=function(e,n){var i=r.clone(e);return r.each(n,function(e,n){"xAxes"===n||"yAxes"===n?i.hasOwnProperty(n)?r.each(e,function(e,a){var o=r.getValueOrDefault(e.type,"xAxes"===n?"category":"linear"),s=t.scaleService.getScaleDefaults(o);a>=i[n].length||!i[n][a].type?i[n].push(r.configMerge(s,e)):e.type&&e.type!==i[n][a].type?i[n][a]=r.configMerge(i[n][a],s,e):i[n][a]=r.configMerge(i[n][a],e)}):(i[n]=[],r.each(e,function(e){var a=r.getValueOrDefault(e.type,"xAxes"===n?"category":"linear");i[n].push(r.configMerge(t.scaleService.getScaleDefaults(a),e))})):i.hasOwnProperty(n)&&"object"==typeof i[n]&&null!==i[n]&&"object"==typeof e?i[n]=r.configMerge(i[n],e):i[n]=e}),i},r.getValueAtIndexOrDefault=function(t,e,n){return void 0===t||null===t?n:r.isArray(t)?e<t.length?t[e]:n:t},r.getValueOrDefault=function(t,e){return void 0===t?e:t},r.indexOf=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=0,i=t.length;n<i;++n)if(t[n]===e)return n;return-1},r.where=function(t,e){if(r.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return r.each(t,function(t){e(t)&&n.push(t)}),n},r.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},r.findNextWhere=function(t,e,n){void 0!==n&&null!==n||(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},r.findPreviousWhere=function(t,e,n){void 0!==n&&null!==n||(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},r.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=r.inherits,t&&r.extend(n.prototype,t),n.__super__=e.prototype,n},r.noop=function(){},r.uid=function(){var t=0;return function(){return t++}}(),r.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},r.almostEquals=function(t,e,n){return Math.abs(t-e)<n},r.almostWhole=function(t,e){var n=Math.round(t);return n-e<t&&n+e>t},r.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},r.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},r.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},r.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},r.toRadians=function(t){return t*(Math.PI/180)},r.toDegrees=function(t){return t*(180/Math.PI)},r.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},r.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},r.aliasPixel=function(t){return t%2===0?0:.5},r.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l);u=isNaN(u)?0:u,d=isNaN(d)?0:d;var c=i*u,h=i*d;return{previous:{x:r.x-c*(o.x-a.x),y:r.y-c*(o.y-a.y)},next:{x:r.x+h*(o.x-a.x),y:r.y+h*(o.y-a.y)}}},r.EPSILON=Number.EPSILON||1e-14,r.splineCurveMonotone=function(t){var e,n,i,a,o=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=o.length;for(e=0;e<s;++e)if(i=o[e],!i.model.skip){if(n=e>0?o[e-1]:null,a=e<s-1?o[e+1]:null,a&&!a.model.skip){var l=a.model.x-i.model.x;i.deltaK=0!==l?(a.model.y-i.model.y)/l:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}var u,d,c,h;for(e=0;e<s-1;++e)i=o[e],a=o[e+1],i.model.skip||a.model.skip||(r.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(u=i.mK/i.deltaK,d=a.mK/i.deltaK,h=Math.pow(u,2)+Math.pow(d,2),h<=9||(c=3/Math.sqrt(h),i.mK=u*c*i.deltaK,a.mK=d*c*i.deltaK)));var f;for(e=0;e<s;++e)i=o[e],i.model.skip||(n=e>0?o[e-1]:null,a=e<s-1?o[e+1]:null,n&&!n.model.skip&&(f=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-f,i.model.controlPointPreviousY=i.model.y-f*i.mK),a&&!a.model.skip&&(f=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+f,i.model.controlPointNextY=i.model.y+f*i.mK))},r.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},r.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},r.niceNum=function(t,e){var n,i=Math.floor(r.log10(t)),a=t/Math.pow(10,i);return n=e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,n*Math.pow(10,i)};var o=r.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===(t/=1)?1:(n||(n=.3),i<Math.abs(1)?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/n)))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===(t/=1)?1:(n||(n=.3),i<Math.abs(1)?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((1*t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2===(t/=.5)?1:(n||(n=1*(.3*1.5)),i<Math.abs(1)?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/n)):i*Math.pow(2,-10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;
|
14 |
-
return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-o.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?1*(7.5625*t*t):t<2/2.75?1*(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return t<.5?.5*o.easeInBounce(2*t):.5*o.easeOutBounce(2*t-1)+.5}};r.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),r.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,o=t.currentTarget||t.srcElement,s=o.getBoundingClientRect(),l=a.touches;l&&l.length>0?(n=l[0].clientX,i=l[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(r.getStyle(o,"padding-left")),d=parseFloat(r.getStyle(o,"padding-top")),c=parseFloat(r.getStyle(o,"padding-right")),h=parseFloat(r.getStyle(o,"padding-bottom")),f=s.right-s.left-u-c,g=s.bottom-s.top-d-h;return n=Math.round((n-s.left-u)/f*o.width/e.currentDevicePixelRatio),i=Math.round((i-s.top-d)/g*o.height/e.currentDevicePixelRatio),{x:n,y:i}},r.addEvent=function(t,e,n){t.addEventListener?t.addEventListener(e,n):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n},r.removeEvent=function(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=r.noop},r.getConstraintWidth=function(t){return a(t,"max-width","clientWidth")},r.getConstraintHeight=function(t){return a(t,"max-height","clientHeight")},r.getMaximumWidth=function(t){var e=t.parentNode,n=parseInt(r.getStyle(e,"padding-left"),10),i=parseInt(r.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,o=r.getConstraintWidth(t);return isNaN(o)?a:Math.min(a,o)},r.getMaximumHeight=function(t){var e=t.parentNode,n=parseInt(r.getStyle(e,"padding-top"),10),i=parseInt(r.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,o=r.getConstraintHeight(t);return isNaN(o)?a:Math.min(a,o)},r.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},r.retinaScale=function(t){var e=t.currentDevicePixelRatio=window.devicePixelRatio||1;if(1!==e){var n=t.canvas,i=t.height,a=t.width;n.height=i*e,n.width=a*e,t.ctx.scale(e,e),n.style.height=i+"px",n.style.width=a+"px"}},r.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},r.fontString=function(t,e,n){return e+" "+t+"px "+n},r.longestText=function(t,e,n,i){i=i||{};var a=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},o=i.garbageCollect=[],i.font=e),t.font=e;var s=0;r.each(n,function(e){void 0!==e&&null!==e&&r.isArray(e)!==!0?s=r.measureText(t,a,o,s,e):r.isArray(e)&&r.each(e,function(e){void 0===e||null===e||r.isArray(e)||(s=r.measureText(t,a,o,s,e))})});var l=o.length/2;if(l>n.length){for(var u=0;u<l;u++)delete a[o[u]];o.splice(0,l)}return s},r.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},r.numberOfLabelLines=function(t){var e=1;return r.each(t,function(t){r.isArray(t)&&t.length>e&&(e=t.length)}),e},r.drawRoundedRectangle=function(t,e,n,i,a,r){t.beginPath(),t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+r),t.lineTo(e+i,n+a-r),t.quadraticCurveTo(e+i,n+a,e+i-r,n+a),t.lineTo(e+r,n+a),t.quadraticCurveTo(e,n+a,e,n+a-r),t.lineTo(e,n+r),t.quadraticCurveTo(e,n,e+r,n),t.closePath()},r.color=function(e){return i?i(e instanceof CanvasGradient?t.defaults.global.defaultColor:e):(console.error("Color.js not found!"),e)},r.isArray=Array.isArray?function(t){return Array.isArray(t)}:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.arrayEquals=function(t,e){var n,i,a,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],o=e[n],a instanceof Array&&o instanceof Array){if(!r.arrayEquals(a,o))return!1}else if(a!==o)return!1;return!0},r.callCallback=function(t,e,n){t&&"function"==typeof t.call&&t.apply(n,e)},r.getHoverColor=function(t){return t instanceof CanvasPattern?t:r.color(t).saturate(.5).darken(.1).rgbString()}}},{2:2}],27:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return t.native?{x:t.x,y:t.y}:o.getRelativePosition(t,e)}function n(t,e){var n,i,a,r,o,s=t.data.datasets;for(i=0,r=s.length;i<r;++i)if(t.isDatasetVisible(i))for(n=t.getDatasetMeta(i),a=0,o=n.data.length;a<o;++a){var l=n.data[a];l._view.skip||e(l)}}function i(t,e){var i=[];return n(t,function(t){t.inRange(e.x,e.y)&&i.push(t)}),i}function a(t,e,i,a){var r=Number.POSITIVE_INFINITY,s=[];return a||(a=o.distanceBetweenPoints),n(t,function(t){if(!i||t.inRange(e.x,e.y)){var n=t.getCenterPoint(),o=a(e,n);o<r?(s=[t],r=o):o===r&&s.push(t)}}),s}function r(t,n,r){var o=e(n,t.chart),s=function(t,e){return Math.abs(t.x-e.x)},l=r.intersect?i(t,o):a(t,o,!1,s),u=[];return l.length?(t.data.datasets.forEach(function(e,n){if(t.isDatasetVisible(n)){var i=t.getDatasetMeta(n),a=i.data[l[0]._index];a&&!a._view.skip&&u.push(a)}}),u):[]}var o=t.helpers;t.Interaction={modes:{single:function(t,i){var a=e(i,t.chart),r=[];return n(t,function(t){if(t.inRange(a.x,a.y))return r.push(t),r}),r.slice(0,1)},label:r,index:r,dataset:function(t,n,r){var o=e(n,t.chart),s=r.intersect?i(t,o):a(t,o,!1);return s.length>0&&(s=t.getDatasetMeta(s[0]._datasetIndex).data),s},"x-axis":function(t,e){return r(t,e,!0)},point:function(t,n){var a=e(n,t.chart);return i(t,a)},nearest:function(t,n,i){var r=e(n,t.chart),o=a(t,r,i.intersect);return o.length>1&&o.sort(function(t,e){var n=t.getArea(),i=e.getArea(),a=n-i;return 0===a&&(a=t._datasetIndex-e._datasetIndex),a}),o.slice(0,1)},x:function(t,i,a){var r=e(i,t.chart),o=[],s=!1;return n(t,function(t){t.inXRange(r.x)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),a.intersect&&!s&&(o=[]),o},y:function(t,i,a){var r=e(i,t.chart),o=[],s=!1;return n(t,function(t){t.inYRange(r.y)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),a.intersect&&!s&&(o=[]),o}}}}},{}],28:[function(t,e,n){"use strict";e.exports=function(){var t=function(e,n){return this.controller=new t.Controller(e,n,this),this.controller};return t.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var n=0;n<t.data.datasets.length;n++)e.push('<li><span style="background-color:'+t.data.datasets[n].backgroundColor+'"></span>'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("</li>");return e.push("</ul>"),e.join("")}}},t.Chart=t,t}},{}],29:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),t.boxes.push(e)},removeBox:function(t,e){t.boxes&&t.boxes.splice(t.boxes.indexOf(e),1)},update:function(t,n,i){function a(t){var e,n=t.isHorizontal();n?(e=t.update(t.options.fullWidth?y:M,S),D-=e.height):(e=t.update(w,_),M-=e.width),C.push({horizontal:n,minSize:e,box:t})}function r(t){var n=e.findNextWhere(C,function(e){return e.box===t});if(n)if(t.isHorizontal()){var i={left:Math.max(F,T),right:Math.max(O,P),top:0,bottom:0};t.update(t.options.fullWidth?y:M,x/2,i)}else t.update(n.minSize.width,D)}function o(t){var n=e.findNextWhere(C,function(e){return e.box===t}),i={left:0,right:0,top:R,bottom:L};n&&t.update(n.minSize.width,D,i)}function s(t){t.isHorizontal()?(t.left=t.options.fullWidth?d:F,t.right=t.options.fullWidth?n-c:F+M,t.top=N,t.bottom=N+t.height,N=t.bottom):(t.left=z,t.right=z+t.width,t.top=R,t.bottom=R+D,z=t.right)}if(t){var l=t.options.layout,u=l?l.padding:null,d=0,c=0,h=0,f=0;isNaN(u)?(d=u.left||0,c=u.right||0,h=u.top||0,f=u.bottom||0):(d=u,c=u,h=u,f=u);var g=e.where(t.boxes,function(t){return"left"===t.options.position}),m=e.where(t.boxes,function(t){return"right"===t.options.position}),p=e.where(t.boxes,function(t){return"top"===t.options.position}),v=e.where(t.boxes,function(t){return"bottom"===t.options.position}),b=e.where(t.boxes,function(t){return"chartArea"===t.options.position});p.sort(function(t,e){return(e.options.fullWidth?1:0)-(t.options.fullWidth?1:0)}),v.sort(function(t,e){return(t.options.fullWidth?1:0)-(e.options.fullWidth?1:0)});var y=n-d-c,x=i-h-f,k=y/2,_=x/2,w=(n-k)/(g.length+m.length),S=(i-_)/(p.length+v.length),M=y,D=x,C=[];e.each(g.concat(m,p,v),a);var T=0,P=0,I=0,A=0;e.each(p.concat(v),function(t){if(t.getPadding){var e=t.getPadding();T=Math.max(T,e.left),P=Math.max(P,e.right)}}),e.each(g.concat(m),function(t){if(t.getPadding){var e=t.getPadding();I=Math.max(I,e.top),A=Math.max(A,e.bottom)}});var F=d,O=c,R=h,L=f;e.each(g.concat(m),r),e.each(g,function(t){F+=t.width}),e.each(m,function(t){O+=t.width}),e.each(p.concat(v),r),e.each(p,function(t){R+=t.height}),e.each(v,function(t){L+=t.height}),e.each(g.concat(m),o),F=d,O=c,R=h,L=f,e.each(g,function(t){F+=t.width}),e.each(m,function(t){O+=t.width}),e.each(p,function(t){R+=t.height}),e.each(v,function(t){L+=t.height});var V=Math.max(T-F,0);F+=V,O+=Math.max(P-O,0);var W=Math.max(I-R,0);R+=W,L+=Math.max(A-L,0);var Y=i-R-L,B=n-F-O;B===M&&Y===D||(e.each(g,function(t){t.height=Y}),e.each(m,function(t){t.height=Y}),e.each(p,function(t){t.options.fullWidth||(t.width=B)}),e.each(v,function(t){t.options.fullWidth||(t.width=B)}),D=Y,M=B);var z=d+V,N=h+W;e.each(g.concat(p),s),z+=M,N+=D,e.each(m,s),e.each(v,s),t.chartArea={left:F,top:R,right:F+M,bottom:R+D},e.each(b,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(M,D)})}}}}},{}],30:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var i=new t.Legend({ctx:e.chart.ctx,options:n,chart:e});e.legend=i,t.layoutService.addBox(e,i)}var i=t.helpers,a=i.noop;t.defaults.global.legend={display:!0,position:"top",fullWidth:!0,reverse:!1,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return i.isArray(e.datasets)?e.datasets.map(function(e,n){return{text:e.label,fillStyle:i.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(n),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:n}},this):[]}}},t.Legend=t.Element.extend({initialize:function(t){i.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:a,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:a,beforeSetDimensions:a,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:a,beforeBuildLabels:a,buildLabels:function(){var t=this,e=t.options.labels,n=e.generateLabels.call(t,t.chart);e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:a,beforeFit:a,fit:function(){var n=this,a=n.options,r=a.labels,o=a.display,s=n.ctx,l=t.defaults.global,u=i.getValueOrDefault,d=u(r.fontSize,l.defaultFontSize),c=u(r.fontStyle,l.defaultFontStyle),h=u(r.fontFamily,l.defaultFontFamily),f=i.fontString(d,c,h),g=n.legendHitBoxes=[],m=n.minSize,p=n.isHorizontal();if(p?(m.width=n.maxWidth,m.height=o?10:0):(m.width=o?10:0,m.height=n.maxHeight),o)if(s.font=f,p){var v=n.lineWidths=[0],b=n.legendItems.length?d+r.padding:0;s.textAlign="left",s.textBaseline="top",i.each(n.legendItems,function(t,i){var a=e(r,d),o=a+d/2+s.measureText(t.text).width;v[v.length-1]+o+r.padding>=n.width&&(b+=d+r.padding,v[v.length]=n.left),g[i]={left:0,top:0,width:o,height:d},v[v.length-1]+=o+r.padding}),m.height+=b}else{var y=r.padding,x=n.columnWidths=[],k=r.padding,_=0,w=0,S=d+y;i.each(n.legendItems,function(t,n){var i=e(r,d),a=i+d/2+s.measureText(t.text).width;w+S>m.height&&(k+=_+r.padding,x.push(_),_=0,w=0),_=Math.max(_,a),w+=S,g[n]={left:0,top:0,width:a,height:d}}),k+=_,x.push(_),m.width+=k}n.width=m.width,n.height=m.height},afterFit:a,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var n=this,a=n.options,r=a.labels,o=t.defaults.global,s=o.elements.line,l=n.width,u=n.lineWidths;if(a.display){var d,c=n.ctx,h=i.getValueOrDefault,f=h(r.fontColor,o.defaultFontColor),g=h(r.fontSize,o.defaultFontSize),m=h(r.fontStyle,o.defaultFontStyle),p=h(r.fontFamily,o.defaultFontFamily),v=i.fontString(g,m,p);c.textAlign="left",c.textBaseline="top",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=v;var b=e(r,g),y=n.legendHitBoxes,x=function(e,n,i){if(!(isNaN(b)||b<=0)){c.save(),c.fillStyle=h(i.fillStyle,o.defaultColor),c.lineCap=h(i.lineCap,s.borderCapStyle),c.lineDashOffset=h(i.lineDashOffset,s.borderDashOffset),c.lineJoin=h(i.lineJoin,s.borderJoinStyle),c.lineWidth=h(i.lineWidth,s.borderWidth),c.strokeStyle=h(i.strokeStyle,o.defaultColor);var r=0===h(i.lineWidth,s.borderWidth);if(c.setLineDash&&c.setLineDash(h(i.lineDash,s.borderDash)),a.labels&&a.labels.usePointStyle){var l=g*Math.SQRT2/2,u=l/Math.SQRT2,d=e+u,f=n+u;t.canvasHelpers.drawPoint(c,i.pointStyle,l,d,f)}else r||c.strokeRect(e,n,b,g),c.fillRect(e,n,b,g);c.restore()}},k=function(t,e,n,i){c.fillText(n.text,b+g/2+t,e),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(b+g/2+t,e+g/2),c.lineTo(b+g/2+t+i,e+g/2),c.stroke())},_=n.isHorizontal();d=_?{x:n.left+(l-u[0])/2,y:n.top+r.padding,line:0}:{x:n.left+r.padding,y:n.top+r.padding,line:0};var w=g+r.padding;i.each(n.legendItems,function(t,e){var i=c.measureText(t.text).width,a=b+g/2+i,o=d.x,s=d.y;_?o+a>=l&&(s=d.y+=w,d.line++,o=d.x=n.left+(l-u[d.line])/2):s+w>n.bottom&&(o=d.x=o+n.columnWidths[d.line]+r.padding,s=d.y=n.top+r.padding,d.line++),x(o,s,t),y[e].left=o,y[e].top=s,k(o,s,t,i),_?d.x+=a+r.padding:d.y+=w})}},handleEvent:function(t){var e=this,n=e.options,i="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===i){if(!n.onHover)return}else{if("click"!==i)return;if(!n.onClick)return}var r=t.x,o=t.y;if(r>=e.left&&r<=e.right&&o>=e.top&&o<=e.bottom)for(var s=e.legendHitBoxes,l=0;l<s.length;++l){var u=s[l];if(r>=u.left&&r<=u.left+u.width&&o>=u.top&&o<=u.top+u.height){if("click"===i){n.onClick.call(e,t.native,e.legendItems[l]),a=!0;break}if("mousemove"===i){n.onHover.call(e,t.native,e.legendItems[l]),a=!0;break}}}return a}}),t.plugins.register({beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(e){var a=e.options.legend;a?(a=i.configMerge(t.defaults.global.legend,a),e.legend?e.legend.options=a:n(e,a)):(t.layoutService.removeBox(e,e.legend),delete e.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}})}},{}],31:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.plugins={},t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){e.indexOf(t)===-1&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);n!==-1&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if(a=l[i],r=a.plugin,s=r[e],"function"==typeof s&&(o=[t].concat(n||[]),o.push(a.options),s.apply(r,o)===!1))return!1;return!0},descriptors:function(n){var i=n._plugins||(n._plugins={});if(i.id===this._cacheId)return i.descriptors;var a=[],r=[],o=n&&n.config||{},s=t.defaults.global.plugins,l=o.options&&o.options.plugins||{};return this._plugins.concat(o.plugins||[]).forEach(function(t){var n=a.indexOf(t);if(n===-1){var i=t.id,o=l[i];o!==!1&&(o===!0&&(o=e.clone(s[i])),a.push(t),r.push({plugin:t,options:o||{}}))}}),i.descriptors=r,i.id=this._cacheId,r}},t.pluginService=t.plugins,t.PluginBase=e.inherits({})}},{}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e,n){return i.isArray(e)?i.longestText(t,n,e):t.measureText(e).width}function n(e){var n=i.getValueOrDefault,a=t.defaults.global,r=n(e.fontSize,a.defaultFontSize),o=n(e.fontStyle,a.defaultFontStyle),s=n(e.fontFamily,a.defaultFontFamily);return{size:r,style:o,family:s,font:i.fontString(r,o,s)}}var i=t.helpers;t.defaults.scale={display:!0,position:"left",gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{labelString:"",display:!1},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:t.Ticks.formatters.values}},t.Scale=t.Element.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},beforeUpdate:function(){i.callCallback(this.options.beforeUpdate,[this])},update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=i.extend({left:0,right:0,top:0,bottom:0},n),a.longestTextCache=a.longestTextCache||{},a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeDataLimits(),a.determineDataLimits(),a.afterDataLimits(),a.beforeBuildTicks(),a.buildTicks(),a.afterBuildTicks(),a.beforeTickToLabelConversion(),a.convertTicksToLabels(),a.afterTickToLabelConversion(),a.beforeCalculateTickRotation(),a.calculateTickRotation(),a.afterCalculateTickRotation(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:function(){i.callCallback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){i.callCallback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){i.callCallback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){i.callCallback(this.options.beforeDataLimits,[this])},determineDataLimits:i.noop,afterDataLimits:function(){i.callCallback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){i.callCallback(this.options.beforeBuildTicks,[this])},buildTicks:i.noop,afterBuildTicks:function(){i.callCallback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){i.callCallback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback)},afterTickToLabelConversion:function(){i.callCallback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){i.callCallback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,a=t.options.ticks,r=n(a);e.font=r.font;var o=a.minRotation||0;if(t.options.display&&t.isHorizontal())for(var s,l,u=i.longestText(e,r.font,t.ticks,t.longestTextCache),d=u,c=t.getPixelForTick(1)-t.getPixelForTick(0)-6;d>c&&o<a.maxRotation;){var h=i.toRadians(o);if(s=Math.cos(h),l=Math.sin(h),l*u>t.maxHeight){o--;break}o++,d=s*u}t.labelRotation=o},afterCalculateTickRotation:function(){i.callCallback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){i.callCallback(this.options.beforeFit,[this])},fit:function(){var t=this,a=t.minSize={width:0,height:0},r=t.options,o=r.ticks,s=r.scaleLabel,l=r.gridLines,u=r.display,d=t.isHorizontal(),c=n(o),h=1.5*n(s).size,f=r.gridLines.tickMarkLength;if(d?a.width=t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:a.width=u&&l.drawTicks?f:0,d?a.height=u&&l.drawTicks?f:0:a.height=t.maxHeight,s.display&&u&&(d?a.height+=h:a.width+=h),o.display&&u){var g=i.longestText(t.ctx,c.font,t.ticks,t.longestTextCache),m=i.numberOfLabelLines(t.ticks),p=.5*c.size;if(d){t.longestLabelWidth=g;var v=i.toRadians(t.labelRotation),b=Math.cos(v),y=Math.sin(v),x=y*g+c.size*m+p*m;a.height=Math.min(t.maxHeight,a.height+x),t.ctx.font=c.font;var k=t.ticks[0],_=e(t.ctx,k,c.font),w=t.ticks[t.ticks.length-1],S=e(t.ctx,w,c.font);0!==t.labelRotation?(t.paddingLeft="bottom"===r.position?b*_+3:b*p+3,t.paddingRight="bottom"===r.position?b*p+3:b*S+3):(t.paddingLeft=_/2+3,t.paddingRight=S/2+3)}else o.mirror?g=0:g+=t.options.ticks.padding,a.width+=g,t.paddingTop=c.size/2,t.paddingBottom=c.size/2}t.handleMargins(),t.width=a.width,t.height=a.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){i.callCallback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){return null===t||"undefined"==typeof t?NaN:"number"!=typeof t||isFinite(t)?"object"==typeof t?t instanceof Date||t.isValid?t:this.getRightValue(this.isHorizontal()?t.x:t.y):t:NaN},getLabelForIndex:i.noop,getPixelForValue:i.noop,getValueForPixel:i.noop,getPixelForTick:function(t,e){var n=this;if(n.isHorizontal()){var i=n.width-(n.paddingLeft+n.paddingRight),a=i/Math.max(n.ticks.length-(n.options.gridLines.offsetGridLines?0:1),1),r=a*t+n.paddingLeft;e&&(r+=a/2);var o=n.left+Math.round(r);return o+=n.isFullWidth()?n.margins.left:0}var s=n.height-(n.paddingTop+n.paddingBottom);return n.top+t*(s/(n.ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=e.width-(e.paddingLeft+e.paddingRight),i=n*t+e.paddingLeft,a=e.left+Math.round(i);return a+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},draw:function(e){var a=this,r=a.options;if(r.display){var o,s,l=a.ctx,u=t.defaults.global,d=r.ticks,c=r.gridLines,h=r.scaleLabel,f=0!==a.labelRotation,g=d.autoSkip,m=a.isHorizontal();d.maxTicksLimit&&(s=d.maxTicksLimit);var p=i.getValueOrDefault(d.fontColor,u.defaultFontColor),v=n(d),b=c.drawTicks?c.tickMarkLength:0,y=i.getValueOrDefault(c.borderDash,u.borderDash),x=i.getValueOrDefault(c.borderDashOffset,u.borderDashOffset),k=i.getValueOrDefault(h.fontColor,u.defaultFontColor),_=n(h),w=i.toRadians(a.labelRotation),S=Math.cos(w),M=a.longestLabelWidth*S;l.fillStyle=p;var D=[];if(m){if(o=!1,f&&(M/=2),(M+d.autoSkipPadding)*a.ticks.length>a.width-(a.paddingLeft+a.paddingRight)&&(o=1+Math.floor((M+d.autoSkipPadding)*a.ticks.length/(a.width-(a.paddingLeft+a.paddingRight)))),s&&a.ticks.length>s)for(;!o||a.ticks.length/(o||1)>s;)o||(o=1),o+=1;g||(o=!1)}var C="right"===r.position?a.left:a.right-b,T="right"===r.position?a.left+b:a.right,P="bottom"===r.position?a.top:a.bottom-b,I="bottom"===r.position?a.top+b:a.bottom;if(i.each(a.ticks,function(t,n){if(void 0!==t&&null!==t){var s=a.ticks.length===n+1,l=o>1&&n%o>0||n%o===0&&n+o>=a.ticks.length;if((!l||s)&&void 0!==t&&null!==t){var u,h;n===("undefined"!=typeof a.zeroLineIndex?a.zeroLineIndex:0)?(u=c.zeroLineWidth,h=c.zeroLineColor):(u=i.getValueAtIndexOrDefault(c.lineWidth,n),h=i.getValueAtIndexOrDefault(c.color,n));var g,p,v,k,_,S,M,A,F,O,R="middle",L="middle";if(m){"bottom"===r.position?(L=f?"middle":"top",R=f?"right":"center",O=a.top+b):(L=f?"middle":"bottom",R=f?"left":"center",O=a.bottom-b);var V=a.getPixelForTick(n)+i.aliasPixel(u);F=a.getPixelForTick(n,c.offsetGridLines)+d.labelOffset,g=v=_=M=V,p=P,k=I,S=e.top,A=e.bottom}else{var W,Y="left"===r.position,B=d.padding;d.mirror?(R=Y?"left":"right",W=B):(R=Y?"right":"left",W=b+B),F=Y?a.right-W:a.left+W;var z=a.getPixelForTick(n);z+=i.aliasPixel(u),O=a.getPixelForTick(n,c.offsetGridLines),g=C,v=T,_=e.left,M=e.right,p=k=S=A=z}D.push({tx1:g,ty1:p,tx2:v,ty2:k,x1:_,y1:S,x2:M,y2:A,labelX:F,labelY:O,glWidth:u,glColor:h,glBorderDash:y,glBorderDashOffset:x,rotation:-1*w,label:t,textBaseline:L,textAlign:R})}}}),i.each(D,function(t){if(c.display&&(l.save(),l.lineWidth=t.glWidth,l.strokeStyle=t.glColor,l.setLineDash&&(l.setLineDash(t.glBorderDash),l.lineDashOffset=t.glBorderDashOffset),l.beginPath(),c.drawTicks&&(l.moveTo(t.tx1,t.ty1),l.lineTo(t.tx2,t.ty2)),c.drawOnChartArea&&(l.moveTo(t.x1,t.y1),l.lineTo(t.x2,t.y2)),l.stroke(),l.restore()),d.display){l.save(),l.translate(t.labelX,t.labelY),l.rotate(t.rotation),l.font=v.font,l.textBaseline=t.textBaseline,l.textAlign=t.textAlign;var e=t.label;if(i.isArray(e))for(var n=0,a=0;n<e.length;++n)l.fillText(""+e[n],0,a),a+=1.5*v.size;else l.fillText(e,0,0);l.restore()}}),h.display){var A,F,O=0;if(m)A=a.left+(a.right-a.left)/2,F="bottom"===r.position?a.bottom-_.size/2:a.top+_.size/2;else{var R="left"===r.position;A=R?a.left+_.size/2:a.right-_.size/2,F=a.top+(a.bottom-a.top)/2,O=R?-.5*Math.PI:.5*Math.PI}l.save(),l.translate(A,F),l.rotate(O),l.textAlign="center",l.textBaseline="middle",l.fillStyle=k,l.font=_.font,l.fillText(h.labelString,0,0),l.restore()}if(c.drawBorder){l.lineWidth=i.getValueAtIndexOrDefault(c.lineWidth,0),l.strokeStyle=i.getValueAtIndexOrDefault(c.color,0);var L=a.left,V=a.right,W=a.top,Y=a.bottom,B=i.aliasPixel(l.lineWidth);m?(W=Y="top"===r.position?a.bottom:a.top,W+=B,Y+=B):(L=V="left"===r.position?a.right:a.left,L+=B,V+=B),l.beginPath(),l.moveTo(L,W),l.lineTo(V,Y),l.stroke()}}}})}},{}],33:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,n,i){this.constructors[t]=n,this.defaults[t]=e.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(n){return this.defaults.hasOwnProperty(n)?e.scaleMerge(t.defaults.scale,this.defaults[n]):{}},updateScaleDefaults:function(t,n){var i=this.defaults;i.hasOwnProperty(t)&&(i[t]=e.extend(i[t],n))},addScalesToLayout:function(n){e.each(n.scales,function(e){t.layoutService.addBox(n,e)})}}}},{}],34:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.Ticks={generators:{linear:function(t,n){var i,a=[];if(t.stepSize&&t.stepSize>0)i=t.stepSize;else{var r=e.niceNum(n.max-n.min,!1);i=e.niceNum(r/(t.maxTicks-1),!0)}var o=Math.floor(n.min/i)*i,s=Math.ceil(n.max/i)*i;t.min&&t.max&&t.stepSize&&e.almostWhole((t.max-t.min)/t.stepSize,i/1e3)&&(o=t.min,s=t.max);var l=(s-o)/i;l=e.almostEquals(l,Math.round(l),i/1e3)?Math.round(l):Math.ceil(l),a.push(void 0!==t.min?t.min:o);for(var u=1;u<l;++u)a.push(o+u*i);return a.push(void 0!==t.max?t.max:s),a},logarithmic:function(t,n){var i,a,r=[],o=e.getValueOrDefault,s=o(t.min,Math.pow(10,Math.floor(e.log10(n.min)))),l=Math.floor(e.log10(n.max)),u=Math.ceil(n.max/Math.pow(10,l));0===s?(i=Math.floor(e.log10(n.minNotZero)),a=Math.floor(n.minNotZero/Math.pow(10,i)),r.push(s),s=a*Math.pow(10,i)):(i=Math.floor(e.log10(s)),a=Math.floor(s/Math.pow(10,i)));do r.push(s),++a,10===a&&(a=1,++i),s=a*Math.pow(10,i);while(i<l||i===l&&a<u);var d=o(t.max,s);return r.push(d),r}},formatters:{values:function(t){return e.isArray(t)?t:""+t},linear:function(t,n,i){var a=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var r=e.log10(Math.abs(a)),o="";if(0!==t){var s=-1*Math.floor(r);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,n,i){var a=t/Math.pow(10,Math.floor(e.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===n||n===i.length-1?t.toExponential():""}}}}},{}],35:[function(t,e,n){"use strict";e.exports=function(t){function e(e,n){var i=new t.Title({ctx:e.chart.ctx,options:n,chart:e});e.titleBlock=i,t.layoutService.addBox(e,i)}var n=t.helpers;t.defaults.global.title={display:!1,position:"top",fullWidth:!0,fontStyle:"bold",padding:10,text:""};var i=n.noop;t.Title=t.Element.extend({initialize:function(t){var e=this;n.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:i,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:i,beforeSetDimensions:i,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:i,beforeBuildLabels:i,buildLabels:i,afterBuildLabels:i,beforeFit:i,fit:function(){var e=this,i=n.getValueOrDefault,a=e.options,r=t.defaults.global,o=a.display,s=i(a.fontSize,r.defaultFontSize),l=e.minSize;e.isHorizontal()?(l.width=e.maxWidth,l.height=o?s+2*a.padding:0):(l.width=o?s+2*a.padding:0,l.height=e.maxHeight),e.width=l.width,e.height=l.height},afterFit:i,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var e=this,i=e.ctx,a=n.getValueOrDefault,r=e.options,o=t.defaults.global;if(r.display){var s,l,u,d=a(r.fontSize,o.defaultFontSize),c=a(r.fontStyle,o.defaultFontStyle),h=a(r.fontFamily,o.defaultFontFamily),f=n.fontString(d,c,h),g=0,m=e.top,p=e.left,v=e.bottom,b=e.right;i.fillStyle=a(r.fontColor,o.defaultFontColor),i.font=f,e.isHorizontal()?(s=p+(b-p)/2,l=m+(v-m)/2,u=b-p):(s="left"===r.position?p+d/2:b-d/2,l=m+(v-m)/2,u=v-m,g=Math.PI*("left"===r.position?-.5:.5)),i.save(),i.translate(s,l),i.rotate(g),i.textAlign="center",i.textBaseline="middle",i.fillText(r.text,0,0,u),i.restore()}}}),t.plugins.register({beforeInit:function(t){var n=t.options.title;n&&e(t,n)},beforeUpdate:function(i){var a=i.options.title;a?(a=n.configMerge(t.defaults.global.title,a),i.titleBlock?i.titleBlock.options=a:e(i,a)):(t.layoutService.removeBox(i,i.titleBlock),delete i.titleBlock)}})}},{}],36:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){var n=l.color(t);return n.alpha(e*n.alpha()).rgbaString()}function n(t,e){return e&&(l.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function i(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function a(e){var n=t.defaults.global,i=l.getValueOrDefault;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,bodyFontColor:e.bodyFontColor,_bodyFontFamily:i(e.bodyFontFamily,n.defaultFontFamily),_bodyFontStyle:i(e.bodyFontStyle,n.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:i(e.bodyFontSize,n.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:i(e.titleFontFamily,n.defaultFontFamily),_titleFontStyle:i(e.titleFontStyle,n.defaultFontStyle),titleFontSize:i(e.titleFontSize,n.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,
|
15 |
-
titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:i(e.footerFontFamily,n.defaultFontFamily),_footerFontStyle:i(e.footerFontStyle,n.defaultFontStyle),footerFontSize:i(e.footerFontSize,n.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors}}function r(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,u=e.footer.length,d=e.titleFontSize,c=e.bodyFontSize,h=e.footerFontSize;i+=s*d,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*c,i+=o?(o-1)*e.bodySpacing:0,i+=u?e.footerMarginTop:0,i+=u*h,i+=u?(u-1)*e.footerSpacing:0;var f=0,g=function(t){a=Math.max(a,n.measureText(t).width+f)};return n.font=l.fontString(d,e._titleFontStyle,e._titleFontFamily),l.each(e.title,g),n.font=l.fontString(c,e._bodyFontStyle,e._bodyFontFamily),l.each(e.beforeBody.concat(e.afterBody),g),f=e.displayColors?c+2:0,l.each(r,function(t){l.each(t.before,g),l.each(t.lines,g),l.each(t.after,g)}),f=0,n.font=l.fontString(h,e._footerFontStyle,e._footerFontFamily),l.each(e.footer,g),a+=2*e.xPadding,{width:a,height:i}}function o(t,e){var n=t._model,i=t._chart,a=t._chartInstance.chartArea,r="center",o="center";n.y<e.height?o="top":n.y>i.height-e.height&&(o="bottom");var s,l,u,d,c,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===o?(s=function(t){return t<=h},l=function(t){return t>h}):(s=function(t){return t<=e.width/2},l=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width>i.width},d=function(t){return t-e.width<0},c=function(t){return t<=f?"top":"bottom"},s(n.x)?(r="left",u(n.x)&&(r="center",o=c(n.y))):l(n.x)&&(r="right",d(n.x)&&(r="center",o=c(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:r,yAlign:g.yAlign?g.yAlign:o}}function s(t,e,n){var i=t.x,a=t.y,r=t.caretSize,o=t.caretPadding,s=t.cornerRadius,l=n.xAlign,u=n.yAlign,d=r+o,c=s+o;return"right"===l?i-=e.width:"center"===l&&(i-=e.width/2),"top"===u?a+=d:a-="bottom"===u?e.height+d:e.height/2,"center"===u?"left"===l?i+=d:"right"===l&&(i-=d):"left"===l?i-=c:"right"===l&&(i+=c),{x:i,y:a}}var l=t.helpers;t.defaults.global.tooltips={enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,callbacks:{beforeTitle:l.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:l.noop,beforeBody:l.noop,beforeLabel:l.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n+": "+t.yLabel},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex),i=n.data[t.index],a=i._view;return{borderColor:a.borderColor,backgroundColor:a.backgroundColor}},afterLabel:l.noop,afterBody:l.noop,beforeFooter:l.noop,footer:l.noop,afterFooter:l.noop}},t.Tooltip=t.Element.extend({initialize:function(){this._model=a(this._options)},getTitle:function(){var t=this,e=t._options,i=e.callbacks,a=i.beforeTitle.apply(t,arguments),r=i.title.apply(t,arguments),o=i.afterTitle.apply(t,arguments),s=[];return s=n(s,a),s=n(s,r),s=n(s,o)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return l.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var i=this,a=i._options.callbacks,r=[];return l.each(t,function(t){var o={before:[],lines:[],after:[]};n(o.before,a.beforeLabel.call(i,t,e)),n(o.lines,a.label.call(i,t,e)),n(o.after,a.afterLabel.call(i,t,e)),r.push(o)}),r},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return l.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),r=e.afterFooter.apply(t,arguments),o=[];return o=n(o,i),o=n(o,a),o=n(o,r)},update:function(e){var n,u,d=this,c=d._options,h=d._model,f=d._model=a(c),g=d._active,m=d._data,p=d._chartInstance,v={xAlign:h.xAlign,yAlign:h.yAlign},b={x:h.x,y:h.y},y={width:h.width,height:h.height},x={x:h.caretX,y:h.caretY};if(g.length){f.opacity=1;var k=[];x=t.Tooltip.positioners[c.position](g,d._eventPosition);var _=[];for(n=0,u=g.length;n<u;++n)_.push(i(g[n]));c.filter&&(_=_.filter(function(t){return c.filter(t,m)})),c.itemSort&&(_=_.sort(function(t,e){return c.itemSort(t,e,m)})),l.each(_,function(t){k.push(c.callbacks.labelColor.call(d,t,p))}),f.title=d.getTitle(_,m),f.beforeBody=d.getBeforeBody(_,m),f.body=d.getBody(_,m),f.afterBody=d.getAfterBody(_,m),f.footer=d.getFooter(_,m),f.x=Math.round(x.x),f.y=Math.round(x.y),f.caretPadding=l.getValueOrDefault(x.padding,2),f.labelColors=k,f.dataPoints=_,y=r(this,f),v=o(this,y),b=s(f,y,v)}else f.opacity=0;return f.xAlign=v.xAlign,f.yAlign=v.yAlign,f.x=b.x,f.y=b.y,f.width=y.width,f.height=y.height,f.caretX=x.x,f.caretY=x.y,d._model=f,e&&c.custom&&c.custom.call(d,f),d},drawCaret:function(t,n,i){var a,r,o,s,l,u,d=this._view,c=this._chart.ctx,h=d.caretSize,f=d.cornerRadius,g=d.xAlign,m=d.yAlign,p=t.x,v=t.y,b=n.width,y=n.height;"center"===m?("left"===g?(a=p,r=a-h,o=a):(a=p+b,r=a+h,o=a),l=v+y/2,s=l-h,u=l+h):("left"===g?(a=p+f,r=a+h,o=r+h):"right"===g?(a=p+b-f,r=a-h,o=r-h):(r=p+b/2,a=r-h,o=r+h),"top"===m?(s=v,l=s-h,u=s):(s=v+y,l=s+h,u=s)),c.fillStyle=e(d.backgroundColor,i),c.beginPath(),c.moveTo(a,s),c.lineTo(r,l),c.lineTo(o,u),c.closePath(),c.fill()},drawTitle:function(t,n,i,a){var r=n.title;if(r.length){i.textAlign=n._titleAlign,i.textBaseline="top";var o=n.titleFontSize,s=n.titleSpacing;i.fillStyle=e(n.titleFontColor,a),i.font=l.fontString(o,n._titleFontStyle,n._titleFontFamily);var u,d;for(u=0,d=r.length;u<d;++u)i.fillText(r[u],t.x,t.y),t.y+=o+s,u+1===r.length&&(t.y+=n.titleMarginBottom-s)}},drawBody:function(t,n,i,a){var r=n.bodyFontSize,o=n.bodySpacing,s=n.body;i.textAlign=n._bodyAlign,i.textBaseline="top";var u=e(n.bodyFontColor,a);i.fillStyle=u,i.font=l.fontString(r,n._bodyFontStyle,n._bodyFontFamily);var d=0,c=function(e){i.fillText(e,t.x+d,t.y),t.y+=r+o};l.each(n.beforeBody,c);var h=n.displayColors;d=h?r+2:0,l.each(s,function(o,s){l.each(o.before,c),l.each(o.lines,function(o){h&&(i.fillStyle=e(n.legendColorBackground,a),i.fillRect(t.x,t.y,r,r),i.strokeStyle=e(n.labelColors[s].borderColor,a),i.strokeRect(t.x,t.y,r,r),i.fillStyle=e(n.labelColors[s].backgroundColor,a),i.fillRect(t.x+1,t.y+1,r-2,r-2),i.fillStyle=u),c(o)}),l.each(o.after,c)}),d=0,l.each(n.afterBody,c),t.y-=o},drawFooter:function(t,n,i,a){var r=n.footer;r.length&&(t.y+=n.footerMarginTop,i.textAlign=n._footerAlign,i.textBaseline="top",i.fillStyle=e(n.footerFontColor,a),i.font=l.fontString(n.footerFontSize,n._footerFontStyle,n._footerFontFamily),l.each(r,function(e){i.fillText(e,t.x,t.y),t.y+=n.footerFontSize+n.footerSpacing}))},drawBackground:function(t,n,i,a,r){i.fillStyle=e(n.backgroundColor,r),l.drawRoundedRectangle(i,t.x,t.y,a.width,a.height,n.cornerRadius),i.fill()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity;this._options.enabled&&(this.drawBackground(i,e,t,n,a),this.drawCaret(i,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e=this,n=e._options,i=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chartInstance.getElementsAtEventForMode(t,n.mode,n),i=!l.arrayEquals(e._active,e._lastActive),e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),i|=a.x!==e._model.x||a.y!==e._model.y}return i}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:Math.round(i/r),y:Math.round(a/r)}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(i=0,a=t.length;i<a;++i){var u=t[i];if(u&&u.hasValue()){var d=u.getCenterPoint(),c=l.distanceBetweenPoints(e,d);c<s&&(s=c,n=u)}}if(n){var h=n.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}}}},{}],37:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n=t.defaults.global;n.elements.arc={backgroundColor:n.defaultColor,borderColor:"#fff",borderWidth:2},t.elements.Arc=t.Element.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,n){var i=this._view;if(i){for(var a=e.getAngleFromPoint(i,{x:t,y:n}),r=a.angle,o=a.distance,s=i.startAngle,l=i.endAngle;l<s;)l+=2*Math.PI;for(;r>l;)r-=2*Math.PI;for(;r<s;)r+=2*Math.PI;var u=r>=s&&r<=l,d=o>=i.innerRadius&&o<=i.outerRadius;return u&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngle,i=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,i),t.arc(e.x,e.y,e.innerRadius,i,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})}},{}],38:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n=t.defaults.global;t.defaults.global.elements.line={tension:.4,backgroundColor:n.defaultColor,borderWidth:3,borderColor:n.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0},t.elements.Line=t.Element.extend({draw:function(){function t(t,e){var n=e._view;e._view.steppedLine===!0?(l.lineTo(n.x,t._view.y),l.lineTo(n.x,n.y)):0===e._view.tension?l.lineTo(n.x,n.y):l.bezierCurveTo(t._view.controlPointNextX,t._view.controlPointNextY,n.controlPointPreviousX,n.controlPointPreviousY,n.x,n.y)}var i=this,a=i._view,r=a.spanGaps,o=a.scaleZero,s=i._loop;s||("top"===a.fill?o=a.scaleTop:"bottom"===a.fill&&(o=a.scaleBottom));var l=i._chart.ctx;l.save();var u=i._children.slice(),d=-1;s&&u.length&&u.push(u[0]);var c,h,f,g;if(u.length&&a.fill){for(l.beginPath(),c=0;c<u.length;++c)h=u[c],f=e.previousItem(u,c),g=h._view,0===c?(s?l.moveTo(o.x,o.y):l.moveTo(g.x,o),g.skip||(d=c,l.lineTo(g.x,g.y))):(f=d===-1?f:u[d],g.skip?r||d!==c-1||(s?l.lineTo(o.x,o.y):l.lineTo(f._view.x,o)):(d!==c-1?r&&d!==-1?t(f,h):s?l.lineTo(g.x,g.y):(l.lineTo(g.x,o),l.lineTo(g.x,g.y)):t(f,h),d=c));s||d===-1||l.lineTo(u[d]._view.x,o),l.fillStyle=a.backgroundColor||n.defaultColor,l.closePath(),l.fill()}var m=n.elements.line;for(l.lineCap=a.borderCapStyle||m.borderCapStyle,l.setLineDash&&l.setLineDash(a.borderDash||m.borderDash),l.lineDashOffset=a.borderDashOffset||m.borderDashOffset,l.lineJoin=a.borderJoinStyle||m.borderJoinStyle,l.lineWidth=a.borderWidth||m.borderWidth,l.strokeStyle=a.borderColor||n.defaultColor,l.beginPath(),d=-1,c=0;c<u.length;++c)h=u[c],f=e.previousItem(u,c),g=h._view,0===c?g.skip||(l.moveTo(g.x,g.y),d=c):(f=d===-1?f:u[d],g.skip||(d!==c-1&&!r||d===-1?l.moveTo(g.x,g.y):t(f,h),d=c));l.stroke(),l.restore()}})}},{}],39:[function(t,e,n){"use strict";e.exports=function(t){function e(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2)}function n(t){var e=this._view;return!!e&&Math.pow(t-e.y,2)<Math.pow(e.radius+e.hitRadius,2)}var i=t.helpers,a=t.defaults.global,r=a.defaultColor;a.elements.point={radius:3,pointStyle:"circle",backgroundColor:r,borderWidth:1,borderColor:r,hitRadius:1,hoverRadius:4,hoverBorderWidth:1},t.elements.Point=t.Element.extend({inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:e,inXRange:e,inYRange:n,getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(e){var n=this._view,o=this._model,s=this._chart.ctx,l=n.pointStyle,u=n.radius,d=n.x,c=n.y,h=t.helpers.color,f=1.01,g=0;n.skip||(s.strokeStyle=n.borderColor||r,s.lineWidth=i.getValueOrDefault(n.borderWidth,a.elements.point.borderWidth),s.fillStyle=n.backgroundColor||r,void 0!==e&&(o.x<e.left||e.right*f<o.x||o.y<e.top||e.bottom*f<o.y)&&(o.x<e.left?g=(d-o.x)/(e.left-o.x):e.right*f<o.x?g=(o.x-d)/(o.x-e.right):o.y<e.top?g=(c-o.y)/(e.top-o.y):e.bottom*f<o.y&&(g=(o.y-c)/(o.y-e.bottom)),g=Math.round(100*g)/100,s.strokeStyle=h(s.strokeStyle).alpha(g).rgbString(),s.fillStyle=h(s.fillStyle).alpha(g).rgbString()),t.canvasHelpers.drawPoint(s,l,u,d,c))}})}},{}],40:[function(t,e,n){"use strict";e.exports=function(t){function e(t){return void 0!==t._view.width}function n(t){var n,i,a,r,o=t._view;if(e(t)){var s=o.width/2;n=o.x-s,i=o.x+s,a=Math.min(o.y,o.base),r=Math.max(o.y,o.base)}else{var l=o.height/2;n=Math.min(o.x,o.base),i=Math.max(o.x,o.base),a=o.y-l,r=o.y+l}return{left:n,top:a,right:i,bottom:r}}var i=t.defaults.global;i.elements.rectangle={backgroundColor:i.defaultColor,borderWidth:0,borderColor:i.defaultColor,borderSkipped:"bottom"},t.elements.Rectangle=t.Element.extend({draw:function(){function t(t){return v[(y+t)%4]}var e,n,i,a,r,o,s,l=this._chart.ctx,u=this._view,d=u.borderWidth;if(u.horizontal?(e=u.base,n=u.x,i=u.y-u.height/2,a=u.y+u.height/2,r=n>e?1:-1,o=1,s=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,i=u.y,a=u.base,r=1,o=a>i?1:-1,s=u.borderSkipped||"bottom"),d){var c=Math.min(Math.abs(e-n),Math.abs(i-a));d=d>c?c:d;var h=d/2,f=e+("left"!==s?h*r:0),g=n+("right"!==s?-h*r:0),m=i+("top"!==s?h*o:0),p=a+("bottom"!==s?-h*o:0);f!==g&&(i=m,a=p),m!==p&&(e=f,n=g)}l.beginPath(),l.fillStyle=u.backgroundColor,l.strokeStyle=u.borderColor,l.lineWidth=d;var v=[[e,a],[e,i],[n,i],[n,a]],b=["bottom","left","top","right"],y=b.indexOf(s,0);y===-1&&(y=0);var x=t(0);l.moveTo(x[0],x[1]);for(var k=1;k<4;k++)x=t(k),l.lineTo(x[0],x[1]);l.fill(),d&&l.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=!1;if(this._view){var a=n(this);i=t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom}return i},inLabelRange:function(t,i){var a=this;if(!a._view)return!1;var r=!1,o=n(a);return r=e(a)?t>=o.left&&t<=o.right:i>=o.top&&i<=o.bottom},inXRange:function(t){var e=n(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=n(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,n,i=this._view;return e(this)?(t=i.x,n=(i.y+i.base)/2):(t=(i.x+i.base)/2,n=i.y),{x:t,y:n}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})}},{}],41:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){var n=l.getStyle(t,e),i=n&&n.match(/(\d+)px/);return i?Number(i[1]):void 0}function n(t,n){var i=t.style,a=t.getAttribute("height"),r=t.getAttribute("width");if(t._chartjs={initial:{height:a,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===r||""===r){var o=e(t,"width");void 0!==o&&(t.width=o)}if(null===a||""===a)if(""===t.style.height)t.height=t.width/(n.options.aspectRatio||2);else{var s=e(t,"height");void 0!==o&&(t.height=s)}return t}function i(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function a(t,e){var n=u[t.type]||t.type,a=l.getRelativePosition(t,e);return i(n,e,a.x,a.y,t)}function r(t){var e=document.createElement("iframe");return e.className="chartjs-hidden-iframe",e.style.cssText="display:block;overflow:hidden;border:0;margin:0;top:0;left:0;bottom:0;right:0;height:100%;width:100%;position:absolute;pointer-events:none;z-index:-1;",e.tabIndex=-1,l.addEvent(e,"load",function(){l.addEvent(e.contentWindow||e,"resize",t),t()}),e}function o(t,e,n){var a=t._chartjs={ticking:!1},o=function(){a.ticking||(a.ticking=!0,l.requestAnimFrame.call(window,function(){if(a.resizer)return a.ticking=!1,e(i("resize",n))}))};a.resizer=r(o),t.insertBefore(a.resizer,t.firstChild)}function s(t){if(t&&t._chartjs){var e=t._chartjs.resizer;e&&(e.parentNode.removeChild(e),t._chartjs.resizer=null),delete t._chartjs}}var l=t.helpers,u={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};return{acquireContext:function(t,e){if("string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t instanceof HTMLCanvasElement){var i=t.getContext&&t.getContext("2d");if(i instanceof CanvasRenderingContext2D)return n(t,e),i}return null},releaseContext:function(t){var e=t.canvas;if(e._chartjs){var n=e._chartjs.initial;["height","width"].forEach(function(t){var i=n[t];void 0===i||null===i?e.removeAttribute(t):e.setAttribute(t,i)}),l.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e._chartjs}},addEventListener:function(t,e,n){var i=t.chart.canvas;if("resize"===e)return void o(i.parentNode,n,t.chart);var r=n._chartjs||(n._chartjs={}),s=r.proxies||(r.proxies={}),u=s[t.id+"_"+e]=function(e){n(a(e,t.chart))};l.addEvent(i,e,u)},removeEventListener:function(t,e,n){var i=t.chart.canvas;if("resize"===e)return void s(i.parentNode,n);var a=n._chartjs||{},r=a.proxies||{},o=r[t.id+"_"+e];o&&l.removeEvent(i,e,o)}}}},{}],42:[function(t,e,n){"use strict";var i=t(41);e.exports=function(t){t.platform={acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},t.helpers.extend(t.platform,i(t))}},{41:41}],43:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n={position:"bottom"},i=t.Scale.extend({getLabels:function(){var t=this.chart.data;return(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t=this,n=t.getLabels();t.minIndex=0,t.maxIndex=n.length-1;var i;void 0!==t.options.ticks.min&&(i=e.indexOf(n,t.options.ticks.min),t.minIndex=i!==-1?i:t.minIndex),void 0!==t.options.ticks.max&&(i=e.indexOf(n,t.options.ticks.max),t.maxIndex=i!==-1?i:t.maxIndex),t.min=n[t.minIndex],t.max=n[t.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.isHorizontal();return i.yLabels&&!a?n.getRightValue(i.datasets[e].data[t]):n.ticks[t-n.minIndex]},getPixelForValue:function(t,e,n,i){var a=this,r=Math.max(a.maxIndex+1-a.minIndex-(a.options.gridLines.offsetGridLines?0:1),1);if(void 0!==t&&isNaN(e)){var o=a.getLabels(),s=o.indexOf(t);e=s!==-1?s:e}if(a.isHorizontal()){var l=a.width/r,u=l*(e-a.minIndex);return(a.options.gridLines.offsetGridLines&&i||a.maxIndex===a.minIndex&&i)&&(u+=l/2),a.left+Math.round(u)}var d=a.height/r,c=d*(e-a.minIndex);return a.options.gridLines.offsetGridLines&&i&&(c+=d/2),a.top+Math.round(c)},getPixelForTick:function(t,e){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null,e)},getValueForPixel:function(t){var e,n=this,i=Math.max(n.ticks.length-(n.options.gridLines.offsetGridLines?0:1),1),a=n.isHorizontal(),r=(a?n.width:n.height)/i;return t-=a?n.left:n.top,n.options.gridLines.offsetGridLines&&(t-=r/2),e=t<=0?0:Math.round(t/r)},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",i,n)}},{}],44:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n={position:"left",ticks:{callback:t.Ticks.formatters.linear}},i=t.LinearScaleBase.extend({determineDataLimits:function(){function t(t){return s?t.xAxisID===n.id:t.yAxisID===n.id}var n=this,i=n.options,a=n.chart,r=a.data,o=r.datasets,s=n.isHorizontal();n.min=null,n.max=null;var l=i.stacked;if(void 0===l&&e.each(o,function(e,n){if(!l){var i=a.getDatasetMeta(n);a.isDatasetVisible(n)&&t(i)&&void 0!==i.stack&&(l=!0)}}),i.stacked||l){var u={};e.each(o,function(r,o){var s=a.getDatasetMeta(o),l=[s.type,void 0===i.stacked&&void 0===s.stack?o:"",s.stack].join(".");void 0===u[l]&&(u[l]={positiveValues:[],negativeValues:[]});var d=u[l].positiveValues,c=u[l].negativeValues;a.isDatasetVisible(o)&&t(s)&&e.each(r.data,function(t,e){var a=+n.getRightValue(t);isNaN(a)||s.data[e].hidden||(d[e]=d[e]||0,c[e]=c[e]||0,i.relativePoints?d[e]=100:a<0?c[e]+=a:d[e]+=a)})}),e.each(u,function(t){var i=t.positiveValues.concat(t.negativeValues),a=e.min(i),r=e.max(i);n.min=null===n.min?a:Math.min(n.min,a),n.max=null===n.max?r:Math.max(n.max,r)})}else e.each(o,function(i,r){var o=a.getDatasetMeta(r);a.isDatasetVisible(r)&&t(o)&&e.each(i.data,function(t,e){var i=+n.getRightValue(t);isNaN(i)||o.data[e].hidden||(null===n.min?n.min=i:i<n.min&&(n.min=i),null===n.max?n.max=i:i>n.max&&(n.max=i))})});this.handleTickRangeOptions()},getTickLimit:function(){var n,i=this,a=i.options.ticks;if(i.isHorizontal())n=Math.min(a.maxTicksLimit?a.maxTicksLimit:11,Math.ceil(i.width/50));else{var r=e.getValueOrDefault(a.fontSize,t.defaults.global.defaultFontSize);n=Math.min(a.maxTicksLimit?a.maxTicksLimit:11,Math.ceil(i.height/(2*r)))}return n},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,n=this,i=n.start,a=+n.getRightValue(t),r=n.end-i;return n.isHorizontal()?(e=n.left+n.width/r*(a-i),Math.round(e)):(e=n.bottom-n.height/r*(a-i),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),i=n?e.width:e.height,a=(n?t-e.left:e.bottom-t)/i;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",i,n)}},{}],45:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n=e.noop;t.LinearScaleBase=t.Scale.extend({handleTickRangeOptions:function(){var t=this,n=t.options,i=n.ticks;if(i.beginAtZero){var a=e.sign(t.min),r=e.sign(t.max);a<0&&r<0?t.max=0:a>0&&r>0&&(t.min=0)}void 0!==i.min?t.min=i.min:void 0!==i.suggestedMin&&(t.min=Math.min(t.min,i.suggestedMin)),void 0!==i.max?t.max=i.max:void 0!==i.suggestedMax&&(t.max=Math.max(t.max,i.suggestedMax)),t.min===t.max&&(t.max++,i.beginAtZero||t.min--)},getTickLimit:n,handleDirectionalChanges:n,buildTicks:function(){var n=this,i=n.options,a=i.ticks,r=n.getTickLimit();r=Math.max(2,r);var o={maxTicks:r,min:a.min,max:a.max,stepSize:e.getValueOrDefault(a.fixedStepSize,a.stepSize)},s=n.ticks=t.Ticks.generators.linear(o,n);n.handleDirectionalChanges(),n.max=e.max(s),n.min=e.min(s),a.reverse?(s.reverse(),n.start=n.max,n.end=n.min):(n.start=n.min,n.end=n.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{}],46:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers,n={position:"left",ticks:{callback:t.Ticks.formatters.logarithmic}},i=t.Scale.extend({determineDataLimits:function(){function t(t){return u?t.xAxisID===n.id:t.yAxisID===n.id}var n=this,i=n.options,a=i.ticks,r=n.chart,o=r.data,s=o.datasets,l=e.getValueOrDefault,u=n.isHorizontal();n.min=null,n.max=null,n.minNotZero=null;var d=i.stacked;if(void 0===d&&e.each(s,function(e,n){if(!d){var i=r.getDatasetMeta(n);r.isDatasetVisible(n)&&t(i)&&void 0!==i.stack&&(d=!0)}}),i.stacked||d){var c={};e.each(s,function(a,o){var s=r.getDatasetMeta(o),l=[s.type,void 0===i.stacked&&void 0===s.stack?o:"",s.stack].join(".");r.isDatasetVisible(o)&&t(s)&&(void 0===c[l]&&(c[l]=[]),e.each(a.data,function(t,e){var a=c[l],r=+n.getRightValue(t);isNaN(r)||s.data[e].hidden||(a[e]=a[e]||0,i.relativePoints?a[e]=100:a[e]+=r)}))}),e.each(c,function(t){var i=e.min(t),a=e.max(t);n.min=null===n.min?i:Math.min(n.min,i),n.max=null===n.max?a:Math.max(n.max,a)})}else e.each(s,function(i,a){var o=r.getDatasetMeta(a);r.isDatasetVisible(a)&&t(o)&&e.each(i.data,function(t,e){var i=+n.getRightValue(t);isNaN(i)||o.data[e].hidden||(null===n.min?n.min=i:i<n.min&&(n.min=i),null===n.max?n.max=i:i>n.max&&(n.max=i),0!==i&&(null===n.minNotZero||i<n.minNotZero)&&(n.minNotZero=i))})});n.min=l(a.min,n.min),n.max=l(a.max,n.max),n.min===n.max&&(0!==n.min&&null!==n.min?(n.min=Math.pow(10,Math.floor(e.log10(n.min))-1),n.max=Math.pow(10,Math.floor(e.log10(n.max))+1)):(n.min=1,n.max=10))},buildTicks:function(){var n=this,i=n.options,a=i.ticks,r={min:a.min,max:a.max},o=n.ticks=t.Ticks.generators.logarithmic(r,n);n.isHorizontal()||o.reverse(),n.max=e.max(o),n.min=e.min(o),a.reverse?(o.reverse(),n.start=n.max,n.end=n.min):(n.start=n.min,n.end=n.max)},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),t.Scale.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},getPixelForValue:function(t){var n,i,a,r=this,o=r.start,s=+r.getRightValue(t),l=r.options,u=l.ticks;return r.isHorizontal()?(a=e.log10(r.end)-e.log10(o),0===s?i=r.left:(n=r.width,i=r.left+n/a*(e.log10(s)-e.log10(o)))):(n=r.height,0!==o||u.reverse?0===r.end&&u.reverse?(a=e.log10(r.start)-e.log10(r.minNotZero),i=s===r.end?r.top:s===r.minNotZero?r.top+.02*n:r.top+.02*n+.98*n/a*(e.log10(s)-e.log10(r.minNotZero))):(a=e.log10(r.end)-e.log10(o),n=r.height,i=r.bottom-n/a*(e.log10(s)-e.log10(o))):(a=e.log10(r.end)-e.log10(r.minNotZero),i=s===o?r.bottom:s===r.minNotZero?r.bottom-.02*n:r.bottom-.02*n-.98*n/a*(e.log10(s)-e.log10(r.minNotZero)))),i},getValueForPixel:function(t){var n,i,a=this,r=e.log10(a.end)-e.log10(a.start);return a.isHorizontal()?(i=a.width,n=a.start*Math.pow(10,(t-a.left)*r/i)):(i=a.height,n=Math.pow(10,(a.bottom-t)*r/i)/a.start),n}});t.scaleService.registerScaleType("logarithmic",i,n)}},{}],47:[function(t,e,n){"use strict";e.exports=function(t){function e(t){return t.options.lineArc?0:t.chart.data.labels.length}function n(t){var e=t.options.pointLabels,n=f.getValueOrDefault(e.fontSize,g.defaultFontSize),i=f.getValueOrDefault(e.fontStyle,g.defaultFontStyle),a=f.getValueOrDefault(e.fontFamily,g.defaultFontFamily),r=f.fontString(n,i,a);return{size:n,style:i,family:a,font:r}}function i(t,e,n){return f.isArray(n)?{w:f.longestText(t,t.font,n),h:n.length*e+1.5*(n.length-1)*e}:{w:t.measureText(n).width,h:e}}function a(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function r(t){var r,o,s,l=n(t),u=Math.min(t.height/2,t.width/2),d={l:t.width,r:0,t:t.height,b:0},c={};t.ctx.font=l.font,t._pointLabelSizes=[];var h=e(t);for(r=0;r<h;r++){s=t.getPointPosition(r,u),o=i(t.ctx,l.size,t.pointLabels[r]||""),t._pointLabelSizes[r]=o;var g=t.getIndexAngle(r),m=f.toDegrees(g)%360,p=a(m,s.x,o.w,0,180),v=a(m,s.y,o.h,90,270);p.start<d.l&&(d.l=p.start,c.l=g),p.end>d.r&&(d.r=p.end,c.r=g),v.start<d.t&&(d.t=v.start,c.t=g),v.end>d.b&&(d.b=v.end,c.b=g)}t.setReductions(u,d,c)}function o(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function s(t){return 0===t||180===t?"center":t<180?"left":"right"}function l(t,e,n,i){if(f.isArray(e))for(var a=n.y,r=1.5*i,o=0;o<e.length;++o)t.fillText(e[o],n.x,a),a+=r;else t.fillText(e,n.x,n.y)}function u(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function d(t){var i=t.ctx,a=f.getValueOrDefault,r=t.options,o=r.angleLines,d=r.pointLabels;i.lineWidth=o.lineWidth,i.strokeStyle=o.color;var c=t.getDistanceFromCenterForValue(r.reverse?t.min:t.max),h=n(t);i.textBaseline="top";for(var m=e(t)-1;m>=0;m--){if(o.display){var p=t.getPointPosition(m,c);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(p.x,p.y),i.stroke(),i.closePath()}var v=t.getPointPosition(m,c+5),b=a(d.fontColor,g.defaultFontColor);i.font=h.font,i.fillStyle=b;var y=t.getIndexAngle(m),x=f.toDegrees(y);i.textAlign=s(x),u(x,t._pointLabelSizes[m],v),l(i,t.pointLabels[m]||"",v,h.size)}}function c(t,n,i,a){var r=t.ctx;if(r.strokeStyle=f.getValueAtIndexOrDefault(n.color,a-1),r.lineWidth=f.getValueAtIndexOrDefault(n.lineWidth,a-1),t.options.lineArc)r.beginPath(),r.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),r.closePath(),r.stroke();else{var o=e(t);if(0===o)return;r.beginPath();var s=t.getPointPosition(0,i);r.moveTo(s.x,s.y);for(var l=1;l<o;l++)s=t.getPointPosition(l,i),r.lineTo(s.x,s.y);r.closePath(),r.stroke()}}function h(t){return f.isNumber(t)?t:0}var f=t.helpers,g=t.defaults.global,m={display:!0,animate:!0,lineArc:!1,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:t.Ticks.formatters.linear},pointLabels:{fontSize:10,callback:function(t){return t}}},p=t.LinearScaleBase.extend({setDimensions:function(){var t=this,e=t.options,n=e.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var i=f.min([t.height,t.width]),a=f.getValueOrDefault(n.fontSize,g.defaultFontSize);t.drawingArea=e.display?i/2-(a/2+n.backdropPaddingY):i/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;f.each(e.data.datasets,function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);f.each(a.data,function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,e=f.getValueOrDefault(t.fontSize,g.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*e)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){this.options.lineArc?o(this):r(this)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-i.height,0)/Math.cos(n.b);a=h(a),r=h(r),o=h(o),s=h(s),i.drawingArea=Math.min(Math.round(t-(a+r)/2),Math.round(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-i-a.drawingArea;a.xCenter=Math.round((o+r)/2+a.left),a.yCenter=Math.round((s+l)/2+a.top)},getIndexAngle:function(t){var n=2*Math.PI/e(this),i=this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0,a=i*Math.PI*2/360;return t*n+a},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var n=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(i)*e)+n.xCenter,y:Math.round(Math.sin(i)*e)+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,n=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,i=e.ticks,a=f.getValueOrDefault;
|
16 |
-
if(e.display){var r=t.ctx,o=a(i.fontSize,g.defaultFontSize),s=a(i.fontStyle,g.defaultFontStyle),l=a(i.fontFamily,g.defaultFontFamily),u=f.fontString(o,s,l);f.each(t.ticks,function(s,l){if(l>0||e.reverse){var d=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),h=t.yCenter-d;if(n.display&&0!==l&&c(t,n,d,l),i.display){var f=a(i.fontColor,g.defaultFontColor);if(r.font=u,i.showLabelBackdrop){var m=r.measureText(s).width;r.fillStyle=i.backdropColor,r.fillRect(t.xCenter-m/2-i.backdropPaddingX,h-o/2-i.backdropPaddingY,m+2*i.backdropPaddingX,o+2*i.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=f,r.fillText(s,t.xCenter,h)}}}),e.lineArc||d(t)}}});t.scaleService.registerScaleType("radialLinear",p,m)}},{}],48:[function(t,e,n){"use strict";var i=t(6);i="function"==typeof i?i:window.moment,e.exports=function(t){var e=t.helpers,n={units:[{name:"millisecond",steps:[1,2,5,10,20,50,100,250,500]},{name:"second",steps:[1,2,5,10,30]},{name:"minute",steps:[1,2,5,10,30]},{name:"hour",steps:[1,2,3,6,12]},{name:"day",steps:[1,2,5]},{name:"week",maxStep:4},{name:"month",maxStep:3},{name:"quarter",maxStep:4},{name:"year",maxStep:!1}]},a={position:"bottom",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm:ss a",hour:"MMM D, hA",day:"ll",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"}},ticks:{autoSkip:!1}},r=t.Scale.extend({initialize:function(){if(!i)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");t.Scale.prototype.initialize.call(this)},getLabelMoment:function(t,e){return null===t||null===e?null:"undefined"!=typeof this.labelMoments[t]?this.labelMoments[t][e]:null},getLabelDiff:function(t,e){var n=this;return null===t||null===e?null:(void 0===n.labelDiffs&&n.buildLabelDiffs(),"undefined"!=typeof n.labelDiffs[t]?n.labelDiffs[t][e]:null)},getMomentStartOf:function(t){var e=this;return"week"===e.options.time.unit&&e.options.time.isoWeekday!==!1?t.clone().startOf("isoWeek").isoWeekday(e.options.time.isoWeekday):t.clone().startOf(e.tickUnit)},determineDataLimits:function(){var t=this;t.labelMoments=[];var n=[];t.chart.data.labels&&t.chart.data.labels.length>0?(e.each(t.chart.data.labels,function(e){var i=t.parseTime(e);i.isValid()&&(t.options.time.round&&i.startOf(t.options.time.round),n.push(i))},t),t.firstTick=i.min.call(t,n),t.lastTick=i.max.call(t,n)):(t.firstTick=null,t.lastTick=null),e.each(t.chart.data.datasets,function(a,r){var o=[],s=t.chart.isDatasetVisible(r);"object"==typeof a.data[0]&&null!==a.data[0]?e.each(a.data,function(e){var n=t.parseTime(t.getRightValue(e));n.isValid()&&(t.options.time.round&&n.startOf(t.options.time.round),o.push(n),s&&(t.firstTick=null!==t.firstTick?i.min(t.firstTick,n):n,t.lastTick=null!==t.lastTick?i.max(t.lastTick,n):n))},t):o=n,t.labelMoments.push(o)},t),t.options.time.min&&(t.firstTick=t.parseTime(t.options.time.min)),t.options.time.max&&(t.lastTick=t.parseTime(t.options.time.max)),t.firstTick=(t.firstTick||i()).clone(),t.lastTick=(t.lastTick||i()).clone()},buildLabelDiffs:function(){var t=this;t.labelDiffs=[];var n=[];t.chart.data.labels&&t.chart.data.labels.length>0&&e.each(t.chart.data.labels,function(e){var i=t.parseTime(e);i.isValid()&&(t.options.time.round&&i.startOf(t.options.time.round),n.push(i.diff(t.firstTick,t.tickUnit,!0)))},t),e.each(t.chart.data.datasets,function(i){var a=[];"object"==typeof i.data[0]&&null!==i.data[0]?e.each(i.data,function(e){var n=t.parseTime(t.getRightValue(e));n.isValid()&&(t.options.time.round&&n.startOf(t.options.time.round),a.push(n.diff(t.firstTick,t.tickUnit,!0)))},t):a=n,t.labelDiffs.push(a)},t)},buildTicks:function(){var i=this;i.ctx.save();var a=e.getValueOrDefault(i.options.ticks.fontSize,t.defaults.global.defaultFontSize),r=e.getValueOrDefault(i.options.ticks.fontStyle,t.defaults.global.defaultFontStyle),o=e.getValueOrDefault(i.options.ticks.fontFamily,t.defaults.global.defaultFontFamily),s=e.fontString(a,r,o);if(i.ctx.font=s,i.ticks=[],i.unitScale=1,i.scaleSizeInUnits=0,i.options.time.unit)i.tickUnit=i.options.time.unit||"day",i.displayFormat=i.options.time.displayFormats[i.tickUnit],i.scaleSizeInUnits=i.lastTick.diff(i.firstTick,i.tickUnit,!0),i.unitScale=e.getValueOrDefault(i.options.time.unitStepSize,1);else{var l=i.isHorizontal()?i.width:i.height,u=i.tickFormatFunction(i.firstTick,0,[]),d=i.ctx.measureText(u).width,c=Math.cos(e.toRadians(i.options.ticks.maxRotation)),h=Math.sin(e.toRadians(i.options.ticks.maxRotation));d=d*c+a*h;var f=l/d;i.tickUnit=i.options.time.minUnit,i.scaleSizeInUnits=i.lastTick.diff(i.firstTick,i.tickUnit,!0),i.displayFormat=i.options.time.displayFormats[i.tickUnit];for(var g=0,m=n.units[g];g<n.units.length;){if(i.unitScale=1,e.isArray(m.steps)&&Math.ceil(i.scaleSizeInUnits/f)<e.max(m.steps)){for(var p=0;p<m.steps.length;++p)if(m.steps[p]>=Math.ceil(i.scaleSizeInUnits/f)){i.unitScale=e.getValueOrDefault(i.options.time.unitStepSize,m.steps[p]);break}break}if(m.maxStep===!1||Math.ceil(i.scaleSizeInUnits/f)<m.maxStep){i.unitScale=e.getValueOrDefault(i.options.time.unitStepSize,Math.ceil(i.scaleSizeInUnits/f));break}++g,m=n.units[g],i.tickUnit=m.name;var v=i.firstTick.diff(i.getMomentStartOf(i.firstTick),i.tickUnit,!0),b=i.getMomentStartOf(i.lastTick.clone().add(1,i.tickUnit)).diff(i.lastTick,i.tickUnit,!0);i.scaleSizeInUnits=i.lastTick.diff(i.firstTick,i.tickUnit,!0)+v+b,i.displayFormat=i.options.time.displayFormats[m.name]}}var y;if(i.options.time.min?y=i.getMomentStartOf(i.firstTick):(i.firstTick=i.getMomentStartOf(i.firstTick),y=i.firstTick),!i.options.time.max){var x=i.getMomentStartOf(i.lastTick),k=x.diff(i.lastTick,i.tickUnit,!0);k<0?i.lastTick=i.getMomentStartOf(i.lastTick.add(1,i.tickUnit)):k>=0&&(i.lastTick=x),i.scaleSizeInUnits=i.lastTick.diff(i.firstTick,i.tickUnit,!0)}i.options.time.displayFormat&&(i.displayFormat=i.options.time.displayFormat),i.ticks.push(i.firstTick.clone());for(var _=i.unitScale;_<=i.scaleSizeInUnits;_+=i.unitScale){var w=y.clone().add(_,i.tickUnit);if(i.options.time.max&&w.diff(i.lastTick,i.tickUnit,!0)>=0)break;i.ticks.push(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|