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