LearnPress – WordPress LMS Plugin - Version 4.1.3

Version Description

(2021-09-07) = ~ Modified: Learnpress order status on Dashboard of Wordpress. ~ Fixed: Widgets: Popular course, Feature course, Recent course, Course Progress, Course Info, Course Extra. All widget compatible with Elementor. ~ Fixed: Info Order have courses deleted on page Profile . ~ Fixed: error user can't learn course set external link when Admin created Order manual Completed has this course. ~ Improve performance. ~ Modify function set cache. ~ Modify custom post type of LP. ~ Modify feature run progress on background. ~ Handle send all email of LP (New Order, Processing Order, Completed Order, Cancelled Order, Enrolled Course, Finished Course, Become An Instructor) on Background. ~ Remove child order when Admin created Order manual. ~ Modify enroll/buy course (user, guest). ~ Added wysiwyg field for metabox. ~ Compatible with MathJax-LateX plugin.

Download this release

Release Info

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

Code changes from version 4.1.2 to 4.1.3

Files changed (106) hide show
  1. assets/css/admin/admin.css +184 -6
  2. assets/css/learnpress.css +0 -96
  3. assets/css/widgets.css +449 -0
  4. assets/js/admin/learnpress.min.js +1 -1
  5. assets/js/dist/admin/editor/course.js +75 -75
  6. assets/js/dist/admin/editor/course.min.js +1 -1
  7. assets/js/dist/admin/editor/question.js +35 -35
  8. assets/js/dist/admin/editor/question.min.js +1 -1
  9. assets/js/dist/admin/editor/quiz.js +80 -80
  10. assets/js/dist/admin/editor/quiz.min.js +1 -1
  11. assets/js/dist/admin/pages/dashboard.js +153 -0
  12. assets/js/dist/admin/pages/dashboard.min.js +1 -0
  13. assets/js/dist/admin/pages/setup.js +5 -5
  14. assets/js/dist/admin/pages/statistic.js +5 -5
  15. assets/js/dist/admin/pages/sync-data.js +5 -5
  16. assets/js/dist/admin/pages/themes-addons.js +10 -10
  17. assets/js/dist/admin/pages/themes-addons.min.js +1 -1
  18. assets/js/dist/admin/pages/tools.js +51 -51
  19. assets/js/dist/admin/pages/tools.min.js +1 -1
  20. assets/js/dist/admin/pages/widgets.js +162 -0
  21. assets/js/dist/admin/pages/widgets.min.js +1 -0
  22. assets/js/dist/frontend/custom.js +5 -5
  23. assets/js/dist/frontend/lesson.js +5 -5
  24. assets/js/dist/frontend/lp-configs.js +5 -5
  25. assets/js/dist/frontend/modal.js +40 -40
  26. assets/js/dist/frontend/modal.min.js +1 -1
  27. assets/js/dist/frontend/profile.js +15 -15
  28. assets/js/dist/frontend/profile.min.js +1 -1
  29. assets/js/dist/frontend/question-types.js +48 -271
  30. assets/js/dist/frontend/question-types.min.js +1 -1
  31. assets/js/dist/frontend/quiz.js +151 -146
  32. assets/js/dist/frontend/quiz.min.js +2 -2
  33. assets/js/dist/frontend/single-course.js +31 -31
  34. assets/js/dist/frontend/single-course.min.js +1 -1
  35. assets/js/dist/frontend/single-curriculum.js +57 -57
  36. assets/js/dist/frontend/single-curriculum.min.js +1 -1
  37. assets/js/dist/frontend/widgets.js +208 -0
  38. assets/js/dist/frontend/widgets.min.js +1 -0
  39. assets/js/dist/js/data-controls.js +5 -5
  40. assets/js/dist/utils.js +60 -60
  41. assets/js/dist/utils.min.js +1 -1
  42. assets/js/frontend/courses.min.js +1 -1
  43. assets/src/apps/js/admin/pages/dashboard.js +23 -0
  44. assets/src/apps/js/admin/pages/widgets.js +61 -0
  45. assets/src/apps/js/frontend/question-types/components/index.js +0 -1
  46. assets/src/apps/js/frontend/question-types/components/questions/sorting-choice/index.js +0 -136
  47. assets/src/apps/js/frontend/question-types/index.js +0 -1
  48. assets/src/apps/js/frontend/quiz/components/questions/question.js +4 -0
  49. assets/src/apps/js/frontend/widgets.js +51 -0
  50. assets/src/js/admin/learnpress.js +56 -0
  51. assets/src/js/frontend/courses.js +3 -3
  52. dummy-data/dummy-data.xml +9 -43
  53. dummy-data/learnpress-how-to-use-learnpress.xml +28 -54
  54. dummy-data/sample-data.xml +24 -54
  55. inc/abstracts/abstract-assets.php +141 -14
  56. inc/abstracts/abstract-post-data.php +16 -9
  57. inc/admin/class-lp-admin-assets.php +55 -102
  58. inc/admin/class-lp-admin-dashboard.php +1 -47
  59. inc/admin/lp-admin-functions.php +2 -6
  60. inc/admin/meta-box/fields/email-content.php +5 -1
  61. inc/admin/settings/class-lp-settings-courses.php +13 -5
  62. inc/admin/settings/class-lp-settings-emails.php +8 -9
  63. inc/admin/settings/email-groups/class-lp-settings-emails-group.php +7 -0
  64. inc/admin/views/dashboard/html-orders.php +54 -0
  65. inc/admin/views/meta-boxes/class-lp-meta-box.php +2 -0
  66. inc/admin/views/meta-boxes/course/settings.php +4 -4
  67. inc/admin/views/meta-boxes/course/tabs/assessment.php +0 -69
  68. inc/admin/views/meta-boxes/course/tabs/author.php +0 -45
  69. inc/admin/views/meta-boxes/course/tabs/extra.php +0 -130
  70. inc/admin/views/meta-boxes/course/tabs/general.php +0 -155
  71. inc/admin/views/meta-boxes/course/tabs/price.php +0 -81
  72. inc/admin/views/meta-boxes/fields/checkbox.php +4 -0
  73. inc/admin/views/meta-boxes/fields/class-lp-meta-box-fields.php +2 -2
  74. inc/admin/views/meta-boxes/fields/repeater.php +105 -0
  75. inc/admin/views/meta-boxes/fields/text.php +2 -2
  76. inc/admin/views/meta-boxes/fields/wysiwyg.php +69 -0
  77. inc/admin/views/meta-boxes/order/details.php +1 -1
  78. inc/{abstracts → background-process}/abstract-background-process.php +0 -8
  79. inc/background-process/class-lp-background-emailer.php +0 -51
  80. inc/background-process/class-lp-background-single-course.php +114 -0
  81. inc/background-process/class-lp-background-single-email.php +65 -0
  82. inc/cache/class-lp-cache.php +71 -2
  83. inc/cache/class-lp-course-cache.php +32 -0
  84. inc/cache/class-lp-quiz-cache.php +32 -0
  85. inc/cart/class-lp-cart.php +0 -3
  86. inc/class-lp-asset-key.php +18 -2
  87. inc/class-lp-assets.php +47 -98
  88. inc/class-lp-checkout.php +3 -6
  89. inc/class-lp-emails.php +44 -174
  90. inc/class-lp-forms-handler.php +21 -9
  91. inc/class-lp-helper.php +15 -3
  92. inc/class-lp-page-controller.php +7 -3
  93. inc/class-lp-request-handler.php +10 -3
  94. inc/class-lp-settings.php +12 -4
  95. inc/class-lp-utils.php +1 -0
  96. inc/class-lp-widget.php +104 -71
  97. inc/course/abstract-course.php +21 -21
  98. inc/course/class-lp-course-item.php +32 -13
  99. inc/course/class-lp-course.php +88 -22
  100. inc/course/lp-course-functions.php +42 -17
  101. inc/curds/class-lp-course-curd.php +42 -17
  102. inc/curds/class-lp-order-curd.php +0 -3
  103. inc/curds/class-lp-user-curd.php +33 -41
  104. inc/curds/class-lp-user-item-curd.php +15 -10
  105. inc/custom-post-types/abstract.php +315 -173
  106. inc/custom-post-types/course.php +43 -59
assets/css/admin/admin.css CHANGED
@@ -2139,6 +2139,22 @@ ul .clearfix {
2139
  margin-left: 180px !important;
2140
  }
2141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2142
  .lp-meta-box select {
2143
  width: auto !important;
2144
  }
@@ -2155,7 +2171,7 @@ ul .clearfix {
2155
  .lp-meta-box input[type="email"],
2156
  .lp-meta-box input[type="text"],
2157
  .lp-meta-box input[type="password"],
2158
- .lp-meta-box textarea {
2159
  width: 50%;
2160
  }
2161
 
@@ -2163,7 +2179,7 @@ ul .clearfix {
2163
  .lp-meta-box input[type="email"] + .description,
2164
  .lp-meta-box input[type="text"] + .description,
2165
  .lp-meta-box input[type="password"] + .description,
2166
- .lp-meta-box textarea + .description {
2167
  flex-basis: 100% !important;
2168
  width: 100%;
2169
  margin-top: 8px !important;
@@ -2179,7 +2195,7 @@ ul .clearfix {
2179
  width: 50%;
2180
  }
2181
 
2182
- .lp-meta-box textarea {
2183
  height: 3.5em;
2184
  line-height: 1.5em;
2185
  vertical-align: top;
@@ -2362,6 +2378,120 @@ ul .clearfix {
2362
  padding-left: 40px !important;
2363
  }
2364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2365
  .lp_course_faq_meta_box__content {
2366
  flex: 1;
2367
  }
@@ -2700,6 +2830,54 @@ input[name="_lp_course_result"]:checked ~ #passing-condition-quiz-result {
2700
  }
2701
  }
2702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2703
  .learn-press-addons .lp-search-addon {
2704
  width: 280px;
2705
  height: 32px;
@@ -7322,11 +7500,11 @@ body.lp-item-moving {
7322
  }
7323
 
7324
  .lp-notice-update-database {
7325
- border-left-color: #f00;
7326
  border: 1px solid rebeccapurple;
7327
- background: rebeccapurple;
7328
- color: white;
7329
  border-radius: 3px;
 
 
7330
  }
7331
 
7332
  .lp-notice-update-database.do-updating::before {
2139
  margin-left: 180px !important;
2140
  }
2141
 
2142
+ .lp-meta-box__wp-editor {
2143
+ display: block;
2144
+ }
2145
+
2146
+ .lp-meta-box__wp-editor .description {
2147
+ flex-basis: 100% !important;
2148
+ width: 100%;
2149
+ margin-top: 8px !important;
2150
+ margin-left: 180px !important;
2151
+ color: #666;
2152
+ }
2153
+
2154
+ .lp-meta-box__wp-editor__textarea {
2155
+ border: none !important;
2156
+ }
2157
+
2158
  .lp-meta-box select {
2159
  width: auto !important;
2160
  }
2171
  .lp-meta-box input[type="email"],
2172
  .lp-meta-box input[type="text"],
2173
  .lp-meta-box input[type="password"],
2174
+ .lp-meta-box textarea:not(.lp-meta-box__wp-editor__textarea) {
2175
  width: 50%;
2176
  }
2177
 
2179
  .lp-meta-box input[type="email"] + .description,
2180
  .lp-meta-box input[type="text"] + .description,
2181
  .lp-meta-box input[type="password"] + .description,
2182
+ .lp-meta-box textarea:not(.lp-meta-box__wp-editor__textarea) + .description {
2183
  flex-basis: 100% !important;
2184
  width: 100%;
2185
  margin-top: 8px !important;
2195
  width: 50%;
2196
  }
2197
 
2198
+ .lp-meta-box textarea:not(.lp-meta-box__wp-editor__textarea) {
2199
  height: 3.5em;
2200
  line-height: 1.5em;
2201
  vertical-align: top;
2378
  padding-left: 40px !important;
2379
  }
2380
 
2381
+ .lp_repeater_meta_box__wrapper {
2382
+ flex: 1 !important;
2383
+ }
2384
+
2385
+ .lp_repeater_meta_box__fields {
2386
+ position: relative;
2387
+ margin-bottom: 10px;
2388
+ }
2389
+
2390
+ .lp_repeater_meta_box__field {
2391
+ display: grid;
2392
+ position: relative;
2393
+ margin-bottom: 10px;
2394
+ border: 1px solid #c5c5c5;
2395
+ border-radius: 2px;
2396
+ }
2397
+
2398
+ .lp_repeater_meta_box__field_active .lp_repeater_meta_box__content {
2399
+ display: block;
2400
+ }
2401
+
2402
+ .lp_repeater_meta_box__field_active .lp_repeater_meta_box__title__toggle::after {
2403
+ transform: rotate(180deg);
2404
+ }
2405
+
2406
+ .lp_repeater_meta_box__title {
2407
+ display: grid;
2408
+ grid-template-columns: 44px 1fr 40px 40px;
2409
+ align-items: center;
2410
+ position: relative;
2411
+ background-color: #eee;
2412
+ }
2413
+
2414
+ .lp_repeater_meta_box__title__title {
2415
+ flex: 1;
2416
+ padding: 14px 0;
2417
+ }
2418
+
2419
+ .lp_repeater_meta_box__title__sort {
2420
+ display: flex;
2421
+ height: 100%;
2422
+ color: #666;
2423
+ text-decoration: none;
2424
+ cursor: grab;
2425
+ align-items: center;
2426
+ justify-content: center;
2427
+ }
2428
+
2429
+ .lp_repeater_meta_box__title__sort::after {
2430
+ font-family: Dashicons;
2431
+ font-size: 20px;
2432
+ line-height: 1;
2433
+ content: "\f333";
2434
+ }
2435
+
2436
+ .lp_repeater_meta_box__title__delete {
2437
+ display: flex;
2438
+ height: 100%;
2439
+ color: #666;
2440
+ text-decoration: none;
2441
+ align-items: center;
2442
+ justify-content: center;
2443
+ }
2444
+
2445
+ .lp_repeater_meta_box__title__delete::after {
2446
+ font-family: Dashicons;
2447
+ font-size: 20px;
2448
+ line-height: 1;
2449
+ content: "\f335";
2450
+ }
2451
+
2452
+ .lp_repeater_meta_box__title__toggle {
2453
+ display: flex;
2454
+ height: 100%;
2455
+ color: #666;
2456
+ text-decoration: none;
2457
+ align-items: center;
2458
+ justify-content: center;
2459
+ }
2460
+
2461
+ .lp_repeater_meta_box__title__toggle::after {
2462
+ font-family: Dashicons;
2463
+ font-size: 20px;
2464
+ line-height: 1;
2465
+ content: "\f347";
2466
+ }
2467
+
2468
+ .lp_repeater_meta_box__content {
2469
+ display: none;
2470
+ padding: 14px 20px;
2471
+ }
2472
+
2473
+ .lp_repeater_meta_box__content > label {
2474
+ display: grid;
2475
+ width: 100% !important;
2476
+ min-width: 100% !important;
2477
+ max-width: 100% !important;
2478
+ margin-bottom: 20px;
2479
+ grid-template-rows: auto 1fr;
2480
+ }
2481
+
2482
+ .lp_repeater_meta_box__content > label:last-child {
2483
+ margin-bottom: 0;
2484
+ }
2485
+
2486
+ .lp_repeater_meta_box__content > label span {
2487
+ margin-bottom: 5px;
2488
+ }
2489
+
2490
+ .lp_repeater_meta_box__content > label textarea,
2491
+ .lp_repeater_meta_box__content > label input {
2492
+ width: 100% !important;
2493
+ }
2494
+
2495
  .lp_course_faq_meta_box__content {
2496
  flex: 1;
2497
  }
2830
  }
2831
  }
2832
 
2833
+ .lp_widget_autocomplete__loading {
2834
+ margin-top: 0 !important;
2835
+ padding: 7px 10px;
2836
+ border: 1px solid #949494;
2837
+ border-top: none !important;
2838
+ background: #eee;
2839
+ font-size: 13px !important;
2840
+ }
2841
+
2842
+ .lp_widget_autocomplete__select {
2843
+ overflow: auto;
2844
+ left: 0;
2845
+ width: 100%;
2846
+ max-height: 148px;
2847
+ margin-top: -1px;
2848
+ background: #eee;
2849
+ font-size: 13px;
2850
+ }
2851
+
2852
+ .lp_widget_autocomplete__item {
2853
+ overflow: hidden;
2854
+ padding: 7px 10px;
2855
+ border: 1px solid #949494;
2856
+ border-top: none;
2857
+ border-bottom-color: #afafaf;
2858
+ white-space: nowrap;
2859
+ text-overflow: ellipsis;
2860
+ cursor: pointer;
2861
+ }
2862
+
2863
+ .lp_widget_autocomplete__item__selected, .lp_widget_autocomplete__item:hover {
2864
+ color: #fff;
2865
+ background-color: #007cba;
2866
+ }
2867
+
2868
+ .widget .select2-selection__rendered {
2869
+ font-size: 13px;
2870
+ }
2871
+
2872
+ @keyframes spin {
2873
+ from {
2874
+ transform: rotate(0deg);
2875
+ }
2876
+ to {
2877
+ transform: rotate(360deg);
2878
+ }
2879
+ }
2880
+
2881
  .learn-press-addons .lp-search-addon {
2882
  width: 280px;
2883
  height: 32px;
7500
  }
7501
 
7502
  .lp-notice-update-database {
 
7503
  border: 1px solid rebeccapurple;
7504
+ border-left-color: #f00;
 
7505
  border-radius: 3px;
7506
+ color: white;
7507
+ background: rebeccapurple;
7508
  }
7509
 
7510
  .lp-notice-update-database.do-updating::before {
assets/css/learnpress.css CHANGED
@@ -5150,29 +5150,6 @@ body.twentyseventeen.learnpress-page #primary article.page .lp-entry-content {
5150
  }
5151
  }
