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.
Release Info
Developer | ThimPress |
Plugin | LearnPress – WordPress LMS Plugin |
Version | 4.1.3 |
Comparing to | |
See all releases |
Code changes from version 4.1.2 to 4.1.3
- assets/css/admin/admin.css +184 -6
- assets/css/learnpress.css +0 -96
- assets/css/widgets.css +449 -0
- assets/js/admin/learnpress.min.js +1 -1
- assets/js/dist/admin/editor/course.js +75 -75
- assets/js/dist/admin/editor/course.min.js +1 -1
- assets/js/dist/admin/editor/question.js +35 -35
- assets/js/dist/admin/editor/question.min.js +1 -1
- assets/js/dist/admin/editor/quiz.js +80 -80
- assets/js/dist/admin/editor/quiz.min.js +1 -1
- assets/js/dist/admin/pages/dashboard.js +153 -0
- assets/js/dist/admin/pages/dashboard.min.js +1 -0
- assets/js/dist/admin/pages/setup.js +5 -5
- assets/js/dist/admin/pages/statistic.js +5 -5
- assets/js/dist/admin/pages/sync-data.js +5 -5
- assets/js/dist/admin/pages/themes-addons.js +10 -10
- assets/js/dist/admin/pages/themes-addons.min.js +1 -1
- assets/js/dist/admin/pages/tools.js +51 -51
- assets/js/dist/admin/pages/tools.min.js +1 -1
- assets/js/dist/admin/pages/widgets.js +162 -0
- assets/js/dist/admin/pages/widgets.min.js +1 -0
- assets/js/dist/frontend/custom.js +5 -5
- assets/js/dist/frontend/lesson.js +5 -5
- assets/js/dist/frontend/lp-configs.js +5 -5
- assets/js/dist/frontend/modal.js +40 -40
- assets/js/dist/frontend/modal.min.js +1 -1
- assets/js/dist/frontend/profile.js +15 -15
- assets/js/dist/frontend/profile.min.js +1 -1
- assets/js/dist/frontend/question-types.js +48 -271
- assets/js/dist/frontend/question-types.min.js +1 -1
- assets/js/dist/frontend/quiz.js +151 -146
- assets/js/dist/frontend/quiz.min.js +2 -2
- assets/js/dist/frontend/single-course.js +31 -31
- assets/js/dist/frontend/single-course.min.js +1 -1
- assets/js/dist/frontend/single-curriculum.js +57 -57
- assets/js/dist/frontend/single-curriculum.min.js +1 -1
- assets/js/dist/frontend/widgets.js +208 -0
- assets/js/dist/frontend/widgets.min.js +1 -0
- assets/js/dist/js/data-controls.js +5 -5
- assets/js/dist/utils.js +60 -60
- assets/js/dist/utils.min.js +1 -1
- assets/js/frontend/courses.min.js +1 -1
- assets/src/apps/js/admin/pages/dashboard.js +23 -0
- assets/src/apps/js/admin/pages/widgets.js +61 -0
- assets/src/apps/js/frontend/question-types/components/index.js +0 -1
- assets/src/apps/js/frontend/question-types/components/questions/sorting-choice/index.js +0 -136
- assets/src/apps/js/frontend/question-types/index.js +0 -1
- assets/src/apps/js/frontend/quiz/components/questions/question.js +4 -0
- assets/src/apps/js/frontend/widgets.js +51 -0
- assets/src/js/admin/learnpress.js +56 -0
- assets/src/js/frontend/courses.js +3 -3
- dummy-data/dummy-data.xml +9 -43
- dummy-data/learnpress-how-to-use-learnpress.xml +28 -54
- dummy-data/sample-data.xml +24 -54
- inc/abstracts/abstract-assets.php +141 -14
- inc/abstracts/abstract-post-data.php +16 -9
- inc/admin/class-lp-admin-assets.php +55 -102
- inc/admin/class-lp-admin-dashboard.php +1 -47
- inc/admin/lp-admin-functions.php +2 -6
- inc/admin/meta-box/fields/email-content.php +5 -1
- inc/admin/settings/class-lp-settings-courses.php +13 -5
- inc/admin/settings/class-lp-settings-emails.php +8 -9
- inc/admin/settings/email-groups/class-lp-settings-emails-group.php +7 -0
- inc/admin/views/dashboard/html-orders.php +54 -0
- inc/admin/views/meta-boxes/class-lp-meta-box.php +2 -0
- inc/admin/views/meta-boxes/course/settings.php +4 -4
- inc/admin/views/meta-boxes/course/tabs/assessment.php +0 -69
- inc/admin/views/meta-boxes/course/tabs/author.php +0 -45
- inc/admin/views/meta-boxes/course/tabs/extra.php +0 -130
- inc/admin/views/meta-boxes/course/tabs/general.php +0 -155
- inc/admin/views/meta-boxes/course/tabs/price.php +0 -81
- inc/admin/views/meta-boxes/fields/checkbox.php +4 -0
- inc/admin/views/meta-boxes/fields/class-lp-meta-box-fields.php +2 -2
- inc/admin/views/meta-boxes/fields/repeater.php +105 -0
- inc/admin/views/meta-boxes/fields/text.php +2 -2
- inc/admin/views/meta-boxes/fields/wysiwyg.php +69 -0
- inc/admin/views/meta-boxes/order/details.php +1 -1
- inc/{abstracts → background-process}/abstract-background-process.php +0 -8
- inc/background-process/class-lp-background-emailer.php +0 -51
- inc/background-process/class-lp-background-single-course.php +114 -0
- inc/background-process/class-lp-background-single-email.php +65 -0
- inc/cache/class-lp-cache.php +71 -2
- inc/cache/class-lp-course-cache.php +32 -0
- inc/cache/class-lp-quiz-cache.php +32 -0
- inc/cart/class-lp-cart.php +0 -3
- inc/class-lp-asset-key.php +18 -2
- inc/class-lp-assets.php +47 -98
- inc/class-lp-checkout.php +3 -6
- inc/class-lp-emails.php +44 -174
- inc/class-lp-forms-handler.php +21 -9
- inc/class-lp-helper.php +15 -3
- inc/class-lp-page-controller.php +7 -3
- inc/class-lp-request-handler.php +10 -3
- inc/class-lp-settings.php +12 -4
- inc/class-lp-utils.php +1 -0
- inc/class-lp-widget.php +104 -71
- inc/course/abstract-course.php +21 -21
- inc/course/class-lp-course-item.php +32 -13
- inc/course/class-lp-course.php +88 -22
- inc/course/lp-course-functions.php +42 -17
- inc/curds/class-lp-course-curd.php +42 -17
- inc/curds/class-lp-order-curd.php +0 -3
- inc/curds/class-lp-user-curd.php +33 -41
- inc/curds/class-lp-user-item-curd.php +15 -10
- inc/custom-post-types/abstract.php +315 -173
- inc/custom-post-types/course.php +18 -22
@@ -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 |
-
|
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 {
|
@@ -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 |
}
|
@@ -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 |
+
}
|
@@ -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);
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
278 |
-
|
279 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
337 |
-
|
338 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
416 |
-
|
417 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
425 |
-
/* harmony import */ var _store_course__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/course */ "../../../Clouds/Thimpress/Plugins/github.com/
|
426 |
|
427 |
|
428 |
window.$Vue = window.$Vue || Vue;
|
@@ -450,10 +450,10 @@ $(document).ready(function () {
|
|
450 |
|
451 |
/***/ }),
|
452 |
|
453 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
454 |
-
|
455 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
493 |
-
|
494 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
535 |
-
|
536 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
578 |
-
|
579 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
648 |
-
|
649 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
821 |
-
|
822 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
851 |
-
|
852 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
901 |
-
|
902 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
910 |
-
/* harmony import */ var _mutations_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/
|
911 |
-
/* harmony import */ var _getters_course_section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getters/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/
|
912 |
|
913 |
|
914 |
|
@@ -936,21 +936,21 @@ var $ = window.jQuery;
|
|
936 |
|
937 |
/***/ }),
|
938 |
|
939 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
940 |
-
|
941 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
949 |
-
/* harmony import */ var _store_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../store/course-section */ "../../../Clouds/Thimpress/Plugins/github.com/
|
950 |
-
/* harmony import */ var _store_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store/i18n */ "../../../Clouds/Thimpress/Plugins/github.com/
|
951 |
-
/* harmony import */ var _getters_course__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getters/course */ "../../../Clouds/Thimpress/Plugins/github.com/
|
952 |
-
/* harmony import */ var _mutations_course__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../mutations/course */ "../../../Clouds/Thimpress/Plugins/github.com/
|
953 |
-
/* harmony import */ var _actions_course__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../actions/course */ "../../../Clouds/Thimpress/Plugins/github.com/
|
954 |
|
955 |
|
956 |
|
@@ -981,10 +981,10 @@ var Course = function Course(data) {
|
|
981 |
|
982 |
/***/ }),
|
983 |
|
984 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
985 |
-
|
986 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
1014 |
-
|
1015 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
1023 |
-
/* harmony import */ var _mutations_modal_course_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1024 |
-
/* harmony import */ var _actions_modal_course_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/modal-course-items */ "../../../Clouds/Thimpress/Plugins/github.com/
|
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 |
|
@@ -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)}))}});
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
197 |
-
|
198 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
278 |
-
|
279 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
347 |
-
|
348 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
417 |
-
|
418 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
465 |
-
|
466 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
474 |
-
/* harmony import */ var _store_question__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/question */ "../../../Clouds/Thimpress/Plugins/github.com/
|
475 |
-
/* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/
|
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/
|
508 |
-
|
509 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
517 |
-
/* harmony import */ var _mutations_question__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/question */ "../../../Clouds/Thimpress/Plugins/github.com/
|
518 |
-
/* harmony import */ var _actions_question__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/question */ "../../../Clouds/Thimpress/Plugins/github.com/
|
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 |
|
@@ -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=
|
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")}))}))}))}});
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
170 |
-
|
171 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
465 |
-
|
466 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
506 |
-
|
507 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
587 |
-
|
588 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
630 |
-
|
631 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
684 |
-
|
685 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
723 |
-
|
724 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
793 |
-
|
794 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
843 |
-
|
844 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
1030 |
-
|
1031 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
1060 |
-
|
1061 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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/
|
1069 |
-
/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1070 |
-
/* harmony import */ var _fill_in_blanks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/
|
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/
|
1100 |
-
|
1101 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1129 |
-
|
1130 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1131 |
-
|
1132 |
/*! exports provided: default */
|
1133 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1134 |
|
1135 |
"use strict";
|
1136 |
__webpack_require__.r(__webpack_exports__);
|
1137 |
-
/* harmony import */ var _getters_modal_quiz_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1138 |
-
/* harmony import */ var _mutations_modal_quiz_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1139 |
-
/* harmony import */ var _actions_modal_quiz_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1140 |
|
1141 |
|
1142 |
|
@@ -1161,18 +1161,18 @@ var Quiz = function Quiz(data) {
|
|
1161 |
|
1162 |
/***/ }),
|
1163 |
|
1164 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1165 |
-
|
1166 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1167 |
-
|
1168 |
/*! exports provided: default */
|
1169 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1170 |
|
1171 |
"use strict";
|
1172 |
__webpack_require__.r(__webpack_exports__);
|
1173 |
-
/* harmony import */ var _getters_question_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1174 |
-
/* harmony import */ var _mutations_question_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1175 |
-
/* harmony import */ var _actions_question_list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1176 |
|
1177 |
|
1178 |
|
@@ -1206,21 +1206,21 @@ var QuestionList = function QuestionList(data) {
|
|
1206 |
|
1207 |
/***/ }),
|
1208 |
|
1209 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1210 |
-
|
1211 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1212 |
-
|
1213 |
/*! exports provided: default */
|
1214 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1215 |
|
1216 |
"use strict";
|
1217 |
__webpack_require__.r(__webpack_exports__);
|
1218 |
-
/* harmony import */ var _getters_quiz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1219 |
-
/* harmony import */ var _mutations_quiz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1220 |
-
/* harmony import */ var _actions_quiz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1221 |
-
/* harmony import */ var _store_modal_quiz_items__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../store/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1222 |
-
/* harmony import */ var _store_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../store/i18n */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1223 |
-
/* harmony import */ var _store_question_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../store/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1224 |
|
1225 |
|
1226 |
|
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/quiz.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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_doing/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 |
|
167 |
/***/ }),
|
168 |
|
169 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/question-list.js":
|
170 |
+
/*!***************************************************************************************************************************************************!*\
|
171 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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 |
|
462 |
/***/ }),
|
463 |
|
464 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/quiz.js":
|
465 |
+
/*!******************************************************************************************************************************************!*\
|
466 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/quiz.js ***!
|
467 |
+
\******************************************************************************************************************************************/
|
468 |
/*! exports provided: default */
|
469 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
470 |
|
502 |
|
503 |
/***/ }),
|
504 |
|
505 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js":
|
506 |
+
/*!********************************************************************************************************************************************!*\
|
507 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/fill-in-blanks.js ***!
|
508 |
+
\********************************************************************************************************************************************/
|
509 |
/*! no static exports found */
|
510 |
/***/ (function(module, exports) {
|
511 |
|
583 |
|
584 |
/***/ }),
|
585 |
|
586 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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_doing/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 |
|
627 |
/***/ }),
|
628 |
|
629 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/question-list.js":
|
630 |
+
/*!***************************************************************************************************************************************************!*\
|
631 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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 |
|
681 |
/***/ }),
|
682 |
|
683 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/quiz.js":
|
684 |
+
/*!******************************************************************************************************************************************!*\
|
685 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/quiz.js ***!
|
686 |
+
\******************************************************************************************************************************************/
|
687 |
/*! exports provided: default */
|
688 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
689 |
|
719 |
|
720 |
/***/ }),
|
721 |
|
722 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js":
|
723 |
+
/*!**********************************************************************************************************************************!*\
|
724 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/http.js ***!
|
725 |
+
\**********************************************************************************************************************************/
|
726 |
/*! exports provided: default */
|
727 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
728 |
|
789 |
|
790 |
/***/ }),
|
791 |
|
792 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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_doing/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 |
|
840 |
/***/ }),
|
841 |
|
842 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/question-list.js":
|
843 |
+
/*!*****************************************************************************************************************************************************!*\
|
844 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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 |
|
1027 |
/***/ }),
|
1028 |
|
1029 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/quiz.js":
|
1030 |
+
/*!********************************************************************************************************************************************!*\
|
1031 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/quiz.js ***!
|
1032 |
+
\********************************************************************************************************************************************/
|
1033 |
/*! exports provided: default */
|
1034 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1035 |
|
1056 |
|
1057 |
/***/ }),
|
1058 |
|
1059 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/quiz.js":
|
1060 |
+
/*!**********************************************************************************************************************************!*\
|
1061 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/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_doing/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_doing/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_doing/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 |
|
1097 |
/***/ }),
|
1098 |
|
1099 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/i18n.js":
|
1100 |
+
/*!****************************************************************************************************************************************!*\
|
1101 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/i18n.js ***!
|
1102 |
+
\****************************************************************************************************************************************/
|
1103 |
/*! exports provided: default */
|
1104 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1105 |
|
1125 |
|
1126 |
/***/ }),
|
1127 |
|
1128 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/modal-quiz-items.js":
|
1129 |
+
/*!****************************************************************************************************************************************************!*\
|
1130 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/modal-quiz-items.js ***!
|
1131 |
+
\****************************************************************************************************************************************************/
|
1132 |
/*! exports provided: default */
|
1133 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1134 |
|
1135 |
"use strict";
|
1136 |
__webpack_require__.r(__webpack_exports__);
|
1137 |
+
/* harmony import */ var _getters_modal_quiz_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/modal-quiz-items.js");
|
1138 |
+
/* harmony import */ var _mutations_modal_quiz_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/modal-quiz-items.js");
|
1139 |
+
/* harmony import */ var _actions_modal_quiz_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/modal-quiz-items.js");
|
1140 |
|
1141 |
|
1142 |
|
1161 |
|
1162 |
/***/ }),
|
1163 |
|
1164 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/question-list.js":
|
1165 |
+
/*!*************************************************************************************************************************************************!*\
|
1166 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/question-list.js ***!
|
1167 |
+
\*************************************************************************************************************************************************/
|
1168 |
/*! exports provided: default */
|
1169 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1170 |
|
1171 |
"use strict";
|
1172 |
__webpack_require__.r(__webpack_exports__);
|
1173 |
+
/* harmony import */ var _getters_question_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/question-list.js");
|
1174 |
+
/* harmony import */ var _mutations_question_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/question-list.js");
|
1175 |
+
/* harmony import */ var _actions_question_list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/question-list.js");
|
1176 |
|
1177 |
|
1178 |
|
1206 |
|
1207 |
/***/ }),
|
1208 |
|
1209 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/quiz.js":
|
1210 |
+
/*!****************************************************************************************************************************************!*\
|
1211 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/quiz.js ***!
|
1212 |
+
\****************************************************************************************************************************************/
|
1213 |
/*! exports provided: default */
|
1214 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1215 |
|
1216 |
"use strict";
|
1217 |
__webpack_require__.r(__webpack_exports__);
|
1218 |
+
/* harmony import */ var _getters_quiz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/getters/quiz.js");
|
1219 |
+
/* harmony import */ var _mutations_quiz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/mutations/quiz.js");
|
1220 |
+
/* harmony import */ var _actions_quiz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/quiz */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/actions/quiz.js");
|
1221 |
+
/* harmony import */ var _store_modal_quiz_items__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../store/modal-quiz-items */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/modal-quiz-items.js");
|
1222 |
+
/* harmony import */ var _store_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../store/i18n */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/i18n.js");
|
1223 |
+
/* harmony import */ var _store_question_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../store/question-list */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/editor/store/question-list.js");
|
1224 |
|
1225 |
|
1226 |
|
@@ -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=10)}([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}))},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}}}}},function(t,e){var n;n=jQuery,window.FIB={getSelectedText:function(){var t="";if(void 0!==window.getSelection){var e=window.getSelection();if(e.rangeCount){for(var n=document.createElement("div"),i=0,o=e.rangeCount;i<o;++i)n.appendChild(e.getRangeAt(i).cloneContents());t=n.innerHTML}}else void 0!==document.selection&&"Text"===document.selection.type&&(t=document.selection.createRange().htmlText);return t},createTextNode:function(t){return document.createTextNode(t)},isContainHtml:function(t){var e=n(t),i="b.fib-blank";return e.is(i)||e.find(i).length||e.parent().is(i)},getSelectionRange:function(){var t="";return window.getSelection?t=window.getSelection():document.getSelection?t=document.getSelection():document.selection&&(t=document.selection.createRange().text),t},outerHTML:function(t){return n("<div>").append(n(t).clone()).html()},doUpgrade:function(t){n.ajax({url:"",data:{"lp-ajax":"fib-upgrade"},success:function(e){console.log(e),t&&t.call(e)}})}},n(document).ready((function(){n("#do-upgrade-fib").on("click",(function(){var t=n(this).prop("disabled",!0).addClass("ajaxloading");FIB.doUpgrade((function(){t.prop("disabled",!1).removeClass("ajaxloading")}))}))}))},,,,,,,,function(t,e,n){"use strict";n.r(e);var i={heartbeat:function(t){return t.heartbeat},questionTypes:function(t){return t.types},defaultNewQuestionType:function(t){return t.default_new},action:function(t){return t.action},id:function(t){return t.quiz_id},status:function(t){return t.status||"error"},currentRequest:function(t){return t.countCurrentRequest||0},nonce:function(t){return t.nonce}},o={UPDATE_HEART_BEAT:function(t,e){t.heartbeat=!!e},UPDATE_STATUS:function(t,e){t.status=e},UPDATE_NEW_QUESTION_TYPE:function(t,e){t.default_new=e},INCREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest--}},s={heartbeat:function(t){LP.Request({type:"heartbeat"}).then((function(e){var n=e.body;t.commit("UPDATE_HEART_BEAT",!!n.success)}),(function(e){t.commit("UPDATE_HEART_BEAT",!1)}))},newRequest:function(t){t.commit("INCREASE_NUMBER_REQUEST"),t.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(t,e){t.commit("DECREASE_NUMBER_REQUEST"),0===t.getters.currentRequest&&(t.commit("UPDATE_STATUS",e),window.onbeforeunload=null)}},u={status:function(t){return t.status},pagination:function(t){return t.pagination},items:function(t,e){return t.items.map((function(t){var n=e.addedItems.find((function(e){return t.id===e.id}));return t.added=!!n,t}))},code:function(t){return Date.now()},addedItems:function(t){return t.addedItems},isOpen:function(t){return t.open},quiz:function(t){return t.quizId}},r={TOGGLE:function(t){t.open=!t.open},SET_QUIZ:function(t,e){t.quizId=e},SET_LIST_ITEMS:function(t,e){t.items=e},ADD_ITEM:function(t,e){t.addedItems.push(e)},REMOVE_ADDED_ITEM:function(t,e){t.addedItems.forEach((function(n,i){n.id===e.id&&t.addedItems.splice(i,1)}))},RESET:function(t){t.addedItems=[],t.items=[]},UPDATE_PAGINATION:function(t,e){t.pagination=e},SEARCH_ITEM_REQUEST:function(t){t.status="loading"},SEARCH_ITEM_SUCCESS:function(t){t.status="successful"},SEARCH_ITEM_FAIL:function(t){t.status="fail"}},c={toggle:function(t){t.commit("TOGGLE")},open:function(t,e){t.commit("SET_QUIZ",e),t.commit("RESET"),t.commit("TOGGLE")},searchItems:function(t,e){t.commit("SEARCH_ITEM_REQUEST"),LP.Request({type:"search-items",query:e.query,page:e.page,exclude:JSON.stringify([])}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("SET_LIST_ITEMS",i.items),t.commit("UPDATE_PAGINATION",i.pagination),t.commit("SEARCH_ITEM_SUCCESS")}}),(function(e){t.commit("SEARCH_ITEMS_FAIL"),console.log(e)}))},addItem:function(t,e){t.commit("ADD_ITEM",e)},removeItem:function(t,e){t.commit("REMOVE_ADDED_ITEM",e)},addQuestionsToQuiz:function(t,e){var n=t.getters.addedItems;n.length>0&&LP.Request({type:"add-questions-to-quiz",items:JSON.stringify(n),draft_quiz:JSON.stringify(e)}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("lqs/SET_QUESTIONS",i,{root:!0}),t.commit("TOGGLE")}}),(function(t){console.log(t)}))}},d=window.jQuery||jQuery,a=function(t){return{namespaced:!0,state:d.extend({quizId:!1,pagination:"",status:""},t.chooseItems),getters:u,mutations:r,actions:c}},E=n(1),_={listQuestions:function(t){return t.questions||[]},questionsOrder:function(t){return t.order||[]},externalComponent:function(t){return t.externalComponent||[]},supportAnswerOptions:function(t){return t.supportAnswerOptions||[]},hiddenQuestionsSettings:function(t){return t.hidden_questions_settings||[]},hiddenQuestions:function(t){return t.questions.filter((function(t){return!t.open})).map((function(t){return parseInt(t.id)}))},isHiddenListQuestions:function(t,e){var n=e.listQuestions,i=e.hiddenQuestions;return n.length===i.length},disableUpdateList:function(t){return t.disableUpdateList},statusUpdateQuestions:function(t){return t.statusUpdateQuestions},statusUpdateQuestionItem:function(t){return t.statusUpdateQuestionItem},statusUpdateQuestionAnswer:function(t){return t.statusUpdateQuestionAnswer}},f=window.jQuery,m={SORT_QUESTIONS:function(t,e){t.questions=t.questions.map((function(t){return t.order=e[t.id],t}))},SORT_QUESTION_ANSWERS:function(t,e){t.questions=t.questions.map((function(t){return t.answers.answer_order=e[t.answers.question_answer_id],t}))},ADD_QUESTION_ANSWER:function(t,e){t.questions=t.questions.map((function(t){if(t.id===e.question_id){var n=!1;if(e.answer.temp_id)for(var i=0,o=t.answers.length;i<o;i++)t.answers[i].question_answer_id==e.answer.temp_id&&(n=!0,$Vue.set(t.answers,i,e.answer));return!n&&t.answers.push(e.answer),t}return t}))},CHANGE_QUESTION_CORRECT_ANSWERS:function(t,e){t.questions=t.questions.map((function(t){return parseInt(t.id)===e.id&&(t.answers=e.answers),t}))},SET_QUESTIONS:function(t,e){t.questions=e},ADD_NEW_QUESTION:function(t,e){var n=!1;if(e.temp_id)for(var i=0,o=t.questions.length;i<o;i++)if(t.questions[i].id===e.temp_id){$Vue.set(t.questions,i,e),n=!0;break}if(!n){var s=f(".lp-list-questions .main > div:last-child");if(s.length){var u=s.offset().top;f("html,body").animate({scrollTop:u})}t.questions.push(e)}},CHANGE_QUESTION_TYPE:function(t,e){t.questions=t.questions.map((function(t){return parseInt(t.id)===e.id&&(t.answers=e.answers,t.type=e.type,t.open=!0),t}))},REMOVE_QUESTION:function(t,e){var n=t.questions.indexOf(e);e.temp_id?t.questions[n].id=e.temp_id:t.questions.splice(n,1)},DELETE_QUESTION_ANSWER:function(t,e){var n=e.question_id,i=e.answer_id;t.questions=t.questions.map((function(t){if(t.id===n){var e=t.answers;e.forEach((function(t){if(t.question_answer_id===i){var n=e.indexOf(t);e.splice(n,1)}}))}return t}))},REMOVE_QUESTIONS:function(){},CLOSE_QUESTION:function(t,e){t.questions.forEach((function(n,i){e.id===n.id&&(t.questions[i].open=!1)}))},OPEN_QUESTION:function(t,e){t.questions.forEach((function(n,i){e.id===n.id&&(t.questions[i].open=!0)}))},CLOSE_LIST_QUESTIONS:function(t){t.questions=t.questions.map((function(t){return t.open=!1,t}))},OPEN_LIST_QUESTIONS:function(t){t.questions=t.questions.map((function(t){return t.open=!0,t}))},UPDATE_QUESTION_REQUEST:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"updating")},UPDATE_QUESTION_SUCCESS:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"successful")},UPDATE_QUESTION_FAILURE:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"failed")},UPDATE_QUESTION_ANSWER_REQUEST:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"updating")},UPDATE_QUESTION_ANSWER_SUCCESS:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"successful")},UPDATE_QUESTION_ANSWER_FAIL:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"failed")},DELETE_ANSWER:function(t,e){t.questions.map((function(t,n){if(t.id==e.question_id){for(var i=0,o=t.answers.length;i<o;i++)if(t.answers[i].question_answer_id==e.answer_id){t.answers[i].question_answer_id=e.temp_id;break}return!1}}))}},S=window.jQuery,T={toggleAll:function(t){t.getters.isHiddenListQuestions?t.commit("OPEN_LIST_QUESTIONS"):t.commit("CLOSE_LIST_QUESTIONS"),LP.Request({type:"hidden-questions",hidden:t.getters.hiddenQuestions})},updateQuizQuestionsHidden:function(t,e){LP.Request(S.extend({},e,{type:"update-quiz-questions-hidden"}))},newQuestion:function(t,e){var n=JSON.parse(JSON.stringify(e.question));n.settings={},t.commit("ADD_NEW_QUESTION",n),LP.Request({type:"new-question",question:JSON.stringify(e.question),draft_quiz:JSON.stringify(e.quiz)}).then((function(n){var i=n.body;i.success&&(t.commit("UPDATE_NEW_QUESTION_TYPE",e.question.type,{root:!0}),t.commit("ADD_NEW_QUESTION",i.data),t.commit("CLOSE_LIST_QUESTIONS"),t.commit("OPEN_QUESTION",i.data))}),(function(t){console.log(t)}))},updateQuestionsOrder:function(t,e){LP.Request({type:"sort-questions",order:JSON.stringify(e)}).then((function(n){t.commit("SORT_QUESTIONS",e)}),(function(t){console.log(t)}))},updateQuestionTitle:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.id),LP.Request({type:"update-question-title",question:JSON.stringify(e)}).then((function(){t.commit("UPDATE_QUESTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)}))},changeQuestionType:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"change-question-type",question_id:e.question_id,question_type:e.type}).then((function(n){var i=n.body;if(i.success){var o=i.data;t.commit("CHANGE_QUESTION_TYPE",o),t.commit("UPDATE_NEW_QUESTION_TYPE",o.type.key,{root:!0}),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)}})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.question_id)}))},isHiddenQuestionsSettings:function(t,e){},cloneQuestion:function(t,e){LP.Request({type:"clone-question",question:JSON.stringify(e)}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("ADD_NEW_QUESTION",n.data),t.commit("UPDATE_NEW_QUESTION_TYPE",i.type.key,{root:!0})}}),(function(t){console.log(t)}))},removeQuestion:function(t,e){var n=e.id;e.temp_id=LP.uniqueId(),t.commit("REMOVE_QUESTION",e),LP.Request({type:"remove-question",question_id:n}).then((function(n){n.body.success&&(e.id=e.temp_id,e.temp_id=0,t.commit("REMOVE_QUESTION",e))}),(function(t){console.error(t)}))},deleteQuestion:function(t,e){var n=e.id;e.temp_id=LP.uniqueId(),t.commit("REMOVE_QUESTION",e),LP.Request({type:"delete-question",question_id:n}).then((function(){e.id=e.temp_id,e.temp_id=0,t.commit("REMOVE_QUESTION",e),t.commit("UPDATE_QUESTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)}))},toggleQuestion:function(t,e){e.open?t.commit("CLOSE_QUESTION",e):t.commit("OPEN_QUESTION",e),LP.Request({type:"hidden-questions",hidden:t.getters.hiddenQuestions})},updateQuestionAnswersOrder:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"sort-question-answers",question_id:e.question_id,order:JSON.stringify(e.order)}).then((function(n){var i=n.body.data;t.commit("SORT_QUESTION_ANSWERS",i),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)}),(function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)}))},updateQuestionAnswerTitle:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"update-question-answer-title",question_id:parseInt(e.question_id),answer:JSON.stringify(e.answer)}).then((function(){t.commit("UPDATE_QUESTION_ANSWER_SUCCESS",parseInt(e.question_id)),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)})).catch((function(){t.commit("UPDATE_QUESTION_ANSWER_FAILURE",parseInt(e.question_id)),t.commit("UPDATE_QUESTION_FAILURE",e.question_id)}))},updateQuestionCorrectAnswer:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"change-question-correct-answer",question_id:e.question_id,correct:JSON.stringify(e.correct)}).then((function(n){var i=n.body;i.success&&(t.commit("CHANGE_QUESTION_CORRECT_ANSWERS",i.data),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id))}),(function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)}))},deleteQuestionAnswer:function(t,e){e.temp_id=LP.uniqueId(),t.commit("DELETE_ANSWER",e),t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"delete-question-answer",question_id:e.question_id,answer_id:e.answer_id}).then((function(n){n.body.success&&(t.commit("DELETE_QUESTION_ANSWER",{question_id:e.question_id,answer_id:e.temp_id}),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id))}),(function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)}))},newQuestionAnswer:function(t,e){var n=LP.uniqueId(),i=e.question_id;t.commit("UPDATE_QUESTION_REQUEST",i),t.commit("ADD_QUESTION_ANSWER",{question_id:i,answer:{text:LP_Quiz_Store.getters["i18n/all"].new_option,question_answer_id:n}}),LP.Request({type:"new-question-answer",question_id:i,question_answer_id:n}).then((function(n){var o=n.body;if(o.success){var s=o.data;t.commit("ADD_QUESTION_ANSWER",{question_id:i,answer:s}),t.commit("UPDATE_QUESTION_SUCCESS",i),e.success&&setTimeout((function(){e.success.apply(e.context,[s])}),300)}}),(function(e){t.commit("UPDATE_QUESTION_FAILURE",i),console.error(e)}))},updateQuestionContent:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.id),LP.Request({type:"update-question-content",question:JSON.stringify(e)}).then((function(){t.commit("UPDATE_QUESTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)}))},updateQuestionMeta:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question.id),LP.Request({type:"update-question-meta",question:JSON.stringify(e.question),meta_key:e.meta_key}).then((function(){t.commit("UPDATE_QUESTION_SUCCESS",e.question.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.question.id)}))}},p=window.jQuery||jQuery,U=function(t){var e=t.listQuestions;return{namespaced:!0,state:p.extend({statusUpdateQuestions:{},statusUpdateQuestionItem:{},statusUpdateQuestionAnswer:{},questions:e.questions.map((function(t){var n=e.hidden_questions.find((function(e){return parseInt(t.id)===parseInt(e)}));return t.open=!n,t}))},e),getters:_,mutations:m,actions:T}},l=window.jQuery||jQuery,q=function(t){return{state:l.extend({status:"success",heartbeat:!0,countCurrentRequest:0},t.root),getters:i,mutations:o,actions:s,modules:{cqi:a(t),i18n:Object(E.a)(t.i18n),lqs:U(t)}}},Q=n(0);n(2);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,window.jQuery(document).ready((function(){window.LP_Quiz_Store=new $Vuex.Store(q(lp_quiz_editor)),Object(Q.a)({ns:"LPListQuizQuestionsRequest",store:LP_Quiz_Store}),setTimeout((function(){window.LP_Quiz_Editor=new $Vue({el:"#admin-editor-lp_quiz",template:"<lp-quiz-editor></lp-quiz-editor>"})}),100)}))}]);
|
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=12)}({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}}}}},12:function(t,e,n){"use strict";n.r(e);var i={heartbeat:function(t){return t.heartbeat},questionTypes:function(t){return t.types},defaultNewQuestionType:function(t){return t.default_new},action:function(t){return t.action},id:function(t){return t.quiz_id},status:function(t){return t.status||"error"},currentRequest:function(t){return t.countCurrentRequest||0},nonce:function(t){return t.nonce}},o={UPDATE_HEART_BEAT:function(t,e){t.heartbeat=!!e},UPDATE_STATUS:function(t,e){t.status=e},UPDATE_NEW_QUESTION_TYPE:function(t,e){t.default_new=e},INCREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest--}},s={heartbeat:function(t){LP.Request({type:"heartbeat"}).then((function(e){var n=e.body;t.commit("UPDATE_HEART_BEAT",!!n.success)}),(function(e){t.commit("UPDATE_HEART_BEAT",!1)}))},newRequest:function(t){t.commit("INCREASE_NUMBER_REQUEST"),t.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(t,e){t.commit("DECREASE_NUMBER_REQUEST"),0===t.getters.currentRequest&&(t.commit("UPDATE_STATUS",e),window.onbeforeunload=null)}},u={status:function(t){return t.status},pagination:function(t){return t.pagination},items:function(t,e){return t.items.map((function(t){var n=e.addedItems.find((function(e){return t.id===e.id}));return t.added=!!n,t}))},code:function(t){return Date.now()},addedItems:function(t){return t.addedItems},isOpen:function(t){return t.open},quiz:function(t){return t.quizId}},r={TOGGLE:function(t){t.open=!t.open},SET_QUIZ:function(t,e){t.quizId=e},SET_LIST_ITEMS:function(t,e){t.items=e},ADD_ITEM:function(t,e){t.addedItems.push(e)},REMOVE_ADDED_ITEM:function(t,e){t.addedItems.forEach((function(n,i){n.id===e.id&&t.addedItems.splice(i,1)}))},RESET:function(t){t.addedItems=[],t.items=[]},UPDATE_PAGINATION:function(t,e){t.pagination=e},SEARCH_ITEM_REQUEST:function(t){t.status="loading"},SEARCH_ITEM_SUCCESS:function(t){t.status="successful"},SEARCH_ITEM_FAIL:function(t){t.status="fail"}},c={toggle:function(t){t.commit("TOGGLE")},open:function(t,e){t.commit("SET_QUIZ",e),t.commit("RESET"),t.commit("TOGGLE")},searchItems:function(t,e){t.commit("SEARCH_ITEM_REQUEST"),LP.Request({type:"search-items",query:e.query,page:e.page,exclude:JSON.stringify([])}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("SET_LIST_ITEMS",i.items),t.commit("UPDATE_PAGINATION",i.pagination),t.commit("SEARCH_ITEM_SUCCESS")}}),(function(e){t.commit("SEARCH_ITEMS_FAIL"),console.log(e)}))},addItem:function(t,e){t.commit("ADD_ITEM",e)},removeItem:function(t,e){t.commit("REMOVE_ADDED_ITEM",e)},addQuestionsToQuiz:function(t,e){var n=t.getters.addedItems;n.length>0&&LP.Request({type:"add-questions-to-quiz",items:JSON.stringify(n),draft_quiz:JSON.stringify(e)}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("lqs/SET_QUESTIONS",i,{root:!0}),t.commit("TOGGLE")}}),(function(t){console.log(t)}))}},d=window.jQuery||jQuery,a=function(t){return{namespaced:!0,state:d.extend({quizId:!1,pagination:"",status:""},t.chooseItems),getters:u,mutations:r,actions:c}},E=n(1),_={listQuestions:function(t){return t.questions||[]},questionsOrder:function(t){return t.order||[]},externalComponent:function(t){return t.externalComponent||[]},supportAnswerOptions:function(t){return t.supportAnswerOptions||[]},hiddenQuestionsSettings:function(t){return t.hidden_questions_settings||[]},hiddenQuestions:function(t){return t.questions.filter((function(t){return!t.open})).map((function(t){return parseInt(t.id)}))},isHiddenListQuestions:function(t,e){var n=e.listQuestions,i=e.hiddenQuestions;return n.length===i.length},disableUpdateList:function(t){return t.disableUpdateList},statusUpdateQuestions:function(t){return t.statusUpdateQuestions},statusUpdateQuestionItem:function(t){return t.statusUpdateQuestionItem},statusUpdateQuestionAnswer:function(t){return t.statusUpdateQuestionAnswer}},f=window.jQuery,m={SORT_QUESTIONS:function(t,e){t.questions=t.questions.map((function(t){return t.order=e[t.id],t}))},SORT_QUESTION_ANSWERS:function(t,e){t.questions=t.questions.map((function(t){return t.answers.answer_order=e[t.answers.question_answer_id],t}))},ADD_QUESTION_ANSWER:function(t,e){t.questions=t.questions.map((function(t){if(t.id===e.question_id){var n=!1;if(e.answer.temp_id)for(var i=0,o=t.answers.length;i<o;i++)t.answers[i].question_answer_id==e.answer.temp_id&&(n=!0,$Vue.set(t.answers,i,e.answer));return!n&&t.answers.push(e.answer),t}return t}))},CHANGE_QUESTION_CORRECT_ANSWERS:function(t,e){t.questions=t.questions.map((function(t){return parseInt(t.id)===e.id&&(t.answers=e.answers),t}))},SET_QUESTIONS:function(t,e){t.questions=e},ADD_NEW_QUESTION:function(t,e){var n=!1;if(e.temp_id)for(var i=0,o=t.questions.length;i<o;i++)if(t.questions[i].id===e.temp_id){$Vue.set(t.questions,i,e),n=!0;break}if(!n){var s=f(".lp-list-questions .main > div:last-child");if(s.length){var u=s.offset().top;f("html,body").animate({scrollTop:u})}t.questions.push(e)}},CHANGE_QUESTION_TYPE:function(t,e){t.questions=t.questions.map((function(t){return parseInt(t.id)===e.id&&(t.answers=e.answers,t.type=e.type,t.open=!0),t}))},REMOVE_QUESTION:function(t,e){var n=t.questions.indexOf(e);e.temp_id?t.questions[n].id=e.temp_id:t.questions.splice(n,1)},DELETE_QUESTION_ANSWER:function(t,e){var n=e.question_id,i=e.answer_id;t.questions=t.questions.map((function(t){if(t.id===n){var e=t.answers;e.forEach((function(t){if(t.question_answer_id===i){var n=e.indexOf(t);e.splice(n,1)}}))}return t}))},REMOVE_QUESTIONS:function(){},CLOSE_QUESTION:function(t,e){t.questions.forEach((function(n,i){e.id===n.id&&(t.questions[i].open=!1)}))},OPEN_QUESTION:function(t,e){t.questions.forEach((function(n,i){e.id===n.id&&(t.questions[i].open=!0)}))},CLOSE_LIST_QUESTIONS:function(t){t.questions=t.questions.map((function(t){return t.open=!1,t}))},OPEN_LIST_QUESTIONS:function(t){t.questions=t.questions.map((function(t){return t.open=!0,t}))},UPDATE_QUESTION_REQUEST:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"updating")},UPDATE_QUESTION_SUCCESS:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"successful")},UPDATE_QUESTION_FAILURE:function(t,e){$Vue.set(t.statusUpdateQuestionItem,e,"failed")},UPDATE_QUESTION_ANSWER_REQUEST:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"updating")},UPDATE_QUESTION_ANSWER_SUCCESS:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"successful")},UPDATE_QUESTION_ANSWER_FAIL:function(t,e){$Vue.set(t.statusUpdateQuestionAnswer,e,"failed")},DELETE_ANSWER:function(t,e){t.questions.map((function(t,n){if(t.id==e.question_id){for(var i=0,o=t.answers.length;i<o;i++)if(t.answers[i].question_answer_id==e.answer_id){t.answers[i].question_answer_id=e.temp_id;break}return!1}}))}},S=window.jQuery,T={toggleAll:function(t){t.getters.isHiddenListQuestions?t.commit("OPEN_LIST_QUESTIONS"):t.commit("CLOSE_LIST_QUESTIONS"),LP.Request({type:"hidden-questions",hidden:t.getters.hiddenQuestions})},updateQuizQuestionsHidden:function(t,e){LP.Request(S.extend({},e,{type:"update-quiz-questions-hidden"}))},newQuestion:function(t,e){var n=JSON.parse(JSON.stringify(e.question));n.settings={},t.commit("ADD_NEW_QUESTION",n),LP.Request({type:"new-question",question:JSON.stringify(e.question),draft_quiz:JSON.stringify(e.quiz)}).then((function(n){var i=n.body;i.success&&(t.commit("UPDATE_NEW_QUESTION_TYPE",e.question.type,{root:!0}),t.commit("ADD_NEW_QUESTION",i.data),t.commit("CLOSE_LIST_QUESTIONS"),t.commit("OPEN_QUESTION",i.data))}),(function(t){console.log(t)}))},updateQuestionsOrder:function(t,e){LP.Request({type:"sort-questions",order:JSON.stringify(e)}).then((function(n){t.commit("SORT_QUESTIONS",e)}),(function(t){console.log(t)}))},updateQuestionTitle:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.id),LP.Request({type:"update-question-title",question:JSON.stringify(e)}).then((function(){t.commit("UPDATE_QUESTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)}))},changeQuestionType:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"change-question-type",question_id:e.question_id,question_type:e.type}).then((function(n){var i=n.body;if(i.success){var o=i.data;t.commit("CHANGE_QUESTION_TYPE",o),t.commit("UPDATE_NEW_QUESTION_TYPE",o.type.key,{root:!0}),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)}})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.question_id)}))},isHiddenQuestionsSettings:function(t,e){},cloneQuestion:function(t,e){LP.Request({type:"clone-question",question:JSON.stringify(e)}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("ADD_NEW_QUESTION",n.data),t.commit("UPDATE_NEW_QUESTION_TYPE",i.type.key,{root:!0})}}),(function(t){console.log(t)}))},removeQuestion:function(t,e){var n=e.id;e.temp_id=LP.uniqueId(),t.commit("REMOVE_QUESTION",e),LP.Request({type:"remove-question",question_id:n}).then((function(n){n.body.success&&(e.id=e.temp_id,e.temp_id=0,t.commit("REMOVE_QUESTION",e))}),(function(t){console.error(t)}))},deleteQuestion:function(t,e){var n=e.id;e.temp_id=LP.uniqueId(),t.commit("REMOVE_QUESTION",e),LP.Request({type:"delete-question",question_id:n}).then((function(){e.id=e.temp_id,e.temp_id=0,t.commit("REMOVE_QUESTION",e),t.commit("UPDATE_QUESTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)}))},toggleQuestion:function(t,e){e.open?t.commit("CLOSE_QUESTION",e):t.commit("OPEN_QUESTION",e),LP.Request({type:"hidden-questions",hidden:t.getters.hiddenQuestions})},updateQuestionAnswersOrder:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"sort-question-answers",question_id:e.question_id,order:JSON.stringify(e.order)}).then((function(n){var i=n.body.data;t.commit("SORT_QUESTION_ANSWERS",i),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)}),(function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)}))},updateQuestionAnswerTitle:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"update-question-answer-title",question_id:parseInt(e.question_id),answer:JSON.stringify(e.answer)}).then((function(){t.commit("UPDATE_QUESTION_ANSWER_SUCCESS",parseInt(e.question_id)),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id)})).catch((function(){t.commit("UPDATE_QUESTION_ANSWER_FAILURE",parseInt(e.question_id)),t.commit("UPDATE_QUESTION_FAILURE",e.question_id)}))},updateQuestionCorrectAnswer:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"change-question-correct-answer",question_id:e.question_id,correct:JSON.stringify(e.correct)}).then((function(n){var i=n.body;i.success&&(t.commit("CHANGE_QUESTION_CORRECT_ANSWERS",i.data),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id))}),(function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)}))},deleteQuestionAnswer:function(t,e){e.temp_id=LP.uniqueId(),t.commit("DELETE_ANSWER",e),t.commit("UPDATE_QUESTION_REQUEST",e.question_id),LP.Request({type:"delete-question-answer",question_id:e.question_id,answer_id:e.answer_id}).then((function(n){n.body.success&&(t.commit("DELETE_QUESTION_ANSWER",{question_id:e.question_id,answer_id:e.temp_id}),t.commit("UPDATE_QUESTION_SUCCESS",e.question_id))}),(function(n){t.commit("UPDATE_QUESTION_FAILURE",e.question_id),console.log(n)}))},newQuestionAnswer:function(t,e){var n=LP.uniqueId(),i=e.question_id;t.commit("UPDATE_QUESTION_REQUEST",i),t.commit("ADD_QUESTION_ANSWER",{question_id:i,answer:{text:LP_Quiz_Store.getters["i18n/all"].new_option,question_answer_id:n}}),LP.Request({type:"new-question-answer",question_id:i,question_answer_id:n}).then((function(n){var o=n.body;if(o.success){var s=o.data;t.commit("ADD_QUESTION_ANSWER",{question_id:i,answer:s}),t.commit("UPDATE_QUESTION_SUCCESS",i),e.success&&setTimeout((function(){e.success.apply(e.context,[s])}),300)}}),(function(e){t.commit("UPDATE_QUESTION_FAILURE",i),console.error(e)}))},updateQuestionContent:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.id),LP.Request({type:"update-question-content",question:JSON.stringify(e)}).then((function(){t.commit("UPDATE_QUESTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.id)}))},updateQuestionMeta:function(t,e){t.commit("UPDATE_QUESTION_REQUEST",e.question.id),LP.Request({type:"update-question-meta",question:JSON.stringify(e.question),meta_key:e.meta_key}).then((function(){t.commit("UPDATE_QUESTION_SUCCESS",e.question.id)})).catch((function(){t.commit("UPDATE_QUESTION_FAILURE",e.question.id)}))}},p=window.jQuery||jQuery,U=function(t){var e=t.listQuestions;return{namespaced:!0,state:p.extend({statusUpdateQuestions:{},statusUpdateQuestionItem:{},statusUpdateQuestionAnswer:{},questions:e.questions.map((function(t){var n=e.hidden_questions.find((function(e){return parseInt(t.id)===parseInt(e)}));return t.open=!n,t}))},e),getters:_,mutations:m,actions:T}},l=window.jQuery||jQuery,q=function(t){return{state:l.extend({status:"success",heartbeat:!0,countCurrentRequest:0},t.root),getters:i,mutations:o,actions:s,modules:{cqi:a(t),i18n:Object(E.a)(t.i18n),lqs:U(t)}}},Q=n(0);n(2);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,window.jQuery(document).ready((function(){window.LP_Quiz_Store=new $Vuex.Store(q(lp_quiz_editor)),Object(Q.a)({ns:"LPListQuizQuestionsRequest",store:LP_Quiz_Store}),setTimeout((function(){window.LP_Quiz_Editor=new $Vue({el:"#admin-editor-lp_quiz",template:"<lp-quiz-editor></lp-quiz-editor>"})}),100)}))},2:function(t,e){var n;n=jQuery,window.FIB={getSelectedText:function(){var t="";if(void 0!==window.getSelection){var e=window.getSelection();if(e.rangeCount){for(var n=document.createElement("div"),i=0,o=e.rangeCount;i<o;++i)n.appendChild(e.getRangeAt(i).cloneContents());t=n.innerHTML}}else void 0!==document.selection&&"Text"===document.selection.type&&(t=document.selection.createRange().htmlText);return t},createTextNode:function(t){return document.createTextNode(t)},isContainHtml:function(t){var e=n(t),i="b.fib-blank";return e.is(i)||e.find(i).length||e.parent().is(i)},getSelectionRange:function(){var t="";return window.getSelection?t=window.getSelection():document.getSelection?t=document.getSelection():document.selection&&(t=document.selection.createRange().text),t},outerHTML:function(t){return n("<div>").append(n(t).clone()).html()},doUpgrade:function(t){n.ajax({url:"",data:{"lp-ajax":"fib-upgrade"},success:function(e){console.log(e),t&&t.call(e)}})}},n(document).ready((function(){n("#do-upgrade-fib").on("click",(function(){var t=n(this).prop("disabled",!0).addClass("ajaxloading");FIB.doUpgrade((function(){t.prop("disabled",!1).removeClass("ajaxloading")}))}))}))}});
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/******/ (function(modules) { // webpackBootstrap
|
2 |
+
/******/ // The module cache
|
3 |
+
/******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 |
+
/******/ }
|
41 |
+
/******/ };
|
42 |
+
/******/
|
43 |
+
/******/ // define __esModule on exports
|
44 |
+
/******/ __webpack_require__.r = function(exports) {
|
45 |
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 |
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 |
+
/******/ }
|
48 |
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
49 |
+
/******/ };
|
50 |
+
/******/
|
51 |
+
/******/ // create a fake namespace object
|
52 |
+
/******/ // mode & 1: value is a module id, require it
|
53 |
+
/******/ // mode & 2: merge all properties of value into the ns
|
54 |
+
/******/ // mode & 4: return value when already ns object
|
55 |
+
/******/ // mode & 8|1: behave like require
|
56 |
+
/******/ __webpack_require__.t = function(value, mode) {
|
57 |
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
58 |
+
/******/ if(mode & 8) return value;
|
59 |
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 |
+
/******/ var ns = Object.create(null);
|
61 |
+
/******/ __webpack_require__.r(ns);
|
62 |
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 |
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 |
+
/******/ return ns;
|
65 |
+
/******/ };
|
66 |
+
/******/
|
67 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
68 |
+
/******/ __webpack_require__.n = function(module) {
|
69 |
+
/******/ var getter = module && module.__esModule ?
|
70 |
+
/******/ function getDefault() { return module['default']; } :
|
71 |
+
/******/ function getModuleExports() { return module; };
|
72 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
73 |
+
/******/ return getter;
|
74 |
+
/******/ };
|
75 |
+
/******/
|
76 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
77 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
+
/******/
|
79 |
+
/******/ // __webpack_public_path__
|
80 |
+
/******/ __webpack_require__.p = "";
|
81 |
+
/******/
|
82 |
+
/******/
|
83 |
+
/******/ // Load entry module and return exports
|
84 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/dashboard.js");
|
85 |
+
/******/ })
|
86 |
+
/************************************************************************/
|
87 |
+
/******/ ({
|
88 |
+
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/dashboard.js":
|
90 |
+
/*!**************************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/dashboard.js ***!
|
92 |
+
\**************************************************************************************************************************************/
|
93 |
+
/*! no static exports found */
|
94 |
+
/***/ (function(module, exports) {
|
95 |
+
|
96 |
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
97 |
+
|
98 |
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
99 |
+
|
100 |
+
document.addEventListener('DOMContentLoaded', function (event) {
|
101 |
+
var elements = document.querySelector('ul.lp-order-statuses');
|
102 |
+
|
103 |
+
var getResponse = /*#__PURE__*/function () {
|
104 |
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ele) {
|
105 |
+
var response;
|
106 |
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
107 |
+
while (1) {
|
108 |
+
switch (_context.prev = _context.next) {
|
109 |
+
case 0:
|
110 |
+
_context.prev = 0;
|
111 |
+
_context.next = 3;
|
112 |
+
return wp.apiFetch({
|
113 |
+
path: wp.url.addQueryArgs('lp/v1/orders/statistic'),
|
114 |
+
method: 'GET'
|
115 |
+
});
|
116 |
+
|
117 |
+
case 3:
|
118 |
+
response = _context.sent;
|
119 |
+
|
120 |
+
if (response.status === 'success' && response.data) {
|
121 |
+
ele.innerHTML = response.data;
|
122 |
+
} else {
|
123 |
+
ele.innerHTML = "<div class=\"lp-ajax-message error\" style=\"display:block\">".concat(response.message && response.message, "</div>");
|
124 |
+
}
|
125 |
+
|
126 |
+
_context.next = 10;
|
127 |
+
break;
|
128 |
+
|
129 |
+
case 7:
|
130 |
+
_context.prev = 7;
|
131 |
+
_context.t0 = _context["catch"](0);
|
132 |
+
ele.innerHTML += "<div class=\"lp-ajax-message error\" style=\"display:block\">".concat(_context.t0.message && _context.t0.message, "</div>");
|
133 |
+
|
134 |
+
case 10:
|
135 |
+
case "end":
|
136 |
+
return _context.stop();
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}, _callee, null, [[0, 7]]);
|
140 |
+
}));
|
141 |
+
|
142 |
+
return function getResponse(_x) {
|
143 |
+
return _ref.apply(this, arguments);
|
144 |
+
};
|
145 |
+
}();
|
146 |
+
|
147 |
+
getResponse(elements);
|
148 |
+
});
|
149 |
+
|
150 |
+
/***/ })
|
151 |
+
|
152 |
+
/******/ });
|
153 |
+
//# sourceMappingURL=dashboard.js.map
|
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}({8:function(e,t){function r(e,t,r,n,o,a,u){try{var i=e[a](u),c=i.value}catch(e){return void r(e)}i.done?t(c):Promise.resolve(c).then(n,o)}document.addEventListener("DOMContentLoaded",(function(e){var t=document.querySelector("ul.lp-order-statuses");(function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:wp.url.addQueryArgs("lp/v1/orders/statistic"),method:"GET"});case 3:"success"===(r=e.sent).status&&r.data?t.innerHTML=r.data:t.innerHTML='<div class="lp-ajax-message error" style="display:block">'.concat(r.message&&r.message,"</div>"),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t.innerHTML+='<div class="lp-ajax-message error" style="display:block">'.concat(e.t0.message&&e.t0.message,"</div>");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})),function(){var t=this,n=arguments;return new Promise((function(o,a){var u=e.apply(t,n);function i(e){r(u,o,a,i,c,"next",e)}function c(e){r(u,o,a,i,c,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}})()(t)}))}});
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
92 |
-
|
93 |
/*! no static exports found */
|
94 |
/***/ (function(module, exports) {
|
95 |
|
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/pages/setup.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/setup.js":
|
90 |
+
/*!**********************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/setup.js ***!
|
92 |
+
\**********************************************************************************************************************************/
|
93 |
/*! no static exports found */
|
94 |
/***/ (function(module, exports) {
|
95 |
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
92 |
-
|
93 |
/*! no static exports found */
|
94 |
/***/ (function(module, exports) {
|
95 |
|
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/pages/statistic.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/statistic.js":
|
90 |
+
/*!**************************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/statistic.js ***!
|
92 |
+
\**************************************************************************************************************************************/
|
93 |
/*! no static exports found */
|
94 |
/***/ (function(module, exports) {
|
95 |
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
92 |
-
|
93 |
/*! no static exports found */
|
94 |
/***/ (function(module, exports) {
|
95 |
|
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/pages/sync-data.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/sync-data.js":
|
90 |
+
/*!**************************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/sync-data.js ***!
|
92 |
+
\**************************************************************************************************************************************/
|
93 |
/*! no static exports found */
|
94 |
/***/ (function(module, exports) {
|
95 |
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
92 |
-
|
93 |
/*! exports provided: default */
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
@@ -154,16 +154,16 @@ var searchThemesAddons = function searchThemesAddons() {};
|
|
154 |
|
155 |
/***/ }),
|
156 |
|
157 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
158 |
-
|
159 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
160 |
-
|
161 |
/*! no exports provided */
|
162 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
163 |
|
164 |
"use strict";
|
165 |
__webpack_require__.r(__webpack_exports__);
|
166 |
-
/* harmony import */ var _addons_search_lp_addons_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addons/search-lp-addons-themes */ "../../../Clouds/Thimpress/Plugins/github.com/
|
167 |
|
168 |
document.addEventListener('DOMContentLoaded', function (event) {
|
169 |
Object(_addons_search_lp_addons_themes__WEBPACK_IMPORTED_MODULE_0__["default"])();
|
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/pages/themes-addons.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/addons/search-lp-addons-themes.js":
|
90 |
+
/*!***********************************************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/addons/search-lp-addons-themes.js ***!
|
92 |
+
\***********************************************************************************************************************************************************/
|
93 |
/*! exports provided: default */
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
154 |
|
155 |
/***/ }),
|
156 |
|
157 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/themes-addons.js":
|
158 |
+
/*!******************************************************************************************************************************************!*\
|
159 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/themes-addons.js ***!
|
160 |
+
\******************************************************************************************************************************************/
|
161 |
/*! no exports provided */
|
162 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
163 |
|
164 |
"use strict";
|
165 |
__webpack_require__.r(__webpack_exports__);
|
166 |
+
/* harmony import */ var _addons_search_lp_addons_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addons/search-lp-addons-themes */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/addons/search-lp-addons-themes.js");
|
167 |
|
168 |
document.addEventListener('DOMContentLoaded', function (event) {
|
169 |
Object(_addons_search_lp_addons_themes__WEBPACK_IMPORTED_MODULE_0__["default"])();
|
@@ -1 +1 @@
|
|
1 |
-
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=
|
1 |
+
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=16)}({16:function(e,n,t){"use strict";var r,o,i,u,l;t.r(n),r=jQuery,o=null,i=null,u=null,l=function(e){u||(u=i.clone());var n=e.toLowerCase().split(/\s+/).filter((function(e,n){return e.length>=3}));i.each((function(e){var t,o,i=r(this).html(""),l=(t=u.eq(e),o=i,t.find(".plugin-card").each((function(){var e,t=r(this),i=t.find(".item-title").text().toLowerCase(),u=t.find(".column-description, .theme-description").text();if(n.length){if(e=new RegExp(n.join("|"),"ig"),i.match(e)||u.match(e)){var l=t.clone();o.append(l)}}else o.append(t.clone())})),i.children().length);i.prev("h2").find("span").html(l)}))},r(document).on("keyup",".lp-search-addon",(function(e){o&&clearTimeout(o),o=setTimeout(l,300,e.target.value)})),r((function(){i=r(".addons-browse")}));var c=function(){};document.addEventListener("DOMContentLoaded",(function(e){c()}))}});
|
@@ -81,25 +81,25 @@
|
|
81 |
/******/
|
82 |
/******/
|
83 |
/******/ // Load entry module and return exports
|
84 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
92 |
-
|
93 |
/*! no exports provided */
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
96 |
"use strict";
|
97 |
__webpack_require__.r(__webpack_exports__);
|
98 |
-
/* harmony import */ var _tools_database_upgrade__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tools/database/upgrade */ "../../../Clouds/Thimpress/Plugins/github.com/
|
99 |
-
/* harmony import */ var _tools_database_create_indexs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tools/database/create_indexs */ "../../../Clouds/Thimpress/Plugins/github.com/
|
100 |
-
/* harmony import */ var _tools_database_re_upgrade_db__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tools/database/re-upgrade-db */ "../../../Clouds/Thimpress/Plugins/github.com/
|
101 |
-
/* harmony import */ var _tools_database_clean_database__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tools/database/clean_database */ "../../../Clouds/Thimpress/Plugins/github.com/
|
102 |
-
/* harmony import */ var _tools_reset_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tools/reset-data */ "../../../Clouds/Thimpress/Plugins/github.com/
|
103 |
|
104 |
|
105 |
|
@@ -219,17 +219,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
219 |
|
220 |
/***/ }),
|
221 |
|
222 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
223 |
-
|
224 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
225 |
-
|
226 |
/*! exports provided: default */
|
227 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
228 |
|
229 |
"use strict";
|
230 |
__webpack_require__.r(__webpack_exports__);
|
231 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
232 |
-
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/
|
233 |
|
234 |
|
235 |
|
@@ -366,17 +366,17 @@ var cleanDatabases = function cleanDatabases() {
|
|
366 |
|
367 |
/***/ }),
|
368 |
|
369 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
370 |
-
|
371 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
372 |
-
|
373 |
/*! exports provided: default */
|
374 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
375 |
|
376 |
"use strict";
|
377 |
__webpack_require__.r(__webpack_exports__);
|
378 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
379 |
-
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/
|
380 |
|
381 |
|
382 |
|
@@ -504,17 +504,17 @@ var createIndexes = function createIndexes() {
|
|
504 |
|
505 |
/***/ }),
|
506 |
|
507 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
508 |
-
|
509 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
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 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
517 |
-
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/
|
518 |
|
519 |
|
520 |
|
@@ -569,17 +569,17 @@ var reUpgradeDB = function reUpgradeDB() {
|
|
569 |
|
570 |
/***/ }),
|
571 |
|
572 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
573 |
-
|
574 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
575 |
-
|
576 |
/*! exports provided: default */
|
577 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
578 |
|
579 |
"use strict";
|
580 |
__webpack_require__.r(__webpack_exports__);
|
581 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
582 |
-
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/
|
583 |
|
584 |
|
585 |
var $ = jQuery;
|
@@ -855,10 +855,10 @@ var getStepsUpgradeStatus = function getStepsUpgradeStatus() {
|
|
855 |
|
856 |
/***/ }),
|
857 |
|
858 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
859 |
-
|
860 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
861 |
-
|
862 |
/*! exports provided: default */
|
863 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
864 |
|
@@ -1237,16 +1237,16 @@ var ResetCourse = function ResetCourse() {
|
|
1237 |
|
1238 |
/***/ }),
|
1239 |
|
1240 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1241 |
-
|
1242 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1243 |
-
|
1244 |
/*! exports provided: default */
|
1245 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1246 |
|
1247 |
"use strict";
|
1248 |
__webpack_require__.r(__webpack_exports__);
|
1249 |
-
/* harmony import */ var _course__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./course */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1250 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
1251 |
|
1252 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -1271,10 +1271,10 @@ var resetData = function resetData() {
|
|
1271 |
|
1272 |
/***/ }),
|
1273 |
|
1274 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1275 |
-
|
1276 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1277 |
-
|
1278 |
/*! exports provided: default */
|
1279 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1280 |
|
@@ -1304,10 +1304,10 @@ var handleAjax = function handleAjax(url, params, functions) {
|
|
1304 |
|
1305 |
/***/ }),
|
1306 |
|
1307 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1308 |
-
|
1309 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1310 |
-
|
1311 |
/*! exports provided: default */
|
1312 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1313 |
|
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/pages/tools.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools.js":
|
90 |
+
/*!**********************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools.js ***!
|
92 |
+
\**********************************************************************************************************************************/
|
93 |
/*! no exports provided */
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
96 |
"use strict";
|
97 |
__webpack_require__.r(__webpack_exports__);
|
98 |
+
/* harmony import */ var _tools_database_upgrade__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tools/database/upgrade */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/upgrade.js");
|
99 |
+
/* harmony import */ var _tools_database_create_indexs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tools/database/create_indexs */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/create_indexs.js");
|
100 |
+
/* harmony import */ var _tools_database_re_upgrade_db__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tools/database/re-upgrade-db */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/re-upgrade-db.js");
|
101 |
+
/* harmony import */ var _tools_database_clean_database__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tools/database/clean_database */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/clean_database.js");
|
102 |
+
/* harmony import */ var _tools_reset_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tools/reset-data */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/reset-data/index.js");
|
103 |
|
104 |
|
105 |
|
219 |
|
220 |
/***/ }),
|
221 |
|
222 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/clean_database.js":
|
223 |
+
/*!**********************************************************************************************************************************************************!*\
|
224 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/clean_database.js ***!
|
225 |
+
\**********************************************************************************************************************************************************/
|
226 |
/*! exports provided: default */
|
227 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
228 |
|
229 |
"use strict";
|
230 |
__webpack_require__.r(__webpack_exports__);
|
231 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
232 |
+
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/handle-ajax-api.js");
|
233 |
|
234 |
|
235 |
|
366 |
|
367 |
/***/ }),
|
368 |
|
369 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/create_indexs.js":
|
370 |
+
/*!*********************************************************************************************************************************************************!*\
|
371 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/create_indexs.js ***!
|
372 |
+
\*********************************************************************************************************************************************************/
|
373 |
/*! exports provided: default */
|
374 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
375 |
|
376 |
"use strict";
|
377 |
__webpack_require__.r(__webpack_exports__);
|
378 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
379 |
+
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/handle-ajax-api.js");
|
380 |
|
381 |
|
382 |
|
504 |
|
505 |
/***/ }),
|
506 |
|
507 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/re-upgrade-db.js":
|
508 |
+
/*!*********************************************************************************************************************************************************!*\
|
509 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/re-upgrade-db.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 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
517 |
+
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/handle-ajax-api.js");
|
518 |
|
519 |
|
520 |
|
569 |
|
570 |
/***/ }),
|
571 |
|
572 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/upgrade.js":
|
573 |
+
/*!***************************************************************************************************************************************************!*\
|
574 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/database/upgrade.js ***!
|
575 |
+
\***************************************************************************************************************************************************/
|
576 |
/*! exports provided: default */
|
577 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
578 |
|
579 |
"use strict";
|
580 |
__webpack_require__.r(__webpack_exports__);
|
581 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
582 |
+
/* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/handle-ajax-api.js");
|
583 |
|
584 |
|
585 |
var $ = jQuery;
|
855 |
|
856 |
/***/ }),
|
857 |
|
858 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/reset-data/course.js":
|
859 |
+
/*!****************************************************************************************************************************************************!*\
|
860 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/reset-data/course.js ***!
|
861 |
+
\****************************************************************************************************************************************************/
|
862 |
/*! exports provided: default */
|
863 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
864 |
|
1237 |
|
1238 |
/***/ }),
|
1239 |
|
1240 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/reset-data/index.js":
|
1241 |
+
/*!***************************************************************************************************************************************************!*\
|
1242 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/reset-data/index.js ***!
|
1243 |
+
\***************************************************************************************************************************************************/
|
1244 |
/*! exports provided: default */
|
1245 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1246 |
|
1247 |
"use strict";
|
1248 |
__webpack_require__.r(__webpack_exports__);
|
1249 |
+
/* harmony import */ var _course__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./course */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/tools/reset-data/course.js");
|
1250 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
1251 |
|
1252 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
1271 |
|
1272 |
/***/ }),
|
1273 |
|
1274 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/handle-ajax-api.js":
|
1275 |
+
/*!**************************************************************************************************************************************!*\
|
1276 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/handle-ajax-api.js ***!
|
1277 |
+
\**************************************************************************************************************************************/
|
1278 |
/*! exports provided: default */
|
1279 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1280 |
|
1304 |
|
1305 |
/***/ }),
|
1306 |
|
1307 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
|
1308 |
+
/*!***************************************************************************************************************************************!*\
|
1309 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
|
1310 |
+
\***************************************************************************************************************************************/
|
1311 |
/*! exports provided: default */
|
1312 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1313 |
|
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},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=11)}({11:function(e,t,n){"use strict";n.r(t);var r=jQuery,a=null,l={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(a=this.elLPOverlay,this.elMainContent=a.find(".main-content"),this.elTitle=a.find(".modal-title"),this.elBtnYes=a.find(".btn-yes"),this.elBtnNo=a.find(".btn-no"),this.elFooter=a.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){a.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof l.callBackYes&&l.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}},o=l,s=function(e,t,n){wp.apiFetch({path:e,method:"POST",data:t}).then((function(e){"function"==typeof n.success&&n.success(e)})).catch((function(e){"function"==typeof n.error&&n.error(e)})).then((function(){"function"==typeof n.completed&&n.completed()}))},i=jQuery,c=i("#lp-tool-upgrade-db"),u=function(){var e=0,t=c.find(".wrapper-terms-upgrade"),n=c.find(".wrapper-lp-status-upgrade"),r=c.find(".wrapper-lp-upgrade-message"),a=null;if(t.length){o.setContentModal(t.html());var l=o.elLPOverlay.find(".terms-upgrade"),u=l.find("input[name=lp-agree-term]"),d=l.find(".error"),p=i("input[name=message-when-upgrading]").val();a=function(){return d.hide(),d.removeClass("learn-press-message"),u.is(":checked")?(s("/lp/v1/database/agree_terms",{agree_terms:1},{}),o.elFooter.find(".learn-press-notice").remove(),o.elFooter.prepend('<span class="learn-press-notice">'+p+"</span>"),o.setContentModal(n.html()),!0):(d.show(),d.addClass("learn-press-message"),o.elMainContent.animate({scrollTop:d.offset().top}),!1)}}else o.setContentModal(n.html()),a=function(){return!0};o.setTitleModal(c.find("h2").html()),o.elBtnYes.text("Upgrade"),o.elBtnYes.show(),o.elBtnNo.text("close"),o.callBackYes=function(){if(a()){e=1,o.elBtnYes.hide(),o.elBtnNo.hide();var t=o.elLPOverlay.find(".lp-group-step"),n=c.find(".lp-item-step"),l=[];i.each(n,(function(e,t){var n=i(t);if(!n.hasClass("completed")){var r=n.find("input").val();l.push(r)}}));var u={steps:l,step:l[0]},d=null,p=function(e,n){(d=t.find("input[value="+e+"]").closest(".lp-item-step")).addClass("running"),100===n&&d.removeClass("running").addClass("completed"),d.find(".progress-bar").css("width",n+"%"),d.find(".percent").text(n+"%")};p(l[0],.1);var f={success:function(n){var a,l;p(u.step,n.percent),u.step!==n.name&&p(n.name,.1),a=u.step,l=(d=t.find("input[value="+a+"]").closest(".lp-item-step")).offset().top-o.elMainContent.offset().top+o.elMainContent.scrollTop(),o.elMainContent.stop().animate({scrollTop:l},600),"success"===n.status?(u.step=n.name,u.data=n.data,setTimeout((function(){s("/lp/v1/database/upgrade",u,f)}),800)):"finished"===n.status?(e=0,d.removeClass("running").addClass("completed"),setTimeout((function(){o.setContentModal(r.html())}),1e3),o.elFooter.find(".learn-press-notice").remove(),o.elBtnNo.show(),o.elBtnNo.on("click",(function(){window.location.reload()}))):(e=0,o.elFooter.find(".learn-press-notice").remove(),d.removeClass("running").addClass("error"),o.setContentModal(r.html(),(function(){o.elBtnYes.text("Retry").show(),o.callBackYes=function(){window.location.href=lpGlobalSettings.siteurl+"/wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},o.elBtnNo.show(),n.message||(n.message="Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help"),o.elMainContent.find(".learn-press-message").addClass("error").html(n.message)})))},error:function(t){e=0,o.setContentModal(r.html(),(function(){o.elBtnYes.text("Retry").show(),o.callBackYes=function(){window.location.location="wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},o.elBtnNo.show(),t.message||(t.message="Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help"),o.elMainContent.find(".learn-press-message").addClass("error").html(t.message)}))},completed:function(){}};s("/lp/v1/database/upgrade",u,f)}},window.onbeforeunload=function(){if(e)return"LP is upgrading Database. Are you want to reload page?"},window.onclose=function(){if(e)return"LP is upgrading Database. Are you want to close page?"}},d=function(){if(c.length&&o.init()){var e=i(".wrapper-lp-status-upgrade"),t=window.location.search,n=new URLSearchParams(t).get("action");"upgrade-db"===n&&(o.elLPOverlay.show(),o.setTitleModal(c.find("h2").html()),o.setContentModal(i(".wrapper-lp-loading").html())),s("/lp/v1/database/get_steps",{},{success:function(t){var r=t.steps_completed,a=t.steps_default;if(void 0===r||void 0===a)return console.log("invalid steps_completed and steps_default"),!1;var l="";for(var s in a){var c=a[s],d=c.steps;for(var p in l='<div class="lp-group-step">',l+="<h3>"+c.label+"</h3>",d){var f=d[p],m="";void 0!==r[p]&&(m="completed"),l+='<div class="lp-item-step '+m+'">',l+='<div class="lp-item-step-left"><input type="hidden" name="lp_steps_upgrade_db[]" value="'+f.name+'" /></div>',l+='<div class="lp-item-step-right">',l+='<label for=""><strong></strong>'+f.label+"</label>",l+='<div class="description">'+f.description+"</div>",l+='<div class="percent"></div>',l+='<span class="progress-bar"></span>',l+="</div>",l+="</div>"}l+="</div>",e.append(l);var h=i(".lp-btn-upgrade-db");"upgrade-db"===n&&u(),h.on("click",(function(){o.elLPOverlay.show(),u()}))}},error:function(e){},completed:function(){}})}},p=function(){var e=document.querySelector("#lp-tool-create-indexes-tables");e&&e.querySelector(".lp-btn-create-indexes").addEventListener("click",(function(t){t.preventDefault();var n=e.querySelector(".wrapper-lp-loading");if(o.init()){o.elLPOverlay.show(),o.setContentModal(n.innerHTML),o.setTitleModal(e.querySelector("h2").textContent),o.elBtnYes[0].style.display="inline-block",o.elBtnYes[0].textContent="Run",o.elBtnNo[0].textContent="Close";var r={success:function(e){e.status,e.message;var t=e.data,n=t.tables,r=t.table,a=document.querySelector(".example-lp-group-step");o.setContentModal(a.innerHTML);var l=o.elLPOverlay[0].querySelector(".lp-group-step "),i=function(e,t){var n=l.querySelector("input[value="+e+"]").closest(".lp-item-step");n.classList.add("running"),100===t&&(n.classList.remove("running"),n.classList.add("completed")),n.querySelector(".progress-bar").style.width=t};for(var c in n){var u=o.elLPOverlay[0].querySelector(".lp-item-step").cloneNode(!0),d=u.querySelector("input");u.querySelector("label").textContent="Table: ".concat(c),d.value=c,l.append(u)}o.callBackYes=function(){var e="/lp/v1/admin/tools/create-indexs",t={tables:n,table:r};o.elBtnNo[0].style.display="none",o.elBtnYes[0].style.display="none",i(r,.1);var a={success:function(n){var r,c,u=n.status,d=n.message,p=n.data,f=p.table,m=p.percent;i(t.table,m),void 0!==f&&(t.table!==f&&(i(f,.1),r=f,c=l.querySelector("input[value="+r+"]").closest(".lp-item-step").offsetTop-o.elMainContent[0].offsetTop+o.elMainContent[0].scrollTop,o.elMainContent.stop().animate({scrollTop:c},600)),t.table=f),"success"===u?setTimeout((function(){s(e,t,a)}),2e3):"finished"===u?(console.log("finished"),o.elBtnNo[0].style.display="inline-block",o.elBtnNo[0].textContent="Finish"):console.log(d)},error:function(e){console.log(e)},completed:function(){}};s(e,t,a)}},error:function(e){},completed:function(){}};s("/lp/v1/admin/tools/list-tables-indexs",{},r)}}))},f=function(){var e=document.querySelector("#lp-tool-re-upgrade-db");if(e){var t="lp/v1/database/check-db-valid-re-upgrade";s(t,{},{success:function(n){if(n.data.can_re_upgrade){e.style.display="block";var r=e.querySelector(".lp-btn-re-upgrade-db"),a=e.querySelector(".learn-press-message");r.addEventListener("click",(function(){confirm("Are you want to Re Upgrade!")&&s(t="lp/v1/database/del-tb-lp-upgrade-db",{},{success:function(e){var t=e.status,n=(e.message,e.data.url);"success"===t&&void 0!==n&&(window.location.href=n)},error:function(e){a.classList.add("error"),a.textContent=e.message,a.style.display="block"}})}))}},error:function(e){}})}},m=function(){var e=document.querySelector("#lp-tool-clean-database");e&&e.querySelector(".lp-btn-clean-db").addEventListener("click",(function(t){t.preventDefault();var n=document.querySelector("#tools-select__id"),r=n.querySelectorAll("ul li input"),a=Array.prototype.slice.call(r).some((function(e){return e.checked})),l=e.querySelector(".tools-prepare__message");if(0==a)return l.style.display="block",void(l.textContent="You must choose at least one table to take this action");l.style.display="none";var i=e.querySelector(".wrapper-lp-loading");if(o.init()){o.elLPOverlay.show(),o.setContentModal(i.innerHTML),o.setTitleModal(e.querySelector("h2").textContent),o.elBtnYes[0].style.display="inline-block",o.elBtnYes[0].textContent="Run",o.elBtnNo[0].textContent="Close";var c=new Array;n.querySelectorAll("ul li input:checked").forEach((function(e){c.push(e.value)}));var u=c[0],d=i.querySelector(".progressbar__item").getAttribute("data-total"),p=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");if(d<=0)return o.elBtnYes[0].style.display="none",p.textContent="There is no data that need to be repaired in the chosen tables",void(p.style.display="block");o.callBackYes=function(){if(0!=confirm("The modified data is impossible to be restored. Please backup your website before doing this.")){var e=document.querySelector(".lp-modal-body .main-content"),t=e.querySelector(".lp-tool__message");t.textContent="This action is in processing. Don't close this page",t.style.display="block";var n="/lp/v1/admin/tools/clean-tables",r={tables:u,itemtotal:d};o.elBtnNo[0].style.display="none",o.elBtnYes[0].style.display="none";var a={success:function(t){var l=t.status,i=t.message,c=t.data,u=c.processed,p=c.percent,f=e.querySelector(".progressbar__item"),m=f.querySelector(".progressbar__rows"),h=f.querySelector(".progressbar__percent"),v=f.querySelector(".progressbar__value");if(console.log(l),"success"===l)setTimeout((function(){s(n,r,a)}),2e3),m.textContent=u+" / "+d,h.textContent="( "+p+"% )",v.style.width=p+"%";else if("finished"===l){m.textContent=d+" / "+d,h.textContent="( 100% )";var y=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");y.textContent="Process has been completed. Press click the finish button to close this popup",y.style.color="white",y.style.background="green",v.style.width="100%",o.elBtnNo[0].style.display="inline-block",o.elBtnNo[0].textContent="Finish",o.elBtnNo[0].addEventListener("click",(function(){location.reload()}))}else console.log(i)},error:function(e){console.log(e)},completed:function(){}};s(n,r,a)}}}}))};function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=C(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,l=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw l}}}}function v(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t,n,r,a,l,o){try{var s=e[l](o),i=s.value}catch(e){return void n(e)}s.done?t(i):Promise.resolve(i).then(r,a)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var l=e.apply(t,n);function o(e){y(l,r,a,o,s,"next",e)}function s(e){y(l,r,a,o,s,"throw",e)}o(void 0)}))}}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,a,l=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return l}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x=wp.i18n.__,S=wp.components,_=S.TextControl,k=S.Button,B=S.Spinner,R=S.CheckboxControl,E=S.Notice,M=wp.element,T=M.useState,q=M.useEffect,P=wp.url.addQueryArgs,A=function(){var e=b(T(!1),2),t=e[0],n=e[1],r=b(T(""),2),a=r[0],l=r[1],o=b(T([]),2),s=o[0],i=o[1],c=b(T([]),2),u=c[0],d=c[1],p=b(T([]),2),f=p[0],m=p[1],y=b(T(!1),2),C=y[0],w=y[1];q((function(){S(a)}),[a]);var S=function(){var e=g(regeneratorRuntime.mark((function e(r){var a,l,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r&&!t){e.next=5;break}return m([]),i([]),e.abrupt("return");case 5:if(!(r.length<3)){e.next=9;break}return m([{status:"error",message:"Please enter at least 3 characters to searching course."}]),i([]),e.abrupt("return");case 9:return n(!0),e.next=12,wp.apiFetch({path:P("lp/v1/admin/tools/reset-data/search-courses",{s:r}),method:"GET"});case 12:a=e.sent,l=a.status,o=a.data,n(!1),"success"===l?(i(o),m([])):(m([{status:"error",message:a.message||"LearnPress: Search Course Fail!"}]),i([])),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),console.log(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[0,18]])})));return function(t){return e.apply(this,arguments)}}();var M=function(){var e=g(regeneratorRuntime.mark((function e(){var t,n,r,a,l,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==u.length){e.next=3;break}return m([{status:"error",message:"Please chooce Course for reset data!"}]),e.abrupt("return");case 3:if(confirm("Are you sure to reset course progress of all users enrolled this course?")){e.next=5;break}return e.abrupt("return");case 5:t=[],e.prev=6,w(!0),n=h(u),e.prev=9,n.s();case 11:if((r=n.n()).done){e.next=20;break}return a=r.value,e.next=15,wp.apiFetch({path:P("lp/v1/admin/tools/reset-data/reset-courses",{courseId:a}),method:"GET"});case 15:l=e.sent,o=l.status,l.data,s=l.message,t.push({status:o,message:s||"Course #".concat(a," reset successfully!")});case 18:e.next=11;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(9),n.e(e.t0);case 25:return e.prev=25,n.f(),e.finish(25);case 28:w(!1),e.next=34;break;case 31:e.prev=31,e.t1=e.catch(6),t.push({status:"error",message:e.t1.message||"LearnPress Error: Reset Course Data."});case 34:m(t);case 35:case"end":return e.stop()}}),e,null,[[6,31],[9,22,25,28]])})));return function(){return e.apply(this,arguments)}}();return React.createElement(React.Fragment,null,React.createElement("h2",null,x("Reset course progress","learnpress")),React.createElement("div",{className:"description"},React.createElement("p",null,x("This action will reset progress of a course for all users have enrolled.","learnpress")),React.createElement("p",null,x("Search results only show course have user data.","learnpress")),React.createElement("div",null,React.createElement(_,{placeholder:x("Search course by name","learnpress"),value:a,onChange:function(e){return l(e)},style:{width:300}}))),t&&React.createElement(B,null),s.length>0&&React.createElement(React.Fragment,null,React.createElement("div",{className:"lp-reset-course_progress",style:{border:"1px solid #eee"}},React.createElement("div",null,React.createElement("div",{style:{background:"#eee"}},React.createElement("div",null,React.createElement(R,{checked:u.length===s.length,onChange:function(){u.length===s.length?d([]):d(s.map((function(e){return e.id})))},style:{margin:0}})),React.createElement("div",null,x("ID","learnpress")),React.createElement("div",null,x("Name","learnpress")),React.createElement("div",null,x("Students","learnpress")))),React.createElement("div",{style:{height:"100%",maxHeight:200,overflow:"auto"}},s.map((function(e){return React.createElement("div",{style:{borderTop:"1px solid #eee"},key:e.id},React.createElement("div",null,React.createElement(R,{checked:u.includes(e.id),onChange:function(){return function(e){var t=v(u);if(t.includes(e)){var n=t.indexOf(e);n>-1&&t.splice(n,1)}else t.push(e);d(t)}(e.id)}})),React.createElement("div",null,"#",e.id),React.createElement("div",null,e.title),React.createElement("div",null,e.students))})))),C?React.createElement(B,null):React.createElement(k,{isPrimary:!0,onClick:function(){return M()},style:{marginTop:10,height:30}},x("Reset now","learnpress"))),f.length>0&&f.map((function(e,t){return React.createElement(E,{status:e.status,key:t,isDismissible:!1},e.message)})),React.createElement("style",null,"\t\t\t\t.lp-reset-course_progress .components-base-control__field {\t\t\t\t\tmargin: 0;\t\t\t\t}\t\t\t\t.components-notice{\t\t\t\t\tmargin-left: 0;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div{\t\t\t\t\tdisplay: grid;\t\t\t\t\tgrid-template-columns: 80px 50px 1fr 80px;\t\t\t\t\talign-items: center;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div > div{\t\t\t\t\tmaegin: 0;\t\t\t\t\tpadding: 8px 10px;\t\t\t\t}\t\t\t\t"))};function L(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var j,N,Y,F,D,I,U,G,H=function(){document.querySelectorAll("#learn-press-reset-course-users").length>0&&wp.element.render(React.createElement(A,null),L(document.querySelectorAll("#learn-press-reset-course-users"))[0])};j=jQuery,N=j(document),Y=!1,F=function(e){e.preventDefault();var t=j(this);Y||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(t.addClass("disabled").html(t.data("installing-text")),j(".lp-install-sample__response").remove(),Y=!0,j.ajax({url:t.attr("href"),data:j(".lp-install-sample__options").serializeJSON(),success:function(e){t.removeClass("disabled").html(t.data("text")),Y=!1,j(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),Y=!1,j(response).insertBefore(t.parent())}}))},D=function(e){e.preventDefault();var t=j(this);Y||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(t.addClass("disabled").html(t.data("uninstalling-text")),Y=!0,j.ajax({url:t.attr("href"),success:function(e){t.removeClass("disabled").html(t.data("text")),Y=!1,j(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),Y=!1,j(response).insertBefore(t.parent())}}))},I=function(e){e.preventDefault();var t=j(this);t.hasClass("disabled")||(t.addClass("disabled").html(t.data("cleaning-text")),j.ajax({url:t.attr("href"),data:{},success:function(e){t.removeClass("disabled").html(t.data("text"))},error:function(){t.removeClass("disabled").html(t.data("text"))}}))},U=function(){j.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success:function(e){},error:function(){}})},G=function(e){e.preventDefault(),j(".lp-install-sample__options").toggleClass("hide-if-js")},j((function(){d(),p(),f(),H(),m(),N.on("click",".lp-install-sample__install",F).on("click",".lp-install-sample__uninstall",D).on("click","#learn-press-clear-cache",I).on("click",'input[name="enable_hard_cache"]',U).on("click",".lp-install-sample__toggle-options",G)}))}});
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},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)}({13:function(e,t,n){"use strict";n.r(t);var r=jQuery,a=null,l={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(a=this.elLPOverlay,this.elMainContent=a.find(".main-content"),this.elTitle=a.find(".modal-title"),this.elBtnYes=a.find(".btn-yes"),this.elBtnNo=a.find(".btn-no"),this.elFooter=a.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){a.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof l.callBackYes&&l.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}},o=l,s=function(e,t,n){wp.apiFetch({path:e,method:"POST",data:t}).then((function(e){"function"==typeof n.success&&n.success(e)})).catch((function(e){"function"==typeof n.error&&n.error(e)})).then((function(){"function"==typeof n.completed&&n.completed()}))},i=jQuery,c=i("#lp-tool-upgrade-db"),u=function(){var e=0,t=c.find(".wrapper-terms-upgrade"),n=c.find(".wrapper-lp-status-upgrade"),r=c.find(".wrapper-lp-upgrade-message"),a=null;if(t.length){o.setContentModal(t.html());var l=o.elLPOverlay.find(".terms-upgrade"),u=l.find("input[name=lp-agree-term]"),d=l.find(".error"),p=i("input[name=message-when-upgrading]").val();a=function(){return d.hide(),d.removeClass("learn-press-message"),u.is(":checked")?(s("/lp/v1/database/agree_terms",{agree_terms:1},{}),o.elFooter.find(".learn-press-notice").remove(),o.elFooter.prepend('<span class="learn-press-notice">'+p+"</span>"),o.setContentModal(n.html()),!0):(d.show(),d.addClass("learn-press-message"),o.elMainContent.animate({scrollTop:d.offset().top}),!1)}}else o.setContentModal(n.html()),a=function(){return!0};o.setTitleModal(c.find("h2").html()),o.elBtnYes.text("Upgrade"),o.elBtnYes.show(),o.elBtnNo.text("close"),o.callBackYes=function(){if(a()){e=1,o.elBtnYes.hide(),o.elBtnNo.hide();var t=o.elLPOverlay.find(".lp-group-step"),n=c.find(".lp-item-step"),l=[];i.each(n,(function(e,t){var n=i(t);if(!n.hasClass("completed")){var r=n.find("input").val();l.push(r)}}));var u={steps:l,step:l[0]},d=null,p=function(e,n){(d=t.find("input[value="+e+"]").closest(".lp-item-step")).addClass("running"),100===n&&d.removeClass("running").addClass("completed"),d.find(".progress-bar").css("width",n+"%"),d.find(".percent").text(n+"%")};p(l[0],.1);var f={success:function(n){var a,l;p(u.step,n.percent),u.step!==n.name&&p(n.name,.1),a=u.step,l=(d=t.find("input[value="+a+"]").closest(".lp-item-step")).offset().top-o.elMainContent.offset().top+o.elMainContent.scrollTop(),o.elMainContent.stop().animate({scrollTop:l},600),"success"===n.status?(u.step=n.name,u.data=n.data,setTimeout((function(){s("/lp/v1/database/upgrade",u,f)}),800)):"finished"===n.status?(e=0,d.removeClass("running").addClass("completed"),setTimeout((function(){o.setContentModal(r.html())}),1e3),o.elFooter.find(".learn-press-notice").remove(),o.elBtnNo.show(),o.elBtnNo.on("click",(function(){window.location.reload()}))):(e=0,o.elFooter.find(".learn-press-notice").remove(),d.removeClass("running").addClass("error"),o.setContentModal(r.html(),(function(){o.elBtnYes.text("Retry").show(),o.callBackYes=function(){window.location.href=lpGlobalSettings.siteurl+"/wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},o.elBtnNo.show(),n.message||(n.message="Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help"),o.elMainContent.find(".learn-press-message").addClass("error").html(n.message)})))},error:function(t){e=0,o.setContentModal(r.html(),(function(){o.elBtnYes.text("Retry").show(),o.callBackYes=function(){window.location.location="wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},o.elBtnNo.show(),t.message||(t.message="Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help"),o.elMainContent.find(".learn-press-message").addClass("error").html(t.message)}))},completed:function(){}};s("/lp/v1/database/upgrade",u,f)}},window.onbeforeunload=function(){if(e)return"LP is upgrading Database. Are you want to reload page?"},window.onclose=function(){if(e)return"LP is upgrading Database. Are you want to close page?"}},d=function(){if(c.length&&o.init()){var e=i(".wrapper-lp-status-upgrade"),t=window.location.search,n=new URLSearchParams(t).get("action");"upgrade-db"===n&&(o.elLPOverlay.show(),o.setTitleModal(c.find("h2").html()),o.setContentModal(i(".wrapper-lp-loading").html())),s("/lp/v1/database/get_steps",{},{success:function(t){var r=t.steps_completed,a=t.steps_default;if(void 0===r||void 0===a)return console.log("invalid steps_completed and steps_default"),!1;var l="";for(var s in a){var c=a[s],d=c.steps;for(var p in l='<div class="lp-group-step">',l+="<h3>"+c.label+"</h3>",d){var f=d[p],m="";void 0!==r[p]&&(m="completed"),l+='<div class="lp-item-step '+m+'">',l+='<div class="lp-item-step-left"><input type="hidden" name="lp_steps_upgrade_db[]" value="'+f.name+'" /></div>',l+='<div class="lp-item-step-right">',l+='<label for=""><strong></strong>'+f.label+"</label>",l+='<div class="description">'+f.description+"</div>",l+='<div class="percent"></div>',l+='<span class="progress-bar"></span>',l+="</div>",l+="</div>"}l+="</div>",e.append(l);var h=i(".lp-btn-upgrade-db");"upgrade-db"===n&&u(),h.on("click",(function(){o.elLPOverlay.show(),u()}))}},error:function(e){},completed:function(){}})}},p=function(){var e=document.querySelector("#lp-tool-create-indexes-tables");e&&e.querySelector(".lp-btn-create-indexes").addEventListener("click",(function(t){t.preventDefault();var n=e.querySelector(".wrapper-lp-loading");if(o.init()){o.elLPOverlay.show(),o.setContentModal(n.innerHTML),o.setTitleModal(e.querySelector("h2").textContent),o.elBtnYes[0].style.display="inline-block",o.elBtnYes[0].textContent="Run",o.elBtnNo[0].textContent="Close";var r={success:function(e){e.status,e.message;var t=e.data,n=t.tables,r=t.table,a=document.querySelector(".example-lp-group-step");o.setContentModal(a.innerHTML);var l=o.elLPOverlay[0].querySelector(".lp-group-step "),i=function(e,t){var n=l.querySelector("input[value="+e+"]").closest(".lp-item-step");n.classList.add("running"),100===t&&(n.classList.remove("running"),n.classList.add("completed")),n.querySelector(".progress-bar").style.width=t};for(var c in n){var u=o.elLPOverlay[0].querySelector(".lp-item-step").cloneNode(!0),d=u.querySelector("input");u.querySelector("label").textContent="Table: ".concat(c),d.value=c,l.append(u)}o.callBackYes=function(){var e="/lp/v1/admin/tools/create-indexs",t={tables:n,table:r};o.elBtnNo[0].style.display="none",o.elBtnYes[0].style.display="none",i(r,.1);var a={success:function(n){var r,c,u=n.status,d=n.message,p=n.data,f=p.table,m=p.percent;i(t.table,m),void 0!==f&&(t.table!==f&&(i(f,.1),r=f,c=l.querySelector("input[value="+r+"]").closest(".lp-item-step").offsetTop-o.elMainContent[0].offsetTop+o.elMainContent[0].scrollTop,o.elMainContent.stop().animate({scrollTop:c},600)),t.table=f),"success"===u?setTimeout((function(){s(e,t,a)}),2e3):"finished"===u?(console.log("finished"),o.elBtnNo[0].style.display="inline-block",o.elBtnNo[0].textContent="Finish"):console.log(d)},error:function(e){console.log(e)},completed:function(){}};s(e,t,a)}},error:function(e){},completed:function(){}};s("/lp/v1/admin/tools/list-tables-indexs",{},r)}}))},f=function(){var e=document.querySelector("#lp-tool-re-upgrade-db");if(e){var t="lp/v1/database/check-db-valid-re-upgrade";s(t,{},{success:function(n){if(n.data.can_re_upgrade){e.style.display="block";var r=e.querySelector(".lp-btn-re-upgrade-db"),a=e.querySelector(".learn-press-message");r.addEventListener("click",(function(){confirm("Are you want to Re Upgrade!")&&s(t="lp/v1/database/del-tb-lp-upgrade-db",{},{success:function(e){var t=e.status,n=(e.message,e.data.url);"success"===t&&void 0!==n&&(window.location.href=n)},error:function(e){a.classList.add("error"),a.textContent=e.message,a.style.display="block"}})}))}},error:function(e){}})}},m=function(){var e=document.querySelector("#lp-tool-clean-database");e&&e.querySelector(".lp-btn-clean-db").addEventListener("click",(function(t){t.preventDefault();var n=document.querySelector("#tools-select__id"),r=n.querySelectorAll("ul li input"),a=Array.prototype.slice.call(r).some((function(e){return e.checked})),l=e.querySelector(".tools-prepare__message");if(0==a)return l.style.display="block",void(l.textContent="You must choose at least one table to take this action");l.style.display="none";var i=e.querySelector(".wrapper-lp-loading");if(o.init()){o.elLPOverlay.show(),o.setContentModal(i.innerHTML),o.setTitleModal(e.querySelector("h2").textContent),o.elBtnYes[0].style.display="inline-block",o.elBtnYes[0].textContent="Run",o.elBtnNo[0].textContent="Close";var c=new Array;n.querySelectorAll("ul li input:checked").forEach((function(e){c.push(e.value)}));var u=c[0],d=i.querySelector(".progressbar__item").getAttribute("data-total"),p=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");if(d<=0)return o.elBtnYes[0].style.display="none",p.textContent="There is no data that need to be repaired in the chosen tables",void(p.style.display="block");o.callBackYes=function(){if(0!=confirm("The modified data is impossible to be restored. Please backup your website before doing this.")){var e=document.querySelector(".lp-modal-body .main-content"),t=e.querySelector(".lp-tool__message");t.textContent="This action is in processing. Don't close this page",t.style.display="block";var n="/lp/v1/admin/tools/clean-tables",r={tables:u,itemtotal:d};o.elBtnNo[0].style.display="none",o.elBtnYes[0].style.display="none";var a={success:function(t){var l=t.status,i=t.message,c=t.data,u=c.processed,p=c.percent,f=e.querySelector(".progressbar__item"),m=f.querySelector(".progressbar__rows"),h=f.querySelector(".progressbar__percent"),v=f.querySelector(".progressbar__value");if(console.log(l),"success"===l)setTimeout((function(){s(n,r,a)}),2e3),m.textContent=u+" / "+d,h.textContent="( "+p+"% )",v.style.width=p+"%";else if("finished"===l){m.textContent=d+" / "+d,h.textContent="( 100% )";var y=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");y.textContent="Process has been completed. Press click the finish button to close this popup",y.style.color="white",y.style.background="green",v.style.width="100%",o.elBtnNo[0].style.display="inline-block",o.elBtnNo[0].textContent="Finish",o.elBtnNo[0].addEventListener("click",(function(){location.reload()}))}else console.log(i)},error:function(e){console.log(e)},completed:function(){}};s(n,r,a)}}}}))};function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=C(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,l=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw l}}}}function v(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t,n,r,a,l,o){try{var s=e[l](o),i=s.value}catch(e){return void n(e)}s.done?t(i):Promise.resolve(i).then(r,a)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var l=e.apply(t,n);function o(e){y(l,r,a,o,s,"next",e)}function s(e){y(l,r,a,o,s,"throw",e)}o(void 0)}))}}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,a,l=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return l}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x=wp.i18n.__,S=wp.components,_=S.TextControl,k=S.Button,B=S.Spinner,R=S.CheckboxControl,E=S.Notice,M=wp.element,T=M.useState,q=M.useEffect,P=wp.url.addQueryArgs,A=function(){var e=b(T(!1),2),t=e[0],n=e[1],r=b(T(""),2),a=r[0],l=r[1],o=b(T([]),2),s=o[0],i=o[1],c=b(T([]),2),u=c[0],d=c[1],p=b(T([]),2),f=p[0],m=p[1],y=b(T(!1),2),C=y[0],w=y[1];q((function(){S(a)}),[a]);var S=function(){var e=g(regeneratorRuntime.mark((function e(r){var a,l,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r&&!t){e.next=5;break}return m([]),i([]),e.abrupt("return");case 5:if(!(r.length<3)){e.next=9;break}return m([{status:"error",message:"Please enter at least 3 characters to searching course."}]),i([]),e.abrupt("return");case 9:return n(!0),e.next=12,wp.apiFetch({path:P("lp/v1/admin/tools/reset-data/search-courses",{s:r}),method:"GET"});case 12:a=e.sent,l=a.status,o=a.data,n(!1),"success"===l?(i(o),m([])):(m([{status:"error",message:a.message||"LearnPress: Search Course Fail!"}]),i([])),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),console.log(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[0,18]])})));return function(t){return e.apply(this,arguments)}}();var M=function(){var e=g(regeneratorRuntime.mark((function e(){var t,n,r,a,l,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==u.length){e.next=3;break}return m([{status:"error",message:"Please chooce Course for reset data!"}]),e.abrupt("return");case 3:if(confirm("Are you sure to reset course progress of all users enrolled this course?")){e.next=5;break}return e.abrupt("return");case 5:t=[],e.prev=6,w(!0),n=h(u),e.prev=9,n.s();case 11:if((r=n.n()).done){e.next=20;break}return a=r.value,e.next=15,wp.apiFetch({path:P("lp/v1/admin/tools/reset-data/reset-courses",{courseId:a}),method:"GET"});case 15:l=e.sent,o=l.status,l.data,s=l.message,t.push({status:o,message:s||"Course #".concat(a," reset successfully!")});case 18:e.next=11;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(9),n.e(e.t0);case 25:return e.prev=25,n.f(),e.finish(25);case 28:w(!1),e.next=34;break;case 31:e.prev=31,e.t1=e.catch(6),t.push({status:"error",message:e.t1.message||"LearnPress Error: Reset Course Data."});case 34:m(t);case 35:case"end":return e.stop()}}),e,null,[[6,31],[9,22,25,28]])})));return function(){return e.apply(this,arguments)}}();return React.createElement(React.Fragment,null,React.createElement("h2",null,x("Reset course progress","learnpress")),React.createElement("div",{className:"description"},React.createElement("p",null,x("This action will reset progress of a course for all users have enrolled.","learnpress")),React.createElement("p",null,x("Search results only show course have user data.","learnpress")),React.createElement("div",null,React.createElement(_,{placeholder:x("Search course by name","learnpress"),value:a,onChange:function(e){return l(e)},style:{width:300}}))),t&&React.createElement(B,null),s.length>0&&React.createElement(React.Fragment,null,React.createElement("div",{className:"lp-reset-course_progress",style:{border:"1px solid #eee"}},React.createElement("div",null,React.createElement("div",{style:{background:"#eee"}},React.createElement("div",null,React.createElement(R,{checked:u.length===s.length,onChange:function(){u.length===s.length?d([]):d(s.map((function(e){return e.id})))},style:{margin:0}})),React.createElement("div",null,x("ID","learnpress")),React.createElement("div",null,x("Name","learnpress")),React.createElement("div",null,x("Students","learnpress")))),React.createElement("div",{style:{height:"100%",maxHeight:200,overflow:"auto"}},s.map((function(e){return React.createElement("div",{style:{borderTop:"1px solid #eee"},key:e.id},React.createElement("div",null,React.createElement(R,{checked:u.includes(e.id),onChange:function(){return function(e){var t=v(u);if(t.includes(e)){var n=t.indexOf(e);n>-1&&t.splice(n,1)}else t.push(e);d(t)}(e.id)}})),React.createElement("div",null,"#",e.id),React.createElement("div",null,e.title),React.createElement("div",null,e.students))})))),C?React.createElement(B,null):React.createElement(k,{isPrimary:!0,onClick:function(){return M()},style:{marginTop:10,height:30}},x("Reset now","learnpress"))),f.length>0&&f.map((function(e,t){return React.createElement(E,{status:e.status,key:t,isDismissible:!1},e.message)})),React.createElement("style",null,"\t\t\t\t.lp-reset-course_progress .components-base-control__field {\t\t\t\t\tmargin: 0;\t\t\t\t}\t\t\t\t.components-notice{\t\t\t\t\tmargin-left: 0;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div{\t\t\t\t\tdisplay: grid;\t\t\t\t\tgrid-template-columns: 80px 50px 1fr 80px;\t\t\t\t\talign-items: center;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div > div{\t\t\t\t\tmaegin: 0;\t\t\t\t\tpadding: 8px 10px;\t\t\t\t}\t\t\t\t"))};function L(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var j,N,Y,F,D,I,U,G,H=function(){document.querySelectorAll("#learn-press-reset-course-users").length>0&&wp.element.render(React.createElement(A,null),L(document.querySelectorAll("#learn-press-reset-course-users"))[0])};j=jQuery,N=j(document),Y=!1,F=function(e){e.preventDefault();var t=j(this);Y||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(t.addClass("disabled").html(t.data("installing-text")),j(".lp-install-sample__response").remove(),Y=!0,j.ajax({url:t.attr("href"),data:j(".lp-install-sample__options").serializeJSON(),success:function(e){t.removeClass("disabled").html(t.data("text")),Y=!1,j(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),Y=!1,j(response).insertBefore(t.parent())}}))},D=function(e){e.preventDefault();var t=j(this);Y||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(t.addClass("disabled").html(t.data("uninstalling-text")),Y=!0,j.ajax({url:t.attr("href"),success:function(e){t.removeClass("disabled").html(t.data("text")),Y=!1,j(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),Y=!1,j(response).insertBefore(t.parent())}}))},I=function(e){e.preventDefault();var t=j(this);t.hasClass("disabled")||(t.addClass("disabled").html(t.data("cleaning-text")),j.ajax({url:t.attr("href"),data:{},success:function(e){t.removeClass("disabled").html(t.data("text"))},error:function(){t.removeClass("disabled").html(t.data("text"))}}))},U=function(){j.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success:function(e){},error:function(){}})},G=function(e){e.preventDefault(),j(".lp-install-sample__options").toggleClass("hide-if-js")},j((function(){d(),p(),f(),H(),m(),N.on("click",".lp-install-sample__install",F).on("click",".lp-install-sample__uninstall",D).on("click","#learn-press-clear-cache",I).on("click",'input[name="enable_hard_cache"]',U).on("click",".lp-install-sample__toggle-options",G)}))}});
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/******/ (function(modules) { // webpackBootstrap
|
2 |
+
/******/ // The module cache
|
3 |
+
/******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 |
+
/******/ }
|
41 |
+
/******/ };
|
42 |
+
/******/
|
43 |
+
/******/ // define __esModule on exports
|
44 |
+
/******/ __webpack_require__.r = function(exports) {
|
45 |
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 |
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 |
+
/******/ }
|
48 |
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
49 |
+
/******/ };
|
50 |
+
/******/
|
51 |
+
/******/ // create a fake namespace object
|
52 |
+
/******/ // mode & 1: value is a module id, require it
|
53 |
+
/******/ // mode & 2: merge all properties of value into the ns
|
54 |
+
/******/ // mode & 4: return value when already ns object
|
55 |
+
/******/ // mode & 8|1: behave like require
|
56 |
+
/******/ __webpack_require__.t = function(value, mode) {
|
57 |
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
58 |
+
/******/ if(mode & 8) return value;
|
59 |
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 |
+
/******/ var ns = Object.create(null);
|
61 |
+
/******/ __webpack_require__.r(ns);
|
62 |
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 |
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 |
+
/******/ return ns;
|
65 |
+
/******/ };
|
66 |
+
/******/
|
67 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
68 |
+
/******/ __webpack_require__.n = function(module) {
|
69 |
+
/******/ var getter = module && module.__esModule ?
|
70 |
+
/******/ function getDefault() { return module['default']; } :
|
71 |
+
/******/ function getModuleExports() { return module; };
|
72 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
73 |
+
/******/ return getter;
|
74 |
+
/******/ };
|
75 |
+
/******/
|
76 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
77 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
+
/******/
|
79 |
+
/******/ // __webpack_public_path__
|
80 |
+
/******/ __webpack_require__.p = "";
|
81 |
+
/******/
|
82 |
+
/******/
|
83 |
+
/******/ // Load entry module and return exports
|
84 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/widgets.js");
|
85 |
+
/******/ })
|
86 |
+
/************************************************************************/
|
87 |
+
/******/ ({
|
88 |
+
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/widgets.js":
|
90 |
+
/*!************************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/admin/pages/widgets.js ***!
|
92 |
+
\************************************************************************************************************************************/
|
93 |
+
/*! no static exports found */
|
94 |
+
/***/ (function(module, exports) {
|
95 |
+
|
96 |
+
var $ = jQuery;
|
97 |
+
|
98 |
+
function formatCourse(repo) {
|
99 |
+
if (repo.loading) {
|
100 |
+
return repo.text;
|
101 |
+
}
|
102 |
+
|
103 |
+
var markup = "<div class='select2-result-course_title'>" + repo.id + ' - ' + repo.title.rendered + '</div>';
|
104 |
+
return markup;
|
105 |
+
}
|
106 |
+
|
107 |
+
function formatCourseSelection(repo) {
|
108 |
+
return repo.title.rendered || repo.text;
|
109 |
+
}
|
110 |
+
|
111 |
+
function autocompleteWidget() {
|
112 |
+
var widget = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
113 |
+
var searchs = $('.lp-widget_select_course');
|
114 |
+
var wpRestUrl = searchs.data('rest-url');
|
115 |
+
var postType = searchs.data('post_type') || 'lp_course';
|
116 |
+
searchs.select2({
|
117 |
+
ajax: {
|
118 |
+
method: 'GET',
|
119 |
+
url: wpRestUrl + 'wp/v2/' + postType,
|
120 |
+
dataType: 'json',
|
121 |
+
delay: 250,
|
122 |
+
data: function data(params) {
|
123 |
+
return {
|
124 |
+
search: params.term
|
125 |
+
};
|
126 |
+
},
|
127 |
+
processResults: function processResults(data, params) {
|
128 |
+
params.page = params.page || 1;
|
129 |
+
return {
|
130 |
+
results: data
|
131 |
+
};
|
132 |
+
},
|
133 |
+
cache: true
|
134 |
+
},
|
135 |
+
escapeMarkup: function escapeMarkup(markup) {
|
136 |
+
return markup;
|
137 |
+
},
|
138 |
+
minimumInputLength: 2,
|
139 |
+
templateResult: formatCourse,
|
140 |
+
// omitted for brevity, see the source of this page
|
141 |
+
templateSelection: formatCourseSelection // omitted for brevity, see the source of this page
|
142 |
+
|
143 |
+
});
|
144 |
+
}
|
145 |
+
|
146 |
+
document.addEventListener('DOMContentLoaded', function (event) {
|
147 |
+
if (document.querySelector('#widgets-editor')) {
|
148 |
+
$(document).on('widget-added', function (event, widget) {
|
149 |
+
autocompleteWidget(widget);
|
150 |
+
});
|
151 |
+
} else {
|
152 |
+
$(document).on('learnpress/widgets/select', function () {
|
153 |
+
autocompleteWidget();
|
154 |
+
});
|
155 |
+
autocompleteWidget();
|
156 |
+
}
|
157 |
+
});
|
158 |
+
|
159 |
+
/***/ })
|
160 |
+
|
161 |
+
/******/ });
|
162 |
+
//# sourceMappingURL=widgets.js.map
|
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=9)}({9:function(e,t){var n=jQuery;function r(e){return e.loading?e.text:"<div class='select2-result-course_title'>"+e.id+" - "+e.title.rendered+"</div>"}function o(e){return e.title.rendered||e.text}function u(){var e=n(".lp-widget_select_course"),t=e.data("rest-url"),u=e.data("post_type")||"lp_course";e.select2({ajax:{method:"GET",url:t+"wp/v2/"+u,dataType:"json",delay:250,data:function(e){return{search:e.term}},processResults:function(e,t){return t.page=t.page||1,{results:e}},cache:!0},escapeMarkup:function(e){return e},minimumInputLength:2,templateResult:r,templateSelection:o})}document.addEventListener("DOMContentLoaded",(function(e){document.querySelector("#widgets-editor")?n(document).on("widget-added",(function(e,t){u(t)})):(n(document).on("learnpress/widgets/select",(function(){u()})),u())}))}});
|
@@ -82,15 +82,15 @@ this["LP"] = this["LP"] || {}; this["LP"]["custom"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! no static exports found */
|
95 |
/***/ (function(module, exports) {
|
96 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/custom.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/custom.js":
|
91 |
+
/*!********************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/custom.js ***!
|
93 |
+
\********************************************************************************************************************************/
|
94 |
/*! no static exports found */
|
95 |
/***/ (function(module, exports) {
|
96 |
|
@@ -82,15 +82,15 @@ this["LP"] = this["LP"] || {}; this["LP"]["lesson"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! no static exports found */
|
95 |
/***/ (function(module, exports) {
|
96 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/lesson.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/lesson.js":
|
91 |
+
/*!********************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/lesson.js ***!
|
93 |
+
\********************************************************************************************************************************/
|
94 |
/*! no static exports found */
|
95 |
/***/ (function(module, exports) {
|
96 |
|
@@ -82,15 +82,15 @@ this["LP"] = this["LP"] || {}; this["LP"]["config"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! exports provided: classNames, isQuestionCorrect, questionBlocks, questionFooterButtons, questionTitleParts, questionChecker, quizStartBlocks */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/lp-configs.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/lp-configs.js":
|
91 |
+
/*!************************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/lp-configs.js ***!
|
93 |
+
\************************************************************************************************************************************/
|
94 |
/*! exports provided: classNames, isQuestionCorrect, questionBlocks, questionFooterButtons, questionTitleParts, questionChecker, quizStartBlocks */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
@@ -82,36 +82,36 @@ this["LP"] = this["LP"] || {}; this["LP"]["modal"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! exports provided: default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
-
/* harmony import */ var _modal_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modal/index */ "../../../Clouds/Thimpress/Plugins/github.com/
|
100 |
|
101 |
/* harmony default export */ __webpack_exports__["default"] = (_modal_index__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
102 |
|
103 |
/***/ }),
|
104 |
|
105 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
106 |
-
|
107 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
108 |
-
|
109 |
/*! exports provided: default */
|
110 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
111 |
|
112 |
"use strict";
|
113 |
__webpack_require__.r(__webpack_exports__);
|
114 |
-
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store */ "../../../Clouds/Thimpress/Plugins/github.com/
|
115 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
116 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
117 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
@@ -178,10 +178,10 @@ var Modal = function Modal(_ref) {
|
|
178 |
|
179 |
/***/ }),
|
180 |
|
181 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
182 |
-
|
183 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
184 |
-
|
185 |
/*! exports provided: show, hide, confirm */
|
186 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
187 |
|
@@ -211,10 +211,10 @@ function confirm(value) {
|
|
211 |
|
212 |
/***/ }),
|
213 |
|
214 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
215 |
-
|
216 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
217 |
-
|
218 |
/*! exports provided: default */
|
219 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
220 |
|
@@ -222,10 +222,10 @@ function confirm(value) {
|
|
222 |
__webpack_require__.r(__webpack_exports__);
|
223 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
224 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
225 |
-
/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "../../../Clouds/Thimpress/Plugins/github.com/
|
226 |
-
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "../../../Clouds/Thimpress/Plugins/github.com/
|
227 |
-
/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "../../../Clouds/Thimpress/Plugins/github.com/
|
228 |
-
/* harmony import */ var _middlewares__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares */ "../../../Clouds/Thimpress/Plugins/github.com/
|
229 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
230 |
|
231 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
@@ -249,16 +249,16 @@ Object(_middlewares__WEBPACK_IMPORTED_MODULE_4__["default"])(store);
|
|
249 |
|
250 |
/***/ }),
|
251 |
|
252 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
253 |
-
|
254 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
255 |
-
|
256 |
/*! exports provided: default */
|
257 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
258 |
|
259 |
"use strict";
|
260 |
__webpack_require__.r(__webpack_exports__);
|
261 |
-
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! refx */ "../../../Clouds/Thimpress/Plugins/github.com/
|
262 |
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(refx__WEBPACK_IMPORTED_MODULE_0__);
|
263 |
/**
|
264 |
* External dependencies
|
@@ -299,10 +299,10 @@ function applyMiddlewares(store) {
|
|
299 |
|
300 |
/***/ }),
|
301 |
|
302 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
303 |
-
|
304 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
305 |
-
|
306 |
/*! exports provided: Modal, default */
|
307 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
308 |
|
@@ -350,10 +350,10 @@ var Modal = function Modal() {
|
|
350 |
|
351 |
/***/ }),
|
352 |
|
353 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
354 |
-
|
355 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
356 |
-
|
357 |
/*! exports provided: isOpen, getMessage, confirm */
|
358 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
|
@@ -388,10 +388,10 @@ function confirm(state, message, cb) {
|
|
388 |
|
389 |
/***/ }),
|
390 |
|
391 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
392 |
-
|
393 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
394 |
-
|
395 |
/*! no static exports found */
|
396 |
/***/ (function(module, exports, __webpack_require__) {
|
397 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal.js":
|
91 |
+
/*!*******************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal.js ***!
|
93 |
+
\*******************************************************************************************************************************/
|
94 |
/*! exports provided: default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
+
/* harmony import */ var _modal_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modal/index */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/index.js");
|
100 |
|
101 |
/* harmony default export */ __webpack_exports__["default"] = (_modal_index__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
102 |
|
103 |
/***/ }),
|
104 |
|
105 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/index.js":
|
106 |
+
/*!*************************************************************************************************************************************!*\
|
107 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/index.js ***!
|
108 |
+
\*************************************************************************************************************************************/
|
109 |
/*! exports provided: default */
|
110 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
111 |
|
112 |
"use strict";
|
113 |
__webpack_require__.r(__webpack_exports__);
|
114 |
+
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/index.js");
|
115 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
116 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
117 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
178 |
|
179 |
/***/ }),
|
180 |
|
181 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/actions.js":
|
182 |
+
/*!*********************************************************************************************************************************************!*\
|
183 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/actions.js ***!
|
184 |
+
\*********************************************************************************************************************************************/
|
185 |
/*! exports provided: show, hide, confirm */
|
186 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
187 |
|
211 |
|
212 |
/***/ }),
|
213 |
|
214 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/index.js":
|
215 |
+
/*!*******************************************************************************************************************************************!*\
|
216 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/index.js ***!
|
217 |
+
\*******************************************************************************************************************************************/
|
218 |
/*! exports provided: default */
|
219 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
220 |
|
222 |
__webpack_require__.r(__webpack_exports__);
|
223 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
224 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
225 |
+
/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/reducer.js");
|
226 |
+
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/actions.js");
|
227 |
+
/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/selectors.js");
|
228 |
+
/* harmony import */ var _middlewares__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/middlewares.js");
|
229 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
230 |
|
231 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
249 |
|
250 |
/***/ }),
|
251 |
|
252 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/middlewares.js":
|
253 |
+
/*!*************************************************************************************************************************************************!*\
|
254 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/middlewares.js ***!
|
255 |
+
\*************************************************************************************************************************************************/
|
256 |
/*! exports provided: default */
|
257 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
258 |
|
259 |
"use strict";
|
260 |
__webpack_require__.r(__webpack_exports__);
|
261 |
+
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! refx */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/refx/refx.js");
|
262 |
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(refx__WEBPACK_IMPORTED_MODULE_0__);
|
263 |
/**
|
264 |
* External dependencies
|
299 |
|
300 |
/***/ }),
|
301 |
|
302 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/reducer.js":
|
303 |
+
/*!*********************************************************************************************************************************************!*\
|
304 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/reducer.js ***!
|
305 |
+
\*********************************************************************************************************************************************/
|
306 |
/*! exports provided: Modal, default */
|
307 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
308 |
|
350 |
|
351 |
/***/ }),
|
352 |
|
353 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/selectors.js":
|
354 |
+
/*!***********************************************************************************************************************************************!*\
|
355 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/modal/store/selectors.js ***!
|
356 |
+
\***********************************************************************************************************************************************/
|
357 |
/*! exports provided: isOpen, getMessage, confirm */
|
358 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
|
388 |
|
389 |
/***/ }),
|
390 |
|
391 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/refx/refx.js":
|
392 |
+
/*!********************************************************************************************************************!*\
|
393 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/refx/refx.js ***!
|
394 |
+
\********************************************************************************************************************/
|
395 |
/*! no static exports found */
|
396 |
/***/ (function(module, exports, __webpack_require__) {
|
397 |
|
@@ -1 +1 @@
|
|
1 |
-
this.LP=this.LP||{},this.LP.modal=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=
|
1 |
+
this.LP=this.LP||{},this.LP.modal=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=23)}({0:function(e,t){e.exports=window.wp.i18n},1:function(e,t){e.exports=window.wp.data},23:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"show",(function(){return f})),r.d(n,"hide",(function(){return p})),r.d(n,"confirm",(function(){return d}));var o={};r.r(o),r.d(o,"isOpen",(function(){return b})),r.d(o,"getMessage",(function(){return O})),r.d(o,"confirm",(function(){return m}));var c=r(1);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l={},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_MODAL":return u(u({},e),{},{isOpen:!0,message:t.message,cb:t.cb});case"HIDE_MODAL":return u(u({},e),{},{isOpen:!1,message:!1,cb:null});case"CONFIRM":return e.cb&&setTimeout((function(){e.cb()}),10),u(u({},e),{},{confirm:t.value})}return e};function f(e,t){return{type:"SHOW_MODAL",message:e,cb:t}}function p(){return{type:"HIDE_MODAL"}}function d(e){return{type:"CONFIRM",value:e}}function b(e){return e.isOpen}function O(e){return e.message}function m(e,t,r){var n=Object(c.dispatch)("learnpress/modal"),o=n.show,i=n.hide;return e.message?(i(),e.confirm):(o(t,r),"no")}var y=r(7),v=r.n(y),g={ENROLL_COURSE_X:function(e,t){}};var j=function(e){var t=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},r={getState:e.getState,dispatch:function(){return t.apply(void 0,arguments)}};return t=v()(g)(r)(e.dispatch),e.dispatch=t,e};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P=LP.dataControls.controls,E=Object(c.registerStore)("learnpress/modal",{reducer:s,selectors:o,actions:n,controls:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},P)});j(E);var S=r(0),_=function(e){var t=e.children,r=Object(c.dispatch)("learnpress/modal"),n=(r.show,r.hide,r.confirm),o=Object(c.useSelect)((function(e){return e("learnpress/modal").isOpen()})),i=Object(c.useSelect)((function(e){return e("learnpress/modal").getMessage()})),u=function(e){return function(t){n(e)}},a={display:o?"block":"none"};return React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement("div",{id:"lp-modal-overlay",style:a}),React.createElement("div",{id:"lp-modal-window",style:a},React.createElement("div",{id:"lp-modal-content",dangerouslySetInnerHTML:{__html:i}}),React.createElement("div",{id:"lp-modal-buttons"},React.createElement("button",{className:"lp-button modal-button-ok",onClick:u("yes")},React.createElement("span",null,Object(S.__)("OK","learnpress"))),React.createElement("button",{className:"lp-button modal-button-cancel",onClick:u("no")},React.createElement("span",null,Object(S.__)("Cancel","learnpress")))))),t)};t.default=_},7:function(e,t,r){"use strict";e.exports=function(e){var t,r={};return function e(t,r){var n;if(Array.isArray(r))for(n=0;n<r.length;n++)e(t,r[n]);else for(n in r)t[n]=(t[n]||[]).concat(r[n])}(r,e),(t=function(e){return function(t){return function(n){var o,c,i=r[n.type],u=t(n);if(i)for(o=0;o<i.length;o++)(c=i[o](n,e))&&e.dispatch(c);return u}}}).effects=r,t}}});
|
@@ -82,22 +82,22 @@ this["LP"] = this["LP"] || {}; this["LP"]["profile"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! no exports provided */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
-
/* harmony import */ var _profile_course_tab__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./profile/course-tab */ "../../../Clouds/Thimpress/Plugins/github.com/
|
100 |
-
/* harmony import */ var _profile_statistic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./profile/statistic */ "../../../Clouds/Thimpress/Plugins/github.com/
|
101 |
|
102 |
|
103 |
document.addEventListener('DOMContentLoaded', function (event) {
|
@@ -107,10 +107,10 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
|
107 |
|
108 |
/***/ }),
|
109 |
|
110 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
111 |
-
|
112 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
113 |
-
|
114 |
/*! exports provided: default */
|
115 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
116 |
|
@@ -342,10 +342,10 @@ var courseTab = function courseTab() {
|
|
342 |
|
343 |
/***/ }),
|
344 |
|
345 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
346 |
-
|
347 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
348 |
-
|
349 |
/*! exports provided: default */
|
350 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
351 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile.js":
|
91 |
+
/*!*********************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile.js ***!
|
93 |
+
\*********************************************************************************************************************************/
|
94 |
/*! no exports provided */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
+
/* harmony import */ var _profile_course_tab__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./profile/course-tab */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile/course-tab.js");
|
100 |
+
/* harmony import */ var _profile_statistic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./profile/statistic */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile/statistic.js");
|
101 |
|
102 |
|
103 |
document.addEventListener('DOMContentLoaded', function (event) {
|
107 |
|
108 |
/***/ }),
|
109 |
|
110 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile/course-tab.js":
|
111 |
+
/*!********************************************************************************************************************************************!*\
|
112 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile/course-tab.js ***!
|
113 |
+
\********************************************************************************************************************************************/
|
114 |
/*! exports provided: default */
|
115 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
116 |
|
342 |
|
343 |
/***/ }),
|
344 |
|
345 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile/statistic.js":
|
346 |
+
/*!*******************************************************************************************************************************************!*\
|
347 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/profile/statistic.js ***!
|
348 |
+
\*******************************************************************************************************************************************/
|
349 |
/*! exports provided: default */
|
350 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
351 |
|
@@ -1 +1 @@
|
|
1 |
-
this.LP=this.LP||{},this.LP.profile=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=
|
1 |
+
this.LP=this.LP||{},this.LP.profile=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=25)}({25:function(e,t,r){"use strict";r.r(t);var n=r(5);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t,r,n,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var l=function(){var e=document.querySelectorAll(".learn-press-course-tab__filter__content");if(e.length){if("IntersectionObserver"in window){var t=new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting){var n=e.target,a=JSON.parse(n.dataset.ajax);r(n,a),t.unobserve(n)}}))}));c(e).map((function(e){return t.observe(e)}))}document.querySelectorAll(".learn-press-course-tab-filters").forEach((function(e){var t=e.querySelectorAll(".learn-press-filters a");t.forEach((function(r){r.addEventListener("click",(function(n){n.preventDefault();var a=r.dataset.tab;c(t).map((function(e){e.classList.remove("active")})),r.classList.add("active"),c(e.querySelectorAll(".learn-press-course-tab__filter__content")).map((function(e){e.style.display="none",e.dataset.tab===a&&(e.style.display="")}))}))}))}));document.querySelectorAll(".learn-press-profile-course__tab__inner").forEach((function(e){var t=e.querySelectorAll("li> a");t.forEach((function(e){e.addEventListener("click",(function(r){r.preventDefault();var n=e.dataset.tab;c(t).map((function(e){e.classList.remove("active")})),e.classList.add("active"),c(document.querySelectorAll(".learn-press-course-tab-filters")).map((function(e){e.style.display="none",e.dataset.tab===n&&(e.style.display="")}))}))}))}));var r=function(){var e,t=(e=regeneratorRuntime.mark((function e(t,r){var o,i,s,c,u,l,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=f.length>2&&void 0!==f[2]&&f[2],i=f.length>3&&void 0!==f[3]&&f[3],e.prev=2,e.next=5,wp.apiFetch({path:Object(n.addQueryArgs)("lp/v1/profile/course-tab",r),method:"GET"});case 5:(s=e.sent)&&((c=t.querySelector(".lp-skeleton-animation"))&&c.remove(),"success"===s.status&&s.data?o?t.innerHTML+=s.data:t.innerHTML=s.data:o?t.innerHTML+='<div class="lp-ajax-message" style="display:block">'.concat(s.message&&s.message,"</div>"):t.innerHTML='<div class="lp-ajax-message" style="display:block">'.concat(s.message&&s.message,"</div>"),i&&(i.classList.remove("loading"),u=i.dataset.paged,i.dataset.number<=u&&i.remove(),i.dataset.paged=parseInt(u)+1),a(t,r)),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),o?t.innerHTML+='<div class="lp-ajax-message error" style="display:block">'.concat(e.t0.message&&e.t0.message,"</div>"):t.innerHTML='<div class="lp-ajax-message error" style="display:block">'.concat(e.t0.message&&e.t0.message,"</div>"),i&&(i.classList.remove("loading"),l=i.dataset.paged,i.dataset.number<=l&&i.remove(),i.dataset.paged=parseInt(l)+1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){s(o,n,a,i,c,"next",e)}function c(e){s(o,n,a,i,c,"throw",e)}i(void 0)}))});return function(e,r){return t.apply(this,arguments)}}(),a=function(e,t){var n=e.querySelector("button[data-paged]");n&&n.addEventListener("click",(function(a){a.preventDefault();var i=n&&n.dataset.paged;n.classList.add("loading");var s="list"===t.layout?".lp_profile_course_progress":".learn-press-courses";r(e.querySelector(s),o(o({},t),{paged:i}),!0,n)}))}}};function f(e,t,r,n,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function p(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var v=function(){var e=document.querySelectorAll(".learn-press-profile-course__statistic");if(e.length){if("IntersectionObserver"in window){var t=new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting){var n=e.target,a=JSON.parse(n.dataset.ajax);r(n,a),t.unobserve(n)}}))}));p(e).map((function(e){return t.observe(e)}))}var r=function(){var e,t=(e=regeneratorRuntime.mark((function e(t,r){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:Object(n.addQueryArgs)("lp/v1/profile/statistic",r),method:"GET"});case 3:"success"===(a=e.sent).status&&a.data?t.innerHTML=a.data:t.innerHTML='<div class="lp-ajax-message error" style="display:block">'.concat(a.message&&a.message,"</div>"),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t.innerHTML+='<div class="lp-ajax-message error" style="display:block">'.concat(e.t0.message&&e.t0.message,"</div>");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){f(o,n,a,i,s,"next",e)}function s(e){f(o,n,a,i,s,"throw",e)}i(void 0)}))});return function(e,r){return t.apply(this,arguments)}}()}};document.addEventListener("DOMContentLoaded",(function(e){l(),v()}))},5:function(e,t){e.exports=window.wp.url}});
|
@@ -82,21 +82,21 @@ this["LP"] = this["LP"] || {}; this["LP"]["questionTypes"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
-
/*! exports provided: QuestionBase, SingleChoice, MultipleChoices, TrueOrFalse, FillInBlanks,
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
-
/* harmony import */ var _question_types_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question-types/index */ "../../../Clouds/Thimpress/Plugins/github.com/
|
100 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuestionBase", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["QuestionBase"]; });
|
101 |
|
102 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SingleChoice", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["SingleChoice"]; });
|
@@ -107,42 +107,36 @@ __webpack_require__.r(__webpack_exports__);
|
|
107 |
|
108 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FillInBlanks", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["FillInBlanks"]; });
|
109 |
|
110 |
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SortingChoice", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["SortingChoice"]; });
|
111 |
-
|
112 |
|
113 |
|
114 |
/* harmony default export */ __webpack_exports__["default"] = (_question_types_index__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
115 |
|
116 |
/***/ }),
|
117 |
|
118 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
119 |
-
|
120 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
121 |
-
|
122 |
-
/*! exports provided: QuestionBase, SingleChoice, MultipleChoices, TrueOrFalse, FillInBlanks
|
123 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
124 |
|
125 |
"use strict";
|
126 |
__webpack_require__.r(__webpack_exports__);
|
127 |
-
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question-base */ "../../../Clouds/Thimpress/Plugins/github.com/
|
128 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuestionBase", function() { return _question_base__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
129 |
|
130 |
-
/* harmony import */ var _questions_single_choice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questions/single-choice */ "../../../Clouds/Thimpress/Plugins/github.com/
|
131 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SingleChoice", function() { return _questions_single_choice__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
132 |
|
133 |
-
/* harmony import */ var _questions_multiple_choices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./questions/multiple-choices */ "../../../Clouds/Thimpress/Plugins/github.com/
|
134 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultipleChoices", function() { return _questions_multiple_choices__WEBPACK_IMPORTED_MODULE_2__["default"]; });
|
135 |
|
136 |
-
/* harmony import */ var _questions_true_or_false__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./questions/true-or-false */ "../../../Clouds/Thimpress/Plugins/github.com/
|
137 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TrueOrFalse", function() { return _questions_true_or_false__WEBPACK_IMPORTED_MODULE_3__["default"]; });
|
138 |
|
139 |
-
/* harmony import */ var _questions_fill_in_blanks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./questions/fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/
|
140 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FillInBlanks", function() { return _questions_fill_in_blanks__WEBPACK_IMPORTED_MODULE_4__["default"]; });
|
141 |
|
142 |
-
/* harmony import */ var _questions_sorting_choice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./questions/sorting-choice */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/frontend/question-types/components/questions/sorting-choice/index.js");
|
143 |
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SortingChoice", function() { return _questions_sorting_choice__WEBPACK_IMPORTED_MODULE_5__["default"]; });
|
144 |
-
|
145 |
-
|
146 |
|
147 |
|
148 |
|
@@ -151,10 +145,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
151 |
|
152 |
/***/ }),
|
153 |
|
154 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
155 |
-
|
156 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
157 |
-
|
158 |
/*! exports provided: default */
|
159 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
160 |
|
@@ -449,10 +443,10 @@ var QuestionBase = /*#__PURE__*/function (_Component) {
|
|
449 |
|
450 |
/***/ }),
|
451 |
|
452 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
453 |
-
|
454 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
455 |
-
|
456 |
/*! exports provided: default */
|
457 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
458 |
|
@@ -460,7 +454,7 @@ var QuestionBase = /*#__PURE__*/function (_Component) {
|
|
460 |
__webpack_require__.r(__webpack_exports__);
|
461 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
462 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
463 |
-
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/
|
464 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
465 |
|
466 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
@@ -615,10 +609,10 @@ var QuestionFillInBlanks = /*#__PURE__*/function (_QuestionBase) {
|
|
615 |
|
616 |
/***/ }),
|
617 |
|
618 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
619 |
-
|
620 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
621 |
-
|
622 |
/*! exports provided: default */
|
623 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
624 |
|
@@ -628,7 +622,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
628 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
629 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
630 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
631 |
-
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/
|
632 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
633 |
|
634 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
@@ -739,16 +733,16 @@ var QuestionMultipleChoices = /*#__PURE__*/function (_QuestionBase) {
|
|
739 |
|
740 |
/***/ }),
|
741 |
|
742 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
743 |
-
|
744 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
745 |
-
|
746 |
/*! exports provided: default */
|
747 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
748 |
|
749 |
"use strict";
|
750 |
__webpack_require__.r(__webpack_exports__);
|
751 |
-
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/
|
752 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
753 |
|
754 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
@@ -832,230 +826,16 @@ var QuestionSingleChoice = /*#__PURE__*/function (_QuestionBase) {
|
|
832 |
|
833 |
/***/ }),
|
834 |
|
835 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
836 |
-
|
837 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
838 |
-
|
839 |
-
/*! exports provided: default */
|
840 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
841 |
-
|
842 |
-
"use strict";
|
843 |
-
__webpack_require__.r(__webpack_exports__);
|
844 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
845 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
846 |
-
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js");
|
847 |
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
848 |
-
|
849 |
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
850 |
-
|
851 |
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
852 |
-
|
853 |
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
854 |
-
|
855 |
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
856 |
-
|
857 |
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
858 |
-
|
859 |
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
860 |
-
|
861 |
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
862 |
-
|
863 |
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
864 |
-
|
865 |
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
866 |
-
|
867 |
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
868 |
-
|
869 |
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
870 |
-
|
871 |
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
872 |
-
|
873 |
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
874 |
-
|
875 |
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
876 |
-
|
877 |
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
878 |
-
|
879 |
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
880 |
-
|
881 |
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
var QuestionSortingChoice = /*#__PURE__*/function (_QuestionBase) {
|
887 |
-
_inherits(QuestionSortingChoice, _QuestionBase);
|
888 |
-
|
889 |
-
var _super = _createSuper(QuestionSortingChoice);
|
890 |
-
|
891 |
-
function QuestionSortingChoice() {
|
892 |
-
var _this;
|
893 |
-
|
894 |
-
_classCallCheck(this, QuestionSortingChoice);
|
895 |
-
|
896 |
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
897 |
-
args[_key] = arguments[_key];
|
898 |
-
}
|
899 |
-
|
900 |
-
_this = _super.call.apply(_super, [this].concat(args));
|
901 |
-
|
902 |
-
_defineProperty(_assertThisInitialized(_this), "isCorrect", function () {
|
903 |
-
var answered = _this.props.answered;
|
904 |
-
|
905 |
-
if (!answered) {
|
906 |
-
return false;
|
907 |
-
}
|
908 |
-
|
909 |
-
var i, option, options, sort;
|
910 |
-
|
911 |
-
for (i = 0, options = _this.getOptions(); i < options.length; i++) {
|
912 |
-
option = options[i];
|
913 |
-
sort = option.sorting;
|
914 |
-
|
915 |
-
if (answered[sort] !== option.value) {
|
916 |
-
return false;
|
917 |
-
}
|
918 |
-
}
|
919 |
-
|
920 |
-
return true;
|
921 |
-
});
|
922 |
-
|
923 |
-
_defineProperty(_assertThisInitialized(_this), "getCorrectLabel", function () {
|
924 |
-
var question = _this.props.question;
|
925 |
-
var checker = _this.isCorrect;
|
926 |
-
var isCorrect = checker.call(_assertThisInitialized(_this));
|
927 |
-
return _this.maybeShowCorrectAnswer() && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
928 |
-
className: "question-response" + (isCorrect ? ' correct' : ' incorrect')
|
929 |
-
}, /*#__PURE__*/React.createElement("span", {
|
930 |
-
className: "label"
|
931 |
-
}, isCorrect ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Correct', 'learnpress') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Incorrect', 'learnpress')), /*#__PURE__*/React.createElement("span", {
|
932 |
-
className: "point"
|
933 |
-
}, sprintf(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('%d/%d point', 'learnpress'), isCorrect ? question.point : 0, question.point))));
|
934 |
-
});
|
935 |
-
|
936 |
-
_defineProperty(_assertThisInitialized(_this), "getAnswerSortingChoice", function () {
|
937 |
-
var question = _this.props.question;
|
938 |
-
var options = question.options || [];
|
939 |
-
var checker = _this.isCorrect;
|
940 |
-
var isCorrect = checker.call(_assertThisInitialized(_this));
|
941 |
-
var getAnswer = [];
|
942 |
-
|
943 |
-
if (!isCorrect && options.length > 0) {
|
944 |
-
options.map(function (option) {
|
945 |
-
var sorting = option.sorting;
|
946 |
-
|
947 |
-
if (sorting !== undefined) {
|
948 |
-
return getAnswer[sorting] = option.title;
|
949 |
-
}
|
950 |
-
});
|
951 |
-
}
|
952 |
-
|
953 |
-
return getAnswer;
|
954 |
-
});
|
955 |
-
|
956 |
-
return _this;
|
957 |
-
}
|
958 |
-
|
959 |
-
_createClass(QuestionSortingChoice, [{
|
960 |
-
key: "componentDidMount",
|
961 |
-
value: function componentDidMount() {
|
962 |
-
var _this$props = this.props,
|
963 |
-
updateUserQuestionAnswers = _this$props.updateUserQuestionAnswers,
|
964 |
-
question = _this$props.question;
|
965 |
-
var ele = document.querySelector("#answer-options-".concat(question.id));
|
966 |
-
return jQuery(ele).sortable({
|
967 |
-
items: '.answer-option',
|
968 |
-
cursor: 'move',
|
969 |
-
axis: 'y',
|
970 |
-
handle: '.option-drag',
|
971 |
-
scrollSensitivity: 40,
|
972 |
-
forcePlaceholderSize: true,
|
973 |
-
helper: 'clone',
|
974 |
-
opacity: 0.65,
|
975 |
-
update: function update(event, ui) {
|
976 |
-
var options = ele.querySelectorAll('.answer-option');
|
977 |
-
var answers = [];
|
978 |
-
|
979 |
-
_toConsumableArray(options).map(function (option) {
|
980 |
-
return answers.push(option.dataset.value);
|
981 |
-
});
|
982 |
-
|
983 |
-
if (answers.length > 0) {
|
984 |
-
updateUserQuestionAnswers(question.id, answers);
|
985 |
-
}
|
986 |
-
}
|
987 |
-
});
|
988 |
-
}
|
989 |
-
}, {
|
990 |
-
key: "render",
|
991 |
-
value: function render() {
|
992 |
-
var _this2 = this;
|
993 |
-
|
994 |
-
var question = this.props.question;
|
995 |
-
var getAnswer = this.getAnswerSortingChoice();
|
996 |
-
return /*#__PURE__*/React.createElement("div", {
|
997 |
-
className: "question-answers"
|
998 |
-
}, this.isDefaultType() && /*#__PURE__*/React.createElement("ul", {
|
999 |
-
id: "answer-options-".concat(question.id),
|
1000 |
-
className: "answer-options lp-sorting-choice-ul"
|
1001 |
-
}, this.getOptions().map(function (option, key) {
|
1002 |
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("li", {
|
1003 |
-
className: _this2.getOptionClass(option).join(' '),
|
1004 |
-
key: "answer-option-".concat(option.value),
|
1005 |
-
"data-value": option.value
|
1006 |
-
}, /*#__PURE__*/React.createElement("span", {
|
1007 |
-
className: "option-drag",
|
1008 |
-
style: {
|
1009 |
-
display: 'flex',
|
1010 |
-
alignItems: 'center',
|
1011 |
-
position: 'absolute',
|
1012 |
-
height: '100%',
|
1013 |
-
left: 14
|
1014 |
-
}
|
1015 |
-
}, /*#__PURE__*/React.createElement("svg", {
|
1016 |
-
xmlns: "http://www.w3.org/2000/svg",
|
1017 |
-
height: "24",
|
1018 |
-
viewBox: "0 0 24 24",
|
1019 |
-
width: "24"
|
1020 |
-
}, /*#__PURE__*/React.createElement("path", {
|
1021 |
-
d: "M0 0h24v24H0z",
|
1022 |
-
fill: "none"
|
1023 |
-
}), /*#__PURE__*/React.createElement("path", {
|
1024 |
-
d: "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"
|
1025 |
-
}))), /*#__PURE__*/React.createElement("label", {
|
1026 |
-
htmlFor: "learn-press-answer-option-".concat(option.value),
|
1027 |
-
className: "option-title",
|
1028 |
-
dangerouslySetInnerHTML: {
|
1029 |
-
__html: option.title || option.value
|
1030 |
-
}
|
1031 |
-
})), getAnswer.length > 0 && getAnswer[key] !== undefined && /*#__PURE__*/React.createElement("div", {
|
1032 |
-
className: 'lp-sorting-choice__check-answer',
|
1033 |
-
key: "lp-checked-answer-".concat(key),
|
1034 |
-
style: {
|
1035 |
-
marginBottom: 10
|
1036 |
-
}
|
1037 |
-
}, getAnswer[key]));
|
1038 |
-
})), !this.isDefaultType() && this.getWarningMessage(), this.getCorrectLabel());
|
1039 |
-
}
|
1040 |
-
}]);
|
1041 |
-
|
1042 |
-
return QuestionSortingChoice;
|
1043 |
-
}(_question_base__WEBPACK_IMPORTED_MODULE_1__["default"]);
|
1044 |
-
|
1045 |
-
/* harmony default export */ __webpack_exports__["default"] = (QuestionSortingChoice);
|
1046 |
-
|
1047 |
-
/***/ }),
|
1048 |
-
|
1049 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/frontend/question-types/components/questions/true-or-false/index.js":
|
1050 |
-
/*!***************************************************************************************************************************************************************************!*\
|
1051 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4/learnpress/assets/src/apps/js/frontend/question-types/components/questions/true-or-false/index.js ***!
|
1052 |
-
\***************************************************************************************************************************************************************************/
|
1053 |
/*! exports provided: default */
|
1054 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1055 |
|
1056 |
"use strict";
|
1057 |
__webpack_require__.r(__webpack_exports__);
|
1058 |
-
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1059 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1060 |
|
1061 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
@@ -1138,11 +918,11 @@ var QuestionTrueOrFalse = /*#__PURE__*/function (_QuestionBase) {
|
|
1138 |
|
1139 |
/***/ }),
|
1140 |
|
1141 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1142 |
-
|
1143 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1144 |
-
|
1145 |
-
/*! exports provided: QuestionBase, SingleChoice, MultipleChoices, TrueOrFalse, FillInBlanks,
|
1146 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1147 |
|
1148 |
"use strict";
|
@@ -1155,7 +935,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
1155 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
|
1156 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1157 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1158 |
-
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1159 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuestionBase", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["QuestionBase"]; });
|
1160 |
|
1161 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SingleChoice", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["SingleChoice"]; });
|
@@ -1166,8 +946,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
1166 |
|
1167 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FillInBlanks", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["FillInBlanks"]; });
|
1168 |
|
1169 |
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SortingChoice", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["SortingChoice"]; });
|
1170 |
-
|
1171 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1172 |
|
1173 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
@@ -1224,8 +1002,7 @@ var QuestionTypes = /*#__PURE__*/function (_Component) {
|
|
1224 |
single_choice: LP.questionTypes.SingleChoice,
|
1225 |
multi_choice: LP.questionTypes.MultipleChoices,
|
1226 |
true_or_false: LP.questionTypes.TrueOrFalse,
|
1227 |
-
fill_in_blanks: LP.questionTypes.FillInBlanks
|
1228 |
-
sorting_choice: LP.questionTypes.SortingChoice
|
1229 |
});
|
1230 |
return types[question.type];
|
1231 |
});
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types.js":
|
91 |
+
/*!****************************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types.js ***!
|
93 |
+
\****************************************************************************************************************************************/
|
94 |
+
/*! exports provided: QuestionBase, SingleChoice, MultipleChoices, TrueOrFalse, FillInBlanks, default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
+
/* harmony import */ var _question_types_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question-types/index */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/index.js");
|
100 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuestionBase", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["QuestionBase"]; });
|
101 |
|
102 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SingleChoice", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["SingleChoice"]; });
|
107 |
|
108 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FillInBlanks", function() { return _question_types_index__WEBPACK_IMPORTED_MODULE_0__["FillInBlanks"]; });
|
109 |
|
|
|
|
|
110 |
|
111 |
|
112 |
/* harmony default export */ __webpack_exports__["default"] = (_question_types_index__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
113 |
|
114 |
/***/ }),
|
115 |
|
116 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/index.js":
|
117 |
+
/*!*********************************************************************************************************************************************************!*\
|
118 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/index.js ***!
|
119 |
+
\*********************************************************************************************************************************************************/
|
120 |
+
/*! exports provided: QuestionBase, SingleChoice, MultipleChoices, TrueOrFalse, FillInBlanks */
|
121 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
122 |
|
123 |
"use strict";
|
124 |
__webpack_require__.r(__webpack_exports__);
|
125 |
+
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question-base */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js");
|
126 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuestionBase", function() { return _question_base__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
127 |
|
128 |
+
/* harmony import */ var _questions_single_choice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questions/single-choice */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/single-choice/index.js");
|
129 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SingleChoice", function() { return _questions_single_choice__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
130 |
|
131 |
+
/* harmony import */ var _questions_multiple_choices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./questions/multiple-choices */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/multiple-choices/index.js");
|
132 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultipleChoices", function() { return _questions_multiple_choices__WEBPACK_IMPORTED_MODULE_2__["default"]; });
|
133 |
|
134 |
+
/* harmony import */ var _questions_true_or_false__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./questions/true-or-false */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/true-or-false/index.js");
|
135 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TrueOrFalse", function() { return _questions_true_or_false__WEBPACK_IMPORTED_MODULE_3__["default"]; });
|
136 |
|
137 |
+
/* harmony import */ var _questions_fill_in_blanks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./questions/fill-in-blanks */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/fill-in-blanks/index.js");
|
138 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FillInBlanks", function() { return _questions_fill_in_blanks__WEBPACK_IMPORTED_MODULE_4__["default"]; });
|
139 |
|
|
|
|
|
|
|
|
|
140 |
|
141 |
|
142 |
|
145 |
|
146 |
/***/ }),
|
147 |
|
148 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js":
|
149 |
+
/*!***********************************************************************************************************************************************************************!*\
|
150 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js ***!
|
151 |
+
\***********************************************************************************************************************************************************************/
|
152 |
/*! exports provided: default */
|
153 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
154 |
|
443 |
|
444 |
/***/ }),
|
445 |
|
446 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/fill-in-blanks/index.js":
|
447 |
+
/*!**********************************************************************************************************************************************************************************!*\
|
448 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/fill-in-blanks/index.js ***!
|
449 |
+
\**********************************************************************************************************************************************************************************/
|
450 |
/*! exports provided: default */
|
451 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
452 |
|
454 |
__webpack_require__.r(__webpack_exports__);
|
455 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
456 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
457 |
+
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js");
|
458 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
459 |
|
460 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
609 |
|
610 |
/***/ }),
|
611 |
|
612 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/multiple-choices/index.js":
|
613 |
+
/*!************************************************************************************************************************************************************************************!*\
|
614 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/multiple-choices/index.js ***!
|
615 |
+
\************************************************************************************************************************************************************************************/
|
616 |
/*! exports provided: default */
|
617 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
618 |
|
622 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
623 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
624 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
625 |
+
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js");
|
626 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
627 |
|
628 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
733 |
|
734 |
/***/ }),
|
735 |
|
736 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/single-choice/index.js":
|
737 |
+
/*!*********************************************************************************************************************************************************************************!*\
|
738 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/single-choice/index.js ***!
|
739 |
+
\*********************************************************************************************************************************************************************************/
|
740 |
/*! exports provided: default */
|
741 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
742 |
|
743 |
"use strict";
|
744 |
__webpack_require__.r(__webpack_exports__);
|
745 |
+
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js");
|
746 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
747 |
|
748 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
826 |
|
827 |
/***/ }),
|
828 |
|
829 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/true-or-false/index.js":
|
830 |
+
/*!*********************************************************************************************************************************************************************************!*\
|
831 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/questions/true-or-false/index.js ***!
|
832 |
+
\*********************************************************************************************************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
/*! exports provided: default */
|
834 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
835 |
|
836 |
"use strict";
|
837 |
__webpack_require__.r(__webpack_exports__);
|
838 |
+
/* harmony import */ var _question_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../question-base */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/question-base/index.js");
|
839 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
840 |
|
841 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
918 |
|
919 |
/***/ }),
|
920 |
|
921 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/index.js":
|
922 |
+
/*!**********************************************************************************************************************************************!*\
|
923 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/index.js ***!
|
924 |
+
\**********************************************************************************************************************************************/
|
925 |
+
/*! exports provided: QuestionBase, SingleChoice, MultipleChoices, TrueOrFalse, FillInBlanks, default */
|
926 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
927 |
|
928 |
"use strict";
|
935 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
|
936 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
937 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
938 |
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/question-types/components/index.js");
|
939 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuestionBase", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["QuestionBase"]; });
|
940 |
|
941 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SingleChoice", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["SingleChoice"]; });
|
946 |
|
947 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FillInBlanks", function() { return _components__WEBPACK_IMPORTED_MODULE_4__["FillInBlanks"]; });
|
948 |
|
|
|
|
|
949 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
950 |
|
951 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
1002 |
single_choice: LP.questionTypes.SingleChoice,
|
1003 |
multi_choice: LP.questionTypes.MultipleChoices,
|
1004 |
true_or_false: LP.questionTypes.TrueOrFalse,
|
1005 |
+
fill_in_blanks: LP.questionTypes.FillInBlanks
|
|
|
1006 |
});
|
1007 |
return types[question.type];
|
1008 |
});
|
@@ -1 +1 @@
|
|
1 |
-
this.LP=this.LP||{},this.LP.questionTypes=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=21)}({0:function(e,t){e.exports=window.wp.i18n},1:function(e,t){e.exports=window.wp.data},21:function(e,t,r){"use strict";r.r(t),r.d(t,"QuestionBase",(function(){return v})),r.d(t,"SingleChoice",(function(){return E})),r.d(t,"MultipleChoices",(function(){return U})),r.d(t,"TrueOrFalse",(function(){return Y})),r.d(t,"FillInBlanks",(function(){return le})),r.d(t,"SortingChoice",(function(){return je}));var n=r(3),o=r(4),i=r(1),c=r(0);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p(this,r)}}function p(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=lodash,d=h.isArray,v=(h.get,h.set,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,e);var t,r,n,o=f(u);function u(e){var t;a(this,u),m(y(t=o.apply(this,arguments)),"prepare",(function(e,t){var r=e.question;return r&&r.id!==t.questionId?{options:t.self.parseOptions(r.options)}:null})),m(y(t),"setInputRef",(function(e,r){t.inputs||(t.inputs={}),t.inputs[r]=e})),m(y(t),"maybeShowCorrectAnswer",(function(){var e=t.props,r=e.status,n=e.isCheckedAnswer,o=e.showCorrectReview,i=e.isReviewing;return"completed"===r&&o||n&&!i})),m(y(t),"maybeDisabledOption",(function(e){var r=t.props,n=(r.answered,r.status);return r.isCheckedAnswer||"started"!==n})),m(y(t),"setAnswerChecked",(function(){return function(e){var r=t.props,n=r.updateUserQuestionAnswers,o=r.question;if("started"!==r.status)return Object(c.__)("LP Error: can not set answers","learnpress");var i=t.$wrap.find(".option-check"),u=[],a="multi_choice"!==o.type;i.each((function(e,t){if(t.checked&&(u.push(t.value),a))return!1})),n(o.id,a?u[0]:u)}})),m(y(t),"maybeCheckedAnswer",(function(e){var r=t.props.answered;return d(r)?!!r.find((function(t){return t==e})):e==r})),m(y(t),"getOptionType",(function(e,t){var r="radio";switch(e){case"multi_choice":r="checkbox"}return r})),m(y(t),"isDefaultType",(function(){return t.props.supportOptions})),m(y(t),"getWarningMessage",(function(){return React.createElement(React.Fragment,null,Object(c.__)("Render function should be overwritten from base.","learnpress"))})),m(y(t),"getOptionClass",(function(e){t.props.answered;return["answer-option"]})),m(y(t),"parseOptions",(function(e){return e&&(e=d(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=d(e)?e:JSON.parse(e)),e||[]})),m(y(t),"getOptions",(function(){return t.state.options||[]})),m(y(t),"isCorrect",(function(){var e,r,n,o=t.props.answered;if(!o)return!1;for(e=0,n=t.getOptions();e<n.length;e++)if("yes"===(r=n[e]).isTrue&&o==r.value)return!0;return!1})),m(y(t),"isChecked",(function(){var e=t.props.question;return Object(i.select)("learnpress/quiz").isCheckedAnswer(e.id)})),m(y(t),"getCorrectLabel",(function(){var e=t.props,r=(e.status,e.answered,e.question),n=(LP.config.isQuestionCorrect[r.type]||t.isCorrect).call(y(t));return t.maybeShowCorrectAnswer()&&React.createElement("div",{className:"question-response"+(n?" correct":" incorrect")},React.createElement("span",{className:"label"},n?Object(c.__)("Correct","learnpress"):Object(c.__)("Incorrect","learnpress")),React.createElement("span",{className:"point"},sprintf(Object(c.__)("%d/%d point","learnpress"),n?r.point:0,r.point)))}));var r=e.question;return t.state={optionClass:["answer-option"],questionId:0,options:r?t.parseOptions(r.options):[],self:y(t)},e.$wrap&&(t.$wrap=e.$wrap),t}return t=u,n=[{key:"getDerivedStateFromProps",value:function(e,t){return t.self.prepare(e,t)}}],(r=[{key:"componentDidMount",value:function(){var e=this.prepare(this.props,this.state);e&&this.setState(e)}},{key:"render",value:function(){var e=this,t=this.props,r=t.question,n=t.status;return React.createElement("div",{className:"question-answers"},this.isDefaultType()&&React.createElement("ul",{id:"answer-options-".concat(r.id),className:"answer-options"},this.getOptions().map((function(t){var o="learn-press-answer-option-".concat(t.uid);return React.createElement("li",{className:e.getOptionClass(t).join(" "),key:"answer-option-".concat(t.uid)},React.createElement("input",{type:e.getOptionType(r.type,t),className:"option-check",name:"started"===n?"learn-press-question-".concat(r.id):"",id:o,ref:function(r){e.setInputRef(r,t.value)},onChange:e.setAnswerChecked(),disabled:e.maybeDisabledOption(t),checked:e.maybeCheckedAnswer(t.value),value:"started"===n?t.value:""}),React.createElement("label",{htmlFor:o,className:"option-title",dangerouslySetInnerHTML:{__html:t.title||t.value}}))}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}])&&s(t.prototype,r),n&&s(t,n),u}(n.Component));function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=A(e);if(t){var o=A(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return R(this,r)}}function R(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?P(e):t}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(r,e);var t=S(r);function r(){var e;j(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return C(P(e=t.call.apply(t,[this].concat(o))),"getOptionClass",(function(t){var r=e.props.answered,n=g(e.state.optionClass);return e.maybeShowCorrectAnswer()&&("yes"===t.isTrue&&n.push("answer-correct"),r&&("yes"===t.isTrue?r===t.value&&n.push("answered-correct"):r===t.value&&n.push("answered-wrong"))),n})),e}return r}(v);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=B(e);if(t){var o=B(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return L(this,r)}}function L(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?M(e):t}function M(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F=lodash.isBoolean,U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(r,e);var t=N(r);function r(){var e;x(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return D(M(e=t.call.apply(t,[this].concat(o))),"isCorrect",(function(){var t,r,n,o=e.props.answered;if(F(o)||!o)return!1;for(t=0,n=e.getOptions();t<n.length;t++)if("yes"===(r=n[t]).isTrue){if(-1===o.indexOf(r.value))return!1}else if(-1!==o.indexOf(r.value))return!1;return!0})),D(M(e),"getOptionClass",(function(t){var r=e.props.answered,n=k(e.state.optionClass);return e.maybeShowCorrectAnswer()&&("yes"===t.isTrue&&n.push("answer-correct"),r&&("yes"===t.isTrue?-1!==r.indexOf(t.value)&&n.push("answered-correct"):-1!==r.indexOf(t.value)&&n.push("answered-wrong"))),n})),e}return r}(v);function H(e){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(e){return function(e){if(Array.isArray(e))return $(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=K(e);if(t){var o=K(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return V(this,r)}}function V(e,t){return!t||"object"!==H(t)&&"function"!=typeof t?G(e):t}function G(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(r,e);var t=W(r);function r(){var e;z(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return X(G(e=t.call.apply(t,[this].concat(o))),"getOptionClass",(function(t){var r=e.props.answered,n=Q(e.state.optionClass);return e.maybeShowCorrectAnswer()&&("yes"===t.isTrue&&n.push("answer-correct"),r&&("yes"===t.isTrue?r===t.value&&n.push("answered-correct"):r===t.value&&n.push("answered-wrong"))),n})),e}return r}(v);function Z(e){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e){return function(e){if(Array.isArray(e))return te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ne(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ae(e);if(t){var o=ae(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ce(this,r)}}function ce(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?ue(e):t}function ue(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ae(e){return(ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function se(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var le=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(i,e);var t,r,n,o=ie(i);function i(){var e;re(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return se(ue(e=o.call.apply(o,[this].concat(r))),"updateFibAnswer",(function(){var t=document.querySelectorAll(".lp-fib-input > input"),r={};ee(t).map((function(t){t.addEventListener("input",(function(n){e.setAnswered(r,t.dataset.id,n.target.value)})),t.addEventListener("paste",(function(n){e.setAnswered(r,t.dataset.id,n.target.value)}))}))})),se(ue(e),"setAnswered",(function(t,r,n){var o=e.props,i=o.updateUserQuestionAnswers,c=o.question;if("started"!==o.status)return"LP Error: can not set answers";var u=Object.assign(t,se({},r,n));i(c.id,u)})),se(ue(e),"getCorrectLabel",(function(){var t=e.props,r=t.question,n=t.mark,o=n||0;return n&&(Number.isInteger(n)||(o=n.toFixed(2))),e.maybeShowCorrectAnswer()&&React.createElement("div",{className:"question-response correct"},React.createElement("span",{className:"label"},Object(c.__)("Points","learnpress")),React.createElement("span",{className:"point"},"".concat(o,"/").concat(r.point," ").concat(Object(c.__)("point","learnpress"))),React.createElement("span",{className:"lp-fib-note"},React.createElement("span",{style:{background:"#00adff"}}),Object(c.__)("Correct","learnpress")),React.createElement("span",{className:"lp-fib-note"},React.createElement("span",{style:{background:"#d85554"}}),Object(c.__)("Incorrect","learnpress")))})),e}return t=i,(r=[{key:"componentDidMount",value:function(){this.updateFibAnswer()}},{key:"componentDidUpdate",value:function(e){e.answered||this.updateFibAnswer()}},{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"lp-fib-content"},this.getOptions().map((function(e){return React.createElement("div",{key:"blank-".concat(e.uid),dangerouslySetInnerHTML:{__html:e.title||e.value}})}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}])&&ne(t.prototype,r),n&&ne(t,n),i}(v);function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pe(e){return function(e){if(Array.isArray(e))return ye(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ye(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ye(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function he(e,t){return(he=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ge(e);if(t){var o=ge(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ve(this,r)}}function ve(e,t){return!t||"object"!==fe(t)&&"function"!=typeof t?we(e):t}function we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ge(e){return(ge=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var je=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&he(e,t)}(i,e);var t,r,n,o=de(i);function i(){var e;be(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Oe(we(e=o.call.apply(o,[this].concat(r))),"isCorrect",(function(){var t,r,n,o=e.props.answered;if(!o)return!1;for(t=0,n=e.getOptions();t<n.length;t++)if(o[(r=n[t]).sorting]!==r.value)return!1;return!0})),Oe(we(e),"getCorrectLabel",(function(){var t=e.props.question,r=e.isCorrect.call(we(e));return e.maybeShowCorrectAnswer()&&React.createElement(React.Fragment,null,React.createElement("div",{className:"question-response"+(r?" correct":" incorrect")},React.createElement("span",{className:"label"},r?Object(c.__)("Correct","learnpress"):Object(c.__)("Incorrect","learnpress")),React.createElement("span",{className:"point"},sprintf(Object(c.__)("%d/%d point","learnpress"),r?t.point:0,t.point))))})),Oe(we(e),"getAnswerSortingChoice",(function(){var t=e.props.question.options||[],r=e.isCorrect.call(we(e)),n=[];return!r&&t.length>0&&t.map((function(e){var t=e.sorting;if(void 0!==t)return n[t]=e.title})),n})),e}return t=i,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.updateUserQuestionAnswers,r=e.question,n=document.querySelector("#answer-options-".concat(r.id));return jQuery(n).sortable({items:".answer-option",cursor:"move",axis:"y",handle:".option-drag",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,update:function(e,o){var i=n.querySelectorAll(".answer-option"),c=[];pe(i).map((function(e){return c.push(e.dataset.value)})),c.length>0&&t(r.id,c)}})}},{key:"render",value:function(){var e=this,t=this.props.question,r=this.getAnswerSortingChoice();return React.createElement("div",{className:"question-answers"},this.isDefaultType()&&React.createElement("ul",{id:"answer-options-".concat(t.id),className:"answer-options lp-sorting-choice-ul"},this.getOptions().map((function(t,n){return React.createElement(React.Fragment,null,React.createElement("li",{className:e.getOptionClass(t).join(" "),key:"answer-option-".concat(t.value),"data-value":t.value},React.createElement("span",{className:"option-drag",style:{display:"flex",alignItems:"center",position:"absolute",height:"100%",left:14}},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},React.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),React.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}))),React.createElement("label",{htmlFor:"learn-press-answer-option-".concat(t.value),className:"option-title",dangerouslySetInnerHTML:{__html:t.title||t.value}})),r.length>0&&void 0!==r[n]&&React.createElement("div",{className:"lp-sorting-choice__check-answer",key:"lp-checked-answer-".concat(n),style:{marginBottom:10}},r[n]))}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}])&&me(t.prototype,r),n&&me(t,n),i}(v);function _e(e){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ae(e,t){return(Ae=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ke(e);if(t){var o=ke(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ee(this,r)}}function Ee(e,t){return!t||"object"!==_e(t)&&"function"!=typeof t?Te(e):t}function Te(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ae(e,t)}(i,e);var t,r,n,o=Ce(i);function i(){var e;Re(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return qe(Te(e=o.call.apply(o,[this].concat(r))),"getQuestion",(function(){var t=e.props.question;return LP.Hook.applyFilters("question-types",{single_choice:LP.questionTypes.SingleChoice,multi_choice:LP.questionTypes.MultipleChoices,true_or_false:LP.questionTypes.TrueOrFalse,fill_in_blanks:LP.questionTypes.FillInBlanks,sorting_choice:LP.questionTypes.SortingChoice})[t.type]})),e}return t=i,(r=[{key:"render",value:function(){var e=this.props,t=e.question,r=e.supportOptions,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){qe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},this.props);n.supportOptions=-1!==r.indexOf(t.type);var o=this.getQuestion()||function(){return React.createElement("div",{className:"question-types",dangerouslySetInnerHTML:{__html:Object(c.sprintf)(Object(c.__)("Question <code>%s</code> invalid!","learnpress"),t.type)}})};return React.createElement(React.Fragment,null,React.createElement(o,n))}}])&&Pe(t.prototype,r),n&&Pe(t,n),i}(n.Component),Ie=Object(o.compose)(Object(i.withSelect)((function(e,t){var r=t.question.id,n=e("learnpress/quiz"),o=n.getData,i=n.isCheckedAnswer;return{supportOptions:o("supportOptions"),isCheckedAnswer:i(r),keyPressed:o("keyPressed"),showCorrectReview:o("showCorrectReview"),isReviewing:"reviewing"===o("mode")}})),Object(i.withDispatch)((function(){return{}})))(xe);t.default=Ie},3:function(e,t){e.exports=window.wp.element},4:function(e,t){e.exports=window.wp.compose}});
|
1 |
+
this.LP=this.LP||{},this.LP.questionTypes=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=22)}({0:function(e,t){e.exports=window.wp.i18n},1:function(e,t){e.exports=window.wp.data},22:function(e,t,r){"use strict";r.r(t),r.d(t,"QuestionBase",(function(){return v})),r.d(t,"SingleChoice",(function(){return E})),r.d(t,"MultipleChoices",(function(){return U})),r.d(t,"TrueOrFalse",(function(){return Y})),r.d(t,"FillInBlanks",(function(){return fe}));var n=r(3),o=r(4),i=r(1),u=r(0);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p(this,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=lodash,m=h.isArray,v=(h.get,h.set,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(c,e);var t,r,n,o=l(c);function c(e){var t;a(this,c),d(y(t=o.apply(this,arguments)),"prepare",(function(e,t){var r=e.question;return r&&r.id!==t.questionId?{options:t.self.parseOptions(r.options)}:null})),d(y(t),"setInputRef",(function(e,r){t.inputs||(t.inputs={}),t.inputs[r]=e})),d(y(t),"maybeShowCorrectAnswer",(function(){var e=t.props,r=e.status,n=e.isCheckedAnswer,o=e.showCorrectReview,i=e.isReviewing;return"completed"===r&&o||n&&!i})),d(y(t),"maybeDisabledOption",(function(e){var r=t.props,n=(r.answered,r.status);return r.isCheckedAnswer||"started"!==n})),d(y(t),"setAnswerChecked",(function(){return function(e){var r=t.props,n=r.updateUserQuestionAnswers,o=r.question;if("started"!==r.status)return Object(u.__)("LP Error: can not set answers","learnpress");var i=t.$wrap.find(".option-check"),c=[],a="multi_choice"!==o.type;i.each((function(e,t){if(t.checked&&(c.push(t.value),a))return!1})),n(o.id,a?c[0]:c)}})),d(y(t),"maybeCheckedAnswer",(function(e){var r=t.props.answered;return m(r)?!!r.find((function(t){return t==e})):e==r})),d(y(t),"getOptionType",(function(e,t){var r="radio";switch(e){case"multi_choice":r="checkbox"}return r})),d(y(t),"isDefaultType",(function(){return t.props.supportOptions})),d(y(t),"getWarningMessage",(function(){return React.createElement(React.Fragment,null,Object(u.__)("Render function should be overwritten from base.","learnpress"))})),d(y(t),"getOptionClass",(function(e){t.props.answered;return["answer-option"]})),d(y(t),"parseOptions",(function(e){return e&&(e=m(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=m(e)?e:JSON.parse(e)),e||[]})),d(y(t),"getOptions",(function(){return t.state.options||[]})),d(y(t),"isCorrect",(function(){var e,r,n,o=t.props.answered;if(!o)return!1;for(e=0,n=t.getOptions();e<n.length;e++)if("yes"===(r=n[e]).isTrue&&o==r.value)return!0;return!1})),d(y(t),"isChecked",(function(){var e=t.props.question;return Object(i.select)("learnpress/quiz").isCheckedAnswer(e.id)})),d(y(t),"getCorrectLabel",(function(){var e=t.props,r=(e.status,e.answered,e.question),n=(LP.config.isQuestionCorrect[r.type]||t.isCorrect).call(y(t));return t.maybeShowCorrectAnswer()&&React.createElement("div",{className:"question-response"+(n?" correct":" incorrect")},React.createElement("span",{className:"label"},n?Object(u.__)("Correct","learnpress"):Object(u.__)("Incorrect","learnpress")),React.createElement("span",{className:"point"},sprintf(Object(u.__)("%d/%d point","learnpress"),n?r.point:0,r.point)))}));var r=e.question;return t.state={optionClass:["answer-option"],questionId:0,options:r?t.parseOptions(r.options):[],self:y(t)},e.$wrap&&(t.$wrap=e.$wrap),t}return t=c,n=[{key:"getDerivedStateFromProps",value:function(e,t){return t.self.prepare(e,t)}}],(r=[{key:"componentDidMount",value:function(){var e=this.prepare(this.props,this.state);e&&this.setState(e)}},{key:"render",value:function(){var e=this,t=this.props,r=t.question,n=t.status;return React.createElement("div",{className:"question-answers"},this.isDefaultType()&&React.createElement("ul",{id:"answer-options-".concat(r.id),className:"answer-options"},this.getOptions().map((function(t){var o="learn-press-answer-option-".concat(t.uid);return React.createElement("li",{className:e.getOptionClass(t).join(" "),key:"answer-option-".concat(t.uid)},React.createElement("input",{type:e.getOptionType(r.type,t),className:"option-check",name:"started"===n?"learn-press-question-".concat(r.id):"",id:o,ref:function(r){e.setInputRef(r,t.value)},onChange:e.setAnswerChecked(),disabled:e.maybeDisabledOption(t),checked:e.maybeCheckedAnswer(t.value),value:"started"===n?t.value:""}),React.createElement("label",{htmlFor:o,className:"option-title",dangerouslySetInnerHTML:{__html:t.title||t.value}}))}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}])&&s(t.prototype,r),n&&s(t,n),c}(n.Component));function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=A(e);if(t){var o=A(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return R(this,r)}}function R(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?P(e):t}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(r,e);var t=S(r);function r(){var e;j(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return C(P(e=t.call.apply(t,[this].concat(o))),"getOptionClass",(function(t){var r=e.props.answered,n=O(e.state.optionClass);return e.maybeShowCorrectAnswer()&&("yes"===t.isTrue&&n.push("answer-correct"),r&&("yes"===t.isTrue?r===t.value&&n.push("answered-correct"):r===t.value&&n.push("answered-wrong"))),n})),e}return r}(v);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=B(e);if(t){var o=B(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return M(this,r)}}function M(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?N(e):t}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F=lodash.isBoolean,U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(r,e);var t=L(r);function r(){var e;q(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return D(N(e=t.call.apply(t,[this].concat(o))),"isCorrect",(function(){var t,r,n,o=e.props.answered;if(F(o)||!o)return!1;for(t=0,n=e.getOptions();t<n.length;t++)if("yes"===(r=n[t]).isTrue){if(-1===o.indexOf(r.value))return!1}else if(-1!==o.indexOf(r.value))return!1;return!0})),D(N(e),"getOptionClass",(function(t){var r=e.props.answered,n=k(e.state.optionClass);return e.maybeShowCorrectAnswer()&&("yes"===t.isTrue&&n.push("answer-correct"),r&&("yes"===t.isTrue?-1!==r.indexOf(t.value)&&n.push("answered-correct"):-1!==r.indexOf(t.value)&&n.push("answered-wrong"))),n})),e}return r}(v);function $(e){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=V(e);if(t){var o=V(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return G(this,r)}}function G(e,t){return!t||"object"!==$(t)&&"function"!=typeof t?K(e):t}function K(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(r,e);var t=z(r);function r(){var e;H(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return X(K(e=t.call.apply(t,[this].concat(o))),"getOptionClass",(function(t){var r=e.props.answered,n=Q(e.state.optionClass);return e.maybeShowCorrectAnswer()&&("yes"===t.isTrue&&n.push("answer-correct"),r&&("yes"===t.isTrue?r===t.value&&n.push("answered-correct"):r===t.value&&n.push("answered-wrong"))),n})),e}return r}(v);function Z(e){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e){return function(e){if(Array.isArray(e))return te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ne(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ae(e);if(t){var o=ae(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ue(this,r)}}function ue(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?ce(e):t}function ce(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ae(e){return(ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function se(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(i,e);var t,r,n,o=ie(i);function i(){var e;re(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return se(ce(e=o.call.apply(o,[this].concat(r))),"updateFibAnswer",(function(){var t=document.querySelectorAll(".lp-fib-input > input"),r={};ee(t).map((function(t){t.addEventListener("input",(function(n){e.setAnswered(r,t.dataset.id,n.target.value)})),t.addEventListener("paste",(function(n){e.setAnswered(r,t.dataset.id,n.target.value)}))}))})),se(ce(e),"setAnswered",(function(t,r,n){var o=e.props,i=o.updateUserQuestionAnswers,u=o.question;if("started"!==o.status)return"LP Error: can not set answers";var c=Object.assign(t,se({},r,n));i(u.id,c)})),se(ce(e),"getCorrectLabel",(function(){var t=e.props,r=t.question,n=t.mark,o=n||0;return n&&(Number.isInteger(n)||(o=n.toFixed(2))),e.maybeShowCorrectAnswer()&&React.createElement("div",{className:"question-response correct"},React.createElement("span",{className:"label"},Object(u.__)("Points","learnpress")),React.createElement("span",{className:"point"},"".concat(o,"/").concat(r.point," ").concat(Object(u.__)("point","learnpress"))),React.createElement("span",{className:"lp-fib-note"},React.createElement("span",{style:{background:"#00adff"}}),Object(u.__)("Correct","learnpress")),React.createElement("span",{className:"lp-fib-note"},React.createElement("span",{style:{background:"#d85554"}}),Object(u.__)("Incorrect","learnpress")))})),e}return t=i,(r=[{key:"componentDidMount",value:function(){this.updateFibAnswer()}},{key:"componentDidUpdate",value:function(e){e.answered||this.updateFibAnswer()}},{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"lp-fib-content"},this.getOptions().map((function(e){return React.createElement("div",{key:"blank-".concat(e.uid),dangerouslySetInnerHTML:{__html:e.title||e.value}})}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}])&&ne(t.prototype,r),n&&ne(t,n),i}(v);function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t){return(de=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function he(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=we(e);if(t){var o=we(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return me(this,r)}}function me(e,t){return!t||"object"!==le(t)&&"function"!=typeof t?ve(e):t}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(e){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ge=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&de(e,t)}(i,e);var t,r,n,o=he(i);function i(){var e;ye(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Oe(ve(e=o.call.apply(o,[this].concat(r))),"getQuestion",(function(){var t=e.props.question;return LP.Hook.applyFilters("question-types",{single_choice:LP.questionTypes.SingleChoice,multi_choice:LP.questionTypes.MultipleChoices,true_or_false:LP.questionTypes.TrueOrFalse,fill_in_blanks:LP.questionTypes.FillInBlanks})[t.type]})),e}return t=i,(r=[{key:"render",value:function(){var e=this.props,t=e.question,r=e.supportOptions,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){Oe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},this.props);n.supportOptions=-1!==r.indexOf(t.type);var o=this.getQuestion()||function(){return React.createElement("div",{className:"question-types",dangerouslySetInnerHTML:{__html:Object(u.sprintf)(Object(u.__)("Question <code>%s</code> invalid!","learnpress"),t.type)}})};return React.createElement(React.Fragment,null,React.createElement(o,n))}}])&&be(t.prototype,r),n&&be(t,n),i}(n.Component),je=Object(o.compose)(Object(i.withSelect)((function(e,t){var r=t.question.id,n=e("learnpress/quiz"),o=n.getData,i=n.isCheckedAnswer;return{supportOptions:o("supportOptions"),isCheckedAnswer:i(r),keyPressed:o("keyPressed"),showCorrectReview:o("showCorrectReview"),isReviewing:"reviewing"===o("mode")}})),Object(i.withDispatch)((function(){return{}})))(ge);t.default=je},3:function(e,t){e.exports=window.wp.element},4:function(e,t){e.exports=window.wp.compose}});
|
@@ -82,23 +82,23 @@ this["LP"] = this["LP"] || {}; this["LP"]["quiz"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! exports provided: default, init */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; });
|
100 |
-
/* harmony import */ var _quiz_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quiz/index */ "../../../Clouds/Thimpress/Plugins/github.com/
|
101 |
-
/* harmony import */ var _single_curriculum_components_compatible__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./single-curriculum/components/compatible */ "../../../Clouds/Thimpress/Plugins/github.com/
|
102 |
/* harmony import */ var _single_curriculum_components_compatible__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_single_curriculum_components_compatible__WEBPACK_IMPORTED_MODULE_1__);
|
103 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
104 |
|
@@ -126,10 +126,10 @@ var init = function init(elem, settings) {
|
|
126 |
|
127 |
/***/ }),
|
128 |
|
129 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
130 |
-
|
131 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
132 |
-
|
133 |
/*! exports provided: default */
|
134 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
135 |
|
@@ -139,7 +139,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
139 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
140 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
141 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
142 |
-
/* harmony import */ var _duration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../duration */ "../../../Clouds/Thimpress/Plugins/github.com/
|
143 |
|
144 |
|
145 |
|
@@ -250,16 +250,16 @@ function timeDifference(earlierDate, laterDate) {
|
|
250 |
|
251 |
/***/ }),
|
252 |
|
253 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
254 |
-
|
255 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
256 |
-
|
257 |
/*! exports provided: default */
|
258 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
259 |
|
260 |
"use strict";
|
261 |
__webpack_require__.r(__webpack_exports__);
|
262 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../../../Clouds/Thimpress/Plugins/github.com/
|
263 |
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
264 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
265 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
@@ -380,10 +380,10 @@ var ButtonCheck = /*#__PURE__*/function (_Component) {
|
|
380 |
|
381 |
/***/ }),
|
382 |
|
383 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
384 |
-
|
385 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
386 |
-
|
387 |
/*! exports provided: default */
|
388 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
389 |
|
@@ -481,10 +481,10 @@ var ButtonHint = /*#__PURE__*/function (_Component) {
|
|
481 |
|
482 |
/***/ }),
|
483 |
|
484 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
485 |
-
|
486 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
487 |
-
|
488 |
/*! exports provided: MaybeShowButton, default */
|
489 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
490 |
|
@@ -972,10 +972,10 @@ var MaybeShowButton = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["co
|
|
972 |
|
973 |
/***/ }),
|
974 |
|
975 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
976 |
-
|
977 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
978 |
-
|
979 |
/*! exports provided: default */
|
980 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
981 |
|
@@ -1005,10 +1005,10 @@ var Content = function Content() {
|
|
1005 |
|
1006 |
/***/ }),
|
1007 |
|
1008 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1009 |
-
|
1010 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1011 |
-
|
1012 |
/*! exports provided: default */
|
1013 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1014 |
|
@@ -1039,40 +1039,40 @@ var formatDuration = function formatDuration(seconds) {
|
|
1039 |
|
1040 |
/***/ }),
|
1041 |
|
1042 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1043 |
-
|
1044 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1045 |
-
|
1046 |
/*! exports provided: Title, Content, Meta, Buttons, Questions, Attempts, Timer, Result, Status */
|
1047 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1048 |
|
1049 |
"use strict";
|
1050 |
__webpack_require__.r(__webpack_exports__);
|
1051 |
-
/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./title */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1052 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Title", function() { return _title__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
1053 |
|
1054 |
-
/* harmony import */ var _content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./content */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1055 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Content", function() { return _content__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
1056 |
|
1057 |
-
/* harmony import */ var _meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./meta */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1058 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Meta", function() { return _meta__WEBPACK_IMPORTED_MODULE_2__["default"]; });
|
1059 |
|
1060 |
-
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./buttons */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1061 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Buttons", function() { return _buttons__WEBPACK_IMPORTED_MODULE_3__["default"]; });
|
1062 |
|
1063 |
-
/* harmony import */ var _questions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./questions */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1064 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Questions", function() { return _questions__WEBPACK_IMPORTED_MODULE_4__["default"]; });
|
1065 |
|
1066 |
-
/* harmony import */ var _attempts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./attempts */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1067 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Attempts", function() { return _attempts__WEBPACK_IMPORTED_MODULE_5__["default"]; });
|
1068 |
|
1069 |
-
/* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./timer */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1070 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _timer__WEBPACK_IMPORTED_MODULE_6__["default"]; });
|
1071 |
|
1072 |
-
/* harmony import */ var _result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./result */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1073 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Result", function() { return _result__WEBPACK_IMPORTED_MODULE_7__["default"]; });
|
1074 |
|
1075 |
-
/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./status */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1076 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Status", function() { return _status__WEBPACK_IMPORTED_MODULE_8__["default"]; });
|
1077 |
|
1078 |
|
@@ -1087,10 +1087,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
1087 |
|
1088 |
/***/ }),
|
1089 |
|
1090 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1091 |
-
|
1092 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1093 |
-
|
1094 |
/*! exports provided: default */
|
1095 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1096 |
|
@@ -1100,7 +1100,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
1100 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
1101 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1102 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
1103 |
-
/* harmony import */ var _duration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../duration */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1104 |
/**
|
1105 |
* Quiz Meta.
|
1106 |
* Edit: Use React Hook.
|
@@ -1160,18 +1160,18 @@ var Meta = function Meta() {
|
|
1160 |
|
1161 |
/***/ }),
|
1162 |
|
1163 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1164 |
-
|
1165 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1166 |
-
|
1167 |
/*! exports provided: default */
|
1168 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1169 |
|
1170 |
"use strict";
|
1171 |
__webpack_require__.r(__webpack_exports__);
|
1172 |
-
/* harmony import */ var _buttons_button_hint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buttons/button-hint */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1173 |
-
/* harmony import */ var _buttons_button_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../buttons/button-check */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1174 |
-
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../buttons */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1175 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1176 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
1177 |
|
@@ -1208,10 +1208,10 @@ var Buttons = function Buttons(props) {
|
|
1208 |
|
1209 |
/***/ }),
|
1210 |
|
1211 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1212 |
-
|
1213 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1214 |
-
|
1215 |
/*! exports provided: default */
|
1216 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1217 |
|
@@ -1225,7 +1225,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
1225 |
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
|
1226 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1227 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1228 |
-
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1229 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1230 |
|
1231 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -1435,10 +1435,10 @@ var Questions = /*#__PURE__*/function (_Component) {
|
|
1435 |
|
1436 |
/***/ }),
|
1437 |
|
1438 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1439 |
-
|
1440 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1441 |
-
|
1442 |
/*! exports provided: default */
|
1443 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1444 |
|
@@ -1452,10 +1452,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
1452 |
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
|
1453 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1454 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1455 |
-
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./buttons */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1456 |
-
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../buttons */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1457 |
-
/* harmony import */ var _buttons_button_check__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../buttons/button-check */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1458 |
-
/* harmony import */ var _buttons_button_hint__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../buttons/button-hint */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1459 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1460 |
|
1461 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
@@ -1579,6 +1579,11 @@ var Question = /*#__PURE__*/function (_Component) {
|
|
1579 |
}
|
1580 |
|
1581 |
LP.Hook.doAction('lp-question-compatible-builder');
|
|
|
|
|
|
|
|
|
|
|
1582 |
return a;
|
1583 |
}
|
1584 |
}, {
|
@@ -1727,10 +1732,10 @@ var Question = /*#__PURE__*/function (_Component) {
|
|
1727 |
|
1728 |
/***/ }),
|
1729 |
|
1730 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1731 |
-
|
1732 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1733 |
-
|
1734 |
/*! exports provided: default */
|
1735 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1736 |
|
@@ -1742,7 +1747,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
1742 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
|
1743 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1744 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
|
1745 |
-
/* harmony import */ var _single_curriculum_components_items_progress__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../single-curriculum/components/items-progress */ "../../../Clouds/Thimpress/Plugins/github.com/
|
1746 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
1747 |
|
1748 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -2039,10 +2044,10 @@ var Result = function Result() {
|
|
2039 |
|
2040 |
/***/ }),
|
2041 |
|
2042 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2043 |
-
|
2044 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2045 |
-
|
2046 |
/*! exports provided: default */
|
2047 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2048 |
|
@@ -2052,7 +2057,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
2052 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
2053 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
2054 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
|
2055 |
-
/* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../timer */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2056 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
2057 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
2058 |
|
@@ -2189,10 +2194,10 @@ var Status = function Status() {
|
|
2189 |
|
2190 |
/***/ }),
|
2191 |
|
2192 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2193 |
-
|
2194 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2195 |
-
|
2196 |
/*! exports provided: default */
|
2197 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2198 |
|
@@ -2289,10 +2294,10 @@ var Timer = function Timer() {
|
|
2289 |
|
2290 |
/***/ }),
|
2291 |
|
2292 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2293 |
-
|
2294 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2295 |
-
|
2296 |
/*! exports provided: default */
|
2297 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2298 |
|
@@ -2306,10 +2311,10 @@ var Title = function Title() {
|
|
2306 |
|
2307 |
/***/ }),
|
2308 |
|
2309 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2310 |
-
|
2311 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2312 |
-
|
2313 |
/*! exports provided: default */
|
2314 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2315 |
|
@@ -2321,8 +2326,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
2321 |
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);
|
2322 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
2323 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
|
2324 |
-
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2325 |
-
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./store */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2326 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
2327 |
|
2328 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -2437,10 +2442,10 @@ var Quiz = /*#__PURE__*/function (_Component) {
|
|
2437 |
|
2438 |
/***/ }),
|
2439 |
|
2440 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2441 |
-
|
2442 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2443 |
-
|
2444 |
/*! exports provided: setQuizData, setCurrentQuestion, setCurrentPage, __requestBeforeStartQuiz, __requestStartQuizSuccess, startQuiz, __requestSubmitQuiz, __requestSubmitQuizSuccess, submitQuiz, updateUserQuestionAnswers, __requestShowHintSuccess, showHint, __requestCheckAnswerSuccess, checkAnswer, markQuestionRendered, setQuizMode, sendKey */
|
2445 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2446 |
|
@@ -2776,10 +2781,10 @@ function sendKey(keyPressed) {
|
|
2776 |
|
2777 |
/***/ }),
|
2778 |
|
2779 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2780 |
-
|
2781 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2782 |
-
|
2783 |
/*! exports provided: default */
|
2784 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2785 |
|
@@ -2787,10 +2792,10 @@ function sendKey(keyPressed) {
|
|
2787 |
__webpack_require__.r(__webpack_exports__);
|
2788 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
2789 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
2790 |
-
/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2791 |
-
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2792 |
-
/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2793 |
-
/* harmony import */ var _middlewares__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2794 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2795 |
|
2796 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
@@ -2814,16 +2819,16 @@ Object(_middlewares__WEBPACK_IMPORTED_MODULE_4__["default"])(store);
|
|
2814 |
|
2815 |
/***/ }),
|
2816 |
|
2817 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2818 |
-
|
2819 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2820 |
-
|
2821 |
/*! exports provided: default */
|
2822 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2823 |
|
2824 |
"use strict";
|
2825 |
__webpack_require__.r(__webpack_exports__);
|
2826 |
-
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! refx */ "../../../Clouds/Thimpress/Plugins/github.com/
|
2827 |
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(refx__WEBPACK_IMPORTED_MODULE_0__);
|
2828 |
/**
|
2829 |
* External dependencies
|
@@ -2869,10 +2874,10 @@ function applyMiddlewares(store) {
|
|
2869 |
|
2870 |
/***/ }),
|
2871 |
|
2872 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
2873 |
-
|
2874 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
2875 |
-
|
2876 |
/*! exports provided: setItemStatus, userQuiz, blocks, default */
|
2877 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2878 |
|
@@ -3138,10 +3143,10 @@ var blocks = flow(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["combineReducers"
|
|
3138 |
|
3139 |
/***/ }),
|
3140 |
|
3141 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3142 |
-
|
3143 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3144 |
-
|
3145 |
/*! exports provided: getQuestionOptions, getItemStatus, getProp, getQuizAttempts, getQuizAnswered, getQuestions, getData, getDefaultRestArgs, getQuestionAnswered, getQuestionMark, getCurrentQuestion, getQuestion, isCheckedAnswer, isCorrect, getQuestionsSelectedAnswers, getUserMark */
|
3146 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3147 |
|
@@ -3417,16 +3422,16 @@ function getUserMark(state) {
|
|
3417 |
|
3418 |
/***/ }),
|
3419 |
|
3420 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3421 |
-
|
3422 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3423 |
-
|
3424 |
/*! exports provided: default */
|
3425 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3426 |
|
3427 |
"use strict";
|
3428 |
__webpack_require__.r(__webpack_exports__);
|
3429 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
3430 |
var $ = jQuery;
|
3431 |
|
3432 |
var lpModalOverlayCompleteItem = {
|
@@ -3479,10 +3484,10 @@ var lpModalOverlayCompleteItem = {
|
|
3479 |
|
3480 |
/***/ }),
|
3481 |
|
3482 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3483 |
-
|
3484 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3485 |
-
|
3486 |
/*! no static exports found */
|
3487 |
/***/ (function(module, exports) {
|
3488 |
|
@@ -3571,10 +3576,10 @@ LP.Hook.addAction('lp-question-compatible-builder', function () {
|
|
3571 |
|
3572 |
/***/ }),
|
3573 |
|
3574 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3575 |
-
|
3576 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3577 |
-
|
3578 |
/*! exports provided: itemsProgress, getResponse */
|
3579 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3580 |
|
@@ -3584,7 +3589,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
3584 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getResponse", function() { return getResponse; });
|
3585 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
3586 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
|
3587 |
-
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/
|
3588 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
3589 |
|
3590 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
@@ -3672,10 +3677,10 @@ var getResponse = /*#__PURE__*/function () {
|
|
3672 |
|
3673 |
/***/ }),
|
3674 |
|
3675 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3676 |
-
|
3677 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3678 |
-
|
3679 |
/*! exports provided: default */
|
3680 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3681 |
|
@@ -3742,10 +3747,10 @@ var lpModalOverlay = {
|
|
3742 |
|
3743 |
/***/ }),
|
3744 |
|
3745 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3746 |
-
|
3747 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3748 |
-
|
3749 |
/*! no static exports found */
|
3750 |
/***/ (function(module, exports, __webpack_require__) {
|
3751 |
|
@@ -3810,10 +3815,10 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
3810 |
|
3811 |
/***/ }),
|
3812 |
|
3813 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
3814 |
-
|
3815 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
3816 |
-
|
3817 |
/*! no static exports found */
|
3818 |
/***/ (function(module, exports, __webpack_require__) {
|
3819 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz.js":
|
91 |
+
/*!******************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz.js ***!
|
93 |
+
\******************************************************************************************************************************/
|
94 |
/*! exports provided: default, init */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; });
|
100 |
+
/* harmony import */ var _quiz_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quiz/index */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/index.js");
|
101 |
+
/* harmony import */ var _single_curriculum_components_compatible__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./single-curriculum/components/compatible */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/compatible.js");
|
102 |
/* harmony import */ var _single_curriculum_components_compatible__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_single_curriculum_components_compatible__WEBPACK_IMPORTED_MODULE_1__);
|
103 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
104 |
|
126 |
|
127 |
/***/ }),
|
128 |
|
129 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/attempts/index.js":
|
130 |
+
/*!********************************************************************************************************************************************************!*\
|
131 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/attempts/index.js ***!
|
132 |
+
\********************************************************************************************************************************************************/
|
133 |
/*! exports provided: default */
|
134 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
135 |
|
139 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
140 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
141 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
142 |
+
/* harmony import */ var _duration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../duration */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/duration/index.js");
|
143 |
|
144 |
|
145 |
|
250 |
|
251 |
/***/ }),
|
252 |
|
253 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-check.js":
|
254 |
+
/*!**************************************************************************************************************************************************************!*\
|
255 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-check.js ***!
|
256 |
+
\**************************************************************************************************************************************************************/
|
257 |
/*! exports provided: default */
|
258 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
259 |
|
260 |
"use strict";
|
261 |
__webpack_require__.r(__webpack_exports__);
|
262 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/classnames/index.js");
|
263 |
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
264 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
265 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
380 |
|
381 |
/***/ }),
|
382 |
|
383 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-hint.js":
|
384 |
+
/*!*************************************************************************************************************************************************************!*\
|
385 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-hint.js ***!
|
386 |
+
\*************************************************************************************************************************************************************/
|
387 |
/*! exports provided: default */
|
388 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
389 |
|
481 |
|
482 |
/***/ }),
|
483 |
|
484 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/index.js":
|
485 |
+
/*!*******************************************************************************************************************************************************!*\
|
486 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/index.js ***!
|
487 |
+
\*******************************************************************************************************************************************************/
|
488 |
/*! exports provided: MaybeShowButton, default */
|
489 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
490 |
|
972 |
|
973 |
/***/ }),
|
974 |
|
975 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/content/index.js":
|
976 |
+
/*!*******************************************************************************************************************************************************!*\
|
977 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/content/index.js ***!
|
978 |
+
\*******************************************************************************************************************************************************/
|
979 |
/*! exports provided: default */
|
980 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
981 |
|
1005 |
|
1006 |
/***/ }),
|
1007 |
|
1008 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/duration/index.js":
|
1009 |
+
/*!********************************************************************************************************************************************************!*\
|
1010 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/duration/index.js ***!
|
1011 |
+
\********************************************************************************************************************************************************/
|
1012 |
/*! exports provided: default */
|
1013 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1014 |
|
1039 |
|
1040 |
/***/ }),
|
1041 |
|
1042 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/index.js":
|
1043 |
+
/*!***********************************************************************************************************************************************!*\
|
1044 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/index.js ***!
|
1045 |
+
\***********************************************************************************************************************************************/
|
1046 |
/*! exports provided: Title, Content, Meta, Buttons, Questions, Attempts, Timer, Result, Status */
|
1047 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1048 |
|
1049 |
"use strict";
|
1050 |
__webpack_require__.r(__webpack_exports__);
|
1051 |
+
/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./title */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/title/index.js");
|
1052 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Title", function() { return _title__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
1053 |
|
1054 |
+
/* harmony import */ var _content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./content */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/content/index.js");
|
1055 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Content", function() { return _content__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
1056 |
|
1057 |
+
/* harmony import */ var _meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./meta */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/meta/index.js");
|
1058 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Meta", function() { return _meta__WEBPACK_IMPORTED_MODULE_2__["default"]; });
|
1059 |
|
1060 |
+
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./buttons */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/index.js");
|
1061 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Buttons", function() { return _buttons__WEBPACK_IMPORTED_MODULE_3__["default"]; });
|
1062 |
|
1063 |
+
/* harmony import */ var _questions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./questions */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/index.js");
|
1064 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Questions", function() { return _questions__WEBPACK_IMPORTED_MODULE_4__["default"]; });
|
1065 |
|
1066 |
+
/* harmony import */ var _attempts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./attempts */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/attempts/index.js");
|
1067 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Attempts", function() { return _attempts__WEBPACK_IMPORTED_MODULE_5__["default"]; });
|
1068 |
|
1069 |
+
/* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./timer */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/timer/index.js");
|
1070 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _timer__WEBPACK_IMPORTED_MODULE_6__["default"]; });
|
1071 |
|
1072 |
+
/* harmony import */ var _result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./result */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/result/index.js");
|
1073 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Result", function() { return _result__WEBPACK_IMPORTED_MODULE_7__["default"]; });
|
1074 |
|
1075 |
+
/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./status */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/status/index.js");
|
1076 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Status", function() { return _status__WEBPACK_IMPORTED_MODULE_8__["default"]; });
|
1077 |
|
1078 |
|
1087 |
|
1088 |
/***/ }),
|
1089 |
|
1090 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/meta/index.js":
|
1091 |
+
/*!****************************************************************************************************************************************************!*\
|
1092 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/meta/index.js ***!
|
1093 |
+
\****************************************************************************************************************************************************/
|
1094 |
/*! exports provided: default */
|
1095 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1096 |
|
1100 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
1101 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1102 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
1103 |
+
/* harmony import */ var _duration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../duration */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/duration/index.js");
|
1104 |
/**
|
1105 |
* Quiz Meta.
|
1106 |
* Edit: Use React Hook.
|
1160 |
|
1161 |
/***/ }),
|
1162 |
|
1163 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/buttons.js":
|
1164 |
+
/*!***********************************************************************************************************************************************************!*\
|
1165 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/buttons.js ***!
|
1166 |
+
\***********************************************************************************************************************************************************/
|
1167 |
/*! exports provided: default */
|
1168 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1169 |
|
1170 |
"use strict";
|
1171 |
__webpack_require__.r(__webpack_exports__);
|
1172 |
+
/* harmony import */ var _buttons_button_hint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buttons/button-hint */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-hint.js");
|
1173 |
+
/* harmony import */ var _buttons_button_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../buttons/button-check */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-check.js");
|
1174 |
+
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../buttons */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/index.js");
|
1175 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1176 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
1177 |
|
1208 |
|
1209 |
/***/ }),
|
1210 |
|
1211 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/index.js":
|
1212 |
+
/*!*********************************************************************************************************************************************************!*\
|
1213 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/index.js ***!
|
1214 |
+
\*********************************************************************************************************************************************************/
|
1215 |
/*! exports provided: default */
|
1216 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1217 |
|
1225 |
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
|
1226 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1227 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1228 |
+
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/question.js");
|
1229 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1230 |
|
1231 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1435 |
|
1436 |
/***/ }),
|
1437 |
|
1438 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/question.js":
|
1439 |
+
/*!************************************************************************************************************************************************************!*\
|
1440 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/question.js ***!
|
1441 |
+
\************************************************************************************************************************************************************/
|
1442 |
/*! exports provided: default */
|
1443 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1444 |
|
1452 |
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
|
1453 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1454 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1455 |
+
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./buttons */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/questions/buttons.js");
|
1456 |
+
/* harmony import */ var _buttons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../buttons */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/index.js");
|
1457 |
+
/* harmony import */ var _buttons_button_check__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../buttons/button-check */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-check.js");
|
1458 |
+
/* harmony import */ var _buttons_button_hint__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../buttons/button-hint */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/buttons/button-hint.js");
|
1459 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1460 |
|
1461 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
1579 |
}
|
1580 |
|
1581 |
LP.Hook.doAction('lp-question-compatible-builder');
|
1582 |
+
|
1583 |
+
if (typeof MathJax !== 'undefined') {
|
1584 |
+
MathJax.Hub.Queue(['Typeset', MathJax.Hub]);
|
1585 |
+
}
|
1586 |
+
|
1587 |
return a;
|
1588 |
}
|
1589 |
}, {
|
1732 |
|
1733 |
/***/ }),
|
1734 |
|
1735 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/result/index.js":
|
1736 |
+
/*!******************************************************************************************************************************************************!*\
|
1737 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/result/index.js ***!
|
1738 |
+
\******************************************************************************************************************************************************/
|
1739 |
/*! exports provided: default */
|
1740 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1741 |
|
1747 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
|
1748 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1749 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
|
1750 |
+
/* harmony import */ var _single_curriculum_components_items_progress__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../single-curriculum/components/items-progress */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/items-progress.js");
|
1751 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
1752 |
|
1753 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
2044 |
|
2045 |
/***/ }),
|
2046 |
|
2047 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/status/index.js":
|
2048 |
+
/*!******************************************************************************************************************************************************!*\
|
2049 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/status/index.js ***!
|
2050 |
+
\******************************************************************************************************************************************************/
|
2051 |
/*! exports provided: default */
|
2052 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2053 |
|
2057 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
2058 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
2059 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
|
2060 |
+
/* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../timer */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/timer/index.js");
|
2061 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
2062 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
2063 |
|
2194 |
|
2195 |
/***/ }),
|
2196 |
|
2197 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/timer/index.js":
|
2198 |
+
/*!*****************************************************************************************************************************************************!*\
|
2199 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/timer/index.js ***!
|
2200 |
+
\*****************************************************************************************************************************************************/
|
2201 |
/*! exports provided: default */
|
2202 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2203 |
|
2294 |
|
2295 |
/***/ }),
|
2296 |
|
2297 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/title/index.js":
|
2298 |
+
/*!*****************************************************************************************************************************************************!*\
|
2299 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/title/index.js ***!
|
2300 |
+
\*****************************************************************************************************************************************************/
|
2301 |
/*! exports provided: default */
|
2302 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2303 |
|
2311 |
|
2312 |
/***/ }),
|
2313 |
|
2314 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/index.js":
|
2315 |
+
/*!************************************************************************************************************************************!*\
|
2316 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/index.js ***!
|
2317 |
+
\************************************************************************************************************************************/
|
2318 |
/*! exports provided: default */
|
2319 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2320 |
|
2326 |
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);
|
2327 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
2328 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
|
2329 |
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/components/index.js");
|
2330 |
+
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./store */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/index.js");
|
2331 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
2332 |
|
2333 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2442 |
|
2443 |
/***/ }),
|
2444 |
|
2445 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/actions.js":
|
2446 |
+
/*!********************************************************************************************************************************************!*\
|
2447 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/actions.js ***!
|
2448 |
+
\********************************************************************************************************************************************/
|
2449 |
/*! exports provided: setQuizData, setCurrentQuestion, setCurrentPage, __requestBeforeStartQuiz, __requestStartQuizSuccess, startQuiz, __requestSubmitQuiz, __requestSubmitQuizSuccess, submitQuiz, updateUserQuestionAnswers, __requestShowHintSuccess, showHint, __requestCheckAnswerSuccess, checkAnswer, markQuestionRendered, setQuizMode, sendKey */
|
2450 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2451 |
|
2781 |
|
2782 |
/***/ }),
|
2783 |
|
2784 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/index.js":
|
2785 |
+
/*!******************************************************************************************************************************************!*\
|
2786 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/index.js ***!
|
2787 |
+
\******************************************************************************************************************************************/
|
2788 |
/*! exports provided: default */
|
2789 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2790 |
|
2792 |
__webpack_require__.r(__webpack_exports__);
|
2793 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
2794 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
|
2795 |
+
/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/reducer.js");
|
2796 |
+
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/actions.js");
|
2797 |
+
/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/selectors.js");
|
2798 |
+
/* harmony import */ var _middlewares__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/middlewares.js");
|
2799 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2800 |
|
2801 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
2819 |
|
2820 |
/***/ }),
|
2821 |
|
2822 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/middlewares.js":
|
2823 |
+
/*!************************************************************************************************************************************************!*\
|
2824 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/middlewares.js ***!
|
2825 |
+
\************************************************************************************************************************************************/
|
2826 |
/*! exports provided: default */
|
2827 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2828 |
|
2829 |
"use strict";
|
2830 |
__webpack_require__.r(__webpack_exports__);
|
2831 |
+
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! refx */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/refx/refx.js");
|
2832 |
/* harmony import */ var refx__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(refx__WEBPACK_IMPORTED_MODULE_0__);
|
2833 |
/**
|
2834 |
* External dependencies
|
2874 |
|
2875 |
/***/ }),
|
2876 |
|
2877 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/reducer.js":
|
2878 |
+
/*!********************************************************************************************************************************************!*\
|
2879 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/reducer.js ***!
|
2880 |
+
\********************************************************************************************************************************************/
|
2881 |
/*! exports provided: setItemStatus, userQuiz, blocks, default */
|
2882 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2883 |
|
3143 |
|
3144 |
/***/ }),
|
3145 |
|
3146 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/selectors.js":
|
3147 |
+
/*!**********************************************************************************************************************************************!*\
|
3148 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/quiz/store/selectors.js ***!
|
3149 |
+
\**********************************************************************************************************************************************/
|
3150 |
/*! exports provided: getQuestionOptions, getItemStatus, getProp, getQuizAttempts, getQuizAnswered, getQuestions, getData, getDefaultRestArgs, getQuestionAnswered, getQuestionMark, getCurrentQuestion, getQuestion, isCheckedAnswer, isCorrect, getQuestionsSelectedAnswers, getUserMark */
|
3151 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3152 |
|
3422 |
|
3423 |
/***/ }),
|
3424 |
|
3425 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js":
|
3426 |
+
/*!*******************************************************************************************************************************************************!*\
|
3427 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js ***!
|
3428 |
+
\*******************************************************************************************************************************************************/
|
3429 |
/*! exports provided: default */
|
3430 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3431 |
|
3432 |
"use strict";
|
3433 |
__webpack_require__.r(__webpack_exports__);
|
3434 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
3435 |
var $ = jQuery;
|
3436 |
|
3437 |
var lpModalOverlayCompleteItem = {
|
3484 |
|
3485 |
/***/ }),
|
3486 |
|
3487 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/compatible.js":
|
3488 |
+
/*!*****************************************************************************************************************************************************************!*\
|
3489 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/compatible.js ***!
|
3490 |
+
\*****************************************************************************************************************************************************************/
|
3491 |
/*! no static exports found */
|
3492 |
/***/ (function(module, exports) {
|
3493 |
|
3576 |
|
3577 |
/***/ }),
|
3578 |
|
3579 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/items-progress.js":
|
3580 |
+
/*!*********************************************************************************************************************************************************************!*\
|
3581 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/items-progress.js ***!
|
3582 |
+
\*********************************************************************************************************************************************************************/
|
3583 |
/*! exports provided: itemsProgress, getResponse */
|
3584 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3585 |
|
3589 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getResponse", function() { return getResponse; });
|
3590 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
3591 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
|
3592 |
+
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js");
|
3593 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
3594 |
|
3595 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
3677 |
|
3678 |
/***/ }),
|
3679 |
|
3680 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
|
3681 |
+
/*!***************************************************************************************************************************************!*\
|
3682 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
|
3683 |
+
\***************************************************************************************************************************************/
|
3684 |
/*! exports provided: default */
|
3685 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3686 |
|
3747 |
|
3748 |
/***/ }),
|
3749 |
|
3750 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/classnames/index.js":
|
3751 |
+
/*!***************************************************************************************************************************!*\
|
3752 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/classnames/index.js ***!
|
3753 |
+
\***************************************************************************************************************************/
|
3754 |
/*! no static exports found */
|
3755 |
/***/ (function(module, exports, __webpack_require__) {
|
3756 |
|
3815 |
|
3816 |
/***/ }),
|
3817 |
|
3818 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/refx/refx.js":
|
3819 |
+
/*!********************************************************************************************************************!*\
|
3820 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/node_modules/refx/refx.js ***!
|
3821 |
+
\********************************************************************************************************************/
|
3822 |
/*! no static exports found */
|
3823 |
/***/ (function(module, exports, __webpack_require__) {
|
3824 |
|
@@ -1,6 +1,6 @@
|
|
1 |
-
this.LP=this.LP||{},this.LP.quiz=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=
|
2 |
/*!
|
3 |
Copyright (c) 2018 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var a=o.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var u in r)n.call(r,u)&&r[u]&&e.push(u);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return Rn}));var r={};n.r(r),n.d(r,"setQuizData",(function(){return wt})),n.d(r,"setCurrentQuestion",(function(){return Ot})),n.d(r,"setCurrentPage",(function(){return _t})),n.d(r,"__requestBeforeStartQuiz",(function(){return St})),n.d(r,"__requestStartQuizSuccess",(function(){return qt})),n.d(r,"startQuiz",(function(){return jt})),n.d(r,"__requestSubmitQuiz",(function(){return Rt})),n.d(r,"__requestSubmitQuizSuccess",(function(){return Pt})),n.d(r,"submitQuiz",(function(){return Et})),n.d(r,"updateUserQuestionAnswers",(function(){return zt})),n.d(r,"__requestShowHintSuccess",(function(){return kt})),n.d(r,"showHint",(function(){return Qt})),n.d(r,"__requestCheckAnswerSuccess",(function(){return It})),n.d(r,"checkAnswer",(function(){return At})),n.d(r,"markQuestionRendered",(function(){return Ct})),n.d(r,"setQuizMode",(function(){return Nt})),n.d(r,"sendKey",(function(){return Tt}));var o={};n.r(o),n.d(o,"getQuestionOptions",(function(){return Lt})),n.d(o,"getItemStatus",(function(){return Ut})),n.d(o,"getProp",(function(){return Ft})),n.d(o,"getQuizAttempts",(function(){return Ht})),n.d(o,"getQuizAnswered",(function(){return Bt})),n.d(o,"getQuestions",(function(){return Gt})),n.d(o,"getData",(function(){return Jt})),n.d(o,"getDefaultRestArgs",(function(){return Kt})),n.d(o,"getQuestionAnswered",(function(){return Wt})),n.d(o,"getQuestionMark",(function(){return $t})),n.d(o,"getCurrentQuestion",(function(){return Zt})),n.d(o,"getQuestion",(function(){return Yt})),n.d(o,"isCheckedAnswer",(function(){return Vt})),n.d(o,"isCorrect",(function(){return Xt})),n.d(o,"getQuestionsSelectedAnswers",(function(){return en})),n.d(o,"getUserMark",(function(){return tn}));var i=n(3),a=n(4),u=n(1),s=function(){var e=Object(u.select)("learnpress/quiz").getData("content");return React.createElement("div",{className:"quiz-content",dangerouslySetInnerHTML:{__html:e}})},c=n(0),l=function(e){var t;if(e>86400)t=(e-e%86400)/86400,e%=86400;else if(86400==e)return"24:00";var n=new Date(1e3*e).toUTCString().match(/\d{2}:\d{2}:\d{2}/)[0].split(":");return t&&(n[0]=parseInt(n[0])+24*t),n.join(":")},f=LP.Hook,p=function(){var e=function(e){return Object(u.select)("learnpress/quiz").getData(e)},t=f.applyFilters("quiz-meta-fields",{duration:{title:Object(c.__)("Duration:","learnpress"),name:"duration",content:l(e("duration"))||"--"},passingGrade:{title:Object(c.__)("Passing grade:","learnpress"),name:"passing-grade",content:e("passingGrade")||"--"},questionsCount:{title:Object(c.__)("Questions:","learnpress"),name:"questions-count",content:e("questionIds")?e("questionIds").length:0}});return t&&React.createElement(React.Fragment,null,React.createElement("ul",{className:"quiz-intro"},Object.values(t).map((function(e,t){var n=e.name||t;return React.createElement("li",{key:"quiz-intro-field-".concat(t),className:"quiz-intro-item quiz-intro-item--".concat(n)},React.createElement("div",{className:"quiz-intro-item__title",dangerouslySetInnerHTML:{__html:e.title}}),React.createElement("span",{className:"quiz-intro-item__content",dangerouslySetInnerHTML:{__html:e.content}}))}))))};function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=S(e);if(t){var o=S(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}function O(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(i,e);var t,n,r,o=w(i);function i(){var e;h(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return q(_(e=o.call.apply(o,[this].concat(n))),"startQuiz",(function(t){t&&t.preventDefault();var n=document.querySelector(".lp-button.start");n&&n.setAttribute("disabled","disabled");var r=e.props,o=r.startQuiz;if("completed"===r.status){var i=Object(u.select)("learnpress/modal"),a=i.confirm,s=i.isOpen;if("no"===a(Object(c.__)("Are you sure you want to retake quiz?","learnpress"),e.startQuiz))return void(!s()&&n&&n.removeAttribute("disabled"))}if("1"==lpQuizSettings.checkNorequizenroll){window.localStorage.removeItem("quiz_start_"+lpQuizSettings.id),window.localStorage.setItem("quiz_start_"+lpQuizSettings.id,Date.now());var l=window.localStorage.getItem("quiz_retake_"+lpQuizSettings.id);l>=1?window.localStorage.setItem("quiz_retake_"+lpQuizSettings.id,parseInt(l)+1):window.localStorage.setItem("quiz_retake_"+lpQuizSettings.id,1),window.localStorage.removeItem("quiz_userdata_"+lpQuizSettings.id)}o()})),q(_(e),"nav",(function(t){return function(n){var r=e.props,o=r.questionNav,i=r.currentPage,a=r.numPages,u=r.setCurrentPage;switch(t){case"prev":i>1?i-=1:i="infinity"===o?a:1;break;default:i<a?i+=1:i="infinity"===o?1:a}u(i)}})),q(_(e),"moveTo",(function(t){return function(n){n.preventDefault();var r=e.props,o=r.numPages,i=r.setCurrentPage;t<1||t>o||i(t)}})),q(_(e),"isLast",(function(){var t=e.props;return t.currentPage===t.numPages})),q(_(e),"isFirst",(function(){return 1===e.props.currentPage})),q(_(e),"submit",(function(){var t=e.props.submitQuiz;"no"!==(0,Object(u.select)("learnpress/modal").confirm)(Object(c.__)("Are you sure to submit quiz?","learnpress"),e.submit)&&t()})),q(_(e),"setQuizMode",(function(t){return function(){(0,e.props.setQuizMode)(t)}})),q(_(e),"isReviewing",(function(){return e.props.isReviewing})),e}return t=i,(n=[{key:"pageNumbers",value:function(e){var t=this,n=this.props,r=n.numPages,o=n.currentPage;if(r<2)return"";(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){q(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({numPages:r,currentPage:o,midSize:1,endSize:1,prevNext:!0},e||{})).endSize<1&&(e.endSize=1),e.midSize<0&&(e.midSize=1);var i=m(Array(r).keys()),a=!1;return React.createElement("div",{className:"nav-links"},e.prevNext&&!this.isFirst()&&React.createElement("button",{className:"page-numbers prev","data-type":"question-navx",onClick:this.nav("prev")},Object(c.__)("Prev","learnpress")),i.map((function(n){return(n+=1)===e.currentPage?(a=!0,React.createElement("span",{key:"page-number-".concat(n),className:"page-numbers current"},n)):n<=e.endSize||e.currentPage&&n>=e.currentPage-e.midSize&&n<=e.currentPage+e.midSize||n>e.numPages-e.endSize?(a=!0,React.createElement("button",{key:"page-number-".concat(n),className:"page-numbers",onClick:t.moveTo(n)},n)):a?(a=!1,React.createElement("span",{key:"page-number-".concat(n),className:"page-numbers dots"},"…")):""})),e.prevNext&&!this.isLast()&&React.createElement("button",{className:"page-numbers next","data-type":"question-navx",onClick:this.nav("next")},Object(c.__)("Next","learnpress")))}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.questionNav,r=e.isReviewing,o=e.showReview,i=e.numPages,a=(e.question,e.questionsPerPage,e.canRetry),u=e.retakeNumber,s=["quiz-buttons"];("started"===t||r)&&s.push("align-center"),"questionNav"===n&&s.push("infinity"),this.isFirst()&&s.push("is-first"),this.isLast()&&s.push("is-last");var l=document.querySelector("#popup-sidebar"),f=document.querySelector("#learn-press-quiz-app"),p="";p="started"===t||r?{marginLeft:l&&l.offsetWidth/2,width:f&&f.offsetWidth}:null;var d=" fixed";return"no"==lpQuizSettings.navigationPosition&&(d=" nav-center"),React.createElement(React.Fragment,null,React.createElement("div",{className:s.join(" ")},React.createElement("div",{className:"button-left"+("started"===t||r?d:""),style:p},("completed"===t&&a||-1!==["","viewed"].indexOf(t))&&!r&&React.createElement("button",{className:"lp-button start",onClick:this.startQuiz},"completed"===t?"".concat(Object(c.__)("Retake","learnpress")).concat(u?" (".concat(u,")"):""):Object(c.__)("Start","learnpress")),("started"===t||r)&&i>1&&React.createElement(React.Fragment,null,React.createElement("div",{className:"questions-pagination"},this.pageNumbers()))),React.createElement("div",{className:"button-right"},"started"===t&&React.createElement(React.Fragment,null,("infinity"===n||this.isLast())&&!r&&React.createElement("button",{className:"lp-button submit-quiz",onClick:this.submit},Object(c.__)("Finish Quiz","learnpress"))),r&&o&&React.createElement("button",{className:"lp-button back-quiz",onClick:this.setQuizMode("")},Object(c.__)("Result","learnpress")),"completed"===t&&o&&!r&&React.createElement("button",{className:"lp-button review-quiz",onClick:this.setQuizMode("reviewing")},Object(c.__)("Review","learnpress")))),this.props.message&&!0!==this.props.success&&React.createElement("div",{className:"learn-press-message error"},this.props.message))}}])&&g(t.prototype,n),r&&g(t,r),i}(i.Component),R=Object(a.compose)(Object(u.withSelect)((function(e){var t=e("learnpress/quiz").getData;return{status:t("status"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),questionsPerPage:t("questionsPerPage")}})))((function(e){var t=e.showCheck,n=e.checkedQuestions,r=e.hintedQuestions,o=e.question,i=e.status,a=e.type,u=e.Button;if("started"!==i)return!1;var s=React.createElement(u,{question:o});switch(a){case"hint":return r?!!o.hasHint&&(-1===r.indexOf(o.id)&&s):s;case"check":return!!t&&(n?-1===n.indexOf(o.id)&&s:s)}})),P=Object(a.compose)([Object(u.withSelect)((function(e){var t=e("learnpress/quiz"),n=t.getData,r=t.getCurrentQuestion,o={id:n("id"),status:n("status"),questionIds:n("questionIds"),questionNav:n("questionNav"),isReviewing:n("reviewQuestions")&&"reviewing"===n("mode"),showReview:n("reviewQuestions"),showCheck:n("instantCheck"),checkedQuestions:n("checkedQuestions"),hintedQuestions:n("hintedQuestions"),numPages:n("numPages"),pages:n("pages"),currentPage:n("currentPage"),questionsPerPage:n("questionsPerPage"),pageNumbers:n("pageNumbers"),keyPressed:n("keyPressed"),canRetry:n("retakeCount")>0&&n("retaken")<n("retakeCount"),retakeNumber:n("retakeCount")>0&&n("retaken")<n("retakeCount")?n("retakeCount")-n("retaken"):null,message:n("messageResponse")||!1,success:void 0===n("successResponse")||n("successResponse")};if(1===o.questionsPerPage&&(o.question=r("object")),"1"==lpQuizSettings.checkNorequizenroll){var i=window.localStorage.getItem("quiz_retake_"+lpQuizSettings.id);n("retakeCount")>i?(o.retakeNumber=n("retakeCount")-i,o.canRetry=!0):o.canRetry=!1}return o})),Object(u.withDispatch)((function(e,t){t.id;var n=e("learnpress/quiz"),r=n.startQuiz,o=n.setCurrentQuestion,i=n.submitQuiz,a=n.setQuizMode,u=n.showHint,s=n.checkAnswer;return{startQuiz:r,setCurrentQuestion:o,setQuizMode:a,setCurrentPage:n.setCurrentPage,submitQuiz:function(e){i(e)},showHint:function(e){u(e)},checkAnswer:function(e){s(e)}}}))])(j);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=N(e);if(t){var o=N(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return A(this,n)}}function A(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?C(e):t}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(i,e);var t,n,r,o=I(i);function i(){var e;z(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return T(C(e=o.call.apply(o,[this].concat(n))),"showHint",(function(){var t=e.props,n=t.showHint,r=t.question;n(r.id,!r.showHint)})),e}return t=i,(n=[{key:"render",value:function(){return this.props.question.hint?React.createElement("button",{className:"btn-show-hint",onClick:this.showHint},React.createElement("span",null,Object(c.__)("Hint","learnpress"))):""}}])&&k(t.prototype,n),r&&k(t,r),i}(i.Component),D=Object(a.compose)(Object(u.withDispatch)((function(e,t){t.id;var n=e("learnpress/quiz").showHint;return{showHint:function(e,t){n(e,t)}}})))(x),M=n(13),L=n.n(M);function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=W(e);if(t){var o=W(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return J(this,n)}}function J(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?K(e):t}function K(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(i,e);var t,n,r,o=G(i);function i(){var e;return F(this,i),$(K(e=o.apply(this,arguments)),"checkAnswer",(function(){var t=e.props,n=t.checkAnswer,r=t.question;t.answered&&(n(r.id),e.setState({loading:!0}))})),e.state={loading:!1},e}return t=i,(n=[{key:"render",value:function(){var e=this.props.answered;return React.createElement(React.Fragment,null,React.createElement("button",{className:L()("lp-button","instant-check",{loading:this.state.loading,disable:!e}),onClick:this.checkAnswer},React.createElement("span",{className:"instant-check__icon"}),Object(c.__)("Check answer","learnpress"),!e&&React.createElement("div",{className:"instant-check__info",dangerouslySetInnerHTML:{__html:Object(c.__)("You need to answer the question before check answer.","learnpress")}})))}}])&&H(t.prototype,n),r&&H(t,r),i}(i.Component),Y=Object(a.compose)(Object(u.withSelect)((function(e,t){var n=t.question.id;return{answered:(0,e("learnpress/quiz").getQuestionAnswered)(n)}})),Object(u.withDispatch)((function(e,t){t.id;var n=e("learnpress/quiz").checkAnswer;return{checkAnswer:function(e){n(e)}}})))(Z),V=function(e){var t=e.question,n={"instant-check":function(){return React.createElement(R,{type:"check",Button:Y,question:t})},hint:function(){return React.createElement(R,{type:"hint",Button:D,question:t})}};return React.createElement(React.Fragment,null,LP.config.questionFooterButtons().map((function(e){return React.createElement(i.Fragment,{key:"button-".concat(e)},n[e]&&n[e]())})))};function X(e){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=se(e);if(t){var o=se(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ae(this,n)}}function ae(e,t){return!t||"object"!==X(t)&&"function"!=typeof t?ue(e):t}function ue(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var le=window.jQuery,fe=lodash,pe=(fe.uniqueId,fe.isArray),de=(fe.isNumber,fe.bind,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(a,e);var t,n,r,o=ie(a);function a(){var e;return ne(this,a),ce(ue(e=o.apply(this,arguments)),"setRef",(function(t){e.$wrap=le(t)})),ce(ue(e),"parseOptions",(function(e){return e&&(e=pe(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=pe(e)?e:JSON.parse(e)),e||[]})),ce(ue(e),"getWrapperClass",(function(){var t=e.props,n=t.question,r=(t.answered,["question","question-"+n.type]),o=e.parseOptions(n.options);return o.length&&void 0!==o[0].isTrue&&r.push("question-answered"),r})),ce(ue(e),"getEditLink",(function(){var t=e.props,n=t.question,r=t.editPermalink;return r?r.replace(/post=(.*[0-9])/,"post=".concat(n.id)):""})),ce(ue(e),"editPermalink",(function(e){return Object(c.sprintf)('<a href="%s">%s</a>',e,Object(c.__)("Edit","learnpress"))})),e.state={time:null,showHint:!1},e.$wrap=null,e}return t=a,(n=[{key:"componentDidMount",value:function(e){var t=this.props,n=t.question,r=t.isCurrent,o=t.markQuestionRendered;return r&&o(n.id),this.state.time||this.setState({time:new Date}),LP.Hook.doAction("lp-question-compatible-builder"),e}},{key:"render",value:function(){var e=this,t=this.props,n=t.question,r=t.isShow,o=t.isShowIndex,a=(t.isShowHint,t.status),u=LP.questionTypes.default,s=this.getEditLink();s&&jQuery("#wp-admin-bar-edit-lp_question").find(".ab-item").attr("href",s);var l={index:function(){return o?React.createElement("span",{className:"question-index"},o,"."):""},title:function(){return React.createElement("span",{dangerouslySetInnerHTML:{__html:n.title}})},hint:function(){return React.createElement(D,{question:n})},"edit-permalink":function(){return s&&React.createElement("span",{dangerouslySetInnerHTML:{__html:e.editPermalink(s)},className:"edit-link"})}},f={title:function(){return React.createElement("h4",{className:"question-title"},LP.config.questionTitleParts().map((function(e){return React.createElement(i.Fragment,{key:"title-part-".concat(e)},l[e]&&l[e]())})))},content:function(){return React.createElement("div",{className:"question-content",dangerouslySetInnerHTML:{__html:n.content}})},"answer-options":function(){return e.$wrap&&React.createElement(u,te(te({},e.props),{},{$wrap:e.$wrap}))},explanation:function(){return n.explanation&&React.createElement(React.Fragment,null,React.createElement("div",{className:"question-explanation-content"},React.createElement("strong",{className:"explanation-title"},Object(c.__)("Explanation","learnpress"),":"),React.createElement("div",{dangerouslySetInnerHTML:{__html:n.explanation}})))},hint:function(){return n.hint&&!n.explanation&&n.showHint&&React.createElement(React.Fragment,null,React.createElement("div",{className:"question-hint-content"},React.createElement("strong",{className:"hint-title"},Object(c.__)("Hint","learnpress"),":"),React.createElement("div",{dangerouslySetInnerHTML:{__html:n.hint}})))},buttons:function(){return"started"===a&&React.createElement(V,{question:n})}},p=LP.config.questionBlocks();return React.createElement(React.Fragment,null,React.createElement("div",{className:this.getWrapperClass().join(" "),style:{display:r?"":"none"},"data-id":n.id,ref:this.setRef},p.map((function(e){return React.createElement(i.Fragment,{key:"block-".concat(e)},f[e]?f[e]():"")}))))}}])&&re(t.prototype,n),r&&re(t,r),a}(i.Component)),me=Object(a.compose)([Object(u.withSelect)((function(e,t){var n=t.question.id,r=e("learnpress/quiz"),o=r.getData,i=r.getQuestionAnswered,a=r.getQuestionMark;return{status:o("status"),questions:o("question"),answered:i(n),questionsRendered:o("questionsRendered"),editPermalink:o("editPermalink"),numPages:o("numPages"),mark:a(n)||""}})),Object(u.withDispatch)((function(e){var t=e("learnpress/quiz"),n=t.updateUserQuestionAnswers;return{markQuestionRendered:t.markQuestionRendered,updateUserQuestionAnswers:n}}))])(de);function be(e){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ge(e,t){return(ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_e(e);if(t){var o=_e(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){return!t||"object"!==be(t)&&"function"!=typeof t?Oe(e):t}function Oe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _e(e){return(_e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ge(e,t)}(i,e);var t,n,r,o=ve(i);function i(e){var t;return ye(this,i),Se(Oe(t=o.apply(this,arguments)),"startQuiz",(function(e){e.preventDefault(),(0,t.props.startQuiz)()})),Se(Oe(t),"isInVisibleRange",(function(e,n){var r=t.props,o=r.currentPage,i=r.questionsPerPage;return o===Math.ceil(n/i)})),Se(Oe(t),"nav",(function(e){var n=t.props.sendKey;switch(e.keyCode){case 37:return n("left");case 38:return;case 39:return n("right");case 40:return;default:e.keyCode>=49&&e.keyCode<=57&&n(e.keyCode-48)}})),t.needToTop=!1,t.state={isReviewing:null,currentPage:0,self:Oe(t)},t}return t=i,r=[{key:"getDerivedStateFromProps",value:function(e,t){for(var n=["isReviewing","currentPage"],r={},o=0;o<n.length;o++)e[n[o]]!==t[n[o]]&&(r[n[o]]=e[n[o]]);return Object.values(r).length?(t.self.needToTop=!0,r):null}}],(n=[{key:"componentDidUpdate",value:function(){this.needToTop&&(jQuery("#popup-content").animate({scrollTop:0}).find(".content-item-scrollable:last").animate({scrollTop:0}),this.needToTop=!1)}},{key:"render",value:function(){var e=this,t=this.props,n=t.status,r=t.currentQuestion,o=t.questions,i=t.questionsRendered,a=t.isReviewing,u=t.questionsPerPage,s=!0;return"completed"!==n||a||(s=!1),React.createElement(React.Fragment,null,React.createElement("div",{tabIndex:100,onKeyUp:this.nav},React.createElement("div",{className:"quiz-questions",style:{display:s?"":"none"}},o.map((function(t,n){var o=!u&&r===t.id,a=i&&-1!==i.indexOf(t.id),s=e.isInVisibleRange(t.id,n+1);return a||!a||s?React.createElement(me,{key:"loop-question-".concat(t.id),isCurrent:o,isShow:s,isShowIndex:!!u&&n+1,questionsPerPage:u,question:t}):""})))))}}])&&he(t.prototype,n),r&&he(t,r),i}(i.Component),je=Object(a.compose)(Object(u.withSelect)((function(e,t,n){var r=e("learnpress/quiz"),o=r.getData,i=r.getQuestions;return{status:o("status"),currentQuestion:o("currentQuestion"),questions:i(),questionsRendered:o("questionsRendered"),isReviewing:"reviewing"===o("mode"),numPages:o("numPages"),currentPage:o("currentPage"),questionsPerPage:o("questionsPerPage")||1}})),Object(u.withDispatch)((function(e){var t=e("learnpress/quiz");return{startQuiz:t.startQuiz,sendKey:t.sendKey}})))(qe);var Re=function(){var e=Object(u.select)("learnpress/quiz").getData("attempts")||[],t=e&&!!e.length;return!!t&&React.createElement(React.Fragment,null,React.createElement("div",{className:"quiz-attempts"},React.createElement("h4",{className:"attempts-heading"},Object(c.__)("Last Attempted","learnpress")),t&&React.createElement("table",null,React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{className:"quiz-attempts__questions"},Object(c.__)("Questions","learnpress")),React.createElement("th",{className:"quiz-attempts__spend"},Object(c.__)("Time spend","learnpress")),React.createElement("th",{className:"quiz-attempts__marks"},Object(c.__)("Marks","learnpress")),React.createElement("th",{className:"quiz-attempts__grade"},Object(c.__)("Passing grade","learnpress")),React.createElement("th",{className:"quiz-attempts__result"},Object(c.__)("Result","learnpress")))),React.createElement("tbody",null,e.map((function(e,t){if("1"==lpQuizSettings.checkNorequizenroll){var n=window.localStorage.getItem("quiz_start_"+lpQuizSettings.id),r=window.localStorage.getItem("quiz_end_"+lpQuizSettings.id);n&&r&&(e.timeSpend=function(e,t){var n=new Object,r=t-e;n.days=Math.floor(r/1e3/60/60/24),r-=1e3*n.days*60*60*24,n.hours=Math.floor(r/1e3/60/60),r-=1e3*n.hours*60*60,n.minutes=Math.floor(r/1e3/60),r-=1e3*n.minutes*60,n.seconds=Math.floor(r/1e3);var o="00";n.days>0&&(o=String(n.days));1==o.length&&(o="0"+o);var i="00";n.minutes>0&&(i=String(n.minutes));1==i.length&&(i="0"+i);var a="00";n.seconds>0&&(a=String(n.seconds));1==a.length&&(a="0"+a);var u=o+":"+i+":"+a;return n.duration=u,n}(n,r).duration)}return React.createElement("tr",{key:"attempt-".concat(t)},React.createElement("td",{className:"quiz-attempts__questions"},"".concat(e.questionCorrect," / ").concat(e.questionCount)),React.createElement("td",{className:"quiz-attempts__spend"},e.timeSpend||"--"),React.createElement("td",{className:"quiz-attempts__marks"},"".concat(e.userMark," / ").concat(e.mark)),React.createElement("td",{className:"quiz-attempts__grade"},e.passingGrade||"-"),React.createElement("td",{className:"quiz-attempts__result"},"".concat(parseFloat(e.result).toFixed(2),"%")," ",React.createElement("span",null,e.graduationText)))}))))))};function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ze=function(){var e=Object(u.select)("learnpress/quiz").getData,t=Object(u.dispatch)("learnpress/quiz").submitQuiz,n=e("totalTime")?e("totalTime"):e("duration"),r=e("endTime"),o=new Date(r.replace(/-/g,"/")),a=new Date,s=(new Date).getTimezoneOffset(),c=parseInt(o.getTime()/1e3-(a.getTime()/1e3+60*s)),l=Pe(Object(i.useState)(c>0?c:0),2),f=l[0],p=l[1];Object(i.useEffect)((function(){var e=setInterval((function(){var n=f;(n-=1)>0?p(n):(clearInterval(e),t())}),1e3);return function(){return clearInterval(e)}}),[f]);return React.createElement("div",{className:"countdown"},React.createElement("i",{className:"fas fa-stopwatch"}),React.createElement("span",null,function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":",r=[];return n<3600?(r.push((f-f%60)/60),r.push(f%60)):n&&(r.push((f-f%3600)/3600),e=f%3600,r.push((e-e%60)/60),r.push(e%60)),r.map((function(e){return e<10?"0".concat(e):e})).join(t)}()))},ke=n(9);function Qe(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ae(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||Ae(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){if(e){if("string"==typeof e)return Ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=lodash.debounce,Te=function(){var e=Ie(Object(i.useState)(0),2),t=e[0],n=e[1],r=Ie(Object(i.useState)(!1),2),o=r[0],a=r[1],s=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("id")}),[]),l=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("results")}),[]),f=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("passingGrade")}),[]),p=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("submitting")}),[]);Object(i.useEffect)((function(){m();var e="";if(e=l.graduation?l.graduation:l.result>=v.replace(/[^0-9\.]+/g,"")?"passed":"failed"){var t=document.querySelector(".course-curriculum .course-item.course-item-".concat(s));t&&(t.classList.remove("failed","passed"),t.classList.add("has-status","status-completed",e))}var n=Qe(document.querySelectorAll("#popup-header .items-progress"))[0];if(n){var r=n.querySelector(".items-completed");if(r){parseInt(r.textContent);var o=document.querySelectorAll("#popup-sidebar .course-curriculum .course-item.status-completed");r.textContent=parseInt(o.length)}}}),[l]),Object(i.useEffect)((function(){void 0!==p&&d()}),[p]);var d=function(){var e=document.querySelectorAll(".popup-header__inner");e.length>0&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&Object(ke.a)(e[0])},m=function(){n(0),a(!1),jQuery.easing._customEasing=function(e,t,n,r,o){return r*Math.sqrt(1-(t=t/o-1)*t)+n},Ne((function(){var e=jQuery("<span />").css({width:1,height:1}).appendTo(document.body);e.css("left",0).animate({left:l.result},{duration:1500,step:function(e,t){n(e)},done:function(){a(!0),e.remove(),jQuery("#quizResultGrade").css({transform:"scale(1.3)",transition:"all 0.25s"}),Ne((function(){jQuery("#quizResultGrade").css({transform:"scale(1)"})}),500)()},easing:"_customEasing"})}),l.result>0?1e3:10)()},b=t;Number.isInteger(t)||(b=parseFloat(t).toFixed(2));var y=190*Math.PI,h=y-b/100*y,g={strokeDasharray:"".concat(y," ").concat(y),strokeDashoffset:h},v=l.passingGrade||f,w="";w=l.graduation?l.graduation:b>=v.replace(/[^0-9\.]+/g,"")?"passed":"failed";var O="";O=l.graduationText?l.graduationText:"passed"===w?Object(c.__)("Passed","learnpress"):Object(c.__)("Failed","learnpress");var _=["quiz-result",w];if("1"==lpQuizSettings.checkNorequizenroll){var S=window.localStorage.getItem("quiz_start_"+s),q=window.localStorage.getItem("quiz_end_"+s);S&&q&&(l.timeSpend=function(e,t){var n=new Object,r=t-e;n.days=Math.floor(r/1e3/60/60/24),r-=1e3*n.days*60*60*24,n.hours=Math.floor(r/1e3/60/60),r-=1e3*n.hours*60*60,n.minutes=Math.floor(r/1e3/60),r-=1e3*n.minutes*60,n.seconds=Math.floor(r/1e3);var o="00";n.days>0&&(o=String(n.days));1==o.length&&(o="0"+o);var i="00";n.minutes>0&&(i=String(n.minutes));1==i.length&&(i="0"+i);var a="00";n.seconds>0&&(a=String(n.seconds));1==a.length&&(a="0"+a);var u=o+":"+i+":"+a;return n.duration=u,n}(S,q).duration)}return React.createElement("div",{className:_.join(" ")},React.createElement("h3",{className:"result-heading"},Object(c.__)("Your Result","learnpress")),React.createElement("div",{id:"quizResultGrade",className:"result-grade"},React.createElement("svg",{className:"circle-progress-bar",width:200,height:200},React.createElement("circle",{className:"circle-progress-bar__circle",stroke:"",strokeWidth:10,style:g,fill:"transparent",r:95,cx:100,cy:100})),React.createElement("span",{className:"result-achieved"},"".concat(b,"%")),React.createElement("span",{className:"result-require"},v||"-")),o&&React.createElement("p",{className:"result-message"},O),React.createElement("ul",{className:"result-statistic"},React.createElement("li",{className:"result-statistic-field result-time-spend"},React.createElement("span",null,Object(c.__)("Time spend","learnpress")),React.createElement("p",null,l.timeSpend)),React.createElement("li",{className:"result-statistic-field result-point"},React.createElement("span",null,Object(c.__)("Point","learnpress")),React.createElement("p",null,l.userMark," / ",l.mark)),React.createElement("li",{className:"result-statistic-field result-questions"},React.createElement("span",null,Object(c.__)("Questions","learnpress")),React.createElement("p",null,l.questionCount)),React.createElement("li",{className:"result-statistic-field result-questions-correct"},React.createElement("span",null,Object(c.__)("Correct","learnpress")),React.createElement("p",null,l.questionCorrect)),React.createElement("li",{className:"result-statistic-field result-questions-wrong"},React.createElement("span",null,Object(c.__)("Wrong","learnpress")),React.createElement("p",null,l.questionWrong)),React.createElement("li",{className:"result-statistic-field result-questions-skipped"},React.createElement("span",null,Object(c.__)("Skipped","learnpress")),React.createElement("p",null,l.questionEmpty))))},xe=jQuery,De=lodash.debounce,Me=function(){var e=Object(u.dispatch)("learnpress/quiz").submitQuiz;Object(i.useEffect)((function(){var e=xe("#popup-content");if(e.length){var t=e.find(".content-item-scrollable:eq(1)"),n=e.find(".content-item-wrap"),r=e.find(".quiz-status"),o=r.offset().top-92,i=!1,a="-"+n.css("margin-left");xe(window).on("resize.refresh-quiz-stauts-bar",De((function(){a="-"+n.css("margin-left"),r.css({"margin-left":a,"margin-right":a})}),100)).trigger("resize.refresh-quiz-stauts-bar"),t.on("scroll",(function(){if(t.scrollTop()>=o){if(i)return;i=!0}else{if(!i)return;i=!1}i?e.addClass("fixed-quiz-status"):e.removeClass("fixed-quiz-status")}))}}),[]);var t=Object(u.select)("learnpress/quiz"),n=t.getData,r=t.getUserMark,o=n("currentPage"),a=n("questionsPerPage"),s=n("questionIds").length,l=n("submitting"),f=n("totalTime"),p=n("duration"),d=r(),m=["quiz-status"],b=(o-1)*a+1,y=b+a-1,h="";return y=Math.min(y,s),l&&m.push("submitting"),h=y<s?a>1?Object(c.sprintf)(Object(c.__)("Question <span>%d to %d of %d</span>","learnpress"),b,y,s):Object(c.sprintf)(Object(c.__)("Question <span>%d of %d</span>","learnpress"),b,s):Object(c.sprintf)(Object(c.__)("Question <span>%d to %d</span>","learnpress"),b,y),React.createElement("div",{className:m.join(" ")},React.createElement("div",null,React.createElement("div",{className:"questions-index",dangerouslySetInnerHTML:{__html:h}}),React.createElement("div",{className:"current-point"},Object(c.sprintf)(Object(c.__)("Earned Point: %s","learnpress"),d)),React.createElement("div",null,React.createElement("div",{className:"submit-quiz"},React.createElement("button",{className:"lp-button",id:"button-submit-quiz",onClick:function t(){"no"!==(0,Object(u.select)("learnpress/modal").confirm)(Object(c.__)("Are you sure to submit quiz?","learnpress"),t)&&e()}},l?Object(c.__)("Submitting...","learnpress"):Object(c.__)("Finish Quiz","learnpress"))),f&&p&&React.createElement(ze,null))))};function Le(e){return function(e){if(Array.isArray(e))return Ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(n),!0).forEach((function(t){Be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ge=lodash,Je=(Ge.omit,Ge.flow),Ke=Ge.isArray,We=Ge.chunk,$e=(LP.camelCaseDashObjectKeys,LP.localStorage),Ze=$e.get,Ye=$e.set,Ve={},Xe=function(e,t){var n=He(He({},e.answered[t.questionId]||{}),{},{answered:t.answers,temp:!0});return He(He({},e),{},{answered:He(He({},e.answered),{},Be({},t.questionId,n))})},et=function(e,t){var n=e.questionsRendered;return Ke(n)?(n.push(t.questionId),He(He({},e),{},{questionsRendered:Le(n)})):He(He({},e),{},{questionsRendered:[t.questionId]})},tt=function(e,t){return t.currentPage&&Ye("Q".concat(e.id,".currentPage"),t.currentPage),He(He({},e),t)},nt=function(e,t){var n=e.questions.map((function(e){return e.id==t.questionId?He(He({},e),{},{showHint:t.showHint}):e}));return He(He({},e),{},{questions:Le(n)})},rt=function(e,t){var n=e.questions.map((function(e){if(e.id!==t.questionId)return e;var n={explanation:t.explanation};return t.options&&(n.options=t.options),He(He({},e),n)}));return He(He({},e),{},{questions:Le(n),answered:He(He({},e.answered),{},Be({},t.questionId,t.result)),checkedQuestions:[].concat(Le(e.checkedQuestions),[t.questionId])})},ot=function(e,t){var n=e.questions.map((function(n){var r={};return e.reviewQuestions&&(t.results.questions[n.id].explanation&&(r.explanation=t.results.questions[n.id].explanation),t.results.questions[n.id].options&&(r.options=t.results.questions[n.id].options)),He(He({},n),r)}));return tt(e,He(He({submitting:!1,currentPage:1},t.results),{},{questions:Le(n)}))},it=function(e,t){var n=void 0!==t.results.success&&t.results.success,r=t.results.message||!1;return tt(e,He(He({checkedQuestions:[],hintedQuestions:[],mode:"",currentPage:1},t.results.results),{},{successResponse:n,messageResponse:r}))},at=Je(u.combineReducers,(function(e){return function(t,n){return e(t,n)}}),(function(e){return function(t,n){return e(t,n)}}),(function(e){return function(t,n){return e(t,n)}}))({a:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{a:1};return e},b:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{b:2};return e}}),ut=Object(u.combineReducers)({blocks:at,userQuiz:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ve,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_QUIZ_DATA":1>t.data.questionsPerPage&&(t.data.questionsPerPage=1);var n=We(e.questionIds||t.data.questionIds,t.data.questionsPerPage);return t.data.numPages=n.length,t.data.pages=n,He(He(He({},e),t.data),{},{currentPage:Ze("Q".concat(t.data.id,".currentPage"))||t.data.currentPage});case"SUBMIT_QUIZ":return He(He({},e),{},{submitting:!0});case"START_QUIZ":case"START_QUIZ_SUCCESS":return it(e,t);case"SET_CURRENT_QUESTION":return Ye("Q".concat(e.id,".currentQuestion"),t.questionId),He(He({},e),{},{currentQuestion:t.questionId});case"SET_CURRENT_PAGE":return Ye("Q".concat(e.id,".currentPage"),t.currentPage),He(He({},e),{},{currentPage:t.currentPage});case"SUBMIT_QUIZ_SUCCESS":return ot(e,t);case"UPDATE_USER_QUESTION_ANSWERS":return"started"===e.status?Xe(e,t):e;case"MARK_QUESTION_RENDERED":return et(e,t);case"SET_QUIZ_MODE":return"reviewing"==t.mode?tt(e,{mode:t.mode}):He(He({},e),{},{mode:t.mode});case"SET_QUESTION_HINT":return nt(e,t);case"CHECK_ANSWER":return rt(e,t);case"SEND_KEY":return He(He({},e),{},{keyPressed:t.keyPressed})}return e}}),st=n(10);function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var lt=regeneratorRuntime.mark(Et),ft=regeneratorRuntime.mark(Qt),pt=regeneratorRuntime.mark(At);function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e){return function(e){if(Array.isArray(e))return bt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yt(){var e=[].slice.call(arguments,2),t=Object(u.dispatch)(arguments[0]),n=arguments[1];t[n].apply(t,mt(e))}var ht=LP,gt=ht.camelCaseDashObjectKeys,vt=ht.Hook;function wt(e,t){return t="string"==typeof e?dt({},e,t):e,"1"==lpQuizSettings.checkNorequizenroll&&null!==window.localStorage.getItem("quiz_userdata_"+lpQuizSettings.id)&&(t=JSON.parse(window.localStorage.getItem("quiz_userdata_"+lpQuizSettings.id))),{type:"SET_QUIZ_DATA",data:gt(t)}}function Ot(e){return{type:"SET_CURRENT_QUESTION",questionId:e}}function _t(e){return{type:"SET_CURRENT_PAGE",currentPage:e}}function St(e,t,n){return{type:"BEFORE_START_QUIZ"}}function qt(e,t,n,r){return vt.doAction("quiz-started",e,t,n,r),{type:"START_QUIZ_SUCCESS",quizId:t,courseId:n,userId:r,results:e}}var jt=regeneratorRuntime.mark((function e(){var t,n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Object(u.select)("learnpress/quiz").getDefaultRestArgs(),n=t.itemId,r=t.courseId,!0===vt.applyFilters("before-start-quiz",!0,n,r)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,Object(st.apiFetch)({path:"lp/v1/users/start-quiz",method:"POST",data:{item_id:n,course_id:r}});case 6:return o=e.sent,o=vt.applyFilters("request-start-quiz-response",o,n,r),e.next=10,yt("learnpress/quiz","__requestStartQuizSuccess",gt(o),n,r);case 10:case"end":return e.stop()}}),e)}));function Rt(){return{type:"SUBMIT_QUIZ"}}function Pt(e,t,n){return vt.doAction("quiz-submitted",e,t,n),{type:"SUBMIT_QUIZ_SUCCESS",results:e}}function Et(){var e,t,n,r,o,i,a,s;return regeneratorRuntime.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(e=Object(u.select)("learnpress/quiz"),t=e.getDefaultRestArgs,n=e.getQuestionsSelectedAnswers,r=t(),o=r.itemId,i=r.courseId,!0===vt.applyFilters("before-submit-quiz",!0)){c.next=5;break}return c.abrupt("return");case 5:return a=n(),c.next=8,Object(st.apiFetch)({path:"lp/v1/users/submit-quiz",method:"POST",data:{item_id:o,course_id:i,answered:a}});case 8:if(s=c.sent,"1"==lpQuizSettings.checkNorequizenroll&&(window.localStorage.removeItem("quiz_end_"+lpQuizSettings.id),window.localStorage.setItem("quiz_end_"+lpQuizSettings.id,Date.now())),!(s=vt.applyFilters("request-submit-quiz-response",s,o,i)).success){c.next=14;break}return c.next=14,yt("learnpress/quiz","__requestSubmitQuizSuccess",gt(s.results),o,i);case 14:"1"==lpQuizSettings.checkNorequizenroll&&localStorage.setItem("quiz_userdata_"+lpQuizSettings.id,JSON.stringify(Object(u.select)("learnpress/quiz").getData()));case 15:case"end":return c.stop()}}),lt)}function zt(e,t,n){return{type:"UPDATE_USER_QUESTION_ANSWERS",questionId:e,answers:t}}function kt(e,t){return{type:"SET_QUESTION_HINT",questionId:e,showHint:t}}function Qt(e,t){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,yt("learnpress/quiz","__requestShowHintSuccess",e,t);case 2:case"end":return n.stop()}}),ft)}function It(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:"CHECK_ANSWER",questionId:e},t)}function At(e){var t,n,r,o,i,a,s;return regeneratorRuntime.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=Object(u.select)("learnpress/quiz"),n=t.getDefaultRestArgs,r=t.getQuestionAnswered,o=n(),i=o.itemId,a=o.courseId,c.next=4,Object(st.apiFetch)({path:"lp/v1/users/check-answer",method:"POST",data:{item_id:i,course_id:a,question_id:e,answered:r(e)||""}});case 4:return s=c.sent,c.next=7,yt("learnpress/quiz","__requestCheckAnswerSuccess",e,gt(s));case 7:case"end":return c.stop()}}),pt)}function Ct(e){return{type:"MARK_QUESTION_RENDERED",questionId:e}}function Nt(e){return{type:"SET_QUIZ_MODE",mode:e}}function Tt(e){return setTimeout((function(){yt("learnpress/quiz","sendKey","")}),300),{type:"SEND_KEY",keyPressed:e}}var xt=lodash,Dt=xt.get,Mt=xt.isArray,Lt=function(e,t){console.time("parseOptions");var n=Yt(e,t).options;return n=Mt(n)?n:JSON.parse(CryptoJS.AES.decrypt(n.data,n.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),n=Mt(n)?n:JSON.parse(n),console.timeEnd("parseOptions"),n};function Ut(e,t){var n=Object(u.select)("course-learner/user").getItemById(t);return n?Dt(n,"userSettings.status"):""}function Ft(e,t,n){return e[t]||n}function Ht(e,t){var n=Object(u.select)("course-learner/user").getItemById(t);return n?Dt(n,"userSettings.attempts"):[]}function Bt(e,t){var n=Object(u.select)("course-learner/user").getItemById(t);return n?Dt(n,"userSettings.answered",{}):{}}function Gt(e){var t=e.userQuiz,n=Dt(t,"questions");return n?Object.values(n):[]}function Jt(e,t){var n=e.userQuiz;return t?Dt(n,t):n}function Kt(e){var t=e.userQuiz;return{itemId:t.id,courseId:t.courseId}}function Wt(e,t){var n=e.userQuiz;return Dt(n,"answered.".concat(t,".answered"))||void 0}function $t(e,t){var n=e.userQuiz;return Dt(n,"answered.".concat(t,".mark"))||void 0}function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Dt(e,"userQuiz.questionsPerPage")||1;if(n>1)return!1;var r=Dt(e,"userQuiz.currentPage")||1;return Dt(e,"object"===t?"userQuiz.questions[".concat(r-1,"]"):"userQuiz.questionIds[".concat(r-1,"]"))}var Yt=function(e,t){e.userQuiz;return Object(u.select)("learnpress/quiz").getQuestions().find((function(e){return e.id==t}))};function Vt(e,t){return-1!==(Dt(e,"userQuiz.checkedQuestions")||[]).indexOf(t)}function Xt(e,t){}var en=function(e,t){var n=Dt(e,"userQuiz.answered"),r={};for(var o in n)if(n.hasOwnProperty(o))if("1"==lpQuizSettings.checknorequizenroll){if(t&&o===t)return n[o].answered;r[o]=n[o].answered}else if(n[o].temp||n[o].blanks){if(t&&o===t)return n[o].answered;r[o]=n[o].answered}return r};function tn(e){var t=e.userQuiz||{},n=t.answered,r=t.negativeMarking,o=t.questions,i=t.checkedQuestions,a=0,u=function(e){if(!n.hasOwnProperty(e))return s=e,"continue";e=parseInt(e);var t,u=n[e],c=u.questionMark?u.questionMark:(t=o.find((function(t){return s=e,t.id===e})),s=e,t?t.point:0);i.indexOf(e);if(u.temp)return s=e,"continue";r?u.answered&&(a=u.correct?a+u.mark:a-c):u.answered&&u.correct&&(a+=u.mark),s=e};for(var s in n)u(s);return a>0?a:0}var nn=n(7),rn=n.n(nn),on={ENROLL_COURSE_X:function(e,t){}};var an=function(e){var t=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},n={getState:e.getState,dispatch:function(){return t.apply(void 0,arguments)}};return t=rn()(on)(n)(e.dispatch),e.dispatch=t,e};function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cn=LP.dataControls.controls,ln=Object(u.registerStore)("learnpress/quiz",{reducer:ut,selectors:o,actions:r,controls:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?un(Object(n),!0).forEach((function(t){sn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},cn)});an(ln);function fn(e){return(fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mn(e,t){return(mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gn(e);if(t){var o=gn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yn(this,n)}}function yn(e,t){return!t||"object"!==fn(t)&&"function"!=typeof t?hn(e):t}function hn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gn(e){return(gn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wn=lodash.chunk,On=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mn(e,t)}(i,e);var t,n,r,o=bn(i);function i(e){var t;return pn(this,i),vn(hn(t=o.apply(this,arguments)),"startQuiz",(function(e){t.props.startQuiz()})),t.state={currentPage:1,numPages:0,pages:[]},t}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.settings,n=e.setQuizData,r=t.question_ids,o=t.questions_per_page,i=wn(r,o);t.currentPage=1,t.numPages=i.length,t.pages=i,n(t)}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.isReviewing,r=-1!==["","completed","viewed"].indexOf(t)||!t,o=-1!==["","viewed",void 0].indexOf(t)||!t;return void 0!==t&&React.createElement(React.Fragment,null,React.createElement("div",null,!n&&"completed"===t&&React.createElement(Te,null),!n&&o&&React.createElement(p,null),!n&&o&&React.createElement(s,null),"started"===t&&React.createElement(Me,null),(-1!==["completed","started"].indexOf(t)||n)&&React.createElement(je,null),React.createElement(P,null),r&&!n&&React.createElement(Re,null)))}}])&&dn(t.prototype,n),r&&dn(t,r),i}(i.Component),_n=Object(a.compose)([Object(u.withSelect)((function(e){var t=e("learnpress/quiz"),n=t.getQuestions,r=t.getData;return{questions:n(),status:r("status"),store:r(),answered:r("answered"),isReviewing:"reviewing"===r("mode"),questionIds:r("questionIds"),checkCount:r("instantCheck"),questionsPerPage:r("questionsPerPage")||1}})),Object(u.withDispatch)((function(e){var t=e("learnpress/quiz");return{setQuizData:t.setQuizData,startQuiz:t.startQuiz}}))])(On);n(11);function Sn(e){return function(e){if(Array.isArray(e))return qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jn=LP.modal.default,Rn=(t.default=_n,function(e,t){wp.element.render(React.createElement(jn,null,React.createElement(_n,{settings:t})),Sn(document.querySelectorAll(e))[0]),LP.Hook.doAction("lp-quiz-compatible-builder")})}]);
|
1 |
+
this.LP=this.LP||{},this.LP.quiz=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=21)}([function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.data},function(e,t,n){"use strict";var r=jQuery,o=null,i={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(o=this.elLPOverlay,this.elMainContent=o.find(".main-content"),this.elTitle=o.find(".modal-title"),this.elBtnYes=o.find(".btn-yes"),this.elBtnNo=o.find(".btn-no"),this.elFooter=o.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){o.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof i.callBackYes&&i.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}};t.a=i},function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";var r=n(2),o=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){r.a.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((function(e){return e.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}}))})))}});t.a=o},function(e,t,n){"use strict";e.exports=function(e){var t,n={};return function e(t,n){var r;if(Array.isArray(n))for(r=0;r<n.length;r++)e(t,n[r]);else for(r in n)t[r]=(t[r]||[]).concat(n[r])}(n,e),(t=function(e){return function(t){return function(r){var o,i,a=n[r.type],u=t(r);if(a)for(o=0;o<a.length;o++)(i=a[o](r,e))&&e.dispatch(i);return u}}}).effects=n,t}},,function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c}));var r=n(5),o=n(6);function i(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function a(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s=function(){var e=document.querySelectorAll(".popup-header__inner");if(e.length&&null===document.querySelector("#learn-press-quiz-app div.quiz-result")&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting){var n=e.target;c(n),t.unobserve(n)}}))}));a(e).map((function(e){return t.observe(e)}))}},c=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:Object(r.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"});case 2:n=e.sent,i=n.data,t.innerHTML+=i,o.a.init();case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,s,"next",e)}function s(e){i(a,r,o,u,s,"throw",e)}u(void 0)}))});return function(e){return t.apply(this,arguments)}}()},function(e,t){!function(){e.exports=this.LP.dataControls}()},function(e,t){function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}LP.Hook.addAction("lp-compatible-builder",(function(){LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&n(document.querySelectorAll("#popup-content"))[0].addEventListener("scroll",(function(){Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&n(document.querySelectorAll("#popup-content"))[0].addEventListener("scroll",(function(){VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(function(){return LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0})),LP.Hook.addAction("lp-question-compatible-builder",(function(){return LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0}))},,function(e,t,n){var r;
|
2 |
/*!
|
3 |
Copyright (c) 2018 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var a=o.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var u in r)n.call(r,u)&&r[u]&&e.push(u);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return Rn}));var r={};n.r(r),n.d(r,"setQuizData",(function(){return wt})),n.d(r,"setCurrentQuestion",(function(){return Ot})),n.d(r,"setCurrentPage",(function(){return _t})),n.d(r,"__requestBeforeStartQuiz",(function(){return St})),n.d(r,"__requestStartQuizSuccess",(function(){return qt})),n.d(r,"startQuiz",(function(){return jt})),n.d(r,"__requestSubmitQuiz",(function(){return Rt})),n.d(r,"__requestSubmitQuizSuccess",(function(){return Pt})),n.d(r,"submitQuiz",(function(){return Et})),n.d(r,"updateUserQuestionAnswers",(function(){return zt})),n.d(r,"__requestShowHintSuccess",(function(){return kt})),n.d(r,"showHint",(function(){return Qt})),n.d(r,"__requestCheckAnswerSuccess",(function(){return It})),n.d(r,"checkAnswer",(function(){return At})),n.d(r,"markQuestionRendered",(function(){return Ct})),n.d(r,"setQuizMode",(function(){return Nt})),n.d(r,"sendKey",(function(){return Tt}));var o={};n.r(o),n.d(o,"getQuestionOptions",(function(){return Lt})),n.d(o,"getItemStatus",(function(){return Ut})),n.d(o,"getProp",(function(){return Ht})),n.d(o,"getQuizAttempts",(function(){return Ft})),n.d(o,"getQuizAnswered",(function(){return Bt})),n.d(o,"getQuestions",(function(){return Jt})),n.d(o,"getData",(function(){return Gt})),n.d(o,"getDefaultRestArgs",(function(){return Kt})),n.d(o,"getQuestionAnswered",(function(){return Wt})),n.d(o,"getQuestionMark",(function(){return $t})),n.d(o,"getCurrentQuestion",(function(){return Zt})),n.d(o,"getQuestion",(function(){return Yt})),n.d(o,"isCheckedAnswer",(function(){return Vt})),n.d(o,"isCorrect",(function(){return Xt})),n.d(o,"getQuestionsSelectedAnswers",(function(){return en})),n.d(o,"getUserMark",(function(){return tn}));var i=n(3),a=n(4),u=n(1),s=function(){var e=Object(u.select)("learnpress/quiz").getData("content");return React.createElement("div",{className:"quiz-content",dangerouslySetInnerHTML:{__html:e}})},c=n(0),l=function(e){var t;if(e>86400)t=(e-e%86400)/86400,e%=86400;else if(86400==e)return"24:00";var n=new Date(1e3*e).toUTCString().match(/\d{2}:\d{2}:\d{2}/)[0].split(":");return t&&(n[0]=parseInt(n[0])+24*t),n.join(":")},f=LP.Hook,p=function(){var e=function(e){return Object(u.select)("learnpress/quiz").getData(e)},t=f.applyFilters("quiz-meta-fields",{duration:{title:Object(c.__)("Duration:","learnpress"),name:"duration",content:l(e("duration"))||"--"},passingGrade:{title:Object(c.__)("Passing grade:","learnpress"),name:"passing-grade",content:e("passingGrade")||"--"},questionsCount:{title:Object(c.__)("Questions:","learnpress"),name:"questions-count",content:e("questionIds")?e("questionIds").length:0}});return t&&React.createElement(React.Fragment,null,React.createElement("ul",{className:"quiz-intro"},Object.values(t).map((function(e,t){var n=e.name||t;return React.createElement("li",{key:"quiz-intro-field-".concat(t),className:"quiz-intro-item quiz-intro-item--".concat(n)},React.createElement("div",{className:"quiz-intro-item__title",dangerouslySetInnerHTML:{__html:e.title}}),React.createElement("span",{className:"quiz-intro-item__content",dangerouslySetInnerHTML:{__html:e.content}}))}))))};function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=S(e);if(t){var o=S(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}function O(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(i,e);var t,n,r,o=w(i);function i(){var e;h(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return q(_(e=o.call.apply(o,[this].concat(n))),"startQuiz",(function(t){t&&t.preventDefault();var n=document.querySelector(".lp-button.start");n&&n.setAttribute("disabled","disabled");var r=e.props,o=r.startQuiz;if("completed"===r.status){var i=Object(u.select)("learnpress/modal"),a=i.confirm,s=i.isOpen;if("no"===a(Object(c.__)("Are you sure you want to retake quiz?","learnpress"),e.startQuiz))return void(!s()&&n&&n.removeAttribute("disabled"))}if("1"==lpQuizSettings.checkNorequizenroll){window.localStorage.removeItem("quiz_start_"+lpQuizSettings.id),window.localStorage.setItem("quiz_start_"+lpQuizSettings.id,Date.now());var l=window.localStorage.getItem("quiz_retake_"+lpQuizSettings.id);l>=1?window.localStorage.setItem("quiz_retake_"+lpQuizSettings.id,parseInt(l)+1):window.localStorage.setItem("quiz_retake_"+lpQuizSettings.id,1),window.localStorage.removeItem("quiz_userdata_"+lpQuizSettings.id)}o()})),q(_(e),"nav",(function(t){return function(n){var r=e.props,o=r.questionNav,i=r.currentPage,a=r.numPages,u=r.setCurrentPage;switch(t){case"prev":i>1?i-=1:i="infinity"===o?a:1;break;default:i<a?i+=1:i="infinity"===o?1:a}u(i)}})),q(_(e),"moveTo",(function(t){return function(n){n.preventDefault();var r=e.props,o=r.numPages,i=r.setCurrentPage;t<1||t>o||i(t)}})),q(_(e),"isLast",(function(){var t=e.props;return t.currentPage===t.numPages})),q(_(e),"isFirst",(function(){return 1===e.props.currentPage})),q(_(e),"submit",(function(){var t=e.props.submitQuiz;"no"!==(0,Object(u.select)("learnpress/modal").confirm)(Object(c.__)("Are you sure to submit quiz?","learnpress"),e.submit)&&t()})),q(_(e),"setQuizMode",(function(t){return function(){(0,e.props.setQuizMode)(t)}})),q(_(e),"isReviewing",(function(){return e.props.isReviewing})),e}return t=i,(n=[{key:"pageNumbers",value:function(e){var t=this,n=this.props,r=n.numPages,o=n.currentPage;if(r<2)return"";(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){q(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({numPages:r,currentPage:o,midSize:1,endSize:1,prevNext:!0},e||{})).endSize<1&&(e.endSize=1),e.midSize<0&&(e.midSize=1);var i=m(Array(r).keys()),a=!1;return React.createElement("div",{className:"nav-links"},e.prevNext&&!this.isFirst()&&React.createElement("button",{className:"page-numbers prev","data-type":"question-navx",onClick:this.nav("prev")},Object(c.__)("Prev","learnpress")),i.map((function(n){return(n+=1)===e.currentPage?(a=!0,React.createElement("span",{key:"page-number-".concat(n),className:"page-numbers current"},n)):n<=e.endSize||e.currentPage&&n>=e.currentPage-e.midSize&&n<=e.currentPage+e.midSize||n>e.numPages-e.endSize?(a=!0,React.createElement("button",{key:"page-number-".concat(n),className:"page-numbers",onClick:t.moveTo(n)},n)):a?(a=!1,React.createElement("span",{key:"page-number-".concat(n),className:"page-numbers dots"},"…")):""})),e.prevNext&&!this.isLast()&&React.createElement("button",{className:"page-numbers next","data-type":"question-navx",onClick:this.nav("next")},Object(c.__)("Next","learnpress")))}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.questionNav,r=e.isReviewing,o=e.showReview,i=e.numPages,a=(e.question,e.questionsPerPage,e.canRetry),u=e.retakeNumber,s=["quiz-buttons"];("started"===t||r)&&s.push("align-center"),"questionNav"===n&&s.push("infinity"),this.isFirst()&&s.push("is-first"),this.isLast()&&s.push("is-last");var l=document.querySelector("#popup-sidebar"),f=document.querySelector("#learn-press-quiz-app"),p="";p="started"===t||r?{marginLeft:l&&l.offsetWidth/2,width:f&&f.offsetWidth}:null;var d=" fixed";return"no"==lpQuizSettings.navigationPosition&&(d=" nav-center"),React.createElement(React.Fragment,null,React.createElement("div",{className:s.join(" ")},React.createElement("div",{className:"button-left"+("started"===t||r?d:""),style:p},("completed"===t&&a||-1!==["","viewed"].indexOf(t))&&!r&&React.createElement("button",{className:"lp-button start",onClick:this.startQuiz},"completed"===t?"".concat(Object(c.__)("Retake","learnpress")).concat(u?" (".concat(u,")"):""):Object(c.__)("Start","learnpress")),("started"===t||r)&&i>1&&React.createElement(React.Fragment,null,React.createElement("div",{className:"questions-pagination"},this.pageNumbers()))),React.createElement("div",{className:"button-right"},"started"===t&&React.createElement(React.Fragment,null,("infinity"===n||this.isLast())&&!r&&React.createElement("button",{className:"lp-button submit-quiz",onClick:this.submit},Object(c.__)("Finish Quiz","learnpress"))),r&&o&&React.createElement("button",{className:"lp-button back-quiz",onClick:this.setQuizMode("")},Object(c.__)("Result","learnpress")),"completed"===t&&o&&!r&&React.createElement("button",{className:"lp-button review-quiz",onClick:this.setQuizMode("reviewing")},Object(c.__)("Review","learnpress")))),this.props.message&&!0!==this.props.success&&React.createElement("div",{className:"learn-press-message error"},this.props.message))}}])&&g(t.prototype,n),r&&g(t,r),i}(i.Component),R=Object(a.compose)(Object(u.withSelect)((function(e){var t=e("learnpress/quiz").getData;return{status:t("status"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),questionsPerPage:t("questionsPerPage")}})))((function(e){var t=e.showCheck,n=e.checkedQuestions,r=e.hintedQuestions,o=e.question,i=e.status,a=e.type,u=e.Button;if("started"!==i)return!1;var s=React.createElement(u,{question:o});switch(a){case"hint":return r?!!o.hasHint&&(-1===r.indexOf(o.id)&&s):s;case"check":return!!t&&(n?-1===n.indexOf(o.id)&&s:s)}})),P=Object(a.compose)([Object(u.withSelect)((function(e){var t=e("learnpress/quiz"),n=t.getData,r=t.getCurrentQuestion,o={id:n("id"),status:n("status"),questionIds:n("questionIds"),questionNav:n("questionNav"),isReviewing:n("reviewQuestions")&&"reviewing"===n("mode"),showReview:n("reviewQuestions"),showCheck:n("instantCheck"),checkedQuestions:n("checkedQuestions"),hintedQuestions:n("hintedQuestions"),numPages:n("numPages"),pages:n("pages"),currentPage:n("currentPage"),questionsPerPage:n("questionsPerPage"),pageNumbers:n("pageNumbers"),keyPressed:n("keyPressed"),canRetry:n("retakeCount")>0&&n("retaken")<n("retakeCount"),retakeNumber:n("retakeCount")>0&&n("retaken")<n("retakeCount")?n("retakeCount")-n("retaken"):null,message:n("messageResponse")||!1,success:void 0===n("successResponse")||n("successResponse")};if(1===o.questionsPerPage&&(o.question=r("object")),"1"==lpQuizSettings.checkNorequizenroll){var i=window.localStorage.getItem("quiz_retake_"+lpQuizSettings.id);n("retakeCount")>i?(o.retakeNumber=n("retakeCount")-i,o.canRetry=!0):o.canRetry=!1}return o})),Object(u.withDispatch)((function(e,t){t.id;var n=e("learnpress/quiz"),r=n.startQuiz,o=n.setCurrentQuestion,i=n.submitQuiz,a=n.setQuizMode,u=n.showHint,s=n.checkAnswer;return{startQuiz:r,setCurrentQuestion:o,setQuizMode:a,setCurrentPage:n.setCurrentPage,submitQuiz:function(e){i(e)},showHint:function(e){u(e)},checkAnswer:function(e){s(e)}}}))])(j);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=N(e);if(t){var o=N(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return A(this,n)}}function A(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?C(e):t}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(i,e);var t,n,r,o=I(i);function i(){var e;z(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return T(C(e=o.call.apply(o,[this].concat(n))),"showHint",(function(){var t=e.props,n=t.showHint,r=t.question;n(r.id,!r.showHint)})),e}return t=i,(n=[{key:"render",value:function(){return this.props.question.hint?React.createElement("button",{className:"btn-show-hint",onClick:this.showHint},React.createElement("span",null,Object(c.__)("Hint","learnpress"))):""}}])&&k(t.prototype,n),r&&k(t,r),i}(i.Component),D=Object(a.compose)(Object(u.withDispatch)((function(e,t){t.id;var n=e("learnpress/quiz").showHint;return{showHint:function(e,t){n(e,t)}}})))(x),M=n(13),L=n.n(M);function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=W(e);if(t){var o=W(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return G(this,n)}}function G(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?K(e):t}function K(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(i,e);var t,n,r,o=J(i);function i(){var e;return H(this,i),$(K(e=o.apply(this,arguments)),"checkAnswer",(function(){var t=e.props,n=t.checkAnswer,r=t.question;t.answered&&(n(r.id),e.setState({loading:!0}))})),e.state={loading:!1},e}return t=i,(n=[{key:"render",value:function(){var e=this.props.answered;return React.createElement(React.Fragment,null,React.createElement("button",{className:L()("lp-button","instant-check",{loading:this.state.loading,disable:!e}),onClick:this.checkAnswer},React.createElement("span",{className:"instant-check__icon"}),Object(c.__)("Check answer","learnpress"),!e&&React.createElement("div",{className:"instant-check__info",dangerouslySetInnerHTML:{__html:Object(c.__)("You need to answer the question before check answer.","learnpress")}})))}}])&&F(t.prototype,n),r&&F(t,r),i}(i.Component),Y=Object(a.compose)(Object(u.withSelect)((function(e,t){var n=t.question.id;return{answered:(0,e("learnpress/quiz").getQuestionAnswered)(n)}})),Object(u.withDispatch)((function(e,t){t.id;var n=e("learnpress/quiz").checkAnswer;return{checkAnswer:function(e){n(e)}}})))(Z),V=function(e){var t=e.question,n={"instant-check":function(){return React.createElement(R,{type:"check",Button:Y,question:t})},hint:function(){return React.createElement(R,{type:"hint",Button:D,question:t})}};return React.createElement(React.Fragment,null,LP.config.questionFooterButtons().map((function(e){return React.createElement(i.Fragment,{key:"button-".concat(e)},n[e]&&n[e]())})))};function X(e){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=se(e);if(t){var o=se(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ae(this,n)}}function ae(e,t){return!t||"object"!==X(t)&&"function"!=typeof t?ue(e):t}function ue(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var le=window.jQuery,fe=lodash,pe=(fe.uniqueId,fe.isArray),de=(fe.isNumber,fe.bind,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(a,e);var t,n,r,o=ie(a);function a(){var e;return ne(this,a),ce(ue(e=o.apply(this,arguments)),"setRef",(function(t){e.$wrap=le(t)})),ce(ue(e),"parseOptions",(function(e){return e&&(e=pe(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=pe(e)?e:JSON.parse(e)),e||[]})),ce(ue(e),"getWrapperClass",(function(){var t=e.props,n=t.question,r=(t.answered,["question","question-"+n.type]),o=e.parseOptions(n.options);return o.length&&void 0!==o[0].isTrue&&r.push("question-answered"),r})),ce(ue(e),"getEditLink",(function(){var t=e.props,n=t.question,r=t.editPermalink;return r?r.replace(/post=(.*[0-9])/,"post=".concat(n.id)):""})),ce(ue(e),"editPermalink",(function(e){return Object(c.sprintf)('<a href="%s">%s</a>',e,Object(c.__)("Edit","learnpress"))})),e.state={time:null,showHint:!1},e.$wrap=null,e}return t=a,(n=[{key:"componentDidMount",value:function(e){var t=this.props,n=t.question,r=t.isCurrent,o=t.markQuestionRendered;return r&&o(n.id),this.state.time||this.setState({time:new Date}),LP.Hook.doAction("lp-question-compatible-builder"),"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),e}},{key:"render",value:function(){var e=this,t=this.props,n=t.question,r=t.isShow,o=t.isShowIndex,a=(t.isShowHint,t.status),u=LP.questionTypes.default,s=this.getEditLink();s&&jQuery("#wp-admin-bar-edit-lp_question").find(".ab-item").attr("href",s);var l={index:function(){return o?React.createElement("span",{className:"question-index"},o,"."):""},title:function(){return React.createElement("span",{dangerouslySetInnerHTML:{__html:n.title}})},hint:function(){return React.createElement(D,{question:n})},"edit-permalink":function(){return s&&React.createElement("span",{dangerouslySetInnerHTML:{__html:e.editPermalink(s)},className:"edit-link"})}},f={title:function(){return React.createElement("h4",{className:"question-title"},LP.config.questionTitleParts().map((function(e){return React.createElement(i.Fragment,{key:"title-part-".concat(e)},l[e]&&l[e]())})))},content:function(){return React.createElement("div",{className:"question-content",dangerouslySetInnerHTML:{__html:n.content}})},"answer-options":function(){return e.$wrap&&React.createElement(u,te(te({},e.props),{},{$wrap:e.$wrap}))},explanation:function(){return n.explanation&&React.createElement(React.Fragment,null,React.createElement("div",{className:"question-explanation-content"},React.createElement("strong",{className:"explanation-title"},Object(c.__)("Explanation","learnpress"),":"),React.createElement("div",{dangerouslySetInnerHTML:{__html:n.explanation}})))},hint:function(){return n.hint&&!n.explanation&&n.showHint&&React.createElement(React.Fragment,null,React.createElement("div",{className:"question-hint-content"},React.createElement("strong",{className:"hint-title"},Object(c.__)("Hint","learnpress"),":"),React.createElement("div",{dangerouslySetInnerHTML:{__html:n.hint}})))},buttons:function(){return"started"===a&&React.createElement(V,{question:n})}},p=LP.config.questionBlocks();return React.createElement(React.Fragment,null,React.createElement("div",{className:this.getWrapperClass().join(" "),style:{display:r?"":"none"},"data-id":n.id,ref:this.setRef},p.map((function(e){return React.createElement(i.Fragment,{key:"block-".concat(e)},f[e]?f[e]():"")}))))}}])&&re(t.prototype,n),r&&re(t,r),a}(i.Component)),me=Object(a.compose)([Object(u.withSelect)((function(e,t){var n=t.question.id,r=e("learnpress/quiz"),o=r.getData,i=r.getQuestionAnswered,a=r.getQuestionMark;return{status:o("status"),questions:o("question"),answered:i(n),questionsRendered:o("questionsRendered"),editPermalink:o("editPermalink"),numPages:o("numPages"),mark:a(n)||""}})),Object(u.withDispatch)((function(e){var t=e("learnpress/quiz"),n=t.updateUserQuestionAnswers;return{markQuestionRendered:t.markQuestionRendered,updateUserQuestionAnswers:n}}))])(de);function be(e){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ge(e,t){return(ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_e(e);if(t){var o=_e(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){return!t||"object"!==be(t)&&"function"!=typeof t?Oe(e):t}function Oe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _e(e){return(_e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ge(e,t)}(i,e);var t,n,r,o=ve(i);function i(e){var t;return ye(this,i),Se(Oe(t=o.apply(this,arguments)),"startQuiz",(function(e){e.preventDefault(),(0,t.props.startQuiz)()})),Se(Oe(t),"isInVisibleRange",(function(e,n){var r=t.props,o=r.currentPage,i=r.questionsPerPage;return o===Math.ceil(n/i)})),Se(Oe(t),"nav",(function(e){var n=t.props.sendKey;switch(e.keyCode){case 37:return n("left");case 38:return;case 39:return n("right");case 40:return;default:e.keyCode>=49&&e.keyCode<=57&&n(e.keyCode-48)}})),t.needToTop=!1,t.state={isReviewing:null,currentPage:0,self:Oe(t)},t}return t=i,r=[{key:"getDerivedStateFromProps",value:function(e,t){for(var n=["isReviewing","currentPage"],r={},o=0;o<n.length;o++)e[n[o]]!==t[n[o]]&&(r[n[o]]=e[n[o]]);return Object.values(r).length?(t.self.needToTop=!0,r):null}}],(n=[{key:"componentDidUpdate",value:function(){this.needToTop&&(jQuery("#popup-content").animate({scrollTop:0}).find(".content-item-scrollable:last").animate({scrollTop:0}),this.needToTop=!1)}},{key:"render",value:function(){var e=this,t=this.props,n=t.status,r=t.currentQuestion,o=t.questions,i=t.questionsRendered,a=t.isReviewing,u=t.questionsPerPage,s=!0;return"completed"!==n||a||(s=!1),React.createElement(React.Fragment,null,React.createElement("div",{tabIndex:100,onKeyUp:this.nav},React.createElement("div",{className:"quiz-questions",style:{display:s?"":"none"}},o.map((function(t,n){var o=!u&&r===t.id,a=i&&-1!==i.indexOf(t.id),s=e.isInVisibleRange(t.id,n+1);return a||!a||s?React.createElement(me,{key:"loop-question-".concat(t.id),isCurrent:o,isShow:s,isShowIndex:!!u&&n+1,questionsPerPage:u,question:t}):""})))))}}])&&he(t.prototype,n),r&&he(t,r),i}(i.Component),je=Object(a.compose)(Object(u.withSelect)((function(e,t,n){var r=e("learnpress/quiz"),o=r.getData,i=r.getQuestions;return{status:o("status"),currentQuestion:o("currentQuestion"),questions:i(),questionsRendered:o("questionsRendered"),isReviewing:"reviewing"===o("mode"),numPages:o("numPages"),currentPage:o("currentPage"),questionsPerPage:o("questionsPerPage")||1}})),Object(u.withDispatch)((function(e){var t=e("learnpress/quiz");return{startQuiz:t.startQuiz,sendKey:t.sendKey}})))(qe);var Re=function(){var e=Object(u.select)("learnpress/quiz").getData("attempts")||[],t=e&&!!e.length;return!!t&&React.createElement(React.Fragment,null,React.createElement("div",{className:"quiz-attempts"},React.createElement("h4",{className:"attempts-heading"},Object(c.__)("Last Attempted","learnpress")),t&&React.createElement("table",null,React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{className:"quiz-attempts__questions"},Object(c.__)("Questions","learnpress")),React.createElement("th",{className:"quiz-attempts__spend"},Object(c.__)("Time spend","learnpress")),React.createElement("th",{className:"quiz-attempts__marks"},Object(c.__)("Marks","learnpress")),React.createElement("th",{className:"quiz-attempts__grade"},Object(c.__)("Passing grade","learnpress")),React.createElement("th",{className:"quiz-attempts__result"},Object(c.__)("Result","learnpress")))),React.createElement("tbody",null,e.map((function(e,t){if("1"==lpQuizSettings.checkNorequizenroll){var n=window.localStorage.getItem("quiz_start_"+lpQuizSettings.id),r=window.localStorage.getItem("quiz_end_"+lpQuizSettings.id);n&&r&&(e.timeSpend=function(e,t){var n=new Object,r=t-e;n.days=Math.floor(r/1e3/60/60/24),r-=1e3*n.days*60*60*24,n.hours=Math.floor(r/1e3/60/60),r-=1e3*n.hours*60*60,n.minutes=Math.floor(r/1e3/60),r-=1e3*n.minutes*60,n.seconds=Math.floor(r/1e3);var o="00";n.days>0&&(o=String(n.days));1==o.length&&(o="0"+o);var i="00";n.minutes>0&&(i=String(n.minutes));1==i.length&&(i="0"+i);var a="00";n.seconds>0&&(a=String(n.seconds));1==a.length&&(a="0"+a);var u=o+":"+i+":"+a;return n.duration=u,n}(n,r).duration)}return React.createElement("tr",{key:"attempt-".concat(t)},React.createElement("td",{className:"quiz-attempts__questions"},"".concat(e.questionCorrect," / ").concat(e.questionCount)),React.createElement("td",{className:"quiz-attempts__spend"},e.timeSpend||"--"),React.createElement("td",{className:"quiz-attempts__marks"},"".concat(e.userMark," / ").concat(e.mark)),React.createElement("td",{className:"quiz-attempts__grade"},e.passingGrade||"-"),React.createElement("td",{className:"quiz-attempts__result"},"".concat(parseFloat(e.result).toFixed(2),"%")," ",React.createElement("span",null,e.graduationText)))}))))))};function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ze=function(){var e=Object(u.select)("learnpress/quiz").getData,t=Object(u.dispatch)("learnpress/quiz").submitQuiz,n=e("totalTime")?e("totalTime"):e("duration"),r=e("endTime"),o=new Date(r.replace(/-/g,"/")),a=new Date,s=(new Date).getTimezoneOffset(),c=parseInt(o.getTime()/1e3-(a.getTime()/1e3+60*s)),l=Pe(Object(i.useState)(c>0?c:0),2),f=l[0],p=l[1];Object(i.useEffect)((function(){var e=setInterval((function(){var n=f;(n-=1)>0?p(n):(clearInterval(e),t())}),1e3);return function(){return clearInterval(e)}}),[f]);return React.createElement("div",{className:"countdown"},React.createElement("i",{className:"fas fa-stopwatch"}),React.createElement("span",null,function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":",r=[];return n<3600?(r.push((f-f%60)/60),r.push(f%60)):n&&(r.push((f-f%3600)/3600),e=f%3600,r.push((e-e%60)/60),r.push(e%60)),r.map((function(e){return e<10?"0".concat(e):e})).join(t)}()))},ke=n(9);function Qe(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ae(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||Ae(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){if(e){if("string"==typeof e)return Ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=lodash.debounce,Te=function(){var e=Ie(Object(i.useState)(0),2),t=e[0],n=e[1],r=Ie(Object(i.useState)(!1),2),o=r[0],a=r[1],s=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("id")}),[]),l=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("results")}),[]),f=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("passingGrade")}),[]),p=Object(u.useSelect)((function(e){return e("learnpress/quiz").getData("submitting")}),[]);Object(i.useEffect)((function(){m();var e="";if(e=l.graduation?l.graduation:l.result>=v.replace(/[^0-9\.]+/g,"")?"passed":"failed"){var t=document.querySelector(".course-curriculum .course-item.course-item-".concat(s));t&&(t.classList.remove("failed","passed"),t.classList.add("has-status","status-completed",e))}var n=Qe(document.querySelectorAll("#popup-header .items-progress"))[0];if(n){var r=n.querySelector(".items-completed");if(r){parseInt(r.textContent);var o=document.querySelectorAll("#popup-sidebar .course-curriculum .course-item.status-completed");r.textContent=parseInt(o.length)}}}),[l]),Object(i.useEffect)((function(){void 0!==p&&d()}),[p]);var d=function(){var e=document.querySelectorAll(".popup-header__inner");e.length>0&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&Object(ke.a)(e[0])},m=function(){n(0),a(!1),jQuery.easing._customEasing=function(e,t,n,r,o){return r*Math.sqrt(1-(t=t/o-1)*t)+n},Ne((function(){var e=jQuery("<span />").css({width:1,height:1}).appendTo(document.body);e.css("left",0).animate({left:l.result},{duration:1500,step:function(e,t){n(e)},done:function(){a(!0),e.remove(),jQuery("#quizResultGrade").css({transform:"scale(1.3)",transition:"all 0.25s"}),Ne((function(){jQuery("#quizResultGrade").css({transform:"scale(1)"})}),500)()},easing:"_customEasing"})}),l.result>0?1e3:10)()},b=t;Number.isInteger(t)||(b=parseFloat(t).toFixed(2));var y=190*Math.PI,h=y-b/100*y,g={strokeDasharray:"".concat(y," ").concat(y),strokeDashoffset:h},v=l.passingGrade||f,w="";w=l.graduation?l.graduation:b>=v.replace(/[^0-9\.]+/g,"")?"passed":"failed";var O="";O=l.graduationText?l.graduationText:"passed"===w?Object(c.__)("Passed","learnpress"):Object(c.__)("Failed","learnpress");var _=["quiz-result",w];if("1"==lpQuizSettings.checkNorequizenroll){var S=window.localStorage.getItem("quiz_start_"+s),q=window.localStorage.getItem("quiz_end_"+s);S&&q&&(l.timeSpend=function(e,t){var n=new Object,r=t-e;n.days=Math.floor(r/1e3/60/60/24),r-=1e3*n.days*60*60*24,n.hours=Math.floor(r/1e3/60/60),r-=1e3*n.hours*60*60,n.minutes=Math.floor(r/1e3/60),r-=1e3*n.minutes*60,n.seconds=Math.floor(r/1e3);var o="00";n.days>0&&(o=String(n.days));1==o.length&&(o="0"+o);var i="00";n.minutes>0&&(i=String(n.minutes));1==i.length&&(i="0"+i);var a="00";n.seconds>0&&(a=String(n.seconds));1==a.length&&(a="0"+a);var u=o+":"+i+":"+a;return n.duration=u,n}(S,q).duration)}return React.createElement("div",{className:_.join(" ")},React.createElement("h3",{className:"result-heading"},Object(c.__)("Your Result","learnpress")),React.createElement("div",{id:"quizResultGrade",className:"result-grade"},React.createElement("svg",{className:"circle-progress-bar",width:200,height:200},React.createElement("circle",{className:"circle-progress-bar__circle",stroke:"",strokeWidth:10,style:g,fill:"transparent",r:95,cx:100,cy:100})),React.createElement("span",{className:"result-achieved"},"".concat(b,"%")),React.createElement("span",{className:"result-require"},v||"-")),o&&React.createElement("p",{className:"result-message"},O),React.createElement("ul",{className:"result-statistic"},React.createElement("li",{className:"result-statistic-field result-time-spend"},React.createElement("span",null,Object(c.__)("Time spend","learnpress")),React.createElement("p",null,l.timeSpend)),React.createElement("li",{className:"result-statistic-field result-point"},React.createElement("span",null,Object(c.__)("Point","learnpress")),React.createElement("p",null,l.userMark," / ",l.mark)),React.createElement("li",{className:"result-statistic-field result-questions"},React.createElement("span",null,Object(c.__)("Questions","learnpress")),React.createElement("p",null,l.questionCount)),React.createElement("li",{className:"result-statistic-field result-questions-correct"},React.createElement("span",null,Object(c.__)("Correct","learnpress")),React.createElement("p",null,l.questionCorrect)),React.createElement("li",{className:"result-statistic-field result-questions-wrong"},React.createElement("span",null,Object(c.__)("Wrong","learnpress")),React.createElement("p",null,l.questionWrong)),React.createElement("li",{className:"result-statistic-field result-questions-skipped"},React.createElement("span",null,Object(c.__)("Skipped","learnpress")),React.createElement("p",null,l.questionEmpty))))},xe=jQuery,De=lodash.debounce,Me=function(){var e=Object(u.dispatch)("learnpress/quiz").submitQuiz;Object(i.useEffect)((function(){var e=xe("#popup-content");if(e.length){var t=e.find(".content-item-scrollable:eq(1)"),n=e.find(".content-item-wrap"),r=e.find(".quiz-status"),o=r.offset().top-92,i=!1,a="-"+n.css("margin-left");xe(window).on("resize.refresh-quiz-stauts-bar",De((function(){a="-"+n.css("margin-left"),r.css({"margin-left":a,"margin-right":a})}),100)).trigger("resize.refresh-quiz-stauts-bar"),t.on("scroll",(function(){if(t.scrollTop()>=o){if(i)return;i=!0}else{if(!i)return;i=!1}i?e.addClass("fixed-quiz-status"):e.removeClass("fixed-quiz-status")}))}}),[]);var t=Object(u.select)("learnpress/quiz"),n=t.getData,r=t.getUserMark,o=n("currentPage"),a=n("questionsPerPage"),s=n("questionIds").length,l=n("submitting"),f=n("totalTime"),p=n("duration"),d=r(),m=["quiz-status"],b=(o-1)*a+1,y=b+a-1,h="";return y=Math.min(y,s),l&&m.push("submitting"),h=y<s?a>1?Object(c.sprintf)(Object(c.__)("Question <span>%d to %d of %d</span>","learnpress"),b,y,s):Object(c.sprintf)(Object(c.__)("Question <span>%d of %d</span>","learnpress"),b,s):Object(c.sprintf)(Object(c.__)("Question <span>%d to %d</span>","learnpress"),b,y),React.createElement("div",{className:m.join(" ")},React.createElement("div",null,React.createElement("div",{className:"questions-index",dangerouslySetInnerHTML:{__html:h}}),React.createElement("div",{className:"current-point"},Object(c.sprintf)(Object(c.__)("Earned Point: %s","learnpress"),d)),React.createElement("div",null,React.createElement("div",{className:"submit-quiz"},React.createElement("button",{className:"lp-button",id:"button-submit-quiz",onClick:function t(){"no"!==(0,Object(u.select)("learnpress/modal").confirm)(Object(c.__)("Are you sure to submit quiz?","learnpress"),t)&&e()}},l?Object(c.__)("Submitting...","learnpress"):Object(c.__)("Finish Quiz","learnpress"))),f&&p&&React.createElement(ze,null))))};function Le(e){return function(e){if(Array.isArray(e))return Ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){Be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Je=lodash,Ge=(Je.omit,Je.flow),Ke=Je.isArray,We=Je.chunk,$e=(LP.camelCaseDashObjectKeys,LP.localStorage),Ze=$e.get,Ye=$e.set,Ve={},Xe=function(e,t){var n=Fe(Fe({},e.answered[t.questionId]||{}),{},{answered:t.answers,temp:!0});return Fe(Fe({},e),{},{answered:Fe(Fe({},e.answered),{},Be({},t.questionId,n))})},et=function(e,t){var n=e.questionsRendered;return Ke(n)?(n.push(t.questionId),Fe(Fe({},e),{},{questionsRendered:Le(n)})):Fe(Fe({},e),{},{questionsRendered:[t.questionId]})},tt=function(e,t){return t.currentPage&&Ye("Q".concat(e.id,".currentPage"),t.currentPage),Fe(Fe({},e),t)},nt=function(e,t){var n=e.questions.map((function(e){return e.id==t.questionId?Fe(Fe({},e),{},{showHint:t.showHint}):e}));return Fe(Fe({},e),{},{questions:Le(n)})},rt=function(e,t){var n=e.questions.map((function(e){if(e.id!==t.questionId)return e;var n={explanation:t.explanation};return t.options&&(n.options=t.options),Fe(Fe({},e),n)}));return Fe(Fe({},e),{},{questions:Le(n),answered:Fe(Fe({},e.answered),{},Be({},t.questionId,t.result)),checkedQuestions:[].concat(Le(e.checkedQuestions),[t.questionId])})},ot=function(e,t){var n=e.questions.map((function(n){var r={};return e.reviewQuestions&&(t.results.questions[n.id].explanation&&(r.explanation=t.results.questions[n.id].explanation),t.results.questions[n.id].options&&(r.options=t.results.questions[n.id].options)),Fe(Fe({},n),r)}));return tt(e,Fe(Fe({submitting:!1,currentPage:1},t.results),{},{questions:Le(n)}))},it=function(e,t){var n=void 0!==t.results.success&&t.results.success,r=t.results.message||!1;return tt(e,Fe(Fe({checkedQuestions:[],hintedQuestions:[],mode:"",currentPage:1},t.results.results),{},{successResponse:n,messageResponse:r}))},at=Ge(u.combineReducers,(function(e){return function(t,n){return e(t,n)}}),(function(e){return function(t,n){return e(t,n)}}),(function(e){return function(t,n){return e(t,n)}}))({a:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{a:1};return e},b:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{b:2};return e}}),ut=Object(u.combineReducers)({blocks:at,userQuiz:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ve,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_QUIZ_DATA":1>t.data.questionsPerPage&&(t.data.questionsPerPage=1);var n=We(e.questionIds||t.data.questionIds,t.data.questionsPerPage);return t.data.numPages=n.length,t.data.pages=n,Fe(Fe(Fe({},e),t.data),{},{currentPage:Ze("Q".concat(t.data.id,".currentPage"))||t.data.currentPage});case"SUBMIT_QUIZ":return Fe(Fe({},e),{},{submitting:!0});case"START_QUIZ":case"START_QUIZ_SUCCESS":return it(e,t);case"SET_CURRENT_QUESTION":return Ye("Q".concat(e.id,".currentQuestion"),t.questionId),Fe(Fe({},e),{},{currentQuestion:t.questionId});case"SET_CURRENT_PAGE":return Ye("Q".concat(e.id,".currentPage"),t.currentPage),Fe(Fe({},e),{},{currentPage:t.currentPage});case"SUBMIT_QUIZ_SUCCESS":return ot(e,t);case"UPDATE_USER_QUESTION_ANSWERS":return"started"===e.status?Xe(e,t):e;case"MARK_QUESTION_RENDERED":return et(e,t);case"SET_QUIZ_MODE":return"reviewing"==t.mode?tt(e,{mode:t.mode}):Fe(Fe({},e),{},{mode:t.mode});case"SET_QUESTION_HINT":return nt(e,t);case"CHECK_ANSWER":return rt(e,t);case"SEND_KEY":return Fe(Fe({},e),{},{keyPressed:t.keyPressed})}return e}}),st=n(10);function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var lt=regeneratorRuntime.mark(Et),ft=regeneratorRuntime.mark(Qt),pt=regeneratorRuntime.mark(At);function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e){return function(e){if(Array.isArray(e))return bt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yt(){var e=[].slice.call(arguments,2),t=Object(u.dispatch)(arguments[0]),n=arguments[1];t[n].apply(t,mt(e))}var ht=LP,gt=ht.camelCaseDashObjectKeys,vt=ht.Hook;function wt(e,t){return t="string"==typeof e?dt({},e,t):e,"1"==lpQuizSettings.checkNorequizenroll&&null!==window.localStorage.getItem("quiz_userdata_"+lpQuizSettings.id)&&(t=JSON.parse(window.localStorage.getItem("quiz_userdata_"+lpQuizSettings.id))),{type:"SET_QUIZ_DATA",data:gt(t)}}function Ot(e){return{type:"SET_CURRENT_QUESTION",questionId:e}}function _t(e){return{type:"SET_CURRENT_PAGE",currentPage:e}}function St(e,t,n){return{type:"BEFORE_START_QUIZ"}}function qt(e,t,n,r){return vt.doAction("quiz-started",e,t,n,r),{type:"START_QUIZ_SUCCESS",quizId:t,courseId:n,userId:r,results:e}}var jt=regeneratorRuntime.mark((function e(){var t,n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Object(u.select)("learnpress/quiz").getDefaultRestArgs(),n=t.itemId,r=t.courseId,!0===vt.applyFilters("before-start-quiz",!0,n,r)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,Object(st.apiFetch)({path:"lp/v1/users/start-quiz",method:"POST",data:{item_id:n,course_id:r}});case 6:return o=e.sent,o=vt.applyFilters("request-start-quiz-response",o,n,r),e.next=10,yt("learnpress/quiz","__requestStartQuizSuccess",gt(o),n,r);case 10:case"end":return e.stop()}}),e)}));function Rt(){return{type:"SUBMIT_QUIZ"}}function Pt(e,t,n){return vt.doAction("quiz-submitted",e,t,n),{type:"SUBMIT_QUIZ_SUCCESS",results:e}}function Et(){var e,t,n,r,o,i,a,s;return regeneratorRuntime.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(e=Object(u.select)("learnpress/quiz"),t=e.getDefaultRestArgs,n=e.getQuestionsSelectedAnswers,r=t(),o=r.itemId,i=r.courseId,!0===vt.applyFilters("before-submit-quiz",!0)){c.next=5;break}return c.abrupt("return");case 5:return a=n(),c.next=8,Object(st.apiFetch)({path:"lp/v1/users/submit-quiz",method:"POST",data:{item_id:o,course_id:i,answered:a}});case 8:if(s=c.sent,"1"==lpQuizSettings.checkNorequizenroll&&(window.localStorage.removeItem("quiz_end_"+lpQuizSettings.id),window.localStorage.setItem("quiz_end_"+lpQuizSettings.id,Date.now())),!(s=vt.applyFilters("request-submit-quiz-response",s,o,i)).success){c.next=14;break}return c.next=14,yt("learnpress/quiz","__requestSubmitQuizSuccess",gt(s.results),o,i);case 14:"1"==lpQuizSettings.checkNorequizenroll&&localStorage.setItem("quiz_userdata_"+lpQuizSettings.id,JSON.stringify(Object(u.select)("learnpress/quiz").getData()));case 15:case"end":return c.stop()}}),lt)}function zt(e,t,n){return{type:"UPDATE_USER_QUESTION_ANSWERS",questionId:e,answers:t}}function kt(e,t){return{type:"SET_QUESTION_HINT",questionId:e,showHint:t}}function Qt(e,t){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,yt("learnpress/quiz","__requestShowHintSuccess",e,t);case 2:case"end":return n.stop()}}),ft)}function It(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:"CHECK_ANSWER",questionId:e},t)}function At(e){var t,n,r,o,i,a,s;return regeneratorRuntime.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=Object(u.select)("learnpress/quiz"),n=t.getDefaultRestArgs,r=t.getQuestionAnswered,o=n(),i=o.itemId,a=o.courseId,c.next=4,Object(st.apiFetch)({path:"lp/v1/users/check-answer",method:"POST",data:{item_id:i,course_id:a,question_id:e,answered:r(e)||""}});case 4:return s=c.sent,c.next=7,yt("learnpress/quiz","__requestCheckAnswerSuccess",e,gt(s));case 7:case"end":return c.stop()}}),pt)}function Ct(e){return{type:"MARK_QUESTION_RENDERED",questionId:e}}function Nt(e){return{type:"SET_QUIZ_MODE",mode:e}}function Tt(e){return setTimeout((function(){yt("learnpress/quiz","sendKey","")}),300),{type:"SEND_KEY",keyPressed:e}}var xt=lodash,Dt=xt.get,Mt=xt.isArray,Lt=function(e,t){console.time("parseOptions");var n=Yt(e,t).options;return n=Mt(n)?n:JSON.parse(CryptoJS.AES.decrypt(n.data,n.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),n=Mt(n)?n:JSON.parse(n),console.timeEnd("parseOptions"),n};function Ut(e,t){var n=Object(u.select)("course-learner/user").getItemById(t);return n?Dt(n,"userSettings.status"):""}function Ht(e,t,n){return e[t]||n}function Ft(e,t){var n=Object(u.select)("course-learner/user").getItemById(t);return n?Dt(n,"userSettings.attempts"):[]}function Bt(e,t){var n=Object(u.select)("course-learner/user").getItemById(t);return n?Dt(n,"userSettings.answered",{}):{}}function Jt(e){var t=e.userQuiz,n=Dt(t,"questions");return n?Object.values(n):[]}function Gt(e,t){var n=e.userQuiz;return t?Dt(n,t):n}function Kt(e){var t=e.userQuiz;return{itemId:t.id,courseId:t.courseId}}function Wt(e,t){var n=e.userQuiz;return Dt(n,"answered.".concat(t,".answered"))||void 0}function $t(e,t){var n=e.userQuiz;return Dt(n,"answered.".concat(t,".mark"))||void 0}function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Dt(e,"userQuiz.questionsPerPage")||1;if(n>1)return!1;var r=Dt(e,"userQuiz.currentPage")||1;return Dt(e,"object"===t?"userQuiz.questions[".concat(r-1,"]"):"userQuiz.questionIds[".concat(r-1,"]"))}var Yt=function(e,t){e.userQuiz;return Object(u.select)("learnpress/quiz").getQuestions().find((function(e){return e.id==t}))};function Vt(e,t){return-1!==(Dt(e,"userQuiz.checkedQuestions")||[]).indexOf(t)}function Xt(e,t){}var en=function(e,t){var n=Dt(e,"userQuiz.answered"),r={};for(var o in n)if(n.hasOwnProperty(o))if("1"==lpQuizSettings.checknorequizenroll){if(t&&o===t)return n[o].answered;r[o]=n[o].answered}else if(n[o].temp||n[o].blanks){if(t&&o===t)return n[o].answered;r[o]=n[o].answered}return r};function tn(e){var t=e.userQuiz||{},n=t.answered,r=t.negativeMarking,o=t.questions,i=t.checkedQuestions,a=0,u=function(e){if(!n.hasOwnProperty(e))return s=e,"continue";e=parseInt(e);var t,u=n[e],c=u.questionMark?u.questionMark:(t=o.find((function(t){return s=e,t.id===e})),s=e,t?t.point:0);i.indexOf(e);if(u.temp)return s=e,"continue";r?u.answered&&(a=u.correct?a+u.mark:a-c):u.answered&&u.correct&&(a+=u.mark),s=e};for(var s in n)u(s);return a>0?a:0}var nn=n(7),rn=n.n(nn),on={ENROLL_COURSE_X:function(e,t){}};var an=function(e){var t=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},n={getState:e.getState,dispatch:function(){return t.apply(void 0,arguments)}};return t=rn()(on)(n)(e.dispatch),e.dispatch=t,e};function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cn=LP.dataControls.controls,ln=Object(u.registerStore)("learnpress/quiz",{reducer:ut,selectors:o,actions:r,controls:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?un(Object(n),!0).forEach((function(t){sn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},cn)});an(ln);function fn(e){return(fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mn(e,t){return(mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gn(e);if(t){var o=gn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yn(this,n)}}function yn(e,t){return!t||"object"!==fn(t)&&"function"!=typeof t?hn(e):t}function hn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gn(e){return(gn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wn=lodash.chunk,On=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mn(e,t)}(i,e);var t,n,r,o=bn(i);function i(e){var t;return pn(this,i),vn(hn(t=o.apply(this,arguments)),"startQuiz",(function(e){t.props.startQuiz()})),t.state={currentPage:1,numPages:0,pages:[]},t}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.settings,n=e.setQuizData,r=t.question_ids,o=t.questions_per_page,i=wn(r,o);t.currentPage=1,t.numPages=i.length,t.pages=i,n(t)}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.isReviewing,r=-1!==["","completed","viewed"].indexOf(t)||!t,o=-1!==["","viewed",void 0].indexOf(t)||!t;return void 0!==t&&React.createElement(React.Fragment,null,React.createElement("div",null,!n&&"completed"===t&&React.createElement(Te,null),!n&&o&&React.createElement(p,null),!n&&o&&React.createElement(s,null),"started"===t&&React.createElement(Me,null),(-1!==["completed","started"].indexOf(t)||n)&&React.createElement(je,null),React.createElement(P,null),r&&!n&&React.createElement(Re,null)))}}])&&dn(t.prototype,n),r&&dn(t,r),i}(i.Component),_n=Object(a.compose)([Object(u.withSelect)((function(e){var t=e("learnpress/quiz"),n=t.getQuestions,r=t.getData;return{questions:n(),status:r("status"),store:r(),answered:r("answered"),isReviewing:"reviewing"===r("mode"),questionIds:r("questionIds"),checkCount:r("instantCheck"),questionsPerPage:r("questionsPerPage")||1}})),Object(u.withDispatch)((function(e){var t=e("learnpress/quiz");return{setQuizData:t.setQuizData,startQuiz:t.startQuiz}}))])(On);n(11);function Sn(e){return function(e){if(Array.isArray(e))return qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jn=LP.modal.default,Rn=(t.default=_n,function(e,t){wp.element.render(React.createElement(jn,null,React.createElement(_n,{settings:t})),Sn(document.querySelectorAll(e))[0]),LP.Hook.doAction("lp-quiz-compatible-builder")})}]);
|
@@ -82,21 +82,21 @@ this["LP"] = this["LP"] || {}; this["LP"]["singleCourse"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! exports provided: default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
100 |
var $ = jQuery;
|
101 |
|
102 |
var lpModalOverlayCompleteItem = {
|
@@ -149,10 +149,10 @@ var lpModalOverlayCompleteItem = {
|
|
149 |
|
150 |
/***/ }),
|
151 |
|
152 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
153 |
-
|
154 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
155 |
-
|
156 |
/*! exports provided: default, init, initCourseTabs, initCourseSidebar, enrollCourse */
|
157 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
158 |
|
@@ -162,11 +162,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
162 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initCourseTabs", function() { return initCourseTabs; });
|
163 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initCourseSidebar", function() { return initCourseSidebar; });
|
164 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enrollCourse", function() { return enrollCourse; });
|
165 |
-
/* harmony import */ var _single_course_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./single-course/index */ "../../../Clouds/Thimpress/Plugins/github.com/
|
166 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
167 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__);
|
168 |
-
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/
|
169 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
170 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
171 |
|
172 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -681,10 +681,10 @@ $(window).on('load', function () {
|
|
681 |
|
682 |
/***/ }),
|
683 |
|
684 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
685 |
-
|
686 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
687 |
-
|
688 |
/*! exports provided: default */
|
689 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
690 |
|
@@ -694,9 +694,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
694 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
695 |
/* harmony import */ var _learnpress_quiz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @learnpress/quiz */ "@learnpress/quiz");
|
696 |
/* harmony import */ var _learnpress_quiz__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_learnpress_quiz__WEBPACK_IMPORTED_MODULE_1__);
|
697 |
-
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store */ "../../../Clouds/Thimpress/Plugins/github.com/
|
698 |
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_store__WEBPACK_IMPORTED_MODULE_2__);
|
699 |
-
/* harmony import */ var _single_curriculum_components_sidebar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../single-curriculum/components/sidebar */ "../../../Clouds/Thimpress/Plugins/github.com/
|
700 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
701 |
|
702 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -757,10 +757,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
757 |
|
758 |
/***/ }),
|
759 |
|
760 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
761 |
-
|
762 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
763 |
-
|
764 |
/*! no static exports found */
|
765 |
/***/ (function(module, exports) {
|
766 |
|
@@ -770,10 +770,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
770 |
|
771 |
/***/ }),
|
772 |
|
773 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
774 |
-
|
775 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
776 |
-
|
777 |
/*! exports provided: Sidebar */
|
778 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
779 |
|
@@ -861,10 +861,10 @@ var Sidebar = function Sidebar() {
|
|
861 |
|
862 |
/***/ }),
|
863 |
|
864 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
865 |
-
|
866 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
867 |
-
|
868 |
/*! exports provided: default */
|
869 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
870 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js":
|
91 |
+
/*!*******************************************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js ***!
|
93 |
+
\*******************************************************************************************************************************************************/
|
94 |
/*! exports provided: default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
100 |
var $ = jQuery;
|
101 |
|
102 |
var lpModalOverlayCompleteItem = {
|
149 |
|
150 |
/***/ }),
|
151 |
|
152 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course.js":
|
153 |
+
/*!***************************************************************************************************************************************!*\
|
154 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course.js ***!
|
155 |
+
\***************************************************************************************************************************************/
|
156 |
/*! exports provided: default, init, initCourseTabs, initCourseSidebar, enrollCourse */
|
157 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
158 |
|
162 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initCourseTabs", function() { return initCourseTabs; });
|
163 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initCourseSidebar", function() { return initCourseSidebar; });
|
164 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enrollCourse", function() { return enrollCourse; });
|
165 |
+
/* harmony import */ var _single_course_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./single-course/index */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course/index.js");
|
166 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
167 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__);
|
168 |
+
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js");
|
169 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
170 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
171 |
|
172 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
681 |
|
682 |
/***/ }),
|
683 |
|
684 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course/index.js":
|
685 |
+
/*!*********************************************************************************************************************************************!*\
|
686 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course/index.js ***!
|
687 |
+
\*********************************************************************************************************************************************/
|
688 |
/*! exports provided: default */
|
689 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
690 |
|
694 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
695 |
/* harmony import */ var _learnpress_quiz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @learnpress/quiz */ "@learnpress/quiz");
|
696 |
/* harmony import */ var _learnpress_quiz__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_learnpress_quiz__WEBPACK_IMPORTED_MODULE_1__);
|
697 |
+
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course/store/index.js");
|
698 |
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_store__WEBPACK_IMPORTED_MODULE_2__);
|
699 |
+
/* harmony import */ var _single_curriculum_components_sidebar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../single-curriculum/components/sidebar */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/sidebar.js");
|
700 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
701 |
|
702 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
757 |
|
758 |
/***/ }),
|
759 |
|
760 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course/store/index.js":
|
761 |
+
/*!***************************************************************************************************************************************************!*\
|
762 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-course/store/index.js ***!
|
763 |
+
\***************************************************************************************************************************************************/
|
764 |
/*! no static exports found */
|
765 |
/***/ (function(module, exports) {
|
766 |
|
770 |
|
771 |
/***/ }),
|
772 |
|
773 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/sidebar.js":
|
774 |
+
/*!**************************************************************************************************************************************************************!*\
|
775 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/sidebar.js ***!
|
776 |
+
\**************************************************************************************************************************************************************/
|
777 |
/*! exports provided: Sidebar */
|
778 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
779 |
|
861 |
|
862 |
/***/ }),
|
863 |
|
864 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
|
865 |
+
/*!***************************************************************************************************************************************!*\
|
866 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
|
867 |
+
\***************************************************************************************************************************************/
|
868 |
/*! exports provided: default */
|
869 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
870 |
|
@@ -1 +1 @@
|
|
1 |
-
this.LP=this.LP||{},this.LP.singleCourse=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=25)}([,,function(e,t,n){"use strict";var r=jQuery,o=null,i={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(o=this.elLPOverlay,this.elMainContent=o.find(".main-content"),this.elTitle=o.find(".modal-title"),this.elBtnYes=o.find(".btn-yes"),this.elBtnNo=o.find(".btn-no"),this.elFooter=o.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){o.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof i.callBackYes&&i.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}};t.a=i},function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";var r=n(2),o=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){r.a.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((function(e){return e.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}}))})))}});t.a=o},,function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return a}));var i=jQuery,a=(lodash.throttle,function(){var e=document.querySelector("#sidebar-toggle");e&&(i(window).innerWidth()<=768||LP.Cookies.get("sidebar-toggle")?e.setAttribute("checked","checked"):e.removeAttribute("checked"),document.querySelector("#popup-course").addEventListener("click",(function(e){var t;"sidebar-toggle"===e.target.id&&(LP.Cookies.set("sidebar-toggle",!!e.target.checked),t=LP.Cookies.get("sidebar-toggle"),i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),t?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open"))}))),i("#learn-press-course-curriculum").find(".section-desc").each((function(e,t){var n=i('<span class="show-desc"></span>').on("click",(function(){r.toggleClass("c")})),r=i(t).siblings(".section-title").append(n)})),i(".section").each((function(){var e=i(this);e.find(".section-left").on("click",(function(){var t=e.toggleClass("closed").hasClass("closed"),n=LP.Cookies.get("closed-section-"+lpGlobalSettings.post_id)||[],o=parseInt(e.data("section-id")),i=n.findIndex((function(e){return e==o}));t?n.push(parseInt(e.data("section-id"))):n.splice(i,1),LP.Cookies.remove("closed-section-(.*)"),LP.Cookies.set("closed-section-"+lpGlobalSettings.post_id,r(new Set(n)))}))}))})},,,,,,,function(e,t){!function(){e.exports=this.LP.quiz}()},function(e,t){},,,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return g})),n.d(t,"initCourseTabs",(function(){return S})),n.d(t,"initCourseSidebar",(function(){return L})),n.d(t,"enrollCourse",(function(){return C}));var r=n(3),o=(n(15),n(16),n(8));function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(i,e);var t,n,r,o=c(i);function i(){return a(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){return React.createElement(React.Fragment,null)}}])&&l(t.prototype,n),r&&l(t,r),i}(r.Component);document.addEventListener("DOMContentLoaded",(function(){Object(o.a)()}));n(5);var p=n(6),v=n(2);function m(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,l,"next",e)}function l(e){h(i,r,o,a,l,"throw",e)}a(void 0)}))}}t.default=f;var g=function(){wp.element.render(React.createElement(f,null))},w=jQuery,S=function(){w("#learn-press-course-tabs").on("change",'input[name="learn-press-course-tab-radio"]',(function(e){var t=w('input[name="learn-press-course-tab-radio"]:checked').val();LP.Cookies.set("course-tab",t),w('label[for="'+w(e.target).attr("id")+'"]').closest("li").addClass("active").siblings().removeClass("active")}))},L=function(){var e=w(".course-summary-sidebar");if(e.length){var t=w(window),n=e.children(),r=e.offset(),o=e.height(),i=n.height(),a=32;t.on("scroll.fixed-course-sidebar",(function(){var l=t.scrollTop()-r.top+a;if(l<0)return e.removeClass("slide-top slide-down"),void n.css("top","");l>o-i?(e.removeClass("slide-down").addClass("slide-top"),n.css("top",o-i)):(e.removeClass("slide-top").addClass("slide-down"),n.css("top",a))})).trigger("scroll.fixed-course-sidebar")}},C=function(){var e=document.querySelectorAll("form.enroll-course");e.length>0&&e.forEach((function(e){var t=function(){var t=b(regeneratorRuntime.mark((function t(n,r){var o,i,a,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,wp.apiFetch({path:"lp/v1/courses/enroll-course",method:"POST",data:{id:n}});case 3:o=t.sent,r.classList.remove("loading"),r.disabled=!1,i=o.status,a=o.data.redirect,(l=o.message)&&i&&(r.style.display="none",e.innerHTML+='<div class="lp-enroll-notice '.concat(i,'">').concat(l,"</div>"),a&&(window.location.href=a)),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),form.innerHTML+='<div class="lp-enroll-notice error">'.concat(t.t0.message&&t.t0.message,"</div>");case 13:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,n){return t.apply(this,arguments)}}();e.addEventListener("submit",(function(n){n.preventDefault();var r=e.querySelector("input[name=enroll-course]").value,o=e.querySelector("button.button-enroll-course");o.classList.add("loading"),o.disabled=!0,t(r,o)}))})),null!==document.querySelector(".course-detail-info")&&window.addEventListener("pageshow",(function(e){(e.persisted||void 0!==window.performance&&"back_forward"==String(window.performance.getEntriesByType("navigation")[0].type))&&location.reload()}))},k=function(){var e=document.querySelectorAll(".lp-form-retake-course");e.length&&e.forEach((function(e){var t=e.querySelector(".button-retake-course"),n=e.querySelector("[name=retake-course]").value,r=e.querySelector(".lp-ajax-message");e.addEventListener("submit",(function(e){e.preventDefault()})),t.addEventListener("click",(function(e){var o;e.preventDefault(),t.classList.add("loading"),t.disabled=!0,o=t,wp.apiFetch({path:"/lp/v1/courses/retake-course",method:"POST",data:{id:n}}).then((function(e){var t=e.status,n=e.message,i=e.data;r.innerHTML=n,null!=t&&"success"===t?(o.style.display="none",setTimeout((function(){window.location.replace(i.url_redirect)}),1e3)):r.classList.add("error")})).catch((function(e){r.classList.add("error"),r.innerHTML="error: "+e.message})).then((function(){o.classList.remove("loading"),o.disabled=!1,r.style.display="block"}))}))}))};w(window).on("load",(function(){var e;w("#popup-course"),w("#learn-press-course-curriculum");m(document.querySelectorAll(".course-extra-box")).map((function(e){var t=e.querySelector(".course-extra-box__title");t.addEventListener("click",(function(){var n=t.nextElementSibling,r=document.querySelector(".course-extra-box.active");r&&!e.classList.contains("active")&&(r.classList.remove("active"),r.querySelector(".course-extra-box__content").style.display="none"),e.classList.contains("active")?(e.classList.remove("active"),n.style.display="none"):(e.classList.add("active"),n.style.display="block")}))})),S(),L(),C(),(e=document.querySelectorAll("form.purchase-course")).length>0&&e.forEach((function(e){var t=function(){document.querySelectorAll(".lp_allow_repuchase_select").forEach((function(t){for(var r=t.querySelectorAll("[name=_lp_allow_repurchase_type]"),o=0,i=r.length;o<i;o++)if(r[o].checked){var a=r[o].value,l=e.querySelector("input[name=purchase-course]").value,s=e.querySelector("button.button-purchase-course");s.classList.add("loading"),s.disabled=!0,n(l,s,a);break}}))},n=function(){var n=b(regeneratorRuntime.mark((function n(r,o){var i,a,l,s,c,u,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=m.length>2&&void 0!==m[2]&&m[2],n.prev=1,n.next=4,wp.apiFetch({path:"lp/v1/courses/purchase-course",method:"POST",data:{id:r,repurchaseType:i}});case 4:if(a=n.sent,o&&(o.classList.remove("loading"),o.disabled=!1),l=a.status,s=a.data,c=s.redirect,u=s.type,d=s.html,f=s.titlePopup,p=a.message,"allow_repurchase"!==u||"success"!==l){n.next=17;break}if(e.querySelector(".lp_allow_repuchase_select")){n.next=15;break}if(v.a.init()){n.next=11;break}return n.abrupt("return");case 11:v.a.elLPOverlay.show(),v.a.setTitleModal(f||""),v.a.setContentModal(d),v.a.callBackYes=function(){v.a.elLPOverlay.hide(),t()};case 15:n.next=18;break;case 17:p&&l&&(e.innerHTML+='<div class="lp-enroll-notice '.concat(l,'">').concat(p,"</div>"),"success"===l&&c&&(window.location.href=c));case 18:n.next=23;break;case 20:n.prev=20,n.t0=n.catch(1),e.innerHTML+='<div class="lp-enroll-notice error">'.concat(n.t0.message&&n.t0.message,"</div>");case 23:case"end":return n.stop()}}),n,null,[[1,20]])})));return function(e,t){return n.apply(this,arguments)}}();e.addEventListener("submit",(function(t){t.preventDefault();var r=e.querySelector("input[name=purchase-course]").value,o=e.querySelector("button.button-purchase-course");o.classList.add("loading"),o.disabled=!0,n(r,o)}))})),k(),function(){var e=document.querySelectorAll(".lp-course-progress-wrapper");if(e.length){if("IntersectionObserver"in window){var t=new IntersectionObserver((function(e,r){e.forEach((function(e){if(e.isIntersecting){var r=e.target;setTimeout((function(){n(r)}),600),t.unobserve(r)}}))}));m(e).map((function(e){return t.observe(e)}))}var n=function(){var e=b(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:"lp/v1/lazy-load/course-progress",method:"POST",data:{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}});case 2:n=e.sent,r=n.data,t.innerHTML=r;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}(),p.a.init()}))}]);
|
1 |
+
this.LP=this.LP||{},this.LP.singleCourse=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=26)}({15:function(e,t){!function(){e.exports=this.LP.quiz}()},16:function(e,t){},2:function(e,t,n){"use strict";var r=jQuery,o=null,i={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(o=this.elLPOverlay,this.elMainContent=o.find(".main-content"),this.elTitle=o.find(".modal-title"),this.elBtnYes=o.find(".btn-yes"),this.elBtnNo=o.find(".btn-no"),this.elFooter=o.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){o.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof i.callBackYes&&i.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}};t.a=i},26:function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return g})),n.d(t,"initCourseTabs",(function(){return S})),n.d(t,"initCourseSidebar",(function(){return L})),n.d(t,"enrollCourse",(function(){return C}));var r=n(3),o=(n(15),n(16),n(8));function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(i,e);var t,n,r,o=c(i);function i(){return a(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){return React.createElement(React.Fragment,null)}}])&&l(t.prototype,n),r&&l(t,r),i}(r.Component);document.addEventListener("DOMContentLoaded",(function(){Object(o.a)()}));n(5);var p=n(6),v=n(2);function m(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,l,"next",e)}function l(e){h(i,r,o,a,l,"throw",e)}a(void 0)}))}}t.default=f;var g=function(){wp.element.render(React.createElement(f,null))},w=jQuery,S=function(){w("#learn-press-course-tabs").on("change",'input[name="learn-press-course-tab-radio"]',(function(e){var t=w('input[name="learn-press-course-tab-radio"]:checked').val();LP.Cookies.set("course-tab",t),w('label[for="'+w(e.target).attr("id")+'"]').closest("li").addClass("active").siblings().removeClass("active")}))},L=function(){var e=w(".course-summary-sidebar");if(e.length){var t=w(window),n=e.children(),r=e.offset(),o=e.height(),i=n.height(),a=32;t.on("scroll.fixed-course-sidebar",(function(){var l=t.scrollTop()-r.top+a;if(l<0)return e.removeClass("slide-top slide-down"),void n.css("top","");l>o-i?(e.removeClass("slide-down").addClass("slide-top"),n.css("top",o-i)):(e.removeClass("slide-top").addClass("slide-down"),n.css("top",a))})).trigger("scroll.fixed-course-sidebar")}},C=function(){var e=document.querySelectorAll("form.enroll-course");e.length>0&&e.forEach((function(e){var t=function(){var t=b(regeneratorRuntime.mark((function t(n,r){var o,i,a,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,wp.apiFetch({path:"lp/v1/courses/enroll-course",method:"POST",data:{id:n}});case 3:o=t.sent,r.classList.remove("loading"),r.disabled=!1,i=o.status,a=o.data.redirect,(l=o.message)&&i&&(r.style.display="none",e.innerHTML+='<div class="lp-enroll-notice '.concat(i,'">').concat(l,"</div>"),a&&(window.location.href=a)),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),form.innerHTML+='<div class="lp-enroll-notice error">'.concat(t.t0.message&&t.t0.message,"</div>");case 13:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,n){return t.apply(this,arguments)}}();e.addEventListener("submit",(function(n){n.preventDefault();var r=e.querySelector("input[name=enroll-course]").value,o=e.querySelector("button.button-enroll-course");o.classList.add("loading"),o.disabled=!0,t(r,o)}))})),null!==document.querySelector(".course-detail-info")&&window.addEventListener("pageshow",(function(e){(e.persisted||void 0!==window.performance&&"back_forward"==String(window.performance.getEntriesByType("navigation")[0].type))&&location.reload()}))},k=function(){var e=document.querySelectorAll(".lp-form-retake-course");e.length&&e.forEach((function(e){var t=e.querySelector(".button-retake-course"),n=e.querySelector("[name=retake-course]").value,r=e.querySelector(".lp-ajax-message");e.addEventListener("submit",(function(e){e.preventDefault()})),t.addEventListener("click",(function(e){var o;e.preventDefault(),t.classList.add("loading"),t.disabled=!0,o=t,wp.apiFetch({path:"/lp/v1/courses/retake-course",method:"POST",data:{id:n}}).then((function(e){var t=e.status,n=e.message,i=e.data;r.innerHTML=n,null!=t&&"success"===t?(o.style.display="none",setTimeout((function(){window.location.replace(i.url_redirect)}),1e3)):r.classList.add("error")})).catch((function(e){r.classList.add("error"),r.innerHTML="error: "+e.message})).then((function(){o.classList.remove("loading"),o.disabled=!1,r.style.display="block"}))}))}))};w(window).on("load",(function(){var e;w("#popup-course"),w("#learn-press-course-curriculum");m(document.querySelectorAll(".course-extra-box")).map((function(e){var t=e.querySelector(".course-extra-box__title");t.addEventListener("click",(function(){var n=t.nextElementSibling,r=document.querySelector(".course-extra-box.active");r&&!e.classList.contains("active")&&(r.classList.remove("active"),r.querySelector(".course-extra-box__content").style.display="none"),e.classList.contains("active")?(e.classList.remove("active"),n.style.display="none"):(e.classList.add("active"),n.style.display="block")}))})),S(),L(),C(),(e=document.querySelectorAll("form.purchase-course")).length>0&&e.forEach((function(e){var t=function(){document.querySelectorAll(".lp_allow_repuchase_select").forEach((function(t){for(var r=t.querySelectorAll("[name=_lp_allow_repurchase_type]"),o=0,i=r.length;o<i;o++)if(r[o].checked){var a=r[o].value,l=e.querySelector("input[name=purchase-course]").value,s=e.querySelector("button.button-purchase-course");s.classList.add("loading"),s.disabled=!0,n(l,s,a);break}}))},n=function(){var n=b(regeneratorRuntime.mark((function n(r,o){var i,a,l,s,c,u,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=m.length>2&&void 0!==m[2]&&m[2],n.prev=1,n.next=4,wp.apiFetch({path:"lp/v1/courses/purchase-course",method:"POST",data:{id:r,repurchaseType:i}});case 4:if(a=n.sent,o&&(o.classList.remove("loading"),o.disabled=!1),l=a.status,s=a.data,c=s.redirect,u=s.type,d=s.html,f=s.titlePopup,p=a.message,"allow_repurchase"!==u||"success"!==l){n.next=17;break}if(e.querySelector(".lp_allow_repuchase_select")){n.next=15;break}if(v.a.init()){n.next=11;break}return n.abrupt("return");case 11:v.a.elLPOverlay.show(),v.a.setTitleModal(f||""),v.a.setContentModal(d),v.a.callBackYes=function(){v.a.elLPOverlay.hide(),t()};case 15:n.next=18;break;case 17:p&&l&&(e.innerHTML+='<div class="lp-enroll-notice '.concat(l,'">').concat(p,"</div>"),"success"===l&&c&&(window.location.href=c));case 18:n.next=23;break;case 20:n.prev=20,n.t0=n.catch(1),e.innerHTML+='<div class="lp-enroll-notice error">'.concat(n.t0.message&&n.t0.message,"</div>");case 23:case"end":return n.stop()}}),n,null,[[1,20]])})));return function(e,t){return n.apply(this,arguments)}}();e.addEventListener("submit",(function(t){t.preventDefault();var r=e.querySelector("input[name=purchase-course]").value,o=e.querySelector("button.button-purchase-course");o.classList.add("loading"),o.disabled=!0,n(r,o)}))})),k(),function(){var e=document.querySelectorAll(".lp-course-progress-wrapper");if(e.length){if("IntersectionObserver"in window){var t=new IntersectionObserver((function(e,r){e.forEach((function(e){if(e.isIntersecting){var r=e.target;setTimeout((function(){n(r)}),600),t.unobserve(r)}}))}));m(e).map((function(e){return t.observe(e)}))}var n=function(){var e=b(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:"lp/v1/lazy-load/course-progress",method:"POST",data:{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}});case 2:n=e.sent,r=n.data,t.innerHTML=r;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}(),p.a.init()}))},3:function(e,t){e.exports=window.wp.element},5:function(e,t){e.exports=window.wp.url},6:function(e,t,n){"use strict";var r=n(2),o=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){r.a.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((function(e){return e.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}}))})))}});t.a=o},8:function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return a}));var i=jQuery,a=(lodash.throttle,function(){var e=document.querySelector("#sidebar-toggle");e&&(i(window).innerWidth()<=768||LP.Cookies.get("sidebar-toggle")?e.setAttribute("checked","checked"):e.removeAttribute("checked"),document.querySelector("#popup-course").addEventListener("click",(function(e){var t;"sidebar-toggle"===e.target.id&&(LP.Cookies.set("sidebar-toggle",!!e.target.checked),t=LP.Cookies.get("sidebar-toggle"),i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),t?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open"))}))),i("#learn-press-course-curriculum").find(".section-desc").each((function(e,t){var n=i('<span class="show-desc"></span>').on("click",(function(){r.toggleClass("c")})),r=i(t).siblings(".section-title").append(n)})),i(".section").each((function(){var e=i(this);e.find(".section-left").on("click",(function(){var t=e.toggleClass("closed").hasClass("closed"),n=LP.Cookies.get("closed-section-"+lpGlobalSettings.post_id)||[],o=parseInt(e.data("section-id")),i=n.findIndex((function(e){return e==o}));t?n.push(parseInt(e.data("section-id"))):n.splice(i,1),LP.Cookies.remove("closed-section-(.*)"),LP.Cookies.set("closed-section-"+lpGlobalSettings.post_id,r(new Set(n)))}))}))})}});
|
@@ -82,21 +82,21 @@ this["LP"] = this["LP"] || {}; this["LP"]["singleCurriculum"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! exports provided: default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
100 |
var $ = jQuery;
|
101 |
|
102 |
var lpModalOverlayCompleteItem = {
|
@@ -149,19 +149,19 @@ var lpModalOverlayCompleteItem = {
|
|
149 |
|
150 |
/***/ }),
|
151 |
|
152 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
153 |
-
|
154 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
155 |
-
|
156 |
/*! exports provided: default, init */
|
157 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
158 |
|
159 |
"use strict";
|
160 |
__webpack_require__.r(__webpack_exports__);
|
161 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; });
|
162 |
-
/* harmony import */ var _single_curriculum_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./single-curriculum/index */ "../../../Clouds/Thimpress/Plugins/github.com/
|
163 |
-
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/
|
164 |
-
/* harmony import */ var _single_curriculum_scrolltoitem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./single-curriculum/scrolltoitem */ "../../../Clouds/Thimpress/Plugins/github.com/
|
165 |
var $ = jQuery;
|
166 |
|
167 |
|
@@ -178,10 +178,10 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
|
178 |
|
179 |
/***/ }),
|
180 |
|
181 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
182 |
-
|
183 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
184 |
-
|
185 |
/*! exports provided: commentForm */
|
186 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
187 |
|
@@ -236,10 +236,10 @@ var commentForm = function commentForm() {
|
|
236 |
|
237 |
/***/ }),
|
238 |
|
239 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
240 |
-
|
241 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
242 |
-
|
243 |
/*! no static exports found */
|
244 |
/***/ (function(module, exports) {
|
245 |
|
@@ -328,10 +328,10 @@ LP.Hook.addAction('lp-question-compatible-builder', function () {
|
|
328 |
|
329 |
/***/ }),
|
330 |
|
331 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
332 |
-
|
333 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
334 |
-
|
335 |
/*! exports provided: itemsProgress, getResponse */
|
336 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
337 |
|
@@ -341,7 +341,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
341 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getResponse", function() { return getResponse; });
|
342 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
343 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
|
344 |
-
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/
|
345 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
346 |
|
347 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
@@ -429,10 +429,10 @@ var getResponse = /*#__PURE__*/function () {
|
|
429 |
|
430 |
/***/ }),
|
431 |
|
432 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
433 |
-
|
434 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
435 |
-
|
436 |
/*! exports provided: progressBar */
|
437 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
438 |
|
@@ -456,10 +456,10 @@ var progressBar = function progressBar() {
|
|
456 |
|
457 |
/***/ }),
|
458 |
|
459 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
460 |
-
|
461 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
462 |
-
|
463 |
/*! exports provided: searchCourseContent */
|
464 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
465 |
|
@@ -547,10 +547,10 @@ var searchCourseContent = function searchCourseContent() {
|
|
547 |
|
548 |
/***/ }),
|
549 |
|
550 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
551 |
-
|
552 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
553 |
-
|
554 |
/*! exports provided: Sidebar */
|
555 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
556 |
|
@@ -638,10 +638,10 @@ var Sidebar = function Sidebar() {
|
|
638 |
|
639 |
/***/ }),
|
640 |
|
641 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
642 |
-
|
643 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
644 |
-
|
645 |
/*! exports provided: default */
|
646 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
647 |
|
@@ -649,12 +649,12 @@ var Sidebar = function Sidebar() {
|
|
649 |
__webpack_require__.r(__webpack_exports__);
|
650 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
651 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
652 |
-
/* harmony import */ var _components_search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/search */ "../../../Clouds/Thimpress/Plugins/github.com/
|
653 |
-
/* harmony import */ var _components_sidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/sidebar */ "../../../Clouds/Thimpress/Plugins/github.com/
|
654 |
-
/* harmony import */ var _components_progress__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/progress */ "../../../Clouds/Thimpress/Plugins/github.com/
|
655 |
-
/* harmony import */ var _components_comment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/comment */ "../../../Clouds/Thimpress/Plugins/github.com/
|
656 |
-
/* harmony import */ var _components_items_progress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/items-progress */ "../../../Clouds/Thimpress/Plugins/github.com/
|
657 |
-
/* harmony import */ var _components_compatible__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/compatible */ "../../../Clouds/Thimpress/Plugins/github.com/
|
658 |
/* harmony import */ var _components_compatible__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_components_compatible__WEBPACK_IMPORTED_MODULE_6__);
|
659 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
660 |
|
@@ -740,16 +740,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
740 |
|
741 |
/***/ }),
|
742 |
|
743 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
744 |
-
|
745 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
746 |
-
|
747 |
/*! exports provided: default */
|
748 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
749 |
|
750 |
"use strict";
|
751 |
__webpack_require__.r(__webpack_exports__);
|
752 |
-
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/
|
753 |
|
754 |
var $ = jQuery;
|
755 |
var scrollToItemCurrent = {
|
@@ -795,10 +795,10 @@ var scrollToItemCurrent = {
|
|
795 |
|
796 |
/***/ }),
|
797 |
|
798 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
799 |
-
|
800 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
801 |
-
|
802 |
/*! exports provided: default */
|
803 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
804 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js":
|
91 |
+
/*!*******************************************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js ***!
|
93 |
+
\*******************************************************************************************************************************************************/
|
94 |
/*! exports provided: default */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
97 |
"use strict";
|
98 |
__webpack_require__.r(__webpack_exports__);
|
99 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
100 |
var $ = jQuery;
|
101 |
|
102 |
var lpModalOverlayCompleteItem = {
|
149 |
|
150 |
/***/ }),
|
151 |
|
152 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum.js":
|
153 |
+
/*!*******************************************************************************************************************************************!*\
|
154 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum.js ***!
|
155 |
+
\*******************************************************************************************************************************************/
|
156 |
/*! exports provided: default, init */
|
157 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
158 |
|
159 |
"use strict";
|
160 |
__webpack_require__.r(__webpack_exports__);
|
161 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; });
|
162 |
+
/* harmony import */ var _single_curriculum_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./single-curriculum/index */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/index.js");
|
163 |
+
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js");
|
164 |
+
/* harmony import */ var _single_curriculum_scrolltoitem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./single-curriculum/scrolltoitem */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js");
|
165 |
var $ = jQuery;
|
166 |
|
167 |
|
178 |
|
179 |
/***/ }),
|
180 |
|
181 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/comment.js":
|
182 |
+
/*!**************************************************************************************************************************************************************!*\
|
183 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/comment.js ***!
|
184 |
+
\**************************************************************************************************************************************************************/
|
185 |
/*! exports provided: commentForm */
|
186 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
187 |
|
236 |
|
237 |
/***/ }),
|
238 |
|
239 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/compatible.js":
|
240 |
+
/*!*****************************************************************************************************************************************************************!*\
|
241 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/compatible.js ***!
|
242 |
+
\*****************************************************************************************************************************************************************/
|
243 |
/*! no static exports found */
|
244 |
/***/ (function(module, exports) {
|
245 |
|
328 |
|
329 |
/***/ }),
|
330 |
|
331 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/items-progress.js":
|
332 |
+
/*!*********************************************************************************************************************************************************************!*\
|
333 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/items-progress.js ***!
|
334 |
+
\*********************************************************************************************************************************************************************/
|
335 |
/*! exports provided: itemsProgress, getResponse */
|
336 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
337 |
|
341 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getResponse", function() { return getResponse; });
|
342 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
343 |
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
|
344 |
+
/* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../show-lp-overlay-complete-item */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/show-lp-overlay-complete-item.js");
|
345 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
346 |
|
347 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
429 |
|
430 |
/***/ }),
|
431 |
|
432 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/progress.js":
|
433 |
+
/*!***************************************************************************************************************************************************************!*\
|
434 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/progress.js ***!
|
435 |
+
\***************************************************************************************************************************************************************/
|
436 |
/*! exports provided: progressBar */
|
437 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
438 |
|
456 |
|
457 |
/***/ }),
|
458 |
|
459 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/search.js":
|
460 |
+
/*!*************************************************************************************************************************************************************!*\
|
461 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/search.js ***!
|
462 |
+
\*************************************************************************************************************************************************************/
|
463 |
/*! exports provided: searchCourseContent */
|
464 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
465 |
|
547 |
|
548 |
/***/ }),
|
549 |
|
550 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/sidebar.js":
|
551 |
+
/*!**************************************************************************************************************************************************************!*\
|
552 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/sidebar.js ***!
|
553 |
+
\**************************************************************************************************************************************************************/
|
554 |
/*! exports provided: Sidebar */
|
555 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
556 |
|
638 |
|
639 |
/***/ }),
|
640 |
|
641 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/index.js":
|
642 |
+
/*!*************************************************************************************************************************************************!*\
|
643 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/index.js ***!
|
644 |
+
\*************************************************************************************************************************************************/
|
645 |
/*! exports provided: default */
|
646 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
647 |
|
649 |
__webpack_require__.r(__webpack_exports__);
|
650 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
651 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
652 |
+
/* harmony import */ var _components_search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/search */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/search.js");
|
653 |
+
/* harmony import */ var _components_sidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/sidebar */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/sidebar.js");
|
654 |
+
/* harmony import */ var _components_progress__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/progress */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/progress.js");
|
655 |
+
/* harmony import */ var _components_comment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/comment */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/comment.js");
|
656 |
+
/* harmony import */ var _components_items_progress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/items-progress */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/items-progress.js");
|
657 |
+
/* harmony import */ var _components_compatible__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/compatible */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/components/compatible.js");
|
658 |
/* harmony import */ var _components_compatible__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_components_compatible__WEBPACK_IMPORTED_MODULE_6__);
|
659 |
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
660 |
|
740 |
|
741 |
/***/ }),
|
742 |
|
743 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js":
|
744 |
+
/*!********************************************************************************************************************************************************!*\
|
745 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js ***!
|
746 |
+
\********************************************************************************************************************************************************/
|
747 |
/*! exports provided: default */
|
748 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
749 |
|
750 |
"use strict";
|
751 |
__webpack_require__.r(__webpack_exports__);
|
752 |
+
/* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
|
753 |
|
754 |
var $ = jQuery;
|
755 |
var scrollToItemCurrent = {
|
795 |
|
796 |
/***/ }),
|
797 |
|
798 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
|
799 |
+
/*!***************************************************************************************************************************************!*\
|
800 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
|
801 |
+
\***************************************************************************************************************************************/
|
802 |
/*! exports provided: default */
|
803 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
804 |
|
@@ -1 +1 @@
|
|
1 |
-
this.LP=this.LP||{},this.LP.singleCurriculum=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=23)}([,,function(e,t,n){"use strict";var r=jQuery,o=null,i={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(o=this.elLPOverlay,this.elMainContent=o.find(".main-content"),this.elTitle=o.find(".modal-title"),this.elBtnYes=o.find(".btn-yes"),this.elBtnNo=o.find(".btn-no"),this.elFooter=o.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){o.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof i.callBackYes&&i.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}};t.a=i},function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";var r=n(2),o=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){r.a.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((function(e){return e.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}}))})))}});t.a=o},,function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return l}));var i=jQuery,l=(lodash.throttle,function(){var e=document.querySelector("#sidebar-toggle");e&&(i(window).innerWidth()<=768||LP.Cookies.get("sidebar-toggle")?e.setAttribute("checked","checked"):e.removeAttribute("checked"),document.querySelector("#popup-course").addEventListener("click",(function(e){var t;"sidebar-toggle"===e.target.id&&(LP.Cookies.set("sidebar-toggle",!!e.target.checked),t=LP.Cookies.get("sidebar-toggle"),i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),t?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open"))}))),i("#learn-press-course-curriculum").find(".section-desc").each((function(e,t){var n=i('<span class="show-desc"></span>').on("click",(function(){r.toggleClass("c")})),r=i(t).siblings(".section-title").append(n)})),i(".section").each((function(){var e=i(this);e.find(".section-left").on("click",(function(){var t=e.toggleClass("closed").hasClass("closed"),n=LP.Cookies.get("closed-section-"+lpGlobalSettings.post_id)||[],o=parseInt(e.data("section-id")),i=n.findIndex((function(e){return e==o}));t?n.push(parseInt(e.data("section-id"))):n.splice(i,1),LP.Cookies.remove("closed-section-(.*)"),LP.Cookies.set("closed-section-"+lpGlobalSettings.post_id,r(new Set(n)))}))}))})},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return a}));var r=n(5),o=n(6);function i(e,t,n,r,o,i,l){try{var c=e[i](l),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u=function(){var e=document.querySelectorAll(".popup-header__inner");if(e.length&&null===document.querySelector("#learn-press-quiz-app div.quiz-result")&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting){var n=e.target;a(n),t.unobserve(n)}}))}));l(e).map((function(e){return t.observe(e)}))}},a=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:Object(r.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"});case 2:n=e.sent,i=n.data,t.innerHTML+=i,o.a.init();case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var l=e.apply(t,n);function c(e){i(l,r,o,c,u,"next",e)}function u(e){i(l,r,o,c,u,"throw",e)}c(void 0)}))});return function(e){return t.apply(this,arguments)}}()},,function(e,t){function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}LP.Hook.addAction("lp-compatible-builder",(function(){LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&n(document.querySelectorAll("#popup-content"))[0].addEventListener("scroll",(function(){Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&n(document.querySelectorAll("#popup-content"))[0].addEventListener("scroll",(function(){VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(function(){return LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0})),LP.Hook.addAction("lp-question-compatible-builder",(function(){return LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0}))},,,,,,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return g}));var r=n(3),o=n(8),i=jQuery,l=n(9);n(11);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var o=p(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}jQuery;var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(i,e);var t,n,r,o=f(i);function i(){return u(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"checkCourseDurationExpire",value:function(){var e=document.getElementsByName("lp-course-timestamp-remaining");if(e.length){var t=e[0].value;t<86400&&setTimeout((function(){window.location.reload(!0)}),1e3*t)}}},{key:"render",value:function(){return React.createElement("div",null)}}])&&a(t.prototype,n),r&&a(t,r),i}(r.Component),y=m;document.addEventListener("DOMContentLoaded",(function(){LP.Hook.doAction("lp-compatible-builder"),function(){var e=document.querySelector("#popup-course"),t=document.querySelector("#learn-press-course-curriculum");if(e&&t){var n=t.querySelector(".curriculum-sections"),r=e.querySelector(".search-course"),o=e.querySelector('.search-course input[type="text"]');if(!o||!n||!r)return;var i=n.querySelectorAll("li.section"),l=n.querySelectorAll("li.course-item"),c=[];l.forEach((function(e){var t=e.dataset.id,n=e.querySelector(".item-name");c.push({id:t,name:n?n.textContent.toLowerCase():""})}));var u=function(e){e.preventDefault();var t=o.value;r.classList.add("searching"),t||r.classList.remove("searching");var n=[];c.forEach((function(e){t&&!e.name.match(t.toLowerCase())||(n.push(e.id),l.forEach((function(e){-1!==n.indexOf(e.dataset.id)?e.classList.remove("hide-if-js"):e.classList.add("hide-if-js")})))})),i.forEach((function(e){var t=e.querySelectorAll(".course-item"),r=[];t.forEach((function(e){n.includes(e.dataset.id)&&r.push(e.dataset.id)})),0===r.length?e.classList.add("hide-if-js"):e.classList.remove("hide-if-js")}))},a=r.querySelector(".clear");a&&a.addEventListener("click",(function(e){e.preventDefault(),o.value="",u(e)})),r.addEventListener("submit",u),o.addEventListener("keyup",u)}}(),Object(o.a)(),i(".learn-press-progress").each((function(){var e=i(this).find(".learn-press-progress__active"),t=e.data("value");void 0!==t&&e.css("left",-(100-parseInt(t))+"%")})),Object(l.b)(),(new m).checkCourseDurationExpire()}));var v=n(6),h=(n(2),jQuery),b={init:function(){this.scrollToItemViewing=function(){var e=h(".viewing-course-item");if(e.length){var t=h("#learn-press-course-curriculum"),n=(h("#popup-sidebar").outerHeight(),h(".section-title").outerHeight(),h(".section-header").outerHeight()),r=new RegExp("^viewing-course-item-([0-9].*)"),o=e.attr("class").split(/\s+/),i=0;if(h.each(o,(function(e,t){var n=r.exec(t);if(n)return i=n[1],!1})),0===i)return;var l=h(".course-item-"+i),c=(l.offset().top,l.offset().top-t.offset().top+t.scrollTop());t.animate({scrollTop:c-n},800)}},this.scrollToItemViewing()}},g=(jQuery,t.default=y,function(){wp.element.render(React.createElement(y,null),document.getElementById("learn-press-course-curriculum"))});document.addEventListener("DOMContentLoaded",(function(e){LP.Hook.doAction("course-ready"),v.a.init(),b.init()}))}]);
|
1 |
+
this.LP=this.LP||{},this.LP.singleCurriculum=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=24)}([,,function(e,t,n){"use strict";var r=jQuery,o=null,i={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){return!!this.instance||(this.elLPOverlay=r(".lp-overlay"),!!this.elLPOverlay.length&&(o=this.elLPOverlay,this.elMainContent=o.find(".main-content"),this.elTitle=o.find(".modal-title"),this.elBtnYes=o.find(".btn-yes"),this.elBtnNo=o.find(".btn-no"),this.elFooter=o.find(".lp-modal-footer"),r(document).on("click",".close, .btn-no",(function(){o.hide()})),r(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof i.callBackYes&&i.callBackYes()})),this.instance=this,!0))},setElCalledModal:function(e){this.elCalledModal=e},setContentModal:function(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal:function(e){this.elTitle.html(e)}};t.a=i},function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";var r=n(2),o=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){r.a.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((function(e){return e.addEventListener("click",(function(e){e.preventDefault();var t=e.target.closest("form");r.a.elLPOverlay.show(),r.a.setTitleModal(t.dataset.title),r.a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),r.a.callBackYes=function(){t.submit()}}))})))}});t.a=o},,function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return l}));var i=jQuery,l=(lodash.throttle,function(){var e=document.querySelector("#sidebar-toggle");e&&(i(window).innerWidth()<=768||LP.Cookies.get("sidebar-toggle")?e.setAttribute("checked","checked"):e.removeAttribute("checked"),document.querySelector("#popup-course").addEventListener("click",(function(e){var t;"sidebar-toggle"===e.target.id&&(LP.Cookies.set("sidebar-toggle",!!e.target.checked),t=LP.Cookies.get("sidebar-toggle"),i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),t?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open"))}))),i("#learn-press-course-curriculum").find(".section-desc").each((function(e,t){var n=i('<span class="show-desc"></span>').on("click",(function(){r.toggleClass("c")})),r=i(t).siblings(".section-title").append(n)})),i(".section").each((function(){var e=i(this);e.find(".section-left").on("click",(function(){var t=e.toggleClass("closed").hasClass("closed"),n=LP.Cookies.get("closed-section-"+lpGlobalSettings.post_id)||[],o=parseInt(e.data("section-id")),i=n.findIndex((function(e){return e==o}));t?n.push(parseInt(e.data("section-id"))):n.splice(i,1),LP.Cookies.remove("closed-section-(.*)"),LP.Cookies.set("closed-section-"+lpGlobalSettings.post_id,r(new Set(n)))}))}))})},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return a}));var r=n(5),o=n(6);function i(e,t,n,r,o,i,l){try{var c=e[i](l),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u=function(){var e=document.querySelectorAll(".popup-header__inner");if(e.length&&null===document.querySelector("#learn-press-quiz-app div.quiz-result")&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting){var n=e.target;a(n),t.unobserve(n)}}))}));l(e).map((function(e){return t.observe(e)}))}},a=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:Object(r.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"});case 2:n=e.sent,i=n.data,t.innerHTML+=i,o.a.init();case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var l=e.apply(t,n);function c(e){i(l,r,o,c,u,"next",e)}function u(e){i(l,r,o,c,u,"throw",e)}c(void 0)}))});return function(e){return t.apply(this,arguments)}}()},,function(e,t){function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}LP.Hook.addAction("lp-compatible-builder",(function(){LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&n(document.querySelectorAll("#popup-content"))[0].addEventListener("scroll",(function(){Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&n(document.querySelectorAll("#popup-content"))[0].addEventListener("scroll",(function(){VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(function(){return LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0})),LP.Hook.addAction("lp-question-compatible-builder",(function(){return LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0}))},,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return g}));var r=n(3),o=n(8),i=jQuery,l=n(9);n(11);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var o=p(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}jQuery;var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(i,e);var t,n,r,o=f(i);function i(){return u(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"checkCourseDurationExpire",value:function(){var e=document.getElementsByName("lp-course-timestamp-remaining");if(e.length){var t=e[0].value;t<86400&&setTimeout((function(){window.location.reload(!0)}),1e3*t)}}},{key:"render",value:function(){return React.createElement("div",null)}}])&&a(t.prototype,n),r&&a(t,r),i}(r.Component),y=m;document.addEventListener("DOMContentLoaded",(function(){LP.Hook.doAction("lp-compatible-builder"),function(){var e=document.querySelector("#popup-course"),t=document.querySelector("#learn-press-course-curriculum");if(e&&t){var n=t.querySelector(".curriculum-sections"),r=e.querySelector(".search-course"),o=e.querySelector('.search-course input[type="text"]');if(!o||!n||!r)return;var i=n.querySelectorAll("li.section"),l=n.querySelectorAll("li.course-item"),c=[];l.forEach((function(e){var t=e.dataset.id,n=e.querySelector(".item-name");c.push({id:t,name:n?n.textContent.toLowerCase():""})}));var u=function(e){e.preventDefault();var t=o.value;r.classList.add("searching"),t||r.classList.remove("searching");var n=[];c.forEach((function(e){t&&!e.name.match(t.toLowerCase())||(n.push(e.id),l.forEach((function(e){-1!==n.indexOf(e.dataset.id)?e.classList.remove("hide-if-js"):e.classList.add("hide-if-js")})))})),i.forEach((function(e){var t=e.querySelectorAll(".course-item"),r=[];t.forEach((function(e){n.includes(e.dataset.id)&&r.push(e.dataset.id)})),0===r.length?e.classList.add("hide-if-js"):e.classList.remove("hide-if-js")}))},a=r.querySelector(".clear");a&&a.addEventListener("click",(function(e){e.preventDefault(),o.value="",u(e)})),r.addEventListener("submit",u),o.addEventListener("keyup",u)}}(),Object(o.a)(),i(".learn-press-progress").each((function(){var e=i(this).find(".learn-press-progress__active"),t=e.data("value");void 0!==t&&e.css("left",-(100-parseInt(t))+"%")})),Object(l.b)(),(new m).checkCourseDurationExpire()}));var v=n(6),h=(n(2),jQuery),b={init:function(){this.scrollToItemViewing=function(){var e=h(".viewing-course-item");if(e.length){var t=h("#learn-press-course-curriculum"),n=(h("#popup-sidebar").outerHeight(),h(".section-title").outerHeight(),h(".section-header").outerHeight()),r=new RegExp("^viewing-course-item-([0-9].*)"),o=e.attr("class").split(/\s+/),i=0;if(h.each(o,(function(e,t){var n=r.exec(t);if(n)return i=n[1],!1})),0===i)return;var l=h(".course-item-"+i),c=(l.offset().top,l.offset().top-t.offset().top+t.scrollTop());t.animate({scrollTop:c-n},800)}},this.scrollToItemViewing()}},g=(jQuery,t.default=y,function(){wp.element.render(React.createElement(y,null),document.getElementById("learn-press-course-curriculum"))});document.addEventListener("DOMContentLoaded",(function(e){LP.Hook.doAction("course-ready"),v.a.init(),b.init()}))}]);
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
this["LP"] = this["LP"] || {}; this["LP"]["widgets"] =
|
2 |
+
/******/ (function(modules) { // webpackBootstrap
|
3 |
+
/******/ // The module cache
|
4 |
+
/******/ var installedModules = {};
|
5 |
+
/******/
|
6 |
+
/******/ // The require function
|
7 |
+
/******/ function __webpack_require__(moduleId) {
|
8 |
+
/******/
|
9 |
+
/******/ // Check if module is in cache
|
10 |
+
/******/ if(installedModules[moduleId]) {
|
11 |
+
/******/ return installedModules[moduleId].exports;
|
12 |
+
/******/ }
|
13 |
+
/******/ // Create a new module (and put it into the cache)
|
14 |
+
/******/ var module = installedModules[moduleId] = {
|
15 |
+
/******/ i: moduleId,
|
16 |
+
/******/ l: false,
|
17 |
+
/******/ exports: {}
|
18 |
+
/******/ };
|
19 |
+
/******/
|
20 |
+
/******/ // Execute the module function
|
21 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
+
/******/
|
23 |
+
/******/ // Flag the module as loaded
|
24 |
+
/******/ module.l = true;
|
25 |
+
/******/
|
26 |
+
/******/ // Return the exports of the module
|
27 |
+
/******/ return module.exports;
|
28 |
+
/******/ }
|
29 |
+
/******/
|
30 |
+
/******/
|
31 |
+
/******/ // expose the modules object (__webpack_modules__)
|
32 |
+
/******/ __webpack_require__.m = modules;
|
33 |
+
/******/
|
34 |
+
/******/ // expose the module cache
|
35 |
+
/******/ __webpack_require__.c = installedModules;
|
36 |
+
/******/
|
37 |
+
/******/ // define getter function for harmony exports
|
38 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
39 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
40 |
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
41 |
+
/******/ }
|
42 |
+
/******/ };
|
43 |
+
/******/
|
44 |
+
/******/ // define __esModule on exports
|
45 |
+
/******/ __webpack_require__.r = function(exports) {
|
46 |
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
47 |
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
48 |
+
/******/ }
|
49 |
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
50 |
+
/******/ };
|
51 |
+
/******/
|
52 |
+
/******/ // create a fake namespace object
|
53 |
+
/******/ // mode & 1: value is a module id, require it
|
54 |
+
/******/ // mode & 2: merge all properties of value into the ns
|
55 |
+
/******/ // mode & 4: return value when already ns object
|
56 |
+
/******/ // mode & 8|1: behave like require
|
57 |
+
/******/ __webpack_require__.t = function(value, mode) {
|
58 |
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
59 |
+
/******/ if(mode & 8) return value;
|
60 |
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
61 |
+
/******/ var ns = Object.create(null);
|
62 |
+
/******/ __webpack_require__.r(ns);
|
63 |
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
64 |
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
65 |
+
/******/ return ns;
|
66 |
+
/******/ };
|
67 |
+
/******/
|
68 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
69 |
+
/******/ __webpack_require__.n = function(module) {
|
70 |
+
/******/ var getter = module && module.__esModule ?
|
71 |
+
/******/ function getDefault() { return module['default']; } :
|
72 |
+
/******/ function getModuleExports() { return module; };
|
73 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
74 |
+
/******/ return getter;
|
75 |
+
/******/ };
|
76 |
+
/******/
|
77 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
78 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
79 |
+
/******/
|
80 |
+
/******/ // __webpack_public_path__
|
81 |
+
/******/ __webpack_require__.p = "";
|
82 |
+
/******/
|
83 |
+
/******/
|
84 |
+
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/widgets.js");
|
86 |
+
/******/ })
|
87 |
+
/************************************************************************/
|
88 |
+
/******/ ({
|
89 |
+
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/widgets.js":
|
91 |
+
/*!*********************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/frontend/widgets.js ***!
|
93 |
+
\*********************************************************************************************************************************/
|
94 |
+
/*! no exports provided */
|
95 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
+
|
97 |
+
"use strict";
|
98 |
+
__webpack_require__.r(__webpack_exports__);
|
99 |
+
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
100 |
+
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
|
101 |
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
102 |
+
|
103 |
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
104 |
+
|
105 |
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
106 |
+
|
107 |
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
108 |
+
|
109 |
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
110 |
+
|
111 |
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
112 |
+
|
113 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
114 |
+
|
115 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
116 |
+
|
117 |
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
118 |
+
|
119 |
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
120 |
+
|
121 |
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
function widgetRestAPI() {
|
126 |
+
var widgets = document.querySelectorAll('.learnpress-widget-wrapper');
|
127 |
+
|
128 |
+
if (!widgets.length) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
|
132 |
+
var getResponse = /*#__PURE__*/function () {
|
133 |
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ele) {
|
134 |
+
var widget, response, data, status, message;
|
135 |
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
136 |
+
while (1) {
|
137 |
+
switch (_context.prev = _context.next) {
|
138 |
+
case 0:
|
139 |
+
widget = ele.dataset.widget ? JSON.parse(ele.dataset.widget) : '';
|
140 |
+
_context.next = 3;
|
141 |
+
return wp.apiFetch({
|
142 |
+
path: 'lp/v1/widgets/api',
|
143 |
+
method: 'POST',
|
144 |
+
data: _objectSpread({}, widget)
|
145 |
+
});
|
146 |
+
|
147 |
+
case 3:
|
148 |
+
response = _context.sent;
|
149 |
+
data = response.data, status = response.status, message = response.message;
|
150 |
+
|
151 |
+
if (data && status === 'success') {
|
152 |
+
ele.insertAdjacentHTML('afterbegin', data);
|
153 |
+
} else if (message) {
|
154 |
+
ele.insertAdjacentHTML('afterbegin', "<div class=\"lp-ajax-message error\" style=\"display:block\">".concat(message, "</div>"));
|
155 |
+
}
|
156 |
+
|
157 |
+
delete ele.dataset.widget;
|
158 |
+
ele.querySelector('.lp-skeleton-animation').remove();
|
159 |
+
|
160 |
+
case 8:
|
161 |
+
case "end":
|
162 |
+
return _context.stop();
|
163 |
+
}
|
164 |
+
}
|
165 |
+
}, _callee);
|
166 |
+
}));
|
167 |
+
|
168 |
+
return function getResponse(_x) {
|
169 |
+
return _ref.apply(this, arguments);
|
170 |
+
};
|
171 |
+
}();
|
172 |
+
|
173 |
+
if ('IntersectionObserver' in window) {
|
174 |
+
var eleObserver = new IntersectionObserver(function (entries, observer) {
|
175 |
+
entries.forEach(function (entry) {
|
176 |
+
if (entry.isIntersecting) {
|
177 |
+
var ele = entry.target;
|
178 |
+
getResponse(ele);
|
179 |
+
eleObserver.unobserve(ele);
|
180 |
+
}
|
181 |
+
});
|
182 |
+
});
|
183 |
+
|
184 |
+
_toConsumableArray(widgets).map(function (ele) {
|
185 |
+
return ele.classList.contains('learnpress-widget-wrapper__restapi') && eleObserver.observe(ele);
|
186 |
+
});
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
document.addEventListener('DOMContentLoaded', function (event) {
|
191 |
+
widgetRestAPI();
|
192 |
+
});
|
193 |
+
|
194 |
+
/***/ }),
|
195 |
+
|
196 |
+
/***/ "@wordpress/url":
|
197 |
+
/*!*****************************!*\
|
198 |
+
!*** external ["wp","url"] ***!
|
199 |
+
\*****************************/
|
200 |
+
/*! no static exports found */
|
201 |
+
/***/ (function(module, exports) {
|
202 |
+
|
203 |
+
(function() { module.exports = window["wp"]["url"]; }());
|
204 |
+
|
205 |
+
/***/ })
|
206 |
+
|
207 |
+
/******/ });
|
208 |
+
//# sourceMappingURL=widgets.js.map
|
@@ -0,0 +1 @@
|
|
|
1 |
+
this.LP=this.LP||{},this.LP.widgets=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}({20:function(e,t,r){"use strict";r.r(t);r(5);function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function s(){var e=document.querySelectorAll(".learnpress-widget-wrapper");if(e.length){var t=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n,o,i,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.dataset.widget?JSON.parse(t.dataset.widget):"",e.next=3,wp.apiFetch({path:"lp/v1/widgets/api",method:"POST",data:a({},r)});case 3:n=e.sent,o=n.data,i=n.status,u=n.message,o&&"success"===i?t.insertAdjacentHTML("afterbegin",o):u&&t.insertAdjacentHTML("afterbegin",'<div class="lp-ajax-message error" style="display:block">'.concat(u,"</div>")),delete t.dataset.widget,t.querySelector(".lp-skeleton-animation").remove();case 8:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();if("IntersectionObserver"in window){var r=new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting){var n=e.target;t(n),r.unobserve(n)}}))}));n(e).map((function(e){return e.classList.contains("learnpress-widget-wrapper__restapi")&&r.observe(e)}))}}}document.addEventListener("DOMContentLoaded",(function(e){s()}))},5:function(e,t){e.exports=window.wp.url}});
|
@@ -82,15 +82,15 @@ this["LP"] = this["LP"] || {}; this["LP"]["dataControls"] =
|
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
-
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
91 |
-
|
92 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
93 |
-
|
94 |
/*! exports provided: apiFetch, select, dispatch, controls */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
82 |
/******/
|
83 |
/******/
|
84 |
/******/ // Load entry module and return exports
|
85 |
+
/******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/data-controls.js");
|
86 |
/******/ })
|
87 |
/************************************************************************/
|
88 |
/******/ ({
|
89 |
|
90 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/data-controls.js":
|
91 |
+
/*!******************************************************************************************************************************!*\
|
92 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/apps/js/data-controls.js ***!
|
93 |
+
\******************************************************************************************************************************/
|
94 |
/*! exports provided: apiFetch, select, dispatch, controls */
|
95 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
96 |
|
@@ -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/
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
90 |
-
|
91 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
92 |
-
|
93 |
/*! exports provided: default */
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
@@ -157,10 +157,10 @@ var Cookies = {
|
|
157 |
|
158 |
/***/ }),
|
159 |
|
160 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
161 |
-
|
162 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
163 |
-
|
164 |
/*! exports provided: default */
|
165 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
166 |
|
@@ -276,10 +276,10 @@ var Event_Callback = function Event_Callback(self) {
|
|
276 |
|
277 |
/***/ }),
|
278 |
|
279 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
280 |
-
|
281 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
282 |
-
|
283 |
/*! exports provided: default */
|
284 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
285 |
|
@@ -298,10 +298,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
298 |
|
299 |
/***/ }),
|
300 |
|
301 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
302 |
-
|
303 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
304 |
-
|
305 |
/*! exports provided: default */
|
306 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
307 |
|
@@ -346,10 +346,10 @@ var exp;
|
|
346 |
|
347 |
/***/ }),
|
348 |
|
349 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
350 |
-
|
351 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
352 |
-
|
353 |
/*! exports provided: default */
|
354 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
355 |
|
@@ -449,10 +449,10 @@ var Hook = {
|
|
449 |
|
450 |
/***/ }),
|
451 |
|
452 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
453 |
-
|
454 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
455 |
-
|
456 |
/*! exports provided: default */
|
457 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
458 |
|
@@ -485,27 +485,27 @@ var IframeSubmit = function IframeSubmit(form) {
|
|
485 |
|
486 |
/***/ }),
|
487 |
|
488 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
489 |
-
|
490 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
491 |
-
|
492 |
/*! exports provided: default */
|
493 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
494 |
|
495 |
"use strict";
|
496 |
__webpack_require__.r(__webpack_exports__);
|
497 |
-
/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extend */ "../../../Clouds/Thimpress/Plugins/github.com/
|
498 |
-
/* harmony import */ var _fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fn */ "../../../Clouds/Thimpress/Plugins/github.com/
|
499 |
-
/* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quick-tip */ "../../../Clouds/Thimpress/Plugins/github.com/
|
500 |
/* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_quick_tip__WEBPACK_IMPORTED_MODULE_2__);
|
501 |
-
/* harmony import */ var _message_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./message-box */ "../../../Clouds/Thimpress/Plugins/github.com/
|
502 |
-
/* harmony import */ var _event_callback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-callback */ "../../../Clouds/Thimpress/Plugins/github.com/
|
503 |
-
/* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hook */ "../../../Clouds/Thimpress/Plugins/github.com/
|
504 |
-
/* harmony import */ var _cookies__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cookies */ "../../../Clouds/Thimpress/Plugins/github.com/
|
505 |
-
/* harmony import */ var _local_storage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./local-storage */ "../../../Clouds/Thimpress/Plugins/github.com/
|
506 |
-
/* harmony import */ var _jquery_plugins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./jquery.plugins */ "../../../Clouds/Thimpress/Plugins/github.com/
|
507 |
-
/* harmony import */ var _iframe_submit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iframe-submit */ "../../../Clouds/Thimpress/Plugins/github.com/
|
508 |
-
/* harmony import */ var _show_password__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./show-password */ "../../../Clouds/Thimpress/Plugins/github.com/
|
509 |
/* harmony import */ var _show_password__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_show_password__WEBPACK_IMPORTED_MODULE_10__);
|
510 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
511 |
|
@@ -1122,10 +1122,10 @@ Object(_extend__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread({
|
|
1122 |
|
1123 |
/***/ }),
|
1124 |
|
1125 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1126 |
-
|
1127 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1128 |
-
|
1129 |
/*! exports provided: default */
|
1130 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1131 |
|
@@ -1357,10 +1357,10 @@ $.fn.progress = progress;
|
|
1357 |
|
1358 |
/***/ }),
|
1359 |
|
1360 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1361 |
-
|
1362 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1363 |
-
|
1364 |
/*! exports provided: default */
|
1365 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1366 |
|
@@ -1407,10 +1407,10 @@ var _localStorage = {
|
|
1407 |
|
1408 |
/***/ }),
|
1409 |
|
1410 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1411 |
-
|
1412 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1413 |
-
|
1414 |
/*! exports provided: default */
|
1415 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1416 |
|
@@ -1686,10 +1686,10 @@ var MessageBox = {
|
|
1686 |
|
1687 |
/***/ }),
|
1688 |
|
1689 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1690 |
-
|
1691 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1692 |
-
|
1693 |
/*! no static exports found */
|
1694 |
/***/ (function(module, exports) {
|
1695 |
|
@@ -1823,10 +1823,10 @@ var MessageBox = {
|
|
1823 |
|
1824 |
/***/ }),
|
1825 |
|
1826 |
-
/***/ "../../../Clouds/Thimpress/Plugins/github.com/
|
1827 |
-
|
1828 |
-
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/
|
1829 |
-
|
1830 |
/*! no static exports found */
|
1831 |
/***/ (function(module, exports) {
|
1832 |
|
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/js/utils/index.js");
|
85 |
/******/ })
|
86 |
/************************************************************************/
|
87 |
/******/ ({
|
88 |
|
89 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/cookies.js":
|
90 |
+
/*!*************************************************************************************************************************!*\
|
91 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/cookies.js ***!
|
92 |
+
\*************************************************************************************************************************/
|
93 |
/*! exports provided: default */
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
157 |
|
158 |
/***/ }),
|
159 |
|
160 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/event-callback.js":
|
161 |
+
/*!********************************************************************************************************************************!*\
|
162 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/event-callback.js ***!
|
163 |
+
\********************************************************************************************************************************/
|
164 |
/*! exports provided: default */
|
165 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
166 |
|
276 |
|
277 |
/***/ }),
|
278 |
|
279 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/extend.js":
|
280 |
+
/*!************************************************************************************************************************!*\
|
281 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/extend.js ***!
|
282 |
+
\************************************************************************************************************************/
|
283 |
/*! exports provided: default */
|
284 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
285 |
|
298 |
|
299 |
/***/ }),
|
300 |
|
301 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/fn.js":
|
302 |
+
/*!********************************************************************************************************************!*\
|
303 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/fn.js ***!
|
304 |
+
\********************************************************************************************************************/
|
305 |
/*! exports provided: default */
|
306 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
307 |
|
346 |
|
347 |
/***/ }),
|
348 |
|
349 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/hook.js":
|
350 |
+
/*!**********************************************************************************************************************!*\
|
351 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/hook.js ***!
|
352 |
+
\**********************************************************************************************************************/
|
353 |
/*! exports provided: default */
|
354 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
355 |
|
449 |
|
450 |
/***/ }),
|
451 |
|
452 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/iframe-submit.js":
|
453 |
+
/*!*******************************************************************************************************************************!*\
|
454 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/iframe-submit.js ***!
|
455 |
+
\*******************************************************************************************************************************/
|
456 |
/*! exports provided: default */
|
457 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
458 |
|
485 |
|
486 |
/***/ }),
|
487 |
|
488 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/index.js":
|
489 |
+
/*!***********************************************************************************************************************!*\
|
490 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/index.js ***!
|
491 |
+
\***********************************************************************************************************************/
|
492 |
/*! exports provided: default */
|
493 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
494 |
|
495 |
"use strict";
|
496 |
__webpack_require__.r(__webpack_exports__);
|
497 |
+
/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extend */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/extend.js");
|
498 |
+
/* harmony import */ var _fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fn */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/fn.js");
|
499 |
+
/* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quick-tip */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/quick-tip.js");
|
500 |
/* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_quick_tip__WEBPACK_IMPORTED_MODULE_2__);
|
501 |
+
/* harmony import */ var _message_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./message-box */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/message-box.js");
|
502 |
+
/* harmony import */ var _event_callback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-callback */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/event-callback.js");
|
503 |
+
/* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hook */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/hook.js");
|
504 |
+
/* harmony import */ var _cookies__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cookies */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/cookies.js");
|
505 |
+
/* harmony import */ var _local_storage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./local-storage */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/local-storage.js");
|
506 |
+
/* harmony import */ var _jquery_plugins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./jquery.plugins */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/jquery.plugins.js");
|
507 |
+
/* harmony import */ var _iframe_submit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iframe-submit */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/iframe-submit.js");
|
508 |
+
/* harmony import */ var _show_password__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./show-password */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/show-password.js");
|
509 |
/* harmony import */ var _show_password__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_show_password__WEBPACK_IMPORTED_MODULE_10__);
|
510 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
511 |
|
1122 |
|
1123 |
/***/ }),
|
1124 |
|
1125 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/jquery.plugins.js":
|
1126 |
+
/*!********************************************************************************************************************************!*\
|
1127 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/jquery.plugins.js ***!
|
1128 |
+
\********************************************************************************************************************************/
|
1129 |
/*! exports provided: default */
|
1130 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1131 |
|
1357 |
|
1358 |
/***/ }),
|
1359 |
|
1360 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/local-storage.js":
|
1361 |
+
/*!*******************************************************************************************************************************!*\
|
1362 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/local-storage.js ***!
|
1363 |
+
\*******************************************************************************************************************************/
|
1364 |
/*! exports provided: default */
|
1365 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1366 |
|
1407 |
|
1408 |
/***/ }),
|
1409 |
|
1410 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/message-box.js":
|
1411 |
+
/*!*****************************************************************************************************************************!*\
|
1412 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/message-box.js ***!
|
1413 |
+
\*****************************************************************************************************************************/
|
1414 |
/*! exports provided: default */
|
1415 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1416 |
|
1686 |
|
1687 |
/***/ }),
|
1688 |
|
1689 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/quick-tip.js":
|
1690 |
+
/*!***************************************************************************************************************************!*\
|
1691 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/quick-tip.js ***!
|
1692 |
+
\***************************************************************************************************************************/
|
1693 |
/*! no static exports found */
|
1694 |
/***/ (function(module, exports) {
|
1695 |
|
1823 |
|
1824 |
/***/ }),
|
1825 |
|
1826 |
+
/***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/show-password.js":
|
1827 |
+
/*!*******************************************************************************************************************************!*\
|
1828 |
+
!*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_doing/learnpress/assets/src/js/utils/show-password.js ***!
|
1829 |
+
\*******************************************************************************************************************************/
|
1830 |
/*! no static exports found */
|
1831 |
/***/ (function(module, exports) {
|
1832 |
|
@@ -1 +1 @@
|
|
1 |
-
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},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=12)}({12:function(t,e,n){"use strict";n.r(e);var o,i=window.jQuery;void 0!==i&&(i.fn.LP=o=function(t,e){if("function"==typeof e)i.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var o=1;o<arguments.length;o++)n.push(arguments[o]);return"function"==typeof i(this)["LP_"+t]?i(this)["LP_"+t].apply(this,n):this}return this});var r=o,a=n(3),s=n.n(a),c=window.jQuery,l={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(t,e){var n=c(t);c("[learn-press-quick-confirm]").each((function(){var t;(t=c(this).data("quick-confirm"))&&(console.log(t),t.destroy())})),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(t,e){var n=c(t),o=c('<span class="learn-press-quick-confirm"></span>').insertAfter(n),i=c(t).position()||{left:0,top:0},r=null,a=null,s=3,l=function(){o.fadeOut("fast",(function(){c(this).remove(),o.parent().css("position","")})),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){a&&clearInterval(a),r&&clearInterval(r)},f=function(){r=setInterval((function(){0==--s&&(l.call(o[0]),"function"==typeof e.onCancel&&e.onCancel(e.data),u()),o.find("span").html(" ("+s+")")}),1e3),a=setInterval((function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),o.remove(),o.parent().css("position",""),"function"==typeof e.onCancel&&e.onCancel(e.data))}),350)};e=c.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),o.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+s+")</span>").css({}),o.click((function(){"function"==typeof e.onOk&&e.onOk(e.data),l()})).hover((function(){u()}),(function(){f()})),o.css({left:i.left+n.outerWidth()-o.outerWidth()+e.offset.left,top:i.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),f(),this.destroy=function(){o.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){c.proxy((function(){e=c.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;c(document);var n=c(document.body);this.$block||(this.$block=c('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=c('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click((function(){}))),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),c(window).bind("resize.message-box",c.proxy(this.update,this)).bind("scroll.message-box",c.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout((function(){LP.MessageBox.hide(),"function"==typeof e.onHide&&e.onHide.call(LP.MessageBox,e)}),e.autohide)}),this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),c(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),o=n.data("timer"),i=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),o=(n.outerWidth(),n.outerHeight()),i=t.height(),r=c(window).height();n.offset().top;i>r-50?(t.css({height:r-25}),o=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(c(window).height()-o)/2}),LP.Hook.doAction("learn_press_message_box_resize",o,e)};t&&i(),o&&clearTimeout(o),o=setTimeout(i,250)},_removeInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t){this.instances.splice(e,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t)return this.instances[e]},_createWindow:function(t,e,n){var o=this.$window.find("#message-box-wrap").html("");if(e&&o.append('<h3 class="message-box-title">'+e+"</h3>"),o.append(c('<div class="message-box-content"></div>').html(t)),n){var i=c('<div class="message-box-buttons"></div>');switch(n){case"yesNo":i.append(this._createButton(LP_Settings.localize.button_yes,"yes")),i.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":i.append(this._createButton(LP_Settings.localize.button_ok,"ok")),i.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:i.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}o.append(i)}},_createButton:function(t,e){var n=c('<button type="button" class="button message-box-button message-box-button-'+e+'">'+t+"</button>"),o="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",o).click((function(){var t=c(this).data("instance"),e=t.events[c(this).data("callback")];"function"===c.type(e)&&!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t)})).data("instance",this.instance),n}},u=function(t){var e={};window.jQuery;this.on=function(n,o){var i=n.split("."),r="";return i.length>1&&(n=i[0],r=i[1]),e[n]||(e[n]=[[],{}]),r?(e[n][1][r]||(e[n][1][r]=[]),e[n][1][r].push(o)):e[n][0].push(o),t},this.off=function(n,o){var i=n.split("."),r="";if(i.length>1&&(n=i[0],r=i[1]),!e[n])return t;var a=-1;if(r){if(!e[n][1][r])return t;if("function"==typeof o){if((a=e[n][1][r].indexOf(o))<0)return t;e[n][1][r].splice(a,1)}else e[n][1][r]=[]}else if("function"==typeof o){if((a=e[n][0].indexOf(o))<0)return t;e[n][0].splice(a,1)}else e[n][0]=[];return t},this.callEvent=function(n,o){if(e[n]){if(e[n][0])for(var i=0;i<e[n][0].length;i++)"function"==typeof e[n][0][i]&&e[n][i][0].apply(t,o);if(e[n][1])for(var i in e[n][1])for(var r=0;r<e[n][1][i].length;r++)"function"==typeof e[n][1][i][r]&&e[n][1][i][r].apply(t,o)}}},f={hooks:{action:{},filter:{}},addAction:function(t,e,n,o){return this.addHook("action",t,e,n,o),this},addFilter:function(t,e,n,o){return this.addHook("filter",t,e,n,o),this},doAction:function(t){return this.doHook("action",t,arguments)},applyFilters:function(t){return this.doHook("filter",t,arguments)},removeAction:function(t,e){return this.removeHook("action",t,e),this},removeFilter:function(t,e,n){return this.removeHook("filter",t,e,n),this},addHook:function(t,e,n,o,i){void 0===this.hooks[t][e]&&(this.hooks[t][e]=[]);var r=this.hooks[t][e];return void 0===i&&(i=e+"_"+r.length),this.hooks[t][e].push({tag:i,callable:n,priority:o}),this},doHook:function(t,e,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[t][e]){var o,i=this.hooks[t][e];i.sort((function(t,e){return t.priority-e.priority}));for(var r=0;r<i.length;r++)"function"!=typeof(o=i[r].callable)&&(o=window[o]),"action"===t?n[r]=o.apply(null,n):n[0]=o.apply(null,n)}return"filter"===t?n[0]:n},removeHook:function(t,e,n,o){if(void 0!==this.hooks[t][e])for(var i=this.hooks[t][e],r=i.length-1;r>=0;r--)void 0!==o&&o!==i[r].tag||void 0!==n&&n!==i[r].priority||i.splice(r,1);return this}},p={get:function(t,e,n){var o;if(n)o=wpCookies.get(t);else{var i=wpCookies.get("LP");i&&(i=JSON.parse(i),o=t?i[t]:i)}return o||o===e||(o=e),o},set:function(t,e,n,o,i,r){if(arguments.length>2)wpCookies.set(t,e,n,o,i,r);else if(2==arguments.length){var a=wpCookies.get("LP");(a=a?JSON.parse(a):{})[t]=e,wpCookies.set("LP",JSON.stringify(a),"","/")}else wpCookies.set("LP",JSON.stringify(t),"","/")},remove:function(t){var e=p.get(),n=new RegExp(t,"g"),o={},i=t.match(/\*/);for(var r in e)i?r.match(n)||(o[r]=e[r]):t!=r&&(o[r]=e[r]);p.set(o)}},d=p,h={__key:"LP",set:function(t,e){var n=h.get(),o=lodash.set;o(n,t,e),localStorage.setItem(h.__key,JSON.stringify(n))},get:function(t,e){var n=JSON.parse(localStorage.getItem(h.__key)||"{}"),o=lodash.get,i=o(n,t);return t?void 0!==i?i:e:n},exists:function(t){return t in h.get()},remove:function(t){var e=h.get(),n=lodash.omit(e,t);h.__set(n)},__get:function(){return localStorage.getItem(h.__key)},__set:function(t){localStorage.setItem(h.__key,JSON.stringify(t||"{}"))}},v=h,g=(n(8),1),y=window.jQuery||jQuery,m=function(t){var e="ajax-iframe-"+g,n=y('form[name="'+e+'"]');n.length||(n=y("<iframe />").appendTo(document.body).attr({name:e,src:"#"})),y(t).on("submit",(function(){var n=y(t).clone().appendTo(document.body);return n.attr("target",e),n.find("#submit").remove(),!1})),g++},b=n(4),w=n.n(b);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var P=jQuery;String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(this);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,o=n.split("#");return n=o[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(o[1]?"#"+o[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var o=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(o,""))+(n[1]?"#"+n[1]:"")};var S={Hook:f,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=P(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle((function(){P(this).is(":visible")?P(e).addClass("toggle-on").removeClass("toggle-off"):P(e).addClass("toggle-off").removeClass("toggle-on")}))},overflow:function(t,e){var n=P(t),o=n.css("overflow");e?n.css("overflow",e).data("overflow",o):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){if("string"!=typeof t)return t;var e=String.raw({raw:t}).match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);try{t=e?JSON.parse(e[1].replace(/(?:\r\n|\r|\n)/g,"")):JSON.parse(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",o=t.action?P.extend(t.data,{"lp-ajax":t.action}):t.data,i=t.beforeSend||function(){},r=t.url||window.location.href;P.ajax({data:o,url:r,type:e,dataType:"html",beforeSend:i.apply(null,t),success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",o=(void 0===t.prefix||"learnpress_")+t.action,i=t.action?P.extend(t.data,{action:o}):t.data;P.ajax({data:i,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},addFilter:function(t,e){var n=P(document),o="LP."+t;return n.on(o,e),LP.log(n.data("events")),this},applyFilters:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);return t.hasEvent(e)?(n[0]="LP."+e,t.triggerHandler.apply(t,n)):n[1]},addAction:function(t,e){return this.addFilter(t,e)},doAction:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);t.hasEvent(e)&&(n[0]="LP."+e,t.trigger.apply(t,n))},toElement:function(t,e){if(0!==P(t).length){e=P.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},e||{});var n,o=P(e.container);0===o.length&&(o=P("body, html")),n=o.offset().top;var i=P(t).offset().top+o.scrollTop()-n-e.offset;e.invisible&&function(t,e){var n=o.scrollTop(),i=n+o.height(),r=P(t).offset().top-o.offset().top,a=r+P(t).height();return!0===e?n<r&&i>a:r<=i&&a>=n}(t,!0)||o.fadeIn(10).delay(e.delay).animate({scrollTop:i},e.duration,e.callback)}},uniqueId:function(t,e){var n;void 0===t&&(t="");var o=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=o(parseInt((new Date).getTime()/1e3,10),8),n+=o(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t<e;t++)console.log(arguments[t])},blockContent:function(){0===P("#learn-press-block-content").length&&P(LP.template("learn-press-template-block-content",{})).appendTo(P("body")),LP.hideMainScrollbar().addClass("block-content"),P(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout((function(){LP.showMainScrollbar().removeClass("block-content"),P(document).trigger("learn_press_unblock_content")}),350)},hideMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.css("overflow");t.css("overflow","hidden").attr("overflow",e)})),e},showMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.attr("overflow");t.css("overflow",e).removeAttr("overflow")})),e},template:"undefined"!=typeof _?_.memoize((function(t,e){var n,o={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},i=function(e){return(n=n||_.template(P("#"+t).html(),null,o))(e)};return e?i(e):i}),(function(t,e){return t+"-"+JSON.stringify(e)})):function(){return""},alert:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.alert(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},confirm:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.confirm(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},_on_alert_show:function(){var t=P("#popup_container");P('<span id="popup_container_placeholder" />').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=P("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(P(document.body)),e.stop().animate({top:"+=50",opacity:0},250,(function(){P(this).remove()}))},sendMessage:function(t,e,n,o){P.isPlainObject(t)&&(t=JSON.stringify(t)),n=n||"*",(e=e||window).postMessage(t,n,o)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,o=t.data||t.originalEvent.data||"";("string"==typeof o||o instanceof String)&&0===o.indexOf("{")&&(o=LP.parseJSON(o)),LP.Hook.doAction("learn_press_receive_message",o,n)},camelCaseDashObjectKeys:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=LP,o=function(t){return Array.isArray(t)},i=function(t){return t===Object(t)&&!o(t)&&"function"!=typeof t},r=function(t){return t.replace(/([-_][a-z])/gi,(function(t){return t.toUpperCase().replace("-","").replace("_","")}))};if(i(t)){var a={};return Object.keys(t).forEach((function(o){a[r(o)]=e?n.camelCaseDashObjectKeys(t[o]):t[o]})),a}return o(t)?t.map((function(t){return n.camelCaseDashObjectKeys(t)})):t},IframeSubmit:m};P(document).ready((function(){var t,e;void 0!==P.alerts&&(P.alerts.overlayColor="#000",P.alerts.overlayOpacity=.5,P.alerts.okButton=lpGlobalSettings.localize.button_ok,P.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),P(".learn-press-message.fixed").each((function(){var t=P(this),e=t.data();!function(t,e){e.delayIn&&setTimeout((function(){t.show().hide().fadeIn()}),e.delayIn),e.delayOut&&setTimeout((function(){t.fadeOut()}),e.delayOut+(e.delayIn||0))}(t,e)})),setTimeout((function(){P(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")}),300),P("body.course-item-popup").parent().css("overflow","hidden"),t=null,e=function(){P(".auto-check-lines").checkLines((function(t){t>1?P(this).removeClass("single-lines"):P(this).addClass("single-lines"),P(this).attr("rows",t)}))},P(window).on("resize.check-lines",(function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})),P(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),P(".learn-press-icon").LP_Tooltip({offset:[30,30]}),P(".learn-press-message[data-autoclose]").each((function(){var t=P(this),e=parseInt(t.data("autoclose"));e&&setTimeout((function(t){t.fadeOut()}),e,t)})),P(document).on("click",(function(){P(document).trigger("learn-press/close-all-quick-tip")}))})),function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({Event_Callback:u,MessageBox:l,Cookies:d,localStorage:v},S));e.default={fn:r,QuickTip:s.a,Cookies:d,localStorage:v,showPass:w.a}},3:function(t,e){!function(t){function e(e,n){var o=t(e),i=o.attr("data-id")||LP.uniqueId();n=t.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,o.data()),o.attr("data-id",i);var r=o.attr("data-content-tip")||o.html(),a=t('<div class="learn-press-tip-floating">'+r+"</div>"),s=null,c=0,l=!1,u="el"===n.arrowOffset?o.outerWidth()/2:8,f=t("#__"+i);function p(){if(s)clearTimeout(s);else{n.single&&t(".learn-press-tip").not(o).LP("QuickTip","close"),a.appendTo(document.body);var e=o.offset();a.css({top:e.top-a.outerHeight()-8,left:e.left-a.outerWidth()/2+u})}}function d(){s&&clearTimeout(s),s=setTimeout((function(){a.detach(),s=null}),c)}function h(){c=0,d(),c=n.closeInterval}return 0===f.length&&t(document.body).append(t("<div />").attr("id","__"+i).html(r).css("display","none")),r=f.html(),a.addClass(n.tipClass),o.data("content-tip",r),o.attr("data-content-tip")&&(l=!0),c=n.closeInterval,!1===n.autoClose&&(a.append('<a class="close"></a>'),a.on("click",".close",(function(){h()}))),l||o.html(""),"click"===n.event&&o.on("click",(function(t){t.stopPropagation(),p()})),t(document).on("learn-press/close-all-quick-tip",(function(){h()})),o.hover((function(t){t.stopPropagation(),"click"!==n.event&&p()}),(function(t){t.stopPropagation(),n.autoClose&&d()})).addClass("ready"),{close:h,open:function(){p()}}}t.fn.LP("QuickTip",(function(n){return t.each(this,(function(){var o=t(this).data("quick-tip");o||(o=new e(this,n),t(this).data("quick-tip",o)),"string"==typeof n&&o[n]&&o[n].apply(o)}))}))}(jQuery)},4:function(t,e){var n=jQuery;n((function(){n('.form-field input[type="password"]').wrap('<span class="lp-password-input"></span>'),n(".lp-password-input").append('<span class="lp-show-password-input"></span>'),n(".lp-show-password-input").on("click",(function(){n(this).toggleClass("display-password"),n(this).hasClass("display-password")?n(this).siblings(['input[type="password"]']).prop("type","text"):n(this).siblings('input[type="text"]').prop("type","password")}))}))},8:function(module,__webpack_exports__,__webpack_require__){"use strict";var _this=void 0;function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var $=window.jQuery||jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,(function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,(function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(null==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(t){console.log("Error:"+t+"\n"+objExp)}}))):indexed[match[0]]=this.value}})),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(t){return t=$.extend({},{offset:[0,0]},t||{}),$.each(_this,(function(){var e=$(this),n=e.data("content");if(n&&void 0===e.data("LP_Tooltip")){var o=null;e.on("mouseenter",(function(i){o=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var r=e.offset();if(Array.isArray(t.offset)){var a=t.offset[1],s=t.offset[0];$.isNumeric(s)&&(r.left+=s),$.isNumeric(a)&&(r.top+=a)}o.css({top:r.top,left:r.left}),o.fadeIn()})),e.on("mouseleave",(function(t){o&&o.remove()})),e.data("tooltip",!0)}}))},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i<e.LP.length;i++)if(e.LP[i].namespace==t)return!0;return!1},dataToJSON=function(){var t={};return $.each(this[0].attributes,(function(){var e=this.name.match(/^data-(.*)/);e&&(t[e[1]]=this.value)})),t},rows=function(){var t=$(this).height(),e=$(this).css("line-height").replace("px","");return $(this).attr({height:t,"line-height":e}),Math.floor(t/parseInt(e))},checkLines=function(t){return this.each((function(){var e=$(this).rows();t.call(this,e)}))},findNext=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o+1);return!!i.length&&i},findPrev=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o-1);return!!i.length&&i},progress=function(t){return this.each((function(){var e=parseInt(t/100*360),n=$(this);e<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+e+"deg)"})}))};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress;var _unused_webpack_default_export={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}}});
|
1 |
+
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},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=14)}({10:function(module,__webpack_exports__,__webpack_require__){"use strict";var _this=void 0;function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var $=window.jQuery||jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,(function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,(function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(null==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(t){console.log("Error:"+t+"\n"+objExp)}}))):indexed[match[0]]=this.value}})),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(t){return t=$.extend({},{offset:[0,0]},t||{}),$.each(_this,(function(){var e=$(this),n=e.data("content");if(n&&void 0===e.data("LP_Tooltip")){var o=null;e.on("mouseenter",(function(i){o=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var r=e.offset();if(Array.isArray(t.offset)){var a=t.offset[1],s=t.offset[0];$.isNumeric(s)&&(r.left+=s),$.isNumeric(a)&&(r.top+=a)}o.css({top:r.top,left:r.left}),o.fadeIn()})),e.on("mouseleave",(function(t){o&&o.remove()})),e.data("tooltip",!0)}}))},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i<e.LP.length;i++)if(e.LP[i].namespace==t)return!0;return!1},dataToJSON=function(){var t={};return $.each(this[0].attributes,(function(){var e=this.name.match(/^data-(.*)/);e&&(t[e[1]]=this.value)})),t},rows=function(){var t=$(this).height(),e=$(this).css("line-height").replace("px","");return $(this).attr({height:t,"line-height":e}),Math.floor(t/parseInt(e))},checkLines=function(t){return this.each((function(){var e=$(this).rows();t.call(this,e)}))},findNext=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o+1);return!!i.length&&i},findPrev=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o-1);return!!i.length&&i},progress=function(t){return this.each((function(){var e=parseInt(t/100*360),n=$(this);e<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+e+"deg)"})}))};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress;var _unused_webpack_default_export={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}},14:function(t,e,n){"use strict";n.r(e);var o,i=window.jQuery;void 0!==i&&(i.fn.LP=o=function(t,e){if("function"==typeof e)i.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var o=1;o<arguments.length;o++)n.push(arguments[o]);return"function"==typeof i(this)["LP_"+t]?i(this)["LP_"+t].apply(this,n):this}return this});var r=o,a=n(3),s=n.n(a),c=window.jQuery,l={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(t,e){var n=c(t);c("[learn-press-quick-confirm]").each((function(){var t;(t=c(this).data("quick-confirm"))&&(console.log(t),t.destroy())})),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(t,e){var n=c(t),o=c('<span class="learn-press-quick-confirm"></span>').insertAfter(n),i=c(t).position()||{left:0,top:0},r=null,a=null,s=3,l=function(){o.fadeOut("fast",(function(){c(this).remove(),o.parent().css("position","")})),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){a&&clearInterval(a),r&&clearInterval(r)},f=function(){r=setInterval((function(){0==--s&&(l.call(o[0]),"function"==typeof e.onCancel&&e.onCancel(e.data),u()),o.find("span").html(" ("+s+")")}),1e3),a=setInterval((function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),o.remove(),o.parent().css("position",""),"function"==typeof e.onCancel&&e.onCancel(e.data))}),350)};e=c.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),o.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+s+")</span>").css({}),o.click((function(){"function"==typeof e.onOk&&e.onOk(e.data),l()})).hover((function(){u()}),(function(){f()})),o.css({left:i.left+n.outerWidth()-o.outerWidth()+e.offset.left,top:i.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),f(),this.destroy=function(){o.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){c.proxy((function(){e=c.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;c(document);var n=c(document.body);this.$block||(this.$block=c('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=c('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click((function(){}))),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),c(window).bind("resize.message-box",c.proxy(this.update,this)).bind("scroll.message-box",c.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout((function(){LP.MessageBox.hide(),"function"==typeof e.onHide&&e.onHide.call(LP.MessageBox,e)}),e.autohide)}),this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),c(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),o=n.data("timer"),i=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),o=(n.outerWidth(),n.outerHeight()),i=t.height(),r=c(window).height();n.offset().top;i>r-50?(t.css({height:r-25}),o=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(c(window).height()-o)/2}),LP.Hook.doAction("learn_press_message_box_resize",o,e)};t&&i(),o&&clearTimeout(o),o=setTimeout(i,250)},_removeInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t){this.instances.splice(e,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t)return this.instances[e]},_createWindow:function(t,e,n){var o=this.$window.find("#message-box-wrap").html("");if(e&&o.append('<h3 class="message-box-title">'+e+"</h3>"),o.append(c('<div class="message-box-content"></div>').html(t)),n){var i=c('<div class="message-box-buttons"></div>');switch(n){case"yesNo":i.append(this._createButton(LP_Settings.localize.button_yes,"yes")),i.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":i.append(this._createButton(LP_Settings.localize.button_ok,"ok")),i.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:i.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}o.append(i)}},_createButton:function(t,e){var n=c('<button type="button" class="button message-box-button message-box-button-'+e+'">'+t+"</button>"),o="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",o).click((function(){var t=c(this).data("instance"),e=t.events[c(this).data("callback")];"function"===c.type(e)&&!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t)})).data("instance",this.instance),n}},u=function(t){var e={};window.jQuery;this.on=function(n,o){var i=n.split("."),r="";return i.length>1&&(n=i[0],r=i[1]),e[n]||(e[n]=[[],{}]),r?(e[n][1][r]||(e[n][1][r]=[]),e[n][1][r].push(o)):e[n][0].push(o),t},this.off=function(n,o){var i=n.split("."),r="";if(i.length>1&&(n=i[0],r=i[1]),!e[n])return t;var a=-1;if(r){if(!e[n][1][r])return t;if("function"==typeof o){if((a=e[n][1][r].indexOf(o))<0)return t;e[n][1][r].splice(a,1)}else e[n][1][r]=[]}else if("function"==typeof o){if((a=e[n][0].indexOf(o))<0)return t;e[n][0].splice(a,1)}else e[n][0]=[];return t},this.callEvent=function(n,o){if(e[n]){if(e[n][0])for(var i=0;i<e[n][0].length;i++)"function"==typeof e[n][0][i]&&e[n][i][0].apply(t,o);if(e[n][1])for(var i in e[n][1])for(var r=0;r<e[n][1][i].length;r++)"function"==typeof e[n][1][i][r]&&e[n][1][i][r].apply(t,o)}}},f={hooks:{action:{},filter:{}},addAction:function(t,e,n,o){return this.addHook("action",t,e,n,o),this},addFilter:function(t,e,n,o){return this.addHook("filter",t,e,n,o),this},doAction:function(t){return this.doHook("action",t,arguments)},applyFilters:function(t){return this.doHook("filter",t,arguments)},removeAction:function(t,e){return this.removeHook("action",t,e),this},removeFilter:function(t,e,n){return this.removeHook("filter",t,e,n),this},addHook:function(t,e,n,o,i){void 0===this.hooks[t][e]&&(this.hooks[t][e]=[]);var r=this.hooks[t][e];return void 0===i&&(i=e+"_"+r.length),this.hooks[t][e].push({tag:i,callable:n,priority:o}),this},doHook:function(t,e,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[t][e]){var o,i=this.hooks[t][e];i.sort((function(t,e){return t.priority-e.priority}));for(var r=0;r<i.length;r++)"function"!=typeof(o=i[r].callable)&&(o=window[o]),"action"===t?n[r]=o.apply(null,n):n[0]=o.apply(null,n)}return"filter"===t?n[0]:n},removeHook:function(t,e,n,o){if(void 0!==this.hooks[t][e])for(var i=this.hooks[t][e],r=i.length-1;r>=0;r--)void 0!==o&&o!==i[r].tag||void 0!==n&&n!==i[r].priority||i.splice(r,1);return this}},p={get:function(t,e,n){var o;if(n)o=wpCookies.get(t);else{var i=wpCookies.get("LP");i&&(i=JSON.parse(i),o=t?i[t]:i)}return o||o===e||(o=e),o},set:function(t,e,n,o,i,r){if(arguments.length>2)wpCookies.set(t,e,n,o,i,r);else if(2==arguments.length){var a=wpCookies.get("LP");(a=a?JSON.parse(a):{})[t]=e,wpCookies.set("LP",JSON.stringify(a),"","/")}else wpCookies.set("LP",JSON.stringify(t),"","/")},remove:function(t){var e=p.get(),n=new RegExp(t,"g"),o={},i=t.match(/\*/);for(var r in e)i?r.match(n)||(o[r]=e[r]):t!=r&&(o[r]=e[r]);p.set(o)}},d=p,h={__key:"LP",set:function(t,e){var n=h.get(),o=lodash.set;o(n,t,e),localStorage.setItem(h.__key,JSON.stringify(n))},get:function(t,e){var n=JSON.parse(localStorage.getItem(h.__key)||"{}"),o=lodash.get,i=o(n,t);return t?void 0!==i?i:e:n},exists:function(t){return t in h.get()},remove:function(t){var e=h.get(),n=lodash.omit(e,t);h.__set(n)},__get:function(){return localStorage.getItem(h.__key)},__set:function(t){localStorage.setItem(h.__key,JSON.stringify(t||"{}"))}},v=h,g=(n(10),1),y=window.jQuery||jQuery,m=function(t){var e="ajax-iframe-"+g,n=y('form[name="'+e+'"]');n.length||(n=y("<iframe />").appendTo(document.body).attr({name:e,src:"#"})),y(t).on("submit",(function(){var n=y(t).clone().appendTo(document.body);return n.attr("target",e),n.find("#submit").remove(),!1})),g++},b=n(4),w=n.n(b);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var P=jQuery;String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(this);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,o=n.split("#");return n=o[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(o[1]?"#"+o[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var o=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(o,""))+(n[1]?"#"+n[1]:"")};var S={Hook:f,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=P(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle((function(){P(this).is(":visible")?P(e).addClass("toggle-on").removeClass("toggle-off"):P(e).addClass("toggle-off").removeClass("toggle-on")}))},overflow:function(t,e){var n=P(t),o=n.css("overflow");e?n.css("overflow",e).data("overflow",o):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){if("string"!=typeof t)return t;var e=String.raw({raw:t}).match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);try{t=e?JSON.parse(e[1].replace(/(?:\r\n|\r|\n)/g,"")):JSON.parse(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",o=t.action?P.extend(t.data,{"lp-ajax":t.action}):t.data,i=t.beforeSend||function(){},r=t.url||window.location.href;P.ajax({data:o,url:r,type:e,dataType:"html",beforeSend:i.apply(null,t),success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",o=(void 0===t.prefix||"learnpress_")+t.action,i=t.action?P.extend(t.data,{action:o}):t.data;P.ajax({data:i,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},addFilter:function(t,e){var n=P(document),o="LP."+t;return n.on(o,e),LP.log(n.data("events")),this},applyFilters:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);return t.hasEvent(e)?(n[0]="LP."+e,t.triggerHandler.apply(t,n)):n[1]},addAction:function(t,e){return this.addFilter(t,e)},doAction:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);t.hasEvent(e)&&(n[0]="LP."+e,t.trigger.apply(t,n))},toElement:function(t,e){if(0!==P(t).length){e=P.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},e||{});var n,o=P(e.container);0===o.length&&(o=P("body, html")),n=o.offset().top;var i=P(t).offset().top+o.scrollTop()-n-e.offset;e.invisible&&function(t,e){var n=o.scrollTop(),i=n+o.height(),r=P(t).offset().top-o.offset().top,a=r+P(t).height();return!0===e?n<r&&i>a:r<=i&&a>=n}(t,!0)||o.fadeIn(10).delay(e.delay).animate({scrollTop:i},e.duration,e.callback)}},uniqueId:function(t,e){var n;void 0===t&&(t="");var o=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=o(parseInt((new Date).getTime()/1e3,10),8),n+=o(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t<e;t++)console.log(arguments[t])},blockContent:function(){0===P("#learn-press-block-content").length&&P(LP.template("learn-press-template-block-content",{})).appendTo(P("body")),LP.hideMainScrollbar().addClass("block-content"),P(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout((function(){LP.showMainScrollbar().removeClass("block-content"),P(document).trigger("learn_press_unblock_content")}),350)},hideMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.css("overflow");t.css("overflow","hidden").attr("overflow",e)})),e},showMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.attr("overflow");t.css("overflow",e).removeAttr("overflow")})),e},template:"undefined"!=typeof _?_.memoize((function(t,e){var n,o={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},i=function(e){return(n=n||_.template(P("#"+t).html(),null,o))(e)};return e?i(e):i}),(function(t,e){return t+"-"+JSON.stringify(e)})):function(){return""},alert:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.alert(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},confirm:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.confirm(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},_on_alert_show:function(){var t=P("#popup_container");P('<span id="popup_container_placeholder" />').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=P("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(P(document.body)),e.stop().animate({top:"+=50",opacity:0},250,(function(){P(this).remove()}))},sendMessage:function(t,e,n,o){P.isPlainObject(t)&&(t=JSON.stringify(t)),n=n||"*",(e=e||window).postMessage(t,n,o)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,o=t.data||t.originalEvent.data||"";("string"==typeof o||o instanceof String)&&0===o.indexOf("{")&&(o=LP.parseJSON(o)),LP.Hook.doAction("learn_press_receive_message",o,n)},camelCaseDashObjectKeys:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=LP,o=function(t){return Array.isArray(t)},i=function(t){return t===Object(t)&&!o(t)&&"function"!=typeof t},r=function(t){return t.replace(/([-_][a-z])/gi,(function(t){return t.toUpperCase().replace("-","").replace("_","")}))};if(i(t)){var a={};return Object.keys(t).forEach((function(o){a[r(o)]=e?n.camelCaseDashObjectKeys(t[o]):t[o]})),a}return o(t)?t.map((function(t){return n.camelCaseDashObjectKeys(t)})):t},IframeSubmit:m};P(document).ready((function(){var t,e;void 0!==P.alerts&&(P.alerts.overlayColor="#000",P.alerts.overlayOpacity=.5,P.alerts.okButton=lpGlobalSettings.localize.button_ok,P.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),P(".learn-press-message.fixed").each((function(){var t=P(this),e=t.data();!function(t,e){e.delayIn&&setTimeout((function(){t.show().hide().fadeIn()}),e.delayIn),e.delayOut&&setTimeout((function(){t.fadeOut()}),e.delayOut+(e.delayIn||0))}(t,e)})),setTimeout((function(){P(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")}),300),P("body.course-item-popup").parent().css("overflow","hidden"),t=null,e=function(){P(".auto-check-lines").checkLines((function(t){t>1?P(this).removeClass("single-lines"):P(this).addClass("single-lines"),P(this).attr("rows",t)}))},P(window).on("resize.check-lines",(function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})),P(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),P(".learn-press-icon").LP_Tooltip({offset:[30,30]}),P(".learn-press-message[data-autoclose]").each((function(){var t=P(this),e=parseInt(t.data("autoclose"));e&&setTimeout((function(t){t.fadeOut()}),e,t)})),P(document).on("click",(function(){P(document).trigger("learn-press/close-all-quick-tip")}))})),function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({Event_Callback:u,MessageBox:l,Cookies:d,localStorage:v},S));e.default={fn:r,QuickTip:s.a,Cookies:d,localStorage:v,showPass:w.a}},3:function(t,e){!function(t){function e(e,n){var o=t(e),i=o.attr("data-id")||LP.uniqueId();n=t.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,o.data()),o.attr("data-id",i);var r=o.attr("data-content-tip")||o.html(),a=t('<div class="learn-press-tip-floating">'+r+"</div>"),s=null,c=0,l=!1,u="el"===n.arrowOffset?o.outerWidth()/2:8,f=t("#__"+i);function p(){if(s)clearTimeout(s);else{n.single&&t(".learn-press-tip").not(o).LP("QuickTip","close"),a.appendTo(document.body);var e=o.offset();a.css({top:e.top-a.outerHeight()-8,left:e.left-a.outerWidth()/2+u})}}function d(){s&&clearTimeout(s),s=setTimeout((function(){a.detach(),s=null}),c)}function h(){c=0,d(),c=n.closeInterval}return 0===f.length&&t(document.body).append(t("<div />").attr("id","__"+i).html(r).css("display","none")),r=f.html(),a.addClass(n.tipClass),o.data("content-tip",r),o.attr("data-content-tip")&&(l=!0),c=n.closeInterval,!1===n.autoClose&&(a.append('<a class="close"></a>'),a.on("click",".close",(function(){h()}))),l||o.html(""),"click"===n.event&&o.on("click",(function(t){t.stopPropagation(),p()})),t(document).on("learn-press/close-all-quick-tip",(function(){h()})),o.hover((function(t){t.stopPropagation(),"click"!==n.event&&p()}),(function(t){t.stopPropagation(),n.autoClose&&d()})).addClass("ready"),{close:h,open:function(){p()}}}t.fn.LP("QuickTip",(function(n){return t.each(this,(function(){var o=t(this).data("quick-tip");o||(o=new e(this,n),t(this).data("quick-tip",o)),"string"==typeof n&&o[n]&&o[n].apply(o)}))}))}(jQuery)},4:function(t,e){var n=jQuery;n((function(){n('.form-field input[type="password"]').wrap('<span class="lp-password-input"></span>'),n(".lp-password-input").append('<span class="lp-show-password-input"></span>'),n(".lp-show-password-input").on("click",(function(){n(this).toggleClass("display-password"),n(this).hasClass("display-password")?n(this).siblings(['input[type="password"]']).prop("type","text"):n(this).siblings('input[type="text"]').prop("type","password")}))}))}});
|
@@ -1 +1 @@
|
|
1 |
-
const
|
1 |
+
const lpArchiveAddQueryArgs=(e,t)=>{const r=new URL(e);return Object.keys(t).forEach(e=>{r.searchParams.append(e,t[e])}),r},lpArchiveCourse=()=>{const e=document.querySelectorAll(".lp-archive-course-skeleton");if(e.length&&"IntersectionObserver"in window){const t=new IntersectionObserver((e,r)=>{e.forEach(e=>{if(e.isIntersecting){const r=e.target;if(!lpArchiveSkeleton)return;lpArchiveRequestCourse(lpArchiveSkeleton),t.unobserve(r)}})});[...e].map(e=>t.observe(e))}};let skeleton,skeletonClone,isLoading=!1;const lpArchiveRequestCourse=e=>{const t=lpGlobalSettings.lp_rest_url,r=lpGlobalSettings.user_id||"";if(!t)return;const s=document.querySelector(".lp-archive-courses"),o=s&&s.querySelector("div.lp-archive-courses .lp-content-area"),n=o&&o.querySelector("ul.learn-press-courses");n&&(isLoading||(isLoading=!0,skeletonClone?n.innerHTML=skeletonClone:(skeleton=document.querySelector(".lp-archive-course-skeleton"),skeletonClone=skeleton.outerHTML),fetch(lpArchiveAddQueryArgs(t+"lp/v1/courses/archive-course",{...e,userID:r}),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{void 0!==e.data.content&&n&&(n.innerHTML=e.data.content||"");const t=e.data.pagination;if(lpArchiveSearchCourse(),void 0!==t){const e=(new DOMParser).parseFromString(t,"text/html").querySelector(".learn-press-pagination"),r=document.querySelector(".learn-press-pagination");r&&r.remove(),e&&(n.after(e),lpArchivePaginationCourse())}}).catch(e=>{n.innerHTML+=`<div class="lp-ajax-message error" style="display:block">${e.message||"Error: Query lp/v1/courses/archive-course"}</div>`}).finally(()=>{isLoading=!1,skeleton&&skeleton.remove(),jQuery("form.search-courses button").removeClass("loading"),LPArchiveCourseInit(),s.scrollIntoView()})))},lpArchiveSearchCourse=()=>{document.querySelectorAll("form.search-courses").forEach(e=>{const t=e.querySelector('input[name="s"]'),r=e.getAttribute("action"),s=e.querySelector('[name="post_type"]').value||"",o=e.querySelector('[name="taxonomy"]').value||"",n=e.querySelector('[name="term_id"]').value||"",c=e.querySelector('[type="submit"]');t.addEventListener("keyup",e=>{e.preventDefault();const t=e.target.value;if(!t||t&&t.length>2){c.classList.add("loading"),lpArchiveRequestCourse({...lpArchiveSkeleton,s:t});const e=lpArchiveAddQueryArgs(r,{post_type:s,taxonomy:o,term_id:n,s:t});window.history.pushState("","",e)}}),e.addEventListener("submit",t=>{t.preventDefault();const r=e.querySelector('input[name="s"]');r&&r.dispatchEvent(new Event("keyup"))})})},lpArchivePaginationCourse=()=>{const e=document.querySelectorAll(".lp-archive-courses .learn-press-pagination .page-numbers");e.length>0&&e.forEach(t=>t.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();const s=r.currentTarget.getAttribute("href");if(s){const o=new URL(s),n={};o.searchParams.forEach((e,t)=>{n[t]=e});const c=[...e].filter(e=>e.classList.contains("current")),l=r.currentTarget.textContent||t.classList.contains("next")&&parseInt(c[0].textContent)+1||t.classList.contains("prev")&&parseInt(c[0].textContent)-1;lpArchiveRequestCourse({...n,paged:l}),window.history.pushState("","",s)}}))},lpArchiveGridListCourse=()=>{const e=LP.Cookies.get("courses-layout"),t=document.querySelectorAll('.lp-courses-bar .switch-layout [name="lp-switch-layout-btn"]');t.length>0&&[...t].map(t=>t.value===e&&(t.checked=!0))},lpArchiveGridListCourseHandle=()=>{const e=document.querySelectorAll('.lp-archive-courses input[name="lp-switch-layout-btn"]');e.length>0&&e.forEach(e=>e.addEventListener("change",e=>{e.preventDefault();const t=e.target.value;if(t){const e=document.querySelector(".lp-archive-courses .learn-press-courses[data-layout]");e&&(e.dataset.layout=t),LP.Cookies.set("courses-layout",t)}}))};function LPArchiveCourseInit(){lpArchiveCourse(),lpArchiveGridListCourseHandle(),lpArchiveGridListCourse()}LPArchiveCourseInit();
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
document.addEventListener( 'DOMContentLoaded', function( event ) {
|
3 |
+
const elements = document.querySelector( 'ul.lp-order-statuses' );
|
4 |
+
|
5 |
+
const getResponse = async ( ele ) => {
|
6 |
+
try {
|
7 |
+
const response = await wp.apiFetch( {
|
8 |
+
path: wp.url.addQueryArgs( 'lp/v1/orders/statistic' ),
|
9 |
+
method: 'GET',
|
10 |
+
} );
|
11 |
+
|
12 |
+
if ( response.status === 'success' && response.data ) {
|
13 |
+
ele.innerHTML = response.data;
|
14 |
+
} else {
|
15 |
+
ele.innerHTML = `<div class="lp-ajax-message error" style="display:block">${ response.message && response.message }</div>`;
|
16 |
+
}
|
17 |
+
} catch ( error ) {
|
18 |
+
ele.innerHTML += `<div class="lp-ajax-message error" style="display:block">${ error.message && error.message }</div>`;
|
19 |
+
}
|
20 |
+
};
|
21 |
+
|
22 |
+
getResponse( elements );
|
23 |
+
} );
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const $ = jQuery;
|
2 |
+
|
3 |
+
function formatCourse( repo ) {
|
4 |
+
if ( repo.loading ) {
|
5 |
+
return repo.text;
|
6 |
+
}
|
7 |
+
const markup = "<div class='select2-result-course_title'>" + repo.id + ' - ' + repo.title.rendered + '</div>';
|
8 |
+
return markup;
|
9 |
+
}
|
10 |
+
|
11 |
+
function formatCourseSelection( repo ) {
|
12 |
+
return repo.title.rendered || repo.text;
|
13 |
+
}
|
14 |
+
|
15 |
+
function autocompleteWidget( widget = null ) {
|
16 |
+
const searchs = $( '.lp-widget_select_course' );
|
17 |
+
const wpRestUrl = searchs.data( 'rest-url' );
|
18 |
+
const postType = searchs.data( 'post_type' ) || 'lp_course';
|
19 |
+
|
20 |
+
searchs.select2( {
|
21 |
+
ajax: {
|
22 |
+
method: 'GET',
|
23 |
+
url: wpRestUrl + 'wp/v2/' + postType,
|
24 |
+
dataType: 'json',
|
25 |
+
delay: 250,
|
26 |
+
data( params ) {
|
27 |
+
return {
|
28 |
+
search: params.term,
|
29 |
+
};
|
30 |
+
},
|
31 |
+
processResults( data, params ) {
|
32 |
+
params.page = params.page || 1;
|
33 |
+
|
34 |
+
return {
|
35 |
+
results: data,
|
36 |
+
};
|
37 |
+
},
|
38 |
+
cache: true,
|
39 |
+
},
|
40 |
+
escapeMarkup( markup ) {
|
41 |
+
return markup;
|
42 |
+
},
|
43 |
+
minimumInputLength: 2,
|
44 |
+
templateResult: formatCourse, // omitted for brevity, see the source of this page
|
45 |
+
templateSelection: formatCourseSelection, // omitted for brevity, see the source of this page
|
46 |
+
} );
|
47 |
+
}
|
48 |
+
|
49 |
+
document.addEventListener( 'DOMContentLoaded', function( event ) {
|
50 |
+
if ( document.querySelector( '#widgets-editor' ) ) {
|
51 |
+
$( document ).on( 'widget-added', function( event, widget ) {
|
52 |
+
autocompleteWidget( widget );
|
53 |
+
} );
|
54 |
+
} else {
|
55 |
+
$( document ).on( 'learnpress/widgets/select', function() {
|
56 |
+
autocompleteWidget();
|
57 |
+
} );
|
58 |
+
|
59 |
+
autocompleteWidget();
|
60 |
+
}
|
61 |
+
} );
|
@@ -3,4 +3,3 @@ export { default as SingleChoice } from './questions/single-choice';
|
|
3 |
export { default as MultipleChoices } from './questions/multiple-choices';
|
4 |
export { default as TrueOrFalse } from './questions/true-or-false';
|
5 |
export { default as FillInBlanks } from './questions/fill-in-blanks';
|
6 |
-
export { default as SortingChoice } from './questions/sorting-choice';
|
3 |
export { default as MultipleChoices } from './questions/multiple-choices';
|
4 |
export { default as TrueOrFalse } from './questions/true-or-false';
|
5 |
export { default as FillInBlanks } from './questions/fill-in-blanks';
|
|
@@ -1,136 +0,0 @@
|
|
1 |
-
import { __ } from '@wordpress/i18n';
|
2 |
-
import QuestionBase from '../../question-base';
|
3 |
-
|
4 |
-
class QuestionSortingChoice extends QuestionBase {
|
5 |
-
componentDidMount() {
|
6 |
-
const { updateUserQuestionAnswers, question } = this.props;
|
7 |
-
|
8 |
-
const ele = document.querySelector( `#answer-options-${ question.id }` );
|
9 |
-
|
10 |
-
return jQuery( ele ).sortable( {
|
11 |
-
items: '.answer-option',
|
12 |
-
cursor: 'move',
|
13 |
-
axis: 'y',
|
14 |
-
handle: '.option-drag',
|
15 |
-
scrollSensitivity: 40,
|
16 |
-
forcePlaceholderSize: true,
|
17 |
-
helper: 'clone',
|
18 |
-
opacity: 0.65,
|
19 |
-
update( event, ui ) {
|
20 |
-
const options = ele.querySelectorAll( '.answer-option' );
|
21 |
-
const answers = [];
|
22 |
-
|
23 |
-
[ ...options ].map( ( option ) => {
|
24 |
-
return answers.push( option.dataset.value );
|
25 |
-
} );
|
26 |
-
|
27 |
-
if ( answers.length > 0 ) {
|
28 |
-
updateUserQuestionAnswers( question.id, answers );
|
29 |
-
}
|
30 |
-
},
|
31 |
-
} );
|
32 |
-
}
|
33 |
-
|
34 |
-
isCorrect = () => {
|
35 |
-
const { answered } = this.props;
|
36 |
-
|
37 |
-
if ( ! answered ) {
|
38 |
-
return false;
|
39 |
-
}
|
40 |
-
|
41 |
-
let i, option, options, sort;
|
42 |
-
|
43 |
-
for ( i = 0, options = this.getOptions(); i < options.length; i++ ) {
|
44 |
-
option = options[ i ];
|
45 |
-
sort = option.sorting;
|
46 |
-
|
47 |
-
if ( answered[ sort ] !== option.value ) {
|
48 |
-
return false;
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
return true;
|
53 |
-
};
|
54 |
-
|
55 |
-
getCorrectLabel = () => {
|
56 |
-
const { question } = this.props;
|
57 |
-
|
58 |
-
const checker = this.isCorrect;
|
59 |
-
const isCorrect = checker.call( this );
|
60 |
-
|
61 |
-
return this.maybeShowCorrectAnswer() && (
|
62 |
-
<>
|
63 |
-
<div className={ `question-response` + ( isCorrect ? ' correct' : ' incorrect' ) }>
|
64 |
-
<span className="label">{ isCorrect ? __( 'Correct', 'learnpress' ) : __( 'Incorrect', 'learnpress' ) }</span>
|
65 |
-
<span className="point">{ sprintf( __( '%d/%d point', 'learnpress' ), isCorrect ? question.point : 0, question.point ) }</span>
|
66 |
-
</div>
|
67 |
-
</>
|
68 |
-
);
|
69 |
-
};
|
70 |
-
|
71 |
-
getAnswerSortingChoice = () => {
|
72 |
-
const { question } = this.props;
|
73 |
-
|
74 |
-
const options = question.options || [];
|
75 |
-
|
76 |
-
const checker = this.isCorrect;
|
77 |
-
const isCorrect = checker.call( this );
|
78 |
-
const getAnswer = [];
|
79 |
-
|
80 |
-
if ( ! isCorrect && options.length > 0 ) {
|
81 |
-
options.map( ( option ) => {
|
82 |
-
const sorting = option.sorting;
|
83 |
-
|
84 |
-
if ( sorting !== undefined ) {
|
85 |
-
return getAnswer[ sorting ] = option.title;
|
86 |
-
}
|
87 |
-
} );
|
88 |
-
}
|
89 |
-
|
90 |
-
return getAnswer;
|
91 |
-
}
|
92 |
-
|
93 |
-
render() {
|
94 |
-
const { question } = this.props;
|
95 |
-
|
96 |
-
const getAnswer = this.getAnswerSortingChoice();
|
97 |
-
|
98 |
-
return (
|
99 |
-
<div className="question-answers">
|
100 |
-
|
101 |
-
{ this.isDefaultType() && (
|
102 |
-
<ul id={ `answer-options-${ question.id }` } className="answer-options lp-sorting-choice-ul">
|
103 |
-
|
104 |
-
{ this.getOptions().map( ( option, key ) => {
|
105 |
-
return (
|
106 |
-
<>
|
107 |
-
<li className={ this.getOptionClass( option ).join( ' ' ) } key={ `answer-option-${ option.value }` } data-value={ option.value }>
|
108 |
-
<span className="option-drag" style={ { display: 'flex', alignItems: 'center', position: 'absolute', height: '100%', left: 14 } }>
|
109 |
-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /></svg>
|
110 |
-
</span>
|
111 |
-
|
112 |
-
<label htmlFor={ `learn-press-answer-option-${ option.value }` }
|
113 |
-
className="option-title"
|
114 |
-
dangerouslySetInnerHTML={ { __html: option.title || option.value } }>
|
115 |
-
</label>
|
116 |
-
</li>
|
117 |
-
|
118 |
-
{ getAnswer.length > 0 && getAnswer[ key ] !== undefined && (
|
119 |
-
<div className={ 'lp-sorting-choice__check-answer' } key={ `lp-checked-answer-${ key }` } style={ { marginBottom: 10 } }>
|
120 |
-
{ getAnswer[ key ] }
|
121 |
-
</div>
|
122 |
-
) }
|
123 |
-
</>
|
124 |
-
);
|
125 |
-
} ) }
|
126 |
-
</ul>
|
127 |
-
) }
|
128 |
-
|
129 |
-
{ ! this.isDefaultType() && this.getWarningMessage() }
|
130 |
-
{ this.getCorrectLabel() }
|
131 |
-
</div>
|
132 |
-
);
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
export default QuestionSortingChoice;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -14,7 +14,6 @@ class QuestionTypes extends Component {
|
|
14 |
multi_choice: LP.questionTypes.MultipleChoices,
|
15 |
true_or_false: LP.questionTypes.TrueOrFalse,
|
16 |
fill_in_blanks: LP.questionTypes.FillInBlanks,
|
17 |
-
sorting_choice: LP.questionTypes.SortingChoice,
|
18 |
} );
|
19 |
|
20 |
return types[ question.type ];
|
14 |
multi_choice: LP.questionTypes.MultipleChoices,
|
15 |
true_or_false: LP.questionTypes.TrueOrFalse,
|
16 |
fill_in_blanks: LP.questionTypes.FillInBlanks,
|
|
|
17 |
} );
|
18 |
|
19 |
return types[ question.type ];
|
@@ -41,6 +41,10 @@ class Question extends Component {
|
|
41 |
|
42 |
LP.Hook.doAction( 'lp-question-compatible-builder' );
|
43 |
|
|
|
|
|
|
|
|
|
44 |
return a;
|
45 |
}
|
46 |
|
41 |
|
42 |
LP.Hook.doAction( 'lp-question-compatible-builder' );
|
43 |
|
44 |
+
if ( typeof MathJax !== 'undefined' ) {
|
45 |
+
MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] );
|
46 |
+
}
|
47 |
+
|
48 |
return a;
|
49 |
}
|
50 |
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { addQueryArgs } from '@wordpress/url';
|
2 |
+
|
3 |
+
function widgetRestAPI() {
|
4 |
+
const widgets = document.querySelectorAll( '.learnpress-widget-wrapper' );
|
5 |
+
|
6 |
+
if ( ! widgets.length ) {
|
7 |
+
return;
|
8 |
+
}
|
9 |
+
|
10 |
+
const getResponse = async ( ele ) => {
|
11 |
+
const widget = ele.dataset.widget ? JSON.parse( ele.dataset.widget ) : '';
|
12 |
+
|
13 |
+
const response = await wp.apiFetch( {
|
14 |
+
path: 'lp/v1/widgets/api',
|
15 |
+
method: 'POST',
|
16 |
+
data: { ...widget },
|
17 |
+
} );
|
18 |
+
|
19 |
+
const { data, status, message } = response;
|
20 |
+
|
21 |
+
if ( data && status === 'success' ) {
|
22 |
+
ele.insertAdjacentHTML( 'afterbegin', data );
|
23 |
+
} else if ( message ) {
|
24 |
+
ele.insertAdjacentHTML( 'afterbegin', `<div class="lp-ajax-message error" style="display:block">${ message }</div>` );
|
25 |
+
}
|
26 |
+
|
27 |
+
delete ele.dataset.widget;
|
28 |
+
|
29 |
+
ele.querySelector( '.lp-skeleton-animation' ).remove();
|
30 |
+
};
|
31 |
+
|
32 |
+
if ( 'IntersectionObserver' in window ) {
|
33 |
+
const eleObserver = new IntersectionObserver( ( entries, observer ) => {
|
34 |
+
entries.forEach( ( entry ) => {
|
35 |
+
if ( entry.isIntersecting ) {
|
36 |
+
const ele = entry.target;
|
37 |
+
|
38 |
+
getResponse( ele );
|
39 |
+
|
40 |
+
eleObserver.unobserve( ele );
|
41 |
+
}
|
42 |
+
} );
|
43 |
+
} );
|
44 |
+
|
45 |
+
[ ...widgets ].map( ( ele ) => ele.classList.contains( 'learnpress-widget-wrapper__restapi' ) && eleObserver.observe( ele ) );
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
document.addEventListener( 'DOMContentLoaded', function( event ) {
|
50 |
+
widgetRestAPI();
|
51 |
+
} );
|
@@ -77,6 +77,61 @@ const lpMetaboxCustomFields = () => {
|
|
77 |
};
|
78 |
};
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
const lpMetaboxExtraInfo = () => {
|
81 |
$( '.lp_course_extra_meta_box__add' ).on( 'click', function() {
|
82 |
$( this ).closest( '.lp_course_extra_meta_box__content' ).find( '.lp_course_extra_meta_box__fields' ).append( $( this ).data( 'add' ) );
|
@@ -791,6 +846,7 @@ const onReady = function onReady() {
|
|
791 |
lpHidePassingGrade();
|
792 |
lpGetFinalQuiz();
|
793 |
lpMetaboxCondition();
|
|
|
794 |
|
795 |
$( document )
|
796 |
.on( 'click', '.learn-press-payments .status .dashicons', togglePaymentStatus )
|
77 |
};
|
78 |
};
|
79 |
|
80 |
+
const lpMetaboxRepeaterField = () => {
|
81 |
+
const updateSort = ( element ) => {
|
82 |
+
const items = element.find( '.lp_repeater_meta_box__field' );
|
83 |
+
|
84 |
+
items.each( function( i, item ) {
|
85 |
+
$( this ).find( '.lp_repeater_meta_box__field__count' ).val( i );
|
86 |
+
$( this ).find( '.lp_repeater_meta_box__title__title > span' ).text( i + 1 );
|
87 |
+
} );
|
88 |
+
};
|
89 |
+
|
90 |
+
$( '.lp_repeater_meta_box__add' ).on( 'click', function() {
|
91 |
+
const row = $( this ).data( 'add' ).replace( /lp_metabox_repeater_key/gi, Math.floor( Math.random() * 1000 ) + 1 );
|
92 |
+
$( this ).closest( '.lp_repeater_meta_box__wrapper' ).find( '.lp_repeater_meta_box__fields' ).append( row );
|
93 |
+
|
94 |
+
updateSort( $( this ).closest( '.lp_repeater_meta_box__wrapper' ) );
|
95 |
+
$( this ).closest( '.lp_repeater_meta_box__wrapper' ).find( '.lp_repeater_meta_box__fields' ).last().find( 'input' ).trigger( 'focus' );
|
96 |
+
|
97 |
+
return false;
|
98 |
+
} );
|
99 |
+
|
100 |
+
$( '.lp_repeater_meta_box__wrapper' ).on( 'click', 'a.lp_repeater_meta_box__title__delete', function() {
|
101 |
+
$( this ).closest( '.lp_repeater_meta_box__field' ).remove();
|
102 |
+
|
103 |
+
updateSort( $( this ).closest( '.lp_repeater_meta_box__wrapper' ) );
|
104 |
+
|
105 |
+
return false;
|
106 |
+
} );
|
107 |
+
|
108 |
+
$( '.lp_repeater_meta_box__fields' ).on( 'click', '.lp_repeater_meta_box__title__toggle, .lp_repeater_meta_box__title__title', function() {
|
109 |
+
const field = $( this ).closest( '.lp_repeater_meta_box__field' );
|
110 |
+
|
111 |
+
if ( field.hasClass( 'lp_repeater_meta_box__field_active' ) ) {
|
112 |
+
field.removeClass( 'lp_repeater_meta_box__field_active' );
|
113 |
+
} else {
|
114 |
+
field.addClass( 'lp_repeater_meta_box__field_active' );
|
115 |
+
}
|
116 |
+
|
117 |
+
return false;
|
118 |
+
} );
|
119 |
+
|
120 |
+
$( '.lp_repeater_meta_box__fields' ).sortable( {
|
121 |
+
items: '.lp_repeater_meta_box__field',
|
122 |
+
cursor: 'grab',
|
123 |
+
axis: 'y',
|
124 |
+
handle: '.lp_repeater_meta_box__title__sort',
|
125 |
+
scrollSensitivity: 40,
|
126 |
+
forcePlaceholderSize: true,
|
127 |
+
helper: 'clone',
|
128 |
+
opacity: 0.65,
|
129 |
+
update( event, ui ) {
|
130 |
+
updateSort( $( this ).closest( '.lp_repeater_meta_box__wrapper' ) );
|
131 |
+
},
|
132 |
+
} );
|
133 |
+
};
|
134 |
+
|
135 |
const lpMetaboxExtraInfo = () => {
|
136 |
$( '.lp_course_extra_meta_box__add' ).on( 'click', function() {
|
137 |
$( this ).closest( '.lp_course_extra_meta_box__content' ).find( '.lp_course_extra_meta_box__fields' ).append( $( this ).data( 'add' ) );
|
846 |
lpHidePassingGrade();
|
847 |
lpGetFinalQuiz();
|
848 |
lpMetaboxCondition();
|
849 |
+
lpMetaboxRepeaterField();
|
850 |
|
851 |
$( document )
|
852 |
.on( 'click', '.learn-press-payments .status .dashicons', togglePaymentStatus )
|
@@ -1,5 +1,5 @@
|
|
1 |
|
2 |
-
const { debounce } = lodash;
|
3 |
|
4 |
const lpArchiveAddQueryArgs = ( endpoint, args ) => {
|
5 |
const url = new URL( endpoint );
|
@@ -130,7 +130,7 @@ const lpArchiveSearchCourse = () => {
|
|
130 |
const termID = s.querySelector( '[name="term_id"]' ).value || '';
|
131 |
const btn = s.querySelector( '[type="submit"]' );
|
132 |
|
133 |
-
search.addEventListener( 'keyup',
|
134 |
event.preventDefault();
|
135 |
|
136 |
const s = event.target.value;
|
@@ -149,7 +149,7 @@ const lpArchiveSearchCourse = () => {
|
|
149 |
|
150 |
window.history.pushState( '', '', url );
|
151 |
}
|
152 |
-
}
|
153 |
|
154 |
s.addEventListener( 'submit', ( e ) => {
|
155 |
e.preventDefault();
|
1 |
|
2 |
+
//const { debounce } = lodash;
|
3 |
|
4 |
const lpArchiveAddQueryArgs = ( endpoint, args ) => {
|
5 |
const url = new URL( endpoint );
|
130 |
const termID = s.querySelector( '[name="term_id"]' ).value || '';
|
131 |
const btn = s.querySelector( '[type="submit"]' );
|
132 |
|
133 |
+
search.addEventListener( 'keyup', ( event ) => {
|
134 |
event.preventDefault();
|
135 |
|
136 |
const s = event.target.value;
|
149 |
|
150 |
window.history.pushState( '', '', url );
|
151 |
}
|
152 |
+
} );
|
153 |
|
154 |
s.addEventListener( 'submit', ( e ) => {
|
155 |
e.preventDefault();
|
@@ -79,10 +79,7 @@
|
|
79 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
80 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
81 |
</wp:postmeta>
|
82 |
-
|
83 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
84 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
85 |
-
</wp:postmeta>
|
86 |
<wp:postmeta>
|
87 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
88 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
@@ -91,11 +88,6 @@
|
|
91 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
92 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
93 |
</wp:postmeta>
|
94 |
-
<wp:postmeta>
|
95 |
-
<wp:meta_key>_lp_curriculum</wp:meta_key>
|
96 |
-
<wp:meta_value>
|
97 |
-
<![CDATA[a:1:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:0:"";s:5:"items";a:2:{i:614;a:5:{s:4:"name";s:18:"word wide web 2222";s:8:"old_name";s:13:"word wide web";s:7:"item_id";s:4:"1232";s:15:"section_item_id";s:3:"614";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
|
98 |
-
</wp:postmeta>
|
99 |
<wp:section>
|
100 |
<wp:section_id>207</wp:section_id>
|
101 |
<wp:section_name>Section #1</wp:section_name>
|
@@ -189,11 +181,6 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
189 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
190 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
191 |
</wp:postmeta>
|
192 |
-
<wp:postmeta>
|
193 |
-
<wp:meta_key>_lp_curriculum</wp:meta_key>
|
194 |
-
<wp:meta_value>
|
195 |
-
<![CDATA[a:6:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:33:"asd asd asdasd asdasd asdasd asda";s:5:"items";a:15:{i:615;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1146";s:15:"section_item_id";s:3:"615";s:9:"post_type";s:7:"lp_quiz";}i:616;a:5:{s:4:"name";s:18:"where are you now?";s:8:"old_name";s:18:"where are you now?";s:7:"item_id";s:4:"1148";s:15:"section_item_id";s:3:"616";s:9:"post_type";s:9:"lp_lesson";}i:617;a:5:{s:4:"name";s:21:"I am here, beside you";s:8:"old_name";s:21:"I am here, beside you";s:7:"item_id";s:4:"1149";s:15:"section_item_id";s:3:"617";s:9:"post_type";s:7:"lp_quiz";}i:618;a:5:{s:4:"name";s:9:"asdasdasd";s:8:"old_name";s:9:"asdasdasd";s:7:"item_id";s:4:"1143";s:15:"section_item_id";s:3:"618";s:9:"post_type";s:9:"lp_lesson";}i:619;a:5:{s:4:"name";s:9:"dsfsdfsdf";s:8:"old_name";s:9:"dsfsdfsdf";s:7:"item_id";s:4:"1144";s:15:"section_item_id";s:3:"619";s:9:"post_type";s:9:"lp_lesson";}i:620;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1139";s:15:"section_item_id";s:3:"620";s:9:"post_type";s:9:"lp_lesson";}i:621;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1140";s:15:"section_item_id";s:3:"621";s:9:"post_type";s:9:"lp_lesson";}i:622;a:5:{s:4:"name";s:8:"Lesson 3";s:8:"old_name";s:8:"Lesson 3";s:7:"item_id";s:4:"1142";s:15:"section_item_id";s:3:"622";s:9:"post_type";s:9:"lp_lesson";}i:623;a:5:{s:4:"name";s:17:"qqqqqqqqqqqqqqqqq";s:8:"old_name";s:17:"qqqqqqqqqqqqqqqqq";s:7:"item_id";s:4:"1153";s:15:"section_item_id";s:3:"623";s:9:"post_type";s:9:"lp_lesson";}i:624;a:5:{s:4:"name";s:10:"trau va bo";s:8:"old_name";s:10:"trau va bo";s:7:"item_id";s:4:"1154";s:15:"section_item_id";s:3:"624";s:9:"post_type";s:9:"lp_lesson";}i:625;a:5:{s:4:"name";s:19:"adasdasdasda asd as";s:8:"old_name";s:19:"adasdasdasda asd as";s:7:"item_id";s:4:"1164";s:15:"section_item_id";s:3:"625";s:9:"post_type";s:9:"lp_lesson";}i:626;a:5:{s:4:"name";s:19:"asd asda sdasdas da";s:8:"old_name";s:19:"asd asda sdasdas da";s:7:"item_id";s:4:"1165";s:15:"section_item_id";s:3:"626";s:9:"post_type";s:9:"lp_lesson";}i:627;a:5:{s:4:"name";s:16:"asdasdasdasdasda";s:8:"old_name";s:16:"asdasdasdasdasda";s:7:"item_id";s:4:"1166";s:15:"section_item_id";s:3:"627";s:9:"post_type";s:9:"lp_lesson";}i:628;a:5:{s:4:"name";s:18:"assasdasdasdasdasd";s:8:"old_name";s:18:"assasdasdasdasdasd";s:7:"item_id";s:4:"1167";s:15:"section_item_id";s:3:"628";s:9:"post_type";s:9:"lp_lesson";}s:7:"item-14";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:1;a:3:{s:4:"name";s:10:"Section #2";s:11:"description";s:49:"asdas das d asdas das asdasd asdas dasdas dasdasd";s:5:"items";a:5:{i:629;a:5:{s:4:"name";s:22:"How to create a course";s:8:"old_name";s:22:"How to create a course";s:7:"item_id";s:4:"1169";s:15:"section_item_id";s:3:"629";s:9:"post_type";s:9:"lp_lesson";}i:630;a:5:{s:4:"name";s:17:"What is your name";s:8:"old_name";s:17:"What is your name";s:7:"item_id";s:4:"1170";s:15:"section_item_id";s:3:"630";s:9:"post_type";s:9:"lp_lesson";}i:631;a:5:{s:4:"name";s:20:"My name is Tu Nguyen";s:8:"old_name";s:20:"My name is Tu Nguyen";s:7:"item_id";s:4:"1171";s:15:"section_item_id";s:3:"631";s:9:"post_type";s:9:"lp_lesson";}i:632;a:5:{s:4:"name";s:23:"sdfsdfsdf sdf sdf sdf s";s:8:"old_name";s:23:"sdfsdfsdf sdf sdf sdf s";s:7:"item_id";s:4:"1168";s:15:"section_item_id";s:3:"632";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-4";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:2;a:3:{s:4:"name";s:10:"Section #3";s:11:"description";s:0:"";s:5:"items";a:2:{i:633;a:5:{s:4:"name";s:14:"sdfsd fsd fsdf";s:8:"old_name";s:14:"sdfsd fsd fsdf";s:7:"item_id";s:4:"1172";s:15:"section_item_id";s:3:"633";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:3;a:3:{s:4:"name";s:10:"Section #4";s:11:"description";s:0:"";s:5:"items";a:2:{i:634;a:5:{s:4:"name";s:22:"sdf sdfsd fsdf sdfsd f";s:8:"old_name";s:22:"sdf sdfsd fsdf sdfsd f";s:7:"item_id";s:4:"1173";s:15:"section_item_id";s:3:"634";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:4;a:3:{s:4:"name";s:10:"Section #5";s:11:"description";s:0:"";s:5:"items";a:6:{i:635;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1228";s:15:"section_item_id";s:3:"635";s:9:"post_type";s:9:"lp_lesson";}i:636;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1229";s:15:"section_item_id";s:3:"636";s:9:"post_type";s:9:"lp_lesson";}i:637;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1136";s:15:"section_item_id";s:3:"637";s:9:"post_type";s:9:"lp_lesson";}i:638;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1137";s:15:"section_item_id";s:3:"638";s:9:"post_type";s:9:"lp_lesson";}i:639;a:5:{s:4:"name";s:18:"oi troi oi la troi";s:8:"old_name";s:18:"oi troi oi la troi";s:7:"item_id";s:4:"1230";s:15:"section_item_id";s:3:"639";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-5";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:5;a:3:{s:4:"name";s:10:"Section #6";s:11:"description";s:0:"";s:5:"items";a:4:{i:640;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1145";s:15:"section_item_id";s:3:"640";s:9:"post_type";s:9:"lp_lesson";}i:641;a:5:{s:4:"name";s:8:"44444444";s:8:"old_name";s:8:"44444444";s:7:"item_id";s:4:"1227";s:15:"section_item_id";s:3:"641";s:9:"post_type";s:9:"lp_lesson";}i:642;a:5:{s:4:"name";s:6:"cookie";s:8:"old_name";s:6:"cookie";s:7:"item_id";s:4:"1231";s:15:"section_item_id";s:3:"642";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-3";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
|
196 |
-
</wp:postmeta>
|
197 |
<wp:postmeta>
|
198 |
<wp:meta_key>_lp_duration</wp:meta_key>
|
199 |
<wp:meta_value><![CDATA[10]]></wp:meta_value>
|
@@ -553,10 +540,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
553 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
554 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
555 |
</wp:postmeta>
|
556 |
-
|
557 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
558 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
559 |
-
</wp:postmeta>
|
560 |
<wp:postmeta>
|
561 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
562 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
@@ -616,10 +600,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
616 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
617 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
618 |
</wp:postmeta>
|
619 |
-
|
620 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
621 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
622 |
-
</wp:postmeta>
|
623 |
<wp:postmeta>
|
624 |
<wp:meta_key>_edit_lock</wp:meta_key>
|
625 |
<wp:meta_value><![CDATA[1452319835:1]]></wp:meta_value>
|
@@ -879,10 +860,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
879 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
880 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
881 |
</wp:postmeta>
|
882 |
-
|
883 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
884 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
885 |
-
</wp:postmeta>
|
886 |
<wp:postmeta>
|
887 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
888 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
@@ -1046,10 +1024,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1046 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1047 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1048 |
</wp:postmeta>
|
1049 |
-
|
1050 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1051 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1052 |
-
</wp:postmeta>
|
1053 |
</item>
|
1054 |
<item>
|
1055 |
<title>asd asda sdasdas da</title>
|
@@ -1169,10 +1144,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1169 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1170 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1171 |
</wp:postmeta>
|
1172 |
-
|
1173 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1174 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1175 |
-
</wp:postmeta>
|
1176 |
</item>
|
1177 |
<item>
|
1178 |
<title>What is your name</title>
|
@@ -1299,10 +1271,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1299 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1300 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1301 |
</wp:postmeta>
|
1302 |
-
|
1303 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1304 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1305 |
-
</wp:postmeta>
|
1306 |
</item>
|
1307 |
<item>
|
1308 |
<title>sdf sdfsd fsdf sdfsd f</title>
|
@@ -1436,10 +1405,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1436 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1437 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1438 |
</wp:postmeta>
|
1439 |
-
|
1440 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1441 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1442 |
-
</wp:postmeta>
|
1443 |
<wp:postmeta>
|
1444 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
1445 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
@@ -1597,4 +1563,4 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1597 |
</wp:postmeta>
|
1598 |
</item>
|
1599 |
</channel>
|
1600 |
-
</rss>
|
79 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
80 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
81 |
</wp:postmeta>
|
82 |
+
|
|
|
|
|
|
|
83 |
<wp:postmeta>
|
84 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
85 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
88 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
89 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
90 |
</wp:postmeta>
|
|
|
|
|
|
|
|
|
|
|
91 |
<wp:section>
|
92 |
<wp:section_id>207</wp:section_id>
|
93 |
<wp:section_name>Section #1</wp:section_name>
|
181 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
182 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
183 |
</wp:postmeta>
|
|
|
|
|
|
|
|
|
|
|
184 |
<wp:postmeta>
|
185 |
<wp:meta_key>_lp_duration</wp:meta_key>
|
186 |
<wp:meta_value><![CDATA[10]]></wp:meta_value>
|
540 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
541 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
542 |
</wp:postmeta>
|
543 |
+
|
|
|
|
|
|
|
544 |
<wp:postmeta>
|
545 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
546 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
600 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
601 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
602 |
</wp:postmeta>
|
603 |
+
|
|
|
|
|
|
|
604 |
<wp:postmeta>
|
605 |
<wp:meta_key>_edit_lock</wp:meta_key>
|
606 |
<wp:meta_value><![CDATA[1452319835:1]]></wp:meta_value>
|
860 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
861 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
862 |
</wp:postmeta>
|
863 |
+
|
|
|
|
|
|
|
864 |
<wp:postmeta>
|
865 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
866 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1024 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1025 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1026 |
</wp:postmeta>
|
1027 |
+
|
|
|
|
|
|
|
1028 |
</item>
|
1029 |
<item>
|
1030 |
<title>asd asda sdasdas da</title>
|
1144 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1145 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1146 |
</wp:postmeta>
|
1147 |
+
|
|
|
|
|
|
|
1148 |
</item>
|
1149 |
<item>
|
1150 |
<title>What is your name</title>
|
1271 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1272 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1273 |
</wp:postmeta>
|
1274 |
+
|
|
|
|
|
|
|
1275 |
</item>
|
1276 |
<item>
|
1277 |
<title>sdf sdfsd fsdf sdfsd f</title>
|
1405 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1406 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1407 |
</wp:postmeta>
|
1408 |
+
|
|
|
|
|
|
|
1409 |
<wp:postmeta>
|
1410 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
1411 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1563 |
</wp:postmeta>
|
1564 |
</item>
|
1565 |
</channel>
|
1566 |
+
</rss>
|
@@ -66,18 +66,13 @@
|
|
66 |
</wp:postmeta> <wp:postmeta>
|
67 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
68 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
69 |
-
</wp:postmeta>
|
70 |
-
<wp:
|
71 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
72 |
-
</wp:postmeta> <wp:postmeta>
|
73 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
74 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
75 |
</wp:postmeta> <wp:postmeta>
|
76 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
77 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
78 |
-
</wp:postmeta> <wp:postmeta>
|
79 |
-
<wp:meta_key>_lp_curriculum</wp:meta_key>
|
80 |
-
<wp:meta_value><![CDATA[a:1:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:0:"";s:5:"items";a:2:{i:614;a:5:{s:4:"name";s:18:"word wide web 2222";s:8:"old_name";s:13:"word wide web";s:7:"item_id";s:4:"1232";s:15:"section_item_id";s:3:"614";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
|
81 |
</wp:postmeta>
|
82 |
<wp:section>
|
83 |
<wp:section_id>144</wp:section_id>
|
@@ -92,7 +87,7 @@
|
|
92 |
<wp:item_type>lp_lesson</wp:item_type>
|
93 |
</wp:section_item>
|
94 |
</wp:section>
|
95 |
-
|
96 |
</item><item>
|
97 |
<title>word wide web 2222</title>
|
98 |
<link>http://localhost/foobla/learnpress/1.0/lessons/wwwwwwwwwwwwwwwwwwww/</link>
|
@@ -163,10 +158,8 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
163 |
</wp:postmeta> <wp:postmeta>
|
164 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
165 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
166 |
-
</wp:postmeta>
|
167 |
-
<wp:
|
168 |
-
<wp:meta_value><![CDATA[a:6:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:33:"asd asd asdasd asdasd asdasd asda";s:5:"items";a:15:{i:615;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1146";s:15:"section_item_id";s:3:"615";s:9:"post_type";s:7:"lp_quiz";}i:616;a:5:{s:4:"name";s:18:"where are you now?";s:8:"old_name";s:18:"where are you now?";s:7:"item_id";s:4:"1148";s:15:"section_item_id";s:3:"616";s:9:"post_type";s:9:"lp_lesson";}i:617;a:5:{s:4:"name";s:21:"I am here, beside you";s:8:"old_name";s:21:"I am here, beside you";s:7:"item_id";s:4:"1149";s:15:"section_item_id";s:3:"617";s:9:"post_type";s:7:"lp_quiz";}i:618;a:5:{s:4:"name";s:9:"asdasdasd";s:8:"old_name";s:9:"asdasdasd";s:7:"item_id";s:4:"1143";s:15:"section_item_id";s:3:"618";s:9:"post_type";s:9:"lp_lesson";}i:619;a:5:{s:4:"name";s:9:"dsfsdfsdf";s:8:"old_name";s:9:"dsfsdfsdf";s:7:"item_id";s:4:"1144";s:15:"section_item_id";s:3:"619";s:9:"post_type";s:9:"lp_lesson";}i:620;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1139";s:15:"section_item_id";s:3:"620";s:9:"post_type";s:9:"lp_lesson";}i:621;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1140";s:15:"section_item_id";s:3:"621";s:9:"post_type";s:9:"lp_lesson";}i:622;a:5:{s:4:"name";s:8:"Lesson 3";s:8:"old_name";s:8:"Lesson 3";s:7:"item_id";s:4:"1142";s:15:"section_item_id";s:3:"622";s:9:"post_type";s:9:"lp_lesson";}i:623;a:5:{s:4:"name";s:17:"qqqqqqqqqqqqqqqqq";s:8:"old_name";s:17:"qqqqqqqqqqqqqqqqq";s:7:"item_id";s:4:"1153";s:15:"section_item_id";s:3:"623";s:9:"post_type";s:9:"lp_lesson";}i:624;a:5:{s:4:"name";s:10:"trau va bo";s:8:"old_name";s:10:"trau va bo";s:7:"item_id";s:4:"1154";s:15:"section_item_id";s:3:"624";s:9:"post_type";s:9:"lp_lesson";}i:625;a:5:{s:4:"name";s:19:"adasdasdasda asd as";s:8:"old_name";s:19:"adasdasdasda asd as";s:7:"item_id";s:4:"1164";s:15:"section_item_id";s:3:"625";s:9:"post_type";s:9:"lp_lesson";}i:626;a:5:{s:4:"name";s:19:"asd asda sdasdas da";s:8:"old_name";s:19:"asd asda sdasdas da";s:7:"item_id";s:4:"1165";s:15:"section_item_id";s:3:"626";s:9:"post_type";s:9:"lp_lesson";}i:627;a:5:{s:4:"name";s:16:"asdasdasdasdasda";s:8:"old_name";s:16:"asdasdasdasdasda";s:7:"item_id";s:4:"1166";s:15:"section_item_id";s:3:"627";s:9:"post_type";s:9:"lp_lesson";}i:628;a:5:{s:4:"name";s:18:"assasdasdasdasdasd";s:8:"old_name";s:18:"assasdasdasdasdasd";s:7:"item_id";s:4:"1167";s:15:"section_item_id";s:3:"628";s:9:"post_type";s:9:"lp_lesson";}s:7:"item-14";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:1;a:3:{s:4:"name";s:10:"Section #2";s:11:"description";s:49:"asdas das d asdas das asdasd asdas dasdas dasdasd";s:5:"items";a:5:{i:629;a:5:{s:4:"name";s:22:"How to create a course";s:8:"old_name";s:22:"How to create a course";s:7:"item_id";s:4:"1169";s:15:"section_item_id";s:3:"629";s:9:"post_type";s:9:"lp_lesson";}i:630;a:5:{s:4:"name";s:17:"What is your name";s:8:"old_name";s:17:"What is your name";s:7:"item_id";s:4:"1170";s:15:"section_item_id";s:3:"630";s:9:"post_type";s:9:"lp_lesson";}i:631;a:5:{s:4:"name";s:20:"My name is Tu Nguyen";s:8:"old_name";s:20:"My name is Tu Nguyen";s:7:"item_id";s:4:"1171";s:15:"section_item_id";s:3:"631";s:9:"post_type";s:9:"lp_lesson";}i:632;a:5:{s:4:"name";s:23:"sdfsdfsdf sdf sdf sdf s";s:8:"old_name";s:23:"sdfsdfsdf sdf sdf sdf s";s:7:"item_id";s:4:"1168";s:15:"section_item_id";s:3:"632";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-4";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:2;a:3:{s:4:"name";s:10:"Section #3";s:11:"description";s:0:"";s:5:"items";a:2:{i:633;a:5:{s:4:"name";s:14:"sdfsd fsd fsdf";s:8:"old_name";s:14:"sdfsd fsd fsdf";s:7:"item_id";s:4:"1172";s:15:"section_item_id";s:3:"633";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:3;a:3:{s:4:"name";s:10:"Section #4";s:11:"description";s:0:"";s:5:"items";a:2:{i:634;a:5:{s:4:"name";s:22:"sdf sdfsd fsdf sdfsd f";s:8:"old_name";s:22:"sdf sdfsd fsdf sdfsd f";s:7:"item_id";s:4:"1173";s:15:"section_item_id";s:3:"634";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:4;a:3:{s:4:"name";s:10:"Section #5";s:11:"description";s:0:"";s:5:"items";a:6:{i:635;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1228";s:15:"section_item_id";s:3:"635";s:9:"post_type";s:9:"lp_lesson";}i:636;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1229";s:15:"section_item_id";s:3:"636";s:9:"post_type";s:9:"lp_lesson";}i:637;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1136";s:15:"section_item_id";s:3:"637";s:9:"post_type";s:9:"lp_lesson";}i:638;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1137";s:15:"section_item_id";s:3:"638";s:9:"post_type";s:9:"lp_lesson";}i:639;a:5:{s:4:"name";s:18:"oi troi oi la troi";s:8:"old_name";s:18:"oi troi oi la troi";s:7:"item_id";s:4:"1230";s:15:"section_item_id";s:3:"639";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-5";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:5;a:3:{s:4:"name";s:10:"Section #6";s:11:"description";s:0:"";s:5:"items";a:4:{i:640;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1145";s:15:"section_item_id";s:3:"640";s:9:"post_type";s:9:"lp_lesson";}i:641;a:5:{s:4:"name";s:8:"44444444";s:8:"old_name";s:8:"44444444";s:7:"item_id";s:4:"1227";s:15:"section_item_id";s:3:"641";s:9:"post_type";s:9:"lp_lesson";}i:642;a:5:{s:4:"name";s:6:"cookie";s:8:"old_name";s:6:"cookie";s:7:"item_id";s:4:"1231";s:15:"section_item_id";s:3:"642";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-3";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
|
169 |
-
</wp:postmeta> <wp:postmeta>
|
170 |
<wp:meta_key>_lp_duration</wp:meta_key>
|
171 |
<wp:meta_value><![CDATA[10]]></wp:meta_value>
|
172 |
</wp:postmeta> <wp:postmeta>
|
@@ -184,10 +177,8 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
184 |
</wp:postmeta> <wp:postmeta>
|
185 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
186 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
187 |
-
</wp:postmeta>
|
188 |
-
<wp:
|
189 |
-
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
190 |
-
</wp:postmeta> <wp:postmeta>
|
191 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
192 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
193 |
</wp:postmeta> <wp:postmeta>
|
@@ -288,7 +279,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
288 |
<wp:item_type>lp_lesson</wp:item_type>
|
289 |
</wp:section_item>
|
290 |
</wp:section>
|
291 |
-
|
292 |
<wp:section>
|
293 |
<wp:section_id>146</wp:section_id>
|
294 |
<wp:section_name>Section #2</wp:section_name>
|
@@ -320,7 +311,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
320 |
<wp:item_type>lp_quiz</wp:item_type>
|
321 |
</wp:section_item>
|
322 |
</wp:section>
|
323 |
-
|
324 |
<wp:section>
|
325 |
<wp:section_id>147</wp:section_id>
|
326 |
<wp:section_name>Section #3</wp:section_name>
|
@@ -334,7 +325,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
334 |
<wp:item_type>lp_quiz</wp:item_type>
|
335 |
</wp:section_item>
|
336 |
</wp:section>
|
337 |
-
|
338 |
<wp:section>
|
339 |
<wp:section_id>148</wp:section_id>
|
340 |
<wp:section_name>Section #4</wp:section_name>
|
@@ -348,7 +339,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
348 |
<wp:item_type>lp_quiz</wp:item_type>
|
349 |
</wp:section_item>
|
350 |
</wp:section>
|
351 |
-
|
352 |
<wp:section>
|
353 |
<wp:section_id>149</wp:section_id>
|
354 |
<wp:section_name>Section #5</wp:section_name>
|
@@ -386,7 +377,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
386 |
<wp:item_type>lp_lesson</wp:item_type>
|
387 |
</wp:section_item>
|
388 |
</wp:section>
|
389 |
-
|
390 |
<wp:section>
|
391 |
<wp:section_id>150</wp:section_id>
|
392 |
<wp:section_name>Section #6</wp:section_name>
|
@@ -412,7 +403,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
412 |
<wp:item_type>lp_lesson</wp:item_type>
|
413 |
</wp:section_item>
|
414 |
</wp:section>
|
415 |
-
|
416 |
<wp:comment>
|
417 |
<wp:comment_id>89</wp:comment_id>
|
418 |
<wp:comment_author><![CDATA[admin]]></wp:comment_author>
|
@@ -533,10 +524,8 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
533 |
</wp:postmeta> <wp:postmeta>
|
534 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
535 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
536 |
-
</wp:postmeta>
|
537 |
-
<wp:
|
538 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
539 |
-
</wp:postmeta> <wp:postmeta>
|
540 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
541 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
542 |
</wp:postmeta> <wp:postmeta>
|
@@ -586,10 +575,8 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
586 |
</wp:postmeta> <wp:postmeta>
|
587 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
588 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
589 |
-
</wp:postmeta>
|
590 |
-
<wp:
|
591 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
592 |
-
</wp:postmeta> <wp:postmeta>
|
593 |
<wp:meta_key>_edit_lock</wp:meta_key>
|
594 |
<wp:meta_value><![CDATA[1450973326:1]]></wp:meta_value>
|
595 |
</wp:postmeta>
|
@@ -694,10 +681,8 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
694 |
</wp:postmeta> <wp:postmeta>
|
695 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
696 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
697 |
-
</wp:postmeta>
|
698 |
-
<wp:
|
699 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
700 |
-
</wp:postmeta> <wp:postmeta>
|
701 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
702 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
703 |
</wp:postmeta>
|
@@ -854,9 +839,6 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
854 |
</wp:postmeta> <wp:postmeta>
|
855 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
856 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
857 |
-
</wp:postmeta> <wp:postmeta>
|
858 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
859 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
860 |
</wp:postmeta>
|
861 |
</item><item>
|
862 |
<title>asd asda sdasdas da</title>
|
@@ -880,7 +862,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
880 |
<wp:post_password></wp:post_password>
|
881 |
<wp:post_author_id>1</wp:post_author_id>
|
882 |
<wp:is_sticky>0</wp:is_sticky>
|
883 |
-
|
884 |
</item><item>
|
885 |
<title>asdasdasdasdasda</title>
|
886 |
<link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</link>
|
@@ -903,7 +885,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
903 |
<wp:post_password></wp:post_password>
|
904 |
<wp:post_author_id>1</wp:post_author_id>
|
905 |
<wp:is_sticky>0</wp:is_sticky>
|
906 |
-
|
907 |
</item><item>
|
908 |
<title>assasdasdasdasdasd</title>
|
909 |
<link>http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</link>
|
@@ -926,7 +908,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
926 |
<wp:post_password></wp:post_password>
|
927 |
<wp:post_author_id>1</wp:post_author_id>
|
928 |
<wp:is_sticky>0</wp:is_sticky>
|
929 |
-
|
930 |
</item><item>
|
931 |
<title>How to create a course</title>
|
932 |
<link>http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</link>
|
@@ -967,9 +949,6 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
967 |
</wp:postmeta> <wp:postmeta>
|
968 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
969 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
970 |
-
</wp:postmeta> <wp:postmeta>
|
971 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
972 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
973 |
</wp:postmeta>
|
974 |
</item><item>
|
975 |
<title>What is your name</title>
|
@@ -993,7 +972,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
993 |
<wp:post_password></wp:post_password>
|
994 |
<wp:post_author_id>1</wp:post_author_id>
|
995 |
<wp:is_sticky>0</wp:is_sticky>
|
996 |
-
|
997 |
</item><item>
|
998 |
<title>My name is Tu Nguyen</title>
|
999 |
<link>http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</link>
|
@@ -1016,7 +995,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1016 |
<wp:post_password></wp:post_password>
|
1017 |
<wp:post_author_id>1</wp:post_author_id>
|
1018 |
<wp:is_sticky>0</wp:is_sticky>
|
1019 |
-
|
1020 |
</item><item>
|
1021 |
<title>sdfsdfsdf sdf sdf sdf s</title>
|
1022 |
<link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</link>
|
@@ -1086,9 +1065,6 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1086 |
</wp:postmeta> <wp:postmeta>
|
1087 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1088 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1089 |
-
</wp:postmeta> <wp:postmeta>
|
1090 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1091 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1092 |
</wp:postmeta>
|
1093 |
</item><item>
|
1094 |
<title>sdf sdfsd fsdf sdfsd f</title>
|
@@ -1112,7 +1088,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1112 |
<wp:post_password></wp:post_password>
|
1113 |
<wp:post_author_id>1</wp:post_author_id>
|
1114 |
<wp:is_sticky>0</wp:is_sticky>
|
1115 |
-
|
1116 |
</item><item>
|
1117 |
<title>happy new year!</title>
|
1118 |
<link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</link>
|
@@ -1214,10 +1190,8 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1214 |
</wp:postmeta> <wp:postmeta>
|
1215 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1216 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1217 |
-
</wp:postmeta>
|
1218 |
-
<wp:
|
1219 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1220 |
-
</wp:postmeta> <wp:postmeta>
|
1221 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
1222 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1223 |
</wp:postmeta> <wp:postmeta>
|
@@ -1370,4 +1344,4 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1370 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1371 |
</wp:postmeta>
|
1372 |
</item> </channel>
|
1373 |
-
</rss>
|
66 |
</wp:postmeta> <wp:postmeta>
|
67 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
68 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
69 |
+
</wp:postmeta>
|
70 |
+
<wp:postmeta>
|
|
|
|
|
71 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
72 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
73 |
</wp:postmeta> <wp:postmeta>
|
74 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
75 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
|
|
|
|
|
|
76 |
</wp:postmeta>
|
77 |
<wp:section>
|
78 |
<wp:section_id>144</wp:section_id>
|
87 |
<wp:item_type>lp_lesson</wp:item_type>
|
88 |
</wp:section_item>
|
89 |
</wp:section>
|
90 |
+
|
91 |
</item><item>
|
92 |
<title>word wide web 2222</title>
|
93 |
<link>http://localhost/foobla/learnpress/1.0/lessons/wwwwwwwwwwwwwwwwwwww/</link>
|
158 |
</wp:postmeta> <wp:postmeta>
|
159 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
160 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
161 |
+
</wp:postmeta>
|
162 |
+
<wp:postmeta>
|
|
|
|
|
163 |
<wp:meta_key>_lp_duration</wp:meta_key>
|
164 |
<wp:meta_value><![CDATA[10]]></wp:meta_value>
|
165 |
</wp:postmeta> <wp:postmeta>
|
177 |
</wp:postmeta> <wp:postmeta>
|
178 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
179 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
180 |
+
</wp:postmeta>
|
181 |
+
<wp:postmeta>
|
|
|
|
|
182 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
183 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
184 |
</wp:postmeta> <wp:postmeta>
|
279 |
<wp:item_type>lp_lesson</wp:item_type>
|
280 |
</wp:section_item>
|
281 |
</wp:section>
|
282 |
+
|
283 |
<wp:section>
|
284 |
<wp:section_id>146</wp:section_id>
|
285 |
<wp:section_name>Section #2</wp:section_name>
|
311 |
<wp:item_type>lp_quiz</wp:item_type>
|
312 |
</wp:section_item>
|
313 |
</wp:section>
|
314 |
+
|
315 |
<wp:section>
|
316 |
<wp:section_id>147</wp:section_id>
|
317 |
<wp:section_name>Section #3</wp:section_name>
|
325 |
<wp:item_type>lp_quiz</wp:item_type>
|
326 |
</wp:section_item>
|
327 |
</wp:section>
|
328 |
+
|
329 |
<wp:section>
|
330 |
<wp:section_id>148</wp:section_id>
|
331 |
<wp:section_name>Section #4</wp:section_name>
|
339 |
<wp:item_type>lp_quiz</wp:item_type>
|
340 |
</wp:section_item>
|
341 |
</wp:section>
|
342 |
+
|
343 |
<wp:section>
|
344 |
<wp:section_id>149</wp:section_id>
|
345 |
<wp:section_name>Section #5</wp:section_name>
|
377 |
<wp:item_type>lp_lesson</wp:item_type>
|
378 |
</wp:section_item>
|
379 |
</wp:section>
|
380 |
+
|
381 |
<wp:section>
|
382 |
<wp:section_id>150</wp:section_id>
|
383 |
<wp:section_name>Section #6</wp:section_name>
|
403 |
<wp:item_type>lp_lesson</wp:item_type>
|
404 |
</wp:section_item>
|
405 |
</wp:section>
|
406 |
+
|
407 |
<wp:comment>
|
408 |
<wp:comment_id>89</wp:comment_id>
|
409 |
<wp:comment_author><![CDATA[admin]]></wp:comment_author>
|
524 |
</wp:postmeta> <wp:postmeta>
|
525 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
526 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
527 |
+
</wp:postmeta>
|
528 |
+
<wp:postmeta>
|
|
|
|
|
529 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
530 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
531 |
</wp:postmeta> <wp:postmeta>
|
575 |
</wp:postmeta> <wp:postmeta>
|
576 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
577 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
578 |
+
</wp:postmeta>
|
579 |
+
<wp:postmeta>
|
|
|
|
|
580 |
<wp:meta_key>_edit_lock</wp:meta_key>
|
581 |
<wp:meta_value><![CDATA[1450973326:1]]></wp:meta_value>
|
582 |
</wp:postmeta>
|
681 |
</wp:postmeta> <wp:postmeta>
|
682 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
683 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
684 |
+
</wp:postmeta>
|
685 |
+
<wp:postmeta>
|
|
|
|
|
686 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
687 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
688 |
</wp:postmeta>
|
839 |
</wp:postmeta> <wp:postmeta>
|
840 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
841 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
|
|
|
|
|
|
842 |
</wp:postmeta>
|
843 |
</item><item>
|
844 |
<title>asd asda sdasdas da</title>
|
862 |
<wp:post_password></wp:post_password>
|
863 |
<wp:post_author_id>1</wp:post_author_id>
|
864 |
<wp:is_sticky>0</wp:is_sticky>
|
865 |
+
|
866 |
</item><item>
|
867 |
<title>asdasdasdasdasda</title>
|
868 |
<link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</link>
|
885 |
<wp:post_password></wp:post_password>
|
886 |
<wp:post_author_id>1</wp:post_author_id>
|
887 |
<wp:is_sticky>0</wp:is_sticky>
|
888 |
+
|
889 |
</item><item>
|
890 |
<title>assasdasdasdasdasd</title>
|
891 |
<link>http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</link>
|
908 |
<wp:post_password></wp:post_password>
|
909 |
<wp:post_author_id>1</wp:post_author_id>
|
910 |
<wp:is_sticky>0</wp:is_sticky>
|
911 |
+
|
912 |
</item><item>
|
913 |
<title>How to create a course</title>
|
914 |
<link>http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</link>
|
949 |
</wp:postmeta> <wp:postmeta>
|
950 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
951 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
|
|
|
|
|
|
952 |
</wp:postmeta>
|
953 |
</item><item>
|
954 |
<title>What is your name</title>
|
972 |
<wp:post_password></wp:post_password>
|
973 |
<wp:post_author_id>1</wp:post_author_id>
|
974 |
<wp:is_sticky>0</wp:is_sticky>
|
975 |
+
|
976 |
</item><item>
|
977 |
<title>My name is Tu Nguyen</title>
|
978 |
<link>http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</link>
|
995 |
<wp:post_password></wp:post_password>
|
996 |
<wp:post_author_id>1</wp:post_author_id>
|
997 |
<wp:is_sticky>0</wp:is_sticky>
|
998 |
+
|
999 |
</item><item>
|
1000 |
<title>sdfsdfsdf sdf sdf sdf s</title>
|
1001 |
<link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</link>
|
1065 |
</wp:postmeta> <wp:postmeta>
|
1066 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1067 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
|
|
|
|
|
|
1068 |
</wp:postmeta>
|
1069 |
</item><item>
|
1070 |
<title>sdf sdfsd fsdf sdfsd f</title>
|
1088 |
<wp:post_password></wp:post_password>
|
1089 |
<wp:post_author_id>1</wp:post_author_id>
|
1090 |
<wp:is_sticky>0</wp:is_sticky>
|
1091 |
+
|
1092 |
</item><item>
|
1093 |
<title>happy new year!</title>
|
1094 |
<link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</link>
|
1190 |
</wp:postmeta> <wp:postmeta>
|
1191 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1192 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1193 |
+
</wp:postmeta>
|
1194 |
+
<wp:postmeta>
|
|
|
|
|
1195 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
1196 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1197 |
</wp:postmeta> <wp:postmeta>
|
1344 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1345 |
</wp:postmeta>
|
1346 |
</item> </channel>
|
1347 |
+
</rss>
|
@@ -65,18 +65,13 @@
|
|
65 |
</wp:postmeta> <wp:postmeta>
|
66 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
67 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
68 |
-
</wp:postmeta>
|
69 |
-
<wp:
|
70 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
71 |
-
</wp:postmeta> <wp:postmeta>
|
72 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
73 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
74 |
</wp:postmeta> <wp:postmeta>
|
75 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
76 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
77 |
-
</wp:postmeta> <wp:postmeta>
|
78 |
-
<wp:meta_key>_lp_curriculum</wp:meta_key>
|
79 |
-
<wp:meta_value><![CDATA[a:1:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:0:"";s:5:"items";a:2:{i:614;a:5:{s:4:"name";s:18:"word wide web 2222";s:8:"old_name";s:13:"word wide web";s:7:"item_id";s:4:"1232";s:15:"section_item_id";s:3:"614";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
|
80 |
</wp:postmeta>
|
81 |
<wp:section>
|
82 |
<wp:section_id>207</wp:section_id>
|
@@ -91,7 +86,7 @@
|
|
91 |
<wp:item_type>lp_lesson</wp:item_type>
|
92 |
</wp:section_item>
|
93 |
</wp:section>
|
94 |
-
|
95 |
</item><item>
|
96 |
<title>word wide web 2222</title>
|
97 |
<link>http://localhost/foobla/learnpress/1.0/lessons/wwwwwwwwwwwwwwwwwwww/</link>
|
@@ -162,10 +157,8 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
162 |
</wp:postmeta> <wp:postmeta>
|
163 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
164 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
165 |
-
</wp:postmeta>
|
166 |
-
<wp:
|
167 |
-
<wp:meta_value><![CDATA[a:6:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:33:"asd asd asdasd asdasd asdasd asda";s:5:"items";a:15:{i:615;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1146";s:15:"section_item_id";s:3:"615";s:9:"post_type";s:7:"lp_quiz";}i:616;a:5:{s:4:"name";s:18:"where are you now?";s:8:"old_name";s:18:"where are you now?";s:7:"item_id";s:4:"1148";s:15:"section_item_id";s:3:"616";s:9:"post_type";s:9:"lp_lesson";}i:617;a:5:{s:4:"name";s:21:"I am here, beside you";s:8:"old_name";s:21:"I am here, beside you";s:7:"item_id";s:4:"1149";s:15:"section_item_id";s:3:"617";s:9:"post_type";s:7:"lp_quiz";}i:618;a:5:{s:4:"name";s:9:"asdasdasd";s:8:"old_name";s:9:"asdasdasd";s:7:"item_id";s:4:"1143";s:15:"section_item_id";s:3:"618";s:9:"post_type";s:9:"lp_lesson";}i:619;a:5:{s:4:"name";s:9:"dsfsdfsdf";s:8:"old_name";s:9:"dsfsdfsdf";s:7:"item_id";s:4:"1144";s:15:"section_item_id";s:3:"619";s:9:"post_type";s:9:"lp_lesson";}i:620;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1139";s:15:"section_item_id";s:3:"620";s:9:"post_type";s:9:"lp_lesson";}i:621;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1140";s:15:"section_item_id";s:3:"621";s:9:"post_type";s:9:"lp_lesson";}i:622;a:5:{s:4:"name";s:8:"Lesson 3";s:8:"old_name";s:8:"Lesson 3";s:7:"item_id";s:4:"1142";s:15:"section_item_id";s:3:"622";s:9:"post_type";s:9:"lp_lesson";}i:623;a:5:{s:4:"name";s:17:"qqqqqqqqqqqqqqqqq";s:8:"old_name";s:17:"qqqqqqqqqqqqqqqqq";s:7:"item_id";s:4:"1153";s:15:"section_item_id";s:3:"623";s:9:"post_type";s:9:"lp_lesson";}i:624;a:5:{s:4:"name";s:10:"trau va bo";s:8:"old_name";s:10:"trau va bo";s:7:"item_id";s:4:"1154";s:15:"section_item_id";s:3:"624";s:9:"post_type";s:9:"lp_lesson";}i:625;a:5:{s:4:"name";s:19:"adasdasdasda asd as";s:8:"old_name";s:19:"adasdasdasda asd as";s:7:"item_id";s:4:"1164";s:15:"section_item_id";s:3:"625";s:9:"post_type";s:9:"lp_lesson";}i:626;a:5:{s:4:"name";s:19:"asd asda sdasdas da";s:8:"old_name";s:19:"asd asda sdasdas da";s:7:"item_id";s:4:"1165";s:15:"section_item_id";s:3:"626";s:9:"post_type";s:9:"lp_lesson";}i:627;a:5:{s:4:"name";s:16:"asdasdasdasdasda";s:8:"old_name";s:16:"asdasdasdasdasda";s:7:"item_id";s:4:"1166";s:15:"section_item_id";s:3:"627";s:9:"post_type";s:9:"lp_lesson";}i:628;a:5:{s:4:"name";s:18:"assasdasdasdasdasd";s:8:"old_name";s:18:"assasdasdasdasdasd";s:7:"item_id";s:4:"1167";s:15:"section_item_id";s:3:"628";s:9:"post_type";s:9:"lp_lesson";}s:7:"item-14";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:1;a:3:{s:4:"name";s:10:"Section #2";s:11:"description";s:49:"asdas das d asdas das asdasd asdas dasdas dasdasd";s:5:"items";a:5:{i:629;a:5:{s:4:"name";s:22:"How to create a course";s:8:"old_name";s:22:"How to create a course";s:7:"item_id";s:4:"1169";s:15:"section_item_id";s:3:"629";s:9:"post_type";s:9:"lp_lesson";}i:630;a:5:{s:4:"name";s:17:"What is your name";s:8:"old_name";s:17:"What is your name";s:7:"item_id";s:4:"1170";s:15:"section_item_id";s:3:"630";s:9:"post_type";s:9:"lp_lesson";}i:631;a:5:{s:4:"name";s:20:"My name is Tu Nguyen";s:8:"old_name";s:20:"My name is Tu Nguyen";s:7:"item_id";s:4:"1171";s:15:"section_item_id";s:3:"631";s:9:"post_type";s:9:"lp_lesson";}i:632;a:5:{s:4:"name";s:23:"sdfsdfsdf sdf sdf sdf s";s:8:"old_name";s:23:"sdfsdfsdf sdf sdf sdf s";s:7:"item_id";s:4:"1168";s:15:"section_item_id";s:3:"632";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-4";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:2;a:3:{s:4:"name";s:10:"Section #3";s:11:"description";s:0:"";s:5:"items";a:2:{i:633;a:5:{s:4:"name";s:14:"sdfsd fsd fsdf";s:8:"old_name";s:14:"sdfsd fsd fsdf";s:7:"item_id";s:4:"1172";s:15:"section_item_id";s:3:"633";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:3;a:3:{s:4:"name";s:10:"Section #4";s:11:"description";s:0:"";s:5:"items";a:2:{i:634;a:5:{s:4:"name";s:22:"sdf sdfsd fsdf sdfsd f";s:8:"old_name";s:22:"sdf sdfsd fsdf sdfsd f";s:7:"item_id";s:4:"1173";s:15:"section_item_id";s:3:"634";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:4;a:3:{s:4:"name";s:10:"Section #5";s:11:"description";s:0:"";s:5:"items";a:6:{i:635;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1228";s:15:"section_item_id";s:3:"635";s:9:"post_type";s:9:"lp_lesson";}i:636;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1229";s:15:"section_item_id";s:3:"636";s:9:"post_type";s:9:"lp_lesson";}i:637;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1136";s:15:"section_item_id";s:3:"637";s:9:"post_type";s:9:"lp_lesson";}i:638;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1137";s:15:"section_item_id";s:3:"638";s:9:"post_type";s:9:"lp_lesson";}i:639;a:5:{s:4:"name";s:18:"oi troi oi la troi";s:8:"old_name";s:18:"oi troi oi la troi";s:7:"item_id";s:4:"1230";s:15:"section_item_id";s:3:"639";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-5";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:5;a:3:{s:4:"name";s:10:"Section #6";s:11:"description";s:0:"";s:5:"items";a:4:{i:640;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1145";s:15:"section_item_id";s:3:"640";s:9:"post_type";s:9:"lp_lesson";}i:641;a:5:{s:4:"name";s:8:"44444444";s:8:"old_name";s:8:"44444444";s:7:"item_id";s:4:"1227";s:15:"section_item_id";s:3:"641";s:9:"post_type";s:9:"lp_lesson";}i:642;a:5:{s:4:"name";s:6:"cookie";s:8:"old_name";s:6:"cookie";s:7:"item_id";s:4:"1231";s:15:"section_item_id";s:3:"642";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-3";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
|
168 |
-
</wp:postmeta> <wp:postmeta>
|
169 |
<wp:meta_key>_lp_duration</wp:meta_key>
|
170 |
<wp:meta_value><![CDATA[10]]></wp:meta_value>
|
171 |
</wp:postmeta> <wp:postmeta>
|
@@ -183,10 +176,8 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
183 |
</wp:postmeta> <wp:postmeta>
|
184 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
185 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
186 |
-
</wp:postmeta>
|
187 |
-
<wp:
|
188 |
-
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
189 |
-
</wp:postmeta> <wp:postmeta>
|
190 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
191 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
192 |
</wp:postmeta> <wp:postmeta>
|
@@ -287,7 +278,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
287 |
<wp:item_type>lp_lesson</wp:item_type>
|
288 |
</wp:section_item>
|
289 |
</wp:section>
|
290 |
-
|
291 |
<wp:section>
|
292 |
<wp:section_id>209</wp:section_id>
|
293 |
<wp:section_name>Section #2</wp:section_name>
|
@@ -319,7 +310,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
319 |
<wp:item_type>lp_quiz</wp:item_type>
|
320 |
</wp:section_item>
|
321 |
</wp:section>
|
322 |
-
|
323 |
<wp:section>
|
324 |
<wp:section_id>210</wp:section_id>
|
325 |
<wp:section_name>Section #3</wp:section_name>
|
@@ -333,7 +324,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
333 |
<wp:item_type>lp_quiz</wp:item_type>
|
334 |
</wp:section_item>
|
335 |
</wp:section>
|
336 |
-
|
337 |
<wp:section>
|
338 |
<wp:section_id>211</wp:section_id>
|
339 |
<wp:section_name>Section #4</wp:section_name>
|
@@ -347,7 +338,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
347 |
<wp:item_type>lp_quiz</wp:item_type>
|
348 |
</wp:section_item>
|
349 |
</wp:section>
|
350 |
-
|
351 |
<wp:section>
|
352 |
<wp:section_id>212</wp:section_id>
|
353 |
<wp:section_name>Section #5</wp:section_name>
|
@@ -385,7 +376,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
385 |
<wp:item_type>lp_lesson</wp:item_type>
|
386 |
</wp:section_item>
|
387 |
</wp:section>
|
388 |
-
|
389 |
<wp:section>
|
390 |
<wp:section_id>213</wp:section_id>
|
391 |
<wp:section_name>Section #6</wp:section_name>
|
@@ -411,7 +402,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
|
411 |
<wp:item_type>lp_lesson</wp:item_type>
|
412 |
</wp:section_item>
|
413 |
</wp:section>
|
414 |
-
|
415 |
</item><item>
|
416 |
<title>333333333333</title>
|
417 |
<link>http://localhost/foobla/learnpress/1.0/quizzes/333333333333-2/</link>
|
@@ -501,10 +492,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
501 |
</wp:postmeta> <wp:postmeta>
|
502 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
503 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
504 |
-
</wp:postmeta>
|
505 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
506 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
507 |
-
</wp:postmeta> <wp:postmeta>
|
508 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
509 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
510 |
</wp:postmeta> <wp:postmeta>
|
@@ -554,10 +542,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
554 |
</wp:postmeta> <wp:postmeta>
|
555 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
556 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
557 |
-
</wp:postmeta>
|
558 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
559 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
560 |
-
</wp:postmeta> <wp:postmeta>
|
561 |
<wp:meta_key>_edit_lock</wp:meta_key>
|
562 |
<wp:meta_value><![CDATA[1452319835:1]]></wp:meta_value>
|
563 |
</wp:postmeta> <wp:postmeta>
|
@@ -790,10 +775,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
790 |
</wp:postmeta> <wp:postmeta>
|
791 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
792 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
793 |
-
</wp:postmeta>
|
794 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
795 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
796 |
-
</wp:postmeta> <wp:postmeta>
|
797 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
798 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
799 |
</wp:postmeta>
|
@@ -944,9 +926,6 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
944 |
</wp:postmeta> <wp:postmeta>
|
945 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
946 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
947 |
-
</wp:postmeta> <wp:postmeta>
|
948 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
949 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
950 |
</wp:postmeta>
|
951 |
</item><item>
|
952 |
<title>asd asda sdasdas da</title>
|
@@ -970,7 +949,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
970 |
<wp:post_password></wp:post_password>
|
971 |
<wp:post_author_id>1</wp:post_author_id>
|
972 |
<wp:is_sticky>0</wp:is_sticky>
|
973 |
-
|
974 |
</item><item>
|
975 |
<title>asdasdasdasdasda</title>
|
976 |
<link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</link>
|
@@ -993,7 +972,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
993 |
<wp:post_password></wp:post_password>
|
994 |
<wp:post_author_id>1</wp:post_author_id>
|
995 |
<wp:is_sticky>0</wp:is_sticky>
|
996 |
-
|
997 |
</item><item>
|
998 |
<title>assasdasdasdasdasd</title>
|
999 |
<link>http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</link>
|
@@ -1016,7 +995,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1016 |
<wp:post_password></wp:post_password>
|
1017 |
<wp:post_author_id>1</wp:post_author_id>
|
1018 |
<wp:is_sticky>0</wp:is_sticky>
|
1019 |
-
|
1020 |
</item><item>
|
1021 |
<title>How to create a course</title>
|
1022 |
<link>http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</link>
|
@@ -1057,9 +1036,6 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1057 |
</wp:postmeta> <wp:postmeta>
|
1058 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1059 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1060 |
-
</wp:postmeta> <wp:postmeta>
|
1061 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1062 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1063 |
</wp:postmeta>
|
1064 |
</item><item>
|
1065 |
<title>What is your name</title>
|
@@ -1083,7 +1059,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1083 |
<wp:post_password></wp:post_password>
|
1084 |
<wp:post_author_id>1</wp:post_author_id>
|
1085 |
<wp:is_sticky>0</wp:is_sticky>
|
1086 |
-
|
1087 |
</item><item>
|
1088 |
<title>My name is Tu Nguyen</title>
|
1089 |
<link>http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</link>
|
@@ -1106,7 +1082,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1106 |
<wp:post_password></wp:post_password>
|
1107 |
<wp:post_author_id>1</wp:post_author_id>
|
1108 |
<wp:is_sticky>0</wp:is_sticky>
|
1109 |
-
|
1110 |
</item><item>
|
1111 |
<title>sdfsdfsdf sdf sdf sdf s</title>
|
1112 |
<link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</link>
|
@@ -1176,9 +1152,6 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1176 |
</wp:postmeta> <wp:postmeta>
|
1177 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1178 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1179 |
-
</wp:postmeta> <wp:postmeta>
|
1180 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1181 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1182 |
</wp:postmeta>
|
1183 |
</item><item>
|
1184 |
<title>sdf sdfsd fsdf sdfsd f</title>
|
@@ -1202,7 +1175,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1202 |
<wp:post_password></wp:post_password>
|
1203 |
<wp:post_author_id>1</wp:post_author_id>
|
1204 |
<wp:is_sticky>0</wp:is_sticky>
|
1205 |
-
|
1206 |
</item><item>
|
1207 |
<title>happy new year!</title>
|
1208 |
<link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</link>
|
@@ -1301,10 +1274,7 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1301 |
</wp:postmeta> <wp:postmeta>
|
1302 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1303 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1304 |
-
</wp:postmeta>
|
1305 |
-
<wp:meta_key>_lp_payment</wp:meta_key>
|
1306 |
-
<wp:meta_value><![CDATA[free]]></wp:meta_value>
|
1307 |
-
</wp:postmeta> <wp:postmeta>
|
1308 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
1309 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1310 |
</wp:postmeta> <wp:postmeta>
|
@@ -1451,4 +1421,4 @@ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc
|
|
1451 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1452 |
</wp:postmeta>
|
1453 |
</item> </channel>
|
1454 |
-
</rss>
|
65 |
</wp:postmeta> <wp:postmeta>
|
66 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
67 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
68 |
+
</wp:postmeta>
|
69 |
+
<wp:postmeta>
|
|
|
|
|
70 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
71 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
72 |
</wp:postmeta> <wp:postmeta>
|
73 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
74 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
|
|
|
|
|
|
75 |
</wp:postmeta>
|
76 |
<wp:section>
|
77 |
<wp:section_id>207</wp:section_id>
|
86 |
<wp:item_type>lp_lesson</wp:item_type>
|
87 |
</wp:section_item>
|
88 |
</wp:section>
|
89 |
+
|
90 |
</item><item>
|
91 |
<title>word wide web 2222</title>
|
92 |
<link>http://localhost/foobla/learnpress/1.0/lessons/wwwwwwwwwwwwwwwwwwww/</link>
|
157 |
</wp:postmeta> <wp:postmeta>
|
158 |
<wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
|
159 |
<wp:meta_value><![CDATA[]]></wp:meta_value>
|
160 |
+
</wp:postmeta>
|
161 |
+
<wp:postmeta>
|
|
|
|
|
162 |
<wp:meta_key>_lp_duration</wp:meta_key>
|
163 |
<wp:meta_value><![CDATA[10]]></wp:meta_value>
|
164 |
</wp:postmeta> <wp:postmeta>
|
176 |
</wp:postmeta> <wp:postmeta>
|
177 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
178 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
179 |
+
</wp:postmeta>
|
180 |
+
<wp:postmeta>
|
|
|
|
|
181 |
<wp:meta_key>_lp_course_status</wp:meta_key>
|
182 |
<wp:meta_value><![CDATA[publish]]></wp:meta_value>
|
183 |
</wp:postmeta> <wp:postmeta>
|
278 |
<wp:item_type>lp_lesson</wp:item_type>
|
279 |
</wp:section_item>
|
280 |
</wp:section>
|
281 |
+
|
282 |
<wp:section>
|
283 |
<wp:section_id>209</wp:section_id>
|
284 |
<wp:section_name>Section #2</wp:section_name>
|
310 |
<wp:item_type>lp_quiz</wp:item_type>
|
311 |
</wp:section_item>
|
312 |
</wp:section>
|
313 |
+
|
314 |
<wp:section>
|
315 |
<wp:section_id>210</wp:section_id>
|
316 |
<wp:section_name>Section #3</wp:section_name>
|
324 |
<wp:item_type>lp_quiz</wp:item_type>
|
325 |
</wp:section_item>
|
326 |
</wp:section>
|
327 |
+
|
328 |
<wp:section>
|
329 |
<wp:section_id>211</wp:section_id>
|
330 |
<wp:section_name>Section #4</wp:section_name>
|
338 |
<wp:item_type>lp_quiz</wp:item_type>
|
339 |
</wp:section_item>
|
340 |
</wp:section>
|
341 |
+
|
342 |
<wp:section>
|
343 |
<wp:section_id>212</wp:section_id>
|
344 |
<wp:section_name>Section #5</wp:section_name>
|
376 |
<wp:item_type>lp_lesson</wp:item_type>
|
377 |
</wp:section_item>
|
378 |
</wp:section>
|
379 |
+
|
380 |
<wp:section>
|
381 |
<wp:section_id>213</wp:section_id>
|
382 |
<wp:section_name>Section #6</wp:section_name>
|
402 |
<wp:item_type>lp_lesson</wp:item_type>
|
403 |
</wp:section_item>
|
404 |
</wp:section>
|
405 |
+
|
406 |
</item><item>
|
407 |
<title>333333333333</title>
|
408 |
<link>http://localhost/foobla/learnpress/1.0/quizzes/333333333333-2/</link>
|
492 |
</wp:postmeta> <wp:postmeta>
|
493 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
494 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
495 |
+
</wp:postmeta> <wp:postmeta>
|
|
|
|
|
|
|
496 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
497 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
498 |
</wp:postmeta> <wp:postmeta>
|
542 |
</wp:postmeta> <wp:postmeta>
|
543 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
544 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
545 |
+
</wp:postmeta> <wp:postmeta>
|
|
|
|
|
|
|
546 |
<wp:meta_key>_edit_lock</wp:meta_key>
|
547 |
<wp:meta_value><![CDATA[1452319835:1]]></wp:meta_value>
|
548 |
</wp:postmeta> <wp:postmeta>
|
775 |
</wp:postmeta> <wp:postmeta>
|
776 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
777 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
778 |
+
</wp:postmeta> <wp:postmeta>
|
|
|
|
|
|
|
779 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
780 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
781 |
</wp:postmeta>
|
926 |
</wp:postmeta> <wp:postmeta>
|
927 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
928 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
|
|
|
|
|
|
929 |
</wp:postmeta>
|
930 |
</item><item>
|
931 |
<title>asd asda sdasdas da</title>
|
949 |
<wp:post_password></wp:post_password>
|
950 |
<wp:post_author_id>1</wp:post_author_id>
|
951 |
<wp:is_sticky>0</wp:is_sticky>
|
952 |
+
|
953 |
</item><item>
|
954 |
<title>asdasdasdasdasda</title>
|
955 |
<link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</link>
|
972 |
<wp:post_password></wp:post_password>
|
973 |
<wp:post_author_id>1</wp:post_author_id>
|
974 |
<wp:is_sticky>0</wp:is_sticky>
|
975 |
+
|
976 |
</item><item>
|
977 |
<title>assasdasdasdasdasd</title>
|
978 |
<link>http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</link>
|
995 |
<wp:post_password></wp:post_password>
|
996 |
<wp:post_author_id>1</wp:post_author_id>
|
997 |
<wp:is_sticky>0</wp:is_sticky>
|
998 |
+
|
999 |
</item><item>
|
1000 |
<title>How to create a course</title>
|
1001 |
<link>http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</link>
|
1036 |
</wp:postmeta> <wp:postmeta>
|
1037 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1038 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
|
|
|
|
|
|
1039 |
</wp:postmeta>
|
1040 |
</item><item>
|
1041 |
<title>What is your name</title>
|
1059 |
<wp:post_password></wp:post_password>
|
1060 |
<wp:post_author_id>1</wp:post_author_id>
|
1061 |
<wp:is_sticky>0</wp:is_sticky>
|
1062 |
+
|
1063 |
</item><item>
|
1064 |
<title>My name is Tu Nguyen</title>
|
1065 |
<link>http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</link>
|
1082 |
<wp:post_password></wp:post_password>
|
1083 |
<wp:post_author_id>1</wp:post_author_id>
|
1084 |
<wp:is_sticky>0</wp:is_sticky>
|
1085 |
+
|
1086 |
</item><item>
|
1087 |
<title>sdfsdfsdf sdf sdf sdf s</title>
|
1088 |
<link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</link>
|
1152 |
</wp:postmeta> <wp:postmeta>
|
1153 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1154 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
|
|
|
|
|
|
1155 |
</wp:postmeta>
|
1156 |
</item><item>
|
1157 |
<title>sdf sdfsd fsdf sdfsd f</title>
|
1175 |
<wp:post_password></wp:post_password>
|
1176 |
<wp:post_author_id>1</wp:post_author_id>
|
1177 |
<wp:is_sticky>0</wp:is_sticky>
|
1178 |
+
|
1179 |
</item><item>
|
1180 |
<title>happy new year!</title>
|
1181 |
<link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</link>
|
1274 |
</wp:postmeta> <wp:postmeta>
|
1275 |
<wp:meta_key>_lp_enroll_requirement</wp:meta_key>
|
1276 |
<wp:meta_value><![CDATA[yes]]></wp:meta_value>
|
1277 |
+
</wp:postmeta> <wp:postmeta>
|
|
|
|
|
|
|
1278 |
<wp:meta_key>_lp_is_previewable</wp:meta_key>
|
1279 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1280 |
</wp:postmeta> <wp:postmeta>
|
1421 |
<wp:meta_value><![CDATA[no]]></wp:meta_value>
|
1422 |
</wp:postmeta>
|
1423 |
</item> </channel>
|
1424 |
+
</rss>
|
@@ -23,9 +23,23 @@ abstract class LP_Abstract_Assets {
|
|
23 |
* @var array
|
24 |
*/
|
25 |
protected $_script_data = array();
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
public static $_min_assets = '.min';
|
|
|
|
|
|
|
|
|
|
|
28 |
public static $_version_assets = LEARNPRESS_VERSION;
|
|
|
|
|
|
|
|
|
|
|
29 |
public static $_folder_source = '';
|
30 |
|
31 |
/**
|
@@ -57,7 +71,7 @@ abstract class LP_Abstract_Assets {
|
|
57 |
*
|
58 |
* @return array
|
59 |
*/
|
60 |
-
protected function _get_scripts() {
|
61 |
return array();
|
62 |
}
|
63 |
|
@@ -66,10 +80,131 @@ abstract class LP_Abstract_Assets {
|
|
66 |
*
|
67 |
* @return array
|
68 |
*/
|
69 |
-
protected function _get_styles() {
|
70 |
return array();
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
/**
|
74 |
* Register style
|
75 |
*
|
@@ -244,12 +379,8 @@ abstract class LP_Abstract_Assets {
|
|
244 |
return 'lp' . str_replace( ' ', '', $handle ) . 'Settings';
|
245 |
}
|
246 |
|
247 |
-
public function _get_admin_script_data() {
|
248 |
-
return false;
|
249 |
-
}
|
250 |
-
|
251 |
public function localize_printed_scripts( $side = '' ) {
|
252 |
-
$scripts_data =
|
253 |
|
254 |
if ( is_array( $scripts_data ) && is_array( $this->_script_data ) ) {
|
255 |
$scripts_data = LP_Helper::array_merge_recursive( $scripts_data, $this->_script_data );
|
@@ -315,20 +446,16 @@ abstract class LP_Abstract_Assets {
|
|
315 |
}
|
316 |
|
317 |
/**
|
318 |
-
* Shortcut to
|
319 |
*
|
320 |
* @param string $file
|
321 |
*
|
322 |
* @return string
|
323 |
*/
|
324 |
-
public function url( $file = '' ) {
|
325 |
return LP_PLUGIN_URL . "assets/{$file}";
|
326 |
}
|
327 |
|
328 |
-
public function get_compressible_assets() {
|
329 |
-
return array();
|
330 |
-
}
|
331 |
-
|
332 |
public static function add_param() {
|
333 |
|
334 |
}
|
23 |
* @var array
|
24 |
*/
|
25 |
protected $_script_data = array();
|
26 |
+
/**
|
27 |
+
* Path file min
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
public static $_min_assets = '.min';
|
32 |
+
/**
|
33 |
+
* Version file asset
|
34 |
+
*
|
35 |
+
* @var mixed|string
|
36 |
+
*/
|
37 |
public static $_version_assets = LEARNPRESS_VERSION;
|
38 |
+
/**
|
39 |
+
* Path file
|
40 |
+
*
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
public static $_folder_source = '';
|
44 |
|
45 |
/**
|
71 |
*
|
72 |
* @return array
|
73 |
*/
|
74 |
+
protected function _get_scripts(): array {
|
75 |
return array();
|
76 |
}
|
77 |
|
80 |
*
|
81 |
* @return array
|
82 |
*/
|
83 |
+
protected function _get_styles(): array {
|
84 |
return array();
|
85 |
}
|
86 |
|
87 |
+
/**
|
88 |
+
* Register/Enqueue script
|
89 |
+
*
|
90 |
+
* @param string $page_current
|
91 |
+
* @author tungnx
|
92 |
+
* @since 4.0.0
|
93 |
+
* @version 1.0.1
|
94 |
+
*/
|
95 |
+
protected function handle_js( string $page_current = '' ) {
|
96 |
+
$scripts = $this->_get_scripts();
|
97 |
+
/**
|
98 |
+
* @var LP_Asset_Key[] $scripts
|
99 |
+
*/
|
100 |
+
foreach ( $scripts as $handle => $script ) {
|
101 |
+
if ( ! $script instanceof LP_Asset_Key ) {
|
102 |
+
continue;
|
103 |
+
}
|
104 |
+
|
105 |
+
// For version addon.
|
106 |
+
if ( ! LP_Debug::is_debug() && ! empty( $script->_version ) ) {
|
107 |
+
self::$_version_assets = $script->_version;
|
108 |
+
}
|
109 |
+
// End
|
110 |
+
|
111 |
+
wp_register_script( $handle, $script->_url, $script->_deps, self::$_version_assets, $script->_in_footer );
|
112 |
+
|
113 |
+
if ( ! $script->_only_register ) {
|
114 |
+
$can_load_js = $this->check_can_load_asset( $handle, $page_current, $script->_screens, $script->_exclude_screens );
|
115 |
+
|
116 |
+
if ( $can_load_js ) {
|
117 |
+
wp_enqueue_script( $handle );
|
118 |
+
}
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Set translate on file js of folder js/dist
|
124 |
+
* Path translate of a string on file ".pot" if have must map to js/dist
|
125 |
+
*/
|
126 |
+
wp_set_script_translations( 'lp-quiz', 'learnpress' );
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Register/Enqueue style
|
131 |
+
*
|
132 |
+
* @param string $page_current
|
133 |
+
* @author tungnx
|
134 |
+
* @since 4.1.3
|
135 |
+
* @version 1.0.0
|
136 |
+
*/
|
137 |
+
protected function handle_style( string $page_current = '' ) {
|
138 |
+
$styles = $this->_get_styles();
|
139 |
+
if ( $styles ) {
|
140 |
+
/**
|
141 |
+
* @var LP_Asset_Key[] $style
|
142 |
+
*/
|
143 |
+
foreach ( $styles as $handle => $style ) {
|
144 |
+
if ( ! $style instanceof LP_Asset_Key ) {
|
145 |
+
continue;
|
146 |
+
}
|
147 |
+
|
148 |
+
// For version addon.
|
149 |
+
if ( ! LP_Debug::is_debug() && ! empty( $style->_version ) ) {
|
150 |
+
self::$_version_assets = $style->_version;
|
151 |
+
}
|
152 |
+
// End
|
153 |
+
|
154 |
+
wp_register_style( $handle, $style->_url, $style->_deps, self::$_version_assets );
|
155 |
+
|
156 |
+
if ( ! $style->_only_register ) {
|
157 |
+
$can_load_style = $this->check_can_load_asset( $handle, $page_current, $style->_screens, $style->_exclude_screens );
|
158 |
+
|
159 |
+
if ( $can_load_style ) {
|
160 |
+
wp_enqueue_style( $handle );
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Check file assets can load on pages
|
169 |
+
*
|
170 |
+
* @param string $handle
|
171 |
+
* @param string $page_current
|
172 |
+
* @param array $include_screens
|
173 |
+
* @param array $exclude_screens
|
174 |
+
* @author tungnx
|
175 |
+
* @since 4.1.3
|
176 |
+
* @version 1.0.0
|
177 |
+
*
|
178 |
+
* @return bool
|
179 |
+
*/
|
180 |
+
protected function check_can_load_asset( string $handle, string $page_current, array $include_screens, array $exclude_screens ): bool {
|
181 |
+
$can_load = false;
|
182 |
+
|
183 |
+
if ( ! empty( $include_screens ) ) {
|
184 |
+
if ( in_array( $page_current, $include_screens ) ) {
|
185 |
+
$can_load = true;
|
186 |
+
}
|
187 |
+
} elseif ( ! empty( $exclude_screens ) ) {
|
188 |
+
if ( ! in_array( $page_current, $exclude_screens ) ) {
|
189 |
+
$can_load = true;
|
190 |
+
}
|
191 |
+
} else {
|
192 |
+
$can_load = true;
|
193 |
+
}
|
194 |
+
|
195 |
+
$is_on = 'admin';
|
196 |
+
if ( ! is_admin() ) {
|
197 |
+
$is_on = 'frontend';
|
198 |
+
}
|
199 |
+
|
200 |
+
return apply_filters(
|
201 |
+
'learnpress/' . $is_on . '/can-load-assets/' . $handle,
|
202 |
+
$can_load,
|
203 |
+
$page_current,
|
204 |
+
$include_screens
|
205 |
+
);
|
206 |
+
}
|
207 |
+
|
208 |
/**
|
209 |
* Register style
|
210 |
*
|
379 |
return 'lp' . str_replace( ' ', '', $handle ) . 'Settings';
|
380 |
}
|
381 |
|
|
|
|
|
|
|
|
|
382 |
public function localize_printed_scripts( $side = '' ) {
|
383 |
+
$scripts_data = $this->_get_script_data();
|
384 |
|
385 |
if ( is_array( $scripts_data ) && is_array( $this->_script_data ) ) {
|
386 |
$scripts_data = LP_Helper::array_merge_recursive( $scripts_data, $this->_script_data );
|
446 |
}
|
447 |
|
448 |
/**
|
449 |
+
* Shortcut to Addon file url.
|
450 |
*
|
451 |
* @param string $file
|
452 |
*
|
453 |
* @return string
|
454 |
*/
|
455 |
+
public function url( string $file = '' ): string {
|
456 |
return LP_PLUGIN_URL . "assets/{$file}";
|
457 |
}
|
458 |
|
|
|
|
|
|
|
|
|
459 |
public static function add_param() {
|
460 |
|
461 |
}
|
@@ -89,8 +89,10 @@ if ( ! class_exists( 'LP_Abstract_Post_Data' ) ) {
|
|
89 |
* @since 3.0.0
|
90 |
*/
|
91 |
public function is_publish() {
|
92 |
-
return apply_filters(
|
93 |
-
|
|
|
|
|
94 |
}
|
95 |
|
96 |
/**
|
@@ -149,15 +151,15 @@ if ( ! class_exists( 'LP_Abstract_Post_Data' ) ) {
|
|
149 |
}
|
150 |
|
151 |
setup_postdata( $post );
|
152 |
-
$content_post
|
153 |
-
$content_post
|
154 |
-
$content_post
|
155 |
$this->_content = $content_post;
|
156 |
wp_reset_postdata();
|
157 |
} else { // Post is previewd
|
158 |
-
$content_post
|
159 |
-
$content_post
|
160 |
-
$content_post
|
161 |
$this->_content = $content_post;
|
162 |
}
|
163 |
}
|
@@ -206,7 +208,12 @@ if ( ! class_exists( 'LP_Abstract_Post_Data' ) ) {
|
|
206 |
return get_edit_post_link( $this->get_id() );
|
207 |
}
|
208 |
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
210 |
return learn_press_get_current_user()->can_edit( $this->get_id() );
|
211 |
}
|
212 |
|
89 |
* @since 3.0.0
|
90 |
*/
|
91 |
public function is_publish() {
|
92 |
+
return apply_filters(
|
93 |
+
'learn-press/' . $this->_post_type . '/is-publish',
|
94 |
+
get_post_status( $this->get_id() ) === 'publish'
|
95 |
+
);
|
96 |
}
|
97 |
|
98 |
/**
|
151 |
}
|
152 |
|
153 |
setup_postdata( $post );
|
154 |
+
$content_post = get_the_content();
|
155 |
+
$content_post = apply_filters( 'the_content', $content_post );
|
156 |
+
$content_post = str_replace( ']]>', ']]>', $content_post );
|
157 |
$this->_content = $content_post;
|
158 |
wp_reset_postdata();
|
159 |
} else { // Post is previewd
|
160 |
+
$content_post = get_the_content();
|
161 |
+
$content_post = apply_filters( 'the_content', $content_post );
|
162 |
+
$content_post = str_replace( ']]>', ']]>', $content_post );
|
163 |
$this->_content = $content_post;
|
164 |
}
|
165 |
}
|
208 |
return get_edit_post_link( $this->get_id() );
|
209 |
}
|
210 |
|
211 |
+
/**
|
212 |
+
* Check user can edit item
|
213 |
+
*
|
214 |
+
* @return bool
|
215 |
+
*/
|
216 |
+
public function current_user_can_edit(): bool {
|
217 |
return learn_press_get_current_user()->can_edit( $this->get_id() );
|
218 |
}
|
219 |
|
@@ -16,7 +16,12 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
16 |
parent::__construct();
|
17 |
}
|
18 |
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
20 |
return array(
|
21 |
'learn-press-global' => learn_press_global_script_params(),
|
22 |
'learn-press-meta-box-order' => apply_filters(
|
@@ -51,7 +56,7 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
51 |
*
|
52 |
* @return mixed
|
53 |
*/
|
54 |
-
protected function _get_scripts() {
|
55 |
$lp_admin_js = new LP_Asset_Key(
|
56 |
$this->url( self::$_folder_source . 'js/admin/admin' . self::$_min_assets . '.js' ),
|
57 |
array( 'learn-press-global', 'lp-utils', 'wp-color-picker', 'jspdf' ),
|
@@ -106,7 +111,7 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
106 |
'wp-api-fetch',
|
107 |
'jquery-ui-timepicker-addon',
|
108 |
),
|
109 |
-
array( LP_COURSE_CPT, 'learnpress_page_learn-press-settings' ),
|
110 |
0,
|
111 |
1
|
112 |
),
|
@@ -241,19 +246,32 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
241 |
0,
|
242 |
1
|
243 |
),
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
)
|
258 |
);
|
259 |
}
|
@@ -263,32 +281,36 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
263 |
*
|
264 |
* @return mixed
|
265 |
*/
|
266 |
-
protected function _get_styles() {
|
267 |
return apply_filters(
|
268 |
'learn-press/admin-default-styles',
|
269 |
array(
|
270 |
-
'select2' =>
|
271 |
-
|
272 |
),
|
273 |
-
'font-awesome' =>
|
274 |
-
|
275 |
),
|
276 |
-
'jquery-ui' =>
|
277 |
-
|
278 |
),
|
279 |
-
'jquery-ui-timepicker' =>
|
280 |
-
|
281 |
),
|
282 |
-
'learn-press-bundle' =>
|
283 |
-
|
284 |
),
|
285 |
-
'learn-press-admin' =>
|
286 |
-
|
287 |
-
|
|
|
|
|
288 |
),
|
289 |
-
'learn-press-statistic' =>
|
290 |
-
|
291 |
-
|
|
|
|
|
292 |
),
|
293 |
)
|
294 |
);
|
@@ -320,75 +342,6 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
|
|
320 |
wp_enqueue_style( 'custom_wp_admin_css' );
|
321 |
}
|
322 |
|
323 |
-
/**
|
324 |
-
* Register, enqueue js
|
325 |
-
*
|
326 |
-
* @param string $screen_id .
|
327 |
-
*
|
328 |
-
* @author tungnx
|
329 |
-
* @since 4.0.0
|
330 |
-
* @version 1.0.0
|
331 |
-
*/
|
332 |
-
protected function handle_js( $screen_id = '' ) {
|
333 |
-
$scripts = $this->_get_scripts();
|
334 |
-
/**
|
335 |
-
* @var LP_Asset_Key[] $scripts
|
336 |
-
*/
|
337 |
-
foreach ( $scripts as $handle => $script ) {
|
338 |
-
if ( ! $script instanceof LP_Asset_Key ) {
|
339 |
-
continue;
|
340 |
-
}
|
341 |
-
|
342 |
-
wp_register_script( $handle, $script->_url, $script->_deps, self::$_version_assets, $script->_in_footer );
|
343 |
-
|
344 |
-
if ( ! $script->_only_register ) {
|
345 |
-
$can_load_js = false;
|
346 |
-
|
347 |
-
if ( ! empty( $script->_screens ) ) {
|
348 |
-
if ( in_array( $screen_id, $script->_screens ) ) {
|
349 |
-
$can_load_js = true;
|
350 |
-
}
|
351 |
-
} elseif ( ! empty( $script->_exclude_screens ) ) {
|
352 |
-
if ( ! in_array( $screen_id, $script->_exclude_screens ) ) {
|
353 |
-
$can_load_js = true;
|
354 |
-
}
|
355 |
-
} else {
|
356 |
-
$can_load_js = true;
|
357 |
-
}
|
358 |
-
|
359 |
-
$can_load_js = apply_filters(
|
360 |
-
'learnpress/admin/can-load-js/' . $handle,
|
361 |
-
$can_load_js,
|
362 |
-
$screen_id,
|
363 |
-
$script->_screens
|
364 |
-
);
|
365 |
-
|
366 |
-
if ( $can_load_js ) {
|
367 |
-
wp_enqueue_script( $handle );
|
368 |
-
}
|
369 |
-
}
|
370 |
-
}
|
371 |
-
}
|
372 |
-
|
373 |
-
/**
|
374 |
-
* Register, enqueue css
|
375 |
-
*
|
376 |
-
* @param string $screen_id .
|
377 |
-
*/
|
378 |
-
protected function handle_style( $screen_id = '' ) {
|
379 |
-
/**
|
380 |
-
* Enqueue styles
|
381 |
-
*
|
382 |
-
* TODO: check to show only styles needed in specific pages
|
383 |
-
*/
|
384 |
-
$styles = $this->_get_styles();
|
385 |
-
if ( $styles ) {
|
386 |
-
foreach ( $styles as $handle => $data ) {
|
387 |
-
wp_enqueue_style( $handle, $data['url'], $data['deps'] ?? array(), self::$_version_assets );
|
388 |
-
}
|
389 |
-
}
|
390 |
-
}
|
391 |
-
|
392 |
/**
|
393 |
* Show overlay
|
394 |
*/
|
16 |
parent::__construct();
|
17 |
}
|
18 |
|
19 |
+
/**
|
20 |
+
* Get localize script
|
21 |
+
*
|
22 |
+
* @return array
|
23 |
+
*/
|
24 |
+
protected function _get_script_data(): array {
|
25 |
return array(
|
26 |
'learn-press-global' => learn_press_global_script_params(),
|
27 |
'learn-press-meta-box-order' => apply_filters(
|
56 |
*
|
57 |
* @return mixed
|
58 |
*/
|
59 |
+
protected function _get_scripts(): array {
|
60 |
$lp_admin_js = new LP_Asset_Key(
|
61 |
$this->url( self::$_folder_source . 'js/admin/admin' . self::$_min_assets . '.js' ),
|
62 |
array( 'learn-press-global', 'lp-utils', 'wp-color-picker', 'jspdf' ),
|
111 |
'wp-api-fetch',
|
112 |
'jquery-ui-timepicker-addon',
|
113 |
),
|
114 |
+
array( LP_LESSON_CPT, LP_QUIZ_CPT, LP_COURSE_CPT, 'learnpress_page_learn-press-settings' ),
|
115 |
0,
|
116 |
1
|
117 |
),
|
246 |
0,
|
247 |
1
|
248 |
),
|
249 |
+
'lp-dashboard' => new LP_Asset_Key(
|
250 |
+
self::url( 'js/dist/admin/pages/dashboard' . self::$_min_assets . '.js' ),
|
251 |
+
array(
|
252 |
+
'jquery',
|
253 |
+
'wp-element',
|
254 |
+
'wp-compose',
|
255 |
+
'wp-data',
|
256 |
+
'wp-hooks',
|
257 |
+
'wp-api-fetch',
|
258 |
+
'lodash',
|
259 |
+
),
|
260 |
+
array( 'dashboard' ),
|
261 |
+
0,
|
262 |
+
1
|
263 |
+
),
|
264 |
+
'lp-widgets-admin' => new LP_Asset_Key(
|
265 |
+
self::url( 'js/dist/admin/pages/widgets' . self::$_min_assets . '.js' ),
|
266 |
+
array(
|
267 |
+
'wp-url',
|
268 |
+
'wp-api-fetch',
|
269 |
+
'lodash',
|
270 |
+
),
|
271 |
+
array( 'widgets', 'elementor' ),
|
272 |
+
0,
|
273 |
+
1
|
274 |
+
),
|
275 |
)
|
276 |
);
|
277 |
}
|
281 |
*
|
282 |
* @return mixed
|
283 |
*/
|
284 |
+
protected function _get_styles(): array {
|
285 |
return apply_filters(
|
286 |
'learn-press/admin-default-styles',
|
287 |
array(
|
288 |
+
'select2' => new LP_Asset_Key(
|
289 |
+
$this->url( 'src/css/vendor/select2.min.css' )
|
290 |
),
|
291 |
+
'font-awesome' => new LP_Asset_Key(
|
292 |
+
$this->url( 'src/css/vendor/font-awesome-5.min.css' )
|
293 |
),
|
294 |
+
'jquery-ui' => new LP_Asset_Key(
|
295 |
+
$this->url( 'src/css/vendor/jquery-ui/jquery-ui.min.css' )
|
296 |
),
|
297 |
+
'jquery-ui-timepicker' => new LP_Asset_Key(
|
298 |
+
$this->url( 'src/css/vendor/jquery-ui-timepicker-addon.css' )
|
299 |
),
|
300 |
+
'learn-press-bundle' => new LP_Asset_Key(
|
301 |
+
$this->url( 'css/bundle.min.css' )
|
302 |
),
|
303 |
+
'learn-press-admin' => new LP_Asset_Key(
|
304 |
+
$this->url( 'css/admin/admin.css' ),
|
305 |
+
array( 'wp-color-picker', 'wp-components', 'select2', 'jquery-ui', 'jquery-ui-timepicker', 'font-awesome' ),
|
306 |
+
array(),
|
307 |
+
0
|
308 |
),
|
309 |
+
'learn-press-statistic' => new LP_Asset_Key(
|
310 |
+
LP_CSS_URL . 'admin/statistic.css',
|
311 |
+
array(),
|
312 |
+
array( 'learners_page_learn-press-statistics' ),
|
313 |
+
0
|
314 |
),
|
315 |
)
|
316 |
);
|
342 |
wp_enqueue_style( 'custom_wp_admin_css' );
|
343 |
}
|
344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
/**
|
346 |
* Show overlay
|
347 |
*/
|
@@ -43,53 +43,7 @@ if ( ! class_exists( 'LP_Admin_Dashboard' ) ) {
|
|
43 |
?>
|
44 |
|
45 |
<ul class="lp-order-statuses">
|
46 |
-
|
47 |
-
<strong><?php echo $this->_get_order_total_raised(); ?></strong>
|
48 |
-
<p><?php esc_html_e( 'Total Raised', 'learnpress' ); ?></p>
|
49 |
-
</li>
|
50 |
-
|
51 |
-
<?php
|
52 |
-
$order_statuses = learn_press_get_order_statuses( true, true );
|
53 |
-
$specific_statuses = array( 'lp-completed', 'lp-failed' );
|
54 |
-
|
55 |
-
foreach ( $order_statuses as $status ) {
|
56 |
-
if ( ! in_array( $status, $specific_statuses ) ) {
|
57 |
-
$specific_statuses[] = $status;
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
$counts = learn_press_count_orders( array( 'status' => $specific_statuses ) );
|
62 |
-
|
63 |
-
foreach ( $specific_statuses as $status ) :
|
64 |
-
|
65 |
-
$status_object = get_post_status_object( $status );
|
66 |
-
|
67 |
-
if ( ! $status_object ) {
|
68 |
-
continue;
|
69 |
-
}
|
70 |
-
|
71 |
-
$count = $counts[ $status ];
|
72 |
-
$url = $count ? admin_url( 'edit.php?post_type=' . LP_ORDER_CPT . '&post_status=' . $status ) : '#';
|
73 |
-
?>
|
74 |
-
|
75 |
-
<li class="counter-number order-<?php echo str_replace( 'lp-', '', $status ); ?>">
|
76 |
-
<div class="counter-inner">
|
77 |
-
<a href="<?php echo esc_url( $url ); ?>">
|
78 |
-
<strong>
|
79 |
-
<?php
|
80 |
-
if ( $count ) {
|
81 |
-
printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count );
|
82 |
-
} else {
|
83 |
-
printf( __( '%d order', 'learnpress' ), 0 );
|
84 |
-
}
|
85 |
-
?>
|
86 |
-
</strong>
|
87 |
-
<p><?php printf( '%s', $status_object->label ); ?></p>
|
88 |
-
</a>
|
89 |
-
</div>
|
90 |
-
</li>
|
91 |
-
<?php endforeach; ?>
|
92 |
-
|
93 |
<?php
|
94 |
$eduma_data = $this->_get_theme_info( 14058034 );
|
95 |
|
43 |
?>
|
44 |
|
45 |
<ul class="lp-order-statuses">
|
46 |
+
<?php lp_skeleton_animation_html( 4, 100 , 'height: 30px;border-radius:4px;' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
<?php
|
48 |
$eduma_data = $this->_get_theme_info( 14058034 );
|
49 |
|
@@ -1165,7 +1165,7 @@ function learn_press_get_chart_courses( $from = null, $by = null, $time_ago = 0
|
|
1165 |
"
|
1166 |
SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
|
1167 |
FROM {$wpdb->posts} c
|
1168 |
-
INNER JOIN {$wpdb->postmeta} cm ON cm.post_id = c.ID
|
1169 |
WHERE 1
|
1170 |
{$query_where}
|
1171 |
AND c.post_status = %s AND c.post_type = %s
|
@@ -1174,8 +1174,6 @@ function learn_press_get_chart_courses( $from = null, $by = null, $time_ago = 0
|
|
1174 |
ORDER BY d ASC
|
1175 |
",
|
1176 |
$_sql_format,
|
1177 |
-
'_lp_payment',
|
1178 |
-
'yes',
|
1179 |
'publish',
|
1180 |
'lp_course',
|
1181 |
$_from,
|
@@ -2301,7 +2299,7 @@ function learn_press_get_chart_general( $from = null, $by = null, $time_ago = 0
|
|
2301 |
"
|
2302 |
SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
|
2303 |
FROM {$wpdb->posts} c
|
2304 |
-
INNER JOIN {$wpdb->postmeta} cm ON cm.post_id = c.ID
|
2305 |
WHERE 1
|
2306 |
{$query_where}
|
2307 |
AND c.post_status = %s AND c.post_type = %s
|
@@ -2310,8 +2308,6 @@ function learn_press_get_chart_general( $from = null, $by = null, $time_ago = 0
|
|
2310 |
ORDER BY d ASC
|
2311 |
",
|
2312 |
$_sql_format,
|
2313 |
-
'_lp_payment',
|
2314 |
-
'yes',
|
2315 |
'publish',
|
2316 |
'lp_course',
|
2317 |
$_from,
|
1165 |
"
|
1166 |
SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
|
1167 |
FROM {$wpdb->posts} c
|
1168 |
+
INNER JOIN {$wpdb->postmeta} cm ON cm.post_id = c.ID
|
1169 |
WHERE 1
|
1170 |
{$query_where}
|
1171 |
AND c.post_status = %s AND c.post_type = %s
|
1174 |
ORDER BY d ASC
|
1175 |
",
|
1176 |
$_sql_format,
|
|
|
|
|
1177 |
'publish',
|
1178 |
'lp_course',
|
1179 |
$_from,
|
2299 |
"
|
2300 |
SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
|
2301 |
FROM {$wpdb->posts} c
|
2302 |
+
INNER JOIN {$wpdb->postmeta} cm ON cm.post_id = c.ID
|
2303 |
WHERE 1
|
2304 |
{$query_where}
|
2305 |
AND c.post_status = %s AND c.post_type = %s
|
2308 |
ORDER BY d ASC
|
2309 |
",
|
2310 |
$_sql_format,
|
|
|
|
|
2311 |
'publish',
|
2312 |
'lp_course',
|
2313 |
$_from,
|
@@ -2,6 +2,10 @@
|
|
2 |
wp_enqueue_script( 'learn-press-email-content-field', LP()->plugin_url( 'inc/admin/meta-box/assets/email-content.js' ) );
|
3 |
wp_enqueue_style( 'learn-press-email-content-field', LP()->plugin_url( 'inc/admin/meta-box/assets/email-content.css' ) );
|
4 |
|
|
|
|
|
|
|
|
|
5 |
$meta = wp_parse_args(
|
6 |
$value['value'],
|
7 |
array(
|
@@ -29,7 +33,7 @@ $email_format = $meta['format'];
|
|
29 |
|
30 |
<tr valign="top">
|
31 |
<th scope="row" class="titledesc">
|
32 |
-
<label><?php echo $value['title']; ?> <?php echo $tooltip_html; ?></label>
|
33 |
</th>
|
34 |
<td class="forminp lp-metabox-field__email-content forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>">‎
|
35 |
<?php
|
2 |
wp_enqueue_script( 'learn-press-email-content-field', LP()->plugin_url( 'inc/admin/meta-box/assets/email-content.js' ) );
|
3 |
wp_enqueue_style( 'learn-press-email-content-field', LP()->plugin_url( 'inc/admin/meta-box/assets/email-content.css' ) );
|
4 |
|
5 |
+
if ( ! isset( $value ) ) {
|
6 |
+
return;
|
7 |
+
}
|
8 |
+
|
9 |
$meta = wp_parse_args(
|
10 |
$value['value'],
|
11 |
array(
|
33 |
|
34 |
<tr valign="top">
|
35 |
<th scope="row" class="titledesc">
|
36 |
+
<label><?php echo $value['title']; ?> <?php echo $tooltip_html ?? ''; ?></label>
|
37 |
</th>
|
38 |
<td class="forminp lp-metabox-field__email-content forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>">‎
|
39 |
<?php
|
@@ -84,11 +84,19 @@ class LP_Settings_Courses extends LP_Abstract_Settings_Page {
|
|
84 |
'desc' => esc_html__( 'Students will get started courses immediately after successfully purchased.', 'learnpress' ),
|
85 |
),
|
86 |
array(
|
87 |
-
'title'
|
88 |
-
'desc'
|
89 |
-
'id'
|
90 |
-
'default'
|
91 |
-
'type'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
),
|
93 |
array(
|
94 |
'title' => esc_html__( 'Courses per page', 'learnpress' ),
|
84 |
'desc' => esc_html__( 'Students will get started courses immediately after successfully purchased.', 'learnpress' ),
|
85 |
),
|
86 |
array(
|
87 |
+
'title' => __( 'Enable popup confirm finish course, complete item', 'learnpress' ),
|
88 |
+
'desc' => __( 'Show popup confirm before finish course or complete item.', 'learnpress' ),
|
89 |
+
'id' => 'enable_popup_confirm_finish',
|
90 |
+
'default' => 'yes',
|
91 |
+
'type' => 'checkbox',
|
92 |
+
),
|
93 |
+
array(
|
94 |
+
'title' => esc_html__( 'Archive page layout', 'learnpress' ),
|
95 |
+
'desc' => esc_html__( 'Type display list course on Course Archive page', 'learnpress' ),
|
96 |
+
'id' => 'archive_courses_layout',
|
97 |
+
'default' => 'list',
|
98 |
+
'type' => 'select',
|
99 |
+
'options' => learn_press_courses_layouts(),
|
100 |
),
|
101 |
array(
|
102 |
'title' => esc_html__( 'Courses per page', 'learnpress' ),
|
@@ -82,13 +82,19 @@ class LP_Settings_Emails extends LP_Abstract_Settings_Page {
|
|
82 |
}
|
83 |
|
84 |
foreach ( $emails as $email ) {
|
|
|
|
|
|
|
|
|
85 |
foreach ( $groups as $group ) {
|
86 |
-
if ( ! empty( $group->items[ $email->id ] ) ) {
|
87 |
continue 2;
|
88 |
}
|
89 |
}
|
90 |
|
91 |
-
$sections[ $email->id ]
|
|
|
|
|
92 |
}
|
93 |
}
|
94 |
}
|
@@ -124,13 +130,6 @@ class LP_Settings_Emails extends LP_Abstract_Settings_Page {
|
|
124 |
'type' => 'email',
|
125 |
'css' => 'width:400px',
|
126 |
),
|
127 |
-
array(
|
128 |
-
'title' => esc_html__( 'Background email', 'learnpress' ),
|
129 |
-
'id' => 'emails_general[send_email_background]',
|
130 |
-
'default' => 'no',
|
131 |
-
'type' => 'checkbox',
|
132 |
-
'desc' => esc_html__( 'Sending emails in the background.', 'learnpress' ),
|
133 |
-
),
|
134 |
array(
|
135 |
'type' => 'sectionend',
|
136 |
),
|
82 |
}
|
83 |
|
84 |
foreach ( $emails as $email ) {
|
85 |
+
if ( ! is_object( $email ) ) {
|
86 |
+
continue;
|
87 |
+
}
|
88 |
+
|
89 |
foreach ( $groups as $group ) {
|
90 |
+
if ( is_object( $group ) && ! empty( $group->items[ $email->id ] ) ) {
|
91 |
continue 2;
|
92 |
}
|
93 |
}
|
94 |
|
95 |
+
if ( isset( $sections[ $email->id ] ) ) {
|
96 |
+
$sections[ $email->id ] = $email;
|
97 |
+
}
|
98 |
}
|
99 |
}
|
100 |
}
|
130 |
'type' => 'email',
|
131 |
'css' => 'width:400px',
|
132 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
array(
|
134 |
'type' => 'sectionend',
|
135 |
),
|
@@ -31,6 +31,10 @@ class LP_Settings_Emails_Group extends LP_Settings {
|
|
31 |
|
32 |
foreach ( $this->items as $id ) {
|
33 |
foreach ( $emails as $email ) {
|
|
|
|
|
|
|
|
|
34 |
if ( ! array_key_exists( $email->id, $ids ) ) {
|
35 |
continue;
|
36 |
}
|
@@ -51,6 +55,9 @@ class LP_Settings_Emails_Group extends LP_Settings {
|
|
51 |
echo '<ul class="subsubsub">';
|
52 |
|
53 |
foreach ( $this->items as $email ) {
|
|
|
|
|
|
|
54 |
if ( $current == $email->id ) {
|
55 |
echo '<li class="active"><span>' . $email . '</span></li>';
|
56 |
} else {
|
31 |
|
32 |
foreach ( $this->items as $id ) {
|
33 |
foreach ( $emails as $email ) {
|
34 |
+
if ( ! is_object( $email ) ) {
|
35 |
+
continue;
|
36 |
+
}
|
37 |
+
|
38 |
if ( ! array_key_exists( $email->id, $ids ) ) {
|
39 |
continue;
|
40 |
}
|
55 |
echo '<ul class="subsubsub">';
|
56 |
|
57 |
foreach ( $this->items as $email ) {
|
58 |
+
if ( ! is_object( $email ) ) {
|
59 |
+
continue;
|
60 |
+
}
|
61 |
if ( $current == $email->id ) {
|
62 |
echo '<li class="active"><span>' . $email . '</span></li>';
|
63 |
} else {
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for displaying orders dashboard in wp-admin
|
4 |
+
*
|
5 |
+
* @author ThimPress
|
6 |
+
* @package LearnPress/Inc/Admin/Views/
|
7 |
+
* @version 4.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || exit;
|
11 |
+
|
12 |
+
if ( empty( $specific_statuses ) ) {
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
?>
|
16 |
+
|
17 |
+
<li class="count-number total-raised">
|
18 |
+
<strong><?php echo learn_press_get_total_price_order_complete(); ?></strong>
|
19 |
+
<p><?php esc_html_e( 'Total Raised', 'learnpress' ); ?></p>
|
20 |
+
</li>
|
21 |
+
|
22 |
+
<?php
|
23 |
+
|
24 |
+
$counts = learn_press_count_orders( array( 'status' => $specific_statuses ) );
|
25 |
+
|
26 |
+
foreach ( $specific_statuses as $status ) :
|
27 |
+
|
28 |
+
$status_object = get_post_status_object( $status );
|
29 |
+
|
30 |
+
if ( ! $status_object ) {
|
31 |
+
continue;
|
32 |
+
}
|
33 |
+
|
34 |
+
$count = $counts[ $status ];
|
35 |
+
$url = $count ? admin_url( 'edit.php?post_type=' . LP_ORDER_CPT . '&post_status=' . $status ) : '#';
|
36 |
+
?>
|
37 |
+
|
38 |
+
<li class="counter-number order-<?php echo str_replace( 'lp-', '', $status ); ?>">
|
39 |
+
<div class="counter-inner">
|
40 |
+
<a href="<?php echo esc_url( $url ); ?>">
|
41 |
+
<strong>
|
42 |
+
<?php
|
43 |
+
if ( $count ) {
|
44 |
+
printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count );
|
45 |
+
} else {
|
46 |
+
printf( __( '%d order', 'learnpress' ), 0 );
|
47 |
+
}
|
48 |
+
?>
|
49 |
+
</strong>
|
50 |
+
<p><?php printf( '%s', $status_object->label ); ?></p>
|
51 |
+
</a>
|
52 |
+
</div>
|
53 |
+
</li>
|
54 |
+
<?php endforeach; ?>
|
@@ -38,6 +38,8 @@ abstract class LP_Meta_Box {
|
|
38 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/extra.php';
|
39 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/extra-faq.php';
|
40 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/date.php';
|
|
|
|
|
41 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/lp-meta-box-functions.php';
|
42 |
}
|
43 |
|
38 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/extra.php';
|
39 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/extra-faq.php';
|
40 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/date.php';
|
41 |
+
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/wysiwyg.php';
|
42 |
+
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/fields/repeater.php';
|
43 |
include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/lp-meta-box-functions.php';
|
44 |
}
|
45 |
|
@@ -328,10 +328,10 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
|
|
328 |
$final_quizz_passing = '
|
329 |
<div class="lp-metabox-evaluate-final_quiz">
|
330 |
<div class="lp-metabox-evaluate-final_quiz__message">'
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
</div>
|
336 |
';
|
337 |
}
|
328 |
$final_quizz_passing = '
|
329 |
<div class="lp-metabox-evaluate-final_quiz">
|
330 |
<div class="lp-metabox-evaluate-final_quiz__message">'
|
331 |
+
. sprintf( esc_html__( 'Passing Grade: %s', 'learpress' ), $passing_grade . '%' ) .
|
332 |
+
' - '
|
333 |
+
. sprintf( esc_html__( 'Edit: %s', 'learnpress' ), '<a href="' . esc_url( $url ) . '">' . get_the_title( $final_quiz ) . '</a>' ) .
|
334 |
+
'</div>
|
335 |
</div>
|
336 |
';
|
337 |
}
|
@@ -1,69 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$course_result_desc = '';
|
3 |
-
$course_results = get_post_meta( $thepostid, '_lp_course_result', true );
|
4 |
-
|
5 |
-
$course_result_desc .= __( 'The method to assess the result of a student for a course.', 'learnpress' );
|
6 |
-
|
7 |
-
if ( $course_results == 'evaluate_final_quiz' && ! get_post_meta( $thepostid, '_lp_final_quiz', true ) ) {
|
8 |
-
$course_result_desc .= __( '<br /><strong>Note! </strong>No final quiz in course, please add a final quiz', 'learnpress' );
|
9 |
-
}
|
10 |
-
|
11 |
-
$final_quizz_passing = '';
|
12 |
-
|
13 |
-
$course = learn_press_get_course( $thepostid );
|
14 |
-
|
15 |
-
if ( $course ) {
|
16 |
-
$passing_grade = $url = '';
|
17 |
-
|
18 |
-
$final_quiz = $course->get_final_quiz();
|
19 |
-
|
20 |
-
if ( $final_quiz ) {
|
21 |
-
$passing_grade = get_post_meta( $final_quiz, '_lp_passing_grade', true );
|
22 |
-
|
23 |
-
$url = get_edit_post_link( $final_quiz ) . '#_lp_passing_grade';
|
24 |
-
|
25 |
-
$final_quizz_passing = '
|
26 |
-
<div class="lp-metabox-evaluate-final_quiz">
|
27 |
-
<div class="lp-metabox-evaluate-final_quiz__message">'
|
28 |
-
. sprintf( esc_html__( 'Passing Grade: %s', 'learpress' ), $passing_grade . '%' ) .
|
29 |
-
' - '
|
30 |
-
. sprintf( esc_html__( 'Edit: %s', 'learnpress' ), '<a href="' . esc_url( $url ) . '">' . get_the_title( $final_quiz ) . '</a>' ) .
|
31 |
-
'</div>
|
32 |
-
</div>
|
33 |
-
';
|
34 |
-
}
|
35 |
-
}
|
36 |
-
?>
|
37 |
-
|
38 |
-
<div id="assessment_course_data" class="lp-meta-box-course-panels">
|
39 |
-
<?php
|
40 |
-
do_action( 'learnpress/course-settings/before-assessment' );
|
41 |
-
|
42 |
-
lp_meta_box_radio_field(
|
43 |
-
array(
|
44 |
-
'id' => '_lp_course_result',
|
45 |
-
'label' => esc_html__( 'Evaluation', 'learnpress' ),
|
46 |
-
'description' => $course_result_desc,
|
47 |
-
'options' => learn_press_course_evaluation_methods( '', $final_quizz_passing ),
|
48 |
-
'default' => 'evaluate_lesson',
|
49 |
-
)
|
50 |
-
);
|
51 |
-
|
52 |
-
lp_meta_box_text_input_field(
|
53 |
-
array(
|
54 |
-
'id' => '_lp_passing_condition',
|
55 |
-
'label' => esc_html__( 'Passing Grade(%)', 'learnpress' ),
|
56 |
-
'description' => esc_html__( 'The condition that must be achieved to finish the course.', 'learnpress' ),
|
57 |
-
'type' => 'number',
|
58 |
-
'default' => '80',
|
59 |
-
'custom_attributes' => array(
|
60 |
-
'min' => '0',
|
61 |
-
'step' => '1',
|
62 |
-
),
|
63 |
-
'style' => 'width: 60px;',
|
64 |
-
)
|
65 |
-
);
|
66 |
-
|
67 |
-
do_action( 'learnpress/course-settings/after-assessment' );
|
68 |
-
?>
|
69 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$author = $post ? $post->post_author : get_current_user_id();
|
3 |
-
|
4 |
-
$options = array();
|
5 |
-
$role = array( 'administrator', 'lp_teacher' );
|
6 |
-
|
7 |
-
$role = apply_filters( 'learn_press_course_author_role_meta_box', $role );
|
8 |
-
|
9 |
-
foreach ( $role as $_role ) {
|
10 |
-
$users_by_role = get_users( array( 'role' => $_role ) );
|
11 |
-
|
12 |
-
if ( $users_by_role ) {
|
13 |
-
foreach ( $users_by_role as $user ) {
|
14 |
-
$options[ $user->get( 'ID' ) ] = $user->user_login;
|
15 |
-
}
|
16 |
-
}
|
17 |
-
}
|
18 |
-
?>
|
19 |
-
|
20 |
-
<div id="author_course_data" class="lp-meta-box-course-panels">
|
21 |
-
<?php
|
22 |
-
do_action( 'learnpress/course-settings/before-author' );
|
23 |
-
|
24 |
-
if ( is_super_admin() ) {
|
25 |
-
lp_meta_box_select_field(
|
26 |
-
array(
|
27 |
-
'id' => '_lp_course_author',
|
28 |
-
'label' => esc_html__( 'Author', 'learnpress' ),
|
29 |
-
'options' => $options,
|
30 |
-
'default' => $author,
|
31 |
-
'style' => 'min-width:200px;',
|
32 |
-
)
|
33 |
-
);
|
34 |
-
} else {
|
35 |
-
esc_html_e( 'Author is set by Admintrator', 'learnpress' );
|
36 |
-
}
|
37 |
-
|
38 |
-
do_action( 'learnpress/course-settings/after-author' );
|
39 |
-
?>
|
40 |
-
</div>
|
41 |
-
|
42 |
-
<?php
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,130 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Course general data panel.
|
4 |
-
*
|
5 |
-
* @author ThimPress <nhamdv>
|
6 |
-
*/
|
7 |
-
|
8 |
-
defined( 'ABSPATH' ) || exit;
|
9 |
-
|
10 |
-
$requirements = get_post_meta( $thepostid, '_lp_requirements', true );
|
11 |
-
$target_audiences = get_post_meta( $thepostid, '_lp_target_audiences', true );
|
12 |
-
$key_features = get_post_meta( $thepostid, '_lp_key_features', true );
|
13 |
-
$faqs = get_post_meta( $thepostid, '_lp_faqs', true );
|
14 |
-
?>
|
15 |
-
|
16 |
-
<div id="extra_course_data" class="lp-meta-box-course-panels">
|
17 |
-
|
18 |
-
<?php do_action( 'learnpress/course-settings/before-extra' ); ?>
|
19 |
-
|
20 |
-
<div class="form-field lp_course_extra_meta_box">
|
21 |
-
<label for="_lp_requirements"><?php esc_html_e( 'Requirements', 'learnpress' ); ?></label>
|
22 |
-
<div class="lp_course_extra_meta_box__content">
|
23 |
-
<div class="lp_course_extra_meta_box__fields">
|
24 |
-
<?php if ( ! empty( $requirements[0][0] ) ) : ?>
|
25 |
-
<?php foreach ( $requirements as $requirement ) : ?>
|
26 |
-
<div class="lp_course_extra_meta_box__field">
|
27 |
-
<span class="sort"></span>
|
28 |
-
<input name="_lp_requirements[]" value="<?php echo $requirement; ?>" type="text" class="lp_course_extra_meta_box__input">
|
29 |
-
<a href="#" class="delete"></a>
|
30 |
-
</div>
|
31 |
-
<?php endforeach; ?>
|
32 |
-
<?php endif; ?>
|
33 |
-
</div>
|
34 |
-
|
35 |
-
<a href="#" class="button button-primary lp_course_extra_meta_box__add" data-add="<?php echo esc_attr( '<div class="lp_course_extra_meta_box__field"><span class="sort"></span><input name="_lp_requirements[]" value="" type="text" class="lp_course_extra_meta_box__input"><a href="#" class="delete"></a></div>' ); ?>">
|
36 |
-
<?php esc_html_e( '+ Add more', 'learnpress' ); ?>
|
37 |
-
</a>
|
38 |
-
</div>
|
39 |
-
</div>
|
40 |
-
|
41 |
-
<div class="form-field lp_course_extra_meta_box">
|
42 |
-
<label for="_lp_target_audiences"><?php esc_html_e( 'Target Audience', 'learnpress' ); ?></label>
|
43 |
-
<div class="lp_course_extra_meta_box__content">
|
44 |
-
<div class="lp_course_extra_meta_box__fields">
|
45 |
-
<?php if ( ! empty( $target_audiences[0][0] ) ) : ?>
|
46 |
-
<?php foreach ( $target_audiences as $target_audience ) : ?>
|
47 |
-
<div class="lp_course_extra_meta_box__field">
|
48 |
-
<span class="sort"></span>
|
49 |
-
<input name="_lp_target_audiences[]" value="<?php echo $target_audience; ?>" type="text" class="lp_course_extra_meta_box__input">
|
50 |
-
<a href="#" class="delete"></a>
|
51 |
-
</div>
|
52 |
-
<?php endforeach; ?>
|
53 |
-
<?php endif; ?>
|
54 |
-
</div>
|
55 |
-
|
56 |
-
<a href="#" class="button button-primary lp_course_extra_meta_box__add" data-add="<?php echo esc_attr( '<div class="lp_course_extra_meta_box__field"><span class="sort"></span></a><input name="_lp_target_audiences[]" value="" type="text" class="lp_course_extra_meta_box__input"><a href="#" class="delete"></a></div>' ); ?>">
|
57 |
-
<?php esc_html_e( '+ Add more', 'learnpress' ); ?>
|
58 |
-
</a>
|
59 |
-
</div>
|
60 |
-
</div>
|
61 |
-
|
62 |
-
<div class="form-field lp_course_extra_meta_box">
|
63 |
-
<label for="_lp_key_features"><?php esc_html_e( 'Key Features', 'learnpress' ); ?></label>
|
64 |
-
<div class="lp_course_extra_meta_box__content">
|
65 |
-
<div class="lp_course_extra_meta_box__fields">
|
66 |
-
<?php if ( ! empty( $key_features[0][0] ) ) : ?>
|
67 |
-
<?php foreach ( $key_features as $key_feature ) : ?>
|
68 |
-
<div class="lp_course_extra_meta_box__field">
|
69 |
-
<span class="sort"></span>
|
70 |
-
<input name="_lp_key_features[]" value="<?php echo $key_feature; ?>" type="text" class="lp_course_extra_meta_box__input">
|
71 |
-
<a href="#" class="delete"></a>
|
72 |
-
</div>
|
73 |
-
<?php endforeach; ?>
|
74 |
-
<?php endif; ?>
|
75 |
-
</div>
|
76 |
-
|
77 |
-
<a href="#" class="button button-primary lp_course_extra_meta_box__add" data-add="<?php echo esc_attr( '<div class="lp_course_extra_meta_box__field"><span class="sort"></span><input name="_lp_key_features[]" value="" type="text" class="lp_course_extra_meta_box__input"><a href="#" class="delete"></a></div>' ); ?>">
|
78 |
-
<?php esc_html_e( '+ Add more', 'learnpress' ); ?>
|
79 |
-
</a>
|
80 |
-
</div>
|
81 |
-
</div>
|
82 |
-
|
83 |
-
<div class="form-field lp_course_faq_meta_box">
|
84 |
-
<label for="_lp_key_features"><?php esc_html_e( 'FAQs', 'learnpress' ); ?></label>
|
85 |
-
<div class="lp_course_faq_meta_box__content">
|
86 |
-
<div class="lp_course_faq_meta_box__fields">
|
87 |
-
<?php if ( ! empty( $faqs[0][0] ) ) : ?>
|
88 |
-
<?php foreach ( $faqs as $key => $faq ) : ?>
|
89 |
-
<div class="lp_course_faq_meta_box__field">
|
90 |
-
<label>
|
91 |
-
<span><?php esc_attr_e( 'Title', 'learnpress' ); ?></span>
|
92 |
-
<input type="text" name="_lp_faqs_question[]" value="<?php echo $faq[0]; ?>">
|
93 |
-
</label>
|
94 |
-
<label>
|
95 |
-
<span><?php esc_attr_e( 'Content', 'learnpress' ); ?></span>
|
96 |
-
<textarea name="_lp_faqs_answer[]"><?php echo $faq[1]; ?></textarea>
|
97 |
-
</label>
|
98 |
-
<a href="#" class="delete"></a>
|
99 |
-
<span class="sort"></span>
|
100 |
-
</div>
|
101 |
-
<?php endforeach; ?>
|
102 |
-
<?php endif; ?>
|
103 |
-
</div>
|
104 |
-
|
105 |
-
<a href="#" class="button button-primary lp_course_faq_meta_box__add"
|
106 |
-
data-add="
|
107 |
-
<?php
|
108 |
-
echo esc_attr(
|
109 |
-
'<div class="lp_course_faq_meta_box__field">
|
110 |
-
<label>
|
111 |
-
<span>' . esc_attr__( 'Title', 'learnpress' ) . '</span>
|
112 |
-
<input type="text" name="_lp_faqs_question[]" value="">
|
113 |
-
</label>
|
114 |
-
<label>
|
115 |
-
<span>' . esc_attr__( 'Content', 'learnpress' ) . '</span>
|
116 |
-
<textarea name="_lp_faqs_answer[]"></textarea>
|
117 |
-
</label>
|
118 |
-
<a href="#" class="delete"></a>
|
119 |
-
<span class="sort"></span>
|
120 |
-
</div>'
|
121 |
-
);
|
122 |
-
?>
|
123 |
-
"><?php esc_html_e( '+ Add more', 'learnpress' ); ?>
|
124 |
-
</a>
|
125 |
-
</div>
|
126 |
-
</div>
|
127 |
-
|
128 |
-
<?php do_action( 'learnpress/course-settings/after-extra' ); ?>
|
129 |
-
|
130 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,155 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Course general data panel.
|
4 |
-
*
|
5 |
-
* @author ThimPress <nhamdv>
|
6 |
-
*/
|
7 |
-
|
8 |
-
defined( 'ABSPATH' ) || exit;
|
9 |
-
?>
|
10 |
-
|
11 |
-
<div id="general_course_data" class="lp-meta-box-course-panels">
|
12 |
-
<?php
|
13 |
-
do_action( 'learnpress/course-settings/before-general' );
|
14 |
-
|
15 |
-
$meta_box_filter = apply_filters( 'learn_press_course_settings_meta_box_args', array( 'fields' => array() ) );
|
16 |
-
|
17 |
-
//Todo: Remove when Eduma theme and guest update 4.0.0
|
18 |
-
if ( ! empty( $meta_box_filter['fields'] ) ) {
|
19 |
-
$meta_box = array(
|
20 |
-
'id' => 'course_settings',
|
21 |
-
'title' => __( 'General', 'learnpress' ),
|
22 |
-
'pages' => array( LP_COURSE_CPT ),
|
23 |
-
'priority' => 'high',
|
24 |
-
'icon' => 'dashicons-admin-tools',
|
25 |
-
'fields' => array(
|
26 |
-
array(
|
27 |
-
'id' => '_lp_duration',
|
28 |
-
'label' => esc_html__( 'Duration', 'learnpress' ),
|
29 |
-
'description' => esc_html__( 'Set 0 for lifetime access.', 'learnpress' ),
|
30 |
-
'default_time' => 'week',
|
31 |
-
'default' => '10',
|
32 |
-
'custom_attributes' => array(
|
33 |
-
'min' => '0',
|
34 |
-
'step' => '1',
|
35 |
-
),
|
36 |
-
'type' => 'duration',
|
37 |
-
),
|
38 |
-
array(
|
39 |
-
'id' => '_lp_block_lesson_content',
|
40 |
-
'label' => esc_html__( 'Block content', 'learnpress' ),
|
41 |
-
'description' => esc_html__( 'Block content item( lesson, quiz... ) of course when expiration time course.',
|
42 |
-
'learnpress' ),
|
43 |
-
'default' => 'no',
|
44 |
-
'type' => 'checkbox',
|
45 |
-
),
|
46 |
-
array(
|
47 |
-
'id' => '_lp_level',
|
48 |
-
'label' => esc_html__( 'Level', 'learnpress' ),
|
49 |
-
'description' => esc_html__( 'Choose a difficulty level.', 'learnpress' ),
|
50 |
-
'default' => '',
|
51 |
-
'options' => array(
|
52 |
-
'' => esc_html__( 'All levels', 'learnpress' ),
|
53 |
-
'beginner' => esc_html__( 'Beginner', 'learnpress' ),
|
54 |
-
'intermediate' => esc_html__( 'Intermediate', 'learnpress' ),
|
55 |
-
'expert' => esc_html__( 'Expert', 'learnpress' ),
|
56 |
-
),
|
57 |
-
'type' => 'select',
|
58 |
-
),
|
59 |
-
array(
|
60 |
-
'id' => '_lp_students',
|
61 |
-
'label' => esc_html__( 'Promote', 'learnpress' ),
|
62 |
-
'description' => esc_html__( 'Show a plus number of students for the course.', 'learnpress' ),
|
63 |
-
'type' => 'number',
|
64 |
-
'default' => '0',
|
65 |
-
'custom_attributes' => array(
|
66 |
-
'min' => '0',
|
67 |
-
'step' => '1',
|
68 |
-
),
|
69 |
-
'style' => 'width: 60px;',
|
70 |
-
),
|
71 |
-
array(
|
72 |
-
'id' => '_lp_max_students',
|
73 |
-
'label' => esc_html__( 'Max student', 'learnpress' ),
|
74 |
-
'description' => esc_html__( 'Maximum students can join the course. Set 0 for unlimited.',
|
75 |
-
'learnpress' ),
|
76 |
-
'type' => 'number',
|
77 |
-
'default' => '0',
|
78 |
-
'custom_attributes' => array(
|
79 |
-
'min' => '0',
|
80 |
-
'step' => '1',
|
81 |
-
),
|
82 |
-
'style' => 'width: 60px;',
|
83 |
-
),
|
84 |
-
array(
|
85 |
-
'id' => '_lp_retake_count',
|
86 |
-
'label' => esc_html__( 'Retry', 'learnpress' ),
|
87 |
-
'description' => esc_html__( 'Allow students to try the course one more time.', 'learnpress' ),
|
88 |
-
'default' => 'no',
|
89 |
-
'type' => 'checkbox',
|
90 |
-
),
|
91 |
-
array(
|
92 |
-
'id' => '_lp_featured',
|
93 |
-
'label' => esc_html__( 'Featured list', 'learnpress' ),
|
94 |
-
'description' => esc_html__( 'Add the course to Featured List.', 'learnpress' ),
|
95 |
-
'default' => 'no',
|
96 |
-
'type' => 'checkbox',
|
97 |
-
),
|
98 |
-
array(
|
99 |
-
'id' => '_lp_has_finish',
|
100 |
-
'label' => esc_html__( 'Finish button', 'learnpress' ),
|
101 |
-
'description' => esc_html__( 'Allow show finish button when all items completed but evalution not passed.',
|
102 |
-
'learnpress' ),
|
103 |
-
'default' => 'yes',
|
104 |
-
'type' => 'checkbox',
|
105 |
-
),
|
106 |
-
array(
|
107 |
-
'id' => '_lp_featured_review',
|
108 |
-
'label' => esc_html__( 'Featured review', 'learnpress' ),
|
109 |
-
'description' => esc_html__( 'A good review to promote the course.', 'learnpress' ),
|
110 |
-
'placeholder' => esc_html__(
|
111 |
-
'e.g. This course is so great and helpful. Thank you the best teacher to explain and show us what LearnPress LMS is all about.',
|
112 |
-
'learnpress'
|
113 |
-
),
|
114 |
-
'default' => '',
|
115 |
-
'type' => 'textarea',
|
116 |
-
),
|
117 |
-
array(
|
118 |
-
'id' => '_lp_external_link_buy_course',
|
119 |
-
'label' => esc_html__( 'External link', 'learnpress' ),
|
120 |
-
'description' => esc_html__(
|
121 |
-
'Normally use for offline classes, e.g. link to a contact page.',
|
122 |
-
'learnpress'
|
123 |
-
),
|
124 |
-
'placeholder' => 'https://',
|
125 |
-
'default' => '',
|
126 |
-
'type' => 'text',
|
127 |
-
),
|
128 |
-
),
|
129 |
-
);
|
130 |
-
|
131 |
-
$meta_boxes = apply_filters( 'learn_press_course_settings_meta_box_args', $meta_box );
|
132 |
-
|
133 |
-
LP_Meta_Box_Course::eduma_child_metabox_v3( $meta_boxes );
|
134 |
-
} else {
|
135 |
-
/**
|
136 |
-
* Show fields general course settings
|
137 |
-
*
|
138 |
-
* @var LP_Meta_Box_Attribute $field
|
139 |
-
*/
|
140 |
-
foreach ( LP_Meta_Box_Course::$general_fields as $k => $field ) {
|
141 |
-
if ( ! $field instanceof LP_Meta_Box_Attribute || ! isset( $field->type ) || ! function_exists( $field->type ) ) {
|
142 |
-
continue;
|
143 |
-
}
|
144 |
-
|
145 |
-
if ( empty( $field->id ) ) {
|
146 |
-
echo esc_html__( 'ID of lp field not empty and unique', 'learnpress' );
|
147 |
-
}
|
148 |
-
|
149 |
-
call_user_func( $field->type, (array) $field );
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
do_action( 'learnpress/course-settings/after-general' );
|
154 |
-
?>
|
155 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,81 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Course price data panel.
|
4 |
-
*
|
5 |
-
* @author ThimPress <nhamdv>
|
6 |
-
*/
|
7 |
-
|
8 |
-
defined( 'ABSPATH' ) || exit;
|
9 |
-
|
10 |
-
$payment = get_post_meta( $thepostid, '_lp_payment', true );
|
11 |
-
?>
|
12 |
-
|
13 |
-
<div id="price_course_data" class="lp-meta-box-course-panels">
|
14 |
-
|
15 |
-
<?php if ( current_user_can( LP_TEACHER_ROLE ) || current_user_can( 'administrator' ) ) { ?>
|
16 |
-
<?php
|
17 |
-
$message = '';
|
18 |
-
$price = get_post_meta( $thepostid, '_lp_price', true );
|
19 |
-
$sale_price = '';
|
20 |
-
$start_date = '';
|
21 |
-
$end_date = '';
|
22 |
-
|
23 |
-
if ( $payment != 'free' ) {
|
24 |
-
$sale_price = get_post_meta( $thepostid, '_lp_sale_price', true );
|
25 |
-
$start_date = get_post_meta( $thepostid, '_lp_sale_start', true );
|
26 |
-
$end_date = get_post_meta( $thepostid, '_lp_sale_end', true );
|
27 |
-
}
|
28 |
-
|
29 |
-
do_action( 'learnpress/course-settings/before-price' );
|
30 |
-
|
31 |
-
lp_meta_box_text_input_field(
|
32 |
-
array(
|
33 |
-
'id' => '_lp_price',
|
34 |
-
'label' => esc_html__( 'Regular price', 'learnpress' ),
|
35 |
-
'description' => sprintf( __( 'Set a regular price (<strong>%s</strong>). Leave it blank for <strong>Free</strong>.', 'learnpress' ), learn_press_get_currency() ),
|
36 |
-
'type' => 'number',
|
37 |
-
'default' => $price,
|
38 |
-
'custom_attributes' => array(
|
39 |
-
'min' => '0',
|
40 |
-
'step' => '0.01',
|
41 |
-
),
|
42 |
-
'style' => 'width: 80px;',
|
43 |
-
'class' => 'lp_meta_box_regular_price',
|
44 |
-
)
|
45 |
-
);
|
46 |
-
|
47 |
-
lp_meta_box_text_input_field(
|
48 |
-
array(
|
49 |
-
'id' => '_lp_sale_price',
|
50 |
-
'label' => esc_html__( 'Sale price', 'learnpress' ),
|
51 |
-
'description' => '<a href="#" class="lp_sale_price_schedule">' . esc_html__( 'Schedule', 'learnpress' ) . '</a>',
|
52 |
-
'type' => 'number',
|
53 |
-
'default' => $sale_price,
|
54 |
-
'custom_attributes' => array(
|
55 |
-
'min' => '0',
|
56 |
-
'step' => '0.01',
|
57 |
-
),
|
58 |
-
'style' => 'width: 80px;',
|
59 |
-
'class' => 'lp_meta_box_sale_price',
|
60 |
-
)
|
61 |
-
);
|
62 |
-
?>
|
63 |
-
|
64 |
-
<div class="lp_sale_dates_fields">
|
65 |
-
<p class="form-field lp_sale_start_dates_fields">
|
66 |
-
<label for="_lp_sale_start"><?php esc_html_e( 'Sale start dates', 'learnpress' ); ?></label>
|
67 |
-
<input type="text" class="short" name="_lp_sale_start" id="_lp_sale_start" value="<?php echo esc_attr( $start_date ); ?>" placeholder="<?php echo esc_html( _x( 'From…', 'placeholder', 'learnpress' ) ); ?>" style="width:320px;" />
|
68 |
-
</p>
|
69 |
-
<p class="form-field lp_sale_end_dates_fields">
|
70 |
-
<label for="_lp_sale_start"><?php esc_html_e( 'Sale end dates', 'learnpress' ); ?></label>
|
71 |
-
<input type="text" class="short" name="_lp_sale_end" id="_lp_sale_end" value="<?php echo esc_attr( $end_date ); ?>" placeholder="<?php echo esc_html( _x( 'To…', 'placeholder', 'learnpress' ) ); ?>" style="width:320px;" />
|
72 |
-
<a href="#" class="description lp_cancel_sale_schedule"><?php esc_html_e( 'Cancel', 'learnpress' ); ?></a>
|
73 |
-
</p>
|
74 |
-
</div>
|
75 |
-
|
76 |
-
<?php do_action( 'learnpress/course-settings/after-price' ); ?>
|
77 |
-
|
78 |
-
<?php } else { ?>
|
79 |
-
<p><?php esc_html_e( 'Price set by admin', 'learnpress' ); ?></p>
|
80 |
-
<?php } ?>
|
81 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -50,6 +50,10 @@ class LP_Meta_Box_Checkbox_Field extends LP_Meta_Box_Field {
|
|
50 |
$checked = 'checked="checked"';
|
51 |
}
|
52 |
|
|
|
|
|
|
|
|
|
53 |
// Custom attribute handling
|
54 |
$custom_attributes = array();
|
55 |
if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) {
|
50 |
$checked = 'checked="checked"';
|
51 |
}
|
52 |
|
53 |
+
if ( isset( $field['value'] ) && $field['value'] === 'yes' ) {
|
54 |
+
$checked = 'checked="checked"';
|
55 |
+
}
|
56 |
+
|
57 |
// Custom attribute handling
|
58 |
$custom_attributes = array();
|
59 |
if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) {
|
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
*
|
6 |
-
* @author
|
7 |
* @version 1.0.0
|
8 |
* @since 4.0.0
|
9 |
*/
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* LP_Meta_Box_Field
|
5 |
*
|
6 |
+
* @author nhamdv
|
7 |
* @version 1.0.0
|
8 |
* @since 4.0.0
|
9 |
*/
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* LP_Meta_Box_Repeater
|
5 |
+
*
|
6 |
+
* @author Nhamdv
|
7 |
+
* @version 1.0.0
|
8 |
+
* @since 4.1.4
|
9 |
+
*/
|
10 |
+
class LP_Meta_Box_Repeater_Field extends LP_Meta_Box_Field {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Constructor.
|
14 |
+
*
|
15 |
+
* @param string $id
|
16 |
+
* @param string $label
|
17 |
+
* @param string $description
|
18 |
+
* @param mixed $default
|
19 |
+
* @param array $extra : fields for repeater, add_text for Add more text, title_text for Title
|
20 |
+
*/
|
21 |
+
public function __construct( $label = '', $description = '', $default = '', $extra = array() ) {
|
22 |
+
parent::__construct( $label, $description, $default, $extra );
|
23 |
+
}
|
24 |
+
|
25 |
+
public function output( $thepostid ) {
|
26 |
+
$repeaters = $this->meta_value( $thepostid );
|
27 |
+
?>
|
28 |
+
|
29 |
+
<div class="form-field lp_repeater_meta_box">
|
30 |
+
<label for="_lp_key_features"><?php echo $this->label; ?></label>
|
31 |
+
<div class="lp_repeater_meta_box__wrapper">
|
32 |
+
<div class="lp_repeater_meta_box__fields">
|
33 |
+
<?php if ( ! empty( $repeaters ) ) : ?>
|
34 |
+
<?php foreach ( $repeaters as $key => $repeater ) : ?>
|
35 |
+
<?php $this->repeater_html( $thepostid, $repeater, false, $key ); ?>
|
36 |
+
<?php endforeach; ?>
|
37 |
+
<?php endif; ?>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<a href="#" class="button button-primary lp_repeater_meta_box__add"
|
41 |
+
data-add="
|
42 |
+
<?php
|
43 |
+
ob_start();
|
44 |
+
$this->repeater_html( $thepostid, false, true );
|
45 |
+
echo esc_attr( ob_get_clean() );
|
46 |
+
?>
|
47 |
+
">
|
48 |
+
<?php echo isset( $this->extra['add_text'] ) ? $this->extra['add_text'] : esc_html__( '+ Add more', 'learnpress' ); ?>
|
49 |
+
</a>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
|
56 |
+
public function save( $post_id ) {
|
57 |
+
$data = isset( $_POST[ $this->id ] ) ? wp_unslash( $_POST[ $this->id ] ) : array();
|
58 |
+
$output = array();
|
59 |
+
|
60 |
+
if ( ! empty( $data ) && is_array( $data ) ) {
|
61 |
+
foreach ( $data as $key => $val ) {
|
62 |
+
foreach ( $this->extra['fields'] as $field_key => $field ) {
|
63 |
+
if ( get_class( $field ) === 'LP_Meta_Box_Checkbox_Field' ) {
|
64 |
+
$val[ $field_key ] = isset( $val[ $field_key ] ) ? 'yes' : 'no';
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
$sort_key = $val['sort'];
|
69 |
+
unset( $val['sort'] );
|
70 |
+
|
71 |
+
$output[ $sort_key ] = $val;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
update_post_meta( $post_id, $this->id, $output );
|
76 |
+
}
|
77 |
+
|
78 |
+
public function repeater_html( $thepostid, $repeater, $is_attr = false, $key = 'lp_metabox_repeater_key' ) {
|
79 |
+
?>
|
80 |
+
<div class="lp_repeater_meta_box__field <?php echo $is_attr ? 'lp_repeater_meta_box__field_active' : ''; ?>">
|
81 |
+
<input class="lp_repeater_meta_box__field__count" type="hidden" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $this->id ) . '[' . $key . ']' . '[sort]'; ?>">
|
82 |
+
<div class="lp_repeater_meta_box__title">
|
83 |
+
<span class="lp_repeater_meta_box__title__sort"></span>
|
84 |
+
<span class="lp_repeater_meta_box__title__title">
|
85 |
+
<?php echo isset( $this->extra['title_text'] ) ? $this->extra['title_text'] : esc_html__( 'Repeater', 'learnpress' ); ?>
|
86 |
+
<span><?php echo esc_html( absint( $key ) + 1 ); ?></span>
|
87 |
+
</span>
|
88 |
+
<a href="#" class="lp_repeater_meta_box__title__delete"></a>
|
89 |
+
<a href="#" class="lp_repeater_meta_box__title__toggle"></a>
|
90 |
+
</div>
|
91 |
+
<div class="lp_repeater_meta_box__content">
|
92 |
+
<?php
|
93 |
+
if ( isset( $this->extra['fields'] ) ) {
|
94 |
+
foreach ( $this->extra['fields'] as $field_key => $field ) {
|
95 |
+
$field->id = $this->id . '[' . $key . '][' . $field_key . ']';
|
96 |
+
$field->extra['value'] = $is_attr ? '' : $repeater[ $field_key ];
|
97 |
+
echo $field->output( $thepostid );
|
98 |
+
}
|
99 |
+
}
|
100 |
+
?>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
<?php
|
104 |
+
}
|
105 |
+
}
|
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
*
|
6 |
-
* @author
|
7 |
* @version 1.0.0
|
8 |
* @since 4.0.0
|
9 |
*/
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* LP_Meta_Box_Text_Field
|
5 |
*
|
6 |
+
* @author nhamdv
|
7 |
* @version 1.0.0
|
8 |
* @since 4.0.0
|
9 |
*/
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* LP_Meta_Box_WP_Editor_Field
|
5 |
+
*
|
6 |
+
* @author Nhamdv
|
7 |
+
* @version 1.0.0
|
8 |
+
* @since 4.1.3
|
9 |
+
*/
|
10 |
+
class LP_Meta_Box_WP_Editor_Field extends LP_Meta_Box_Field {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Constructor.
|
14 |
+
*
|
15 |
+
* @param string $id
|
16 |
+
* @param string $label
|
17 |
+
* @param string $description
|
18 |
+
* @param mixed $default
|
19 |
+
* @param array $extra
|
20 |
+
*/
|
21 |
+
public function __construct( $label = '', $description = '', $default = '', $extra = array() ) {
|
22 |
+
parent::__construct( $label, $description, $default, $extra );
|
23 |
+
}
|
24 |
+
|
25 |
+
public function output( $thepostid ) {
|
26 |
+
wp_enqueue_editor();
|
27 |
+
|
28 |
+
if ( empty( $this->id ) ) {
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
$extra = $this->extra;
|
33 |
+
$wrapper_class = ! empty( $extra['wrapper_class'] ) ? esc_attr( $extra['wrapper_class'] ) : '';
|
34 |
+
|
35 |
+
$meta = $this->meta_value( $thepostid );
|
36 |
+
$value = ! $meta && ! empty( $this->default ) ? $this->default : $meta;
|
37 |
+
$value = isset( $extra['value'] ) ? $extra['value'] : $value;
|
38 |
+
$desc_tip = $extra['desc_tip'] ?? '';
|
39 |
+
|
40 |
+
echo '<div class="lp-meta-box__wp-editor form-field ' . $this->id . '_field ' . $wrapper_class . '">
|
41 |
+
<label for="' . esc_attr( $this->id ) . '">' . wp_kses_post( $this->label ) . '</label>';
|
42 |
+
|
43 |
+
echo wp_editor(
|
44 |
+
$value,
|
45 |
+
$this->id,
|
46 |
+
array(
|
47 |
+
'textarea_rows' => 10,
|
48 |
+
'editor_class' => 'lp-meta-box__wp-editor__textarea',
|
49 |
+
)
|
50 |
+
);
|
51 |
+
|
52 |
+
if ( ! empty( $this->description ) ) {
|
53 |
+
echo '<p class="description">';
|
54 |
+
echo '<span>' . wp_kses_post( $this->description ) . '</span>';
|
55 |
+
|
56 |
+
if ( ! empty( $desc_tip ) ) {
|
57 |
+
learn_press_quick_tip( $desc_tip );
|
58 |
+
}
|
59 |
+
echo '</p>';
|
60 |
+
}
|
61 |
+
echo '</div>';
|
62 |
+
}
|
63 |
+
|
64 |
+
public function save( $post_id ) {
|
65 |
+
$meta_value = isset( $_POST[ $this->id ] ) ? wpautop( wp_unslash( $_POST[ $this->id ] ) ) : $this->default;
|
66 |
+
|
67 |
+
update_post_meta( $post_id, $this->id, $meta_value );
|
68 |
+
}
|
69 |
+
}
|
@@ -126,7 +126,7 @@ $user_ip = $order->get_user_ip_address();
|
|
126 |
|
127 |
}
|
128 |
|
129 |
-
learn_press_admin_view( 'meta-boxes/order/child-order', array( 'order' => $order ) );
|
130 |
?>
|
131 |
|
132 |
</div>
|
126 |
|
127 |
}
|
128 |
|
129 |
+
//learn_press_admin_view( 'meta-boxes/order/child-order', array( 'order' => $order ) );
|
130 |
?>
|
131 |
|
132 |
</div>
|
@@ -3,14 +3,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
-
if ( ! class_exists( 'WP_Async_Request', false ) ) {
|
7 |
-
include_once LP_PLUGIN_PATH . '/inc/libraries/wp-async-request.php';
|
8 |
-
}
|
9 |
-
|
10 |
-
if ( ! class_exists( 'WP_Background_Process', false ) ) {
|
11 |
-
include_once LP_PLUGIN_PATH . '/inc/libraries/wp-background-process.php';
|
12 |
-
}
|
13 |
-
|
14 |
if ( ! class_exists( 'LP_Abstract_Background_Process' ) ) {
|
15 |
/**
|
16 |
* Class LP_Abstract_Background_Process
|
3 |
exit;
|
4 |
}
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
if ( ! class_exists( 'LP_Abstract_Background_Process' ) ) {
|
7 |
/**
|
8 |
* Class LP_Abstract_Background_Process
|
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Send emails in background
|
4 |
-
*/
|
5 |
-
defined( 'ABSPATH' ) || exit;
|
6 |
-
|
7 |
-
if ( ! class_exists( 'LP_Background_Email' ) ) {
|
8 |
-
/**
|
9 |
-
* Class LP_Background_Emailer
|
10 |
-
*
|
11 |
-
* @since 3.0.0
|
12 |
-
*/
|
13 |
-
class LP_Background_Email extends LP_Abstract_Background_Process {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @var string
|
17 |
-
*/
|
18 |
-
protected $action = 'lp_mailer';
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var int
|
22 |
-
*/
|
23 |
-
protected $queue_lock_time = 3600;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* LP_Background_Emailer constructor.
|
27 |
-
*/
|
28 |
-
public function __construct() {
|
29 |
-
parent::__construct();
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param mixed $callback
|
34 |
-
*
|
35 |
-
* @return bool
|
36 |
-
*/
|
37 |
-
protected function task( $callback ) {
|
38 |
-
parent::task( $callback );
|
39 |
-
|
40 |
-
if ( isset( $callback['filter'], $callback['args'] ) ) {
|
41 |
-
try {
|
42 |
-
LP_Emails::send_email( $callback['filter'], $callback['args'] );
|
43 |
-
} catch ( Exception $e ) {
|
44 |
-
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
return false;
|
49 |
-
}
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class LP_Background_Single_Course
|
4 |
+
*
|
5 |
+
* Single to run not schedule, run one time and done when be call
|
6 |
+
*
|
7 |
+
* @since 4.1.1
|
8 |
+
* @author tungnx
|
9 |
+
* @version 1.0.1
|
10 |
+
*/
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
if ( ! class_exists( 'LP_Background_Single_Course' ) ) {
|
14 |
+
class LP_Background_Single_Course extends WP_Async_Request {
|
15 |
+
protected $prefix = 'lp';
|
16 |
+
protected $action = 'background_single_course';
|
17 |
+
protected static $instance;
|
18 |
+
/**
|
19 |
+
* @var $lp_course_db LP_Course_DB
|
20 |
+
*/
|
21 |
+
protected $lp_course_db;
|
22 |
+
/**
|
23 |
+
* @var $lp_course LP_Course
|
24 |
+
*/
|
25 |
+
protected $lp_course;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get params via $_POST and handle
|
29 |
+
* @in_array
|
30 |
+
* @see LP_Course_Post_Type::save
|
31 |
+
*/
|
32 |
+
protected function handle() {
|
33 |
+
$this->lp_course_db = LP_Course_DB::getInstance();
|
34 |
+
|
35 |
+
try {
|
36 |
+
if ( ! isset( $_POST['handle_name'] ) || empty( $_POST['handle_name'] )
|
37 |
+
|| ! isset( $_POST['course_id'] ) || empty( $_POST['course_id'] ) ) {
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
$course_id = $_POST['course_id'];
|
42 |
+
|
43 |
+
$this->lp_course = new LP_Course( $course_id );
|
44 |
+
|
45 |
+
switch ( $_POST['handle_name'] ) {
|
46 |
+
case 'save_post':
|
47 |
+
$this->save_post();
|
48 |
+
break;
|
49 |
+
default:
|
50 |
+
break;
|
51 |
+
}
|
52 |
+
} catch ( Throwable $e ) {
|
53 |
+
error_log( $e->getMessage() );
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Save course post data
|
59 |
+
*
|
60 |
+
* @throws Exception
|
61 |
+
*/
|
62 |
+
protected function save_post() {
|
63 |
+
$lp_course_db = $this->lp_course_db;
|
64 |
+
$lp_course = $this->lp_course;
|
65 |
+
|
66 |
+
// Set first item id
|
67 |
+
$first_item_id = $lp_course_db->get_first_item_id( $lp_course->get_id() );
|
68 |
+
$extra_info = $this->lp_course->get_info_extra_for_fast_query();
|
69 |
+
|
70 |
+
$extra_info->first_item_id = $first_item_id;
|
71 |
+
|
72 |
+
// Save post meta
|
73 |
+
$lp_course->set_info_extra_for_fast_query( $extra_info );
|
74 |
+
// End set first item id
|
75 |
+
|
76 |
+
// Check user is Instructor and enable review post of Instructor
|
77 |
+
$user = learn_press_get_current_user();
|
78 |
+
$required_review = LP_Settings::get_option( 'required_review', 'yes' ) === 'yes';
|
79 |
+
|
80 |
+
if ( $user->is_instructor() && $required_review ) {
|
81 |
+
wp_update_post(
|
82 |
+
array(
|
83 |
+
'ID' => $lp_course->get_id(),
|
84 |
+
'post_status' => 'pending',
|
85 |
+
),
|
86 |
+
array( '%d', '%s' )
|
87 |
+
);
|
88 |
+
}
|
89 |
+
// End
|
90 |
+
|
91 |
+
// Clear cache
|
92 |
+
$lp_course_cache = LP_Course_Cache::instance();
|
93 |
+
$key_cache_arr = [];
|
94 |
+
foreach ( $key_cache_arr as $key_cache ) {
|
95 |
+
$lp_course_cache->clear( $key_cache );
|
96 |
+
}
|
97 |
+
// End
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @return LP_Background_Single_Course
|
102 |
+
*/
|
103 |
+
public static function instance(): self {
|
104 |
+
if ( is_null( self::$instance ) ) {
|
105 |
+
self::$instance = new self();
|
106 |
+
}
|
107 |
+
|
108 |
+
return self::$instance;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
// Must run instance to register ajax.
|
113 |
+
LP_Background_Single_Course::instance();
|
114 |
+
}
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Send emails in background
|
4 |
+
*/
|
5 |
+
defined( 'ABSPATH' ) || exit;
|
6 |
+
|
7 |
+
if ( ! class_exists( 'LP_Background_Single_Email' ) ) {
|
8 |
+
/**
|
9 |
+
* Class LP_Background_Single_Email
|
10 |
+
*
|
11 |
+
* @since 4.1.1
|
12 |
+
* @author tungnx
|
13 |
+
*/
|
14 |
+
class LP_Background_Single_Email extends WP_Async_Request {
|
15 |
+
protected $prefix = 'lp';
|
16 |
+
protected $action = 'background_single_email';
|
17 |
+
protected static $instance;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Method async handle
|
21 |
+
*/
|
22 |
+
protected function handle() {
|
23 |
+
$params = $_POST['params'] ?? false;
|
24 |
+
$class_name = $_POST['class_name'] ?? false;
|
25 |
+
|
26 |
+
if ( ! $class_name || ! $params ) {
|
27 |
+
error_log( 'Params send email on background is invalid' );
|
28 |
+
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( ! class_exists( $class_name ) ) {
|
33 |
+
error_log( 'Class not exists: ' . $class_name );
|
34 |
+
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( ! method_exists( $class_name, 'handle' ) ) {
|
39 |
+
error_log( "Method 'handle' not exists on class $class_name" );
|
40 |
+
|
41 |
+
return;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @var LP_Email_Type_Enrolled_Course $email
|
46 |
+
*/
|
47 |
+
$email = new $class_name;
|
48 |
+
$email->handle( $params );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @return LP_Background_Single_Email
|
53 |
+
*/
|
54 |
+
public static function instance(): self {
|
55 |
+
if ( is_null( self::$instance ) ) {
|
56 |
+
self::$instance = new self();
|
57 |
+
}
|
58 |
+
|
59 |
+
return self::$instance;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
// Must run instance to register ajax.
|
64 |
+
LP_Background_Single_Email::instance();
|
65 |
+
}
|
@@ -5,12 +5,81 @@
|
|
5 |
*
|
6 |
* @author tungnx
|
7 |
* @since 4.0.8
|
8 |
-
* @version 1.0.
|
9 |
*/
|
10 |
defined( 'ABSPATH' ) || exit();
|
11 |
|
12 |
class LP_Cache {
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
}
|
5 |
*
|
6 |
* @author tungnx
|
7 |
* @since 4.0.8
|
8 |
+
* @version 1.0.1
|
9 |
*/
|
10 |
defined( 'ABSPATH' ) || exit();
|
11 |
|
12 |
class LP_Cache {
|
13 |
+
protected static $instance;
|
14 |
+
/**
|
15 |
+
* @var string Key group parent
|
16 |
+
*/
|
17 |
+
protected $key_group_parent = 'learn_press/';
|
18 |
+
/**
|
19 |
+
* @var string Key group child(external)
|
20 |
+
*/
|
21 |
+
protected $key_group_child = '';
|
22 |
+
/**
|
23 |
+
* @var string Add key group parent with key group child
|
24 |
+
*/
|
25 |
+
protected $key_group = '';
|
26 |
+
/**
|
27 |
+
* @var float|int default expire
|
28 |
+
*/
|
29 |
+
protected $expire = DAY_IN_SECONDS;
|
30 |
|
31 |
+
/**
|
32 |
+
* Get instance
|
33 |
+
*
|
34 |
+
* @return LP_Cache
|
35 |
+
*/
|
36 |
+
public static function instance(): LP_Cache {
|
37 |
+
if ( is_null( self::$instance ) ) {
|
38 |
+
self::$instance = new self();
|
39 |
+
}
|
40 |
+
|
41 |
+
return self::$instance;
|
42 |
+
}
|
43 |
+
|
44 |
+
protected function __construct() {
|
45 |
+
$this->key_group = $this->key_group_parent . $this->key_group_child;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Set cache
|
50 |
+
* $expire = -1 is get default expire time on one day(DAY_IN_SECONDS)
|
51 |
+
*
|
52 |
+
* @param string $key
|
53 |
+
* @param mixed $data
|
54 |
+
* @param int $expire
|
55 |
+
*/
|
56 |
+
public function set_cache( string $key, $data, int $expire = -1 ) {
|
57 |
+
if ( -1 === $expire ) {
|
58 |
+
$expire = $this->expire;
|
59 |
+
}
|
60 |
+
wp_cache_set( $key, $data, $this->key_group, $expire );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Get cache
|
65 |
+
*
|
66 |
+
* @param string $key
|
67 |
+
* @return false|mixed
|
68 |
+
*/
|
69 |
+
public function get_cache( string $key ) {
|
70 |
+
return wp_cache_get( $key, $this->key_group );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Clear cache by key
|
75 |
+
*
|
76 |
+
* @param $key
|
77 |
+
*/
|
78 |
+
public function clear( $key ) {
|
79 |
+
wp_cache_delete( $key, $this->key_group );
|
80 |
+
}
|
81 |
+
|
82 |
+
public function clear_all() {
|
83 |
+
wp_cache_flush();
|
84 |
}
|
85 |
}
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class LP_Course_Cache
|
5 |
+
*
|
6 |
+
* @author tungnx
|
7 |
+
* @since 4.0.9
|
8 |
+
* @version 1.0.0
|
9 |
+
*/
|
10 |
+
defined( 'ABSPATH' ) || exit();
|
11 |
+
|
12 |
+
class LP_Course_Cache extends LP_Cache {
|
13 |
+
protected static $instance;
|
14 |
+
protected $key_group_child = 'course';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get instance
|
18 |
+
*
|
19 |
+
* @return LP_Cache
|
20 |
+
*/
|
21 |
+
public static function instance(): LP_Cache {
|
22 |
+
if ( is_null( self::$instance ) ) {
|
23 |
+
self::$instance = new self();
|
24 |
+
}
|
25 |
+
|
26 |
+
return self::$instance;
|
27 |
+
}
|
28 |
+
|
29 |
+
protected function __construct() {
|
30 |
+
parent::__construct();
|
31 |
+
}
|
32 |
+
}
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class LP_Quiz_Cache
|
5 |
+
*
|
6 |
+
* @author tungnx
|
7 |
+
* @since 4.0.9
|
8 |
+
* @version 1.0.0
|
9 |
+
*/
|
10 |
+
defined( 'ABSPATH' ) || exit();
|
11 |
+
|
12 |
+
class LP_Quiz_Cache extends LP_Cache {
|
13 |
+
protected static $instance;
|
14 |
+
protected $key_group_child = 'quiz';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get instance
|
18 |
+
*
|
19 |
+
* @return LP_Cache
|
20 |
+
*/
|
21 |
+
public static function instance(): LP_Cache {
|
22 |
+
if ( is_null( self::$instance ) ) {
|
23 |
+
self::$instance = new self();
|
24 |
+
}
|
25 |
+
|
26 |
+
return self::$instance;
|
27 |
+
}
|
28 |
+
|
29 |
+
protected function __construct() {
|
30 |
+
parent::__construct();
|
31 |
+
}
|
32 |
+
}
|
@@ -167,9 +167,6 @@ class LP_Cart {
|
|
167 |
|
168 |
$this->set_cart_cookies( true );
|
169 |
|
170 |
-
// @deprecated
|
171 |
-
do_action( 'learn_press_add_to_cart', $course_id, $quantity, $item_data, $this );
|
172 |
-
|
173 |
/**
|
174 |
* @see LP_Cart::calculate_totals()
|
175 |
*/
|
167 |
|
168 |
$this->set_cart_cookies( true );
|
169 |
|
|
|
|
|
|
|
170 |
/**
|
171 |
* @see LP_Cart::calculate_totals()
|
172 |
*/
|
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @author tungnx
|
7 |
* @package LearnPress/Classes
|
8 |
-
* @version 1.0
|
9 |
* @since 3.2.8
|
10 |
*/
|
11 |
|
@@ -50,6 +50,12 @@ class LP_Asset_Key {
|
|
50 |
* @var array|string[]
|
51 |
*/
|
52 |
public $_exclude_screens = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
/**
|
55 |
* LP_ASSET_KEY constructor.
|
@@ -60,12 +66,13 @@ class LP_Asset_Key {
|
|
60 |
* @param int $only_register .
|
61 |
* @param int $in_footer .
|
62 |
*/
|
63 |
-
public function __construct( string $url = '', array $deps = array(), array $screens = array(), int $only_register = 1, int $in_footer = 0 ) {
|
64 |
$this->_url = $url;
|
65 |
$this->_deps = $deps;
|
66 |
$this->_in_footer = $in_footer;
|
67 |
$this->_only_register = $only_register;
|
68 |
$this->_screens = $screens;
|
|
|
69 |
}
|
70 |
|
71 |
/**
|
@@ -76,4 +83,13 @@ class LP_Asset_Key {
|
|
76 |
public function exclude_screen( array $screens = array() ) {
|
77 |
$this->_exclude_screens = $screens;
|
78 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
5 |
*
|
6 |
* @author tungnx
|
7 |
* @package LearnPress/Classes
|
8 |
+
* @version 1.0.1
|
9 |
* @since 3.2.8
|
10 |
*/
|
11 |
|
50 |
* @var array|string[]
|
51 |
*/
|
52 |
public $_exclude_screens = array();
|
53 |
+
/**
|
54 |
+
* Version of addon
|
55 |
+
*
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
public $_version = '';
|
59 |
|
60 |
/**
|
61 |
* LP_ASSET_KEY constructor.
|
66 |
* @param int $only_register .
|
67 |
* @param int $in_footer .
|
68 |
*/
|
69 |
+
public function __construct( string $url = '', array $deps = array(), array $screens = array(), int $only_register = 1, int $in_footer = 0, string $version = '' ) {
|
70 |
$this->_url = $url;
|
71 |
$this->_deps = $deps;
|
72 |
$this->_in_footer = $in_footer;
|
73 |
$this->_only_register = $only_register;
|
74 |
$this->_screens = $screens;
|
75 |
+
$this->_version = $version;
|
76 |
}
|
77 |
|
78 |
/**
|
83 |
public function exclude_screen( array $screens = array() ) {
|
84 |
$this->_exclude_screens = $screens;
|
85 |
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Set dependency
|
89 |
+
*
|
90 |
+
* @param array $deps
|
91 |
+
*/
|
92 |
+
public function set_dependency_js( array $deps ) {
|
93 |
+
$this->_deps = $deps;
|
94 |
+
}
|
95 |
}
|
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author ThimPress
|
6 |
* @package LearnPress/Classes
|
7 |
-
* @version 4.0.
|
8 |
*/
|
9 |
|
10 |
defined( 'ABSPATH' ) || exit;
|
@@ -22,25 +22,35 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
22 |
}
|
23 |
|
24 |
/**
|
25 |
-
* Get default styles in
|
26 |
*
|
27 |
-
* @return
|
28 |
*/
|
29 |
-
protected function _get_styles() {
|
30 |
return apply_filters(
|
31 |
'learn-press/frontend-default-styles',
|
32 |
array(
|
33 |
-
'lp-font-awesome-5'
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
),
|
37 |
-
'
|
38 |
-
|
39 |
-
|
|
|
|
|
40 |
),
|
41 |
-
'learnpress'
|
42 |
-
|
43 |
-
|
|
|
|
|
44 |
),
|
45 |
)
|
46 |
);
|
@@ -144,7 +154,10 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
144 |
// 'lp-lesson' => new LP_Asset_Key( self::url( self::$_folder_source .'js/frontend/lesson' . self::$_min_assets . '.js' ) ),
|
145 |
'lp-question-types' => new LP_Asset_Key(
|
146 |
self::url( 'js/dist/frontend/question-types' . self::$_min_assets . '.js' ),
|
147 |
-
array_merge( $wp_js, array( 'lp-global' ) )
|
|
|
|
|
|
|
148 |
),
|
149 |
'lp-single-curriculum' => new LP_Asset_Key(
|
150 |
self::url( 'js/dist/frontend/single-curriculum' . self::$_min_assets . '.js' ),
|
@@ -172,8 +185,6 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
172 |
'lp-modal',
|
173 |
'lp-config',
|
174 |
'lp-single-curriculum',
|
175 |
-
'jquery-ui-sortable', // Use in question type: sorting choice - Nhamdv
|
176 |
-
|
177 |
)
|
178 |
),
|
179 |
array( LP_PAGE_QUIZ ),
|
@@ -195,7 +206,7 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
195 |
),
|
196 |
'lp-courses' => new LP_Asset_Key(
|
197 |
self::url( self::$_folder_source . 'js/frontend/courses' . self::$_min_assets . '.js' ),
|
198 |
-
array( 'lp-global', '
|
199 |
array( LP_PAGE_COURSES ),
|
200 |
0,
|
201 |
1
|
@@ -225,6 +236,16 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
225 |
0,
|
226 |
1
|
227 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
'lp-become-a-teacher' => new LP_Asset_Key(
|
229 |
self::url( self::$_folder_source . 'js/frontend/become-teacher' . self::$_min_assets . '.js' ),
|
230 |
array( 'jquery', 'lp-utils' ),
|
@@ -232,10 +253,6 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
232 |
0,
|
233 |
1
|
234 |
),
|
235 |
-
/*
|
236 |
-
'lp-custom' => new LP_Asset_Key( self::url( 'js/dist/frontend/custom' . self::$_min_assets . '.js' ),
|
237 |
-
array( 'jquery', )
|
238 |
-
),*/
|
239 |
)
|
240 |
);
|
241 |
|
@@ -246,90 +263,19 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
246 |
|
247 |
/**
|
248 |
* Load assets
|
|
|
|
|
|
|
|
|
249 |
*/
|
250 |
public function load_scripts() {
|
251 |
-
// Register script.
|
252 |
-
// $this->_register_scripts();
|
253 |
-
// $scripts = $this->_get_scripts();
|
254 |
-
|
255 |
-
// if ( $scripts ) {
|
256 |
-
// foreach ( $scripts as $handle => $data ) {
|
257 |
-
// $enqueue = false;
|
258 |
-
//
|
259 |
-
// do_action( 'learn-press/enqueue-script/' . $handle );
|
260 |
-
//
|
261 |
-
// if ( ! empty( $data['screens'] ) ) {
|
262 |
-
// $enqueue = $this->is_screen( $data['screens'] );
|
263 |
-
// }
|
264 |
-
//
|
265 |
-
// if ( $enqueue ) {
|
266 |
-
// wp_enqueue_script( $handle );
|
267 |
-
// }
|
268 |
-
// }
|
269 |
-
// }
|
270 |
-
|
271 |
$page_current = lp_page_controller()::page_current();
|
272 |
$this->handle_js( $page_current );
|
273 |
-
|
274 |
-
$styles = $this->_get_styles();
|
275 |
-
if ( $styles ) {
|
276 |
-
foreach ( $styles as $handle => $data ) {
|
277 |
-
$enqueue = false;
|
278 |
-
|
279 |
-
do_action( 'learn-press/enqueue-style/' . $handle );
|
280 |
-
|
281 |
-
wp_register_style( $handle, $data['url'], array(), self::$_version_assets );
|
282 |
-
|
283 |
-
if ( ! empty( $data['screens'] ) ) {
|
284 |
-
$enqueue = $this->is_screen( $data['screens'] );
|
285 |
-
}
|
286 |
-
|
287 |
-
if ( $enqueue ) {
|
288 |
-
wp_enqueue_style( $handle );
|
289 |
-
}
|
290 |
-
}
|
291 |
-
}
|
292 |
|
293 |
do_action( 'learn-press/after-enqueue-scripts' );
|
294 |
}
|
295 |
|
296 |
-
protected function handle_js( $page_current ) {
|
297 |
-
$scripts = $this->_get_scripts();
|
298 |
-
/**
|
299 |
-
* @var LP_Asset_Key[] $scripts
|
300 |
-
*/
|
301 |
-
foreach ( $scripts as $handle => $script ) {
|
302 |
-
if ( ! $script instanceof LP_Asset_Key ) {
|
303 |
-
continue;
|
304 |
-
}
|
305 |
-
|
306 |
-
wp_register_script( $handle, $script->_url, $script->_deps, self::$_version_assets, $script->_in_footer );
|
307 |
-
|
308 |
-
if ( ! $script->_only_register ) {
|
309 |
-
$can_load_js = true;
|
310 |
-
|
311 |
-
if ( ! empty( $script->_screens ) ) {
|
312 |
-
$can_load_js = apply_filters(
|
313 |
-
'learnpress/frontend/can-load-js/' . $handle,
|
314 |
-
in_array( $page_current, $script->_screens ),
|
315 |
-
$page_current,
|
316 |
-
$script->_screens
|
317 |
-
);
|
318 |
-
}
|
319 |
-
|
320 |
-
if ( $can_load_js ) {
|
321 |
-
wp_enqueue_script( $handle );
|
322 |
-
}
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Set translate on file js of folder js/dist
|
328 |
-
* Path translate of a string on file ".pot" if have must map to js/dist
|
329 |
-
*/
|
330 |
-
wp_set_script_translations( 'lp-quiz', 'learnpress' );
|
331 |
-
}
|
332 |
-
|
333 |
/**
|
334 |
* Check is currently in a screen required.
|
335 |
*
|
@@ -337,7 +283,10 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
337 |
*
|
338 |
* @return bool
|
339 |
* @since 3.3.0
|
|
|
|
|
340 |
*/
|
|
|
341 |
public function is_screen( $screens ) {
|
342 |
$pages = array(
|
343 |
'profile',
|
@@ -406,7 +355,7 @@ class LP_Assets extends LP_Abstract_Assets {
|
|
406 |
}
|
407 |
|
408 |
return $is_screen;
|
409 |
-
}
|
410 |
|
411 |
/**
|
412 |
* Add lp overlay
|
4 |
*
|
5 |
* @author ThimPress
|
6 |
* @package LearnPress/Classes
|
7 |
+
* @version 4.0.1
|
8 |
*/
|
9 |
|
10 |
defined( 'ABSPATH' ) || exit;
|
22 |
}
|
23 |
|
24 |
/**
|
25 |
+
* Get default styles in frontend.
|
26 |
*
|
27 |
+
* @return array
|
28 |
*/
|
29 |
+
protected function _get_styles(): array {
|
30 |
return apply_filters(
|
31 |
'learn-press/frontend-default-styles',
|
32 |
array(
|
33 |
+
'lp-font-awesome-5' => new LP_Asset_Key(
|
34 |
+
self::url( 'src/css/vendor/font-awesome-5.min.css' ),
|
35 |
+
array(),
|
36 |
+
array()
|
37 |
+
),
|
38 |
+
'lp-bundle' => new LP_Asset_Key(
|
39 |
+
self::url( 'css/bundle.min.css' ),
|
40 |
+
array(),
|
41 |
+
array()
|
42 |
),
|
43 |
+
'learnpress' => new LP_Asset_Key(
|
44 |
+
self::url( 'css/learnpress.css' ),
|
45 |
+
array( 'lp-font-awesome-5', 'lp-bundle' ),
|
46 |
+
array( LP_PAGE_COURSES, LP_PAGE_SINGLE_COURSE, LP_PAGE_SINGLE_COURSE_CURRICULUM, LP_PAGE_QUIZ, LP_PAGE_QUESTION, LP_PAGE_CHECKOUT, LP_PAGE_BECOME_A_TEACHER ),
|
47 |
+
0
|
48 |
),
|
49 |
+
'learnpress-widgets' => new LP_Asset_Key(
|
50 |
+
self::url( 'css/widgets.css' ),
|
51 |
+
array(),
|
52 |
+
array(),
|
53 |
+
0
|
54 |
),
|
55 |
)
|
56 |
);
|
154 |
// 'lp-lesson' => new LP_Asset_Key( self::url( self::$_folder_source .'js/frontend/lesson' . self::$_min_assets . '.js' ) ),
|
155 |
'lp-question-types' => new LP_Asset_Key(
|
156 |
self::url( 'js/dist/frontend/question-types' . self::$_min_assets . '.js' ),
|
157 |
+
array_merge( $wp_js, array( 'lp-global' ) ),
|
158 |
+
array(),
|
159 |
+
1,
|
160 |
+
1
|
161 |
),
|
162 |
'lp-single-curriculum' => new LP_Asset_Key(
|
163 |
self::url( 'js/dist/frontend/single-curriculum' . self::$_min_assets . '.js' ),
|
185 |
'lp-modal',
|
186 |
'lp-config',
|
187 |
'lp-single-curriculum',
|
|
|
|
|
188 |
)
|
189 |
),
|
190 |
array( LP_PAGE_QUIZ ),
|
206 |
),
|
207 |
'lp-courses' => new LP_Asset_Key(
|
208 |
self::url( self::$_folder_source . 'js/frontend/courses' . self::$_min_assets . '.js' ),
|
209 |
+
array( 'lp-global', 'lp-utils' ),
|
210 |
array( LP_PAGE_COURSES ),
|
211 |
0,
|
212 |
1
|
236 |
0,
|
237 |
1
|
238 |
),
|
239 |
+
'lp-widgets' => new LP_Asset_Key(
|
240 |
+
self::url( 'js/dist/frontend/widgets' . self::$_min_assets . '.js' ),
|
241 |
+
array_merge(
|
242 |
+
$wp_js,
|
243 |
+
array( 'wp-i18n' )
|
244 |
+
),
|
245 |
+
array(),
|
246 |
+
1,
|
247 |
+
1
|
248 |
+
),
|
249 |
'lp-become-a-teacher' => new LP_Asset_Key(
|
250 |
self::url( self::$_folder_source . 'js/frontend/become-teacher' . self::$_min_assets . '.js' ),
|
251 |
array( 'jquery', 'lp-utils' ),
|
253 |
0,
|
254 |
1
|
255 |
),
|
|
|
|
|
|
|
|
|
256 |
)
|
257 |
);
|
258 |
|
263 |
|
264 |
/**
|
265 |
* Load assets
|
266 |
+
*
|
267 |
+
* @author tungnx
|
268 |
+
* @version 1.0.1
|
269 |
+
* @since 3.2.8
|
270 |
*/
|
271 |
public function load_scripts() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
$page_current = lp_page_controller()::page_current();
|
273 |
$this->handle_js( $page_current );
|
274 |
+
$this->handle_style( $page_current );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
|
276 |
do_action( 'learn-press/after-enqueue-scripts' );
|
277 |
}
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
/**
|
280 |
* Check is currently in a screen required.
|
281 |
*
|
283 |
*
|
284 |
* @return bool
|
285 |
* @since 3.3.0
|
286 |
+
* @editor tungnx
|
287 |
+
* @reason comment - not use
|
288 |
*/
|
289 |
+
/*
|
290 |
public function is_screen( $screens ) {
|
291 |
$pages = array(
|
292 |
'profile',
|
355 |
}
|
356 |
|
357 |
return $is_screen;
|
358 |
+
}*/
|
359 |
|
360 |
/**
|
361 |
* Add lp overlay
|
@@ -119,7 +119,6 @@ class LP_Checkout {
|
|
119 |
|
120 |
$user_id = 0;
|
121 |
$checkout_option = LP_Request::get_string( 'checkout-email-option' );
|
122 |
-
$order->delete_meta( '_create_account' );
|
123 |
|
124 |
switch ( $checkout_option ) {
|
125 |
case 'new-account':
|
@@ -139,10 +138,8 @@ class LP_Checkout {
|
|
139 |
|
140 |
if ( $user_id ) {
|
141 |
$order->set_user_id( $user_id );
|
|
|
142 |
}
|
143 |
-
|
144 |
-
$order->save();
|
145 |
-
|
146 |
} catch ( Exception $ex ) {
|
147 |
if ( $ex->getCode() && $ex->getMessage() ) {
|
148 |
$result['message'] = $ex->getMessage();
|
@@ -450,7 +447,7 @@ class LP_Checkout {
|
|
450 |
* @since 3.0.0
|
451 |
*/
|
452 |
public function is_enable_guest_checkout() {
|
453 |
-
return apply_filters( 'learn-press/checkout/enable-guest', LP()->settings()->get( 'guest_checkout' ) == 'yes' );
|
454 |
}
|
455 |
|
456 |
/**
|
@@ -681,7 +678,7 @@ class LP_Checkout {
|
|
681 |
} else {
|
682 |
// maybe throw new exception
|
683 |
$this->validate_payment();
|
684 |
-
|
685 |
// Create order.
|
686 |
$order_id = $this->create_order();
|
687 |
|
119 |
|
120 |
$user_id = 0;
|
121 |
$checkout_option = LP_Request::get_string( 'checkout-email-option' );
|
|
|
122 |
|
123 |
switch ( $checkout_option ) {
|
124 |
case 'new-account':
|
138 |
|
139 |
if ( $user_id ) {
|
140 |
$order->set_user_id( $user_id );
|
141 |
+
$order->save();
|
142 |
}
|
|
|
|
|
|
|
143 |
} catch ( Exception $ex ) {
|
144 |
if ( $ex->getCode() && $ex->getMessage() ) {
|
145 |
$result['message'] = $ex->getMessage();
|
447 |
* @since 3.0.0
|
448 |
*/
|
449 |
public function is_enable_guest_checkout() {
|
450 |
+
return apply_filters( 'learn-press/checkout/enable-guest', LP()->settings()->get( 'guest_checkout', 'no' ) == 'yes' );
|
451 |
}
|
452 |
|
453 |
/**
|
678 |
} else {
|
679 |
// maybe throw new exception
|
680 |
$this->validate_payment();
|
681 |
+
|
682 |
// Create order.
|
683 |
$order_id = $this->create_order();
|
684 |
|
@@ -32,11 +32,6 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
32 |
*/
|
33 |
protected static $_instance = null;
|
34 |
|
35 |
-
/**
|
36 |
-
* @var LP_Background_Emailer
|
37 |
-
*/
|
38 |
-
// protected static $_background_emailer = null;
|
39 |
-
|
40 |
/**
|
41 |
* @var LP_Email
|
42 |
*/
|
@@ -58,73 +53,56 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
58 |
|
59 |
$this->register_emails();
|
60 |
|
61 |
-
add_action( 'learn_press_course_submit_for_reviewer_notification', array( $this, 'review_course' ), 10, 2 );
|
62 |
-
add_action( 'learn_press_course_submit_rejected_notification', array( $this, 'course_rejected' ), 10, 2 );
|
63 |
-
add_action( 'learn_press_course_submit_approved_notification', array( $this, 'course_approved' ), 10, 2 );
|
64 |
-
add_action( 'learn_press_user_finish_course_notification', array( $this, 'finish_course' ), 10, 3 );
|
65 |
-
// Send email customer when order created
|
66 |
-
add_filter( 'learn_press_checkout_success_result_notification', array( $this, 'customer_new_order' ), 10, 2 );
|
67 |
-
add_action( 'set_user_role_notification', array( $this, 'become_an_teacher' ), 10, 3 );
|
68 |
-
|
69 |
-
// add_action( 'learn_press_email_header', array( $this, 'email_header' ) );
|
70 |
-
// add_action( 'learn_press_email_footer', array( $this, 'email_footer' ) );
|
71 |
-
|
72 |
do_action( 'learn-press/emails-init', $this );
|
73 |
}
|
74 |
|
75 |
public function register_emails() {
|
76 |
-
include_once
|
77 |
-
include_once
|
78 |
-
include_once
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
// New order
|
81 |
-
$this->emails['LP_Email_New_Order_Admin'] = include_once 'emails/class-lp-email-new-order-admin.php';
|
82 |
-
$this->emails['LP_Email_New_Order_User'] = include_once 'emails/class-lp-email-new-order-user.php';
|
83 |
-
$this->emails['LP_Email_New_Order_Instructor'] = include_once 'emails/class-lp-email-new-order-instructor.php';
|
84 |
-
$this->emails['LP_Email_New_Order_Guest'] = include_once 'emails/class-lp-email-new-order-guest.php';
|
85 |
|
86 |
// Processing order
|
87 |
-
$this->emails['LP_Email_Processing_Order_User'] = include_once 'emails/class-lp-email-processing-order-user.php';
|
88 |
-
$this->emails['LP_Email_Processing_Order_Guest'] = include_once 'emails/class-lp-email-processing-order-guest.php';
|
89 |
|
90 |
// Completed order
|
91 |
-
$this->emails['LP_Email_Completed_Order_Admin'] = include_once 'emails/class-lp-email-completed-order-admin.php';
|
92 |
-
$this->emails['LP_Email_Completed_Order_User'] = include_once 'emails/class-lp-email-completed-order-user.php';
|
93 |
-
$this->emails['LP_Email_Completed_Order_Guest'] = include_once 'emails/class-lp-email-completed-order-guest.php';
|
94 |
|
95 |
// Cancelled order
|
96 |
-
$this->emails['LP_Email_Cancelled_Order_Admin'] = include_once 'emails/class-lp-email-cancelled-order-admin.php';
|
97 |
-
$this->emails['LP_Email_Cancelled_Order_Instructor'] = include_once 'emails/class-lp-email-cancelled-order-instructor.php';
|
98 |
-
$this->emails['LP_Email_Cancelled_Order_User'] = include_once 'emails/class-lp-email-cancelled-order-user.php';
|
99 |
-
$this->emails['LP_Email_Cancelled_Order_Guest'] = include_once 'emails/class-lp-email-cancelled-order-guest.php';
|
100 |
|
101 |
// Enrolled course
|
102 |
-
$this->emails['LP_Email_Enrolled_Course_Admin'] = include_once 'emails/class-lp-email-enrolled-course-admin.php';
|
103 |
-
$this->emails['LP_Email_Enrolled_Course_Instructor'] = include_once 'emails/class-lp-email-enrolled-course-instructor.php';
|
104 |
-
$this->emails['LP_Email_Enrolled_Course_User'] = include_once 'emails/class-lp-email-enrolled-course-user.php';
|
105 |
|
106 |
// Finished course
|
107 |
-
$this->emails['LP_Email_Finished_Course_Admin'] = include_once 'emails/class-lp-email-finished-course-admin.php';
|
108 |
-
$this->emails['LP_Email_Finished_Course_Instructor'] = include_once 'emails/class-lp-email-finished-course-instructor.php';
|
109 |
-
$this->emails['LP_Email_Finished_Course_User'] = include_once 'emails/class-lp-email-finished-course-user.php';
|
110 |
-
|
111 |
-
// Review course
|
112 |
-
// $this->emails['LP_Email_New_Course'] = include_once( 'emails/class-lp-email-new-course.php' );
|
113 |
-
// $this->emails['LP_Email_Rejected_Course'] = include_once( 'emails/class-lp-email-rejected-course.php' );
|
114 |
-
// $this->emails['LP_Email_Published_Course'] = include_once( 'emails/class-lp-email-published-course.php' );
|
115 |
-
|
116 |
-
// Other
|
117 |
-
// $this->emails['LP_Email_Update_Course'] = include_once( 'emails/class-lp-email-updated-course.php' );
|
118 |
-
$this->emails['LP_Email_Become_An_Instructor'] = include_once 'emails/class-lp-email-become-an-instructor.php';
|
119 |
-
$this->emails['LP_Email_Instructor_Accepted'] = include_once 'emails/class-lp-email-instructor-accepted.php';
|
120 |
-
$this->emails['LP_Email_Instructor_Denied'] = include_once 'emails/class-lp-email-instructor-denied.php';
|
121 |
|
122 |
-
//
|
123 |
-
|
|
|
|
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
// do_action_ref_array( 'learn-press/register-emails', array( &$this->emails, $this ) ); // Not use in LP4 - Nhamdv
|
128 |
}
|
129 |
|
130 |
|
@@ -146,62 +124,12 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
146 |
* Init email notification hooks.
|
147 |
*
|
148 |
* @since 3.0.0
|
|
|
|
|
149 |
*/
|
150 |
-
public static function init_email_notifications() {
|
151 |
-
$actions = apply_filters(
|
152 |
-
'learn-press/email-actions',
|
153 |
-
array(
|
154 |
-
// preview course
|
155 |
-
'learn_press_course_submit_rejected',
|
156 |
-
'learn_press_course_submit_approved',
|
157 |
-
'learn_press_course_submit_for_reviewer',
|
158 |
-
'learn_press_user_enrolled_course',
|
159 |
-
|
160 |
-
// New order
|
161 |
-
'learn-press/order/status-pending-to-processing',
|
162 |
-
'learn-press/order/status-pending-to-completed',
|
163 |
-
|
164 |
-
// Completed order
|
165 |
-
'learn-press/order/status-completed',
|
166 |
-
|
167 |
-
// Cancelled order
|
168 |
-
'learn-press/order/status-cancelled',
|
169 |
-
|
170 |
-
// User become an teacher
|
171 |
-
'set_user_role',
|
172 |
-
|
173 |
-
// User enrolled course
|
174 |
-
'learn-press/user-enrolled-course',
|
175 |
-
|
176 |
-
// User finished course
|
177 |
-
'learn-press/user-course-finished',
|
178 |
-
|
179 |
-
// Create order
|
180 |
-
// 'learn_press_checkout_success_result',
|
181 |
-
// 'learn_press_user_finish_course',
|
182 |
-
)
|
183 |
-
);
|
184 |
-
|
185 |
-
//TODO: tungnx - rewrite background progess
|
186 |
-
/*if ( 'yes' === LP()->settings()->get( 'emails_general.send_email_background' ) ) {
|
187 |
-
|
188 |
-
// self::$_background_emailer = new LP_Background_Emailer();
|
189 |
-
|
190 |
-
foreach ( $actions as $action ) {
|
191 |
-
//add_action( $action, array( __CLASS__, 'queue_email' ), 10, 10 );
|
192 |
-
}
|
193 |
-
} else {
|
194 |
-
foreach ( $actions as $action ) {
|
195 |
-
add_action( $action, array( __CLASS__, 'send_email' ), 10, 10 );
|
196 |
-
}
|
197 |
-
}*/
|
198 |
-
|
199 |
-
foreach ( $actions as $action ) {
|
200 |
-
add_action( $action, array( __CLASS__, 'send_email' ), 10, 10 );
|
201 |
-
}
|
202 |
-
|
203 |
self::instance();
|
204 |
-
}
|
205 |
|
206 |
/**
|
207 |
* Push email notification into queue.
|
@@ -218,15 +146,19 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
218 |
|
219 |
/**
|
220 |
* Send email notification.
|
|
|
|
|
|
|
|
|
221 |
*/
|
222 |
-
public static function send_email() {
|
223 |
try {
|
224 |
$args = func_get_args();
|
225 |
self::instance();
|
226 |
do_action_ref_array( current_filter() . '/notification', $args );
|
227 |
} catch ( Exception $e ) {
|
228 |
}
|
229 |
-
}
|
230 |
|
231 |
/**
|
232 |
* Email header.
|
@@ -236,7 +168,7 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
236 |
*
|
237 |
* @return string
|
238 |
*/
|
239 |
-
public function email_header( $heading, $echo = true ) {
|
240 |
ob_start();
|
241 |
learn_press_get_template( 'emails/email-header.php', array( 'email_heading' => $heading ) );
|
242 |
$header = ob_get_clean();
|
@@ -255,7 +187,7 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
255 |
*
|
256 |
* @return string
|
257 |
*/
|
258 |
-
public function email_footer( $footer_text, $echo = true ) {
|
259 |
ob_start();
|
260 |
learn_press_get_template( 'emails/email-footer.php', array( 'footer_text' => $footer_text ) );
|
261 |
$footer = ob_get_clean();
|
@@ -266,68 +198,6 @@ if ( ! class_exists( 'LP_Emails' ) ) {
|
|
266 |
return $footer;
|
267 |
}
|
268 |
|
269 |
-
/**
|
270 |
-
* Email when a course is submitted for reviewing
|
271 |
-
*
|
272 |
-
* @param $course_id
|
273 |
-
* @param $user
|
274 |
-
*/
|
275 |
-
public function review_course( $course_id, $user ) {
|
276 |
-
$mail = $this->emails['LP_Email_New_Course'];
|
277 |
-
$mail->trigger( $course_id, $user );
|
278 |
-
}
|
279 |
-
|
280 |
-
public function course_rejected( $course_id ) {
|
281 |
-
$course_user = learn_press_get_user( get_post_field( 'post_author', $course_id ) );
|
282 |
-
|
283 |
-
if ( ! $course_user->is_admin() ) {
|
284 |
-
$mail = $this->emails['LP_Email_Rejected_Course'];
|
285 |
-
$mail->trigger( $course_id );
|
286 |
-
}
|
287 |
-
}
|
288 |
-
|
289 |
-
public function course_approved( $course_id, $user ) {
|
290 |
-
$course_user = learn_press_get_user( get_post_field( 'post_author', $course_id ) );
|
291 |
-
|
292 |
-
if ( ! $course_user->is_admin() ) {
|
293 |
-
$mail = $this->emails['LP_Email_Published_Course'];
|
294 |
-
$mail->trigger( $course_id, $user );
|
295 |
-
}
|
296 |
-
}
|
297 |
-
|
298 |
-
public function finish_course( $course_id, $user_id, $result ) {
|
299 |
-
$user = learn_press_get_user( $user_id );
|
300 |
-
|
301 |
-
if ( ! $user ) {
|
302 |
-
return;
|
303 |
-
}
|
304 |
-
|
305 |
-
$mail = $this->emails['LP_Email_Finished_Course'];
|
306 |
-
$mail->trigger( $course_id, $user->get_id(), $result );
|
307 |
-
}
|
308 |
-
|
309 |
-
/**
|
310 |
-
* triggder send customer new order
|
311 |
-
*
|
312 |
-
* @param type $result
|
313 |
-
* @param type $order_id
|
314 |
-
*
|
315 |
-
* @return array
|
316 |
-
*/
|
317 |
-
public function customer_new_order( $result, $order_id ) {
|
318 |
-
$mail = $this->emails['LP_Email_New_Order_Customer'];
|
319 |
-
$mail->trigger( $order_id );
|
320 |
-
|
321 |
-
return $result;
|
322 |
-
}
|
323 |
-
|
324 |
-
public function become_an_teacher( $user_id, $role, $old_role ) {
|
325 |
-
if ( $role === LP_TEACHER_ROLE ) {
|
326 |
-
$mail = $this->emails['LP_Email_Become_An_Instructor'];
|
327 |
-
$mail->trigger( $user_id );
|
328 |
-
}
|
329 |
-
}
|
330 |
-
|
331 |
public function set_current( $id ) {
|
332 |
$this->_last_current = $this->_current;
|
333 |
|
32 |
*/
|
33 |
protected static $_instance = null;
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
/**
|
36 |
* @var LP_Email
|
37 |
*/
|
53 |
|
54 |
$this->register_emails();
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
do_action( 'learn-press/emails-init', $this );
|
57 |
}
|
58 |
|
59 |
public function register_emails() {
|
60 |
+
include_once 'emails/types/class-lp-email-type-order.php';
|
61 |
+
include_once 'emails/types/class-lp-email-type-order-student.php';
|
62 |
+
include_once 'emails/types/class-lp-email-type-order-guest.php';
|
63 |
+
include_once 'emails/types/class-lp-email-type-order-admin.php';
|
64 |
+
include_once 'emails/types/class-lp-email-type-order-instructor.php';
|
65 |
+
include_once 'emails/types/class-lp-email-type-enrolled-course.php';
|
66 |
+
include_once 'emails/types/class-lp-email-type-finished-course.php';
|
67 |
+
include_once 'emails/types/class-lp-email-type-become-an-instructor.php';
|
68 |
|
69 |
// New order
|
70 |
+
$this->emails['LP_Email_New_Order_Admin'] = include_once 'emails/admin/class-lp-email-new-order-admin.php';
|
71 |
+
$this->emails['LP_Email_New_Order_User'] = include_once 'emails/student/class-lp-email-new-order-user.php';
|
72 |
+
$this->emails['LP_Email_New_Order_Instructor'] = include_once 'emails/instructor/class-lp-email-new-order-instructor.php';
|
73 |
+
$this->emails['LP_Email_New_Order_Guest'] = include_once 'emails/guest/class-lp-email-new-order-guest.php';
|
74 |
|
75 |
// Processing order
|
76 |
+
$this->emails['LP_Email_Processing_Order_User'] = include_once 'emails/student/class-lp-email-processing-order-user.php';
|
77 |
+
$this->emails['LP_Email_Processing_Order_Guest'] = include_once 'emails/guest/class-lp-email-processing-order-guest.php';
|
78 |
|
79 |
// Completed order
|
80 |
+
$this->emails['LP_Email_Completed_Order_Admin'] = include_once 'emails/admin/class-lp-email-completed-order-admin.php';
|
81 |
+
$this->emails['LP_Email_Completed_Order_User'] = include_once 'emails/student/class-lp-email-completed-order-user.php';
|
82 |
+
$this->emails['LP_Email_Completed_Order_Guest'] = include_once 'emails/guest/class-lp-email-completed-order-guest.php';
|
83 |
|
84 |
// Cancelled order
|
85 |
+
$this->emails['LP_Email_Cancelled_Order_Admin'] = include_once 'emails/admin/class-lp-email-cancelled-order-admin.php';
|
86 |
+
$this->emails['LP_Email_Cancelled_Order_Instructor'] = include_once 'emails/instructor/class-lp-email-cancelled-order-instructor.php';
|
87 |
+
$this->emails['LP_Email_Cancelled_Order_User'] = include_once 'emails/student/class-lp-email-cancelled-order-user.php';
|
88 |
+
$this->emails['LP_Email_Cancelled_Order_Guest'] = include_once 'emails/guest/class-lp-email-cancelled-order-guest.php';
|
89 |
|
90 |
// Enrolled course
|
91 |
+
$this->emails['LP_Email_Enrolled_Course_Admin'] = include_once 'emails/admin/class-lp-email-enrolled-course-admin.php';
|
92 |
+
$this->emails['LP_Email_Enrolled_Course_Instructor'] = include_once 'emails/instructor/class-lp-email-enrolled-course-instructor.php';
|
93 |
+
$this->emails['LP_Email_Enrolled_Course_User'] = include_once 'emails/student/class-lp-email-enrolled-course-user.php';
|
94 |
|
95 |
// Finished course
|
96 |
+
$this->emails['LP_Email_Finished_Course_Admin'] = include_once 'emails/admin/class-lp-email-finished-course-admin.php';
|
97 |
+
$this->emails['LP_Email_Finished_Course_Instructor'] = include_once 'emails/instructor/class-lp-email-finished-course-instructor.php';
|
98 |
+
$this->emails['LP_Email_Finished_Course_User'] = include_once 'emails/student/class-lp-email-finished-course-user.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
+
// Become An Instructor
|
101 |
+
$this->emails['LP_Email_Become_An_Instructor'] = include_once 'emails/admin/class-lp-email-become-an-instructor.php';
|
102 |
+
$this->emails['LP_Email_Instructor_Accepted'] = include_once 'emails/instructor/class-lp-email-instructor-accepted.php';
|
103 |
+
$this->emails['LP_Email_Instructor_Denied'] = include_once 'emails/instructor/class-lp-email-instructor-denied.php';
|
104 |
|
105 |
+
do_action( 'learnpress/emails/register', $this->emails );
|
|
|
|
|
106 |
}
|
107 |
|
108 |
|
124 |
* Init email notification hooks.
|
125 |
*
|
126 |
* @since 3.0.0
|
127 |
+
* @editor tungnx
|
128 |
+
* @reason comment - not use
|
129 |
*/
|
130 |
+
/*public static function init_email_notifications() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
self::instance();
|
132 |
+
}*/
|
133 |
|
134 |
/**
|
135 |
* Push email notification into queue.
|
146 |
|
147 |
/**
|
148 |
* Send email notification.
|
149 |
+
*
|
150 |
+
* @editor tungnx
|
151 |
+
* @reason not use
|
152 |
+
* @deprecated 4.1.1
|
153 |
*/
|
154 |
+
/*public static function send_email() {
|
155 |
try {
|
156 |
$args = func_get_args();
|
157 |
self::instance();
|
158 |
do_action_ref_array( current_filter() . '/notification', $args );
|
159 |
} catch ( Exception $e ) {
|
160 |
}
|
161 |
+
}*/
|
162 |
|
163 |
/**
|
164 |
* Email header.
|
168 |
*
|
169 |
* @return string
|
170 |
*/
|
171 |
+
public function email_header( string $heading, bool $echo = true ): string {
|
172 |
ob_start();
|
173 |
learn_press_get_template( 'emails/email-header.php', array( 'email_heading' => $heading ) );
|
174 |
$header = ob_get_clean();
|
187 |
*
|
188 |
* @return string
|
189 |
*/
|
190 |
+
public function email_footer( string $footer_text, bool $echo = true ): string {
|
191 |
ob_start();
|
192 |
learn_press_get_template( 'emails/email-footer.php', array( 'footer_text' => $footer_text ) );
|
193 |
$footer = ob_get_clean();
|
198 |
return $footer;
|
199 |
}
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
public function set_current( $id ) {
|
202 |
$this->_last_current = $this->_current;
|
203 |
|
@@ -159,26 +159,38 @@ class LP_Forms_Handler {
|
|
159 |
throw new Exception( $new_customer->get_error_message() );
|
160 |
}
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
learn_press_add_message( $username . __( ' was successfully created!', 'learnpress' ), 'success' );
|
166 |
-
|
167 |
-
// Send email when check enable Instructor.
|
168 |
-
if ( LP()->settings->get( 'instructor_registration' ) == 'yes' && isset( $_POST['become_teacher'] ) ) {
|
169 |
update_user_meta( $new_customer, '_requested_become_teacher', 'yes' );
|
170 |
do_action(
|
171 |
'learn-press/become-a-teacher-sent',
|
172 |
array(
|
173 |
'bat_email' => $email,
|
174 |
'bat_phone' => '',
|
175 |
-
'bat_message' => apply_filters( 'learnpress_become_instructor_message', esc_html__( 'I need become
|
176 |
)
|
177 |
);
|
178 |
|
179 |
-
|
180 |
}
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
if ( ! empty( $_POST['redirect'] ) ) {
|
183 |
$redirect = wp_sanitize_redirect( wp_unslash( $_POST['redirect'] ) );
|
184 |
} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
|
159 |
throw new Exception( $new_customer->get_error_message() );
|
160 |
}
|
161 |
|
162 |
+
// Send email become a teacher.
|
163 |
+
$is_become_a_teacher = false;
|
164 |
+
if ( LP_Settings::get_option( 'instructor_registration', 'no' ) == 'yes' && isset( $_POST['become_teacher'] ) ) {
|
|
|
|
|
|
|
|
|
165 |
update_user_meta( $new_customer, '_requested_become_teacher', 'yes' );
|
166 |
do_action(
|
167 |
'learn-press/become-a-teacher-sent',
|
168 |
array(
|
169 |
'bat_email' => $email,
|
170 |
'bat_phone' => '',
|
171 |
+
'bat_message' => apply_filters( 'learnpress_become_instructor_message', esc_html__( 'I need become an instructor', 'learnpress' ) ),
|
172 |
)
|
173 |
);
|
174 |
|
175 |
+
$is_become_a_teacher = true;
|
176 |
}
|
177 |
|
178 |
+
/**
|
179 |
+
* Auto login user
|
180 |
+
* Must set code below after Send email become a teacher
|
181 |
+
* because 'none' check by "check_ajax_referer" will not valid for send mail background on WP_Async_Request
|
182 |
+
*/
|
183 |
+
wp_set_current_user( $new_customer );
|
184 |
+
wp_set_auth_cookie( $new_customer, true );
|
185 |
+
|
186 |
+
$message_success = $username . __( ' was successfully created!', 'learnpress' );
|
187 |
+
|
188 |
+
if ( $is_become_a_teacher ) {
|
189 |
+
$message_success .= '<br/>' . __( 'Your request become an instructor has been sent. We will get back to you soon!', 'learnpress' );
|
190 |
+
}
|
191 |
+
|
192 |
+
learn_press_add_message( $message_success, 'success' );
|
193 |
+
|
194 |
if ( ! empty( $_POST['redirect'] ) ) {
|
195 |
$redirect = wp_sanitize_redirect( wp_unslash( $_POST['redirect'] ) );
|
196 |
} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
|
@@ -93,15 +93,19 @@ class LP_Helper {
|
|
93 |
* Load posts from database into cache by ids
|
94 |
*
|
95 |
* @param array|int $ids
|
|
|
96 |
*/
|
97 |
public static function cache_posts( $ids ) {
|
98 |
global $wpdb;
|
99 |
|
100 |
settype( $ids, 'array' );
|
101 |
$format = array_fill( 0, sizeof( $ids ), '%d' );
|
102 |
-
$query = $wpdb->prepare(
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
105 |
|
106 |
$posts = $wpdb->get_results( $query );
|
107 |
|
@@ -543,4 +547,12 @@ class LP_Helper {
|
|
543 |
|
544 |
return join( ',', $format );
|
545 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
}
|
93 |
* Load posts from database into cache by ids
|
94 |
*
|
95 |
* @param array|int $ids
|
96 |
+
* @Todo: tungnx - need to review code
|
97 |
*/
|
98 |
public static function cache_posts( $ids ) {
|
99 |
global $wpdb;
|
100 |
|
101 |
settype( $ids, 'array' );
|
102 |
$format = array_fill( 0, sizeof( $ids ), '%d' );
|
103 |
+
$query = $wpdb->prepare(
|
104 |
+
"
|
105 |
+
SELECT * FROM {$wpdb->posts} WHERE ID IN(" . join( ',', $format ) . ')
|
106 |
+
',
|
107 |
+
$ids
|
108 |
+
);
|
109 |
|
110 |
$posts = $wpdb->get_results( $query );
|
111 |
|
547 |
|
548 |
return join( ',', $format );
|
549 |
}
|
550 |
+
|
551 |
+
/**
|
552 |
+
* Get link lp checkout page
|
553 |
+
* without cache - because some cache(redis) will cache page with user anonymous
|
554 |
+
*/
|
555 |
+
public static function get_link_no_cache( string $link ): string {
|
556 |
+
return add_query_arg( 'no-cache', uniqid(), $link );
|
557 |
+
}
|
558 |
}
|
@@ -36,7 +36,7 @@ class LP_Page_Controller {
|
|
36 |
add_filter( 'template_include', array( $this, 'template_loader' ), 10 );
|
37 |
// Comment by tungnx
|
38 |
add_filter( 'template_include', array( $this, 'template_content_item' ), 20 );
|
39 |
-
add_filter( 'template_include', array( $this, 'maybe_redirect_quiz' ), 30 );
|
40 |
add_filter( 'template_include', array( $this, 'check_pages' ), 30 );
|
41 |
add_filter( 'template_include', array( $this, 'auto_shortcode' ), 50 );
|
42 |
|
@@ -201,7 +201,11 @@ class LP_Page_Controller {
|
|
201 |
return $template;
|
202 |
}
|
203 |
|
204 |
-
|
|
|
|
|
|
|
|
|
205 |
$course = LP_Global::course();
|
206 |
$quiz = LP_Global::course_item_quiz();
|
207 |
$user = learn_press_get_current_user();
|
@@ -223,7 +227,7 @@ class LP_Page_Controller {
|
|
223 |
}
|
224 |
|
225 |
return $template;
|
226 |
-
}
|
227 |
|
228 |
/**
|
229 |
* @param $post
|
36 |
add_filter( 'template_include', array( $this, 'template_loader' ), 10 );
|
37 |
// Comment by tungnx
|
38 |
add_filter( 'template_include', array( $this, 'template_content_item' ), 20 );
|
39 |
+
//add_filter( 'template_include', array( $this, 'maybe_redirect_quiz' ), 30 );
|
40 |
add_filter( 'template_include', array( $this, 'check_pages' ), 30 );
|
41 |
add_filter( 'template_include', array( $this, 'auto_shortcode' ), 50 );
|
42 |
|
201 |
return $template;
|
202 |
}
|
203 |
|
204 |
+
/**
|
205 |
+
* @editor tungnx
|
206 |
+
* @modify 4.1.3 - comment - not use
|
207 |
+
*/
|
208 |
+
/*public function maybe_redirect_quiz( $template ) {
|
209 |
$course = LP_Global::course();
|
210 |
$quiz = LP_Global::course_item_quiz();
|
211 |
$user = learn_press_get_current_user();
|
227 |
}
|
228 |
|
229 |
return $template;
|
230 |
+
}*/
|
231 |
|
232 |
/**
|
233 |
* @param $post
|
@@ -72,7 +72,14 @@ class LP_Request {
|
|
72 |
public static function register( $action, $function = '', $priority = 5 ) {
|
73 |
if ( is_array( $action ) ) {
|
74 |
foreach ( $action as $item ) {
|
75 |
-
$item = wp_parse_args(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
if ( ! $item['action'] || ! $item['callback'] ) {
|
77 |
continue;
|
78 |
}
|
@@ -475,12 +482,12 @@ class LP_Request {
|
|
475 |
|
476 |
public static function get_cookie( $name, $def = false, $global = false ) {
|
477 |
if ( $global ) {
|
478 |
-
return
|
479 |
}
|
480 |
|
481 |
$cookie = isset( $_COOKIE['LP'] ) ? (array) json_decode( stripslashes( $_COOKIE['LP'] ) ) : array();
|
482 |
|
483 |
-
return
|
484 |
}
|
485 |
|
486 |
public static function set_cookie( $name, $value, $expires = '', $domain = '', $path = '', $secure = false ) {
|
72 |
public static function register( $action, $function = '', $priority = 5 ) {
|
73 |
if ( is_array( $action ) ) {
|
74 |
foreach ( $action as $item ) {
|
75 |
+
$item = wp_parse_args(
|
76 |
+
$item,
|
77 |
+
array(
|
78 |
+
'action' => '',
|
79 |
+
'callback' => '',
|
80 |
+
'priority' => 5,
|
81 |
+
)
|
82 |
+
);
|
83 |
if ( ! $item['action'] || ! $item['callback'] ) {
|
84 |
continue;
|
85 |
}
|
482 |
|
483 |
public static function get_cookie( $name, $def = false, $global = false ) {
|
484 |
if ( $global ) {
|
485 |
+
return $_COOKIE[ $name ] ?? $def;
|
486 |
}
|
487 |
|
488 |
$cookie = isset( $_COOKIE['LP'] ) ? (array) json_decode( stripslashes( $_COOKIE['LP'] ) ) : array();
|
489 |
|
490 |
+
return $cookie[ $name ] ?? $def;
|
491 |
}
|
492 |
|
493 |
public static function set_cookie( $name, $value, $expires = '', $domain = '', $path = '', $secure = false ) {
|
@@ -136,8 +136,8 @@ class LP_Settings {
|
|
136 |
*
|
137 |
* @return mixed
|
138 |
*/
|
139 |
-
public function get( $var =
|
140 |
-
if (
|
141 |
return $this->_options;
|
142 |
}
|
143 |
|
@@ -145,7 +145,6 @@ class LP_Settings {
|
|
145 |
$var = $this->_prefix . $var;
|
146 |
}
|
147 |
|
148 |
-
$segs = explode( '.', $var );
|
149 |
$return = $this->_get_option( $this->_options, $var, $default );
|
150 |
|
151 |
if ( $return == '' || is_null( $return ) ) {
|
@@ -227,7 +226,7 @@ class LP_Settings {
|
|
227 |
* @since 3.2.8
|
228 |
* @editor tungnx
|
229 |
*/
|
230 |
-
public static function get_option( $name = '', $default = false ) {
|
231 |
return get_option( "learn_press_{$name}", $default );
|
232 |
}
|
233 |
|
@@ -399,6 +398,15 @@ class LP_Settings {
|
|
399 |
|
400 |
return apply_filters( 'learn-press/endpoints/profile', $endpoints );
|
401 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
}
|
403 |
|
404 |
if ( ! function_exists( 'lp_settings' ) ) {
|
136 |
*
|
137 |
* @return mixed
|
138 |
*/
|
139 |
+
public function get( string $var = '', $default = null ) {
|
140 |
+
if ( empty( $var ) ) {
|
141 |
return $this->_options;
|
142 |
}
|
143 |
|
145 |
$var = $this->_prefix . $var;
|
146 |
}
|
147 |
|
|
|
148 |
$return = $this->_get_option( $this->_options, $var, $default );
|
149 |
|
150 |
if ( $return == '' || is_null( $return ) ) {
|
226 |
* @since 3.2.8
|
227 |
* @editor tungnx
|
228 |
*/
|
229 |
+
public static function get_option( string $name = '', $default = false ) {
|
230 |
return get_option( "learn_press_{$name}", $default );
|
231 |
}
|
232 |
|
398 |
|
399 |
return apply_filters( 'learn-press/endpoints/profile', $endpoints );
|
400 |
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Check setting enable option "Auto start"
|
404 |
+
*
|
405 |
+
* @return bool
|
406 |
+
*/
|
407 |
+
public static function is_auto_start_course(): bool {
|
408 |
+
return 'yes' === self::get_option( 'auto_enroll', 'yes' );
|
409 |
+
}
|
410 |
}
|
411 |
|
412 |
if ( ! function_exists( 'lp_settings' ) ) {
|
@@ -75,6 +75,7 @@ class LP_Utils {
|
|
75 |
* @param bool $hard
|
76 |
*
|
77 |
* @return array
|
|
|
78 |
*/
|
79 |
public function count_course_users( $args = array(), $hard = false ) {
|
80 |
|
75 |
* @param bool $hard
|
76 |
*
|
77 |
* @return array
|
78 |
+
* @Todo: tungnx - review this function
|
79 |
*/
|
80 |
public function count_course_users( $args = array(), $hard = false ) {
|
81 |
|
@@ -44,6 +44,20 @@ class LP_Widget extends WP_Widget {
|
|
44 |
*/
|
45 |
public $widget_name;
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
/**
|
48 |
* Settings.
|
49 |
*
|
@@ -62,62 +76,6 @@ class LP_Widget extends WP_Widget {
|
|
62 |
);
|
63 |
|
64 |
parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );
|
65 |
-
|
66 |
-
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
|
67 |
-
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
|
68 |
-
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Get cached widget.
|
73 |
-
*/
|
74 |
-
public function get_cached_widget( $args ) {
|
75 |
-
if ( empty( $args['widget_id'] ) ) {
|
76 |
-
return false;
|
77 |
-
}
|
78 |
-
|
79 |
-
$cache = wp_cache_get( $this->get_widget_id_for_cache( $this->widget_id ), 'widget' );
|
80 |
-
|
81 |
-
if ( ! is_array( $cache ) ) {
|
82 |
-
$cache = array();
|
83 |
-
}
|
84 |
-
|
85 |
-
if ( isset( $cache[ $this->get_widget_id_for_cache( $args['widget_id'] ) ] ) ) {
|
86 |
-
echo $cache[ $this->get_widget_id_for_cache( $args['widget_id'] ) ];
|
87 |
-
return true;
|
88 |
-
}
|
89 |
-
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Cache the widget.
|
95 |
-
*/
|
96 |
-
public function cache_widget( $args, $content ) {
|
97 |
-
if ( empty( $args['widget_id'] ) ) {
|
98 |
-
return $content;
|
99 |
-
}
|
100 |
-
|
101 |
-
$cache = wp_cache_get( $this->get_widget_id_for_cache( $this->widget_id ), 'widget' );
|
102 |
-
|
103 |
-
if ( ! is_array( $cache ) ) {
|
104 |
-
$cache = array();
|
105 |
-
}
|
106 |
-
|
107 |
-
$cache[ $this->get_widget_id_for_cache( $args['widget_id'] ) ] = $content;
|
108 |
-
|
109 |
-
wp_cache_set( $this->get_widget_id_for_cache( $this->widget_id ), $cache, 'widget' );
|
110 |
-
|
111 |
-
return $content;
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
* Flush the cache.
|
116 |
-
*/
|
117 |
-
public function flush_widget_cache() {
|
118 |
-
foreach ( array( 'https', 'http' ) as $scheme ) {
|
119 |
-
wp_cache_delete( $this->get_widget_id_for_cache( $this->widget_id, $scheme ), 'widget' );
|
120 |
-
}
|
121 |
}
|
122 |
|
123 |
/**
|
@@ -160,6 +118,80 @@ class LP_Widget extends WP_Widget {
|
|
160 |
echo $args['after_widget'];
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
/**
|
164 |
* Updates a particular instance of a widget.
|
165 |
*/
|
@@ -205,8 +237,6 @@ class LP_Widget extends WP_Widget {
|
|
205 |
$instance[ $key ] = apply_filters( 'learnpress_widget_settings_sanitize_option', $instance[ $key ], $new_instance, $key, $setting );
|
206 |
}
|
207 |
|
208 |
-
$this->flush_widget_cache();
|
209 |
-
|
210 |
return $instance;
|
211 |
}
|
212 |
|
@@ -278,23 +308,26 @@ class LP_Widget extends WP_Widget {
|
|
278 |
<?php
|
279 |
break;
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
default:
|
282 |
do_action( 'learnpress_widget_field_' . $setting['type'], $key, $value, $setting, $instance );
|
283 |
break;
|
284 |
}
|
285 |
}
|
286 |
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Get widget id cached widgets.
|
290 |
-
*/
|
291 |
-
protected function get_widget_id_for_cache( $widget_id, $scheme = '' ) {
|
292 |
-
if ( $scheme ) {
|
293 |
-
$widget_id_for_cache = $widget_id . '-' . $scheme;
|
294 |
-
} else {
|
295 |
-
$widget_id_for_cache = $widget_id . '-' . ( is_ssl() ? 'https' : 'http' );
|
296 |
-
}
|
297 |
-
|
298 |
-
return apply_filters( 'learnpress_cached_widget_id', $widget_id_for_cache );
|
299 |
-
}
|
300 |
}
|
44 |
*/
|
45 |
public $widget_name;
|
46 |
|
47 |
+
/**
|
48 |
+
* Enable rest_api for LearnPress.
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
public $widget_in_rest = true;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* New param add to rest api need for data.
|
56 |
+
*
|
57 |
+
* @var array
|
58 |
+
*/
|
59 |
+
public $widget_data_attr = array();
|
60 |
+
|
61 |
/**
|
62 |
* Settings.
|
63 |
*
|
76 |
);
|
77 |
|
78 |
parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
|
81 |
/**
|
118 |
echo $args['after_widget'];
|
119 |
}
|
120 |
|
121 |
+
/**
|
122 |
+
* Output Widgets HTML.
|
123 |
+
*
|
124 |
+
* @param [type] $args
|
125 |
+
* @param [type] $instance
|
126 |
+
* @return void
|
127 |
+
*/
|
128 |
+
public function widget( $args, $instance ) {
|
129 |
+
wp_enqueue_script( 'lp-widgets' );
|
130 |
+
|
131 |
+
$serialized_instance = serialize( $instance );
|
132 |
+
|
133 |
+
$data = array_merge(
|
134 |
+
$this->widget_data_attr,
|
135 |
+
array(
|
136 |
+
'widget' => $this->widget_id,
|
137 |
+
'instance' => base64_encode( $serialized_instance ),
|
138 |
+
'hash' => wp_hash( $serialized_instance ),
|
139 |
+
)
|
140 |
+
);
|
141 |
+
|
142 |
+
echo $this->lp_widget_content( $data, $args, $instance );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Show widget content.
|
147 |
+
*
|
148 |
+
* @param array $data Data attribute HTML for Rest API js.
|
149 |
+
* @param [type] $args Default Widget Args
|
150 |
+
* @param [type] $instance Default Widget Instance
|
151 |
+
* @return string HTML
|
152 |
+
*/
|
153 |
+
public function lp_widget_content( $data, $args, $instance ) {
|
154 |
+
ob_start();
|
155 |
+
|
156 |
+
$this->widget_start( $args, $instance );
|
157 |
+
|
158 |
+
if ( ! is_admin() && $this->widget_in_rest ) {
|
159 |
+
?>
|
160 |
+
<div class="learnpress-widget-wrapper learnpress-widget-wrapper__restapi" data-widget="<?php echo htmlentities( wp_json_encode( $data ) ); ?>" >
|
161 |
+
<?php echo lp_skeleton_animation_html( 5 ); ?>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<?php
|
165 |
+
} else { // Use for Preview in Widget Editor since WordPress 5.8
|
166 |
+
$content = $this->lp_rest_api_content( $instance, array() );
|
167 |
+
|
168 |
+
echo '<div class="learnpress-widget-wrapper">';
|
169 |
+
|
170 |
+
if ( is_wp_error( $content ) ) {
|
171 |
+
echo $content->get_error_message();
|
172 |
+
} else {
|
173 |
+
echo $content;
|
174 |
+
}
|
175 |
+
|
176 |
+
echo '</div>';
|
177 |
+
}
|
178 |
+
|
179 |
+
$this->widget_end( $args );
|
180 |
+
|
181 |
+
return ob_get_clean();
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Send content for API
|
186 |
+
*
|
187 |
+
* @param array $instance Widget Instance
|
188 |
+
* @param array $params RestAPI param need for content.
|
189 |
+
* @return string || WP_Error
|
190 |
+
*/
|
191 |
+
public function lp_rest_api_content( $instance, $params ) {
|
192 |
+
return 'No content for Rest API';
|
193 |
+
}
|
194 |
+
|
195 |
/**
|
196 |
* Updates a particular instance of a widget.
|
197 |
*/
|
237 |
$instance[ $key ] = apply_filters( 'learnpress_widget_settings_sanitize_option', $instance[ $key ], $new_instance, $key, $setting );
|
238 |
}
|
239 |
|
|
|
|
|
240 |
return $instance;
|
241 |
}
|
242 |
|
308 |
<?php
|
309 |
break;
|
310 |
|
311 |
+
case 'autocomplete':
|
312 |
+
?>
|
313 |
+
<p>
|
314 |
+
<label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo wp_kses_post( $setting['label'] ); ?></label><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>
|
315 |
+
<select class="widefat lp-widget_select_course" id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" data-rest-url="<?php echo get_rest_url(); ?>" data-post-type="<?php echo esc_attr( $setting['post_type'] ?? LP_COURSE_CPT ); ?>" style="width: 300px;">
|
316 |
+
<?php if ( ! empty( $value ) ) : ?>
|
317 |
+
<option value="<?php echo esc_attr( $value ); ?>" selected="selected"><?php echo esc_html( get_the_title( $value ) ); ?></option>
|
318 |
+
<?php endif; ?>
|
319 |
+
<script>
|
320 |
+
jQuery(document).trigger('learnpress/widgets/select');
|
321 |
+
</script>
|
322 |
+
</select>
|
323 |
+
</p>
|
324 |
+
<?php
|
325 |
+
break;
|
326 |
+
|
327 |
default:
|
328 |
do_action( 'learnpress_widget_field_' . $setting['type'], $key, $value, $setting, $instance );
|
329 |
break;
|
330 |
}
|
331 |
}
|
332 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
}
|
@@ -90,14 +90,6 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
90 |
return false;
|
91 |
}
|
92 |
|
93 |
-
public function get_items_4() {
|
94 |
-
|
95 |
-
}
|
96 |
-
|
97 |
-
public function get_user_course_data() {
|
98 |
-
return learn_press_get_user( $this->user_id )->get_course_data( $this->get_id() );
|
99 |
-
}
|
100 |
-
|
101 |
/**
|
102 |
* Constructor gets the post object and sets the ID for the loaded course.
|
103 |
*
|
@@ -408,7 +400,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
408 |
*/
|
409 |
public function is_no_required_enroll() {
|
410 |
$return = false;
|
411 |
-
if ( $this->get_data( 'no_required_enroll' ) == 'yes' && ! is_user_logged_in() ) {
|
412 |
$return = true;
|
413 |
}
|
414 |
return apply_filters( 'learn-press/course-require-enrollment', $return, $this->get_id() );
|
@@ -607,8 +599,10 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
607 |
* Output html for students enrolled counter
|
608 |
*
|
609 |
* @return string
|
|
|
|
|
610 |
*/
|
611 |
-
public function get_students_html() {
|
612 |
$output = '';
|
613 |
$count = $this->get_users_enrolled();
|
614 |
|
@@ -647,7 +641,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
647 |
}
|
648 |
|
649 |
return apply_filters( 'learn-press/students-enrolled-html', $output, $this->get_id() );
|
650 |
-
}
|
651 |
|
652 |
/**
|
653 |
* @param string $field
|
@@ -870,7 +864,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
870 |
public function is_viewing_item( $item_id = false ) {
|
871 |
$item = LP_Global::course_item();
|
872 |
|
873 |
-
if (
|
874 |
return false;
|
875 |
}
|
876 |
|
@@ -1192,7 +1186,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1192 |
*
|
1193 |
* @return string
|
1194 |
*/
|
1195 |
-
public function get_item_link( $item_id ) {
|
1196 |
$item_link = '';
|
1197 |
$item_links = $this->get_item_links();
|
1198 |
|
@@ -1211,8 +1205,10 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1211 |
* @param int $at
|
1212 |
*
|
1213 |
* @return bool|mixed
|
|
|
|
|
1214 |
*/
|
1215 |
-
public function get_item_at( $at ) {
|
1216 |
$items = $this->get_items();
|
1217 |
|
1218 |
if ( ! $items ) {
|
@@ -1220,7 +1216,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1220 |
}
|
1221 |
|
1222 |
return ! empty( $items[ $at ] ) ? $items[ $at ] : false;
|
1223 |
-
}
|
1224 |
|
1225 |
/**
|
1226 |
* Get position of an item in course curriculum.
|
@@ -1405,8 +1401,10 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1405 |
* @param bool $force
|
1406 |
*
|
1407 |
* @return mixed|void
|
|
|
|
|
1408 |
*/
|
1409 |
-
public function _evaluate_course_by_quizzes_results( $user_id, $force = false ) {
|
1410 |
$quizzes = $this->get_items( LP_QUIZ_CPT );
|
1411 |
$user = learn_press_get_user( $user_id );
|
1412 |
$results = array();
|
@@ -1441,7 +1439,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1441 |
$this->get_id(),
|
1442 |
$user_id
|
1443 |
);
|
1444 |
-
}
|
1445 |
|
1446 |
public function enable_evaluate_item( $item_id, $user_id = 0 ) {
|
1447 |
if ( ! $user_id ) {
|
@@ -1755,8 +1753,10 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1755 |
* @param boolean $force
|
1756 |
*
|
1757 |
* @return mixed
|
|
|
|
|
1758 |
*/
|
1759 |
-
public function _evaluate_course_by_quizzes( $user_id, $force = false ) {
|
1760 |
$quizzes = $this->get_items( LP_QUIZ_CPT );
|
1761 |
$result = 0;
|
1762 |
|
@@ -1777,7 +1777,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1777 |
}
|
1778 |
|
1779 |
return apply_filters( 'learn_press_evaluation_course_quizzes', $result, $this->get_id(), $user_id );
|
1780 |
-
}
|
1781 |
|
1782 |
/**
|
1783 |
* Get course duration in seconds
|
@@ -1888,7 +1888,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1888 |
* @return mixed
|
1889 |
*/
|
1890 |
public function get_external_link() {
|
1891 |
-
return apply_filters( 'learn-press/course-external-link', $this->get_data( 'external_link' ), $this->get_id() );
|
1892 |
}
|
1893 |
|
1894 |
public function get_external_link_text() {
|
@@ -1912,7 +1912,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
|
|
1912 |
*
|
1913 |
* @return LP_User|int
|
1914 |
*/
|
1915 |
-
public function get_author( $field = '' ) {
|
1916 |
$author_id = absint( get_post_field( 'post_author', $this->get_id() ) );
|
1917 |
|
1918 |
return strtolower( $field ) === 'id' ? $author_id : learn_press_get_user( $author_id );
|
90 |
return false;
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
/**
|
94 |
* Constructor gets the post object and sets the ID for the loaded course.
|
95 |
*
|
400 |
*/
|
401 |
public function is_no_required_enroll() {
|
402 |
$return = false;
|
403 |
+
if ( $this->get_data( 'no_required_enroll', 'no' ) == 'yes' && ! is_user_logged_in() ) {
|
404 |
$return = true;
|
405 |
}
|
406 |
return apply_filters( 'learn-press/course-require-enrollment', $return, $this->get_id() );
|
599 |
* Output html for students enrolled counter
|
600 |
*
|
601 |
* @return string
|
602 |
+
* @editor tungnx
|
603 |
+
* @modify 4.1.3
|
604 |
*/
|
605 |
+
/*public function get_students_html() {
|
606 |
$output = '';
|
607 |
$count = $this->get_users_enrolled();
|
608 |
|
641 |
}
|
642 |
|
643 |
return apply_filters( 'learn-press/students-enrolled-html', $output, $this->get_id() );
|
644 |
+
}*/
|
645 |
|
646 |
/**
|
647 |
* @param string $field
|
864 |
public function is_viewing_item( $item_id = false ) {
|
865 |
$item = LP_Global::course_item();
|
866 |
|
867 |
+
if ( empty( $item ) ) {
|
868 |
return false;
|
869 |
}
|
870 |
|
1186 |
*
|
1187 |
* @return string
|
1188 |
*/
|
1189 |
+
public function get_item_link( int $item_id ): string {
|
1190 |
$item_link = '';
|
1191 |
$item_links = $this->get_item_links();
|
1192 |
|
1205 |
* @param int $at
|
1206 |
*
|
1207 |
* @return bool|mixed
|
1208 |
+
* @editor tungnx
|
1209 |
+
* @modify 4.1.3 - comment - not use
|
1210 |
*/
|
1211 |
+
/*public function get_item_at( $at ) {
|
1212 |
$items = $this->get_items();
|
1213 |
|
1214 |
if ( ! $items ) {
|
1216 |
}
|
1217 |
|
1218 |
return ! empty( $items[ $at ] ) ? $items[ $at ] : false;
|
1219 |
+
}*/
|
1220 |
|
1221 |
/**
|
1222 |
* Get position of an item in course curriculum.
|
1401 |
* @param bool $force
|
1402 |
*
|
1403 |
* @return mixed|void
|
1404 |
+
* @editor tungnx
|
1405 |
+
* @modify 4.1.3 - comment - not use
|
1406 |
*/
|
1407 |
+
/*public function _evaluate_course_by_quizzes_results( $user_id, $force = false ) {
|
1408 |
$quizzes = $this->get_items( LP_QUIZ_CPT );
|
1409 |
$user = learn_press_get_user( $user_id );
|
1410 |
$results = array();
|
1439 |
$this->get_id(),
|
1440 |
$user_id
|
1441 |
);
|
1442 |
+
}*/
|
1443 |
|
1444 |
public function enable_evaluate_item( $item_id, $user_id = 0 ) {
|
1445 |
if ( ! $user_id ) {
|
1753 |
* @param boolean $force
|
1754 |
*
|
1755 |
* @return mixed
|
1756 |
+
* @editor tungnx
|
1757 |
+
* @modify 4.1.3 - comment - not use
|
1758 |
*/
|
1759 |
+
/*public function _evaluate_course_by_quizzes( $user_id, $force = false ) {
|
1760 |
$quizzes = $this->get_items( LP_QUIZ_CPT );
|
1761 |
$result = 0;
|
1762 |
|
1777 |
}
|
1778 |
|
1779 |
return apply_filters( 'learn_press_evaluation_course_quizzes', $result, $this->get_id(), $user_id );
|
1780 |
+
}*/
|
1781 |
|
1782 |
/**
|
1783 |
* Get course duration in seconds
|
1888 |
* @return mixed
|
1889 |
*/
|
1890 |
public function get_external_link() {
|
1891 |
+
return apply_filters( 'learn-press/course-external-link', $this->get_data( 'external_link', '' ), $this->get_id() );
|
1892 |
}
|
1893 |
|
1894 |
public function get_external_link_text() {
|
1912 |
*
|
1913 |
* @return LP_User|int
|
1914 |
*/
|
1915 |
+
public function get_author( string $field = '' ) {
|
1916 |
$author_id = absint( get_post_field( 'post_author', $this->get_id() ) );
|
1917 |
|
1918 |
return strtolower( $field ) === 'id' ? $author_id : learn_press_get_user( $author_id );
|
@@ -288,9 +288,18 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
288 |
* @param string $item_type .
|
289 |
*
|
290 |
* @return LP_Course_Item|false
|
|
|
|
|
|
|
|
|
|
|
291 |
*/
|
292 |
public static function get_item( $item_id = 0, $course_id = 0, $item_type = '' ) {
|
293 |
-
|
|
|
|
|
|
|
|
|
294 |
|
295 |
if ( false === $item ) {
|
296 |
$item = get_post( $item_id );
|
@@ -331,13 +340,13 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
331 |
}
|
332 |
}
|
333 |
|
334 |
-
if ( $course_id
|
335 |
if ( $item instanceof LP_Course_Item ) {
|
336 |
$item->set_course( $course_id );
|
337 |
}
|
338 |
}
|
339 |
|
340 |
-
|
341 |
}
|
342 |
}
|
343 |
|
@@ -525,10 +534,14 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
525 |
* @param int $user_id
|
526 |
*
|
527 |
* @return bool
|
528 |
-
* @
|
|
|
|
|
529 |
*/
|
530 |
public function is_blocked( $course_id = 0, $user_id = 0 ) {
|
531 |
-
|
|
|
|
|
532 |
$user_id = get_current_user_id();
|
533 |
}
|
534 |
|
@@ -596,10 +609,14 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
596 |
$this->get_id(),
|
597 |
$course_id,
|
598 |
$user_id
|
599 |
-
)
|
600 |
}
|
601 |
|
602 |
-
|
|
|
|
|
|
|
|
|
603 |
$course = learn_press_get_course( $course_id );
|
604 |
|
605 |
if ( ! $course ) {
|
@@ -627,9 +644,9 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
627 |
if ( $item->is_preview() ) {
|
628 |
$blocked_items[ $course_item ] = 'no';
|
629 |
} elseif ( ! $block_item_types || is_array( $block_item_types ) && ! in_array(
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
$blocked_items[ $course_item ] = 'no';
|
634 |
}
|
635 |
}
|
@@ -653,7 +670,7 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
653 |
LP_Object_Cache::set( $cache_key, $blocked_items, 'learn-press/blocked-items' );
|
654 |
|
655 |
return $blocked_items;
|
656 |
-
}
|
657 |
|
658 |
/**
|
659 |
* @param LP_User $user
|
@@ -661,8 +678,10 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
661 |
* @param LP_User_Item_Course $course_item_data
|
662 |
*
|
663 |
* @return string
|
|
|
|
|
664 |
*/
|
665 |
-
protected function _item_is_blocked( $user, $course, $course_item_data ) {
|
666 |
if ( in_array( 'administrator', $user->get_roles() ) ) {
|
667 |
$blocked = 'no';
|
668 |
} elseif ( $user->has_course_status( $course->get_id(), learn_press_course_enrolled_slugs() ) ) {
|
@@ -676,7 +695,7 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
|
|
676 |
}
|
677 |
|
678 |
return $blocked;
|
679 |
-
}
|
680 |
|
681 |
public function offsetExists( $offset ) {
|
682 |
}
|
288 |
* @param string $item_type .
|
289 |
*
|
290 |
* @return LP_Course_Item|false
|
291 |
+
* @Todo: tungnx - review - rewrite - set cache - check where call this function
|
292 |
+
* @editor tungnx
|
293 |
+
* @modify 4.1.3 - change cache
|
294 |
+
* @version 4.0.1
|
295 |
+
* @since 3.x.x
|
296 |
*/
|
297 |
public static function get_item( $item_id = 0, $course_id = 0, $item_type = '' ) {
|
298 |
+
/*$lp_course_cache = LP_Course_Cache::instance();
|
299 |
+
$key_cache = sprintf( '%d/item_id/%d', $course_id, $item_id );
|
300 |
+
$item = $lp_course_cache->get_cache( $key_cache );*/
|
301 |
+
|
302 |
+
$item = false;
|
303 |
|
304 |
if ( false === $item ) {
|
305 |
$item = get_post( $item_id );
|
340 |
}
|
341 |
}
|
342 |
|
343 |
+
if ( $course_id ) {
|
344 |
if ( $item instanceof LP_Course_Item ) {
|
345 |
$item->set_course( $course_id );
|
346 |
}
|
347 |
}
|
348 |
|
349 |
+
//$lp_course_cache->set_cache( $key_cache, $item );
|
350 |
}
|
351 |
}
|
352 |
|
534 |
* @param int $user_id
|
535 |
*
|
536 |
* @return bool
|
537 |
+
* @editor tungnx
|
538 |
+
* @modify 4.1.3 - not use - comment
|
539 |
+
* @deprecated
|
540 |
*/
|
541 |
public function is_blocked( $course_id = 0, $user_id = 0 ) {
|
542 |
+
_deprecated_function( __FUNCTION__, '4.1.3' );
|
543 |
+
|
544 |
+
/*if ( ! $user_id ) {
|
545 |
$user_id = get_current_user_id();
|
546 |
}
|
547 |
|
609 |
$this->get_id(),
|
610 |
$course_id,
|
611 |
$user_id
|
612 |
+
);*/
|
613 |
}
|
614 |
|
615 |
+
/**
|
616 |
+
* @editor tungnx
|
617 |
+
* @modify 4.1.3
|
618 |
+
*/
|
619 |
+
/*protected function _parse_item_block_status( $course_id, $user_id, $cache_key ) {
|
620 |
$course = learn_press_get_course( $course_id );
|
621 |
|
622 |
if ( ! $course ) {
|
644 |
if ( $item->is_preview() ) {
|
645 |
$blocked_items[ $course_item ] = 'no';
|
646 |
} elseif ( ! $block_item_types || is_array( $block_item_types ) && ! in_array(
|
647 |
+
$item->get_post_type(),
|
648 |
+
$block_item_types
|
649 |
+
) ) {
|
650 |
$blocked_items[ $course_item ] = 'no';
|
651 |
}
|
652 |
}
|
670 |
LP_Object_Cache::set( $cache_key, $blocked_items, 'learn-press/blocked-items' );
|
671 |
|
672 |
return $blocked_items;
|
673 |
+
}*/
|
674 |
|
675 |
/**
|
676 |
* @param LP_User $user
|
678 |
* @param LP_User_Item_Course $course_item_data
|
679 |
*
|
680 |
* @return string
|
681 |
+
* @editor tungnx
|
682 |
+
* @modify 4.1.3
|
683 |
*/
|
684 |
+
/*protected function _item_is_blocked( $user, $course, $course_item_data ) {
|
685 |
if ( in_array( 'administrator', $user->get_roles() ) ) {
|
686 |
$blocked = 'no';
|
687 |
} elseif ( $user->has_course_status( $course->get_id(), learn_press_course_enrolled_slugs() ) ) {
|
695 |
}
|
696 |
|
697 |
return $blocked;
|
698 |
+
}*/
|
699 |
|
700 |
public function offsetExists( $offset ) {
|
701 |
}
|
@@ -15,6 +15,7 @@ if ( ! class_exists( 'LP_Course' ) ) {
|
|
15 |
* Class LP_Course
|
16 |
*/
|
17 |
class LP_Course extends LP_Abstract_Course {
|
|
|
18 |
|
19 |
/**
|
20 |
* LP_Course constructor.
|
@@ -203,6 +204,7 @@ if ( ! class_exists( 'LP_Course' ) ) {
|
|
203 |
* @return int second
|
204 |
* @since 4.0.0
|
205 |
* @author tungnx
|
|
|
206 |
*/
|
207 |
public function timestamp_remaining_duration(): int {
|
208 |
$timestamp_remaining = - 1;
|
@@ -223,19 +225,6 @@ if ( ! class_exists( 'LP_Course' ) ) {
|
|
223 |
return $timestamp_remaining;
|
224 |
}
|
225 |
|
226 |
-
/**
|
227 |
-
* Get cache
|
228 |
-
* Please run wp_cache_delete('timestamp_remaining_duration_course_' . $this->get_id()); when save duration on course
|
229 |
-
*/
|
230 |
-
$timestamp_remaining = wp_cache_get(
|
231 |
-
'timestamp_remaining_duration_course_' . $this->get_id(),
|
232 |
-
'course-post'
|
233 |
-
);
|
234 |
-
|
235 |
-
if ( ! is_bool( $timestamp_remaining ) ) {
|
236 |
-
return $timestamp_remaining;
|
237 |
-
}
|
238 |
-
|
239 |
$course_item_data = $user->get_course_data( $this->get_id() );
|
240 |
|
241 |
$course_start_time = $course_item_data->get_start_time()->get_raw_date();
|
@@ -246,13 +235,6 @@ if ( ! class_exists( 'LP_Course' ) ) {
|
|
246 |
|
247 |
if ( $timestamp_remaining < 0 ) {
|
248 |
$timestamp_remaining = 0;
|
249 |
-
|
250 |
-
// Set Cache
|
251 |
-
wp_cache_set(
|
252 |
-
'timestamp_remaining_duration_course_' . $this->get_id(),
|
253 |
-
$timestamp_remaining,
|
254 |
-
'course-post'
|
255 |
-
);
|
256 |
}
|
257 |
|
258 |
return apply_filters( 'learnpress/course/block_duration_expire/timestamp_remaining', $timestamp_remaining );
|
@@ -278,22 +260,106 @@ if ( ! class_exists( 'LP_Course' ) ) {
|
|
278 |
/**
|
279 |
* Get first item of course
|
280 |
*
|
|
|
|
|
|
|
|
|
281 |
* @return int
|
282 |
*/
|
283 |
public function get_first_item_id(): int {
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
286 |
|
287 |
/**
|
288 |
* Get redirect url after enroll course
|
289 |
*
|
|
|
|
|
|
|
290 |
* @return false|string|WP_Error
|
291 |
*/
|
292 |
public function get_redirect_url_after_enroll() {
|
293 |
$first_item_id = $this->get_first_item_id();
|
294 |
-
$redirect =
|
295 |
|
296 |
return apply_filters( 'learnpress/rest-api/enroll-course/redirect', $redirect );
|
297 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
}
|
15 |
* Class LP_Course
|
16 |
*/
|
17 |
class LP_Course extends LP_Abstract_Course {
|
18 |
+
protected $key_info_extra_fast_query = '_lp_info_extra_fast_query';
|
19 |
|
20 |
/**
|
21 |
* LP_Course constructor.
|
204 |
* @return int second
|
205 |
* @since 4.0.0
|
206 |
* @author tungnx
|
207 |
+
* @version 1.0.1
|
208 |
*/
|
209 |
public function timestamp_remaining_duration(): int {
|
210 |
$timestamp_remaining = - 1;
|
225 |
return $timestamp_remaining;
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
$course_item_data = $user->get_course_data( $this->get_id() );
|
229 |
|
230 |
$course_start_time = $course_item_data->get_start_time()->get_raw_date();
|
235 |
|
236 |
if ( $timestamp_remaining < 0 ) {
|
237 |
$timestamp_remaining = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
}
|
239 |
|
240 |
return apply_filters( 'learnpress/course/block_duration_expire/timestamp_remaining', $timestamp_remaining );
|
260 |
/**
|
261 |
* Get first item of course
|
262 |
*
|
263 |
+
* @author tungnx
|
264 |
+
* @since 4.0.0
|
265 |
+
* @modify 4.1.3
|
266 |
+
* @version 1.0.1
|
267 |
* @return int
|
268 |
*/
|
269 |
public function get_first_item_id(): int {
|
270 |
+
$course_id = $this->get_id();
|
271 |
+
|
272 |
+
try {
|
273 |
+
// Get cache
|
274 |
+
$lp_course_cache = LP_Course_Cache::instance();
|
275 |
+
$key_cache = "$course_id/first_item_id";
|
276 |
+
$first_item_id = $lp_course_cache->get_cache( $key_cache );
|
277 |
+
|
278 |
+
if ( ! $first_item_id ) {
|
279 |
+
$extra_info = $this->get_info_extra_for_fast_query();
|
280 |
+
|
281 |
+
if ( ! $extra_info->first_item_id ) {
|
282 |
+
$first_item_id = LP_Course_DB::getInstance()->get_first_item_id( $course_id );
|
283 |
+
$extra_info->first_item_id = $first_item_id;
|
284 |
+
|
285 |
+
// Save post meta
|
286 |
+
$this->set_info_extra_for_fast_query( $extra_info );
|
287 |
+
} else {
|
288 |
+
$first_item_id = $extra_info->first_item_id;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
} catch ( Throwable $e ) {
|
292 |
+
$first_item_id = 0;
|
293 |
+
}
|
294 |
+
|
295 |
+
return $first_item_id;
|
296 |
}
|
297 |
|
298 |
/**
|
299 |
* Get redirect url after enroll course
|
300 |
*
|
301 |
+
* @author tungnx
|
302 |
+
* @version 1.0.0
|
303 |
+
* @since 4.0.0
|
304 |
* @return false|string|WP_Error
|
305 |
*/
|
306 |
public function get_redirect_url_after_enroll() {
|
307 |
$first_item_id = $this->get_first_item_id();
|
308 |
+
$redirect = $first_item_id ? $this->get_item_link( $first_item_id ) : get_the_permalink( $this->get_id() );
|
309 |
|
310 |
return apply_filters( 'learnpress/rest-api/enroll-course/redirect', $redirect );
|
311 |
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Get info extra on post meta to query fast
|
315 |
+
*
|
316 |
+
* @since 4.1.3
|
317 |
+
* @author tungnx
|
318 |
+
* @version 1.0.0
|
319 |
+
* @return LP_Course_Extra_Info_Fast_Query_Model
|
320 |
+
*/
|
321 |
+
public function get_info_extra_for_fast_query(): LP_Course_Extra_Info_Fast_Query_Model {
|
322 |
+
$extra_info = new LP_Course_Extra_Info_Fast_Query_Model();
|
323 |
+
|
324 |
+
try {
|
325 |
+
$extra_info_str = get_post_meta( $this->get_id(), $this->key_info_extra_fast_query, true );
|
326 |
+
|
327 |
+
if ( $extra_info_str ) {
|
328 |
+
$extra_info_stdclass = json_decode( $extra_info_str );
|
329 |
+
|
330 |
+
if ( JSON_ERROR_NONE !== json_last_error() ) {
|
331 |
+
throw new Exception( 'Error json decode on ' . __METHOD__ );
|
332 |
+
}
|
333 |
+
|
334 |
+
$extra_info = $extra_info->map_stdclass( $extra_info_stdclass );
|
335 |
+
}
|
336 |
+
} catch ( Throwable $e ) {
|
337 |
+
error_log( $e->getMessage() );
|
338 |
+
}
|
339 |
+
|
340 |
+
return $extra_info;
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Set extra info for query fast on post meta
|
345 |
+
*
|
346 |
+
* @since 4.1.3
|
347 |
+
* @author tungnx
|
348 |
+
* @version 1.0.0
|
349 |
+
* @param LP_Course_Extra_Info_Fast_Query_Model $data_object
|
350 |
+
*/
|
351 |
+
public function set_info_extra_for_fast_query( LP_Course_Extra_Info_Fast_Query_Model $data_object ) {
|
352 |
+
try {
|
353 |
+
$extra_info_json = json_encode( $data_object );
|
354 |
+
|
355 |
+
if ( JSON_ERROR_NONE !== json_last_error() ) {
|
356 |
+
throw new Exception( 'Error encode on ' . __METHOD__ );
|
357 |
+
}
|
358 |
+
|
359 |
+
update_post_meta( $this->get_id(), $this->key_info_extra_fast_query, $extra_info_json );
|
360 |
+
} catch ( Throwable $e ) {
|
361 |
+
error_log( $e->getMessage() );
|
362 |
+
}
|
363 |
+
}
|
364 |
}
|
365 |
}
|
@@ -74,7 +74,8 @@ function learn_press_verify_course_action_nonce( $nonce, $action, $course_id = 0
|
|
74 |
function learn_press_get_course_item_types() {
|
75 |
return apply_filters(
|
76 |
'learn-press/course-item-type',
|
77 |
-
array( LP_LESSON_CPT, LP_QUIZ_CPT )
|
|
|
78 |
}
|
79 |
|
80 |
/**
|
@@ -86,13 +87,16 @@ function learn_press_get_course_item_types() {
|
|
86 |
*/
|
87 |
function learn_press_get_item_courses( $item ) {
|
88 |
global $wpdb;
|
89 |
-
$query = $wpdb->prepare(
|
|
|
90 |
SELECT c.*
|
91 |
FROM {$wpdb->posts} c
|
92 |
INNER JOIN {$wpdb->learnpress_sections} s ON c.ID = s.section_course_id
|
93 |
INNER JOIN {$wpdb->learnpress_section_items} si ON si.section_id = s.section_id
|
94 |
WHERE si.item_id = %d
|
95 |
-
|
|
|
|
|
96 |
|
97 |
return $wpdb->get_results( $query );
|
98 |
}
|
@@ -123,8 +127,12 @@ function learn_press_course_post_type_link( $permalink, $post ) {
|
|
123 |
|
124 |
if ( ! empty( $terms ) ) {
|
125 |
$terms = _learn_press_usort_terms_by_ID( $terms ); // order by ID
|
126 |
-
$category_object = apply_filters(
|
127 |
-
|
|
|
|
|
|
|
|
|
128 |
$category_object = get_term( $category_object, 'course_category' );
|
129 |
$course_category = $category_object->slug;
|
130 |
|
@@ -180,8 +188,11 @@ function learn_press_item_meta_format( $item, $nonce = '' ) {
|
|
180 |
|
181 |
// return false to hide post format
|
182 |
if ( $format = apply_filters( 'learn_press_course_item_format', $format, $item ) ) {
|
183 |
-
printf(
|
184 |
-
|
|
|
|
|
|
|
185 |
} else {
|
186 |
echo $nonce;
|
187 |
}
|
@@ -218,8 +229,11 @@ function learn_press_get_course_curriculum( $course_id ) {
|
|
218 |
* @param int $user_id
|
219 |
*
|
220 |
* @return boolean
|
|
|
|
|
221 |
*/
|
222 |
function learn_press_is_enrolled_course( $course_id = null, $user_id = null ) {
|
|
|
223 |
if ( $course = learn_press_get_course( $course_id ) && $user = learn_press_get_user( $user_id ) ) {
|
224 |
return $user->has_enrolled_course( $course_id );
|
225 |
}
|
@@ -479,12 +493,13 @@ function learn_press_get_course_permalink( $course_id = 0 ) {
|
|
479 |
* @since 3.0.0
|
480 |
*
|
481 |
*/
|
482 |
-
function learn_press_get_course_item_permalink( $course_id = 0, $item_id = 0 ) {
|
483 |
-
|
|
|
484 |
return $course->get_item_link( $item_id );
|
485 |
}
|
486 |
|
487 |
-
return
|
488 |
}
|
489 |
|
490 |
|
@@ -719,10 +734,16 @@ if ( ! function_exists( 'learn_press_edit_item_link' ) ) {
|
|
719 |
$user = learn_press_get_current_user();
|
720 |
if ( $user->can_edit_item( $item_id, $course_id ) ) : ?>
|
721 |
<p class="edit-course-item-link">
|
722 |
-
<a href="<?php echo get_edit_post_link( $item_id ); ?>"
|
723 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
724 |
</p>
|
725 |
-
|
726 |
endif;
|
727 |
}
|
728 |
}
|
@@ -763,14 +784,17 @@ if ( ! function_exists( 'learn_press_get_item_course_id' ) ) {
|
|
763 |
}
|
764 |
|
765 |
if ( false === $course_id ) {
|
766 |
-
$query = $wpdb->prepare(
|
|
|
767 |
SELECT section.section_course_id
|
768 |
FROM {$wpdb->learnpress_sections} AS section
|
769 |
INNER JOIN {$wpdb->learnpress_section_items} AS item
|
770 |
ON item.section_id = section.section_id
|
771 |
WHERE item.item_id = %d
|
772 |
LIMIT 1
|
773 |
-
|
|
|
|
|
774 |
|
775 |
$course_id = apply_filters( 'learn-press/item-course-id', absint( $wpdb->get_var( $query ) ), $post_id );
|
776 |
|
@@ -848,8 +872,9 @@ function learn_press_get_preview_url( $post_id ) {
|
|
848 |
add_query_arg(
|
849 |
array(
|
850 |
'lp-preview' => $post_id,
|
851 |
-
'_wpnonce' => wp_create_nonce( 'lp-preview' )
|
852 |
-
),
|
|
|
853 |
);
|
854 |
}
|
855 |
|
74 |
function learn_press_get_course_item_types() {
|
75 |
return apply_filters(
|
76 |
'learn-press/course-item-type',
|
77 |
+
array( LP_LESSON_CPT, LP_QUIZ_CPT )
|
78 |
+
);
|
79 |
}
|
80 |
|
81 |
/**
|
87 |
*/
|
88 |
function learn_press_get_item_courses( $item ) {
|
89 |
global $wpdb;
|
90 |
+
$query = $wpdb->prepare(
|
91 |
+
"
|
92 |
SELECT c.*
|
93 |
FROM {$wpdb->posts} c
|
94 |
INNER JOIN {$wpdb->learnpress_sections} s ON c.ID = s.section_course_id
|
95 |
INNER JOIN {$wpdb->learnpress_section_items} si ON si.section_id = s.section_id
|
96 |
WHERE si.item_id = %d
|
97 |
+
",
|
98 |
+
$item
|
99 |
+
);
|
100 |
|
101 |
return $wpdb->get_results( $query );
|
102 |
}
|
127 |
|
128 |
if ( ! empty( $terms ) ) {
|
129 |
$terms = _learn_press_usort_terms_by_ID( $terms ); // order by ID
|
130 |
+
$category_object = apply_filters(
|
131 |
+
'learn_press_course_post_type_link_course_category',
|
132 |
+
$terms[0],
|
133 |
+
$terms,
|
134 |
+
$post
|
135 |
+
);
|
136 |
$category_object = get_term( $category_object, 'course_category' );
|
137 |
$course_category = $category_object->slug;
|
138 |
|
188 |
|
189 |
// return false to hide post format
|
190 |
if ( $format = apply_filters( 'learn_press_course_item_format', $format, $item ) ) {
|
191 |
+
printf(
|
192 |
+
'<label for="post-format-0" class="post-format-icon post-format-%s" title="%s"></label>',
|
193 |
+
$format,
|
194 |
+
ucfirst( $format )
|
195 |
+
);
|
196 |
} else {
|
197 |
echo $nonce;
|
198 |
}
|
229 |
* @param int $user_id
|
230 |
*
|
231 |
* @return boolean
|
232 |
+
* @deprecated 4.1.3
|
233 |
+
* @editor tungnx
|
234 |
*/
|
235 |
function learn_press_is_enrolled_course( $course_id = null, $user_id = null ) {
|
236 |
+
_deprecated_function( __FUNCTION__, '4.1.3' );
|
237 |
if ( $course = learn_press_get_course( $course_id ) && $user = learn_press_get_user( $user_id ) ) {
|
238 |
return $user->has_enrolled_course( $course_id );
|
239 |
}
|
493 |
* @since 3.0.0
|
494 |
*
|
495 |
*/
|
496 |
+
function learn_press_get_course_item_permalink( int $course_id = 0, int $item_id = 0 ): string {
|
497 |
+
$course = learn_press_get_course( $course_id );
|
498 |
+
if ( $course ) {
|
499 |
return $course->get_item_link( $item_id );
|
500 |
}
|
501 |
|
502 |
+
return '';
|
503 |
}
|
504 |
|
505 |
|
734 |
$user = learn_press_get_current_user();
|
735 |
if ( $user->can_edit_item( $item_id, $course_id ) ) : ?>
|
736 |
<p class="edit-course-item-link">
|
737 |
+
<a href="<?php echo get_edit_post_link( $item_id ); ?>">
|
738 |
+
<?php
|
739 |
+
_e(
|
740 |
+
'Edit this item',
|
741 |
+
'learnpress'
|
742 |
+
);
|
743 |
+
?>
|
744 |
+
</a>
|
745 |
</p>
|
746 |
+
<?php
|
747 |
endif;
|
748 |
}
|
749 |
}
|
784 |
}
|
785 |
|
786 |
if ( false === $course_id ) {
|
787 |
+
$query = $wpdb->prepare(
|
788 |
+
"
|
789 |
SELECT section.section_course_id
|
790 |
FROM {$wpdb->learnpress_sections} AS section
|
791 |
INNER JOIN {$wpdb->learnpress_section_items} AS item
|
792 |
ON item.section_id = section.section_id
|
793 |
WHERE item.item_id = %d
|
794 |
LIMIT 1
|
795 |
+
",
|
796 |
+
$post_id
|
797 |
+
);
|
798 |
|
799 |
$course_id = apply_filters( 'learn-press/item-course-id', absint( $wpdb->get_var( $query ) ), $post_id );
|
800 |
|
872 |
add_query_arg(
|
873 |
array(
|
874 |
'lp-preview' => $post_id,
|
875 |
+
'_wpnonce' => wp_create_nonce( 'lp-preview' ),
|
876 |
+
),
|
877 |
+
trailingslashit( get_home_url() /* SITE_URL */ )
|
878 |
);
|
879 |
}
|
880 |
|
@@ -137,8 +137,12 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
137 |
|
138 |
// ensure that user can create course
|
139 |
if ( ! current_user_can( 'edit_posts' ) ) {
|
140 |
-
return new WP_Error(
|
141 |
-
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
// duplicate course
|
144 |
$new_course_id = learn_press_duplicate_post( $course_id, $args );
|
@@ -251,13 +255,20 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
251 |
);
|
252 |
}
|
253 |
|
254 |
-
$types
|
255 |
-
$where .= $wpdb->prepare(
|
256 |
-
$types )
|
|
|
|
|
257 |
|
258 |
if ( $section_ids ) {
|
259 |
-
$where .= $wpdb->prepare(
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
|
263 |
$query = $wpdb->prepare(
|
@@ -450,11 +461,11 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
450 |
INNER JOIN {$wpdb->posts} it ON it.ID = si.item_id
|
451 |
WHERE s.section_course_id = %d";
|
452 |
if ( $context == 'view' ) {
|
453 |
-
$sql
|
454 |
AND it.post_status = %s ';
|
455 |
$params = array_merge( $params, array( 'publish', 'publish' ) );
|
456 |
}
|
457 |
-
$sql
|
458 |
$query = $wpdb->prepare( $sql, $params );
|
459 |
|
460 |
$stats_object = array();
|
@@ -583,12 +594,21 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
583 |
public function remove_course( $course_id ) {
|
584 |
global $wpdb;
|
585 |
|
586 |
-
$section_ids = $wpdb->get_col(
|
587 |
-
$
|
|
|
|
|
|
|
|
|
588 |
if ( $section_ids ) {
|
589 |
$wpdb->query(
|
590 |
-
$wpdb->prepare(
|
591 |
-
|
|
|
|
|
|
|
|
|
|
|
592 |
);
|
593 |
learn_press_reset_auto_increment( 'learnpress_section_items' );
|
594 |
}
|
@@ -842,8 +862,10 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
842 |
continue;
|
843 |
}
|
844 |
|
845 |
-
if ( false !== ( $count = LP_Object_Cache::get(
|
846 |
-
|
|
|
|
|
847 |
continue;
|
848 |
} else {
|
849 |
LP_Object_Cache::set( 'course-' . $course_id, 0, 'learn-press/course-orders' );
|
@@ -884,8 +906,11 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
|
|
884 |
if ( empty( $row->cid ) ) {
|
885 |
continue;
|
886 |
}
|
887 |
-
LP_Object_Cache::set(
|
888 |
-
'
|
|
|
|
|
|
|
889 |
}
|
890 |
}
|
891 |
}
|
137 |
|
138 |
// ensure that user can create course
|
139 |
if ( ! current_user_can( 'edit_posts' ) ) {
|
140 |
+
return new WP_Error(
|
141 |
+
__(
|
142 |
+
'<p>Sorry! You don\'t have permission to duplicate this course</p>',
|
143 |
+
'learnpress'
|
144 |
+
)
|
145 |
+
);
|
146 |
}
|
147 |
// duplicate course
|
148 |
$new_course_id = learn_press_duplicate_post( $course_id, $args );
|
255 |
);
|
256 |
}
|
257 |
|
258 |
+
$types = learn_press_course_get_support_item_types( true );
|
259 |
+
$where .= $wpdb->prepare(
|
260 |
+
' AND si.item_type IN(' . LP_Helper::db_format_array( $types, '%s' ) . ')',
|
261 |
+
$types
|
262 |
+
);
|
263 |
|
264 |
if ( $section_ids ) {
|
265 |
+
$where .= $wpdb->prepare(
|
266 |
+
' AND s.section_id IN(' . LP_Helper::db_format_array(
|
267 |
+
$section_ids,
|
268 |
+
'%d'
|
269 |
+
) . ')',
|
270 |
+
$section_ids
|
271 |
+
);
|
272 |
}
|
273 |
|
274 |
$query = $wpdb->prepare(
|
461 |
INNER JOIN {$wpdb->posts} it ON it.ID = si.item_id
|
462 |
WHERE s.section_course_id = %d";
|
463 |
if ( $context == 'view' ) {
|
464 |
+
$sql .= ' AND c.post_status = %s
|
465 |
AND it.post_status = %s ';
|
466 |
$params = array_merge( $params, array( 'publish', 'publish' ) );
|
467 |
}
|
468 |
+
$sql .= ' GROUP BY it.post_type ';
|
469 |
$query = $wpdb->prepare( $sql, $params );
|
470 |
|
471 |
$stats_object = array();
|
594 |
public function remove_course( $course_id ) {
|
595 |
global $wpdb;
|
596 |
|
597 |
+
$section_ids = $wpdb->get_col(
|
598 |
+
$wpdb->prepare(
|
599 |
+
"SELECT section_id FROM {$wpdb->prefix}learnpress_sections WHERE section_course_id = %d",
|
600 |
+
$course_id
|
601 |
+
)
|
602 |
+
);
|
603 |
if ( $section_ids ) {
|
604 |
$wpdb->query(
|
605 |
+
$wpdb->prepare(
|
606 |
+
"DELETE FROM {$wpdb->prefix}learnpress_section_items WHERE %d AND section_id IN(" . join(
|
607 |
+
',',
|
608 |
+
$section_ids
|
609 |
+
) . ')',
|
610 |
+
1
|
611 |
+
)
|
612 |
);
|
613 |
learn_press_reset_auto_increment( 'learnpress_section_items' );
|
614 |
}
|
862 |
continue;
|
863 |
}
|
864 |
|
865 |
+
if ( false !== ( $count = LP_Object_Cache::get(
|
866 |
+
'course-' . $course_id,
|
867 |
+
'learn-press/course-orders'
|
868 |
+
) ) ) {
|
869 |
continue;
|
870 |
} else {
|
871 |
LP_Object_Cache::set( 'course-' . $course_id, 0, 'learn-press/course-orders' );
|
906 |
if ( empty( $row->cid ) ) {
|
907 |
continue;
|
908 |
}
|
909 |
+
LP_Object_Cache::set(
|
910 |
+
'course-' . $row->cid,
|
911 |
+
intval( $row->count ),
|
912 |
+
'learn-press/course-orders'
|
913 |
+
);
|
914 |
}
|
915 |
}
|
916 |
}
|
@@ -288,9 +288,6 @@ class LP_Order_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
288 |
'post_date_gmt' => $order->get_order_date( 'edit' )->toSql( false ),
|
289 |
'post_status' => 'lp-' . $status,
|
290 |
'post_parent' => $order->get_parent_id(),
|
291 |
-
// 'post_excerpt' => $this->get_post_excerpt( $order ),
|
292 |
-
// 'post_modified' => $order->get_date_modified( ),
|
293 |
-
// 'post_modified_gmt' => $order->get_date_modified( ),
|
294 |
);
|
295 |
|
296 |
$post_data = apply_filters( 'learn-press/order/update-data', $post_data, $order->get_id() );
|
288 |
'post_date_gmt' => $order->get_order_date( 'edit' )->toSql( false ),
|
289 |
'post_status' => 'lp-' . $status,
|
290 |
'post_parent' => $order->get_parent_id(),
|
|
|
|
|
|
|
291 |
);
|
292 |
|
293 |
$post_data = apply_filters( 'learn-press/order/update-data', $post_data, $order->get_id() );
|
@@ -645,13 +645,18 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
645 |
/**
|
646 |
* Read course data for an user.
|
647 |
*
|
648 |
-
* @param int
|
649 |
-
* @param int
|
650 |
-
* @param bool
|
651 |
*
|
652 |
* @return bool
|
|
|
|
|
|
|
653 |
*/
|
654 |
-
public function read_course( $user_id =
|
|
|
|
|
655 |
if ( is_null( $user_id ) ) {
|
656 |
$user_id = get_current_user_id();
|
657 |
}
|
@@ -668,48 +673,33 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
668 |
return false;
|
669 |
}
|
670 |
|
671 |
-
|
672 |
-
|
673 |
-
$this->read_course( $user_id, $cid, $force );
|
674 |
-
}
|
675 |
-
|
676 |
-
return true;
|
677 |
-
}
|
678 |
-
|
679 |
-
if ( false !== ( $result = LP_Object_Cache::get( 'course-' . $user_id . '-' . $course_id, 'learn-press/user-item-courses' ) ) ) {
|
680 |
return $result;
|
681 |
-
}
|
|
|
682 |
|
683 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
$query = $wpdb->prepare(
|
689 |
-
"
|
690 |
-
SELECT ui.*
|
691 |
-
FROM {$wpdb->learnpress_user_items} ui
|
692 |
-
WHERE item_type = %s
|
693 |
-
AND user_id = %d
|
694 |
-
AND item_id = %d
|
695 |
-
ORDER BY user_item_id DESC
|
696 |
-
LIMIT 0, 1
|
697 |
-
",
|
698 |
-
LP_COURSE_CPT,
|
699 |
-
$user_id,
|
700 |
-
$course_id
|
701 |
-
);
|
702 |
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
} else {
|
707 |
-
$result = '';
|
708 |
}
|
709 |
|
710 |
-
LP_Object_Cache::set( 'course-' . $user_id . '-' . $course_id, $result, 'learn-press/user-item-courses' );
|
711 |
|
712 |
-
return $
|
713 |
}
|
714 |
|
715 |
public function get_course_access_level( $user_id, $course_id ) {
|
@@ -1176,8 +1166,10 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
1176 |
* @param array $item_data
|
1177 |
*
|
1178 |
* @return bool
|
|
|
|
|
1179 |
*/
|
1180 |
-
public function update_user_item_by_id( $user_item_id, $item_data = array() ) {
|
1181 |
global $wpdb;
|
1182 |
|
1183 |
$item = $this->get_user_item_by_id( $user_item_id );
|
@@ -1235,7 +1227,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
|
|
1235 |
}
|
1236 |
|
1237 |
return isset( $updated ) ? $updated : $user_item_id;
|
1238 |
-
}
|
1239 |
|
1240 |
/**
|
1241 |
* Update status of an user item by id.
|
645 |
/**
|
646 |
* Read course data for an user.
|
647 |
*
|
648 |
+
* @param int $user_id
|
649 |
+
* @param int $course_id
|
650 |
+
* @param bool $force - ignore caching.
|
651 |
*
|
652 |
* @return bool
|
653 |
+
* @editor tungnx
|
654 |
+
* @modify 4.1.2
|
655 |
+
* @Todo should rewrite
|
656 |
*/
|
657 |
+
public function read_course( int $user_id = 0, int $course_id = null, bool $force = false ) {
|
658 |
+
$lp_user_items_db = LP_User_Items_DB::getInstance();
|
659 |
+
|
660 |
if ( is_null( $user_id ) ) {
|
661 |
$user_id = get_current_user_id();
|
662 |
}
|
673 |
return false;
|
674 |
}
|
675 |
|
676 |
+
/*$result = LP_Object_Cache::get( 'course-' . $user_id . '-' . $course_id, 'learn-press/user-item-courses' );
|
677 |
+
if ( false !== $result ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
return $result;
|
679 |
+
}*/
|
680 |
+
$last_user_course = false;
|
681 |
|
682 |
+
try {
|
683 |
+
/**
|
684 |
+
* Get newest item-course in table user-items
|
685 |
+
*/
|
686 |
+
$filter = new LP_User_Items_Filter();
|
687 |
+
$filter->item_id = $course_id;
|
688 |
+
$filter->user_id = $user_id;
|
689 |
+
$last_user_course = $lp_user_items_db->get_last_user_course( $filter );
|
690 |
|
691 |
+
if ( ! $last_user_course ) {
|
692 |
+
return false;
|
693 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
694 |
|
695 |
+
$last_user_course = (array) $last_user_course;
|
696 |
+
} catch ( Throwable $e ) {
|
697 |
+
error_log( $e->getMessage() );
|
|
|
|
|
698 |
}
|
699 |
|
700 |
+
//LP_Object_Cache::set( 'course-' . $user_id . '-' . $course_id, $result, 'learn-press/user-item-courses' );
|
701 |
|
702 |
+
return $last_user_course;
|
703 |
}
|
704 |
|
705 |
public function get_course_access_level( $user_id, $course_id ) {
|
1166 |
* @param array $item_data
|
1167 |
*
|
1168 |
* @return bool
|
1169 |
+
* @editor tungnx
|
1170 |
+
* @modify 4.1.3 - comment - not use
|
1171 |
*/
|
1172 |
+
/*public function update_user_item_by_id( $user_item_id, $item_data = array() ) {
|
1173 |
global $wpdb;
|
1174 |
|
1175 |
$item = $this->get_user_item_by_id( $user_item_id );
|
1227 |
}
|
1228 |
|
1229 |
return isset( $updated ) ? $updated : $user_item_id;
|
1230 |
+
}*/
|
1231 |
|
1232 |
/**
|
1233 |
* Update status of an user item by id.
|
@@ -532,8 +532,10 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
|
|
532 |
*
|
533 |
* @return array
|
534 |
* @since 3.2.0
|
|
|
|
|
535 |
*/
|
536 |
-
public function parse_items_preview( $course_id, $user_id = 0 ) {
|
537 |
$items = array();
|
538 |
|
539 |
$course = learn_press_get_course( $course_id );
|
@@ -577,20 +579,21 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
|
|
577 |
}
|
578 |
|
579 |
return $items;
|
580 |
-
}
|
581 |
|
582 |
/**
|
583 |
* Parse classes for all items in a course.
|
584 |
*
|
585 |
-
* @param int
|
586 |
-
* @param int
|
587 |
* @param array|string $more .
|
588 |
*
|
589 |
* @return array
|
|
|
590 |
* @since 3.2.0
|
591 |
* @editor tungnx
|
592 |
*/
|
593 |
-
public function parse_items_classes( $course_id = 0, $user_id = 0, $more = array() ) {
|
594 |
$items = array();
|
595 |
|
596 |
$course = learn_press_get_course( $course_id );
|
@@ -615,9 +618,9 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
|
|
615 |
}
|
616 |
|
617 |
$current_item = LP_Global::course_item();
|
618 |
-
$enrolled = $user->
|
619 |
$is_free = $course->is_free();
|
620 |
-
$no_required_enroll
|
621 |
$can_view_content_course = $user->can_view_content_course( $course_id );
|
622 |
|
623 |
foreach ( $get_item_ids as $item_id ) {
|
@@ -650,7 +653,7 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
|
|
650 |
// Edit by tungnx, rewrite class to show icon.
|
651 |
if ( $no_required_enroll ) {
|
652 |
$defaults[] = 'item-free';
|
653 |
-
} elseif ( ! $
|
654 |
$defaults['item-locked'] = 'item-locked';
|
655 |
|
656 |
if ( $item->is_preview() ) {
|
@@ -681,14 +684,16 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
|
|
681 |
$defaults['has-status'] = 'has-status';
|
682 |
}
|
683 |
|
684 |
-
|
685 |
'learn-press/course-item-status-class',
|
686 |
$item_status,
|
687 |
$item_grade,
|
688 |
$item->get_item_type(),
|
689 |
$item_id,
|
690 |
$course_id
|
691 |
-
)
|
|
|
|
|
692 |
$defaults[] = $item_class;
|
693 |
}
|
694 |
}
|
532 |
*
|
533 |
* @return array
|
534 |
* @since 3.2.0
|
535 |
+
* @editor tungnx
|
536 |
+
* @modify 4.1.3 - comment - not use
|
537 |
*/
|
538 |
+
/*public function parse_items_preview( $course_id, $user_id = 0 ) {
|
539 |
$items = array();
|
540 |
|
541 |
$course = learn_press_get_course( $course_id );
|
579 |
}
|
580 |
|
581 |
return $items;
|
582 |
+
}*/
|
583 |
|
584 |
/**
|
585 |
* Parse classes for all items in a course.
|
586 |
*
|
587 |
+
* @param int $course_id .
|
588 |
+
* @param int $user_id .
|
589 |
* @param array|string $more .
|
590 |
*
|
591 |
* @return array
|
592 |
+
* @throws Exception
|
593 |
* @since 3.2.0
|
594 |
* @editor tungnx
|
595 |
*/
|
596 |
+
public function parse_items_classes( int $course_id = 0, int $user_id = 0, $more = array() ): array {
|
597 |
$items = array();
|
598 |
|
599 |
$course = learn_press_get_course( $course_id );
|
618 |
}
|
619 |
|
620 |
$current_item = LP_Global::course_item();
|
621 |
+
$enrolled = $user->has_enrolled_or_finished( $course_id );
|
622 |
$is_free = $course->is_free();
|
623 |
+
$no_required_enroll = $course->is_no_required_enroll();
|
624 |
$can_view_content_course = $user->can_view_content_course( $course_id );
|
625 |
|
626 |
foreach ( $get_item_ids as $item_id ) {
|
653 |
// Edit by tungnx, rewrite class to show icon.
|
654 |
if ( $no_required_enroll ) {
|
655 |
$defaults[] = 'item-free';
|
656 |
+
} elseif ( ! $enrolled ) {
|
657 |
$defaults['item-locked'] = 'item-locked';
|
658 |
|
659 |
if ( $item->is_preview() ) {
|
684 |
$defaults['has-status'] = 'has-status';
|
685 |
}
|
686 |
|
687 |
+
$item_class = apply_filters(
|
688 |
'learn-press/course-item-status-class',
|
689 |
$item_status,
|
690 |
$item_grade,
|
691 |
$item->get_item_type(),
|
692 |
$item_id,
|
693 |
$course_id
|
694 |
+
);
|
695 |
+
|
696 |
+
if ( $item_class ) {
|
697 |
$defaults[] = $item_class;
|
698 |
}
|
699 |
}
|
@@ -49,7 +49,7 @@ abstract class LP_Abstract_Post_Type {
|
|
49 |
*
|
50 |
* @var array
|
51 |
*/
|
52 |
-
protected $_map_methods = array();
|
53 |
|
54 |
/**
|
55 |
* @var array
|
@@ -71,7 +71,7 @@ abstract class LP_Abstract_Post_Type {
|
|
71 |
|
72 |
$this->_post_type = $post_type;
|
73 |
add_action( 'init', array( $this, '_do_register' ) );
|
74 |
-
add_action( 'save_post', array( $this, '
|
75 |
add_action( 'before_delete_post', array( $this, '_before_delete_post' ) );
|
76 |
add_action( 'deleted_post', array( $this, '_deleted_post' ) );
|
77 |
|
@@ -84,16 +84,24 @@ abstract class LP_Abstract_Post_Type {
|
|
84 |
add_filter( 'posts_where_paged', array( $this, '_posts_where_paged' ) );
|
85 |
add_filter( 'posts_orderby', array( $this, '_posts_orderby' ) );
|
86 |
|
87 |
-
|
88 |
add_filter( 'post_row_actions', array( $this, '_post_row_actions' ), 10, 2 );
|
89 |
|
|
|
90 |
add_action( 'load-post.php', array( $this, 'add_meta_boxes' ), 0 );
|
91 |
add_action( 'load-post-new.php', array( $this, 'add_meta_boxes' ), 0 );
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
add_action( '
|
96 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
add_action( 'admin_footer', array( $this, 'admin_footer_scripts' ) );
|
98 |
|
99 |
add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
|
@@ -110,11 +118,135 @@ abstract class LP_Abstract_Post_Type {
|
|
110 |
add_action( 'admin_print_scripts', array( $this, 'remove_auto_save_script' ) );
|
111 |
}
|
112 |
|
113 |
-
if ( $args['default_meta'] ) {
|
114 |
$this->_default_metas = $args['default_meta'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
116 |
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
|
120 |
public function column_instructor( $post_id = 0 ) {
|
@@ -152,15 +284,17 @@ abstract class LP_Abstract_Post_Type {
|
|
152 |
return;
|
153 |
}
|
154 |
|
155 |
-
|
|
|
156 |
$option = sprintf( '<option value="">%s</option>', __( 'Search by user', 'learnpress' ) );
|
157 |
$user = get_user_by( 'id', LP_Request::get_int( 'author' ) );
|
158 |
|
159 |
if ( $user ) {
|
160 |
$option = sprintf( '<option value="%d" selected="selected">%s</option>', $user->ID, $user->user_login );
|
161 |
}
|
162 |
-
}
|
163 |
|
|
|
164 |
if ( $pagenow === 'post.php' ) {
|
165 |
?>
|
166 |
<script>
|
@@ -223,7 +357,8 @@ abstract class LP_Abstract_Post_Type {
|
|
223 |
return 0;
|
224 |
}
|
225 |
|
226 |
-
|
|
|
227 |
if ( ! $this->_remove_features ) {
|
228 |
return;
|
229 |
}
|
@@ -231,9 +366,10 @@ abstract class LP_Abstract_Post_Type {
|
|
231 |
foreach ( $this->_remove_features as $feature ) {
|
232 |
remove_post_type_support( $this->_post_type, $feature );
|
233 |
}
|
234 |
-
}
|
235 |
|
236 |
-
|
|
|
237 |
if ( is_array( $feature ) ) {
|
238 |
foreach ( $feature as $fea ) {
|
239 |
$this->remove_feature( $fea );
|
@@ -241,9 +377,10 @@ abstract class LP_Abstract_Post_Type {
|
|
241 |
} else {
|
242 |
$this->_remove_features[] = $feature;
|
243 |
}
|
244 |
-
}
|
245 |
|
246 |
-
|
|
|
247 |
global $wp_query, $post;
|
248 |
|
249 |
if ( ! $post ) {
|
@@ -267,7 +404,7 @@ abstract class LP_Abstract_Post_Type {
|
|
267 |
update_post_meta( $post->ID, $k, $v );
|
268 |
}
|
269 |
}
|
270 |
-
}
|
271 |
|
272 |
public function remove_auto_save_script() {
|
273 |
global $post;
|
@@ -278,54 +415,20 @@ abstract class LP_Abstract_Post_Type {
|
|
278 |
}
|
279 |
|
280 |
/**
|
281 |
-
*
|
282 |
-
* new post type with WP.
|
283 |
-
*/
|
284 |
-
public function _do_register() {
|
285 |
-
$args = $this->register();
|
286 |
-
|
287 |
-
if ( $args ) {
|
288 |
-
register_post_type( $this->_post_type, $args );
|
289 |
-
}
|
290 |
-
}
|
291 |
-
|
292 |
-
/**
|
293 |
-
* This function is invoked along with 'save_post' action to save
|
294 |
-
* post data if needed.
|
295 |
-
*
|
296 |
-
* In child-class should use function save() to update data instead
|
297 |
-
* of _do_save() directly. This helper function is a pre-process to
|
298 |
-
* checks some security in basic level or prevent loop 'save_post'
|
299 |
-
* action in our application.
|
300 |
-
*
|
301 |
-
* @param $post_id
|
302 |
-
* @param $post
|
303 |
*
|
304 |
-
* @
|
|
|
|
|
305 |
*/
|
306 |
-
public function
|
307 |
-
|
308 |
-
$this->maybe_remove_assigned( $post_id );
|
309 |
|
310 |
-
if (
|
311 |
-
return
|
312 |
}
|
313 |
-
// TODO: check more here
|
314 |
-
// prevent loop action
|
315 |
-
remove_action( 'save_post', array( $this, '_do_save' ), 10 );
|
316 |
-
$func_args = func_get_args();
|
317 |
-
$this->_call_method( 'save', $func_args );
|
318 |
-
$this->_flush_cache();
|
319 |
-
add_action( 'save_post', array( $this, '_do_save' ), 10, 2 );
|
320 |
|
321 |
-
|
322 |
-
}
|
323 |
-
|
324 |
-
public function maybe_remove_assigned( $post_id ) {
|
325 |
-
global $wpdb;
|
326 |
-
|
327 |
-
$post = get_post( $post_id );
|
328 |
-
$post_type = $this->get_post_type();
|
329 |
$post_status = $post->post_status;
|
330 |
|
331 |
// If we are updating question
|
@@ -337,8 +440,8 @@ abstract class LP_Abstract_Post_Type {
|
|
337 |
"
|
338 |
DELETE FROM {$wpdb->learnpress_quiz_questions}
|
339 |
WHERE question_id = %d
|
340 |
-
|
341 |
-
$
|
342 |
);
|
343 |
$wpdb->query( $query );
|
344 |
}
|
@@ -350,8 +453,8 @@ abstract class LP_Abstract_Post_Type {
|
|
350 |
"
|
351 |
DELETE FROM {$wpdb->learnpress_section_items}
|
352 |
WHERE item_id = %d
|
353 |
-
|
354 |
-
$
|
355 |
);
|
356 |
$wpdb->query( $query );
|
357 |
}
|
@@ -412,32 +515,22 @@ abstract class LP_Abstract_Post_Type {
|
|
412 |
}
|
413 |
}
|
414 |
|
415 |
-
|
|
|
|
|
|
|
|
|
416 |
global $pagenow, $post_type;
|
417 |
if ( ! is_admin() || ( $pagenow != 'edit.php' ) || ( $this->_post_type != LP_Request::get_string( 'post_type' ) ) ) {
|
418 |
return false;
|
419 |
}
|
420 |
|
421 |
return true;
|
422 |
-
}
|
423 |
-
|
424 |
-
public function _before_delete_post( $post_id ) {
|
425 |
-
// TODO:
|
426 |
-
if ( ! $this->_check_post() ) {
|
427 |
-
return;
|
428 |
-
}
|
429 |
-
|
430 |
-
$func_args = func_get_args();
|
431 |
-
return $this->_call_method( 'before_delete', $func_args );
|
432 |
-
}
|
433 |
-
|
434 |
-
public function _deleted_post( $post_id ) {
|
435 |
-
$this->_flush_cache();
|
436 |
-
}
|
437 |
|
438 |
protected function _flush_cache() {
|
439 |
-
LP_Hard_Cache::flush();
|
440 |
-
wp_cache_flush();
|
441 |
}
|
442 |
|
443 |
public function _posts_fields( $fields ) {
|
@@ -456,6 +549,10 @@ abstract class LP_Abstract_Post_Type {
|
|
456 |
return $this->posts_join_paged( $join );
|
457 |
}
|
458 |
|
|
|
|
|
|
|
|
|
459 |
public function _posts_where_paged( $where ) {
|
460 |
if ( ! $this->_check_post() ) {
|
461 |
return $where;
|
@@ -464,6 +561,10 @@ abstract class LP_Abstract_Post_Type {
|
|
464 |
return $this->posts_where_paged( $where );
|
465 |
}
|
466 |
|
|
|
|
|
|
|
|
|
467 |
public function _posts_orderby( $orderby ) {
|
468 |
if ( ! $this->_check_post() ) {
|
469 |
return $orderby;
|
@@ -472,7 +573,16 @@ abstract class LP_Abstract_Post_Type {
|
|
472 |
return $this->posts_orderby( $orderby );
|
473 |
}
|
474 |
|
475 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
global $pagenow, $post_type;
|
477 |
|
478 |
if ( ! is_admin() || ( ! in_array( $pagenow, array( 'edit.php', 'post.php' ) ) ) || ( $this->_post_type != $post_type ) ) {
|
@@ -482,16 +592,27 @@ abstract class LP_Abstract_Post_Type {
|
|
482 |
return true;
|
483 |
}
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
public function add_meta_box( $id, $title, $callback = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
|
486 |
$this->_meta_boxes[ $id ] = func_get_args();
|
487 |
|
488 |
return $this;
|
489 |
}
|
490 |
|
491 |
-
public function register() {
|
492 |
-
return false;
|
493 |
-
}
|
494 |
-
|
495 |
public function add_meta_boxes() {
|
496 |
if ( $this->_post_type != learn_press_get_requested_post_type() ) {
|
497 |
return;
|
@@ -520,23 +641,13 @@ abstract class LP_Abstract_Post_Type {
|
|
520 |
|
521 |
}
|
522 |
|
523 |
-
public function before_delete( $post_id ) {
|
524 |
-
// Implement from child
|
525 |
-
}
|
526 |
-
|
527 |
-
/**
|
528 |
-
*
|
529 |
-
*/
|
530 |
-
public function save() {
|
531 |
-
|
532 |
-
}
|
533 |
-
|
534 |
/**
|
535 |
* Filter item by the course selected.
|
536 |
*
|
537 |
* @since 3.0.7
|
538 |
*
|
539 |
* @return bool|int
|
|
|
540 |
*/
|
541 |
protected function _filter_items_by_course() {
|
542 |
$course_id = ! empty( $_REQUEST['course'] ) ? absint( $_REQUEST['course'] ) : false;
|
@@ -553,6 +664,7 @@ abstract class LP_Abstract_Post_Type {
|
|
553 |
|
554 |
/**
|
555 |
* @return mixed
|
|
|
556 |
*/
|
557 |
protected function _get_course_column_title() {
|
558 |
global $post_type;
|
@@ -621,18 +733,6 @@ abstract class LP_Abstract_Post_Type {
|
|
621 |
return $fields;
|
622 |
}
|
623 |
|
624 |
-
public function posts_join_paged( $join ) {
|
625 |
-
return $join;
|
626 |
-
}
|
627 |
-
|
628 |
-
public function posts_where_paged( $where ) {
|
629 |
-
return $where;
|
630 |
-
}
|
631 |
-
|
632 |
-
public function posts_orderby( $orderby ) {
|
633 |
-
return $orderby;
|
634 |
-
}
|
635 |
-
|
636 |
/**
|
637 |
* Get sortable columns for list table
|
638 |
*
|
@@ -655,31 +755,37 @@ abstract class LP_Abstract_Post_Type {
|
|
655 |
*
|
656 |
* @return string
|
657 |
*/
|
658 |
-
|
659 |
return LP_Request::get( 's' );
|
660 |
}
|
661 |
|
662 |
/**
|
663 |
* @return string
|
664 |
*/
|
665 |
-
|
666 |
return strtolower( LP_Request::get( 'order' ) ) === 'desc' ? 'DESC' : 'ASC';
|
667 |
}
|
668 |
|
669 |
/**
|
670 |
* @return mixed
|
671 |
*/
|
672 |
-
|
673 |
return LP_Request::get( 'orderby' );
|
674 |
}
|
675 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
public function _post_row_actions( $actions, $post ) {
|
677 |
if ( ! $this->_check_post() ) {
|
678 |
return $actions;
|
679 |
}
|
680 |
-
$func_args = func_get_args();
|
681 |
|
682 |
-
return $this->
|
683 |
}
|
684 |
|
685 |
public function row_actions( $actions, $post ) {
|
@@ -690,29 +796,39 @@ abstract class LP_Abstract_Post_Type {
|
|
690 |
* Those functions should be extended from child class to override
|
691 |
*
|
692 |
* @return mixed
|
|
|
|
|
693 |
*/
|
694 |
-
|
695 |
-
public function register_post_type() {
|
696 |
return $this;
|
697 |
-
}
|
698 |
|
699 |
-
|
|
|
700 |
return $this;
|
701 |
-
}
|
702 |
|
703 |
-
|
|
|
704 |
return $this;
|
705 |
-
}
|
706 |
|
707 |
-
|
|
|
708 |
return $this;
|
709 |
-
}
|
710 |
|
711 |
-
|
|
|
712 |
return $this;
|
713 |
-
}
|
714 |
|
715 |
-
|
|
|
|
|
|
|
|
|
|
|
716 |
if ( $single ) {
|
717 |
$this->_map_methods[ $origin ] = $replace;
|
718 |
} else {
|
@@ -724,9 +840,15 @@ abstract class LP_Abstract_Post_Type {
|
|
724 |
}
|
725 |
|
726 |
return $this;
|
727 |
-
}
|
728 |
|
729 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
if ( ! empty( $this->_map_methods[ $origin ] ) ) {
|
731 |
if ( is_array( $this->_map_methods[ $origin ] ) ) {
|
732 |
$callback = array();
|
@@ -741,9 +863,15 @@ abstract class LP_Abstract_Post_Type {
|
|
741 |
}
|
742 |
|
743 |
return $callback;
|
744 |
-
}
|
745 |
|
746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
$callbacks = $this->_get_map_method( $name );
|
748 |
if ( is_array( $callbacks[0] ) ) {
|
749 |
$return = array();
|
@@ -756,7 +884,7 @@ abstract class LP_Abstract_Post_Type {
|
|
756 |
}
|
757 |
|
758 |
return $return;
|
759 |
-
}
|
760 |
|
761 |
public function updated_messages( $messages ) {
|
762 |
$post = get_post();
|
@@ -815,49 +943,63 @@ abstract class LP_Abstract_Post_Type {
|
|
815 |
|
816 |
return $messages;
|
817 |
}
|
818 |
-
}
|
819 |
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
*
|
824 |
-
* @return string
|
825 |
-
*/
|
826 |
-
protected function _get_search() {
|
827 |
-
return LP_Request::get( 's' );
|
828 |
}
|
829 |
-
|
830 |
-
|
831 |
-
* @return string
|
832 |
-
*/
|
833 |
-
protected function _get_order() {
|
834 |
-
return strtolower( LP_Request::get( 'order' ) ) === 'desc' ? 'DESC' : 'ASC';
|
835 |
-
}
|
836 |
-
|
837 |
-
/**
|
838 |
-
* @return mixed
|
839 |
-
*/
|
840 |
-
protected function _get_orderby() {
|
841 |
-
return LP_Request::get( 'orderby' );
|
842 |
}
|
|
|
843 |
|
844 |
-
|
845 |
-
* Return TRUE if this post-type is support Gutenberg editor.
|
846 |
-
*
|
847 |
-
* @since 3.3.0
|
848 |
-
*
|
849 |
-
* @return bool
|
850 |
-
*/
|
851 |
-
public function is_support_gutenberg() {
|
852 |
-
$post_types = array(
|
853 |
-
LP_COURSE_CPT => LP()->settings()->get( 'enable_gutenberg_course' ),
|
854 |
-
LP_LESSON_CPT => LP()->settings()->get( 'enable_gutenberg_lesson' ),
|
855 |
-
LP_QUIZ_CPT => LP()->settings()->get( 'enable_gutenberg_quiz' ),
|
856 |
-
LP_QUESTION_CPT => LP()->settings()->get( 'enable_gutenberg_question' ),
|
857 |
-
);
|
858 |
|
859 |
-
|
860 |
-
|
861 |
-
return apply_filters( 'learn-press/custom-post-support-gutenberg', $support, $this->get_post_type() );
|
862 |
-
}
|
863 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
*
|
50 |
* @var array
|
51 |
*/
|
52 |
+
//protected $_map_methods = array();
|
53 |
|
54 |
/**
|
55 |
* @var array
|
71 |
|
72 |
$this->_post_type = $post_type;
|
73 |
add_action( 'init', array( $this, '_do_register' ) );
|
74 |
+
add_action( 'save_post', array( $this, '_do_save_post' ), 10, 2 );
|
75 |
add_action( 'before_delete_post', array( $this, '_before_delete_post' ) );
|
76 |
add_action( 'deleted_post', array( $this, '_deleted_post' ) );
|
77 |
|
84 |
add_filter( 'posts_where_paged', array( $this, '_posts_where_paged' ) );
|
85 |
add_filter( 'posts_orderby', array( $this, '_posts_orderby' ) );
|
86 |
|
87 |
+
// Show actions link on list post admin.
|
88 |
add_filter( 'post_row_actions', array( $this, '_post_row_actions' ), 10, 2 );
|
89 |
|
90 |
+
//Todo: Nhamdv see to rewrite
|
91 |
add_action( 'load-post.php', array( $this, 'add_meta_boxes' ), 0 );
|
92 |
add_action( 'load-post-new.php', array( $this, 'add_meta_boxes' ), 0 );
|
93 |
+
//End
|
94 |
+
|
95 |
+
// Comment by tungnx
|
96 |
+
//add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
|
97 |
+
//add_action( 'admin_enqueue_scripts', array( $this, 'admin_styles' ) );
|
98 |
+
|
99 |
+
// Comment by tungnx
|
100 |
+
//add_action( 'admin_footer-post.php', array( $this, 'print_js_template' ) );
|
101 |
+
//add_action( 'admin_footer-post-new.php', array( $this, 'print_js_template' ) );
|
102 |
+
|
103 |
+
// Comment by tungnx - not use
|
104 |
+
//add_action( 'pre_get_posts', array( $this, 'update_default_meta' ) );
|
105 |
add_action( 'admin_footer', array( $this, 'admin_footer_scripts' ) );
|
106 |
|
107 |
add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
|
118 |
add_action( 'admin_print_scripts', array( $this, 'remove_auto_save_script' ) );
|
119 |
}
|
120 |
|
121 |
+
/*if ( $args['default_meta'] ) {
|
122 |
$this->_default_metas = $args['default_meta'];
|
123 |
+
}*/
|
124 |
+
|
125 |
+
// Comment by tungnx
|
126 |
+
//add_action( 'init', array( $this, 'maybe_remove_features' ), 1000 );
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* This function is invoked along with 'init' action to register
|
131 |
+
* new post type with WP.
|
132 |
+
*
|
133 |
+
* @editor tungnx
|
134 |
+
* @since modify 4.1.0
|
135 |
+
*/
|
136 |
+
public function _do_register() {
|
137 |
+
$args = $this->args_register_post_type();
|
138 |
+
|
139 |
+
/*
|
140 |
+
* Todo: This is function old, still has on some addons, so need replace "register" function to args_register_post_type
|
141 |
+
* When replace all will delete this function - long ago will delete, for some user didn't updated new addon version fix
|
142 |
+
*/
|
143 |
+
if ( method_exists( $this, 'register' ) ) {
|
144 |
+
$args = $this->register();
|
145 |
+
}
|
146 |
+
|
147 |
+
if ( $args ) {
|
148 |
+
register_post_type( $this->_post_type, $args );
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Args to register custom post type.
|
154 |
+
*
|
155 |
+
* @return array
|
156 |
+
*/
|
157 |
+
public function args_register_post_type() : array {
|
158 |
+
return array();
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Hook save post of WP
|
163 |
+
*
|
164 |
+
* In child-class use function save()
|
165 |
+
*
|
166 |
+
* @param int $post_id
|
167 |
+
* @param WP_Post $post
|
168 |
+
* @editor tungnx
|
169 |
+
* @since modify 4.0.9
|
170 |
+
*/
|
171 |
+
final function _do_save_post( int $post_id = 0, WP_Post $post = null ) {
|
172 |
+
// Maybe remove
|
173 |
+
$this->maybe_remove_assigned( $post );
|
174 |
+
|
175 |
+
if ( ! $this->_check_post() ) {
|
176 |
+
return;
|
177 |
}
|
178 |
|
179 |
+
// prevent loop action
|
180 |
+
//remove_action( 'save_post', array( $this, '_do_save' ), 10, 2 );
|
181 |
+
//$func_args = func_get_args();
|
182 |
+
|
183 |
+
//var_dump($post_id, $post, $func_args);die;
|
184 |
+
|
185 |
+
//$this->_call_method( 'save', $func_args );
|
186 |
+
$this->save( $post_id, $post );
|
187 |
+
//$this->_flush_cache();
|
188 |
+
//add_action( 'save_post', array( $this, '_do_save' ), 10, 2 );
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Function for child class handle when post has just saved
|
193 |
+
*
|
194 |
+
* @editor tungnx
|
195 |
+
* @docs Class post type extend need override this function if want to handle when save
|
196 |
+
*/
|
197 |
+
public function save( int $post_id, WP_Post $post ) {
|
198 |
+
// Implement from child
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Hook before delete post
|
203 |
+
* Only on receiver 1 param $post_id, can't get param $post - don't know why
|
204 |
+
*
|
205 |
+
* @param int $post_id
|
206 |
+
*
|
207 |
+
* @editor tungnx
|
208 |
+
* @since modify 4.0.9
|
209 |
+
*/
|
210 |
+
final function _before_delete_post( int $post_id ) {
|
211 |
+
if ( ! $this->_check_post() ) {
|
212 |
+
return;
|
213 |
+
}
|
214 |
+
|
215 |
+
$this->before_delete( $post_id );
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Function for child class handle before post deleted
|
220 |
+
*
|
221 |
+
* @param int $post_id
|
222 |
+
* @editor tungnx
|
223 |
+
* @since modify 4.0.9
|
224 |
+
*/
|
225 |
+
public function before_delete( int $post_id ) {
|
226 |
+
// Implement from child
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Hook deleted post
|
231 |
+
*
|
232 |
+
* @param int $post_id
|
233 |
+
*/
|
234 |
+
final function _deleted_post( int $post_id ) {
|
235 |
+
if ( ! $this->_check_post() ) {
|
236 |
+
return;
|
237 |
+
}
|
238 |
+
|
239 |
+
$this->deleted_post( $post_id );
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Function for child class handle when post has just deleted
|
244 |
+
*
|
245 |
+
* @editor tungnx
|
246 |
+
* @docs Class post type extend need override this function if want to handle when post deleted
|
247 |
+
*/
|
248 |
+
public function deleted_post( int $post_id ) {
|
249 |
+
// Implement from child
|
250 |
}
|
251 |
|
252 |
public function column_instructor( $post_id = 0 ) {
|
284 |
return;
|
285 |
}
|
286 |
|
287 |
+
// Comment by tungnx - not use on here, wrote on js
|
288 |
+
/*if ( $pagenow === 'edit.php' ) {
|
289 |
$option = sprintf( '<option value="">%s</option>', __( 'Search by user', 'learnpress' ) );
|
290 |
$user = get_user_by( 'id', LP_Request::get_int( 'author' ) );
|
291 |
|
292 |
if ( $user ) {
|
293 |
$option = sprintf( '<option value="%d" selected="selected">%s</option>', $user->ID, $user->user_login );
|
294 |
}
|
295 |
+
}*/
|
296 |
|
297 |
+
// Todo: write this code on file js
|
298 |
if ( $pagenow === 'post.php' ) {
|
299 |
?>
|
300 |
<script>
|
357 |
return 0;
|
358 |
}
|
359 |
|
360 |
+
// Comment by tungnx - no see use
|
361 |
+
/*public function maybe_remove_features() {
|
362 |
if ( ! $this->_remove_features ) {
|
363 |
return;
|
364 |
}
|
366 |
foreach ( $this->_remove_features as $feature ) {
|
367 |
remove_post_type_support( $this->_post_type, $feature );
|
368 |
}
|
369 |
+
}*/
|
370 |
|
371 |
+
// Comment by tungnx - no see use
|
372 |
+
/*public function remove_feature( $feature ) {
|
373 |
if ( is_array( $feature ) ) {
|
374 |
foreach ( $feature as $fea ) {
|
375 |
$this->remove_feature( $fea );
|
377 |
} else {
|
378 |
$this->_remove_features[] = $feature;
|
379 |
}
|
380 |
+
}*/
|
381 |
|
382 |
+
// Comment by tungnx - not use
|
383 |
+
/*public function update_default_meta() {
|
384 |
global $wp_query, $post;
|
385 |
|
386 |
if ( ! $post ) {
|
404 |
update_post_meta( $post->ID, $k, $v );
|
405 |
}
|
406 |
}
|
407 |
+
}*/
|
408 |
|
409 |
public function remove_auto_save_script() {
|
410 |
global $post;
|
415 |
}
|
416 |
|
417 |
/**
|
418 |
+
* Maybe remove assigned item
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
*
|
420 |
+
* @param WP_Post $post
|
421 |
+
* @editor tungnx
|
422 |
+
* @todo Review and move to place correct
|
423 |
*/
|
424 |
+
public function maybe_remove_assigned( WP_Post $post ) {
|
425 |
+
global $wpdb;
|
|
|
426 |
|
427 |
+
if ( ! $post ) {
|
428 |
+
return;
|
429 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
|
431 |
+
$post_type = $post->post_type;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
$post_status = $post->post_status;
|
433 |
|
434 |
// If we are updating question
|
440 |
"
|
441 |
DELETE FROM {$wpdb->learnpress_quiz_questions}
|
442 |
WHERE question_id = %d
|
443 |
+
",
|
444 |
+
$post->ID
|
445 |
);
|
446 |
$wpdb->query( $query );
|
447 |
}
|
453 |
"
|
454 |
DELETE FROM {$wpdb->learnpress_section_items}
|
455 |
WHERE item_id = %d
|
456 |
+
",
|
457 |
+
$post->ID
|
458 |
);
|
459 |
$wpdb->query( $query );
|
460 |
}
|
515 |
}
|
516 |
}
|
517 |
|
518 |
+
/**
|
519 |
+
* @editor tungnx
|
520 |
+
* @reason not use
|
521 |
+
*/
|
522 |
+
/*private function _is_archive() {
|
523 |
global $pagenow, $post_type;
|
524 |
if ( ! is_admin() || ( $pagenow != 'edit.php' ) || ( $this->_post_type != LP_Request::get_string( 'post_type' ) ) ) {
|
525 |
return false;
|
526 |
}
|
527 |
|
528 |
return true;
|
529 |
+
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
530 |
|
531 |
protected function _flush_cache() {
|
532 |
+
//LP_Hard_Cache::flush();
|
533 |
+
//wp_cache_flush();
|
534 |
}
|
535 |
|
536 |
public function _posts_fields( $fields ) {
|
549 |
return $this->posts_join_paged( $join );
|
550 |
}
|
551 |
|
552 |
+
public function posts_join_paged( $join ) {
|
553 |
+
return $join;
|
554 |
+
}
|
555 |
+
|
556 |
public function _posts_where_paged( $where ) {
|
557 |
if ( ! $this->_check_post() ) {
|
558 |
return $where;
|
561 |
return $this->posts_where_paged( $where );
|
562 |
}
|
563 |
|
564 |
+
public function posts_where_paged( $where ) {
|
565 |
+
return $where;
|
566 |
+
}
|
567 |
+
|
568 |
public function _posts_orderby( $orderby ) {
|
569 |
if ( ! $this->_check_post() ) {
|
570 |
return $orderby;
|
573 |
return $this->posts_orderby( $orderby );
|
574 |
}
|
575 |
|
576 |
+
public function posts_orderby( $orderby ) {
|
577 |
+
return $orderby;
|
578 |
+
}
|
579 |
+
|
580 |
+
/**
|
581 |
+
* Check post valid
|
582 |
+
*
|
583 |
+
* @return bool
|
584 |
+
*/
|
585 |
+
public function _check_post():bool {
|
586 |
global $pagenow, $post_type;
|
587 |
|
588 |
if ( ! is_admin() || ( ! in_array( $pagenow, array( 'edit.php', 'post.php' ) ) ) || ( $this->_post_type != $post_type ) ) {
|
592 |
return true;
|
593 |
}
|
594 |
|
595 |
+
/**
|
596 |
+
* Check is page list posts valid
|
597 |
+
*
|
598 |
+
* @return bool
|
599 |
+
*/
|
600 |
+
protected function is_page_list_posts_on_backend():bool {
|
601 |
+
global $pagenow, $post_type;
|
602 |
+
|
603 |
+
if ( ! is_admin() || $pagenow != 'edit.php' || ( $this->_post_type != $post_type ) ) {
|
604 |
+
return false;
|
605 |
+
}
|
606 |
+
|
607 |
+
return true;
|
608 |
+
}
|
609 |
+
|
610 |
public function add_meta_box( $id, $title, $callback = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
|
611 |
$this->_meta_boxes[ $id ] = func_get_args();
|
612 |
|
613 |
return $this;
|
614 |
}
|
615 |
|
|
|
|
|
|
|
|
|
616 |
public function add_meta_boxes() {
|
617 |
if ( $this->_post_type != learn_press_get_requested_post_type() ) {
|
618 |
return;
|
641 |
|
642 |
}
|
643 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
/**
|
645 |
* Filter item by the course selected.
|
646 |
*
|
647 |
* @since 3.0.7
|
648 |
*
|
649 |
* @return bool|int
|
650 |
+
* @Todo move to course LP_Course_Post_Type
|
651 |
*/
|
652 |
protected function _filter_items_by_course() {
|
653 |
$course_id = ! empty( $_REQUEST['course'] ) ? absint( $_REQUEST['course'] ) : false;
|
664 |
|
665 |
/**
|
666 |
* @return mixed
|
667 |
+
* @Todo move to course LP_Course_Post_Type
|
668 |
*/
|
669 |
protected function _get_course_column_title() {
|
670 |
global $post_type;
|
733 |
return $fields;
|
734 |
}
|
735 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
/**
|
737 |
* Get sortable columns for list table
|
738 |
*
|
755 |
*
|
756 |
* @return string
|
757 |
*/
|
758 |
+
protected function get_search(): string {
|
759 |
return LP_Request::get( 's' );
|
760 |
}
|
761 |
|
762 |
/**
|
763 |
* @return string
|
764 |
*/
|
765 |
+
protected function get_order_sort(): string {
|
766 |
return strtolower( LP_Request::get( 'order' ) ) === 'desc' ? 'DESC' : 'ASC';
|
767 |
}
|
768 |
|
769 |
/**
|
770 |
* @return mixed
|
771 |
*/
|
772 |
+
protected function get_order_by(): string {
|
773 |
return LP_Request::get( 'orderby' );
|
774 |
}
|
775 |
|
776 |
+
/**
|
777 |
+
* Show actions on list post
|
778 |
+
*
|
779 |
+
* @param string[] $actions
|
780 |
+
* @param WP_Post $post
|
781 |
+
* @return array|false|mixed
|
782 |
+
*/
|
783 |
public function _post_row_actions( $actions, $post ) {
|
784 |
if ( ! $this->_check_post() ) {
|
785 |
return $actions;
|
786 |
}
|
|
|
787 |
|
788 |
+
return $this->row_actions( $actions, $post );
|
789 |
}
|
790 |
|
791 |
public function row_actions( $actions, $post ) {
|
796 |
* Those functions should be extended from child class to override
|
797 |
*
|
798 |
* @return mixed
|
799 |
+
* @editor tungnx
|
800 |
+
* @reason not use
|
801 |
*/
|
802 |
+
/*public function register_post_type() {
|
|
|
803 |
return $this;
|
804 |
+
}*/
|
805 |
|
806 |
+
// Comment by tungnx - not use
|
807 |
+
/*public function admin_params() {
|
808 |
return $this;
|
809 |
+
}*/
|
810 |
|
811 |
+
// Comment by tungnx - not use
|
812 |
+
/*public function admin_scripts() {
|
813 |
return $this;
|
814 |
+
}*/
|
815 |
|
816 |
+
// Comment by tungnx - not use
|
817 |
+
/*public function admin_styles() {
|
818 |
return $this;
|
819 |
+
}*/
|
820 |
|
821 |
+
// Comment by tungnx
|
822 |
+
/*public function print_js_template() {
|
823 |
return $this;
|
824 |
+
}*/
|
825 |
|
826 |
+
/**
|
827 |
+
* @editor tungnx
|
828 |
+
* @reason comment by write difficult for another developer, difficult development
|
829 |
+
* @since modify 4.0.9
|
830 |
+
*/
|
831 |
+
/*public function add_map_method( $origin, $replace, $single = false ) {
|
832 |
if ( $single ) {
|
833 |
$this->_map_methods[ $origin ] = $replace;
|
834 |
} else {
|
840 |
}
|
841 |
|
842 |
return $this;
|
843 |
+
}*/
|
844 |
|
845 |
+
/**
|
846 |
+
* @editor tungnx
|
847 |
+
* @reason comment by write difficult for another developer, difficult development
|
848 |
+
* @param $messages
|
849 |
+
* @return array|mixed
|
850 |
+
*/
|
851 |
+
/*private function _get_map_method( $origin ) {
|
852 |
if ( ! empty( $this->_map_methods[ $origin ] ) ) {
|
853 |
if ( is_array( $this->_map_methods[ $origin ] ) ) {
|
854 |
$callback = array();
|
863 |
}
|
864 |
|
865 |
return $callback;
|
866 |
+
}*/
|
867 |
|
868 |
+
/**
|
869 |
+
* @editor tungnx
|
870 |
+
* @reason comment by write difficult for another developer, difficult development
|
871 |
+
* @param $messages
|
872 |
+
* @return array|mixed
|
873 |
+
*/
|
874 |
+
/*private function _call_method( $name, $args = false ) {
|
875 |
$callbacks = $this->_get_map_method( $name );
|
876 |
if ( is_array( $callbacks[0] ) ) {
|
877 |
$return = array();
|
884 |
}
|
885 |
|
886 |
return $return;
|
887 |
+
}*/
|
888 |
|
889 |
public function updated_messages( $messages ) {
|
890 |
$post = get_post();
|
943 |
|
944 |
return $messages;
|
945 |
}
|
|
|
946 |
|
947 |
+
// Deprecated functions
|
948 |
+
/*private function _get_orderby() {
|
949 |
+
_deprecated_function( __FUNCTION__, '4.1.0' );
|
|
|
|
|
|
|
|
|
|
|
950 |
}
|
951 |
+
public function _get_search(): string {
|
952 |
+
return LP_Request::get( 's' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
953 |
}
|
954 |
+
protected function _get_order(): string {
|
955 |
|
956 |
+
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
957 |
|
958 |
+
// End deprecated
|
|
|
|
|
|
|
959 |
}
|
960 |
+
|
961 |
+
// Comment by tungnx - not use
|
962 |
+
//class LP_Abstract_Post_Type_Core extends LP_Abstract_Post_Type {
|
963 |
+
// /**
|
964 |
+
// * Get string for searching
|
965 |
+
// *
|
966 |
+
// * @return string
|
967 |
+
// */
|
968 |
+
// protected function _get_search() {
|
969 |
+
// return LP_Request::get( 's' );
|
970 |
+
// }
|
971 |
+
//
|
972 |
+
// /**
|
973 |
+
// * @return string
|
974 |
+
// */
|
975 |
+
// protected function _get_order() {
|
976 |
+
// return strtolower( LP_Request::get( 'order' ) ) === 'desc' ? 'DESC' : 'ASC';
|
977 |
+
// }
|
978 |
+
//
|
979 |
+
// /**
|
980 |
+
// * @return mixed
|
981 |
+
// */
|
982 |
+
// protected function _get_orderby() {
|
983 |
+
// return LP_Request::get( 'orderby' );
|
984 |
+
// }
|
985 |
+
//
|
986 |
+
// /**
|
987 |
+
// * Return TRUE if this post-type is support Gutenberg editor.
|
988 |
+
// *
|
989 |
+
// * @since 3.3.0
|
990 |
+
// *
|
991 |
+
// * @return bool
|
992 |
+
// */
|
993 |
+
// public function is_support_gutenberg() {
|
994 |
+
// $post_types = array(
|
995 |
+
// LP_COURSE_CPT => LP()->settings()->get( 'enable_gutenberg_course' ),
|
996 |
+
// LP_LESSON_CPT => LP()->settings()->get( 'enable_gutenberg_lesson' ),
|
997 |
+
// LP_QUIZ_CPT => LP()->settings()->get( 'enable_gutenberg_quiz' ),
|
998 |
+
// LP_QUESTION_CPT => LP()->settings()->get( 'enable_gutenberg_question' ),
|
999 |
+
// );
|
1000 |
+
//
|
1001 |
+
// $support = $post_types[ $this->_post_type ] === 'yes' ? true : false;
|
1002 |
+
//
|
1003 |
+
// return apply_filters( 'learn-press/custom-post-support-gutenberg', $support, $this->get_post_type() );
|
1004 |
+
// }
|
1005 |
+
//}
|
@@ -14,18 +14,16 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
14 |
/**
|
15 |
* Class LP_Course_Post_Type
|
16 |
*/
|
17 |
-
final class LP_Course_Post_Type extends
|
18 |
/**
|
19 |
-
*
|
20 |
-
*
|
21 |
-
* @var bool
|
22 |
*/
|
23 |
-
protected static $
|
24 |
|
25 |
/**
|
26 |
-
* @var
|
27 |
*/
|
28 |
-
protected
|
29 |
|
30 |
/**
|
31 |
* Constructor
|
@@ -35,16 +33,12 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
35 |
public function __construct( $post_type ) {
|
36 |
parent::__construct( $post_type );
|
37 |
|
38 |
-
// Map origin methods to another method
|
39 |
-
$this
|
40 |
-
->add_map_method( 'save', 'before_save_curriculum', false )
|
41 |
-
->add_map_method( 'before_delete', 'before_delete_course' );
|
42 |
-
|
43 |
add_action( 'init', array( $this, 'register_taxonomy' ) );
|
44 |
add_filter( 'posts_where_paged', array( $this, '_posts_where_paged_course_items' ), 10 );
|
45 |
add_filter( 'posts_join_paged', array( $this, '_posts_join_paged_course_items' ), 10 );
|
46 |
|
47 |
-
|
|
|
48 |
add_action( 'admin_enqueue_scripts', array( $this, 'add_script_data' ) );
|
49 |
}
|
50 |
|
@@ -105,7 +99,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
105 |
/**
|
106 |
* Register course post type.
|
107 |
*/
|
108 |
-
public function
|
109 |
$settings = LP_Settings::instance();
|
110 |
$labels = array(
|
111 |
'name' => _x( 'Courses', 'Post Type General Name', 'learnpress' ),
|
@@ -136,12 +130,12 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
136 |
'publicly_queryable' => true,
|
137 |
'show_ui' => true,
|
138 |
'has_archive' => $has_archive,
|
139 |
-
'capability_type' =>
|
140 |
'map_meta_cap' => true,
|
141 |
'show_in_menu' => 'learn_press',
|
142 |
'show_in_admin_bar' => true,
|
143 |
'show_in_nav_menus' => true,
|
144 |
-
'show_in_rest' =>
|
145 |
'taxonomies' => array( 'course_category', 'course_tag' ),
|
146 |
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments', 'excerpt' ),
|
147 |
'hierarchical' => false,
|
@@ -183,7 +177,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
183 |
'show_admin_column' => true,
|
184 |
'show_in_admin_bar' => true,
|
185 |
'show_in_nav_menus' => true,
|
186 |
-
'show_in_rest' =>
|
187 |
'rewrite' => array(
|
188 |
'slug' => empty( $category_base ) ? _x( 'course-category', 'slug', 'learnpress' ) : $category_base,
|
189 |
'hierarchical' => true,
|
@@ -221,7 +215,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
221 |
'show_in_menu' => 'learn_press',
|
222 |
'update_count_callback' => '_update_post_term_count',
|
223 |
'query_var' => true,
|
224 |
-
'show_in_rest' =>
|
225 |
'rewrite' => array(
|
226 |
'slug' => empty( $tag_base ) ? _x( 'course-tag', 'slug', 'learnpress' ) : $tag_base,
|
227 |
'with_front' => false,
|
@@ -234,22 +228,25 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
|
|
234 |
* Load data for course editor.
|
235 |
*
|
236 |
* @since 3.0.0
|
|
|
|
|
237 |
*/
|
238 |
-
public function data_course_editor() {
|
239 |
if ( LP_COURSE_CPT !== get_post_type() ) {
|
240 |
return;
|
241 |
}
|
242 |
|
243 |
-
}
|
244 |
|
245 |
/**
|
246 |
* Delete course sections before delete course.
|
247 |
*
|
248 |
-
* @param $post_id
|
249 |
-
*
|
250 |
* @since 3.0.0
|
|
14 |
/**
|
15 |
* Class LP_Course_Post_Type
|
16 |
*/
|
17 |
+
final class LP_Course_Post_Type extends LP_Abstract_Post_Type {
|
18 |
/**
|
19 |
+
* @var null
|
|
|
|
|
20 |
*/
|
21 |
+
protected static $_instance = null;
|
22 |
|
23 |
/**
|
24 |
+
* @var string
|
25 |
*/
|
26 |
+
protected $_post_type = LP_COURSE_CPT;
|
27 |
|
28 |
/**
|
29 |
* Constructor
|
33 |
public function __construct( $post_type ) {
|
34 |
parent::__construct( $post_type );
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
add_action( 'init', array( $this, 'register_taxonomy' ) );
|
37 |
add_filter( 'posts_where_paged', array( $this, '_posts_where_paged_course_items' ), 10 );
|
38 |
add_filter( 'posts_join_paged', array( $this, '_posts_join_paged_course_items' ), 10 );
|
39 |
|
40 |
+
// Comment by tungnx
|
41 |
+
//add_action( 'learn-press/admin/after-enqueue-scripts', array( $this, 'data_course_editor' ) );
|
42 |
add_action( 'admin_enqueue_scripts', array( $this, 'add_script_data' ) );
|
43 |
}
|
44 |
|
99 |
/**
|
100 |
* Register course post type.
|
101 |
*/
|
102 |
+
public function args_register_post_type() : array {
|
103 |
$settings = LP_Settings::instance();
|
104 |
$labels = array(
|
105 |
'name' => _x( 'Courses', 'Post Type General Name', 'learnpress' ),
|
130 |
'publicly_queryable' => true,
|
131 |
'show_ui' => true,
|
132 |
'has_archive' => $has_archive,
|
133 |
+
'capability_type' => $this->_post_type,
|
134 |
'map_meta_cap' => true,
|
135 |
'show_in_menu' => 'learn_press',
|
136 |
'show_in_admin_bar' => true,
|
137 |
'show_in_nav_menus' => true,
|
138 |
+
'show_in_rest' => true,
|
139 |
'taxonomies' => array( 'course_category', 'course_tag' ),
|
140 |
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments', 'excerpt' ),
|
141 |
'hierarchical' => false,
|
177 |
'show_admin_column' => true,
|
178 |
'show_in_admin_bar' => true,
|
179 |
'show_in_nav_menus' => true,
|
180 |
+
'show_in_rest' => true,
|
181 |
'rewrite' => array(
|
182 |
'slug' => empty( $category_base ) ? _x( 'course-category', 'slug', 'learnpress' ) : $category_base,
|
183 |
'hierarchical' => true,
|
215 |
'show_in_menu' => 'learn_press',
|
216 |
'update_count_callback' => '_update_post_term_count',
|
217 |
'query_var' => true,
|
218 |
+
'show_in_rest' => true,
|
219 |
'rewrite' => array(
|
220 |
'slug' => empty( $tag_base ) ? _x( 'course-tag', 'slug', 'learnpress' ) : $tag_base,
|
221 |
'with_front' => false,
|
228 |
* Load data for course editor.
|
229 |
*
|
230 |
* @since 3.0.0
|
231 |
+
* @editor tungnx
|
232 |
+
* @reason not use
|
233 |
*/
|
234 |
+
/*public function data_course_editor() {
|
235 |
if ( LP_COURSE_CPT !== get_post_type() ) {
|
236 |
return;
|
237 |
}
|
238 |
|
239 |
+
}*/
|
240 |
|
241 |
/**
|
242 |
* Delete course sections before delete course.
|
243 |
*
|
244 |
+
* @param int $post_id
|
|
|
245 |
* @since 3.0.0
|
246 |
+
* @edito
|