PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7.3
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7.3
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / js / dist / admin / editor / course.js

course.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7.3, at assets/js/dist/admin/editor/course.js

1,057 lines 32.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (function() { // webpackBootstrap
2 /******/ "use strict";
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "./assets/src/apps/js/admin/editor/actions/course-section.js":
6 /*!*******************************************************************!*\
7 !*** ./assets/src/apps/js/admin/editor/actions/course-section.js ***!
8 \*******************************************************************/
9 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10
11 __webpack_require__.r(__webpack_exports__);
12 const $ = window.jQuery || jQuery;
13 const CourseCurriculum = {
14 toggleAllSections(context) {
15 const hidden = context.getters.isHiddenAllSections;
16
17 if (hidden) {
18 context.commit('OPEN_ALL_SECTIONS');
19 } else {
20 context.commit('CLOSE_ALL_SECTIONS');
21 }
22
23 LP.Request({
24 type: 'hidden-sections',
25 hidden: context.getters.hiddenSections
26 });
27 },
28
29 updateSectionsOrder(context, order) {
30 LP.Request({
31 type: 'sort-sections',
32 order: JSON.stringify(order)
33 }).then(function (response) {
34 const result = response.body;
35 const order_sections = result.data;
36 context.commit('SORT_SECTION', order_sections);
37 }, function (error) {
38 console.error(error);
39 });
40 },
41
42 toggleSection(context, section) {
43 if (section.open) {
44 context.commit('CLOSE_SECTION', section);
45 } else {
46 context.commit('OPEN_SECTION', section);
47 }
48
49 LP.Request({
50 type: 'hidden-sections',
51 hidden: context.getters.hiddenSections
52 });
53 },
54
55 updateSection(context, section) {
56 context.commit('UPDATE_SECTION_REQUEST', section.id);
57 LP.Request({
58 type: 'update-section',
59 section: JSON.stringify(section)
60 }).then(function () {
61 context.commit('UPDATE_SECTION_SUCCESS', section.id);
62 }).catch(function () {
63 context.commit('UPDATE_SECTION_FAILURE', section.id);
64 });
65 },
66
67 removeSection(context, payload) {
68 context.commit('REMOVE_SECTION', payload.index);
69 LP.Request({
70 type: 'remove-section',
71 section_id: payload.section.id
72 }).then(function (response) {
73 const result = response.body;
74 }, function (error) {
75 console.error(error);
76 });
77 },
78
79 newSection(context, name) {
80 const newSection = {
81 type: 'new-section',
82 section_name: name,
83 temp_id: LP.uniqueId()
84 };
85 context.commit('ADD_NEW_SECTION', {
86 id: newSection.temp_id,
87 items: [],
88 open: false,
89 title: newSection.section_name
90 });
91 LP.Request(newSection).then(function (response) {
92 const result = response.body;
93
94 if (result.success) {
95 const section = $.extend({}, result.data, {
96 open: true
97 });
98 context.commit('ADD_NEW_SECTION', section);
99 }
100 }, function (error) {
101 console.error(error);
102 });
103 },
104
105 updateSectionItem(context, payload) {
106 context.commit('UPDATE_SECTION_ITEM_REQUEST', payload.item.id);
107 LP.Request({
108 type: 'update-section-item',
109 section_id: payload.section_id,
110 item: JSON.stringify(payload.item)
111 }).then(function (response) {
112 context.commit('UPDATE_SECTION_ITEM_SUCCESS', payload.item.id);
113 const result = response.body;
114
115 if (result.success) {
116 const item = result.data;
117 context.commit('UPDATE_SECTION_ITEM', {
118 section_id: payload.section_id,
119 item
120 });
121 }
122 }, function (error) {
123 context.commit('UPDATE_SECTION_ITEM_FAILURE', payload.item.id);
124 console.error(error);
125 });
126 },
127
128 removeSectionItem(context, payload) {
129 const id = payload.item.id;
130 context.commit('REMOVE_SECTION_ITEM', payload);
131 payload.item.temp_id = 0;
132 LP.Request({
133 type: 'remove-section-item',
134 section_id: payload.section_id,
135 item_id: id
136 }).then(function (rs) {
137 const {
138 data,
139 success
140 } = rs.body;
141
142 if (success) {
143 context.commit('REMOVE_SECTION_ITEM', payload);
144 } else {
145 alert(data);
146 payload.oldId = id;
147 context.commit('REMOVE_SECTION_ITEM', payload);
148 }
149
150 context.commit('REMOVE_SECTION_ITEM', payload);
151 });
152 },
153
154 deleteSectionItem(context, payload) {
155 const id = payload.item.id;
156 context.commit('REMOVE_SECTION_ITEM', payload);
157 payload.item.temp_id = 0;
158 LP.Request({
159 type: 'delete-section-item',
160 section_id: payload.section_id,
161 item_id: id
162 }).then(function (rs) {
163 const {
164 data,
165 success
166 } = rs.body;
167
168 if (success) {
169 context.commit('REMOVE_SECTION_ITEM', payload);
170 } else {
171 alert(data);
172 payload.oldId = id;
173 context.commit('REMOVE_SECTION_ITEM', payload);
174 }
175 });
176 },
177
178 newSectionItem(context, payload) {
179 context.commit('APPEND_EMPTY_ITEM_TO_SECTION', payload); //context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
180
181 LP.Request({
182 type: 'new-section-item',
183 section_id: payload.section_id,
184 item: JSON.stringify(payload.item)
185 }).then(function (response) {
186 const result = response.body;
187
188 if (result.success) {
189 // context.commit('UPDATE_SECTION_ITEMS', {section_id: payload.section_id, items: result.data});
190 const items = {};
191 $.each(result.data, function (i, a) {
192 items[a.old_id ? a.old_id : a.id] = a;
193 });
194 context.commit('UPDATE_ITEM_SECTION_BY_ID', {
195 section_id: payload.section_id,
196 items
197 });
198 }
199 }, function (error) {
200 console.error(error);
201 });
202 },
203
204 updateSectionItems(_ref, payload) {
205 let {
206 state
207 } = _ref;
208 LP.Request({
209 type: 'update-section-items',
210 section_id: payload.section_id,
211 items: JSON.stringify(payload.items),
212 last_section: state.sections[state.sections.length - 1] === payload.section_id
213 }).then(function (response) {
214 const result = response.body;
215
216 if (result.success) {// console.log(result);
217 }
218 }, function (error) {
219 console.error(error);
220 });
221 }
222
223 };
224 /* harmony default export */ __webpack_exports__["default"] = (CourseCurriculum);
225
226 /***/ }),
227
228 /***/ "./assets/src/apps/js/admin/editor/actions/course.js":
229 /*!***********************************************************!*\
230 !*** ./assets/src/apps/js/admin/editor/actions/course.js ***!
231 \***********************************************************/
232 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
233
234 __webpack_require__.r(__webpack_exports__);
235 const Course = {
236 heartbeat: function (context) {
237 LP.Request({
238 type: 'heartbeat'
239 }).then(function (response) {
240 var result = response.body;
241 context.commit('UPDATE_HEART_BEAT', !!result.success);
242 }, function (error) {
243 context.commit('UPDATE_HEART_BEAT', false);
244 });
245 },
246 draftCourse: function (context, payload) {
247 var auto_draft = context.getters.autoDraft;
248
249 if (auto_draft) {
250 LP.Request({
251 type: 'draft-course',
252 course: JSON.stringify(payload)
253 }).then(function (response) {
254 var result = response.body;
255
256 if (!result.success) {
257 return;
258 }
259
260 context.commit('UPDATE_AUTO_DRAFT_STATUS', false);
261 });
262 }
263 },
264 newRequest: function (context) {
265 context.commit('INCREASE_NUMBER_REQUEST');
266 context.commit('UPDATE_STATUS', 'loading');
267
268 window.onbeforeunload = function () {
269 return '';
270 };
271 },
272 requestCompleted: function (context, status) {
273 context.commit('DECREASE_NUMBER_REQUEST');
274
275 if (context.getters.currentRequest === 0) {
276 context.commit('UPDATE_STATUS', status);
277 window.onbeforeunload = null;
278 }
279 }
280 };
281 /* harmony default export */ __webpack_exports__["default"] = (Course);
282
283 /***/ }),
284
285 /***/ "./assets/src/apps/js/admin/editor/actions/modal-course-items.js":
286 /*!***********************************************************************!*\
287 !*** ./assets/src/apps/js/admin/editor/actions/modal-course-items.js ***!
288 \***********************************************************************/
289 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
290
291 __webpack_require__.r(__webpack_exports__);
292 const ModalCourseItems = {
293 toggle: function (context) {
294 context.commit('TOGGLE');
295 },
296 open: function (context, sectionId) {
297 context.commit('SET_SECTION', sectionId);
298 context.commit('RESET');
299 context.commit('TOGGLE');
300 },
301 searchItems: function (context, payload) {
302 context.commit('SEARCH_ITEMS_REQUEST');
303 LP.Request({
304 type: 'search-items',
305 query: payload.query,
306 item_type: payload.type,
307 page: payload.page,
308 exclude: JSON.stringify([])
309 }).then(function (response) {
310 var result = response.body;
311
312 if (!result.success) {
313 return;
314 }
315
316 var data = result.data;
317 context.commit('SET_LIST_ITEMS', data.items);
318 context.commit('UPDATE_PAGINATION', data.pagination);
319 context.commit('SEARCH_ITEMS_SUCCESS');
320 }, function (error) {
321 context.commit('SEARCH_ITEMS_FAILURE');
322 console.error(error);
323 });
324 },
325 addItem: function (context, item) {
326 context.commit('ADD_ITEM', item);
327 },
328 removeItem: function (context, index) {
329 context.commit('REMOVE_ADDED_ITEM', index);
330 },
331 addItemsToSection: function (context) {
332 var items = context.getters.addedItems;
333
334 if (items.length > 0) {
335 LP.Request({
336 type: 'add-items-to-section',
337 section_id: context.getters.section,
338 items: JSON.stringify(items)
339 }).then(function (response) {
340 var result = response.body;
341
342 if (result.success) {
343 context.commit('TOGGLE');
344 var items = result.data;
345 context.commit('ss/UPDATE_SECTION_ITEMS', {
346 section_id: context.getters.section,
347 items: items
348 }, {
349 root: true
350 });
351 }
352 }, function (error) {
353 console.error(error);
354 });
355 }
356 }
357 };
358 /* harmony default export */ __webpack_exports__["default"] = (ModalCourseItems);
359
360 /***/ }),
361
362 /***/ "./assets/src/apps/js/admin/editor/getters/course-section.js":
363 /*!*******************************************************************!*\
364 !*** ./assets/src/apps/js/admin/editor/getters/course-section.js ***!
365 \*******************************************************************/
366 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
367
368 __webpack_require__.r(__webpack_exports__);
369 const CourseCurriculum = {
370 sections: function (state) {
371 return state.sections || [];
372 },
373 urlEdit: function (state) {
374 return state.urlEdit;
375 },
376 hiddenSections: function (state) {
377 return state.sections.filter(function (section) {
378 return !section.open;
379 }).map(function (section) {
380 return parseInt(section.id);
381 });
382 },
383 isHiddenAllSections: function (state, getters) {
384 var sections = getters.sections;
385 var hiddenSections = getters.hiddenSections;
386 return hiddenSections.length === sections.length;
387 },
388 statusUpdateSection: function (state) {
389 return state.statusUpdateSection;
390 },
391 statusUpdateSectionItem: function (state) {
392 return state.statusUpdateSectionItem;
393 }
394 };
395 /* harmony default export */ __webpack_exports__["default"] = (CourseCurriculum);
396
397 /***/ }),
398
399 /***/ "./assets/src/apps/js/admin/editor/getters/course.js":
400 /*!***********************************************************!*\
401 !*** ./assets/src/apps/js/admin/editor/getters/course.js ***!
402 \***********************************************************/
403 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
404
405 __webpack_require__.r(__webpack_exports__);
406 const Course = {
407 heartbeat: function (state) {
408 return state.heartbeat;
409 },
410 action: function (state) {
411 return state.action;
412 },
413 id: function (state) {
414 return state.course_id;
415 },
416 autoDraft: function (state) {
417 return state.auto_draft;
418 },
419 disable_curriculum: function (state) {
420 return state.disable_curriculum;
421 },
422 status: function (state) {
423 return state.status || 'error';
424 },
425 currentRequest: function (state) {
426 return state.countCurrentRequest || 0;
427 },
428 urlAjax: function (state) {
429 return state.ajax;
430 },
431 nonce: function (state) {
432 return state.nonce;
433 }
434 };
435 /* harmony default export */ __webpack_exports__["default"] = (Course);
436
437 /***/ }),
438
439 /***/ "./assets/src/apps/js/admin/editor/getters/modal-course-items.js":
440 /*!***********************************************************************!*\
441 !*** ./assets/src/apps/js/admin/editor/getters/modal-course-items.js ***!
442 \***********************************************************************/
443 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
444
445 __webpack_require__.r(__webpack_exports__);
446 const Getters = {
447 status: function (state) {
448 return state.status;
449 },
450 pagination: function (state) {
451 return state.pagination;
452 },
453 items: function (state, _getters) {
454 return state.items.map(function (item) {
455 var find = _getters.addedItems.find(function (_item) {
456 return item.id === _item.id;
457 });
458
459 item.added = !!find;
460 return item;
461 });
462 },
463 addedItems: function (state) {
464 return state.addedItems;
465 },
466 isOpen: function (state) {
467 return state.open;
468 },
469 types: function (state) {
470 return state.types;
471 },
472 section: function (state) {
473 return state.sectionId;
474 }
475 };
476 /* harmony default export */ __webpack_exports__["default"] = (Getters);
477
478 /***/ }),
479
480 /***/ "./assets/src/apps/js/admin/editor/http.js":
481 /*!*************************************************!*\
482 !*** ./assets/src/apps/js/admin/editor/http.js ***!
483 \*************************************************/
484 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
485
486 __webpack_require__.r(__webpack_exports__);
487 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
488 /* harmony export */ "default": function() { return /* binding */ HTTP; }
489 /* harmony export */ });
490 function HTTP(options) {
491 const $ = window.jQuery || jQuery;
492 const $VueHTTP = Vue.http;
493 options = $.extend({
494 ns: 'LPRequest',
495 store: false
496 }, options || {});
497 let $publishingAction = null;
498
499 LP.Request = function (payload) {
500 $publishingAction = $('#publishing-action');
501 payload.id = options.store.getters.id;
502 payload.nonce = options.store.getters.nonce;
503 payload['lp-ajax'] = options.store.getters.action;
504 payload.code = options.store.getters.code;
505 $publishingAction.find('#publish').addClass('disabled');
506 $publishingAction.find('.spinner').addClass('is-active');
507 $publishingAction.addClass('code-' + payload.code);
508 return $VueHTTP.post(options.store.getters.urlAjax, payload, {
509 emulateJSON: true,
510 params: {
511 namespace: options.ns,
512 code: payload.code
513 }
514 });
515 };
516
517 $VueHTTP.interceptors.push(function (request, next) {
518 if (request.params.namespace !== options.ns) {
519 next();
520 return;
521 }
522
523 options.store.dispatch('newRequest');
524 next(function (response) {
525 if (!jQuery.isPlainObject(response.body)) {
526 response.body = LP.parseJSON(response.body);
527 }
528
529 const body = response.body;
530 const result = body.success || false;
531
532 if (result) {
533 options.store.dispatch('requestCompleted', 'successful');
534 } else {
535 options.store.dispatch('requestCompleted', 'failed');
536 }
537
538 $publishingAction.removeClass('code-' + request.params.code);
539
540 if (!$publishingAction.attr('class')) {
541 $publishingAction.find('#publish').removeClass('disabled');
542 $publishingAction.find('.spinner').removeClass('is-active');
543 }
544 });
545 });
546 }
547
548 /***/ }),
549
550 /***/ "./assets/src/apps/js/admin/editor/mutations/course-section.js":
551 /*!*********************************************************************!*\
552 !*** ./assets/src/apps/js/admin/editor/mutations/course-section.js ***!
553 \*********************************************************************/
554 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
555
556 __webpack_require__.r(__webpack_exports__);
557 const CourseCurriculum = {
558 SORT_SECTION(state, orders) {
559 state.sections = state.sections.map(function (section) {
560 section.order = orders[section.id];
561 return section;
562 });
563 },
564
565 SET_SECTIONS(state, sections) {
566 state.sections = sections;
567 },
568
569 ADD_NEW_SECTION(state, newSection) {
570 if (newSection.open === undefined) {
571 newSection.open = true;
572 }
573
574 let pos;
575
576 if (newSection.temp_id) {
577 state.sections.map(function (section, i) {
578 if (newSection.temp_id == section.id) {
579 pos = i;
580 return false;
581 }
582 });
583 }
584
585 if (pos !== undefined) {
586 $Vue.set(state.sections, pos, newSection);
587 } else {
588 state.sections.push(newSection);
589 }
590 },
591
592 ADD_EMPTY_SECTION(state, section) {
593 section.open = true;
594 state.sections.push(section);
595 },
596
597 REMOVE_SECTION(state, index) {
598 state.sections.splice(index, 1);
599 },
600
601 REMOVE_SECTION_ITEM(state, payload) {
602 const section = state.sections.find(function (section) {
603 return section.id === payload.section_id;
604 });
605 let items = section.items || [],
606 item = payload.item,
607 index = -1;
608 items.forEach(function (it, i) {
609 if (it.id === item.id) {
610 index = i;
611 }
612 });
613
614 if (index !== -1) {
615 if (payload.oldId !== undefined) {
616 items[index].id = payload.oldId;
617 return;
618 }
619
620 if (item.temp_id) {
621 items[index].id = item.temp_id;
622 } else {
623 items.splice(index, 1);
624 }
625 }
626 },
627
628 UPDATE_SECTION_ITEMS(state, payload) {
629 const section = state.sections.find(function (section) {
630 return parseInt(section.id) === parseInt(payload.section_id);
631 });
632
633 if (!section) {
634 return;
635 }
636
637 section.items = payload.items;
638 },
639
640 UPDATE_SECTION_ITEM(state, payload) {},
641
642 CLOSE_SECTION(state, section) {
643 state.sections.forEach(function (_section, index) {
644 if (section.id === _section.id) {
645 state.sections[index].open = false;
646 }
647 });
648 },
649
650 OPEN_SECTION(state, section) {
651 state.sections.forEach(function (_section, index) {
652 if (section.id === _section.id) {
653 state.sections[index].open = true;
654 }
655 });
656 },
657
658 OPEN_ALL_SECTIONS(state) {
659 state.sections = state.sections.map(function (_section) {
660 _section.open = true;
661 return _section;
662 });
663 },
664
665 CLOSE_ALL_SECTIONS(state) {
666 state.sections = state.sections.map(function (_section) {
667 _section.open = false;
668 return _section;
669 });
670 },
671
672 UPDATE_SECTION_REQUEST(state, sectionId) {
673 $Vue.set(state.statusUpdateSection, sectionId, 'updating');
674 },
675
676 UPDATE_SECTION_SUCCESS(state, sectionId) {
677 $Vue.set(state.statusUpdateSection, sectionId, 'successful');
678 },
679
680 UPDATE_SECTION_FAILURE(state, sectionId) {
681 $Vue.set(state.statusUpdateSection, sectionId, 'failed');
682 },
683
684 UPDATE_SECTION_ITEM_REQUEST(state, itemId) {
685 $Vue.set(state.statusUpdateSectionItem, itemId, 'updating');
686 },
687
688 UPDATE_SECTION_ITEM_SUCCESS(state, itemId) {
689 $Vue.set(state.statusUpdateSectionItem, itemId, 'successful');
690 },
691
692 UPDATE_SECTION_ITEM_FAILURE(state, itemId) {
693 $Vue.set(state.statusUpdateSectionItem, itemId, 'failed');
694 },
695
696 APPEND_EMPTY_ITEM_TO_SECTION(state, data) {
697 const section = state.sections.find(function (section) {
698 return parseInt(section.id) === parseInt(data.section_id);
699 });
700
701 if (!section) {
702 return;
703 }
704
705 section.items.push({
706 id: data.item.id,
707 title: data.item.title,
708 type: 'empty-item'
709 });
710 },
711
712 UPDATE_ITEM_SECTION_BY_ID(state, data) {
713 const section = state.sections.find(function (section) {
714 return parseInt(section.id) === parseInt(data.section_id);
715 });
716
717 if (!section) {
718 return;
719 }
720
721 for (let i = 0; i < section.items.length; i++) {
722 try {
723 if (!section.items[i]) {
724 continue;
725 }
726
727 const item_id = section.items[i].id;
728
729 if (item_id) {
730 if (data.items[item_id]) {
731 $Vue.set(section.items, i, data.items[item_id]);
732 }
733 }
734 } catch (ex) {
735 console.log(ex);
736 }
737 } //section.items.push({id: data.item.id, title: data.item.title, type: 'empty-item'});
738
739 }
740
741 };
742 /* harmony default export */ __webpack_exports__["default"] = (CourseCurriculum);
743
744 /***/ }),
745
746 /***/ "./assets/src/apps/js/admin/editor/mutations/course.js":
747 /*!*************************************************************!*\
748 !*** ./assets/src/apps/js/admin/editor/mutations/course.js ***!
749 \*************************************************************/
750 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
751
752 __webpack_require__.r(__webpack_exports__);
753 const Course = {
754 UPDATE_HEART_BEAT: function (state, status) {
755 state.heartbeat = !!status;
756 },
757 UPDATE_AUTO_DRAFT_STATUS: function (state, status) {
758 state.auto_draft = status;
759 },
760 UPDATE_STATUS: function (state, status) {
761 state.status = status;
762 },
763 INCREASE_NUMBER_REQUEST: function (state) {
764 state.countCurrentRequest++;
765 },
766 DECREASE_NUMBER_REQUEST: function (state) {
767 state.countCurrentRequest--;
768 }
769 };
770 /* harmony default export */ __webpack_exports__["default"] = (Course);
771
772 /***/ }),
773
774 /***/ "./assets/src/apps/js/admin/editor/mutations/modal-course-items.js":
775 /*!*************************************************************************!*\
776 !*** ./assets/src/apps/js/admin/editor/mutations/modal-course-items.js ***!
777 \*************************************************************************/
778 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
779
780 __webpack_require__.r(__webpack_exports__);
781 const Mutations = {
782 TOGGLE: function (state) {
783 state.open = !state.open;
784 },
785 SET_SECTION: function (state, sectionId) {
786 state.sectionId = sectionId;
787 },
788 SET_LIST_ITEMS: function (state, items) {
789 state.items = items;
790 },
791 ADD_ITEM: function (state, item) {
792 state.addedItems.push(item);
793 },
794 REMOVE_ADDED_ITEM: function (state, item) {
795 state.addedItems.forEach(function (_item, index) {
796 if (_item.id === item.id) {
797 state.addedItems.splice(index, 1);
798 }
799 });
800 },
801 RESET: function (state) {
802 state.addedItems = [];
803 state.items = [];
804 },
805 UPDATE_PAGINATION: function (state, pagination) {
806 state.pagination = pagination;
807 },
808 SEARCH_ITEMS_REQUEST: function (state) {
809 state.status = 'loading';
810 },
811 SEARCH_ITEMS_SUCCESS: function (state) {
812 state.status = 'successful';
813 },
814 SEARCH_ITEMS_FAILURE: function (state) {
815 state.status = 'failed';
816 }
817 };
818 /* harmony default export */ __webpack_exports__["default"] = (Mutations);
819
820 /***/ }),
821
822 /***/ "./assets/src/apps/js/admin/editor/store/course-section.js":
823 /*!*****************************************************************!*\
824 !*** ./assets/src/apps/js/admin/editor/store/course-section.js ***!
825 \*****************************************************************/
826 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
827
828 __webpack_require__.r(__webpack_exports__);
829 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
830 /* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
831 /* harmony export */ });
832 /* harmony import */ var _actions_course_section__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actions/course-section */ "./assets/src/apps/js/admin/editor/actions/course-section.js");
833 /* harmony import */ var _mutations_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/course-section */ "./assets/src/apps/js/admin/editor/mutations/course-section.js");
834 /* harmony import */ var _getters_course_section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getters/course-section */ "./assets/src/apps/js/admin/editor/getters/course-section.js");
835
836
837
838 const $ = window.jQuery;
839 /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(data) {
840 var state = $.extend({}, data.sections);
841 state.statusUpdateSection = {};
842 state.statusUpdateSectionItem = {};
843 state.sections = state.sections.map(function (section) {
844 var hiddenSections = state.hidden_sections;
845 var find = hiddenSections.find(function (sectionId) {
846 return parseInt(section.id) === parseInt(sectionId);
847 });
848 section.open = !find;
849 return section;
850 });
851 return {
852 namespaced: true,
853 state: state,
854 getters: _getters_course_section__WEBPACK_IMPORTED_MODULE_2__["default"],
855 mutations: _mutations_course_section__WEBPACK_IMPORTED_MODULE_1__["default"],
856 actions: _actions_course_section__WEBPACK_IMPORTED_MODULE_0__["default"]
857 };
858 }
859
860 /***/ }),
861
862 /***/ "./assets/src/apps/js/admin/editor/store/course.js":
863 /*!*********************************************************!*\
864 !*** ./assets/src/apps/js/admin/editor/store/course.js ***!
865 \*********************************************************/
866 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
867
868 __webpack_require__.r(__webpack_exports__);
869 /* harmony import */ var _store_modal_course_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../store/modal-course-items */ "./assets/src/apps/js/admin/editor/store/modal-course-items.js");
870 /* harmony import */ var _store_course_section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../store/course-section */ "./assets/src/apps/js/admin/editor/store/course-section.js");
871 /* harmony import */ var _store_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store/i18n */ "./assets/src/apps/js/admin/editor/store/i18n.js");
872 /* harmony import */ var _getters_course__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getters/course */ "./assets/src/apps/js/admin/editor/getters/course.js");
873 /* harmony import */ var _mutations_course__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../mutations/course */ "./assets/src/apps/js/admin/editor/mutations/course.js");
874 /* harmony import */ var _actions_course__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../actions/course */ "./assets/src/apps/js/admin/editor/actions/course.js");
875
876
877
878
879
880
881 const $ = window.jQuery;
882
883 const Course = function Course(data) {
884 var state = $.extend({}, data.root);
885 state.status = 'success';
886 state.heartbeat = true;
887 state.countCurrentRequest = 0;
888 return {
889 state: state,
890 getters: _getters_course__WEBPACK_IMPORTED_MODULE_3__["default"],
891 mutations: _mutations_course__WEBPACK_IMPORTED_MODULE_4__["default"],
892 actions: _actions_course__WEBPACK_IMPORTED_MODULE_5__["default"],
893 modules: {
894 ci: (0,_store_modal_course_items__WEBPACK_IMPORTED_MODULE_0__["default"])(data),
895 i18n: (0,_store_i18n__WEBPACK_IMPORTED_MODULE_2__["default"])(data.i18n),
896 ss: (0,_store_course_section__WEBPACK_IMPORTED_MODULE_1__["default"])(data)
897 }
898 };
899 };
900
901 /* harmony default export */ __webpack_exports__["default"] = (Course);
902
903 /***/ }),
904
905 /***/ "./assets/src/apps/js/admin/editor/store/i18n.js":
906 /*!*******************************************************!*\
907 !*** ./assets/src/apps/js/admin/editor/store/i18n.js ***!
908 \*******************************************************/
909 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
910
911 __webpack_require__.r(__webpack_exports__);
912 const $ = window.jQuery || jQuery;
913
914 const i18n = function i18n(i18n) {
915 const state = $.extend({}, i18n);
916 const getters = {
917 all: function (state) {
918 return state;
919 }
920 };
921 return {
922 namespaced: true,
923 state: state,
924 getters: getters
925 };
926 };
927
928 /* harmony default export */ __webpack_exports__["default"] = (i18n);
929
930 /***/ }),
931
932 /***/ "./assets/src/apps/js/admin/editor/store/modal-course-items.js":
933 /*!*********************************************************************!*\
934 !*** ./assets/src/apps/js/admin/editor/store/modal-course-items.js ***!
935 \*********************************************************************/
936 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
937
938 __webpack_require__.r(__webpack_exports__);
939 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
940 /* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
941 /* harmony export */ });
942 /* harmony import */ var _getters_modal_course_items__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getters/modal-course-items */ "./assets/src/apps/js/admin/editor/getters/modal-course-items.js");
943 /* harmony import */ var _mutations_modal_course_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mutations/modal-course-items */ "./assets/src/apps/js/admin/editor/mutations/modal-course-items.js");
944 /* harmony import */ var _actions_modal_course_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/modal-course-items */ "./assets/src/apps/js/admin/editor/actions/modal-course-items.js");
945
946
947
948 const $ = window.jQuery || jQuery;
949 /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(data) {
950 var state = $.extend({}, data.chooseItems);
951 state.sectionId = false;
952 state.pagination = '';
953 state.status = '';
954 return {
955 namespaced: true,
956 state: state,
957 getters: _getters_modal_course_items__WEBPACK_IMPORTED_MODULE_0__["default"],
958 mutations: _mutations_modal_course_items__WEBPACK_IMPORTED_MODULE_1__["default"],
959 actions: _actions_modal_course_items__WEBPACK_IMPORTED_MODULE_2__["default"]
960 };
961 }
962
963 /***/ })
964
965 /******/ });
966 /************************************************************************/
967 /******/ // The module cache
968 /******/ var __webpack_module_cache__ = {};
969 /******/
970 /******/ // The require function
971 /******/ function __webpack_require__(moduleId) {
972 /******/ // Check if module is in cache
973 /******/ var cachedModule = __webpack_module_cache__[moduleId];
974 /******/ if (cachedModule !== undefined) {
975 /******/ return cachedModule.exports;
976 /******/ }
977 /******/ // Create a new module (and put it into the cache)
978 /******/ var module = __webpack_module_cache__[moduleId] = {
979 /******/ // no module.id needed
980 /******/ // no module.loaded needed
981 /******/ exports: {}
982 /******/ };
983 /******/
984 /******/ // Execute the module function
985 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
986 /******/
987 /******/ // Return the exports of the module
988 /******/ return module.exports;
989 /******/ }
990 /******/
991 /************************************************************************/
992 /******/ /* webpack/runtime/define property getters */
993 /******/ !function() {
994 /******/ // define getter functions for harmony exports
995 /******/ __webpack_require__.d = function(exports, definition) {
996 /******/ for(var key in definition) {
997 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
998 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
999 /******/ }
1000 /******/ }
1001 /******/ };
1002 /******/ }();
1003 /******/
1004 /******/ /* webpack/runtime/hasOwnProperty shorthand */
1005 /******/ !function() {
1006 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
1007 /******/ }();
1008 /******/
1009 /******/ /* webpack/runtime/make namespace object */
1010 /******/ !function() {
1011 /******/ // define __esModule on exports
1012 /******/ __webpack_require__.r = function(exports) {
1013 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1014 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1015 /******/ }
1016 /******/ Object.defineProperty(exports, '__esModule', { value: true });
1017 /******/ };
1018 /******/ }();
1019 /******/
1020 /************************************************************************/
1021 var __webpack_exports__ = {};
1022 // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
1023 !function() {
1024 /*!***************************************************!*\
1025 !*** ./assets/src/apps/js/admin/editor/course.js ***!
1026 \***************************************************/
1027 __webpack_require__.r(__webpack_exports__);
1028 /* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ "./assets/src/apps/js/admin/editor/http.js");
1029 /* harmony import */ var _store_course__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store/course */ "./assets/src/apps/js/admin/editor/store/course.js");
1030
1031
1032 window.$Vue = window.$Vue || Vue;
1033 window.$Vuex = window.$Vuex || Vuex;
1034 const $ = window.jQuery;
1035 /**
1036 * Init app.
1037 *
1038 * @since 3.0.0
1039 */
1040
1041 $(document).ready(function () {
1042 window.LP_Curriculum_Store = new $Vuex.Store((0,_store_course__WEBPACK_IMPORTED_MODULE_1__["default"])(lpAdminCourseEditorSettings));
1043 (0,_http__WEBPACK_IMPORTED_MODULE_0__["default"])({
1044 ns: 'LPCurriculumRequest',
1045 store: LP_Curriculum_Store
1046 });
1047 setTimeout(() => {
1048 window.LP_Course_Editor = new $Vue({
1049 el: '#admin-editor-lp_course',
1050 template: '<lp-course-editor></lp-course-editor>'
1051 });
1052 }, 100);
1053 });
1054 }();
1055 /******/ })()
1056 ;
1057 //# sourceMappingURL=course.js.map