5152
 
5153
- .lp-widget .items-progress,
5154
- .lp-widget .course-progress {
5155
- width: 100%;
5156
- }
5157
-
5158
- .lp-widget .course-remaining-time {
5159
- font-size: 14px;
5160
- }
5161
-
5162
- .lp-widget .lp-course-info-fields {
5163
- margin: 0;
5164
- }
5165
-
5166
- .lp-widget .lp-course-info-fields .lp-course-info {
5167
- list-style: none;
5168
- margin: 0 0 10px 0;
5169
- }
5170
-
5171
- .lp-widget .lp-course-info-fields .lp-course-info .lp-label {
5172
- float: right;
5173
- background: #03a9f4;
5174
- }
5175
-
5176
  .learn-press-tip {
5177
  display: none;
5178
  margin: 0 5px;
@@ -6562,13 +6539,6 @@ input[type="radio"]:nth-child(19):checked ~ .switch-btn:nth-child(20)::before {
6562
  background: #fff;
6563
  }
6564
 
6565
- .lp-archive-courses .course-summary .course-summary-content .lp-entry-content.lp-content-area .course-summary-sidebar .course-summary-sidebar__inner > div .widgettitle {
6566
- margin-top: 0;
6567
- margin-bottom: 2px;
6568
- font-size: 18px;
6569
- font-weight: 500;
6570
- }
6571
-
6572
  .lp-archive-courses .course-summary .course-summary-content .lp-entry-content.lp-content-area .course-summary-sidebar .course-summary-sidebar__inner > div ul {
6573
  list-style: none;
6574
  }
@@ -6785,72 +6755,6 @@ input[type="radio"]:nth-child(19):checked ~ .switch-btn:nth-child(20)::before {
6785
  margin-bottom: 0;
6786
  }
6787
 
6788
- #learn-press-course .course-summary-sidebar .course-extras {
6789
- display: block;
6790
- }
6791
-
6792
- #learn-press-course .course-summary-sidebar .course-extras .course-extras__title {
6793
- font-size: 18px;
6794
- font-weight: normal;
6795
- }
6796
-
6797
- #learn-press-course .course-summary-sidebar .course-extras .course-extras__content {
6798
- color: #777;
6799
- font-size: 14px;
6800
- }
6801
-
6802
- #learn-press-course .course-summary-sidebar .course-extras .course-extras__content ul {
6803
- list-style: none;
6804
- }
6805
-
6806
- #learn-press-course .course-summary-sidebar .course-extras .course-extras__content ol {
6807
- list-style-position: inside;
6808
- }
6809
-
6810
- #learn-press-course .course-summary-sidebar .course-extras .course-extras__content ul li,
6811
- #learn-press-course .course-summary-sidebar .course-extras .course-extras__content ol li {
6812
- position: relative;
6813
- border: none;
6814
- }
6815
-
6816
- #learn-press-course .course-summary-sidebar .course-extras.style-checks ul li,
6817
- #learn-press-course .course-summary-sidebar .course-extras.style-checks ol li {
6818
- padding-left: 20px;
6819
- }
6820
-
6821
- #learn-press-course .course-summary-sidebar .course-extras.style-checks ul li::before,
6822
- #learn-press-course .course-summary-sidebar .course-extras.style-checks ol li::before {
6823
- display: inline-block;
6824
- position: absolute;
6825
- top: 13px;
6826
- left: 0;
6827
- width: 12px;
6828
- height: 7px;
6829
- border: 2px solid #8794b9;
6830
- border-top: none;
6831
- border-right: none;
6832
- content: "";
6833
- transform: rotate(-54deg);
6834
- }
6835
-
6836
- #learn-press-course .course-summary-sidebar .course-extras.style-radios ul li,
6837
- #learn-press-course .course-summary-sidebar .course-extras.style-radios ol li {
6838
- padding-left: 20px;
6839
- }
6840
-
6841
- #learn-press-course .course-summary-sidebar .course-extras.style-radios ul li::before,
6842
- #learn-press-course .course-summary-sidebar .course-extras.style-radios ol li::before {
6843
- display: inline-block;
6844
- position: absolute;
6845
- top: 12px;
6846
- left: 0;
6847
- width: 12px;
6848
- height: 12px;
6849
- border: 2px solid #8794b9;
6850
- border-radius: 50%;
6851
- content: "";
6852
- }
6853
-
6854
  .learnpress-page .lp-button.secondary {
6855
  background: #9198ab;
6856
  }
5150
  }
5151
  }
5152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5153
  .learn-press-tip {
5154
  display: none;
5155
  margin: 0 5px;
6539
  background: #fff;
6540
  }
6541
 
 
 
 
 
 
 
 
6542
  .lp-archive-courses .course-summary .course-summary-content .lp-entry-content.lp-content-area .course-summary-sidebar .course-summary-sidebar__inner > div ul {
6543
  list-style: none;
6544
  }
6755
  margin-bottom: 0;
6756
  }
6757
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6758
  .learnpress-page .lp-button.secondary {
6759
  background: #9198ab;
6760
  }
