LearnPress – WordPress LMS Plugin - Version 3.2.6.7

Version Description

(2020.03.16) = ~ Fixed security issues (CVE-2020-7916 and CVE-2020-7917): uer logged can change role all users to Instructor ~ Fixed error preview Assignment

Download this release

Release Info

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

Code changes from version 3.2.6.5 to 3.2.6.7

Files changed (43) hide show
  1. assets/css/font-awesome.min.css +4 -0
  2. assets/css/jalert.css +1 -0
  3. assets/js/admin/admin-tabs.js +88 -0
  4. assets/js/admin/admin-tools.js +106 -0
  5. assets/js/admin/all.js +1 -0
  6. assets/js/admin/attributes.js +92 -0
  7. assets/js/admin/course-editor.js +866 -0
  8. assets/js/admin/index.php +1 -0
  9. assets/js/admin/meta-box-order.js +461 -0
  10. assets/js/admin/modal-search-items.js +145 -0
  11. assets/js/admin/modal-search-users.js +148 -0
  12. assets/js/admin/question-editor.asset.php +0 -1
  13. assets/js/admin/question-editor.deps.json +0 -1
  14. assets/js/admin/question-editor.js +330 -0
  15. assets/js/admin/quiz-editor.js +1002 -0
  16. assets/js/admin/settings.js +235 -0
  17. assets/js/admin/setup.js +153 -0
  18. assets/js/admin/statistic.js +286 -0
  19. assets/js/admin/sync-data.js +268 -0
  20. assets/js/admin/update.js +238 -0
  21. assets/js/admin/utils/_advanced-list.js +133 -0
  22. assets/js/admin/utils/_advertisement.js +79 -0
  23. assets/js/admin/utils/_cookie.js +3 -0
  24. assets/js/admin/utils/_dropdown-pages.js +130 -0
  25. assets/js/admin/utils/_search-items.js +46 -0
  26. assets/js/frontend/quiz.bak.js +915 -0
  27. assets/js/index.php +1 -0
  28. assets/js/vendor/Chart.bundle.min.js +16 -0
  29. assets/js/vendor/circle-bar.js +72 -0
  30. assets/js/vendor/jquery-scrollbar/jquery.scrollbar.css +185 -0
  31. assets/js/vendor/jquery-scrollbar/jquery.scrollbar.js +780 -0
  32. assets/js/vendor/jquery-tipsy/jquery.tipsy.css +1 -0
  33. assets/js/vendor/jquery-tipsy/jquery.tipsy.js +258 -0
  34. assets/js/vendor/jquery.alert.js +210 -0
  35. assets/js/vendor/jquery.appear.js +102 -0
  36. assets/js/vendor/jquery.caret.js +79 -0
  37. assets/js/vendor/jquery.cookie.js +73 -0
  38. assets/js/vendor/jquery.scrollTo.js +210 -0
  39. assets/js/vendor/jquery.timer.js +84 -0
  40. assets/js/vendor/sortable.js +1490 -0
  41. assets/js/vendor/vue-resource.js +1574 -0
  42. assets/js/vendor/vue.js +11945 -0
  43. assets/js/vendor/vue.min.js +6 -0
assets/css/font-awesome.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}
assets/css/jalert.css ADDED
@@ -0,0 +1 @@
 
1
+ #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}
assets/js/admin/admin-tabs.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/all.js ADDED
@@ -0,0 +1 @@
 
1
+ function login(){alert()}function abc(){}var x=0;abc();
assets/js/admin/attributes.js ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/course-editor.js ADDED
@@ -0,0 +1,866 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/js/admin/meta-box-order.js ADDED
<
@@ -0,0 +1,461 @@