assets/css/widgets.css ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @charset "UTF-8";
2
+ /**
3
+ * Mixin
4
+ */
5
+ @-webkit-keyframes rotating4 {
6
+ from {
7
+ -webkit-transform: rotate(0deg);
8
+ -o-transform: rotate(0deg);
9
+ transform: rotate(0deg);
10
+ }
11
+ to {
12
+ -webkit-transform: rotate(360deg);
13
+ -o-transform: rotate(360deg);
14
+ transform: rotate(360deg);
15
+ }
16
+ }
17
+
18
+ @keyframes rotating4 {
19
+ from {
20
+ -ms-transform: rotate(0deg);
21
+ -moz-transform: rotate(0deg);
22
+ -webkit-transform: rotate(0deg);
23
+ -o-transform: rotate(0deg);
24
+ transform: rotate(0deg);
25
+ }
26
+ to {
27
+ -ms-transform: rotate(360deg);
28
+ -moz-transform: rotate(360deg);
29
+ -webkit-transform: rotate(360deg);
30
+ -o-transform: rotate(360deg);
31
+ transform: rotate(360deg);
32
+ }
33
+ }
34
+
35
+ @-webkit-keyframes animation4 {
36
+ from {
37
+ left: -40%;
38
+ width: 40%;
39
+ }
40
+ to {
41
+ left: 100%;
42
+ width: 10%;
43
+ }
44
+ }
45
+
46
+ @keyframes animation4 {
47
+ from {
48
+ left: -40%;
49
+ width: 40%;
50
+ }
51
+ to {
52
+ left: 100%;
53
+ width: 10%;
54
+ }
55
+ }
56
+
57
+ .lp-skeleton-animation {
58
+ margin: 0;
59
+ padding: 0;
60
+ list-style: none;
61
+ }
62
+
63
+ .lp-skeleton-animation > li {
64
+ width: 100%;
65
+ height: 16px;
66
+ margin-top: 15px;
67
+ border-radius: 2px;
68
+ background: linear-gradient(90deg, rgba(190, 190, 190, 0.2) 25%, rgba(129, 129, 129, 0.24) 37%, rgba(190, 190, 190, 0.2) 63%);
69
+ background-size: 400% 100%;
70
+ list-style: none;
71
+ animation: lp-skeleton-loading 1.4s ease infinite;
72
+ }
73
+
74
+ @keyframes lp-skeleton-loading {
75
+ 0% {
76
+ background-position: 100% 50%;
77
+ }
78
+ to {
79
+ background-position: 0 50%;
80
+ }
81
+ }
82
+
83
+ .learnpress.widget {
84
+ max-width: 400px;
85
+ margin-bottom: 30px;
86
+ }
87
+
88
+ .learnpress.widget .widgettitle {
89
+ margin-top: 0;
90
+ margin-bottom: 2px;
91
+ font-size: 18px;
92
+ font-weight: 600;
93
+ }
94
+
95
+ .learnpress.widget .learnpress-widget-wrapper {
96
+ margin-top: 15px;
97
+ }
98
+
99
+ .learnpress.widget h3 {
100
+ margin-bottom: 20px;
101
+ font-size: 16px;
102
+ }
103
+
104
+ .learnpress.widget a {
105
+ text-decoration: none;
106
+ }
107
+
108
+ .elementor-widget-wrap .learnpress-widget-wrapper {
109
+ max-width: 400px;
110
+ }
111
+
112
+ .learnpress-widget-wrapper .lp-widget-course {
113
+ margin: 0 0 30px 0;
114
+ }
115
+
116
+ .learnpress-widget-wrapper .lp-widget-course__image img {
117
+ max-width: 100%;
118
+ height: auto;
119
+ }
120
+
121
+ .learnpress-widget-wrapper .lp-widget-course__title {
122
+ margin-bottom: 20px;
123
+ font-size: 16px;
124
+ font-weight: 600;
125
+ }
126
+
127
+ .learnpress-widget-wrapper .lp-widget-course__content {
128
+ margin: 0;
129
+ padding: 15px;
130
+ border: 1px solid #eee;
131
+ border-top: none;
132
+ }
133
+
134
+ .learnpress-widget-wrapper .lp-widget-course__title {
135
+ margin: 5px 0 15px 0;
136
+ }
137
+
138
+ .learnpress-widget-wrapper .lp-widget-course__meta {
139
+ display: grid;
140
+ margin: 15px 0 0 0;
141
+ font-size: 15px;
142
+ grid-template-columns: repeat(2, 1fr);
143
+ justify-content: space-between;
144
+ align-items: center;
145
+ }
146
+
147
+ .learnpress-widget-wrapper .lp-widget-course__description {
148
+ color: #666;
149
+ font-size: 15px;
150
+ }
151
+
152
+ .learnpress-widget-wrapper .lp-widget-course__price {
153
+ color: #444;
154
+ font-size: 15px;
155
+ font-weight: 600;
156
+ }
157
+
158
+ .learnpress-widget-wrapper .lp-widget-course__instructor {
159
+ display: flex;
160
+ align-items: center;
161
+ }
162
+
163
+ .learnpress-widget-wrapper .lp-widget-course__instructor__avatar {
164
+ margin-right: 5px;
165
+ }
166
+
167
+ .learnpress-widget-wrapper .lp-widget-course__instructor__avatar img {
168
+ width: 20px;
169
+ border-radius: 20px;
170
+ }
171
+
172
+ .learnpress-widget-wrapper .lp-widget-course__instructor > a {
173
+ color: #777;
174
+ font-size: 15px;
175
+ }
176
+
177
+ .learnpress.widget_course_progress .lp_widget_course_progress,
178
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .lp_widget_course_progress {
179
+ margin: 0;
180
+ padding: 20px;
181
+ border: 1px solid #eee;
182
+ }
183
+
184
+ .learnpress.widget_course_progress .course-results-progress,
185
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress {
186
+ margin-top: 10px;
187
+ font-size: 14px;
188
+ }
189
+
190
+ .learnpress.widget_course_progress .course-results-progress .items-progress,
191
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .items-progress {
192
+ display: flex;
193
+ margin-bottom: 5px;
194
+ justify-content: space-between;
195
+ align-items: center;
196
+ }
197
+
198
+ .learnpress.widget_course_progress .course-results-progress .items-progress__heading,
199
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .items-progress__heading {
200
+ font-weight: 400;
201
+ }
202
+
203
+ .learnpress.widget_course_progress .course-results-progress .lp-course-progress,
204
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .lp-course-progress {
205
+ width: 100%;
206
+ }
207
+
208
+ .learnpress.widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress,
209
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress {
210
+ position: relative;
211
+ }
212
+
213
+ .learnpress.widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress .progress-bg,
214
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress .progress-bg {
215
+ overflow: hidden;
216
+ position: relative;
217
+ height: 6px;
218
+ background: #ccc;
219
+ -webkit-border-radius: 5px;
220
+ -moz-border-radius: 5px;
221
+ border-radius: 5px;
222
+ }
223
+
224
+ .learnpress.widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress .progress-bg .progress-active,
225
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress .progress-bg .progress-active {
226
+ position: absolute;
227
+ left: 50%;
228
+ width: 100%;
229
+ height: 100%;
230
+ margin-left: -100%;
231
+ background: var(--lp-primary-color);
232
+ -webkit-border-radius: 5px;
233
+ -moz-border-radius: 5px;
234
+ border-radius: 5px;
235
+ }
236
+
237
+ .learnpress.widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress .lp-passing-conditional,
238
+ .elementor-widget-wp-widget-learnpress_widget_course_progress .course-results-progress .lp-course-progress.learn-press-progress .lp-passing-conditional {
239
+ position: absolute;
240
+ top: 0;
241
+ width: 3px;
242
+ height: 6px;
243
+ margin-left: -1px;
244
+ background: var(--lp-secondary-color);
245
+ }
246
+
247
+ .learnpress.widget_course_info .lp_widget_course_info,
248
+ .elementor-widget-wp-widget-learnpress_widget_course_info .lp_widget_course_info {
249
+ margin: 0;
250
+ padding: 20px;
251
+ border: 1px solid #eee;
252
+ line-height: 1;
253
+ }
254
+
255
+ .learnpress.widget_course_info .lp_widget_course_info h3,
256
+ .elementor-widget-wp-widget-learnpress_widget_course_info .lp_widget_course_info h3 {
257
+ margin-bottom: 15px;
258
+ }
259
+
260
+ .learnpress.widget_course_info .lp_widget_course_info ul,
261
+ .elementor-widget-wp-widget-learnpress_widget_course_info .lp_widget_course_info ul {
262
+ margin: 0;
263
+ padding: 0;
264
+ font-size: 14px;
265
+ }
266
+
267
+ .learnpress.widget_course_info .lp_widget_course_info ul li,
268
+ .elementor-widget-wp-widget-learnpress_widget_course_info .lp_widget_course_info ul li {
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: space-between;
272
+ margin-bottom: 5px;
273
+ line-height: 1;
274
+ }
275
+
276
+ .learnpress.widget_course_info .lp_widget_course_info ul li span,
277
+ .elementor-widget-wp-widget-learnpress_widget_course_info .lp_widget_course_info ul li span {
278
+ font-size: 14px;
279
+ }
280
+
281
+ .learnpress.widget_course_info .lp_widget_course_info ul label,
282
+ .elementor-widget-wp-widget-learnpress_widget_course_info .lp_widget_course_info ul label {
283
+ font-size: 14px;
284
+ }
285
+
286
+ .learnpress.widget_course_extra .lp-widget-course-extra,
287
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra {
288
+ margin: 0;
289
+ padding: 20px;
290
+ border: 1px solid #eee;
291
+ line-height: 1;
292
+ }
293
+
294
+ .learnpress.widget_course_extra .lp-widget-course-extra h3,
295
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra h3 {
296
+ margin-bottom: 20px;
297
+ font-size: 16px;
298
+ }
299
+
300
+ .learnpress.widget_course_extra .lp-widget-course-extra__content h4.course-extras__title,
301
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content h4.course-extras__title {
302
+ margin: 0;
303
+ margin-bottom: 15px;
304
+ font-size: 14px;
305
+ font-weight: 600;
306
+ }
307
+
308
+ .learnpress.widget_course_extra .lp-widget-course-extra__content ul,
309
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content ul {
310
+ margin: 0;
311
+ padding: 0;
312
+ font-size: 14px;
313
+ }
314
+
315
+ .learnpress.widget_course_extra .lp-widget-course-extra__content ul li,
316
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content ul li {
317
+ margin-bottom: 10px;
318
+ }
319
+
320
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras,
321
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras {
322
+ display: block;
323
+ }
324
+
325
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content,
326
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content {
327
+ color: #777;
328
+ font-size: 14px;
329
+ }
330
+
331
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ul,
332
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ul {
333
+ list-style: none;
334
+ }
335
+
336
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ol,
337
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ol {
338
+ list-style-position: inside;
339
+ }
340
+
341
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ul li,
342
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ol li,
343
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ul li,
344
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras .course-extras__content ol li {
345
+ position: relative;
346
+ border: none;
347
+ }
348
+
349
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ul li,
350
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ol li,
351
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ul li,
352
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ol li {
353
+ padding-left: 20px;
354
+ }
355
+
356
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ul li::before,
357
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ol li::before,
358
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ul li::before,
359
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-checks ol li::before {
360
+ display: inline-block;
361
+ position: absolute;
362
+ top: 50%;
363
+ left: 0;
364
+ width: 12px;
365
+ height: 7px;
366
+ border: 2px solid #8794b9;
367
+ border-top: none;
368
+ border-right: none;
369
+ content: "";
370
+ transform: rotate(-54deg) translateY(-50%);
371
+ }
372
+
373
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ul li,
374
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ol li,
375
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ul li,
376
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ol li {
377
+ padding-left: 20px;
378
+ }
379
+
380
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ul li::before,
381
+ .learnpress.widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ol li::before,
382
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ul li::before,
383
+ .elementor-widget-wp-widget-learnpress_widget_course_extra .lp-widget-course-extra__content .course-extras.style-radios ol li::before {
384
+ display: inline-block;
385
+ position: absolute;
386
+ top: 50%;
387
+ left: 0;
388
+ width: 12px;
389
+ height: 7px;
390
+ border: 2px solid #8794b9;
391
+ border-top: none;
392
+ border-right: none;
393
+ content: "";
394
+ transform: rotate(-54deg) translateY(-50%);
395
+ }
396
+
397
+ .learnpress.widget_course_featured .lp-widget-featured-courses__footer,
398
+ .elementor-widget-wp-widget-learnpress_widget_course_featured .lp-widget-featured-courses__footer {
399
+ margin-top: 20px;
400
+ padding-top: 10px;
401
+ border-top: 1px solid #eee;
402
+ }
403
+
404
+ .learnpress.widget_course_featured .lp-widget-featured-courses__footer__link,
405
+ .elementor-widget-wp-widget-learnpress_widget_course_featured .lp-widget-featured-courses__footer__link {
406
+ font-size: 16px;
407
+ line-height: 1;
408
+ }
409
+
410
+ .learnpress.widget_course_featured .lp-widget-featured-courses__footer__link::before,
411
+ .elementor-widget-wp-widget-learnpress_widget_course_featured .lp-widget-featured-courses__footer__link::before {
412
+ content: "←";
413
+ }
414
+
415
+ .learnpress.widget_course_popular .lp-widget-popular-courses__footer,
416
+ .elementor-widget-wp-widget-learnpress_widget_course_popular .lp-widget-popular-courses__footer {
417
+ margin-top: 20px;
418
+ padding-top: 10px;
419
+ border-top: 1px solid #eee;
420
+ }
421
+
422
+ .learnpress.widget_course_popular .lp-widget-popular-courses__footer__link,
423
+ .elementor-widget-wp-widget-learnpress_widget_course_popular .lp-widget-popular-courses__footer__link {
424
+ font-size: 16px;
425
+ line-height: 1;
426
+ }
427
+
428
+ .learnpress.widget_course_popular .lp-widget-popular-courses__footer__link::before,
429
+ .elementor-widget-wp-widget-learnpress_widget_course_popular .lp-widget-popular-courses__footer__link::before {
430
+ content: "←";
431
+ }
432
+
433
+ .learnpress.widget_course_recent .lp-widget-recent-courses__footer,
434
+ .elementor-widget-wp-widget-learnpress_widget_course_recent .lp-widget-recent-courses__footer {
435
+ margin-top: 20px;
436
+ padding-top: 10px;
437
+ border-top: 1px solid #eee;
438
+ }
439
+
440
+ .learnpress.widget_course_recent .lp-widget-recent-courses__footer__link,
441
+ .elementor-widget-wp-widget-learnpress_widget_course_recent .lp-widget-recent-courses__footer__link {
442
+ font-size: 16px;
443
+ line-height: 1;
444
+ }
445
+
446
+ .learnpress.widget_course_recent .lp-widget-recent-courses__footer__link::before,
447
+ .elementor-widget-wp-widget-learnpress_widget_course_recent .lp-widget-recent-courses__footer__link::before {
448
+ content: "←";
449
+ }
assets/js/admin/learnpress.min.js CHANGED
@@ -1 +1 @@
1
- const $=jQuery,$doc=$(document),$win=$(window),makePaymentsSortable=function(){$(".learn-press-payments.sortable tbody").sortable({handle:".dashicons-menu",helper:(e,t)=>(t.children().each((function(){$(this).width($(this).width())})),t),axis:"y",start(e,t){},stop(e,t){},update(e,t){const a=$(this).children().map((function(){return $(this).find('input[name="payment-order"]').val()})).get();$.post({url:"",data:{"lp-ajax":"update-payment-order",order:a},success(e){}})}})},lpMetaboxCustomFields=()=>{$(".lp-metabox__custom-fields").on("click",".lp-metabox-custom-field-button",(function(){const t=$(this).data("row").replace(/lp_metabox_custom_fields_key/gi,Math.floor(1e3*Math.random())+1);return $(this).closest("table").find("tbody").append(t),e($(this).closest(".lp-metabox__custom-fields")),!1})),$(".lp-metabox__custom-fields").on("click","a.delete",(function(){return $(this).closest("tr").remove(),e($(this).closest(".lp-metabox__custom-fields")),!1})),$(".lp-metabox__custom-fields tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,update(t,a){e($(this).closest(".lp-metabox__custom-fields"))}});const e=e=>{e.find("tbody tr").each((function(e,t){$(this).find(".sort .count").val(e)}))}},lpMetaboxExtraInfo=()=>{$(".lp_course_extra_meta_box__add").on("click",(function(){return $(this).closest(".lp_course_extra_meta_box__content").find(".lp_course_extra_meta_box__fields").append($(this).data("add")),$(this).closest(".lp_course_extra_meta_box__content").find(".lp_course_extra_meta_box__field").last().find("input").trigger("focus"),!1})),document.querySelectorAll(".lp_course_extra_meta_box__fields").forEach(e=>{e.addEventListener("keydown",t=>{const a=e.querySelectorAll(".lp_course_extra_meta_box__input");if(13===t.keyCode)return t.preventDefault(),a.forEach(e=>{e.blur()}),!1})}),$(".lp_course_extra_meta_box__fields").on("click","a.delete",(function(){return $(this).closest(".lp_course_extra_meta_box__field").remove(),!1})),$(".lp_course_extra_meta_box__fields").sortable({items:".lp_course_extra_meta_box__field",cursor:"grab",axis:"y",handle:".sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65}),$(".lp_course_faq_meta_box__add").on("click",(function(){return $(this).closest(".lp_course_faq_meta_box__content").find(".lp_course_faq_meta_box__fields").append($(this).data("add")),!1})),document.querySelectorAll(".lp_course_faq_meta_box__fields").forEach(e=>{e.addEventListener("keydown",t=>{const a=e.querySelectorAll(".lp_course_faq_meta_box__field input"),s=e.querySelectorAll(".lp_course_faq_meta_box__field textarea");if(13===t.keyCode)return t.preventDefault(),[...a,...s].forEach(e=>{e.blur()}),!1})}),$(".lp_course_faq_meta_box__fields").on("click","a.delete",(function(){return $(this).closest(".lp_course_faq_meta_box__field").remove(),!1})),$(".lp_course_faq_meta_box__fields").sortable({items:".lp_course_faq_meta_box__field",cursor:"grab",axis:"y",handle:".sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65})},lpGetFinalQuiz=()=>{[...document.querySelectorAll(".lp-metabox-get-final-quiz")].map(t=>{t.addEventListener("click",a=>{a.preventDefault();const s=t.textContent,i=t.dataset.loading,l=document.querySelector(".lp-metabox-evaluate-final_quiz");l&&l.remove(),t.textContent=i,e(t).then(e=>{const{message:a,data:i}=e;t.textContent=s;const l=document.createElement("div");l.className="lp-metabox-evaluate-final_quiz",l.innerHTML=i||a,t.parentNode.insertBefore(l,t.nextSibling)})})});const e=async e=>{if(!lpGlobalSettings.root)return;return await wp.apiFetch({path:"lp/v1/admin/course/get_final_quiz",method:"POST",data:{courseId:e.dataset.postid||""}})}},lpMetaboxColorPicker=()=>{$(".lp-metabox__colorpick").iris({change(e,t){$(this).parent().find(".colorpickpreview").css({backgroundColor:t.color.toString()})},hide:!0,border:!0}).on("click focus",(function(e){e.stopPropagation(),$(".iris-picker").hide(),$(this).closest("td").find(".iris-picker").show(),$(this).data("original-value",$(this).val())})).on("change",(function(){if($(this).is(".iris-error")){$(this).data("original-value").match(/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)?$(this).val($(this).data("original-value")).trigger("change"):$(this).val("").trigger("change")}})),$("body").on("click",(function(){$(".iris-picker").hide()}))},lpMetaboxImage=()=>{$(".lp-metabox-field__image").each((e,t)=>{let a;const s=$(t).find(".lp-metabox-field__image--add"),i=$(t).find(".lp-metabox-field__image--delete"),l=$(t).find(".lp-metabox-field__image--image"),o=$(t).find(".lp-metabox-field__image--id");o.val()?(s.hide(),i.show()):(s.show(),i.hide()),s.on("click",e=>{e.preventDefault(),a||(a=wp.media({title:s.data("choose"),button:{text:s.data("update")},multiple:!1}),a.on("select",(function(){const e=a.state().get("selection").first().toJSON(),t=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;l.append('<div class="lp-metabox-field__image--inner"><img src="'+t+'" alt="" style="max-width:100%;"/></div>'),o.val(e.id),s.hide(),i.show()}))),a.open()}),i.on("click",e=>{e.preventDefault(),l.html(""),s.show(),i.hide(),o.val("")})})},lpMetaboxImageAdvanced=()=>{$(".lp-metabox-field__image-advanced").each((e,t)=>{let a;const s=$(t).find("#lp-gallery-images-ids"),i=$(t).find(".lp-metabox-field__image-advanced-images"),l=$(t).find(".lp-metabox-field__image-advanced-upload > a");$(l).on("click",e=>{e.preventDefault(),a||(a=wp.media({title:l.data("choose"),button:{text:l.data("update")},states:[new wp.media.controller.Library({title:l.data("choose"),filterable:"all",multiple:!0})]}),a.on("select",(function(){const e=a.state().get("selection");let t=s.val();e.forEach((function(e){if((e=e.toJSON()).id){t=t?t+","+e.id:e.id;const a=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;i.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+a+'" /><ul class="actions"><li><a href="#" class="delete" title="'+l.data("delete")+'">'+l.data("text")+"</a></li></ul></li>")}})),s.val(t)}))),a.open()}),i.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"lp-metabox-sortable-placeholder",start(e,t){t.item.css("background-color","#f6f6f6")},stop(e,t){t.item.removeAttr("style")},update(){let e="";i.find("li.image").css("cursor","default").each((function(){const t=$(this).attr("data-attachment_id");e=e+t+","})),s.val(e)}}),$(i).find("li.image").each((e,t)=>{$(t).find("a.delete").on("click",()=>{$(t).remove();let e="";return $(i).find("li.image").css("cursor","default").each((function(){const t=$(this).attr("data-attachment_id");e=e+t+","})),s.val(e),!1})})})},lpMetaboxCourseTabs=()=>{$(document.body).on("lp-metabox-course-tab-panels",(function(){$("ul.lp-meta-box__course-tab__tabs").show(),$("ul.lp-meta-box__course-tab__tabs a").on("click",(function(e){e.preventDefault();const t=$(this).closest("div.lp-meta-box__course-tab");$("ul.lp-meta-box__course-tab__tabs li",t).removeClass("active"),$(this).parent().addClass("active"),$("div.lp-meta-box-course-panels",t).hide(),$($(this).attr("href")).show()})),$("div.lp-meta-box__course-tab").each((function(){$(this).find("ul.lp-meta-box__course-tab__tabs li").eq(0).find("a").trigger("click")}))})).trigger("lp-metabox-course-tab-panels")},lpMetaboxCondition=()=>{document.querySelectorAll(".lp-meta-box .form-field").forEach(e=>{e.hasAttribute("data-show")&&e.dataset.show?lpMetaboxConditionType(e,e.dataset.show,"show"):e.hasAttribute("data-hide")&&e.dataset.hide&&lpMetaboxConditionType(e,e.dataset.hide,"hide")})},lpMetaboxConditionType=(e,t,a="show")=>{const s=JSON.parse(t),i=document.querySelectorAll(`input[id^="${s[0]}"]`),l="="===s[1]?"=":"!=",o=s[2],n=(t,s,i)=>{switch(t){case"checkbox":let t=o;"yes"===o||"1"===o||1===o||"true"===o?t=!0:"no"!==o&&"0"!==o&&0!==o&&"false"!==o||(t=!1),"!="==l&&t!==Boolean(i?i.checked:s.checked)||"="==l&&t==Boolean(i?i.checked:s.checked)?e.style.display="show"===a?"flex":"none":e.style.display="show"===a?"none":"flex"}};i.forEach(e=>{const t=e.getAttribute("type");n(t,e),e.addEventListener("change",a=>{const s=a.target;n(t,e,s)})})},initTooltips=function(){$(".learn-press-tooltip").each((function(){const e=$(this),t=$.extend({title:"data-tooltip",offset:10,gravity:"s"},e.data());e.tipsy(t)}))},initSelect2=function(){$.fn.select2&&$(".lp-select-2 select").select2()},initSingleCoursePermalink=function(){$doc.on("change",'.learn-press-single-course-permalink input[type="radio"]',(function(){const e=$(this).closest(".learn-press-single-course-permalink");e.hasClass("custom-base")?e.find('input[type="text"]').prop("readonly",!1):e.siblings(".custom-base").find('input[type="text"]').prop("readonly",!0)})).on("change","input.learn-press-course-base",(function(){$("#course_permalink_structure").val($(this).val())})).on("focus","#course_permalink_structure",(function(){$("#learn_press_custom_permalink").click()})).on("change","#learn_press_courses_page_id",(function(){$("tr.learn-press-courses-page-id").toggleClass("hide-if-js",!parseInt(this.value))}))},togglePaymentStatus=function(e){e.preventDefault();const t=$(this).closest("tr"),a=($(this),t.find(".status").hasClass("enabled")?"no":"yes");$.ajax({url:"",data:{"lp-ajax":"update-payment-status",status:a,id:t.data("payment")},success(e){e=LP.parseJSON(e);for(const t in e)$("#payment-"+t+" .status").toggleClass("enabled",e[t])}})},updateEmailStatus=function(){(function(){$.post({url:window.location.href,data:{"lp-ajax":"update_email_status",status:$(this).parent().hasClass("enabled")?"no":"yes",id:$(this).data("id")},dataType:"text",success:$.proxy((function(e){e=LP.parseJSON(e);for(const t in e)$("#email-"+t+" .status").toggleClass("enabled",e[t])}),this)})}).apply(this)},lpMetaboxsalePriceDate=()=>{if(!$("#course-settings").length)return;$(".lp_sale_dates_fields").each((function(){const e=$(this),t=e.closest("div.lp-meta-box-course-panels");let a=!1;e.find("input").each((function(){""!==$(this).val()&&(a=!0)})),a?(t.find(".lp_sale_price_schedule").hide(),t.find(".lp_sale_dates_fields").show()):(t.find(".lp_sale_price_schedule").show(),t.find(".lp_sale_dates_fields").hide())})),$(".lp-meta-box-course-panels").on("click",".lp_sale_price_schedule",(function(){const e=$(this).closest("div.lp-meta-box-course-panels");return $(this).hide(),e.find(".lp_cancel_sale_schedule").show(),e.find(".lp_sale_dates_fields").show(),!1})),$(".lp-meta-box-course-panels").on("click",".lp_cancel_sale_schedule",(function(){const e=$(this).closest("div.lp-meta-box-course-panels");return $(this).hide(),e.find(".lp_sale_price_schedule").show(),e.find(".lp_sale_dates_fields").hide(),e.find(".lp_sale_dates_fields").find("input").val(""),!1})),$(document).on("input","#price_course_data",(function(e){const t=$(this),a=$(".lp_meta_box_regular_price"),s=$(".lp_meta_box_sale_price"),i=$(e.target).attr("id");t.find(".learn-press-tip-floating").remove(),parseInt(s.val())>parseInt(a.val())&&("_lp_price"===i?a.parent(".form-field").append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_price+"</div>"):"_lp_sale_price"===i&&s.parent(".form-field").append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_sale_price+"</div>"))}));const e=function(e){const t=$(e).is("#_lp_sale_start")?"minDate":"maxDate",a=$("minDate"===t?"#_lp_sale_end":"#_lp_sale_start"),s=$(e).datetimepicker("getDate");$(a).datetimepicker("option",t,s),$(e).trigger("change")};$(".lp_sale_dates_fields").each((function(){$(this).find("input").datetimepicker({timeFormat:"HH:mm",separator:" ",dateFormat:"yy-mm-dd",showButtonPanel:!0,onSelect(){e($(this))}}),$(this).find("input").each((function(){e($(this))}))}))},lpHidePassingGrade=()=>{const e=["evaluate_final_quiz","evaluate_final_assignment"];[...document.querySelectorAll("input[type=radio][name=_lp_course_result]")].map((t,a)=>(t.checked&&e.includes(t.value)&&$("._lp_passing_condition_field").hide(),null)),$("input[type=radio][name=_lp_course_result]").on("change",(function(t){e.includes(t.target.value)?$("._lp_passing_condition_field").hide():$("._lp_passing_condition_field").show()}))},callbackFilterTemplates=function(){const e=$(this);if(e.hasClass("current"))return!1;const t=$("#learn-press-template-files"),a=t.find("tr[data-template]"),s=e.data("template"),i=e.data("filter");return e.addClass("current").siblings("a").removeClass("current"),s?a.map((function(){$(this).toggleClass("hide-if-js",$(this).data("template")!==s)})):i?a.map((function(){$(this).toggleClass("hide-if-js","yes"!==$(this).data("filter-"+i))})):a.removeClass("hide-if-js"),$("#learn-press-no-templates").toggleClass("hide-if-js",!!t.find("tr.template-row:not(.hide-if-js):first").length),!1},toggleEmails=function(e){e.preventDefault();const t=$(this).data("status");$.ajax({url:"",data:{"lp-ajax":"update_email_status",status:t},success(e){e=LP.parseJSON(e);for(const t in e)$("#email-"+t+" .status").toggleClass("enabled",e[t])}})},importCourses=function(){const t=$("#learn-press-install-sample-data-notice"),a=$(this).attr("data-action");a&&(e.preventDefault(),"yes"===a?t.find(".install-sample-data-notice").slideUp().siblings(".install-sample-data-loading").slideDown():t.fadeOut(),$.ajax({url:ajaxurl,dataType:"html",type:"post",data:{action:"learnpress_install_sample_data",yes:a},success(e){(e=LP.parseJSON(e)).url?$.ajax({url:e.url,success(){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()}}))},onReady=function(){$(".learn-press-payments.sortable tbody").sortable({handle:".dashicons-menu",helper:(e,t)=>(t.children().each((function(){$(this).width($(this).width())})),t),axis:"y",start(e,t){},stop(e,t){},update(e,t){const a=$(this).children().map((function(){return $(this).find('input[name="payment-order"]').val()})).get();$.post({url:"",data:{"lp-ajax":"update-payment-order",order:a},success(e){}})}}),$.fn.select2&&$(".lp-select-2 select").select2(),$(".learn-press-tooltip").each((function(){const e=$(this),t=$.extend({title:"data-tooltip",offset:10,gravity:"s"},e.data());e.tipsy(t)})),$doc.on("change",'.learn-press-single-course-permalink input[type="radio"]',(function(){const e=$(this).closest(".learn-press-single-course-permalink");e.hasClass("custom-base")?e.find('input[type="text"]').prop("readonly",!1):e.siblings(".custom-base").find('input[type="text"]').prop("readonly",!0)})).on("change","input.learn-press-course-base",(function(){$("#course_permalink_structure").val($(this).val())})).on("focus","#course_permalink_structure",(function(){$("#learn_press_custom_permalink").click()})).on("change","#learn_press_courses_page_id",(function(){$("tr.learn-press-courses-page-id").toggleClass("hide-if-js",!parseInt(this.value))})),lpMetaboxCourseTabs(),lpMetaboxCustomFields(),lpMetaboxColorPicker(),lpMetaboxImageAdvanced(),$(".lp-metabox-field__image").each((e,t)=>{let a;const s=$(t).find(".lp-metabox-field__image--add"),i=$(t).find(".lp-metabox-field__image--delete"),l=$(t).find(".lp-metabox-field__image--image"),o=$(t).find(".lp-metabox-field__image--id");o.val()?(s.hide(),i.show()):(s.show(),i.hide()),s.on("click",e=>{e.preventDefault(),a||(a=wp.media({title:s.data("choose"),button:{text:s.data("update")},multiple:!1}),a.on("select",(function(){const e=a.state().get("selection").first().toJSON(),t=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;l.append('<div class="lp-metabox-field__image--inner"><img src="'+t+'" alt="" style="max-width:100%;"/></div>'),o.val(e.id),s.hide(),i.show()}))),a.open()}),i.on("click",e=>{e.preventDefault(),l.html(""),s.show(),i.hide(),o.val("")})}),lpMetaboxsalePriceDate(),lpMetaboxExtraInfo(),lpHidePassingGrade(),lpGetFinalQuiz(),document.querySelectorAll(".lp-meta-box .form-field").forEach(e=>{e.hasAttribute("data-show")&&e.dataset.show?lpMetaboxConditionType(e,e.dataset.show,"show"):e.hasAttribute("data-hide")&&e.dataset.hide&&lpMetaboxConditionType(e,e.dataset.hide,"hide")}),$(document).on("click",".learn-press-payments .status .dashicons",togglePaymentStatus).on("click",".change-email-status",updateEmailStatus).on("click",".learn-press-filter-template",callbackFilterTemplates).on("click","#learn-press-enable-emails, #learn-press-disable-emails",toggleEmails).on("click","#learn-press-install-sample-data-notice a",importCourses)};$(document).ready(onReady);
1
+ const $=jQuery,$doc=$(document),$win=$(window),makePaymentsSortable=function(){$(".learn-press-payments.sortable tbody").sortable({handle:".dashicons-menu",helper:(e,t)=>(t.children().each((function(){$(this).width($(this).width())})),t),axis:"y",start(e,t){},stop(e,t){},update(e,t){const a=$(this).children().map((function(){return $(this).find('input[name="payment-order"]').val()})).get();$.post({url:"",data:{"lp-ajax":"update-payment-order",order:a},success(e){}})}})},lpMetaboxCustomFields=()=>{$(".lp-metabox__custom-fields").on("click",".lp-metabox-custom-field-button",(function(){const t=$(this).data("row").replace(/lp_metabox_custom_fields_key/gi,Math.floor(1e3*Math.random())+1);return $(this).closest("table").find("tbody").append(t),e($(this).closest(".lp-metabox__custom-fields")),!1})),$(".lp-metabox__custom-fields").on("click","a.delete",(function(){return $(this).closest("tr").remove(),e($(this).closest(".lp-metabox__custom-fields")),!1})),$(".lp-metabox__custom-fields tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,update(t,a){e($(this).closest(".lp-metabox__custom-fields"))}});const e=e=>{e.find("tbody tr").each((function(e,t){$(this).find(".sort .count").val(e)}))}},lpMetaboxRepeaterField=()=>{const e=e=>{e.find(".lp_repeater_meta_box__field").each((function(e,t){$(this).find(".lp_repeater_meta_box__field__count").val(e),$(this).find(".lp_repeater_meta_box__title__title > span").text(e+1)}))};$(".lp_repeater_meta_box__add").on("click",(function(){const t=$(this).data("add").replace(/lp_metabox_repeater_key/gi,Math.floor(1e3*Math.random())+1);return $(this).closest(".lp_repeater_meta_box__wrapper").find(".lp_repeater_meta_box__fields").append(t),e($(this).closest(".lp_repeater_meta_box__wrapper")),$(this).closest(".lp_repeater_meta_box__wrapper").find(".lp_repeater_meta_box__fields").last().find("input").trigger("focus"),!1})),$(".lp_repeater_meta_box__wrapper").on("click","a.lp_repeater_meta_box__title__delete",(function(){return $(this).closest(".lp_repeater_meta_box__field").remove(),e($(this).closest(".lp_repeater_meta_box__wrapper")),!1})),$(".lp_repeater_meta_box__fields").on("click",".lp_repeater_meta_box__title__toggle, .lp_repeater_meta_box__title__title",(function(){const e=$(this).closest(".lp_repeater_meta_box__field");return e.hasClass("lp_repeater_meta_box__field_active")?e.removeClass("lp_repeater_meta_box__field_active"):e.addClass("lp_repeater_meta_box__field_active"),!1})),$(".lp_repeater_meta_box__fields").sortable({items:".lp_repeater_meta_box__field",cursor:"grab",axis:"y",handle:".lp_repeater_meta_box__title__sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,update(t,a){e($(this).closest(".lp_repeater_meta_box__wrapper"))}})},lpMetaboxExtraInfo=()=>{$(".lp_course_extra_meta_box__add").on("click",(function(){return $(this).closest(".lp_course_extra_meta_box__content").find(".lp_course_extra_meta_box__fields").append($(this).data("add")),$(this).closest(".lp_course_extra_meta_box__content").find(".lp_course_extra_meta_box__field").last().find("input").trigger("focus"),!1})),document.querySelectorAll(".lp_course_extra_meta_box__fields").forEach(e=>{e.addEventListener("keydown",t=>{const a=e.querySelectorAll(".lp_course_extra_meta_box__input");if(13===t.keyCode)return t.preventDefault(),a.forEach(e=>{e.blur()}),!1})}),$(".lp_course_extra_meta_box__fields").on("click","a.delete",(function(){return $(this).closest(".lp_course_extra_meta_box__field").remove(),!1})),$(".lp_course_extra_meta_box__fields").sortable({items:".lp_course_extra_meta_box__field",cursor:"grab",axis:"y",handle:".sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65}),$(".lp_course_faq_meta_box__add").on("click",(function(){return $(this).closest(".lp_course_faq_meta_box__content").find(".lp_course_faq_meta_box__fields").append($(this).data("add")),!1})),document.querySelectorAll(".lp_course_faq_meta_box__fields").forEach(e=>{e.addEventListener("keydown",t=>{const a=e.querySelectorAll(".lp_course_faq_meta_box__field input"),s=e.querySelectorAll(".lp_course_faq_meta_box__field textarea");if(13===t.keyCode)return t.preventDefault(),[...a,...s].forEach(e=>{e.blur()}),!1})}),$(".lp_course_faq_meta_box__fields").on("click","a.delete",(function(){return $(this).closest(".lp_course_faq_meta_box__field").remove(),!1})),$(".lp_course_faq_meta_box__fields").sortable({items:".lp_course_faq_meta_box__field",cursor:"grab",axis:"y",handle:".sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65})},lpGetFinalQuiz=()=>{[...document.querySelectorAll(".lp-metabox-get-final-quiz")].map(t=>{t.addEventListener("click",a=>{a.preventDefault();const s=t.textContent,l=t.dataset.loading,i=document.querySelector(".lp-metabox-evaluate-final_quiz");i&&i.remove(),t.textContent=l,e(t).then(e=>{const{message:a,data:l}=e;t.textContent=s;const i=document.createElement("div");i.className="lp-metabox-evaluate-final_quiz",i.innerHTML=l||a,t.parentNode.insertBefore(i,t.nextSibling)})})});const e=async e=>{if(!lpGlobalSettings.root)return;return await wp.apiFetch({path:"lp/v1/admin/course/get_final_quiz",method:"POST",data:{courseId:e.dataset.postid||""}})}},lpMetaboxColorPicker=()=>{$(".lp-metabox__colorpick").iris({change(e,t){$(this).parent().find(".colorpickpreview").css({backgroundColor:t.color.toString()})},hide:!0,border:!0}).on("click focus",(function(e){e.stopPropagation(),$(".iris-picker").hide(),$(this).closest("td").find(".iris-picker").show(),$(this).data("original-value",$(this).val())})).on("change",(function(){if($(this).is(".iris-error")){$(this).data("original-value").match(/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)?$(this).val($(this).data("original-value")).trigger("change"):$(this).val("").trigger("change")}})),$("body").on("click",(function(){$(".iris-picker").hide()}))},lpMetaboxImage=()=>{$(".lp-metabox-field__image").each((e,t)=>{let a;const s=$(t).find(".lp-metabox-field__image--add"),l=$(t).find(".lp-metabox-field__image--delete"),i=$(t).find(".lp-metabox-field__image--image"),o=$(t).find(".lp-metabox-field__image--id");o.val()?(s.hide(),l.show()):(s.show(),l.hide()),s.on("click",e=>{e.preventDefault(),a||(a=wp.media({title:s.data("choose"),button:{text:s.data("update")},multiple:!1}),a.on("select",(function(){const e=a.state().get("selection").first().toJSON(),t=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;i.append('<div class="lp-metabox-field__image--inner"><img src="'+t+'" alt="" style="max-width:100%;"/></div>'),o.val(e.id),s.hide(),l.show()}))),a.open()}),l.on("click",e=>{e.preventDefault(),i.html(""),s.show(),l.hide(),o.val("")})})},lpMetaboxImageAdvanced=()=>{$(".lp-metabox-field__image-advanced").each((e,t)=>{let a;const s=$(t).find("#lp-gallery-images-ids"),l=$(t).find(".lp-metabox-field__image-advanced-images"),i=$(t).find(".lp-metabox-field__image-advanced-upload > a");$(i).on("click",e=>{e.preventDefault(),a||(a=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]}),a.on("select",(function(){const e=a.state().get("selection");let t=s.val();e.forEach((function(e){if((e=e.toJSON()).id){t=t?t+","+e.id:e.id;const a=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;l.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+a+'" /><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">'+i.data("text")+"</a></li></ul></li>")}})),s.val(t)}))),a.open()}),l.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"lp-metabox-sortable-placeholder",start(e,t){t.item.css("background-color","#f6f6f6")},stop(e,t){t.item.removeAttr("style")},update(){let e="";l.find("li.image").css("cursor","default").each((function(){const t=$(this).attr("data-attachment_id");e=e+t+","})),s.val(e)}}),$(l).find("li.image").each((e,t)=>{$(t).find("a.delete").on("click",()=>{$(t).remove();let e="";return $(l).find("li.image").css("cursor","default").each((function(){const t=$(this).attr("data-attachment_id");e=e+t+","})),s.val(e),!1})})})},lpMetaboxCourseTabs=()=>{$(document.body).on("lp-metabox-course-tab-panels",(function(){$("ul.lp-meta-box__course-tab__tabs").show(),$("ul.lp-meta-box__course-tab__tabs a").on("click",(function(e){e.preventDefault();const t=$(this).closest("div.lp-meta-box__course-tab");$("ul.lp-meta-box__course-tab__tabs li",t).removeClass("active"),$(this).parent().addClass("active"),$("div.lp-meta-box-course-panels",t).hide(),$($(this).attr("href")).show()})),$("div.lp-meta-box__course-tab").each((function(){$(this).find("ul.lp-meta-box__course-tab__tabs li").eq(0).find("a").trigger("click")}))})).trigger("lp-metabox-course-tab-panels")},lpMetaboxCondition=()=>{document.querySelectorAll(".lp-meta-box .form-field").forEach(e=>{e.hasAttribute("data-show")&&e.dataset.show?lpMetaboxConditionType(e,e.dataset.show,"show"):e.hasAttribute("data-hide")&&e.dataset.hide&&lpMetaboxConditionType(e,e.dataset.hide,"hide")})},lpMetaboxConditionType=(e,t,a="show")=>{const s=JSON.parse(t),l=document.querySelectorAll(`input[id^="${s[0]}"]`),i="="===s[1]?"=":"!=",o=s[2],n=(t,s,l)=>{switch(t){case"checkbox":let t=o;"yes"===o||"1"===o||1===o||"true"===o?t=!0:"no"!==o&&"0"!==o&&0!==o&&"false"!==o||(t=!1),"!="==i&&t!==Boolean(l?l.checked:s.checked)||"="==i&&t==Boolean(l?l.checked:s.checked)?e.style.display="show"===a?"flex":"none":e.style.display="show"===a?"none":"flex"}};l.forEach(e=>{const t=e.getAttribute("type");n(t,e),e.addEventListener("change",a=>{const s=a.target;n(t,e,s)})})},initTooltips=function(){$(".learn-press-tooltip").each((function(){const e=$(this),t=$.extend({title:"data-tooltip",offset:10,gravity:"s"},e.data());e.tipsy(t)}))},initSelect2=function(){$.fn.select2&&$(".lp-select-2 select").select2()},initSingleCoursePermalink=function(){$doc.on("change",'.learn-press-single-course-permalink input[type="radio"]',(function(){const e=$(this).closest(".learn-press-single-course-permalink");e.hasClass("custom-base")?e.find('input[type="text"]').prop("readonly",!1):e.siblings(".custom-base").find('input[type="text"]').prop("readonly",!0)})).on("change","input.learn-press-course-base",(function(){$("#course_permalink_structure").val($(this).val())})).on("focus","#course_permalink_structure",(function(){$("#learn_press_custom_permalink").click()})).on("change","#learn_press_courses_page_id",(function(){$("tr.learn-press-courses-page-id").toggleClass("hide-if-js",!parseInt(this.value))}))},togglePaymentStatus=function(e){e.preventDefault();const t=$(this).closest("tr"),a=($(this),t.find(".status").hasClass("enabled")?"no":"yes");$.ajax({url:"",data:{"lp-ajax":"update-payment-status",status:a,id:t.data("payment")},success(e){e=LP.parseJSON(e);for(const t in e)$("#payment-"+t+" .status").toggleClass("enabled",e[t])}})},updateEmailStatus=function(){(function(){$.post({url:window.location.href,data:{"lp-ajax":"update_email_status",status:$(this).parent().hasClass("enabled")?"no":"yes",id:$(this).data("id")},dataType:"text",success:$.proxy((function(e){e=LP.parseJSON(e);for(const t in e)$("#email-"+t+" .status").toggleClass("enabled",e[t])}),this)})}).apply(this)},lpMetaboxsalePriceDate=()=>{if(!$("#course-settings").length)return;$(".lp_sale_dates_fields").each((function(){const e=$(this),t=e.closest("div.lp-meta-box-course-panels");let a=!1;e.find("input").each((function(){""!==$(this).val()&&(a=!0)})),a?(t.find(".lp_sale_price_schedule").hide(),t.find(".lp_sale_dates_fields").show()):(t.find(".lp_sale_price_schedule").show(),t.find(".lp_sale_dates_fields").hide())})),$(".lp-meta-box-course-panels").on("click",".lp_sale_price_schedule",(function(){const e=$(this).closest("div.lp-meta-box-course-panels");return $(this).hide(),e.find(".lp_cancel_sale_schedule").show(),e.find(".lp_sale_dates_fields").show(),!1})),$(".lp-meta-box-course-panels").on("click",".lp_cancel_sale_schedule",(function(){const e=$(this).closest("div.lp-meta-box-course-panels");return $(this).hide(),e.find(".lp_sale_price_schedule").show(),e.find(".lp_sale_dates_fields").hide(),e.find(".lp_sale_dates_fields").find("input").val(""),!1})),$(document).on("input","#price_course_data",(function(e){const t=$(this),a=$(".lp_meta_box_regular_price"),s=$(".lp_meta_box_sale_price"),l=$(e.target).attr("id");t.find(".learn-press-tip-floating").remove(),parseInt(s.val())>parseInt(a.val())&&("_lp_price"===l?a.parent(".form-field").append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_price+"</div>"):"_lp_sale_price"===l&&s.parent(".form-field").append('<div class="learn-press-tip-floating">'+lpAdminCourseEditorSettings.i18n.notice_sale_price+"</div>"))}));const e=function(e){const t=$(e).is("#_lp_sale_start")?"minDate":"maxDate",a=$("minDate"===t?"#_lp_sale_end":"#_lp_sale_start"),s=$(e).datetimepicker("getDate");$(a).datetimepicker("option",t,s),$(e).trigger("change")};$(".lp_sale_dates_fields").each((function(){$(this).find("input").datetimepicker({timeFormat:"HH:mm",separator:" ",dateFormat:"yy-mm-dd",showButtonPanel:!0,onSelect(){e($(this))}}),$(this).find("input").each((function(){e($(this))}))}))},lpHidePassingGrade=()=>{const e=["evaluate_final_quiz","evaluate_final_assignment"];[...document.querySelectorAll("input[type=radio][name=_lp_course_result]")].map((t,a)=>(t.checked&&e.includes(t.value)&&$("._lp_passing_condition_field").hide(),null)),$("input[type=radio][name=_lp_course_result]").on("change",(function(t){e.includes(t.target.value)?$("._lp_passing_condition_field").hide():$("._lp_passing_condition_field").show()}))},callbackFilterTemplates=function(){const e=$(this);if(e.hasClass("current"))return!1;const t=$("#learn-press-template-files"),a=t.find("tr[data-template]"),s=e.data("template"),l=e.data("filter");return e.addClass("current").siblings("a").removeClass("current"),s?a.map((function(){$(this).toggleClass("hide-if-js",$(this).data("template")!==s)})):l?a.map((function(){$(this).toggleClass("hide-if-js","yes"!==$(this).data("filter-"+l))})):a.removeClass("hide-if-js"),$("#learn-press-no-templates").toggleClass("hide-if-js",!!t.find("tr.template-row:not(.hide-if-js):first").length),!1},toggleEmails=function(e){e.preventDefault();const t=$(this).data("status");$.ajax({url:"",data:{"lp-ajax":"update_email_status",status:t},success(e){e=LP.parseJSON(e);for(const t in e)$("#email-"+t+" .status").toggleClass("enabled",e[t])}})},importCourses=function(){const t=$("#learn-press-install-sample-data-notice"),a=$(this).attr("data-action");a&&(e.preventDefault(),"yes"===a?t.find(".install-sample-data-notice").slideUp().siblings(".install-sample-data-loading").slideDown():t.fadeOut(),$.ajax({url:ajaxurl,dataType:"html",type:"post",data:{action:"learnpress_install_sample_data",yes:a},success(e){(e=LP.parseJSON(e)).url?$.ajax({url:e.url,success(){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()}}))},onReady=function(){$(".learn-press-payments.sortable tbody").sortable({handle:".dashicons-menu",helper:(e,t)=>(t.children().each((function(){$(this).width($(this).width())})),t),axis:"y",start(e,t){},stop(e,t){},update(e,t){const a=$(this).children().map((function(){return $(this).find('input[name="payment-order"]').val()})).get();$.post({url:"",data:{"lp-ajax":"update-payment-order",order:a},success(e){}})}}),$.fn.select2&&$(".lp-select-2 select").select2(),$(".learn-press-tooltip").each((function(){const e=$(this),t=$.extend({title:"data-tooltip",offset:10,gravity:"s"},e.data());e.tipsy(t)})),$doc.on("change",'.learn-press-single-course-permalink input[type="radio"]',(function(){const e=$(this).closest(".learn-press-single-course-permalink");e.hasClass("custom-base")?e.find('input[type="text"]').prop("readonly",!1):e.siblings(".custom-base").find('input[type="text"]').prop("readonly",!0)})).on("change","input.learn-press-course-base",(function(){$("#course_permalink_structure").val($(this).val())})).on("focus","#course_permalink_structure",(function(){$("#learn_press_custom_permalink").click()})).on("change","#learn_press_courses_page_id",(function(){$("tr.learn-press-courses-page-id").toggleClass("hide-if-js",!parseInt(this.value))})),lpMetaboxCourseTabs(),lpMetaboxCustomFields(),lpMetaboxColorPicker(),lpMetaboxImageAdvanced(),$(".lp-metabox-field__image").each((e,t)=>{let a;const s=$(t).find(".lp-metabox-field__image--add"),l=$(t).find(".lp-metabox-field__image--delete"),i=$(t).find(".lp-metabox-field__image--image"),o=$(t).find(".lp-metabox-field__image--id");o.val()?(s.hide(),l.show()):(s.show(),l.hide()),s.on("click",e=>{e.preventDefault(),a||(a=wp.media({title:s.data("choose"),button:{text:s.data("update")},multiple:!1}),a.on("select",(function(){const e=a.state().get("selection").first().toJSON(),t=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;i.append('<div class="lp-metabox-field__image--inner"><img src="'+t+'" alt="" style="max-width:100%;"/></div>'),o.val(e.id),s.hide(),l.show()}))),a.open()}),l.on("click",e=>{e.preventDefault(),i.html(""),s.show(),l.hide(),o.val("")})}),lpMetaboxsalePriceDate(),lpMetaboxExtraInfo(),lpHidePassingGrade(),lpGetFinalQuiz(),document.querySelectorAll(".lp-meta-box .form-field").forEach(e=>{e.hasAttribute("data-show")&&e.dataset.show?lpMetaboxConditionType(e,e.dataset.show,"show"):e.hasAttribute("data-hide")&&e.dataset.hide&&lpMetaboxConditionType(e,e.dataset.hide,"hide")}),lpMetaboxRepeaterField(),$(document).on("click",".learn-press-payments .status .dashicons",togglePaymentStatus).on("click",".change-email-status",updateEmailStatus).on("click",".learn-press-filter-template",callbackFilterTemplates).on("click","#learn-press-enable-emails, #learn-press-disable-emails",toggleEmails).on("click","#learn-press-install-sample-data-notice a",importCourses)};$(document).ready(onReady);
assets/js/dist/admin/editor/course.js CHANGED
@@ -81,15 +81,15 @@
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
- /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/course.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/course-section.js":
90
- /*!**********************************************************************************************************************************************!*\
91
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/course-section.js ***!
92
- \**********************************************************************************************************************************************/
93
  /*! exports provided: default */
94
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
 
@@ -274,10 +274,10 @@ var CourseCurriculum = {
274
 
275
  /***/ }),
276
 
277
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/course.js":
278
- /*!**************************************************************************************************************************************!*\
279
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/course.js ***!
280
- \**************************************************************************************************************************************/
281
  /*! exports provided: default */
282
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
283
 
@@ -333,10 +333,10 @@ var Course = {
333
 
334
  /***/ }),
335
 
336
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/modal-course-items.js":
337
- /*!**************************************************************************************************************************************************!*\
338
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/modal-course-items.js ***!
339
- \**************************************************************************************************************************************************/
340
  /*! exports provided: default */
341
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
342
 
@@ -412,17 +412,17 @@ var ModalCourseItems = {
412
 
413
  /***/ }),
414
 
415
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/course.js":
416
- /*!******************************************************************************************************************************!*\
417
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/course.js ***!
418
- \******************************************************************************************************************************/
419
  /*! no exports provided */
420
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
421
 
422
  "use strict";
423
  __webpack_require__.r(__webpack_exports__);
424
- /* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js");
425
- /* harmony import */ var _store_course__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/course.js");
426
 
427
 
428
  window.$Vue = window.$Vue || Vue;
@@ -450,10 +450,10 @@ $(document).ready(function () {
450
 
451
  /***/ }),
452
 
453
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/course-section.js":
454
- /*!**********************************************************************************************************************************************!*\
455
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/course-section.js ***!
456
- \**********************************************************************************************************************************************/
457
  /*! exports provided: default */
458
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
459
 
@@ -489,10 +489,10 @@ var CourseCurriculum = {
489
 
490
  /***/ }),
491
 
492
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/course.js":
493
- /*!**************************************************************************************************************************************!*\
494
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/course.js ***!
495
- \**************************************************************************************************************************************/
496
  /*! exports provided: default */
497
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
498
 
@@ -531,10 +531,10 @@ var Course = {
531
 
532
  /***/ }),
533
 
534
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/modal-course-items.js":
535
- /*!**************************************************************************************************************************************************!*\
536
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/modal-course-items.js ***!
537
- \**************************************************************************************************************************************************/
538
  /*! exports provided: default */
539
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
540
 
@@ -574,10 +574,10 @@ var Getters = {
574
 
575
  /***/ }),
576
 
577
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js":
578
- /*!****************************************************************************************************************************!*\
579
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js ***!
580
- \****************************************************************************************************************************/
581
  /*! exports provided: default */
582
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
583
 
@@ -644,10 +644,10 @@ function HTTP(options) {
644
 
645
  /***/ }),
646
 
647
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/course-section.js":
648
- /*!************************************************************************************************************************************************!*\
649
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/course-section.js ***!
650
- \************************************************************************************************************************************************/
651
  /*! exports provided: default */
652
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
653
 
@@ -817,10 +817,10 @@ var CourseCurriculum = {
817
 
818
  /***/ }),
819
 
820
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/course.js":
821
- /*!****************************************************************************************************************************************!*\
822
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/course.js ***!
823
- \****************************************************************************************************************************************/
824
  /*! exports provided: default */
825
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
826
 
@@ -847,10 +847,10 @@ var Course = {
847
 
848
  /***/ }),
849
 
850
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/modal-course-items.js":
851
- /*!****************************************************************************************************************************************************!*\
852
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/modal-course-items.js ***!
853
- \****************************************************************************************************************************************************/
854
  /*! exports provided: default */
855
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
856
 
@@ -897,18 +897,18 @@ var Mutations = {
897
 
898
  /***/ }),
899
 
900
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/course-section.js":
901
- /*!********************************************************************************************************************************************!*\
902
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/course-section.js ***!
903
- \********************************************************************************************************************************************/
904
  /*! exports provided: default */
905
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
906
 
907
  "use strict";
908
  __webpack_require__.r(__webpack_exports__);
909
- /* harmony import */ var _actions_course_section__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actions/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/course-section.js");
910
- /* harmony import */ var _mutations_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/course-section.js");
911
- /* harmony import */ var _getters_course_section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getters/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/course-section.js");
912
 
913
 
914
 
@@ -936,21 +936,21 @@ var $ = window.jQuery;
936
 
937
  /***/ }),
938
 
939
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/course.js":
940
- /*!************************************************************************************************************************************!*\
941
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/course.js ***!
942
- \************************************************************************************************************************************/
943
  /*! exports provided: default */
944
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
945
 
946
  "use strict";
947
  __webpack_require__.r(__webpack_exports__);
948
- /* harmony import */ var _store_modal_course_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../store/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/modal-course-items.js");
949
- /* harmony import */ var _store_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../store/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/course-section.js");
950
- /* harmony import */ var _store_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store/i18n */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/i18n.js");
951
- /* harmony import */ var _getters_course__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getters/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/course.js");
952
- /* harmony import */ var _mutations_course__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../mutations/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/course.js");
953
- /* harmony import */ var _actions_course__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../actions/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/course.js");
954
 
955
 
956
 
@@ -981,10 +981,10 @@ var Course = function Course(data) {
981
 
982
  /***/ }),
983
 
984
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/i18n.js":
985
- /*!**********************************************************************************************************************************!*\
986
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/i18n.js ***!
987
- \**********************************************************************************************************************************/
988
  /*! exports provided: default */
989
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
990
 
@@ -1010,18 +1010,18 @@ var i18n = function i18n(i18n) {
1010
 
1011
  /***/ }),
1012
 
1013
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/modal-course-items.js":
1014
- /*!************************************************************************************************************************************************!*\
1015
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/modal-course-items.js ***!
1016
- \************************************************************************************************************************************************/
1017
  /*! exports provided: default */
1018
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1019
 
1020
  "use strict";
1021
  __webpack_require__.r(__webpack_exports__);
1022
- /* harmony import */ var _getters_modal_course_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/modal-course-items.js");
1023
- /* harmony import */ var _mutations_modal_course_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/modal-course-items.js");
1024
- /* harmony import */ var _actions_modal_course_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/modal-course-items.js");
1025
 
1026
 
1027
 
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
+ /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/course.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/course-section.js":
90
+ /*!****************************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/course-section.js ***!
92
+ \****************************************************************************************************************************************************/
93
  /*! exports provided: default */
94
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
 
274
 
275
  /***/ }),
276
 
277
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/course.js":
278
+ /*!********************************************************************************************************************************************!*\
279
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/course.js ***!
280
+ \********************************************************************************************************************************************/
281
  /*! exports provided: default */
282
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
283
 
333
 
334
  /***/ }),
335
 
336
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/modal-course-items.js":
337
+ /*!********************************************************************************************************************************************************!*\
338
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/modal-course-items.js ***!
339
+ \********************************************************************************************************************************************************/
340
  /*! exports provided: default */
341
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
342
 
412
 
413
  /***/ }),
414
 
415
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/course.js":
416
+ /*!************************************************************************************************************************************!*\
417
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/course.js ***!
418
+ \************************************************************************************************************************************/
419
  /*! no exports provided */
420
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
421
 
422
  "use strict";
423
  __webpack_require__.r(__webpack_exports__);
424
+ /* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js");
425
+ /* harmony import */ var _store_course__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/course.js");
426
 
427
 
428
  window.$Vue = window.$Vue || Vue;
450
 
451
  /***/ }),
452
 
453
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/course-section.js":
454
+ /*!****************************************************************************************************************************************************!*\
455
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/course-section.js ***!
456
+ \****************************************************************************************************************************************************/
457
  /*! exports provided: default */
458
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
459
 
489
 
490
  /***/ }),
491
 
492
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/course.js":
493
+ /*!********************************************************************************************************************************************!*\
494
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/course.js ***!
495
+ \********************************************************************************************************************************************/
496
  /*! exports provided: default */
497
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
498
 
531
 
532
  /***/ }),
533
 
534
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/modal-course-items.js":
535
+ /*!********************************************************************************************************************************************************!*\
536
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/modal-course-items.js ***!
537
+ \********************************************************************************************************************************************************/
538
  /*! exports provided: default */
539
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
540
 
574
 
575
  /***/ }),
576
 
577
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js":
578
+ /*!**********************************************************************************************************************************!*\
579
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js ***!
580
+ \**********************************************************************************************************************************/
581
  /*! exports provided: default */
582
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
583
 
644
 
645
  /***/ }),
646
 
647
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/course-section.js":
648
+ /*!******************************************************************************************************************************************************!*\
649
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/course-section.js ***!
650
+ \******************************************************************************************************************************************************/
651
  /*! exports provided: default */
652
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
653
 
817
 
818
  /***/ }),
819
 
820
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/course.js":
821
+ /*!**********************************************************************************************************************************************!*\
822
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/course.js ***!
823
+ \**********************************************************************************************************************************************/
824
  /*! exports provided: default */
825
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
826
 
847
 
848
  /***/ }),
849
 
850
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/modal-course-items.js":
851
+ /*!**********************************************************************************************************************************************************!*\
852
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/modal-course-items.js ***!
853
+ \**********************************************************************************************************************************************************/
854
  /*! exports provided: default */
855
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
856
 
897
 
898
  /***/ }),
899
 
900
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/course-section.js":
901
+ /*!**************************************************************************************************************************************************!*\
902
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/course-section.js ***!
903
+ \**************************************************************************************************************************************************/
904
  /*! exports provided: default */
905
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
906
 
907
  "use strict";
908
  __webpack_require__.r(__webpack_exports__);
909
+ /* harmony import */ var _actions_course_section__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actions/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/course-section.js");
910
+ /* harmony import */ var _mutations_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/course-section.js");
911
+ /* harmony import */ var _getters_course_section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getters/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/course-section.js");
912
 
913
 
914
 
936
 
937
  /***/ }),
938
 
939
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/course.js":
940
+ /*!******************************************************************************************************************************************!*\
941
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/course.js ***!
942
+ \******************************************************************************************************************************************/
943
  /*! exports provided: default */
944
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
945
 
946
  "use strict";
947
  __webpack_require__.r(__webpack_exports__);
948
+ /* harmony import */ var _store_modal_course_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../store/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/modal-course-items.js");
949
+ /* harmony import */ var _store_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../store/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/course-section.js");
950
+ /* harmony import */ var _store_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store/i18n */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/i18n.js");
951
+ /* harmony import */ var _getters_course__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getters/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/course.js");
952
+ /* harmony import */ var _mutations_course__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../mutations/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/course.js");
953
+ /* harmony import */ var _actions_course__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../actions/course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/course.js");
954
 
955
 
956
 
981
 
982
  /***/ }),
983
 
984
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/i18n.js":
985
+ /*!****************************************************************************************************************************************!*\
986
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/i18n.js ***!
987
+ \****************************************************************************************************************************************/
988
  /*! exports provided: default */
989
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
990
 
1010
 
1011
  /***/ }),
1012
 
1013
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/modal-course-items.js":
1014
+ /*!******************************************************************************************************************************************************!*\
1015
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/modal-course-items.js ***!
1016
+ \******************************************************************************************************************************************************/
1017
  /*! exports provided: default */
1018
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1019
 
1020
  "use strict";
1021
  __webpack_require__.r(__webpack_exports__);
1022
+ /* harmony import */ var _getters_modal_course_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/modal-course-items.js");
1023
+ /* harmony import */ var _mutations_modal_course_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/modal-course-items.js");
1024
+ /* harmony import */ var _actions_modal_course_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/modal-course-items.js");
1025
 
1026
 
1027
 
assets/js/dist/admin/editor/course.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}({0:function(t,e,n){"use strict";function i(t){var e=window.jQuery||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){e.params.namespace===t.ns?(t.store.dispatch("newRequest"),n((function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success||!1?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"))}))):n()}))}n.d(e,"a",(function(){return i}))},1:function(t,e,n){"use strict";var i=window.jQuery||jQuery;e.a=function(t){return{namespaced:!0,state:i.extend({},t),getters:{all:function(t){return t}}}}},9:function(t,e,n){"use strict";n.r(e);var i=n(0),o={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(t){return t.sectionId}},s={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"}},c={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)}))}},u=window.jQuery||jQuery,r=function(t){var e=u.extend({},t.chooseItems);return e.sectionId=!1,e.pagination="",e.status="",{namespaced:!0,state:e,getters:o,mutations:s,actions:c}},d=window.jQuery||jQuery,a={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.data;t.commit("SORT_SECTION",n)}),(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=d.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={};d.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){var n=t.state;LP.Request({type:"update-section-items",section_id:e.section_id,items:JSON.stringify(e.items),last_section:n.sections[n.sections.length-1]===e.section_id}).then((function(t){t.body.success}),(function(t){console.error(t)}))}},E={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){var n;void 0===e.open&&(e.open=!0),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})).items||[],i=e.item,o=-1;n.forEach((function(t,e){t.id===i.id&&(o=e)})),-1!==o&&(i.temp_id?n[o].id=i.temp_id:n.splice(o,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)}}},m={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}},f=window.jQuery,_=function(t){var e=f.extend({},t.sections);return e.statusUpdateSection={},e.statusUpdateSectionItem={},e.sections=e.sections.map((function(t){var n=e.hidden_sections.find((function(e){return parseInt(t.id)===parseInt(e)}));return t.open=!n,t})),{namespaced:!0,state:e,getters:m,mutations:E,actions:a}},S=n(1),T={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}},p={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--}},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)}},l=window.jQuery,O=function(t){var e=l.extend({},t.root);return e.status="success",e.heartbeat=!0,e.countCurrentRequest=0,{state:e,getters:T,mutations:p,actions:I,modules:{ci:r(t),i18n:Object(S.a)(t.i18n),ss:_(t)}}};window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,(0,window.jQuery)(document).ready((function(){window.LP_Curriculum_Store=new $Vuex.Store(O(lpAdminCourseEditorSettings)),Object(i.a)({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)}))}});
1
+ !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}({0:function(t,e,n){"use strict";function i(t){var e=window.jQuery||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){e.params.namespace===t.ns?(t.store.dispatch("newRequest"),n((function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success||!1?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"))}))):n()}))}n.d(e,"a",(function(){return i}))},1:function(t,e,n){"use strict";var i=window.jQuery||jQuery;e.a=function(t){return{namespaced:!0,state:i.extend({},t),getters:{all:function(t){return t}}}}},11:function(t,e,n){"use strict";n.r(e);var i=n(0),o={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(t){return t.sectionId}},s={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"}},c={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)}))}},u=window.jQuery||jQuery,r=function(t){var e=u.extend({},t.chooseItems);return e.sectionId=!1,e.pagination="",e.status="",{namespaced:!0,state:e,getters:o,mutations:s,actions:c}},d=window.jQuery||jQuery,a={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.data;t.commit("SORT_SECTION",n)}),(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=d.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={};d.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){var n=t.state;LP.Request({type:"update-section-items",section_id:e.section_id,items:JSON.stringify(e.items),last_section:n.sections[n.sections.length-1]===e.section_id}).then((function(t){t.body.success}),(function(t){console.error(t)}))}},E={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){var n;void 0===e.open&&(e.open=!0),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})).items||[],i=e.item,o=-1;n.forEach((function(t,e){t.id===i.id&&(o=e)})),-1!==o&&(i.temp_id?n[o].id=i.temp_id:n.splice(o,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)}}},m={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}},f=window.jQuery,_=function(t){var e=f.extend({},t.sections);return e.statusUpdateSection={},e.statusUpdateSectionItem={},e.sections=e.sections.map((function(t){var n=e.hidden_sections.find((function(e){return parseInt(t.id)===parseInt(e)}));return t.open=!n,t})),{namespaced:!0,state:e,getters:m,mutations:E,actions:a}},S=n(1),T={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}},p={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--}},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)}},l=window.jQuery,O=function(t){var e=l.extend({},t.root);return e.status="success",e.heartbeat=!0,e.countCurrentRequest=0,{state:e,getters:T,mutations:p,actions:I,modules:{ci:r(t),i18n:Object(S.a)(t.i18n),ss:_(t)}}};window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,(0,window.jQuery)(document).ready((function(){window.LP_Curriculum_Store=new $Vuex.Store(O(lpAdminCourseEditorSettings)),Object(i.a)({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)}))}});
assets/js/dist/admin/editor/question.js CHANGED
@@ -81,15 +81,15 @@
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
- /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/question.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/question.js":
90
- /*!****************************************************************************************************************************************!*\
91
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/question.js ***!
92
- \****************************************************************************************************************************************/
93
  /*! exports provided: default */
94
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
 
@@ -193,10 +193,10 @@ var Question = {
193
 
194
  /***/ }),
195
 
196
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js":
197
- /*!**************************************************************************************************************************************!*\
198
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js ***!
199
- \**************************************************************************************************************************************/
200
  /*! no static exports found */
201
  /***/ (function(module, exports) {
202
 
@@ -274,10 +274,10 @@ var Question = {
274
 
275
  /***/ }),
276
 
277
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/question.js":
278
- /*!****************************************************************************************************************************************!*\
279
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/question.js ***!
280
- \****************************************************************************************************************************************/
281
  /*! exports provided: default */
282
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
283
 
@@ -343,10 +343,10 @@ var Question = {
343
 
344
  /***/ }),
345
 
346
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js":
347
- /*!****************************************************************************************************************************!*\
348
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js ***!
349
- \****************************************************************************************************************************/
350
  /*! exports provided: default */
351
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
352
 
@@ -413,10 +413,10 @@ function HTTP(options) {
413
 
414
  /***/ }),
415
 
416
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/question.js":
417
- /*!******************************************************************************************************************************************!*\
418
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/question.js ***!
419
- \******************************************************************************************************************************************/
420
  /*! exports provided: default */
421
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
422
 
@@ -461,18 +461,18 @@ var Question = {
461
 
462
  /***/ }),
463
 
464
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/question.js":
465
- /*!********************************************************************************************************************************!*\
466
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/question.js ***!
467
- \********************************************************************************************************************************/
468
  /*! no exports provided */
469
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
470
 
471
  "use strict";
472
  __webpack_require__.r(__webpack_exports__);
473
- /* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js");
474
- /* harmony import */ var _store_question__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/question.js");
475
- /* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js");
476
  /* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__);
477
 
478
 
@@ -504,18 +504,18 @@ $(document).ready(function () {
504
 
505
  /***/ }),
506
 
507
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/question.js":
508
- /*!**************************************************************************************************************************************!*\
509
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/question.js ***!
510
- \**************************************************************************************************************************************/
511
  /*! exports provided: default */
512
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
513
 
514
  "use strict";
515
  __webpack_require__.r(__webpack_exports__);
516
- /* harmony import */ var _getters_question__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/question.js");
517
- /* harmony import */ var _mutations_question__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/question.js");
518
- /* harmony import */ var _actions_question__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/question.js");
519
 
520
 
521
 
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
+ /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/question.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/question.js":
90
+ /*!**********************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/question.js ***!
92
+ \**********************************************************************************************************************************************/
93
  /*! exports provided: default */
94
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
 
193
 
194
  /***/ }),
195
 
196
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js":
197
+ /*!********************************************************************************************************************************************!*\
198
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js ***!
199
+ \********************************************************************************************************************************************/
200
  /*! no static exports found */
201
  /***/ (function(module, exports) {
202
 
274
 
275
  /***/ }),
276
 
277
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/question.js":
278
+ /*!**********************************************************************************************************************************************!*\
279
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/question.js ***!
280
+ \**********************************************************************************************************************************************/
281
  /*! exports provided: default */
282
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
283
 
343
 
344
  /***/ }),
345
 
346
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js":
347
+ /*!**********************************************************************************************************************************!*\
348
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js ***!
349
+ \**********************************************************************************************************************************/
350
  /*! exports provided: default */
351
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
352
 
413
 
414
  /***/ }),
415
 
416
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/question.js":
417
+ /*!************************************************************************************************************************************************!*\
418
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/question.js ***!
419
+ \************************************************************************************************************************************************/
420
  /*! exports provided: default */
421
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
422
 
461
 
462
  /***/ }),
463
 
464
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/question.js":
465
+ /*!**************************************************************************************************************************************!*\
466
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/question.js ***!
467
+ \**************************************************************************************************************************************/
468
  /*! no exports provided */
469
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
470
 
471
  "use strict";
472
  __webpack_require__.r(__webpack_exports__);
473
+ /* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js");
474
+ /* harmony import */ var _store_question__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/question.js");
475
+ /* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js");
476
  /* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__);
477
 
478
 
504
 
505
  /***/ }),
506
 
507
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/question.js":
508
+ /*!********************************************************************************************************************************************!*\
509
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/question.js ***!
510
+ \********************************************************************************************************************************************/
511
  /*! exports provided: default */
512
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
513
 
514
  "use strict";
515
  __webpack_require__.r(__webpack_exports__);
516
+ /* harmony import */ var _getters_question__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/question.js");
517
+ /* harmony import */ var _mutations_question__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/question.js");
518
+ /* harmony import */ var _actions_question__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/question.js");
519
 
520
 
521
 
assets/js/dist/admin/editor/question.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}({0:function(e,t,n){"use strict";function o(e){var t=window.jQuery||jQuery,n=Vue.http;e=t.extend({ns:"LPRequest",store:!1},e||{});var o=null;LP.Request=function(r){return o=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,o.find("#publish").addClass("disabled"),o.find(".spinner").addClass("is-active"),o.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){t.params.namespace===e.ns?(e.store.dispatch("newRequest"),n((function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success||!1?e.store.dispatch("requestCompleted","successful"):e.store.dispatch("requestCompleted","failed"),o.removeClass("code-"+t.params.code),o.attr("class")||(o.find("#publish").removeClass("disabled"),o.find(".spinner").removeClass("is-active"))}))):n()}))}n.d(t,"a",(function(){return o}))},13:function(e,t,n){"use strict";n.r(t);var o=n(0),r={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||[]},supportAnswerOptions:function(e){return e.supportAnswerOptions||[]},state:function(e){return e},i18n:function(e){return e.i18n}},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,o=e.answers.length;n<o;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--}},i={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)}},s=window.jQuery||jQuery,c=function(e){return{state:s.extend({status:"successful",countCurrentRequest:0,i18n:s.extend({},e.i18n)},e.root),getters:r,mutations:u,actions:i}};n(2);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex;var a=window.jQuery;a(document).ready((function(){window.LP_Question_Store=new $Vuex.Store(c(lp_question_editor)),Object(o.a)({ns:"LPQuestionEditorRequest",store:LP_Question_Store}),setTimeout((function(){a("#admin-editor-lp_question").length&&(window.LP_Question_Editor=new $Vue({el:"#admin-editor-lp_question",template:"<lp-question-editor></lp-question-editor>"}))}),100)}))},2:function(e,t){var n;n=jQuery,window.FIB={getSelectedText:function(){var e="";if(void 0!==window.getSelection){var t=window.getSelection();if(t.rangeCount){for(var n=document.createElement("div"),o=0,r=t.rangeCount;o<r;++o)n.appendChild(t.getRangeAt(o).cloneContents());e=n.innerHTML}}else void 0!==document.selection&&"Text"===document.selection.type&&(e=document.selection.createRange().htmlText);return e},createTextNode:function(e){return document.createTextNode(e)},isContainHtml:function(e){var t=n(e),o="b.fib-blank";return t.is(o)||t.find(o).length||t.parent().is(o)},getSelectionRange:function(){var e="";return window.getSelection?e=window.getSelection():document.getSelection?e=document.getSelection():document.selection&&(e=document.selection.createRange().text),e},outerHTML:function(e){return n("<div>").append(n(e).clone()).html()},doUpgrade:function(e){n.ajax({url:"",data:{"lp-ajax":"fib-upgrade"},success:function(t){console.log(t),e&&e.call(t)}})}},n(document).ready((function(){n("#do-upgrade-fib").on("click",(function(){var e=n(this).prop("disabled",!0).addClass("ajaxloading");FIB.doUpgrade((function(){e.prop("disabled",!1).removeClass("ajaxloading")}))}))}))}});
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}({0:function(e,t,n){"use strict";function o(e){var t=window.jQuery||jQuery,n=Vue.http;e=t.extend({ns:"LPRequest",store:!1},e||{});var o=null;LP.Request=function(r){return o=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,o.find("#publish").addClass("disabled"),o.find(".spinner").addClass("is-active"),o.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){t.params.namespace===e.ns?(e.store.dispatch("newRequest"),n((function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success||!1?e.store.dispatch("requestCompleted","successful"):e.store.dispatch("requestCompleted","failed"),o.removeClass("code-"+t.params.code),o.attr("class")||(o.find("#publish").removeClass("disabled"),o.find(".spinner").removeClass("is-active"))}))):n()}))}n.d(t,"a",(function(){return o}))},15:function(e,t,n){"use strict";n.r(t);var o=n(0),r={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||[]},supportAnswerOptions:function(e){return e.supportAnswerOptions||[]},state:function(e){return e},i18n:function(e){return e.i18n}},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,o=e.answers.length;n<o;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--}},i={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)}},s=window.jQuery||jQuery,c=function(e){return{state:s.extend({status:"successful",countCurrentRequest:0,i18n:s.extend({},e.i18n)},e.root),getters:r,mutations:u,actions:i}};n(2);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex;var a=window.jQuery;a(document).ready((function(){window.LP_Question_Store=new $Vuex.Store(c(lp_question_editor)),Object(o.a)({ns:"LPQuestionEditorRequest",store:LP_Question_Store}),setTimeout((function(){a("#admin-editor-lp_question").length&&(window.LP_Question_Editor=new $Vue({el:"#admin-editor-lp_question",template:"<lp-question-editor></lp-question-editor>"}))}),100)}))},2:function(e,t){var n;n=jQuery,window.FIB={getSelectedText:function(){var e="";if(void 0!==window.getSelection){var t=window.getSelection();if(t.rangeCount){for(var n=document.createElement("div"),o=0,r=t.rangeCount;o<r;++o)n.appendChild(t.getRangeAt(o).cloneContents());e=n.innerHTML}}else void 0!==document.selection&&"Text"===document.selection.type&&(e=document.selection.createRange().htmlText);return e},createTextNode:function(e){return document.createTextNode(e)},isContainHtml:function(e){var t=n(e),o="b.fib-blank";return t.is(o)||t.find(o).length||t.parent().is(o)},getSelectionRange:function(){var e="";return window.getSelection?e=window.getSelection():document.getSelection?e=document.getSelection():document.selection&&(e=document.selection.createRange().text),e},outerHTML:function(e){return n("<div>").append(n(e).clone()).html()},doUpgrade:function(e){n.ajax({url:"",data:{"lp-ajax":"fib-upgrade"},success:function(t){console.log(t),e&&e.call(t)}})}},n(document).ready((function(){n("#do-upgrade-fib").on("click",(function(){var e=n(this).prop("disabled",!0).addClass("ajaxloading");FIB.doUpgrade((function(){e.prop("disabled",!1).removeClass("ajaxloading")}))}))}))}});
assets/js/dist/admin/editor/quiz.js CHANGED
@@ -81,15 +81,15 @@
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
- /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/quiz.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/modal-quiz-items.js":
90
- /*!************************************************************************************************************************************************!*\
91
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/modal-quiz-items.js ***!
92
- \************************************************************************************************************************************************/
93
  /*! exports provided: default */
94
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
 
@@ -166,10 +166,10 @@ var ModalQuizItems = {
166
 
167
  /***/ }),
168
 
169
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/question-list.js":
170
- /*!*********************************************************************************************************************************************!*\
171
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/question-list.js ***!
172
- \*********************************************************************************************************************************************/
173
  /*! exports provided: default */
174
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
175
 
@@ -461,10 +461,10 @@ var QuestionList = {
461
 
462
  /***/ }),
463
 
464
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/quiz.js":
465
- /*!************************************************************************************************************************************!*\
466
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/actions/quiz.js ***!
467
- \************************************************************************************************************************************/
468
  /*! exports provided: default */
469
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
470
 
@@ -502,10 +502,10 @@ var Quiz = {
502
 
503
  /***/ }),
504
 
505
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js":
506
- /*!**************************************************************************************************************************************!*\
507
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js ***!
508
- \**************************************************************************************************************************************/
509
  /*! no static exports found */
510
  /***/ (function(module, exports) {
511
 
@@ -583,10 +583,10 @@ var Quiz = {
583
 
584
  /***/ }),
585
 
586
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/modal-quiz-items.js":
587
- /*!************************************************************************************************************************************************!*\
588
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/modal-quiz-items.js ***!
589
- \************************************************************************************************************************************************/
590
  /*! exports provided: default */
591
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
592
 
@@ -626,10 +626,10 @@ var ModalQuizItems = {
626
 
627
  /***/ }),
628
 
629
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/question-list.js":
630
- /*!*********************************************************************************************************************************************!*\
631
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/question-list.js ***!
632
- \*********************************************************************************************************************************************/
633
  /*! exports provided: default */
634
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
635
 
@@ -680,10 +680,10 @@ var QuestionList = {
680
 
681
  /***/ }),
682
 
683
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/quiz.js":
684
- /*!************************************************************************************************************************************!*\
685
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/getters/quiz.js ***!
686
- \************************************************************************************************************************************/
687
  /*! exports provided: default */
688
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
689
 
@@ -719,10 +719,10 @@ var Quiz = {
719
 
720
  /***/ }),
721
 
722
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js":
723
- /*!****************************************************************************************************************************!*\
724
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js ***!
725
- \****************************************************************************************************************************/
726
  /*! exports provided: default */
727
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
728
 
@@ -789,10 +789,10 @@ function HTTP(options) {
789
 
790
  /***/ }),
791
 
792
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/modal-quiz-items.js":
793
- /*!**************************************************************************************************************************************************!*\
794
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/modal-quiz-items.js ***!
795
- \**************************************************************************************************************************************************/
796
  /*! exports provided: default */
797
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
798
 
@@ -839,10 +839,10 @@ var ModalQuizItems = {
839
 
840
  /***/ }),
841
 
842
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/question-list.js":
843
- /*!***********************************************************************************************************************************************!*\
844
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/question-list.js ***!
845
- \***********************************************************************************************************************************************/
846
  /*! exports provided: default */
847
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
848
 
@@ -1026,10 +1026,10 @@ var QuestionList = {
1026
 
1027
  /***/ }),
1028
 
1029
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/quiz.js":
1030
- /*!**************************************************************************************************************************************!*\
1031
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/mutations/quiz.js ***!
1032
- \**************************************************************************************************************************************/
1033
  /*! exports provided: default */
1034
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1035
 
@@ -1056,18 +1056,18 @@ var Quiz = {
1056
 
1057
  /***/ }),
1058
 
1059
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/quiz.js":
1060
- /*!****************************************************************************************************************************!*\
1061
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/quiz.js ***!
1062
- \****************************************************************************************************************************/
1063
  /*! no exports provided */
1064
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1065
 
1066
  "use strict";
1067
  __webpack_require__.r(__webpack_exports__);
1068
- /* harmony import */ var _store_quiz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/quiz.js");
1069
- /* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/http.js");
1070
- /* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js");
1071
  /* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__);
1072
 
1073
 
@@ -1096,10 +1096,10 @@ window.jQuery(document).ready(function () {
1096
 
1097
  /***/ }),
1098
 
1099
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/i18n.js":
1100
- /*!**********************************************************************************************************************************!*\
1101
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/admin/editor/store/i18n.js ***!
1102
- \**********************************************************************************************************************************/
1103
  /*! exports provided: default */
1104
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1105
 
@@ -1125,18 +1125,18 @@ var i18n = function i18n(i18n) {
1125
 
1126
  /***/ }),
1127
 
1128
- /*