LearnPress – WordPress LMS Plugin - Version 4.0.1

Version Description

~ Fixed: upgrade LP error if mysql version < 5.7 - "Specified key was too long". ~ Fixed: minor bugs.

Download this release

Release Info

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

Code changes from version 4.0.0 to 4.0.1

Files changed (34) hide show
  1. assets/js/dist/admin/editor/course.min.js +1 -1
  2. assets/js/dist/admin/editor/question.min.js +1 -1
  3. assets/js/dist/admin/editor/quiz.min.js +1 -1
  4. assets/js/dist/admin/pages/search-lp-addons-themes.js +152 -0
  5. assets/js/dist/admin/pages/search-lp-addons-themes.min.js +1 -0
  6. assets/js/dist/admin/pages/setup.js +255 -0
  7. assets/js/dist/admin/pages/setup.min.js +1 -0
  8. assets/js/dist/admin/pages/statistic.js +385 -0
  9. assets/js/dist/admin/pages/statistic.min.js +1 -0
  10. assets/js/dist/admin/pages/sync-data.js +355 -0
  11. assets/js/dist/admin/pages/sync-data.min.js +1 -0
  12. assets/js/dist/admin/pages/tools.js +71 -71
  13. assets/js/dist/admin/pages/tools.min.js +1 -1
  14. assets/js/dist/frontend/single-course.js +14 -16
  15. assets/js/dist/frontend/single-course.min.js +1 -1
  16. assets/js/dist/frontend/single-curriculum.js +14 -16
  17. assets/js/dist/frontend/single-curriculum.min.js +1 -1
  18. assets/js/dist/utils.min.js +1 -1
  19. assets/src/apps/js/admin/pages/tools/database/upgrade.js +10 -13
  20. assets/src/apps/js/frontend/show-lp-overlay-complete-item.js +1 -1
  21. assets/src/apps/js/utils/handle-ajax-api.js +21 -0
  22. assets/src/apps/js/utils/lp-modal-overlay.js +52 -0
  23. inc/databases/class-lp-db.php +72 -30
  24. inc/gateways/class-lp-gateway-abstract.php +2 -2
  25. inc/handle-steps/class-lp-handle-steps.php +3 -1
  26. inc/handle-steps/class-lp-handle-upgrade-db-steps.php +18 -4
  27. inc/lp-core-functions.php +66 -0
  28. inc/updates/learnpress-upgrade-4.php +164 -86
  29. inc/user/abstract-lp-user.php +1 -14
  30. learnpress.php +3 -1
  31. readme.txt +510 -505
  32. templates/single-course/buttons/purchase.php +6 -1
  33. templates/single-course/content-protected.php +2 -2
  34. templates/single-course/item-comments.php +1 -1
assets/js/dist/admin/editor/course.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([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,n){"use strict";n.r(e);var i=n(0),o={status:function(t){return t.status},pagination:function(t){return t.pagination},items:function(t,e){return t.items.map((function(t){var n=e.addedItems.find((function(e){return t.id===e.id}));return t.added=!!n,t}))},addedItems:function(t){return t.addedItems},isOpen:function(t){return t.open},types:function(t){return t.types},section:function(t){return t.sectionId}},s={TOGGLE:function(t){t.open=!t.open},SET_SECTION:function(t,e){t.sectionId=e},SET_LIST_ITEMS:function(t,e){t.items=e},ADD_ITEM:function(t,e){t.addedItems.push(e)},REMOVE_ADDED_ITEM:function(t,e){t.addedItems.forEach((function(n,i){n.id===e.id&&t.addedItems.splice(i,1)}))},RESET:function(t){t.addedItems=[],t.items=[]},UPDATE_PAGINATION:function(t,e){t.pagination=e},SEARCH_ITEMS_REQUEST:function(t){t.status="loading"},SEARCH_ITEMS_SUCCESS:function(t){t.status="successful"},SEARCH_ITEMS_FAILURE:function(t){t.status="failed"}},c={toggle:function(t){t.commit("TOGGLE")},open:function(t,e){t.commit("SET_SECTION",e),t.commit("RESET"),t.commit("TOGGLE")},searchItems:function(t,e){t.commit("SEARCH_ITEMS_REQUEST"),LP.Request({type:"search-items",query:e.query,item_type:e.type,page:e.page,exclude:JSON.stringify([])}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("SET_LIST_ITEMS",i.items),t.commit("UPDATE_PAGINATION",i.pagination),t.commit("SEARCH_ITEMS_SUCCESS")}}),(function(e){t.commit("SEARCH_ITEMS_FAILURE"),console.error(e)}))},addItem:function(t,e){t.commit("ADD_ITEM",e)},removeItem:function(t,e){t.commit("REMOVE_ADDED_ITEM",e)},addItemsToSection:function(t){var e=t.getters.addedItems;e.length>0&&LP.Request({type:"add-items-to-section",section_id:t.getters.section,items:JSON.stringify(e)}).then((function(e){var n=e.body;if(n.success){t.commit("TOGGLE");var i=n.data;t.commit("ss/UPDATE_SECTION_ITEMS",{section_id:t.getters.section,items:i},{root:!0})}}),(function(t){console.error(t)}))}},u=window.jQuery||jQuery,r=function(t){var e=u.extend({},t.chooseItems);return e.sectionId=!1,e.pagination="",e.status="",{namespaced:!0,state:e,getters:o,mutations:s,actions:c}},d=window.jQuery||jQuery,a={toggleAllSections:function(t){t.getters.isHiddenAllSections?t.commit("OPEN_ALL_SECTIONS"):t.commit("CLOSE_ALL_SECTIONS"),LP.Request({type:"hidden-sections",hidden:t.getters.hiddenSections})},updateSectionsOrder:function(t,e){LP.Request({type:"sort-sections",order:JSON.stringify(e)}).then((function(e){var n=e.body.data;t.commit("SORT_SECTION",n)}),(function(t){console.error(t)}))},toggleSection:function(t,e){e.open?t.commit("CLOSE_SECTION",e):t.commit("OPEN_SECTION",e),LP.Request({type:"hidden-sections",hidden:t.getters.hiddenSections})},updateSection:function(t,e){t.commit("UPDATE_SECTION_REQUEST",e.id),LP.Request({type:"update-section",section:JSON.stringify(e)}).then((function(){t.commit("UPDATE_SECTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_SECTION_FAILURE",e.id)}))},removeSection:function(t,e){t.commit("REMOVE_SECTION",e.index),LP.Request({type:"remove-section",section_id:e.section.id}).then((function(t){t.body}),(function(t){console.error(t)}))},newSection:function(t,e){var n={type:"new-section",section_name:e,temp_id:LP.uniqueId()};t.commit("ADD_NEW_SECTION",{id:n.temp_id,items:[],open:!1,title:n.section_name}),LP.Request(n).then((function(e){var n=e.body;if(n.success){var i=d.extend({},n.data,{open:!0});t.commit("ADD_NEW_SECTION",i)}}),(function(t){console.error(t)}))},updateSectionItem:function(t,e){t.commit("UPDATE_SECTION_ITEM_REQUEST",e.item.id),LP.Request({type:"update-section-item",section_id:e.section_id,item:JSON.stringify(e.item)}).then((function(n){t.commit("UPDATE_SECTION_ITEM_SUCCESS",e.item.id);var i=n.body;if(i.success){var o=i.data;t.commit("UPDATE_SECTION_ITEM",{section_id:e.section_id,item:o})}}),(function(n){t.commit("UPDATE_SECTION_ITEM_FAILURE",e.item.id),console.error(n)}))},removeSectionItem:function(t,e){var n=e.item.id;t.commit("REMOVE_SECTION_ITEM",e),e.item.temp_id=0,LP.Request({type:"remove-section-item",section_id:e.section_id,item_id:n}).then((function(){t.commit("REMOVE_SECTION_ITEM",e)}))},deleteSectionItem:function(t,e){var n=e.item.id;t.commit("REMOVE_SECTION_ITEM",e),e.item.temp_id=0,LP.Request({type:"delete-section-item",section_id:e.section_id,item_id:n}).then((function(){t.commit("REMOVE_SECTION_ITEM",e)}))},newSectionItem:function(t,e){t.commit("APPEND_EMPTY_ITEM_TO_SECTION",e),LP.Request({type:"new-section-item",section_id:e.section_id,item:JSON.stringify(e.item)}).then((function(n){var i=n.body;if(i.success){var o={};d.each(i.data,(function(t,e){o[e.old_id?e.old_id:e.id]=e})),t.commit("UPDATE_ITEM_SECTION_BY_ID",{section_id:e.section_id,items:o})}}),(function(t){console.error(t)}))},updateSectionItems:function(t,e){var n=t.state;LP.Request({type:"update-section-items",section_id:e.section_id,items:JSON.stringify(e.items),last_section:n.sections[n.sections.length-1]===e.section_id}).then((function(t){t.body.success}),(function(t){console.error(t)}))}},E={SORT_SECTION:function(t,e){t.sections=t.sections.map((function(t){return t.order=e[t.id],t}))},SET_SECTIONS:function(t,e){t.sections=e},ADD_NEW_SECTION:function(t,e){var n;void 0===e.open&&(e.open=!0),e.temp_id&&t.sections.map((function(t,i){if(e.temp_id==t.id)return n=i,!1})),void 0!==n?$Vue.set(t.sections,n,e):t.sections.push(e)},ADD_EMPTY_SECTION:function(t,e){e.open=!0,t.sections.push(e)},REMOVE_SECTION:function(t,e){t.sections.splice(e,1)},REMOVE_SECTION_ITEM:function(t,e){var n=t.sections.find((function(t){return t.id===e.section_id})).items||[],i=e.item,o=-1;n.forEach((function(t,e){t.id===i.id&&(o=e)})),-1!==o&&(i.temp_id?n[o].id=i.temp_id:n.splice(o,1))},UPDATE_SECTION_ITEMS:function(t,e){var n=t.sections.find((function(t){return parseInt(t.id)===parseInt(e.section_id)}));n&&(n.items=e.items)},UPDATE_SECTION_ITEM:function(t,e){},CLOSE_SECTION:function(t,e){t.sections.forEach((function(n,i){e.id===n.id&&(t.sections[i].open=!1)}))},OPEN_SECTION:function(t,e){t.sections.forEach((function(n,i){e.id===n.id&&(t.sections[i].open=!0)}))},OPEN_ALL_SECTIONS:function(t){t.sections=t.sections.map((function(t){return t.open=!0,t}))},CLOSE_ALL_SECTIONS:function(t){t.sections=t.sections.map((function(t){return t.open=!1,t}))},UPDATE_SECTION_REQUEST:function(t,e){$Vue.set(t.statusUpdateSection,e,"updating")},UPDATE_SECTION_SUCCESS:function(t,e){$Vue.set(t.statusUpdateSection,e,"successful")},UPDATE_SECTION_FAILURE:function(t,e){$Vue.set(t.statusUpdateSection,e,"failed")},UPDATE_SECTION_ITEM_REQUEST:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"updating")},UPDATE_SECTION_ITEM_SUCCESS:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"successful")},UPDATE_SECTION_ITEM_FAILURE:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"failed")},APPEND_EMPTY_ITEM_TO_SECTION:function(t,e){var n=t.sections.find((function(t){return parseInt(t.id)===parseInt(e.section_id)}));n&&n.items.push({id:e.item.id,title:e.item.title,type:"empty-item"})},UPDATE_ITEM_SECTION_BY_ID:function(t,e){var n=t.sections.find((function(t){return parseInt(t.id)===parseInt(e.section_id)}));if(n)for(var i=0;i<n.items.length;i++)try{if(!n.items[i])continue;var o=n.items[i].id;o&&e.items[o]&&$Vue.set(n.items,i,e.items[o])}catch(t){console.log(t)}}},m={sections:function(t){return t.sections||[]},urlEdit:function(t){return t.urlEdit},hiddenSections:function(t){return t.sections.filter((function(t){return!t.open})).map((function(t){return parseInt(t.id)}))},isHiddenAllSections:function(t,e){var n=e.sections;return e.hiddenSections.length===n.length},statusUpdateSection:function(t){return t.statusUpdateSection},statusUpdateSectionItem:function(t){return t.statusUpdateSectionItem}},f=window.jQuery,_=function(t){var e=f.extend({},t.sections);return e.statusUpdateSection={},e.statusUpdateSectionItem={},e.sections=e.sections.map((function(t){var n=e.hidden_sections.find((function(e){return parseInt(t.id)===parseInt(e)}));return t.open=!n,t})),{namespaced:!0,state:e,getters:m,mutations:E,actions:a}},S=n(1),T={heartbeat:function(t){return t.heartbeat},action:function(t){return t.action},id:function(t){return t.course_id},autoDraft:function(t){return t.auto_draft},disable_curriculum:function(t){return t.disable_curriculum},status:function(t){return t.status||"error"},currentRequest:function(t){return t.countCurrentRequest||0},urlAjax:function(t){return t.ajax},nonce:function(t){return t.nonce}},p={UPDATE_HEART_BEAT:function(t,e){t.heartbeat=!!e},UPDATE_AUTO_DRAFT_STATUS:function(t,e){t.auto_draft=e},UPDATE_STATUS:function(t,e){t.status=e},INCREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest--}},I={heartbeat:function(t){LP.Request({type:"heartbeat"}).then((function(e){var n=e.body;t.commit("UPDATE_HEART_BEAT",!!n.success)}),(function(e){t.commit("UPDATE_HEART_BEAT",!1)}))},draftCourse:function(t,e){t.getters.autoDraft&&LP.Request({type:"draft-course",course:JSON.stringify(e)}).then((function(e){e.body.success&&t.commit("UPDATE_AUTO_DRAFT_STATUS",!1)}))},newRequest:function(t){t.commit("INCREASE_NUMBER_REQUEST"),t.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(t,e){t.commit("DECREASE_NUMBER_REQUEST"),0===t.getters.currentRequest&&(t.commit("UPDATE_STATUS",e),window.onbeforeunload=null)}},l=window.jQuery,O=function(t){var e=l.extend({},t.root);return e.status="success",e.heartbeat=!0,e.countCurrentRequest=0,{state:e,getters:T,mutations:p,actions:I,modules:{ci:r(t),i18n:Object(S.a)(t.i18n),ss:_(t)}}};window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,(0,window.jQuery)(document).ready((function(){window.LP_Curriculum_Store=new $Vuex.Store(O(lpAdminCourseEditorSettings)),Object(i.a)({ns:"LPCurriculumRequest",store:LP_Curriculum_Store}),setTimeout((function(){window.LP_Course_Editor=new $Vue({el:"#admin-editor-lp_course",template:"<lp-course-editor></lp-course-editor>"})}),100)}))}]);
1
+ !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}({0:function(t,e,n){"use strict";function i(t){var e=window.jQuery||jQuery,n=Vue.http;t=e.extend({ns:"LPRequest",store:!1},t||{});var i=null;LP.Request=function(o){return i=e("#publishing-action"),o.id=t.store.getters.id,o.nonce=t.store.getters.nonce,o["lp-ajax"]=t.store.getters.action,o.code=t.store.getters.code,i.find("#publish").addClass("disabled"),i.find(".spinner").addClass("is-active"),i.addClass("code-"+o.code),n.post(t.store.getters.urlAjax,o,{emulateJSON:!0,params:{namespace:t.ns,code:o.code}})},n.interceptors.push((function(e,n){e.params.namespace===t.ns?(t.store.dispatch("newRequest"),n((function(n){jQuery.isPlainObject(n.body)||(n.body=LP.parseJSON(n.body)),n.body.success||!1?t.store.dispatch("requestCompleted","successful"):t.store.dispatch("requestCompleted","failed"),i.removeClass("code-"+e.params.code),i.attr("class")||(i.find("#publish").removeClass("disabled"),i.find(".spinner").removeClass("is-active"))}))):n()}))}n.d(e,"a",(function(){return i}))},1:function(t,e,n){"use strict";var i=window.jQuery||jQuery;e.a=function(t){return{namespaced:!0,state:i.extend({},t),getters:{all:function(t){return t}}}}},11:function(t,e,n){"use strict";n.r(e);var i=n(0),o={status:function(t){return t.status},pagination:function(t){return t.pagination},items:function(t,e){return t.items.map((function(t){var n=e.addedItems.find((function(e){return t.id===e.id}));return t.added=!!n,t}))},addedItems:function(t){return t.addedItems},isOpen:function(t){return t.open},types:function(t){return t.types},section:function(t){return t.sectionId}},s={TOGGLE:function(t){t.open=!t.open},SET_SECTION:function(t,e){t.sectionId=e},SET_LIST_ITEMS:function(t,e){t.items=e},ADD_ITEM:function(t,e){t.addedItems.push(e)},REMOVE_ADDED_ITEM:function(t,e){t.addedItems.forEach((function(n,i){n.id===e.id&&t.addedItems.splice(i,1)}))},RESET:function(t){t.addedItems=[],t.items=[]},UPDATE_PAGINATION:function(t,e){t.pagination=e},SEARCH_ITEMS_REQUEST:function(t){t.status="loading"},SEARCH_ITEMS_SUCCESS:function(t){t.status="successful"},SEARCH_ITEMS_FAILURE:function(t){t.status="failed"}},c={toggle:function(t){t.commit("TOGGLE")},open:function(t,e){t.commit("SET_SECTION",e),t.commit("RESET"),t.commit("TOGGLE")},searchItems:function(t,e){t.commit("SEARCH_ITEMS_REQUEST"),LP.Request({type:"search-items",query:e.query,item_type:e.type,page:e.page,exclude:JSON.stringify([])}).then((function(e){var n=e.body;if(n.success){var i=n.data;t.commit("SET_LIST_ITEMS",i.items),t.commit("UPDATE_PAGINATION",i.pagination),t.commit("SEARCH_ITEMS_SUCCESS")}}),(function(e){t.commit("SEARCH_ITEMS_FAILURE"),console.error(e)}))},addItem:function(t,e){t.commit("ADD_ITEM",e)},removeItem:function(t,e){t.commit("REMOVE_ADDED_ITEM",e)},addItemsToSection:function(t){var e=t.getters.addedItems;e.length>0&&LP.Request({type:"add-items-to-section",section_id:t.getters.section,items:JSON.stringify(e)}).then((function(e){var n=e.body;if(n.success){t.commit("TOGGLE");var i=n.data;t.commit("ss/UPDATE_SECTION_ITEMS",{section_id:t.getters.section,items:i},{root:!0})}}),(function(t){console.error(t)}))}},u=window.jQuery||jQuery,r=function(t){var e=u.extend({},t.chooseItems);return e.sectionId=!1,e.pagination="",e.status="",{namespaced:!0,state:e,getters:o,mutations:s,actions:c}},d=window.jQuery||jQuery,a={toggleAllSections:function(t){t.getters.isHiddenAllSections?t.commit("OPEN_ALL_SECTIONS"):t.commit("CLOSE_ALL_SECTIONS"),LP.Request({type:"hidden-sections",hidden:t.getters.hiddenSections})},updateSectionsOrder:function(t,e){LP.Request({type:"sort-sections",order:JSON.stringify(e)}).then((function(e){var n=e.body.data;t.commit("SORT_SECTION",n)}),(function(t){console.error(t)}))},toggleSection:function(t,e){e.open?t.commit("CLOSE_SECTION",e):t.commit("OPEN_SECTION",e),LP.Request({type:"hidden-sections",hidden:t.getters.hiddenSections})},updateSection:function(t,e){t.commit("UPDATE_SECTION_REQUEST",e.id),LP.Request({type:"update-section",section:JSON.stringify(e)}).then((function(){t.commit("UPDATE_SECTION_SUCCESS",e.id)})).catch((function(){t.commit("UPDATE_SECTION_FAILURE",e.id)}))},removeSection:function(t,e){t.commit("REMOVE_SECTION",e.index),LP.Request({type:"remove-section",section_id:e.section.id}).then((function(t){t.body}),(function(t){console.error(t)}))},newSection:function(t,e){var n={type:"new-section",section_name:e,temp_id:LP.uniqueId()};t.commit("ADD_NEW_SECTION",{id:n.temp_id,items:[],open:!1,title:n.section_name}),LP.Request(n).then((function(e){var n=e.body;if(n.success){var i=d.extend({},n.data,{open:!0});t.commit("ADD_NEW_SECTION",i)}}),(function(t){console.error(t)}))},updateSectionItem:function(t,e){t.commit("UPDATE_SECTION_ITEM_REQUEST",e.item.id),LP.Request({type:"update-section-item",section_id:e.section_id,item:JSON.stringify(e.item)}).then((function(n){t.commit("UPDATE_SECTION_ITEM_SUCCESS",e.item.id);var i=n.body;if(i.success){var o=i.data;t.commit("UPDATE_SECTION_ITEM",{section_id:e.section_id,item:o})}}),(function(n){t.commit("UPDATE_SECTION_ITEM_FAILURE",e.item.id),console.error(n)}))},removeSectionItem:function(t,e){var n=e.item.id;t.commit("REMOVE_SECTION_ITEM",e),e.item.temp_id=0,LP.Request({type:"remove-section-item",section_id:e.section_id,item_id:n}).then((function(){t.commit("REMOVE_SECTION_ITEM",e)}))},deleteSectionItem:function(t,e){var n=e.item.id;t.commit("REMOVE_SECTION_ITEM",e),e.item.temp_id=0,LP.Request({type:"delete-section-item",section_id:e.section_id,item_id:n}).then((function(){t.commit("REMOVE_SECTION_ITEM",e)}))},newSectionItem:function(t,e){t.commit("APPEND_EMPTY_ITEM_TO_SECTION",e),LP.Request({type:"new-section-item",section_id:e.section_id,item:JSON.stringify(e.item)}).then((function(n){var i=n.body;if(i.success){var o={};d.each(i.data,(function(t,e){o[e.old_id?e.old_id:e.id]=e})),t.commit("UPDATE_ITEM_SECTION_BY_ID",{section_id:e.section_id,items:o})}}),(function(t){console.error(t)}))},updateSectionItems:function(t,e){var n=t.state;LP.Request({type:"update-section-items",section_id:e.section_id,items:JSON.stringify(e.items),last_section:n.sections[n.sections.length-1]===e.section_id}).then((function(t){t.body.success}),(function(t){console.error(t)}))}},E={SORT_SECTION:function(t,e){t.sections=t.sections.map((function(t){return t.order=e[t.id],t}))},SET_SECTIONS:function(t,e){t.sections=e},ADD_NEW_SECTION:function(t,e){var n;void 0===e.open&&(e.open=!0),e.temp_id&&t.sections.map((function(t,i){if(e.temp_id==t.id)return n=i,!1})),void 0!==n?$Vue.set(t.sections,n,e):t.sections.push(e)},ADD_EMPTY_SECTION:function(t,e){e.open=!0,t.sections.push(e)},REMOVE_SECTION:function(t,e){t.sections.splice(e,1)},REMOVE_SECTION_ITEM:function(t,e){var n=t.sections.find((function(t){return t.id===e.section_id})).items||[],i=e.item,o=-1;n.forEach((function(t,e){t.id===i.id&&(o=e)})),-1!==o&&(i.temp_id?n[o].id=i.temp_id:n.splice(o,1))},UPDATE_SECTION_ITEMS:function(t,e){var n=t.sections.find((function(t){return parseInt(t.id)===parseInt(e.section_id)}));n&&(n.items=e.items)},UPDATE_SECTION_ITEM:function(t,e){},CLOSE_SECTION:function(t,e){t.sections.forEach((function(n,i){e.id===n.id&&(t.sections[i].open=!1)}))},OPEN_SECTION:function(t,e){t.sections.forEach((function(n,i){e.id===n.id&&(t.sections[i].open=!0)}))},OPEN_ALL_SECTIONS:function(t){t.sections=t.sections.map((function(t){return t.open=!0,t}))},CLOSE_ALL_SECTIONS:function(t){t.sections=t.sections.map((function(t){return t.open=!1,t}))},UPDATE_SECTION_REQUEST:function(t,e){$Vue.set(t.statusUpdateSection,e,"updating")},UPDATE_SECTION_SUCCESS:function(t,e){$Vue.set(t.statusUpdateSection,e,"successful")},UPDATE_SECTION_FAILURE:function(t,e){$Vue.set(t.statusUpdateSection,e,"failed")},UPDATE_SECTION_ITEM_REQUEST:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"updating")},UPDATE_SECTION_ITEM_SUCCESS:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"successful")},UPDATE_SECTION_ITEM_FAILURE:function(t,e){$Vue.set(t.statusUpdateSectionItem,e,"failed")},APPEND_EMPTY_ITEM_TO_SECTION:function(t,e){var n=t.sections.find((function(t){return parseInt(t.id)===parseInt(e.section_id)}));n&&n.items.push({id:e.item.id,title:e.item.title,type:"empty-item"})},UPDATE_ITEM_SECTION_BY_ID:function(t,e){var n=t.sections.find((function(t){return parseInt(t.id)===parseInt(e.section_id)}));if(n)for(var i=0;i<n.items.length;i++)try{if(!n.items[i])continue;var o=n.items[i].id;o&&e.items[o]&&$Vue.set(n.items,i,e.items[o])}catch(t){console.log(t)}}},m={sections:function(t){return t.sections||[]},urlEdit:function(t){return t.urlEdit},hiddenSections:function(t){return t.sections.filter((function(t){return!t.open})).map((function(t){return parseInt(t.id)}))},isHiddenAllSections:function(t,e){var n=e.sections;return e.hiddenSections.length===n.length},statusUpdateSection:function(t){return t.statusUpdateSection},statusUpdateSectionItem:function(t){return t.statusUpdateSectionItem}},f=window.jQuery,_=function(t){var e=f.extend({},t.sections);return e.statusUpdateSection={},e.statusUpdateSectionItem={},e.sections=e.sections.map((function(t){var n=e.hidden_sections.find((function(e){return parseInt(t.id)===parseInt(e)}));return t.open=!n,t})),{namespaced:!0,state:e,getters:m,mutations:E,actions:a}},S=n(1),T={heartbeat:function(t){return t.heartbeat},action:function(t){return t.action},id:function(t){return t.course_id},autoDraft:function(t){return t.auto_draft},disable_curriculum:function(t){return t.disable_curriculum},status:function(t){return t.status||"error"},currentRequest:function(t){return t.countCurrentRequest||0},urlAjax:function(t){return t.ajax},nonce:function(t){return t.nonce}},p={UPDATE_HEART_BEAT:function(t,e){t.heartbeat=!!e},UPDATE_AUTO_DRAFT_STATUS:function(t,e){t.auto_draft=e},UPDATE_STATUS:function(t,e){t.status=e},INCREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(t){t.countCurrentRequest--}},I={heartbeat:function(t){LP.Request({type:"heartbeat"}).then((function(e){var n=e.body;t.commit("UPDATE_HEART_BEAT",!!n.success)}),(function(e){t.commit("UPDATE_HEART_BEAT",!1)}))},draftCourse:function(t,e){t.getters.autoDraft&&LP.Request({type:"draft-course",course:JSON.stringify(e)}).then((function(e){e.body.success&&t.commit("UPDATE_AUTO_DRAFT_STATUS",!1)}))},newRequest:function(t){t.commit("INCREASE_NUMBER_REQUEST"),t.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(t,e){t.commit("DECREASE_NUMBER_REQUEST"),0===t.getters.currentRequest&&(t.commit("UPDATE_STATUS",e),window.onbeforeunload=null)}},l=window.jQuery,O=function(t){var e=l.extend({},t.root);return e.status="success",e.heartbeat=!0,e.countCurrentRequest=0,{state:e,getters:T,mutations:p,actions:I,modules:{ci:r(t),i18n:Object(S.a)(t.i18n),ss:_(t)}}};window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex,(0,window.jQuery)(document).ready((function(){window.LP_Curriculum_Store=new $Vuex.Store(O(lpAdminCourseEditorSettings)),Object(i.a)({ns:"LPCurriculumRequest",store:LP_Curriculum_Store}),setTimeout((function(){window.LP_Course_Editor=new $Vue({el:"#admin-editor-lp_course",template:"<lp-course-editor></lp-course-editor>"})}),100)}))}});
assets/js/dist/admin/editor/question.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}({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}))},10:function(e,t,n){"use strict";n.r(t);var o=n(0),r={id:function(e){return e.id},type:function(e){return e.type},code:function(e){return Date.now()},autoDraft:function(e){return e.auto_draft},answers:function(e){return Object.values(e.answers)||[]},settings:function(e){return e.setting},types:function(e){return e.questionTypes||[]},numberCorrect:function(e){var t=0;return Object.keys(e.answers).forEach((function(n){"yes"===e.answers[n].is_true&&(t+=1)})),t},status:function(e){return e.status},currentRequest:function(e){return e.countCurrentRequest||0},action:function(e){return e.action},nonce:function(e){return e.nonce},externalComponent:function(e){return e.externalComponent||[]},supportAnswerOptions:function(e){return e.supportAnswerOptions||[]},state:function(e){return e},i18n:function(e){return e.i18n}},u={UPDATE_STATUS:function(e,t){e.status=t},UPDATE_AUTO_DRAFT_STATUS:function(e,t){e.auto_draft=t},CHANGE_QUESTION_TYPE:function(e,t){e.answers=t.answers,e.type=t.type},SET_ANSWERS:function(e,t){e.answers=t},DELETE_ANSWER:function(e,t){for(var n=0,o=e.answers.length;n<o;n++)if(e.answers[n].question_answer_id==t){e.answers[n].question_answer_id=LP.uniqueId();break}},ADD_NEW_ANSWER:function(e,t){e.answers.push(t)},UPDATE_ANSWERS:function(e,t){e.answers=t},INCREASE_NUMBER_REQUEST:function(e){e.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(e){e.countCurrentRequest--}},i={changeQuestionType:function(e,t){LP.Request({type:"change-question-type",question_type:t.type,draft_question:e.getters.autoDraft?JSON.stringify(t.question):""}).then((function(t){var n=t.body;n.success&&(e.commit("UPDATE_AUTO_DRAFT_STATUS",!1),e.commit("CHANGE_QUESTION_TYPE",n.data))}))},updateAnswersOrder:function(e,t){LP.Request({type:"sort-answer",order:t}).then((function(e){e.body.success}))},updateAnswerTitle:function(e,t){void 0!==t.question_answer_id&&(t=JSON.stringify(t),LP.Request({type:"update-answer-title",answer:t}))},updateCorrectAnswer:function(e,t){LP.Request({type:"change-correct",correct:JSON.stringify(t)}).then((function(t){var n=t.body;n.success&&(e.commit("UPDATE_ANSWERS",n.data),e.commit("UPDATE_AUTO_DRAFT_STATUS",!1))}))},deleteAnswer:function(e,t){e.commit("DELETE_ANSWER",t.id),LP.Request({type:"delete-answer",answer_id:t.id}).then((function(t){var n=t.body;n.success&&e.commit("SET_ANSWERS",n.data)}))},newAnswer:function(e,t){e.commit("ADD_NEW_ANSWER",t.answer),LP.Request({type:"new-answer"}).then((function(t){var n=t.body;n.success&&e.commit("UPDATE_ANSWERS",n.data)}))},newRequest:function(e){e.commit("INCREASE_NUMBER_REQUEST"),e.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(e,t){e.commit("DECREASE_NUMBER_REQUEST"),0===e.getters.currentRequest&&(e.commit("UPDATE_STATUS",t),window.onbeforeunload=null)}},s=window.jQuery||jQuery,c=function(e){return{state:s.extend({status:"successful",countCurrentRequest:0,i18n:s.extend({},e.i18n)},e.root),getters:r,mutations:u,actions:i}};n(2);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex;var a=window.jQuery;a(document).ready((function(){window.LP_Question_Store=new $Vuex.Store(c(lp_question_editor)),Object(o.a)({ns:"LPQuestionEditorRequest",store:LP_Question_Store}),setTimeout((function(){a("#admin-editor-lp_question").length&&(window.LP_Question_Editor=new $Vue({el:"#admin-editor-lp_question",template:"<lp-question-editor></lp-question-editor>"}))}),100)}))},2:function(e,t){var n;n=jQuery,window.FIB={getSelectedText:function(){var e="";if(void 0!==window.getSelection){var t=window.getSelection();if(t.rangeCount){for(var n=document.createElement("div"),o=0,r=t.rangeCount;o<r;++o)n.appendChild(t.getRangeAt(o).cloneContents());e=n.innerHTML}}else void 0!==document.selection&&"Text"===document.selection.type&&(e=document.selection.createRange().htmlText);return e},createTextNode:function(e){return document.createTextNode(e)},isContainHtml:function(e){var t=n(e),o="b.fib-blank";return t.is(o)||t.find(o).length||t.parent().is(o)},getSelectionRange:function(){var e="";return window.getSelection?e=window.getSelection():document.getSelection?e=document.getSelection():document.selection&&(e=document.selection.createRange().text),e},outerHTML:function(e){return n("<div>").append(n(e).clone()).html()},doUpgrade:function(e){n.ajax({url:"",data:{"lp-ajax":"fib-upgrade"},success:function(t){console.log(t),e&&e.call(t)}})}},n(document).ready((function(){n("#do-upgrade-fib").on("click",(function(){var e=n(this).prop("disabled",!0).addClass("ajaxloading");FIB.doUpgrade((function(){e.prop("disabled",!1).removeClass("ajaxloading")}))}))}))}});
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}({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}))},14:function(e,t,n){"use strict";n.r(t);var o=n(0),r={id:function(e){return e.id},type:function(e){return e.type},code:function(e){return Date.now()},autoDraft:function(e){return e.auto_draft},answers:function(e){return Object.values(e.answers)||[]},settings:function(e){return e.setting},types:function(e){return e.questionTypes||[]},numberCorrect:function(e){var t=0;return Object.keys(e.answers).forEach((function(n){"yes"===e.answers[n].is_true&&(t+=1)})),t},status:function(e){return e.status},currentRequest:function(e){return e.countCurrentRequest||0},action:function(e){return e.action},nonce:function(e){return e.nonce},externalComponent:function(e){return e.externalComponent||[]},supportAnswerOptions:function(e){return e.supportAnswerOptions||[]},state:function(e){return e},i18n:function(e){return e.i18n}},u={UPDATE_STATUS:function(e,t){e.status=t},UPDATE_AUTO_DRAFT_STATUS:function(e,t){e.auto_draft=t},CHANGE_QUESTION_TYPE:function(e,t){e.answers=t.answers,e.type=t.type},SET_ANSWERS:function(e,t){e.answers=t},DELETE_ANSWER:function(e,t){for(var n=0,o=e.answers.length;n<o;n++)if(e.answers[n].question_answer_id==t){e.answers[n].question_answer_id=LP.uniqueId();break}},ADD_NEW_ANSWER:function(e,t){e.answers.push(t)},UPDATE_ANSWERS:function(e,t){e.answers=t},INCREASE_NUMBER_REQUEST:function(e){e.countCurrentRequest++},DECREASE_NUMBER_REQUEST:function(e){e.countCurrentRequest--}},i={changeQuestionType:function(e,t){LP.Request({type:"change-question-type",question_type:t.type,draft_question:e.getters.autoDraft?JSON.stringify(t.question):""}).then((function(t){var n=t.body;n.success&&(e.commit("UPDATE_AUTO_DRAFT_STATUS",!1),e.commit("CHANGE_QUESTION_TYPE",n.data))}))},updateAnswersOrder:function(e,t){LP.Request({type:"sort-answer",order:t}).then((function(e){e.body.success}))},updateAnswerTitle:function(e,t){void 0!==t.question_answer_id&&(t=JSON.stringify(t),LP.Request({type:"update-answer-title",answer:t}))},updateCorrectAnswer:function(e,t){LP.Request({type:"change-correct",correct:JSON.stringify(t)}).then((function(t){var n=t.body;n.success&&(e.commit("UPDATE_ANSWERS",n.data),e.commit("UPDATE_AUTO_DRAFT_STATUS",!1))}))},deleteAnswer:function(e,t){e.commit("DELETE_ANSWER",t.id),LP.Request({type:"delete-answer",answer_id:t.id}).then((function(t){var n=t.body;n.success&&e.commit("SET_ANSWERS",n.data)}))},newAnswer:function(e,t){e.commit("ADD_NEW_ANSWER",t.answer),LP.Request({type:"new-answer"}).then((function(t){var n=t.body;n.success&&e.commit("UPDATE_ANSWERS",n.data)}))},newRequest:function(e){e.commit("INCREASE_NUMBER_REQUEST"),e.commit("UPDATE_STATUS","loading"),window.onbeforeunload=function(){return""}},requestCompleted:function(e,t){e.commit("DECREASE_NUMBER_REQUEST"),0===e.getters.currentRequest&&(e.commit("UPDATE_STATUS",t),window.onbeforeunload=null)}},s=window.jQuery||jQuery,c=function(e){return{state:s.extend({status:"successful",countCurrentRequest:0,i18n:s.extend({},e.i18n)},e.root),getters:r,mutations:u,actions:i}};n(2);window.$Vue=window.$Vue||Vue,window.$Vuex=window.$Vuex||Vuex;var a=window.jQuery;a(document).ready((function(){window.LP_Question_Store=new $Vuex.Store(c(lp_question_editor)),Object(o.a)({ns:"LPQuestionEditorRequest",store:LP_Question_Store}),setTimeout((function(){a("#admin-editor-lp_question").length&&(window.LP_Question_Editor=new $Vue({el:"#admin-editor-lp_question",template:"<lp-question-editor></lp-question-editor>"}))}),100)}))},2:function(e,t){var n;n=jQuery,window.FIB={getSelectedText:function(){var e="";if(void 0!==window.getSelection){var t=window.getSelection();if(t.rangeCount){for(var n=document.createElement("div"),o=0,r=t.rangeCount;o<r;++o)n.appendChild(t.getRangeAt(o).cloneContents());e=n.innerHTML}}else void 0!==document.selection&&"Text"===document.selection.type&&(e=document.selection.createRange().htmlText);return e},createTextNode:function(e){return document.createTextNode(e)},isContainHtml:function(e){var t=n(e),o="b.fib-blank";return t.is(o)||t.find(o).length||t.parent().is(o)},getSelectionRange:function(){var e="";return window.getSelection?e=window.getSelection():document.getSelection?e=document.getSelection():document.selection&&(e=document.selection.createRange().text),e},outerHTML:function(e){return n("<div>").append(n(e).clone()).html()},doUpgrade:function(e){n.ajax({url:"",data:{"lp-ajax":"fib-upgrade"},success:function(t){console.log(t),e&&e.call(t)}})}},n(document).ready((function(){n("#do-upgrade-fib").on("click",(function(){var e=n(this).prop("disabled",!0).addClass("ajaxloading");FIB.doUpgrade((function(){e.prop("disabled",!1).removeClass("ajaxloading")}))}))}))}});
assets/js/dist/admin/editor/quiz.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([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")}))}))}))}});
assets/js/dist/admin/pages/search-lp-addons-themes.js ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/search-lp-addons-themes.js");
85
+ /******/ })
86
+ /************************************************************************/
87
+ /******/ ({
88
+
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/search-lp-addons-themes.js":
90
+ /*!**********************************************************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/search-lp-addons-themes.js ***!
92
+ \**********************************************************************************************************************************************************************************/
93
+ /*! no static exports found */
94
+ /***/ (function(module, exports) {
95
+
96
+ (function ($) {
97
+ var timer = null,
98
+ $wraps = null,
99
+ $cloneWraps = null;
100
+
101
+ var onSearch = function onSearch(keyword) {
102
+ if (!$cloneWraps) {
103
+ $cloneWraps = $wraps.clone();
104
+ }
105
+
106
+ var keywords = keyword.toLowerCase().split(/\s+/).filter(function (a, b) {
107
+ return a.length >= 3;
108
+ });
109
+
110
+ var foundItems = function foundItems($w1, $w2) {
111
+ return $w1.find('.plugin-card').each(function () {
112
+ var $item = $(this),
113
+ itemText = $item.find('.item-title').text().toLowerCase(),
114
+ itemDesc = $item.find('.column-description, .theme-description').text();
115
+
116
+ var found = function found() {
117
+ var reg = new RegExp(keywords.join('|'), 'ig');
118
+ return itemText.match(reg) || itemDesc.match(reg);
119
+ };
120
+
121
+ if (keywords.length) {
122
+ if (found()) {
123
+ var $clone = $item.clone();
124
+ $w2.append($clone);
125
+ }
126
+ } else {
127
+ $w2.append($item.clone());
128
+ }
129
+ });
130
+ };
131
+
132
+ $wraps.each(function (i) {
133
+ var $this = $(this).html(''),
134
+ $items = foundItems($cloneWraps.eq(i), $this),
135
+ count = $this.children().length;
136
+ $this.prev('h2').find('span').html(count);
137
+ });
138
+ };
139
+
140
+ $(document).on('keyup', '.lp-search-addon', function (e) {
141
+ timer && clearTimeout(timer);
142
+ timer = setTimeout(onSearch, 300, e.target.value);
143
+ });
144
+ jQuery(function () {
145
+ $wraps = $('.addons-browse');
146
+ });
147
+ })(jQuery);
148
+
149
+ /***/ })
150
+
151
+ /******/ });
152
+ //# sourceMappingURL=search-lp-addons-themes.js.map
assets/js/dist/admin/pages/search-lp-addons-themes.min.js ADDED
@@ -0,0 +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=9)}({9:function(e,n){var t,r,o,i,u;t=jQuery,r=null,o=null,i=null,u=function(e){i||(i=o.clone());var n=e.toLowerCase().split(/\s+/).filter((function(e,n){return e.length>=3}));o.each((function(e){var r,o,u=t(this).html(""),l=(r=i.eq(e),o=u,r.find(".plugin-card").each((function(){var e,r=t(this),i=r.find(".item-title").text().toLowerCase(),u=r.find(".column-description, .theme-description").text();if(n.length){if(e=new RegExp(n.join("|"),"ig"),i.match(e)||u.match(e)){var l=r.clone();o.append(l)}}else o.append(r.clone())})),u.children().length);u.prev("h2").find("span").html(l)}))},t(document).on("keyup",".lp-search-addon",(function(e){r&&clearTimeout(r),r=setTimeout(u,300,e.target.value)})),jQuery((function(){o=t(".addons-browse")}))}});
assets/js/dist/admin/pages/setup.js ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/setup.js");
85
+ /******/ })
86
+ /************************************************************************/
87
+ /******/ ({
88
+
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/setup.js":
90
+ /*!****************************************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/setup.js ***!
92
+ \****************************************************************************************************************************************************************/
93
+ /*! no static exports found */
94
+ /***/ (function(module, exports) {
95
+
96
+ (function ($) {
97
+ 'use strict';
98
+
99
+ var $main, $setupForm;
100
+
101
+ var checkForm = function checkForm($form) {
102
+ var $emails = $form.find('input[type="email"]');
103
+ var valid = true;
104
+ $emails.each(function () {
105
+ var $this = $(this);
106
+ $this.css('border-color', '');
107
+
108
+ switch ($this.attr('name')) {
109
+ case 'settings[paypal][paypal_email]':
110
+ case 'settings[paypal][paypal_sandbox_email]':
111
+ if (!$this.closest('tr').prev().find('input[type="checkbox"]').is(':checked')) {
112
+ return;
113
+ }
114
+
115
+ break;
116
+ }
117
+
118
+ if (!isEmail(this.value)) {
119
+ valid = false;
120
+ $this.css('border-color', '#FF0000');
121
+ }
122
+ });
123
+ return valid;
124
+ };
125
+
126
+ var blockContent = function blockContent(block) {
127
+ $main.toggleClass('loading', block === undefined ? true : block);
128
+ };
129
+
130
+ var getFormData = function getFormData(more) {
131
+ $setupForm = $('#learn-press-setup-form');
132
+ var data = $setupForm.serializeJSON();
133
+ return $.extend(data, more || {});
134
+ };
135
+
136
+ var replaceMainContent = function replaceMainContent(newContent) {
137
+ var $newContent = $(newContent);
138
+ $main.replaceWith($newContent);
139
+ $main = $newContent;
140
+ };
141
+
142
+ var navPages = function navPages(e) {
143
+ e.preventDefault();
144
+
145
+ if (!checkForm($setupForm)) {
146
+ return;
147
+ }
148
+
149
+ var loadUrl = $(this).attr('href');
150
+ $main.addClass('loading');
151
+ $.post({
152
+ url: loadUrl,
153
+ data: getFormData(),
154
+ success: function success(res) {
155
+ var $html = $(res);
156
+ replaceMainContent($html.contents().filter('#main'));
157
+ LP.setUrl(loadUrl);
158
+ $('.learn-press-dropdown-pages').LP('DropdownPages');
159
+ $('.learn-press-tip').LP('QuickTip');
160
+ $main.removeClass('loading');
161
+ }
162
+ });
163
+ };
164
+
165
+ var updateCurrency = function updateCurrency() {
166
+ var m = $(this).children(':selected').html().match(/\((.*)\)/),
167
+ symbol = m ? m[1] : '';
168
+ $('#currency-pos').children().each(function () {
169
+ var $option = $(this);
170
+ var text = $option.html();
171
+
172
+ switch ($option.val()) {
173
+ case 'left':
174
+ text = text.replace(/\( (.*)69/, '( ' + symbol + '69');
175
+ break;
176
+
177
+ case 'right':
178
+ text = text.replace(/9([^0-9]*) \)/, '9' + symbol + ' )');
179
+ break;
180
+
181
+ case 'left_with_space':
182
+ text = text.replace(/\( (.*) 6/, '( ' + symbol + ' 6');
183
+ break;
184
+
185
+ case 'right_with_space':
186
+ text = text.replace(/9 (.*) \)/, '9 ' + symbol + ' )');
187
+ break;
188
+ }
189
+
190
+ $option.html(text);
191
+ });
192
+ };
193
+
194
+ var updatePrice = function updatePrice() {
195
+ $.post({
196
+ url: '',
197
+ dataType: 'html',
198
+ data: getFormData({
199
+ 'lp-ajax': 'get-price-format'
200
+ }),
201
+ success: function success(res) {
202
+ $('#preview-price').html(res);
203
+ }
204
+ });
205
+ };
206
+
207
+ var createPages = function createPages(e) {
208
+ e.preventDefault();
209
+ blockContent();
210
+ $.post({
211
+ url: $(this).attr('href'),
212
+ dataType: 'html',
213
+ data: getFormData({
214
+ 'lp-ajax': 'setup-create-pages'
215
+ }),
216
+ success: function success(res) {
217
+ replaceMainContent($(res).contents().filter('#main'));
218
+ $('.learn-press-dropdown-pages').LP('DropdownPages');
219
+ blockContent(false);
220
+ }
221
+ });
222
+ };
223
+
224
+ var installSampleCourse = function installSampleCourse(e) {
225
+ e.preventDefault();
226
+ var $button = $(this);
227
+ blockContent();
228
+ $.post({
229
+ url: $(this).attr('href'),
230
+ dataType: 'html',
231
+ data: {},
232
+ success: function success(res) {
233
+ blockContent(false);
234
+ $button.replaceWith($(res).find('a:first').addClass('button button-primary'));
235
+ }
236
+ });
237
+ };
238
+
239
+ function isEmail(email) {
240
+ var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
241
+ return re.test(email);
242
+ }
243
+
244
+ $(function () {
245
+ $main = $('#main');
246
+ $setupForm = $('#learn-press-setup-form');
247
+ $('.learn-press-select2').select2();
248
+ $(document).on('click', '.buttons .button', navPages).on('change', '#currency', updateCurrency).on('change', 'input, select', updatePrice).on('click', '#create-pages', createPages).on('click', '#install-sample-course', installSampleCourse);
249
+ });
250
+ })(jQuery);
251
+
252
+ /***/ })
253
+
254
+ /******/ });
255
+ //# sourceMappingURL=setup.js.map
assets/js/dist/admin/pages/setup.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !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}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=6)}({6:function(e,t){!function(e){"use strict";var t,r,n=function(e){t.toggleClass("loading",void 0===e||e)},a=function(t){var n=(r=e("#learn-press-setup-form")).serializeJSON();return e.extend(n,t||{})},s=function(r){var n=e(r);t.replaceWith(n),t=n},c=function(n){if(n.preventDefault(),c=r.find('input[type="email"]'),o=!0,c.each((function(){var t,r=e(this);switch(r.css("border-color",""),r.attr("name")){case"settings[paypal][paypal_email]":case"settings[paypal][paypal_sandbox_email]":if(!r.closest("tr").prev().find('input[type="checkbox"]').is(":checked"))return}t=this.value,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)||(o=!1,r.css("border-color","#FF0000"))})),o){var c,o,i=e(this).attr("href");t.addClass("loading"),e.post({url:i,data:a(),success:function(r){var n=e(r);s(n.contents().filter("#main")),LP.setUrl(i),e(".learn-press-dropdown-pages").LP("DropdownPages"),e(".learn-press-tip").LP("QuickTip"),t.removeClass("loading")}})}},o=function(){var t=e(this).children(":selected").html().match(/\((.*)\)/),r=t?t[1]:"";e("#currency-pos").children().each((function(){var t=e(this),n=t.html();switch(t.val()){case"left":n=n.replace(/\( (.*)69/,"( "+r+"69");break;case"right":n=n.replace(/9([^0-9]*) \)/,"9"+r+" )");break;case"left_with_space":n=n.replace(/\( (.*) 6/,"( "+r+" 6");break;case"right_with_space":n=n.replace(/9 (.*) \)/,"9 "+r+" )")}t.html(n)}))},i=function(){e.post({url:"",dataType:"html",data:a({"lp-ajax":"get-price-format"}),success:function(t){e("#preview-price").html(t)}})},l=function(t){t.preventDefault(),n(),e.post({url:e(this).attr("href"),dataType:"html",data:a({"lp-ajax":"setup-create-pages"}),success:function(t){s(e(t).contents().filter("#main")),e(".learn-press-dropdown-pages").LP("DropdownPages"),n(!1)}})},u=function(t){t.preventDefault();var r=e(this);n(),e.post({url:e(this).attr("href"),dataType:"html",data:{},success:function(t){n(!1),r.replaceWith(e(t).find("a:first").addClass("button button-primary"))}})};e((function(){t=e("#main"),r=e("#learn-press-setup-form"),e(".learn-press-select2").select2(),e(document).on("click",".buttons .button",c).on("change","#currency",o).on("change","input, select",i).on("click","#create-pages",l).on("click","#install-sample-course",u)}))}(jQuery)}});
assets/js/dist/admin/pages/statistic.js ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/statistic.js");
85
+ /******/ })
86
+ /************************************************************************/
87
+ /******/ ({
88
+
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/statistic.js":
90
+ /*!********************************************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/statistic.js ***!
92
+ \********************************************************************************************************************************************************************/
93
+ /*! no static exports found */
94
+ /***/ (function(module, exports) {
95
+
96
+ (function ($) {
97
+ $.fn.LP_Chart_Line = function (data, config) {
98
+ return $.each(this, function () {
99
+ var $elem = $(this),
100
+ $canvas = $('<canvas />');
101
+ $elem.html('');
102
+ $canvas.appendTo($elem);
103
+ new Chart($canvas.get(0).getContext('2d')).Line(data, config);
104
+ }); //
105
+ };
106
+
107
+ $.fn.LP_Statistic_Users = function () {
108
+ if (parseInt($(this).length) === 0) {
109
+ return;
110
+ }
111
+
112
+ return $.each(this, function () {
113
+ var $buttons = $('.chart-buttons button').on('click', function () {
114
+ var $button = $(this),
115
+ type = $button.data('type');
116
+ var from = '',
117
+ to = '';
118
+ $buttons.not(this).not('[data-type="user-custom-time"]').prop('disabled', false);
119
+
120
+ if (type == 'user-custom-time') {
121
+ from = $('#user-custom-time input[name="from"]').val();
122
+ to = $('#user-custom-time input[name="to"]').val();
123
+
124
+ if (from == '' || to == '') {
125
+ return false;
126
+ }
127
+ } else {
128
+ $button.prop('disabled', true);
129
+ }
130
+
131
+ var $container = $('#learn-press-chart');
132
+ $container.addClass('loading');
133
+ $.ajax({
134
+ url: 'admin-ajax.php',
135
+ data: {
136
+ action: 'learnpress_load_chart',
137
+ type: type,
138
+ range: [from, to]
139
+ },
140
+ dataType: 'text',
141
+ success: function success(response) {
142
+ response = LP.parseJSON(response);
143
+ $container.LP_Chart_Line(response, LP_Chart_Config);
144
+ $container.removeClass('loading');
145
+ }
146
+ });
147
+ return false;
148
+ }),
149
+ $inputs = $('.chart-buttons #user-custom-time input[type="text"]').on('change', function () {
150
+ var _valid_date = function _valid_date() {
151
+ if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
152
+ return true;
153
+ }
154
+ };
155
+
156
+ $buttons.filter('[data-type="user-custom-time"]').prop('disabled', $inputs.filter(function () {
157
+ return this.value == '';
158
+ }).get().length || !_valid_date());
159
+ });
160
+ });
161
+ };
162
+
163
+ $.fn.LP_Statistic_Courses = function () {
164
+ if (parseInt($(this).length) === 0) {
165
+ return;
166
+ }
167
+
168
+ return $.each(this, function () {
169
+ var $buttons = $('.chart-buttons button').on('click', function () {
170
+ var $button = $(this),
171
+ type = $button.data('type'),
172
+ from = '',
173
+ to = '',
174
+ $container = $('#learn-press-chart');
175
+ $buttons.not(this).not('[data-type="course-custom-time"]').prop('disabled', false);
176
+
177
+ if (type == 'course-custom-time') {
178
+ from = $('#course-custom-time input[name="from"]').val();
179
+ to = $('#course-custom-time input[name="to"]').val();
180
+
181
+ if (from == '' || to == '') {
182
+ return false;
183
+ }
184
+ } else {
185
+ $button.prop('disabled', true);
186
+ }
187
+
188
+ $container.addClass('loading');
189
+ $.ajax({
190
+ url: 'admin-ajax.php',
191
+ data: {
192
+ action: 'learnpress_load_chart',
193
+ type: type,
194
+ range: [from, to]
195
+ },
196
+ dataType: 'text',
197
+ success: function success(response) {
198
+ response = LP.parseJSON(response);
199
+ $container.LP_Chart_Line(response, LP_Chart_Config);
200
+ $container.removeClass('loading');
201
+ }
202
+ });
203
+ return false;
204
+ }),
205
+ $inputs = $('.chart-buttons #course-custom-time input[type="text"]').on('change', function () {
206
+ var _valid_date = function _valid_date() {
207
+ if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
208
+ return true;
209
+ }
210
+ };
211
+
212
+ $buttons.filter('[data-type="course-custom-time"]').prop('disabled', $inputs.filter(function () {
213
+ return this.value == '';
214
+ }).get().length || !_valid_date());
215
+ });
216
+ });
217
+ };
218
+
219
+ $.fn.LP_Statistic_Orders = function () {
220
+ if (parseInt($(this).length) === 0) {
221
+ return;
222
+ }
223
+
224
+ $('.panel_report_option').hide();
225
+ $('#panel_report_sales_by_' + $('#report_sales_by').val()).show();
226
+ $('#report_sales_by').on('change', function () {
227
+ $('.panel_report_option').hide();
228
+ $('#panel_report_sales_by_' + $(this).val()).show();
229
+
230
+ if ('date' == $(this).val()) {
231
+ LP_Statistic_Orders_Upgrade_Chart();
232
+ }
233
+ });
234
+ /**
235
+ * Upgrade Chart for Order Statistics
236
+ *
237
+ * @return {boolean}
238
+ */
239
+
240
+ var LP_Statistic_Orders_Upgrade_Chart = function LP_Statistic_Orders_Upgrade_Chart() {
241
+ var type = '',
242
+ from = '',
243
+ to = '',
244
+ report_sales_by = 'date',
245
+ cat_id = 0,
246
+ course_id = 0;
247
+ report_sales_by = $('#report_sales_by').val();
248
+ $container = $('#learn-press-chart');
249
+ $container.addClass('loading'); // get type
250
+
251
+ var $buttons = $('.chart-buttons button:disabled').not('[data-type="order-custom-time"]');
252
+
253
+ if (parseInt($buttons.length) > 0) {
254
+ type = $($buttons[0]).data('type');
255
+ } else {
256
+ type = 'order-custom-time';
257
+ from = $('#order-custom-time input[name="from"]').val();
258
+ to = $('#order-custom-time input[name="to"]').val();
259
+
260
+ if (from == '' || to == '') {
261
+ return false;
262
+ }
263
+ }
264
+
265
+ if ('course' === report_sales_by) {
266
+ course_id = $('#report-by-course-id').val();
267
+ } else if ('category' === report_sales_by) {
268
+ cat_id = $('#report-by-course-category-id').val();
269
+ }
270
+
271
+ $.ajax({
272
+ url: 'admin-ajax.php',
273
+ data: {
274
+ action: 'learnpress_load_chart',
275
+ type: type,
276
+ range: [from, to],
277
+ report_sales_by: report_sales_by,
278
+ course_id: course_id,
279
+ cat_id: cat_id
280
+ },
281
+ dataType: 'text',
282
+ success: function success(response) {
283
+ response = LP.parseJSON(response);
284
+ $container.LP_Chart_Line(response, LP_Chart_Config);
285
+ $container.removeClass('loading');
286
+ }
287
+ });
288
+ };
289
+
290
+ $('#report-by-course-id').select2({
291
+ placeholder: 'Select a course',
292
+ minimumInputLength: 1,
293
+ ajax: {
294
+ url: ajaxurl + '?action=learnpress_search_course',
295
+ dataType: 'json',
296
+ quietMillis: 250,
297
+ data: function data(term, page) {
298
+ return {
299
+ q: term // search term
300
+
301
+ };
302
+ },
303
+ results: function results(data, page) {
304
+ return {
305
+ results: data.items
306
+ };
307
+ },
308
+ cache: true
309
+ }
310
+ });
311
+ $('#report-by-course-id').on('change', function () {
312
+ LP_Statistic_Orders_Upgrade_Chart();
313
+ });
314
+ $('#report-by-course-category-id').select2({
315
+ placeholder: 'Select a course',
316
+ minimumInputLength: 1,
317
+ ajax: {
318
+ url: ajaxurl + '?action=learnpress_search_course_category',
319
+ dataType: 'json',
320
+ quietMillis: 250,
321
+ data: function data(term, page) {
322
+ return {
323
+ q: term // search term
324
+
325
+ };
326
+ },
327
+ results: function results(data, page) {
328
+ return {
329
+ results: data.items
330
+ };
331
+ },
332
+ cache: true
333
+ }
334
+ });
335
+ $('#report-by-course-category-id').on('change', function () {
336
+ LP_Statistic_Orders_Upgrade_Chart();
337
+ });
338
+ var $buttons = $('.chart-buttons button').on('click', function () {
339
+ var $button = $(this),
340
+ type = $button.data('type'),
341
+ from = '',
342
+ to = '',
343
+ $container = $('#learn-press-chart');
344
+ $buttons.not(this).not('[data-type="order-custom-time"]').prop('disabled', false);
345
+
346
+ if (type !== 'order-custom-time') {
347
+ $button.prop('disabled', true);
348
+ $('#order-custom-time input[name="from"]').val('');
349
+ $('#order-custom-time input[name="to"]').val('');
350
+ }
351
+
352
+ LP_Statistic_Orders_Upgrade_Chart();
353
+ return false;
354
+ });
355
+ var $inputs = $('.chart-buttons #order-custom-time input[type="text"]').on('change', function () {
356
+ var _valid_date = function _valid_date() {
357
+ if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
358
+ return true;
359
+ }
360
+ };
361
+
362
+ $buttons.filter('[data-type="order-custom-time"]').prop('disabled', $inputs.filter(function () {
363
+ return this.value == '';
364
+ }).get().length || !_valid_date());
365
+ });
366
+ };
367
+
368
+ $(function () {
369
+ if (typeof $.fn.datepicker != 'undefined') {
370
+ $('.date-picker').datepicker({
371
+ dateFormat: 'yy/mm/dd'
372
+ });
373
+ }
374
+
375
+ $('.learn-press-statistic-users').LP_Statistic_Users();
376
+ $('.learn-press-statistic-courses').LP_Statistic_Courses();
377
+ $('.learn-press-statistic-orders').LP_Statistic_Orders();
378
+ });
379
+ return;
380
+ })(jQuery);
381
+
382
+ /***/ })
383
+
384
+ /******/ });
385
+ //# sourceMappingURL=statistic.js.map
assets/js/dist/admin/pages/statistic.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}({7:function(t,e){var r;(r=jQuery).fn.LP_Chart_Line=function(t,e){return r.each(this,(function(){var n=r(this),a=r("<canvas />");n.html(""),a.appendTo(n),new Chart(a.get(0).getContext("2d")).Line(t,e)}))},r.fn.LP_Statistic_Users=function(){if(0!==parseInt(r(this).length))return r.each(this,(function(){var t=r(".chart-buttons button").on("click",(function(){var e=r(this),n=e.data("type"),a="",o="";if(t.not(this).not('[data-type="user-custom-time"]').prop("disabled",!1),"user-custom-time"==n){if(a=r('#user-custom-time input[name="from"]').val(),o=r('#user-custom-time input[name="to"]').val(),""==a||""==o)return!1}else e.prop("disabled",!0);var i=r("#learn-press-chart");return i.addClass("loading"),r.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:n,range:[a,o]},dataType:"text",success:function(t){t=LP.parseJSON(t),i.LP_Chart_Line(t,LP_Chart_Config),i.removeClass("loading")}}),!1})),e=r('.chart-buttons #user-custom-time input[type="text"]').on("change",(function(){t.filter('[data-type="user-custom-time"]').prop("disabled",e.filter((function(){return""==this.value})).get().length||!function(){if(new Date(e[0].value)<new Date(e[1].value))return!0}())}))}))},r.fn.LP_Statistic_Courses=function(){if(0!==parseInt(r(this).length))return r.each(this,(function(){var t=r(".chart-buttons button").on("click",(function(){var e=r(this),n=e.data("type"),a="",o="",i=r("#learn-press-chart");if(t.not(this).not('[data-type="course-custom-time"]').prop("disabled",!1),"course-custom-time"==n){if(a=r('#course-custom-time input[name="from"]').val(),o=r('#course-custom-time input[name="to"]').val(),""==a||""==o)return!1}else e.prop("disabled",!0);return i.addClass("loading"),r.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:n,range:[a,o]},dataType:"text",success:function(t){t=LP.parseJSON(t),i.LP_Chart_Line(t,LP_Chart_Config),i.removeClass("loading")}}),!1})),e=r('.chart-buttons #course-custom-time input[type="text"]').on("change",(function(){t.filter('[data-type="course-custom-time"]').prop("disabled",e.filter((function(){return""==this.value})).get().length||!function(){if(new Date(e[0].value)<new Date(e[1].value))return!0}())}))}))},r.fn.LP_Statistic_Orders=function(){if(0!==parseInt(r(this).length)){r(".panel_report_option").hide(),r("#panel_report_sales_by_"+r("#report_sales_by").val()).show(),r("#report_sales_by").on("change",(function(){r(".panel_report_option").hide(),r("#panel_report_sales_by_"+r(this).val()).show(),"date"==r(this).val()&&t()}));var t=function(){var t,e="",n="",a="",o=0,i=0;t=r("#report_sales_by").val(),$container=r("#learn-press-chart"),$container.addClass("loading");var s=r(".chart-buttons button:disabled").not('[data-type="order-custom-time"]');if(parseInt(s.length)>0)e=r(s[0]).data("type");else if(e="order-custom-time",n=r('#order-custom-time input[name="from"]').val(),a=r('#order-custom-time input[name="to"]').val(),""==n||""==a)return!1;"course"===t?i=r("#report-by-course-id").val():"category"===t&&(o=r("#report-by-course-category-id").val()),r.ajax({url:"admin-ajax.php",data:{action:"learnpress_load_chart",type:e,range:[n,a],report_sales_by:t,course_id:i,cat_id:o},dataType:"text",success:function(t){t=LP.parseJSON(t),$container.LP_Chart_Line(t,LP_Chart_Config),$container.removeClass("loading")}})};r("#report-by-course-id").select2({placeholder:"Select a course",minimumInputLength:1,ajax:{url:ajaxurl+"?action=learnpress_search_course",dataType:"json",quietMillis:250,data:function(t,e){return{q:t}},results:function(t,e){return{results:t.items}},cache:!0}}),r("#report-by-course-id").on("change",(function(){t()})),r("#report-by-course-category-id").select2({placeholder:"Select a course",minimumInputLength:1,ajax:{url:ajaxurl+"?action=learnpress_search_course_category",dataType:"json",quietMillis:250,data:function(t,e){return{q:t}},results:function(t,e){return{results:t.items}},cache:!0}}),r("#report-by-course-category-id").on("change",(function(){t()}));var e=r(".chart-buttons button").on("click",(function(){var n=r(this),a=n.data("type");return r("#learn-press-chart"),e.not(this).not('[data-type="order-custom-time"]').prop("disabled",!1),"order-custom-time"!==a&&(n.prop("disabled",!0),r('#order-custom-time input[name="from"]').val(""),r('#order-custom-time input[name="to"]').val("")),t(),!1})),n=r('.chart-buttons #order-custom-time input[type="text"]').on("change",(function(){e.filter('[data-type="order-custom-time"]').prop("disabled",n.filter((function(){return""==this.value})).get().length||!function(){if(new Date(n[0].value)<new Date(n[1].value))return!0}())}))}},r((function(){void 0!==r.fn.datepicker&&r(".date-picker").datepicker({dateFormat:"yy/mm/dd"}),r(".learn-press-statistic-users").LP_Statistic_Users(),r(".learn-press-statistic-courses").LP_Statistic_Courses(),r(".learn-press-statistic-orders").LP_Statistic_Orders()}))}});
assets/js/dist/admin/pages/sync-data.js ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/sync-data.js");
85
+ /******/ })
86
+ /************************************************************************/
87
+ /******/ ({
88
+
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/sync-data.js":
90
+ /*!********************************************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/sync-data.js ***!
92
+ \********************************************************************************************************************************************************************/
93
+ /*! no static exports found */
94
+ /***/ (function(module, exports) {
95
+
96
+ (function ($) {
97
+ var Sync_Base = {
98
+ id: 'sync-base',
99
+ syncing: false,
100
+ items: false,
101
+ completed: false,
102
+ callback: null,
103
+ methodGetItems: '',
104
+ itemsKey: '',
105
+ chunkSize: 50,
106
+ sync: function sync(callback) {
107
+ if (this.syncing) {
108
+ return;
109
+ }
110
+
111
+ this.callback = callback;
112
+
113
+ if (this.items === false) {
114
+ this.get_items();
115
+ } else if (!this.dispatch()) {
116
+ this.completed = true;
117
+ this.callToCallback();
118
+ return;
119
+ }
120
+
121
+ this.syncing = true;
122
+ },
123
+ init: function init() {
124
+ this.syncing = false;
125
+ this.items = false;
126
+ this.completed = false;
127
+ },
128
+ is_completed: function is_completed() {
129
+ return this.completed;
130
+ },
131
+ dispatch: function dispatch() {
132
+ var that = this,
133
+ items = this.items ? this.items.splice(0, this.chunkSize) : false;
134
+
135
+ if (!items || items.length === 0) {
136
+ return false;
137
+ }
138
+
139
+ $.ajax({
140
+ url: '',
141
+ data: {
142
+ 'lp-ajax': this.id,
143
+ sync: items
144
+ },
145
+ method: 'post',
146
+ success: function success(response) {
147
+ response = LP.parseJSON(response);
148
+ that.syncing = false;
149
+
150
+ if (response.result !== 'success') {
151
+ that.completed = true;
152
+ }
153
+
154
+ that.callToCallback();
155
+
156
+ if (that.is_completed()) {
157
+ return;
158
+ }
159
+
160
+ that.sync(that.callback);
161
+ }
162
+ });
163
+ return true;
164
+ },
165
+ callToCallback: function callToCallback() {
166
+ this.callback && this.callback.call(this);
167
+ },
168
+ get_items: function get_items() {
169
+ var that = this;
170
+ $.ajax({
171
+ url: '',
172
+ data: {
173
+ 'lp-ajax': this.id,
174
+ sync: this.methodGetItems
175
+ },
176
+ success: function success(response) {
177
+ that.syncing = false;
178
+ response = LP.parseJSON(response);
179
+
180
+ if (response[that.itemsKey]) {
181
+ that.items = response[that.itemsKey];
182
+ that.sync(that.callback);
183
+ } else {
184
+ that.completed = true;
185
+ that.items = [];
186
+ that.callToCallback();
187
+ }
188
+ }
189
+ });
190
+ }
191
+ };
192
+ var Sync_Course_Orders = $.extend({}, Sync_Base, {
193
+ id: 'sync-course-orders',
194
+ methodGetItems: 'get-courses',
195
+ itemsKey: 'courses'
196
+ });
197
+ var Sync_User_Courses = $.extend({}, Sync_Base, {
198
+ id: 'sync-user-courses',
199
+ methodGetItems: 'get-users',
200
+ itemsKey: 'users',
201
+ chunkSize: 500
202
+ });
203
+ var Sync_User_Orders = $.extend({}, Sync_Base, {
204
+ id: 'sync-user-orders',
205
+ methodGetItems: 'get-users',
206
+ itemsKey: 'users',
207
+ chunkSize: 500
208
+ });
209
+ var Sync_Course_Final_Quiz = $.extend({}, Sync_Base, {
210
+ id: 'sync-course-final-quiz',
211
+ methodGetItems: 'get-courses',
212
+ itemsKey: 'courses',
213
+ chunkSize: 500
214
+ });
215
+ var Sync_Remove_Older_Data = $.extend({}, Sync_Base, {
216
+ id: 'sync-remove-older-data',
217
+ methodGetItems: 'remove-older-data',
218
+ itemsKey: '_nothing_here',
219
+ chunkSize: 500
220
+ });
221
+ var Sync_Calculate_Course_Results = $.extend({}, Sync_Base, {
222
+ id: 'sync-calculate-course-results',
223
+ methodGetItems: 'get-users',
224
+ itemsKey: 'users',
225
+ chunkSize: 1
226
+ });
227
+ window.LP_Sync_Data = {
228
+ syncs: [],
229
+ syncing: 0,
230
+ options: {},
231
+ start: function start(options) {
232
+ this.syncs = [];
233
+ this.options = $.extend({
234
+ onInit: function onInit() {},
235
+ onStart: function onStart() {},
236
+ onCompleted: function onCompleted() {},
237
+ onCompletedAll: function onCompletedAll() {}
238
+ }, options || {});
239
+
240
+ if (!this.get_syncs()) {
241
+ return;
242
+ }
243
+
244
+ this.reset();
245
+ this.options.onInit.call(this);
246
+
247
+ var that = this,
248
+ syncing = 0,
249
+ totalSyncs = this.syncs.length,
250
+ syncCallback = function syncCallback($sync) {
251
+ if ($sync.is_completed()) {
252
+ syncing++;
253
+ that.options.onCompleted.call(that, $sync);
254
+
255
+ if (syncing >= totalSyncs) {
256
+ that.options.onCompletedAll.call(that);
257
+ return;
258
+ }
259
+
260
+ that.sync(syncing, syncCallback);
261
+ }
262
+ };
263
+
264
+ this.sync(syncing, syncCallback);
265
+ },
266
+ reset: function reset() {
267
+ for (var sync in this.syncs) {
268
+ try {
269
+ this[this.syncs[sync]].init();
270
+ } catch (e) {}
271
+ }
272
+ },
273
+ sync: function sync(_sync, callback) {
274
+ var that = this,
275
+ $sync = this[this.syncs[_sync]];
276
+ that.options.onStart.call(that, $sync);
277
+ $sync.sync(function () {
278
+ callback.call(that, $sync);
279
+ });
280
+ },
281
+ get_syncs: function get_syncs() {
282
+ var syncs = $('input[name^="lp-repair"]:checked').serializeJSON()['lp-repair'];
283
+
284
+ if (!syncs) {
285
+ return false;
286
+ }
287
+
288
+ for (var sync in syncs) {
289
+ if (syncs[sync] !== 'yes') {
290
+ continue;
291
+ }
292
+
293
+ sync = sync.replace(/[-]+/g, '_');
294
+
295
+ if (!this[sync]) {
296
+ continue;
297
+ }
298
+
299
+ this.syncs.push(sync);
300
+ }
301
+
302
+ return this.syncs;
303
+ },
304
+ get_sync: function get_sync(id) {
305
+ id = id.replace(/[-]+/g, '_');
306
+ return this[id];
307
+ },
308
+ sync_course_orders: Sync_Course_Orders,
309
+ sync_user_orders: Sync_User_Orders,
310
+ sync_user_courses: Sync_User_Courses,
311
+ sync_course_final_quiz: Sync_Course_Final_Quiz,
312
+ sync_remove_older_data: Sync_Remove_Older_Data,
313
+ sync_calculate_course_results: Sync_Calculate_Course_Results
314
+ };
315
+ $(document).ready(function () {
316
+ function initSyncs() {
317
+ var $chkAll = $('#learn-press-check-all-syncs'),
318
+ $chks = $('#learn-press-syncs').find('[name^="lp-repair"]');
319
+ $chkAll.on('click', function () {
320
+ $chks.prop('checked', this.checked);
321
+ });
322
+ $chks.on('click', function () {
323
+ $chkAll.prop('checked', $chks.filter(':checked').length === $chks.length);
324
+ });
325
+ }
326
+
327
+ initSyncs();
328
+ }).on('click', '.lp-button-repair', function () {
329
+ function getInput(sync) {
330
+ return $('ul#learn-press-syncs').find('input[name*="' + sync + '"]');
331
+ }
332
+
333
+ LP_Sync_Data.start({
334
+ onInit: function onInit() {
335
+ $('ul#learn-press-syncs').children().removeClass('syncing synced');
336
+ $('.lp-button-repair').prop('disabled', true);
337
+ },
338
+ onStart: function onStart($sync) {
339
+ getInput($sync.id).closest('li').addClass('syncing');
340
+ },
341
+ onCompleted: function onCompleted($sync) {
342
+ getInput($sync.id).closest('li').removeClass('syncing').addClass('synced');
343
+ },
344
+ onCompletedAll: function onCompletedAll() {
345
+ $('ul#learn-press-syncs').children().removeClass('syncing synced');
346
+ $('.lp-button-repair').prop('disabled', false);
347
+ }
348
+ });
349
+ });
350
+ })(jQuery);
351
+
352
+ /***/ })
353
+
354
+ /******/ });
355
+ //# sourceMappingURL=sync-data.js.map
assets/js/dist/admin/pages/sync-data.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function s(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,s),i.l=!0,i.exports}s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=8)}({8:function(e,t){var s,n,i,c,r,o,l,a;s=jQuery,n={id:"sync-base",syncing:!1,items:!1,completed:!1,callback:null,methodGetItems:"",itemsKey:"",chunkSize:50,sync:function(e){if(!this.syncing){if(this.callback=e,!1===this.items)this.get_items();else if(!this.dispatch())return this.completed=!0,void this.callToCallback();this.syncing=!0}},init:function(){this.syncing=!1,this.items=!1,this.completed=!1},is_completed:function(){return this.completed},dispatch:function(){var e=this,t=!!this.items&&this.items.splice(0,this.chunkSize);return!(!t||0===t.length||(s.ajax({url:"",data:{"lp-ajax":this.id,sync:t},method:"post",success:function(t){t=LP.parseJSON(t),e.syncing=!1,"success"!==t.result&&(e.completed=!0),e.callToCallback(),e.is_completed()||e.sync(e.callback)}}),0))},callToCallback:function(){this.callback&&this.callback.call(this)},get_items:function(){var e=this;s.ajax({url:"",data:{"lp-ajax":this.id,sync:this.methodGetItems},success:function(t){e.syncing=!1,(t=LP.parseJSON(t))[e.itemsKey]?(e.items=t[e.itemsKey],e.sync(e.callback)):(e.completed=!0,e.items=[],e.callToCallback())}})}},i=s.extend({},n,{id:"sync-course-orders",methodGetItems:"get-courses",itemsKey:"courses"}),c=s.extend({},n,{id:"sync-user-courses",methodGetItems:"get-users",itemsKey:"users",chunkSize:500}),r=s.extend({},n,{id:"sync-user-orders",methodGetItems:"get-users",itemsKey:"users",chunkSize:500}),o=s.extend({},n,{id:"sync-course-final-quiz",methodGetItems:"get-courses",itemsKey:"courses",chunkSize:500}),l=s.extend({},n,{id:"sync-remove-older-data",methodGetItems:"remove-older-data",itemsKey:"_nothing_here",chunkSize:500}),a=s.extend({},n,{id:"sync-calculate-course-results",methodGetItems:"get-users",itemsKey:"users",chunkSize:1}),window.LP_Sync_Data={syncs:[],syncing:0,options:{},start:function(e){if(this.syncs=[],this.options=s.extend({onInit:function(){},onStart:function(){},onCompleted:function(){},onCompletedAll:function(){}},e||{}),this.get_syncs()){this.reset(),this.options.onInit.call(this);var t=this,n=0,i=this.syncs.length;this.sync(n,(function e(s){if(s.is_completed()){if(n++,t.options.onCompleted.call(t,s),n>=i)return void t.options.onCompletedAll.call(t);t.sync(n,e)}}))}},reset:function(){for(var e in this.syncs)try{this[this.syncs[e]].init()}catch(e){}},sync:function(e,t){var s=this,n=this[this.syncs[e]];s.options.onStart.call(s,n),n.sync((function(){t.call(s,n)}))},get_syncs:function(){var e=s('input[name^="lp-repair"]:checked').serializeJSON()["lp-repair"];if(!e)return!1;for(var t in e)"yes"===e[t]&&this[t=t.replace(/[-]+/g,"_")]&&this.syncs.push(t);return this.syncs},get_sync:function(e){return this[e=e.replace(/[-]+/g,"_")]},sync_course_orders:i,sync_user_orders:r,sync_user_courses:c,sync_course_final_quiz:o,sync_remove_older_data:l,sync_calculate_course_results:a},s(document).ready((function(){var e,t;e=s("#learn-press-check-all-syncs"),t=s("#learn-press-syncs").find('[name^="lp-repair"]'),e.on("click",(function(){t.prop("checked",this.checked)})),t.on("click",(function(){e.prop("checked",t.filter(":checked").length===t.length)}))})).on("click",".lp-button-repair",(function(){function e(e){return s("ul#learn-press-syncs").find('input[name*="'+e+'"]')}LP_Sync_Data.start({onInit:function(){s("ul#learn-press-syncs").children().removeClass("syncing synced"),s(".lp-button-repair").prop("disabled",!0)},onStart:function(t){e(t.id).closest("li").addClass("syncing")},onCompleted:function(t){e(t.id).closest("li").removeClass("syncing").addClass("synced")},onCompletedAll:function(){s("ul#learn-press-syncs").children().removeClass("syncing synced"),s(".lp-button-repair").prop("disabled",!1)}})}))}});
assets/js/dist/admin/pages/tools.js CHANGED
@@ -81,21 +81,21 @@
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
- /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/admin/pages/tools.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/admin/pages/tools.js":
90
- /*!***********************************************************************************************************************************************************!*\
91
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/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_modify_step_install_after_activated/learnpress/assets/src/js/admin/pages/tools/database/upgrade.js");
99
 
100
 
101
  (function ($) {
@@ -207,17 +207,17 @@ __webpack_require__.r(__webpack_exports__);
207
 
208
  /***/ }),
209
 
210
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/admin/pages/tools/database/upgrade.js":
211
- /*!****************************************************************************************************************************************************************************!*\
212
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/admin/pages/tools/database/upgrade.js ***!
213
- \****************************************************************************************************************************************************************************/
214
  /*! exports provided: default */
215
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
216
 
217
  "use strict";
218
  __webpack_require__.r(__webpack_exports__);
219
- /* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/utils/lp-modal-overlay.js");
220
- /* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/utils/handle-ajax-api.js");
221
 
222
 
223
  var $ = jQuery;
@@ -232,8 +232,8 @@ var upgradeDB = function upgradeDB() {
232
 
233
  if (elWrapperTermsUpgrade.length) {
234
  // Show Terms Upgrade.
235
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal(elWrapperTermsUpgrade.html());
236
- var elTermUpdate = _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["elLPOverlay"].find('.terms-upgrade');
237
  var elLPAgreeTerm = elTermUpdate.find('input[name=lp-agree-term]');
238
  var elTermMessage = elTermUpdate.find('.error');
239
  var elMessageUpgrading = $('input[name=message-when-upgrading]').val();
@@ -246,43 +246,43 @@ var upgradeDB = function upgradeDB() {
246
  Object(_utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__["default"])('/lp/v1/database/agree_terms', {
247
  agree_terms: 1
248
  }, {});
249
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elFooter.find('.learn-press-notice').remove();
250
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elFooter.prepend('<span class="learn-press-notice">' + elMessageUpgrading + '</span>');
251
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal(elStatusUpgrade.html());
252
  return true;
253
  }
254
 
255
  elTermMessage.show();
256
  elTermMessage.addClass('learn-press-message');
257
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elMainContent.animate({
258
  scrollTop: elTermMessage.offset().top
259
  });
260
  return false;
261
  };
262
  } else {
263
  // Show Steps Upgrade.
264
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal(elStatusUpgrade.html());
265
 
266
  checkValidBeforeUpgrade = function checkValidBeforeUpgrade() {
267
  return true;
268
  };
269
  }
270
 
271
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setTitleModal(elToolUpgradeDB.find('h2').html());
272
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnYes.text('Upgrade');
273
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnYes.show();
274
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnNo.text('close');
275
 
276
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].callBackYes = function () {
277
  if (!checkValidBeforeUpgrade()) {
278
  return;
279
  }
280
 
281
  isUpgrading = 1;
282
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnYes.hide();
283
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnNo.hide();
284
  var urlHandle = '/lp/v1/database/upgrade';
285
- var elGroupStep = _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["elLPOverlay"].find('.lp-group-step');
286
  var elItemSteps = elToolUpgradeDB.find('.lp-item-step'); // Get params.
287
 
288
  var steps = [];
@@ -315,8 +315,8 @@ var upgradeDB = function upgradeDB() {
315
 
316
  var scrollToStepCurrent = function scrollToStepCurrent(stepCurrent) {
317
  elItemStepCurrent = elGroupStep.find('input[value=' + stepCurrent + ']').closest('.lp-item-step');
318
- var offset = elItemStepCurrent.offset().top - _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elMainContent.offset().top + _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elMainContent.scrollTop();
319
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elMainContent.stop().animate({
320
  scrollTop: offset
321
  }, 600);
322
  };
@@ -342,40 +342,40 @@ var upgradeDB = function upgradeDB() {
342
  isUpgrading = 0;
343
  elItemStepCurrent.removeClass('running').addClass('completed');
344
  setTimeout(function () {
345
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal(elWrapperUpgradeMessage.html());
346
  }, 1000);
347
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elFooter.find('.learn-press-notice').remove();
348
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnNo.show();
349
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnNo.on('click', function () {
350
  window.location.reload();
351
  });
352
  } else {
353
  isUpgrading = 0;
354
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elFooter.find('.learn-press-notice').remove();
355
  elItemStepCurrent.removeClass('running').addClass('error');
356
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal(elWrapperUpgradeMessage.html(), function () {
357
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnYes.text('Retry').show();
358
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnNo.show();
359
 
360
  if (!res.message) {
361
  res.message = 'Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help';
362
  }
363
 
364
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elMainContent.find('.learn-press-message').addClass('error').html(res.message);
365
  });
366
  }
367
  },
368
  error: function error(err) {
369
  isUpgrading = 0;
370
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal(elWrapperUpgradeMessage.html(), function () {
371
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnYes.text('Retry').show();
372
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elBtnNo.show();
373
 
374
  if (!err.message) {
375
  err.message = 'Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help';
376
  }
377
 
378
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].elMainContent.find('.learn-press-message').addClass('error').html(err.message);
379
  });
380
  },
381
  completed: function completed() {}
@@ -401,6 +401,11 @@ var upgradeDB = function upgradeDB() {
401
  var getStepsUpgradeStatus = function getStepsUpgradeStatus() {
402
  if (!elToolUpgradeDB.length) {
403
  return;
 
 
 
 
 
404
  }
405
 
406
  var elWrapperStatusUpgrade = $('.wrapper-lp-status-upgrade');
@@ -411,14 +416,9 @@ var getStepsUpgradeStatus = function getStepsUpgradeStatus() {
411
  var action = urlParams.get('action');
412
 
413
  if ('upgrade-db' === action) {
414
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["elLPOverlay"].show();
415
-
416
- if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].instance) {
417
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].init();
418
- }
419
-
420
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setTitleModal(elToolUpgradeDB.find('h2').html());
421
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].setContentModal($('.wrapper-lp-loading').html());
422
  }
423
 
424
  var funcCallBack = {
@@ -468,12 +468,7 @@ var getStepsUpgradeStatus = function getStepsUpgradeStatus() {
468
  }
469
 
470
  elBtnUpgradeDB.on('click', function () {
471
- // instance LP Modal Overlay.
472
- if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].instance) {
473
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["lpModalOverlay"].init();
474
- }
475
-
476
- _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["elLPOverlay"].show();
477
  upgradeDB();
478
  });
479
  }
@@ -488,10 +483,10 @@ var getStepsUpgradeStatus = function getStepsUpgradeStatus() {
488
 
489
  /***/ }),
490
 
491
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/utils/handle-ajax-api.js":
492
- /*!***************************************************************************************************************************************************************!*\
493
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/utils/handle-ajax-api.js ***!
494
- \***************************************************************************************************************************************************************/
495
  /*! exports provided: default */
496
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
497
 
@@ -521,20 +516,19 @@ var handleAjax = function handleAjax(url, params, functions) {
521
 
522
  /***/ }),
523
 
524
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/utils/lp-modal-overlay.js":
525
- /*!****************************************************************************************************************************************************************!*\
526
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/js/utils/lp-modal-overlay.js ***!
527
- \****************************************************************************************************************************************************************/
528
- /*! exports provided: lpModalOverlay, elLPOverlay */
529
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
530
 
531
  "use strict";
532
  __webpack_require__.r(__webpack_exports__);
533
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lpModalOverlay", function() { return lpModalOverlay; });
534
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elLPOverlay", function() { return elLPOverlay; });
535
  var $ = jQuery;
536
- var elLPOverlay = $('.lp-overlay');
537
  var lpModalOverlay = {
 
538
  elMainContent: null,
539
  elTitle: null,
540
  elBtnYes: null,
@@ -542,9 +536,14 @@ var lpModalOverlay = {
542
  elFooter: null,
543
  elCalledModal: null,
544
  callBackYes: null,
545
- instance: null,
546
  init: function init() {
547
- this.instance = this;
 
 
 
 
 
 
548
  this.elMainContent = elLPOverlay.find('.main-content');
549
  this.elTitle = elLPOverlay.find('.modal-title');
550
  this.elBtnYes = elLPOverlay.find('.btn-yes');
@@ -558,6 +557,7 @@ var lpModalOverlay = {
558
  lpModalOverlay.callBackYes();
559
  }
560
  });
 
561
  },
562
  setElCalledModal: function setElCalledModal(elCalledModal) {
563
  this.elCalledModal = elCalledModal;
@@ -573,7 +573,7 @@ var lpModalOverlay = {
573
  this.elTitle.html(content);
574
  }
575
  };
576
-
577
 
578
  /***/ })
579
 
81
  /******/
82
  /******/
83
  /******/ // Load entry module and return exports
84
+ /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/tools.js");
85
  /******/ })
86
  /************************************************************************/
87
  /******/ ({
88
 
89
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/tools.js":
90
+ /*!****************************************************************************************************************************************************************!*\
91
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/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_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/tools/database/upgrade.js");
99
 
100
 
101
  (function ($) {
207
 
208
  /***/ }),
209
 
210
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/tools/database/upgrade.js":
211
+ /*!*********************************************************************************************************************************************************************************!*\
212
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/admin/pages/tools/database/upgrade.js ***!
213
+ \*********************************************************************************************************************************************************************************/
214
  /*! exports provided: default */
215
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
216
 
217
  "use strict";
218
  __webpack_require__.r(__webpack_exports__);
219
+ /* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../utils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
220
+ /* harmony import */ var _utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/handle-ajax-api */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/handle-ajax-api.js");
221
 
222
 
223
  var $ = jQuery;
232
 
233
  if (elWrapperTermsUpgrade.length) {
234
  // Show Terms Upgrade.
235
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal(elWrapperTermsUpgrade.html());
236
+ var elTermUpdate = _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.find('.terms-upgrade');
237
  var elLPAgreeTerm = elTermUpdate.find('input[name=lp-agree-term]');
238
  var elTermMessage = elTermUpdate.find('.error');
239
  var elMessageUpgrading = $('input[name=message-when-upgrading]').val();
246
  Object(_utils_handle_ajax_api__WEBPACK_IMPORTED_MODULE_1__["default"])('/lp/v1/database/agree_terms', {
247
  agree_terms: 1
248
  }, {});
249
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elFooter.find('.learn-press-notice').remove();
250
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elFooter.prepend('<span class="learn-press-notice">' + elMessageUpgrading + '</span>');
251
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal(elStatusUpgrade.html());
252
  return true;
253
  }
254
 
255
  elTermMessage.show();
256
  elTermMessage.addClass('learn-press-message');
257
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elMainContent.animate({
258
  scrollTop: elTermMessage.offset().top
259
  });
260
  return false;
261
  };
262
  } else {
263
  // Show Steps Upgrade.
264
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal(elStatusUpgrade.html());
265
 
266
  checkValidBeforeUpgrade = function checkValidBeforeUpgrade() {
267
  return true;
268
  };
269
  }
270
 
271
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(elToolUpgradeDB.find('h2').html());
272
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnYes.text('Upgrade');
273
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnYes.show();
274
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnNo.text('close');
275
 
276
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
277
  if (!checkValidBeforeUpgrade()) {
278
  return;
279
  }
280
 
281
  isUpgrading = 1;
282
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnYes.hide();
283
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnNo.hide();
284
  var urlHandle = '/lp/v1/database/upgrade';
285
+ var elGroupStep = _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.find('.lp-group-step');
286
  var elItemSteps = elToolUpgradeDB.find('.lp-item-step'); // Get params.
287
 
288
  var steps = [];
315
 
316
  var scrollToStepCurrent = function scrollToStepCurrent(stepCurrent) {
317
  elItemStepCurrent = elGroupStep.find('input[value=' + stepCurrent + ']').closest('.lp-item-step');
318
+ var offset = elItemStepCurrent.offset().top - _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elMainContent.offset().top + _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elMainContent.scrollTop();
319
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elMainContent.stop().animate({
320
  scrollTop: offset
321
  }, 600);
322
  };
342
  isUpgrading = 0;
343
  elItemStepCurrent.removeClass('running').addClass('completed');
344
  setTimeout(function () {
345
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal(elWrapperUpgradeMessage.html());
346
  }, 1000);
347
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elFooter.find('.learn-press-notice').remove();
348
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnNo.show();
349
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnNo.on('click', function () {
350
  window.location.reload();
351
  });
352
  } else {
353
  isUpgrading = 0;
354
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elFooter.find('.learn-press-notice').remove();
355
  elItemStepCurrent.removeClass('running').addClass('error');
356
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal(elWrapperUpgradeMessage.html(), function () {
357
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnYes.text('Retry').show();
358
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnNo.show();
359
 
360
  if (!res.message) {
361
  res.message = 'Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help';
362
  }
363
 
364
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elMainContent.find('.learn-press-message').addClass('error').html(res.message);
365
  });
366
  }
367
  },
368
  error: function error(err) {
369
  isUpgrading = 0;
370
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal(elWrapperUpgradeMessage.html(), function () {
371
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnYes.text('Retry').show();
372
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elBtnNo.show();
373
 
374
  if (!err.message) {
375
  err.message = 'Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help';
376
  }
377
 
378
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elMainContent.find('.learn-press-message').addClass('error').html(err.message);
379
  });
380
  },
381
  completed: function completed() {}
401
  var getStepsUpgradeStatus = function getStepsUpgradeStatus() {
402
  if (!elToolUpgradeDB.length) {
403
  return;
404
+ } // initial LP Modal Overlay
405
+
406
+
407
+ if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].init()) {
408
+ return;
409
  }
410
 
411
  var elWrapperStatusUpgrade = $('.wrapper-lp-status-upgrade');
416
  var action = urlParams.get('action');
417
 
418
  if ('upgrade-db' === action) {
419
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
420
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(elToolUpgradeDB.find('h2').html());
421
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal($('.wrapper-lp-loading').html());
 
 
 
 
 
422
  }
423
 
424
  var funcCallBack = {
468
  }
469
 
470
  elBtnUpgradeDB.on('click', function () {
471
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
 
 
 
 
 
472
  upgradeDB();
473
  });
474
  }
483
 
484
  /***/ }),
485
 
486
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/handle-ajax-api.js":
487
+ /*!********************************************************************************************************************************************************************!*\
488
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/handle-ajax-api.js ***!
489
+ \********************************************************************************************************************************************************************/
490
  /*! exports provided: default */
491
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
492
 
516
 
517
  /***/ }),
518
 
519
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
520
+ /*!*********************************************************************************************************************************************************************!*\
521
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
522
+ \*********************************************************************************************************************************************************************/
523
+ /*! exports provided: default */
524
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
525
 
526
  "use strict";
527
  __webpack_require__.r(__webpack_exports__);
 
 
528
  var $ = jQuery;
529
+ var elLPOverlay = null;
530
  var lpModalOverlay = {
531
+ elLPOverlay: null,
532
  elMainContent: null,
533
  elTitle: null,
534
  elBtnYes: null,
536
  elFooter: null,
537
  elCalledModal: null,
538
  callBackYes: null,
 
539
  init: function init() {
540
+ this.elLPOverlay = $('.lp-overlay');
541
+
542
+ if (!this.elLPOverlay.length) {
543
+ return false;
544
+ }
545
+
546
+ elLPOverlay = this.elLPOverlay;
547
  this.elMainContent = elLPOverlay.find('.main-content');
548
  this.elTitle = elLPOverlay.find('.modal-title');
549
  this.elBtnYes = elLPOverlay.find('.btn-yes');
557
  lpModalOverlay.callBackYes();
558
  }
559
  });
560
+ return true;
561
  },
562
  setElCalledModal: function setElCalledModal(elCalledModal) {
563
  this.elCalledModal = elCalledModal;
573
  this.elTitle.html(content);
574
  }
575
  };
576
+ /* harmony default export */ __webpack_exports__["default"] = (lpModalOverlay);
577
 
578
  /***/ })
579
 
assets/js/dist/admin/pages/tools.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(a){if(t[a])return t[a].exports;var s=t[a]={i:a,l:!1,exports:{}};return e[a].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(a,s,function(t){return e[t]}.bind(null,s));return a},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 a,s,l,o,r,i,d,c,p=jQuery,u=p(".lp-overlay"),f={elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init:function(){this.instance=this,this.elMainContent=u.find(".main-content"),this.elTitle=u.find(".modal-title"),this.elBtnYes=u.find(".btn-yes"),this.elBtnNo=u.find(".btn-no"),this.elFooter=u.find(".lp-modal-footer"),p(document).on("click",".close, .btn-no",(function(){u.hide()})),p(document).on("click",".btn-yes",(function(){"function"==typeof f.callBackYes&&f.callBackYes()}))},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)}},m=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()}))},h=jQuery,g=h("#lp-tool-upgrade-db"),v=function(){var e=0,t=g.find(".wrapper-terms-upgrade"),n=g.find(".wrapper-lp-status-upgrade"),a=g.find(".wrapper-lp-upgrade-message"),s=null;if(t.length){f.setContentModal(t.html());var l=u.find(".terms-upgrade"),o=l.find("input[name=lp-agree-term]"),r=l.find(".error"),i=h("input[name=message-when-upgrading]").val();s=function(){return r.hide(),r.removeClass("learn-press-message"),o.is(":checked")?(m("/lp/v1/database/agree_terms",{agree_terms:1},{}),f.elFooter.find(".learn-press-notice").remove(),f.elFooter.prepend('<span class="learn-press-notice">'+i+"</span>"),f.setContentModal(n.html()),!0):(r.show(),r.addClass("learn-press-message"),f.elMainContent.animate({scrollTop:r.offset().top}),!1)}}else f.setContentModal(n.html()),s=function(){return!0};f.setTitleModal(g.find("h2").html()),f.elBtnYes.text("Upgrade"),f.elBtnYes.show(),f.elBtnNo.text("close"),f.callBackYes=function(){if(s()){e=1,f.elBtnYes.hide(),f.elBtnNo.hide();var t=u.find(".lp-group-step"),n=g.find(".lp-item-step"),l=[];h.each(n,(function(e,t){var n=h(t);if(!n.hasClass("completed")){var a=n.find("input").val();l.push(a)}}));var o={steps:l,step:l[0]},r=null,i=function(e,n){(r=t.find("input[value="+e+"]").closest(".lp-item-step")).addClass("running"),100===n&&r.removeClass("running").addClass("completed"),r.find(".progress-bar").css("width",n+"%"),r.find(".percent").text(n+"%")};i(l[0],.1);var d={success:function(n){var s,l;i(o.step,n.percent),o.step!==n.name&&i(n.name,.1),s=o.step,l=(r=t.find("input[value="+s+"]").closest(".lp-item-step")).offset().top-f.elMainContent.offset().top+f.elMainContent.scrollTop(),f.elMainContent.stop().animate({scrollTop:l},600),"success"===n.status?(o.step=n.name,o.data=n.data,setTimeout((function(){m("/lp/v1/database/upgrade",o,d)}),800)):"finished"===n.status?(e=0,r.removeClass("running").addClass("completed"),setTimeout((function(){f.setContentModal(a.html())}),1e3),f.elFooter.find(".learn-press-notice").remove(),f.elBtnNo.show(),f.elBtnNo.on("click",(function(){window.location.reload()}))):(e=0,f.elFooter.find(".learn-press-notice").remove(),r.removeClass("running").addClass("error"),f.setContentModal(a.html(),(function(){f.elBtnYes.text("Retry").show(),f.elBtnNo.show(),n.message||(n.message="Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help"),f.elMainContent.find(".learn-press-message").addClass("error").html(n.message)})))},error:function(t){e=0,f.setContentModal(a.html(),(function(){f.elBtnYes.text("Retry").show(),f.elBtnNo.show(),t.message||(t.message="Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help"),f.elMainContent.find(".learn-press-message").addClass("error").html(t.message)}))},completed:function(){}};m("/lp/v1/database/upgrade",o,d)}},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?"}},b=function(){if(g.length){var e=h(".wrapper-lp-status-upgrade"),t=window.location.search,n=new URLSearchParams(t).get("action");"upgrade-db"===n&&(u.show(),f.instance||f.init(),f.setTitleModal(g.find("h2").html()),f.setContentModal(h(".wrapper-lp-loading").html())),m("/lp/v1/database/get_steps",{},{success:function(t){var a=t.steps_completed,s=t.steps_default;if(void 0===a||void 0===s)return console.log("invalid steps_completed and steps_default"),!1;var l="";for(var o in s){var r=s[o],i=r.steps;for(var d in l='<div class="lp-group-step">',l+="<h3>"+r.label+"</h3>",i){var c=i[d],p="";void 0!==a[d]&&(p="completed"),l+='<div class="lp-item-step '+p+'">',l+='<div class="lp-item-step-left"><input type="hidden" name="lp_steps_upgrade_db[]" value="'+c.name+'" /></div>',l+='<div class="lp-item-step-right">',l+='<label for=""><strong></strong>'+c.label+"</label>",l+='<div class="description">'+c.description+"</div>",l+='<div class="percent"></div>',l+='<span class="progress-bar"></span>',l+="</div>",l+="</div>"}l+="</div>",e.append(l);var m=h(".lp-btn-upgrade-db");"upgrade-db"===n&&v(),m.on("click",(function(){f.instance||f.init(),u.show(),v()}))}},error:function(e){},completed:function(){}})}};a=jQuery,s=a(document),l=!1,o=function(e){e.preventDefault();var t=a(this);l||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(t.addClass("disabled").html(t.data("installing-text")),a(".lp-install-sample__response").remove(),l=!0,a.ajax({url:t.attr("href"),data:a(".lp-install-sample__options").serializeJSON(),success:function(e){t.removeClass("disabled").html(t.data("text")),l=!1,a(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),l=!1,a(response).insertBefore(t.parent())}}))},r=function(e){e.preventDefault();var t=a(this);l||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(t.addClass("disabled").html(t.data("uninstalling-text")),l=!0,a.ajax({url:t.attr("href"),success:function(e){t.removeClass("disabled").html(t.data("text")),l=!1,a(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),l=!1,a(response).insertBefore(t.parent())}}))},i=function(e){e.preventDefault();var t=a(this);t.hasClass("disabled")||(t.addClass("disabled").html(t.data("cleaning-text")),a.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"))}}))},d=function(){a.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success:function(e){},error:function(){}})},c=function(e){e.preventDefault(),a(".lp-install-sample__options").toggleClass("hide-if-js")},a((function(){b(),s.on("click",".lp-install-sample__install",o).on("click",".lp-install-sample__uninstall",r).on("click","#learn-press-clear-cache",i).on("click",'input[name="enable_hard_cache"]',d).on("click",".lp-install-sample__toggle-options",c)}))}});
1
+ !function(e){var t={};function n(l){if(t[l])return t[l].exports;var a=t[l]={i:l,l:!1,exports:{}};return e[l].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},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 l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(l,a,function(t){return e[t]}.bind(null,a));return l},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)}({15:function(e,t,n){"use strict";n.r(t);var l,a,s,o,r,i,d,c,p=jQuery,u=null,f={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,init:function(){return this.elLPOverlay=p(".lp-overlay"),!!this.elLPOverlay.length&&(u=this.elLPOverlay,this.elMainContent=u.find(".main-content"),this.elTitle=u.find(".modal-title"),this.elBtnYes=u.find(".btn-yes"),this.elBtnNo=u.find(".btn-no"),this.elFooter=u.find(".lp-modal-footer"),p(document).on("click",".close, .btn-no",(function(){u.hide()})),p(document).on("click",".btn-yes",(function(){"function"==typeof f.callBackYes&&f.callBackYes()})),!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)}},m=f,h=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()}))},v=jQuery,g=v("#lp-tool-upgrade-db"),b=function(){var e=0,t=g.find(".wrapper-terms-upgrade"),n=g.find(".wrapper-lp-status-upgrade"),l=g.find(".wrapper-lp-upgrade-message"),a=null;if(t.length){m.setContentModal(t.html());var s=m.elLPOverlay.find(".terms-upgrade"),o=s.find("input[name=lp-agree-term]"),r=s.find(".error"),i=v("input[name=message-when-upgrading]").val();a=function(){return r.hide(),r.removeClass("learn-press-message"),o.is(":checked")?(h("/lp/v1/database/agree_terms",{agree_terms:1},{}),m.elFooter.find(".learn-press-notice").remove(),m.elFooter.prepend('<span class="learn-press-notice">'+i+"</span>"),m.setContentModal(n.html()),!0):(r.show(),r.addClass("learn-press-message"),m.elMainContent.animate({scrollTop:r.offset().top}),!1)}}else m.setContentModal(n.html()),a=function(){return!0};m.setTitleModal(g.find("h2").html()),m.elBtnYes.text("Upgrade"),m.elBtnYes.show(),m.elBtnNo.text("close"),m.callBackYes=function(){if(a()){e=1,m.elBtnYes.hide(),m.elBtnNo.hide();var t=m.elLPOverlay.find(".lp-group-step"),n=g.find(".lp-item-step"),s=[];v.each(n,(function(e,t){var n=v(t);if(!n.hasClass("completed")){var l=n.find("input").val();s.push(l)}}));var o={steps:s,step:s[0]},r=null,i=function(e,n){(r=t.find("input[value="+e+"]").closest(".lp-item-step")).addClass("running"),100===n&&r.removeClass("running").addClass("completed"),r.find(".progress-bar").css("width",n+"%"),r.find(".percent").text(n+"%")};i(s[0],.1);var d={success:function(n){var a,s;i(o.step,n.percent),o.step!==n.name&&i(n.name,.1),a=o.step,s=(r=t.find("input[value="+a+"]").closest(".lp-item-step")).offset().top-m.elMainContent.offset().top+m.elMainContent.scrollTop(),m.elMainContent.stop().animate({scrollTop:s},600),"success"===n.status?(o.step=n.name,o.data=n.data,setTimeout((function(){h("/lp/v1/database/upgrade",o,d)}),800)):"finished"===n.status?(e=0,r.removeClass("running").addClass("completed"),setTimeout((function(){m.setContentModal(l.html())}),1e3),m.elFooter.find(".learn-press-notice").remove(),m.elBtnNo.show(),m.elBtnNo.on("click",(function(){window.location.reload()}))):(e=0,m.elFooter.find(".learn-press-notice").remove(),r.removeClass("running").addClass("error"),m.setContentModal(l.html(),(function(){m.elBtnYes.text("Retry").show(),m.elBtnNo.show(),n.message||(n.message="Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help"),m.elMainContent.find(".learn-press-message").addClass("error").html(n.message)})))},error:function(t){e=0,m.setContentModal(l.html(),(function(){m.elBtnYes.text("Retry").show(),m.elBtnNo.show(),t.message||(t.message="Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help"),m.elMainContent.find(".learn-press-message").addClass("error").html(t.message)}))},completed:function(){}};h("/lp/v1/database/upgrade",o,d)}},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?"}},C=function(){if(g.length&&m.init()){var e=v(".wrapper-lp-status-upgrade"),t=window.location.search,n=new URLSearchParams(t).get("action");"upgrade-db"===n&&(m.elLPOverlay.show(),m.setTitleModal(g.find("h2").html()),m.setContentModal(v(".wrapper-lp-loading").html())),h("/lp/v1/database/get_steps",{},{success:function(t){var l=t.steps_completed,a=t.steps_default;if(void 0===l||void 0===a)return console.log("invalid steps_completed and steps_default"),!1;var s="";for(var o in a){var r=a[o],i=r.steps;for(var d in s='<div class="lp-group-step">',s+="<h3>"+r.label+"</h3>",i){var c=i[d],p="";void 0!==l[d]&&(p="completed"),s+='<div class="lp-item-step '+p+'">',s+='<div class="lp-item-step-left"><input type="hidden" name="lp_steps_upgrade_db[]" value="'+c.name+'" /></div>',s+='<div class="lp-item-step-right">',s+='<label for=""><strong></strong>'+c.label+"</label>",s+='<div class="description">'+c.description+"</div>",s+='<div class="percent"></div>',s+='<span class="progress-bar"></span>',s+="</div>",s+="</div>"}s+="</div>",e.append(s);var u=v(".lp-btn-upgrade-db");"upgrade-db"===n&&b(),u.on("click",(function(){m.elLPOverlay.show(),b()}))}},error:function(e){},completed:function(){}})}};l=jQuery,a=l(document),s=!1,o=function(e){e.preventDefault();var t=l(this);s||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(t.addClass("disabled").html(t.data("installing-text")),l(".lp-install-sample__response").remove(),s=!0,l.ajax({url:t.attr("href"),data:l(".lp-install-sample__options").serializeJSON(),success:function(e){t.removeClass("disabled").html(t.data("text")),s=!1,l(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),s=!1,l(response).insertBefore(t.parent())}}))},r=function(e){e.preventDefault();var t=l(this);s||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(t.addClass("disabled").html(t.data("uninstalling-text")),s=!0,l.ajax({url:t.attr("href"),success:function(e){t.removeClass("disabled").html(t.data("text")),s=!1,l(e).insertBefore(t.parent())},error:function(){t.removeClass("disabled").html(t.data("text")),s=!1,l(response).insertBefore(t.parent())}}))},i=function(e){e.preventDefault();var t=l(this);t.hasClass("disabled")||(t.addClass("disabled").html(t.data("cleaning-text")),l.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"))}}))},d=function(){l.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success:function(e){},error:function(){}})},c=function(e){e.preventDefault(),l(".lp-install-sample__options").toggleClass("hide-if-js")},l((function(){C(),a.on("click",".lp-install-sample__install",o).on("click",".lp-install-sample__uninstall",r).on("click","#learn-press-clear-cache",i).on("click",'input[name="enable_hard_cache"]',d).on("click",".lp-install-sample__toggle-options",c)}))}});
assets/js/dist/frontend/single-course.js CHANGED
@@ -96,14 +96,14 @@ this["LP"] = this["LP"] || {}; this["LP"]["singleCourse"] =
96
 
97
  "use strict";
98
  __webpack_require__.r(__webpack_exports__);
99
- /* harmony import */ var _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ultils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/ultils/lp-modal-overlay.js");
100
  var $ = jQuery;
101
 
102
  var lpModalOverlayCompleteItem = {
103
  elBtnFinishCourse: null,
104
  elBtnCompleteItem: null,
105
  init: function init() {
106
- if (!_ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].init()) {
107
  return;
108
  }
109
 
@@ -118,11 +118,11 @@ var lpModalOverlayCompleteItem = {
118
  this.elBtnCompleteItem.addEventListener('click', function (e) {
119
  e.preventDefault();
120
  var form = e.target.closest('form');
121
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
122
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
123
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
124
 
125
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
126
  form.submit();
127
  };
128
  });
@@ -133,11 +133,11 @@ var lpModalOverlayCompleteItem = {
133
  return element.addEventListener('click', function (e) {
134
  e.preventDefault();
135
  var form = e.target.closest('form');
136
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
137
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
138
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
139
 
140
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
141
  form.submit();
142
  };
143
  });
@@ -790,10 +790,10 @@ var Sidebar = function Sidebar() {
790
 
791
  /***/ }),
792
 
793
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/ultils/lp-modal-overlay.js":
794
- /*!**********************************************************************************************************************************************************************!*\
795
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/ultils/lp-modal-overlay.js ***!
796
- \**********************************************************************************************************************************************************************/
797
  /*! exports provided: default */
798
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
799
 
@@ -810,9 +810,7 @@ var lpModalOverlay = {
810
  elFooter: null,
811
  elCalledModal: null,
812
  callBackYes: null,
813
- instance: null,
814
  init: function init() {
815
- this.instance = this;
816
  this.elLPOverlay = $('.lp-overlay');
817
 
818
  if (!this.elLPOverlay.length) {
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_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
100
  var $ = jQuery;
101
 
102
  var lpModalOverlayCompleteItem = {
103
  elBtnFinishCourse: null,
104
  elBtnCompleteItem: null,
105
  init: function init() {
106
+ if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].init()) {
107
  return;
108
  }
109
 
118
  this.elBtnCompleteItem.addEventListener('click', function (e) {
119
  e.preventDefault();
120
  var form = e.target.closest('form');
121
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
122
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
123
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
124
 
125
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
126
  form.submit();
127
  };
128
  });
133
  return element.addEventListener('click', function (e) {
134
  e.preventDefault();
135
  var form = e.target.closest('form');
136
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
137
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
138
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
139
 
140
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
141
  form.submit();
142
  };
143
  });
790
 
791
  /***/ }),
792
 
793
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
794
+ /*!*********************************************************************************************************************************************************************!*\
795
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
796
+ \*********************************************************************************************************************************************************************/
797
  /*! exports provided: default */
798
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
799
 
810
  elFooter: null,
811
  elCalledModal: null,
812
  callBackYes: null,
 
813
  init: function init() {
 
814
  this.elLPOverlay = $('.lp-overlay');
815
 
816
  if (!this.elLPOverlay.length) {
assets/js/dist/frontend/single-course.min.js CHANGED
@@ -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=22)}([,,function(e,t){e.exports=window.wp.element},,,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&&Symbol.iterator in Object(e))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,s=lodash.throttle,a=function(){var e,t=i("#popup-course"),n=i("#learn-press-course-curriculum");i("#sidebar-toggle").on("change",(function(e){LP.Cookies.set("sidebar-toggle",e.target.checked),o(e.target.checked)}));var o=function(e){i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),e?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open")};o(LP.Cookies.get("sidebar-toggle")),n.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)))}))})),t.length&&(n.on("scroll",s((function(){var t=i(this);t.addClass("scrolling"),e&&clearTimeout(e),e=setTimeout((function(){t.removeClass("scrolling")}),1e3)}),500)),LP.toElement(".course-item.current",{container:".curriculum-scrollable:eq(1)",offset:100,duration:1}))}},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,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(){"function"==typeof i.callBackYes&&i.callBackYes()})),!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)}},s=i,a=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){s.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");s.elLPOverlay.show(),s.setTitleModal(t.dataset.title),s.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),s.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");s.elLPOverlay.show(),s.setTitleModal(t.dataset.title),s.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),s.callBackYes=function(){t.submit()}}))})))}});t.a=a},,,,function(e,t){e.exports=window.wp.url},,,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 h})),n.d(t,"initCourseTabs",(function(){return w})),n.d(t,"initCourseSidebar",(function(){return S})),n.d(t,"enrollCourse",(function(){return C}));var r=n(2),o=(n(13),n(14),n(5));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 s(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 l(e,t){return(l=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&&l(e,t)}(i,e);var t,n,r,o=c(i);function i(){return s(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){return React.createElement(React.Fragment,null)}}])&&a(t.prototype,n),r&&a(t,r),i}(r.Component);window.addEventListener("DOMContentLoaded",(function(){Object(o.a)()}));n(10);var p=n(6);function v(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return m(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 m(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 m(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,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).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 s(e){y(i,r,o,s,a,"next",e)}function a(e){y(i,r,o,s,a,"throw",e)}s(void 0)}))}}t.default=f;var h=function(){wp.element.render(React.createElement(f,null))},g=jQuery,w=function(){g("#learn-press-course-tabs").on("change",'input[name="learn-press-course-tab-radio"]',(function(e){var t=g('input[name="learn-press-course-tab-radio"]:checked').val();LP.Cookies.set("course-tab",t),g('label[for="'+g(e.target).attr("id")+'"]').closest("li").addClass("active").siblings().removeClass("active")}))},S=function(){var e=g(".course-summary-sidebar");if(e.length){var t=g(window),n=e.children(),r=e.offset(),o=e.height(),i=n.height(),s=32;t.on("scroll.fixed-course-sidebar",(function(){var a=t.scrollTop()-r.top+s;if(a<0)return e.removeClass("slide-top slide-down"),void n.css("top","");a>o-i?(e.removeClass("slide-down").addClass("slide-top"),n.css("top",o-i)):(e.removeClass("slide-top").addClass("slide-down"),n.css("top",s))})).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,s,a;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,s=o.data.redirect,(a=o.message)&&i&&(r.style.display="none",e.innerHTML+='<div class="lp-enroll-notice '.concat(i,'">').concat(a,"</div>"),s&&(window.location.href=s)),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()}))},L=function(){var e=document.querySelector(".lp-form-retake-course");if(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){e.preventDefault(),t.classList.add("loading"),t.disabled=!0,wp.apiFetch({path:"/lp/v1/courses/retake-course",method:"POST",data:{id:n}}).then((function(e){var n=e.status,o=e.message,i=e.data;r.innerHTML=o,null!=n&&"success"===n?(t.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.data.status+" "+e.message})).then((function(){t.classList.remove("loading"),t.disabled=!1,r.style.display="block"}))}))}};g(window).on("load",(function(){var e;g("#popup-course"),g("#learn-press-course-curriculum");v(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")}))})),w(),S(),C(),(e=document.querySelectorAll("form.purchase-course")).length>0&&e.forEach((function(e){var t=function(){var t=b(regeneratorRuntime.mark((function t(n,r){var o,i,s,a;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/purchase-course",method:"POST",data:{id:n}});case 3:o=t.sent,r.classList.remove("loading"),r.disabled=!1,i=o.status,s=o.data.redirect,(a=o.message)&&i&&(e.innerHTML+='<div class="lp-enroll-notice '.concat(i,'">').concat(a,"</div>"),"success"===i&&s&&(window.location.href=s)),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),e.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=purchase-course]").value,o=e.querySelector("button.button-purchase-course");o.classList.add("loading"),o.disabled=!0,t(r,o)}))})),L(),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)}}))}));v(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=22)}([,,function(e,t){e.exports=window.wp.element},,,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&&Symbol.iterator in Object(e))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 s}));var i=jQuery,a=lodash.throttle,s=function(){var e,t=i("#popup-course"),n=i("#learn-press-course-curriculum");i("#sidebar-toggle").on("change",(function(e){LP.Cookies.set("sidebar-toggle",e.target.checked),o(e.target.checked)}));var o=function(e){i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),e?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open")};o(LP.Cookies.get("sidebar-toggle")),n.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)))}))})),t.length&&(n.on("scroll",a((function(){var t=i(this);t.addClass("scrolling"),e&&clearTimeout(e),e=setTimeout((function(){t.removeClass("scrolling")}),1e3)}),500)),LP.toElement(".course-item.current",{container:".curriculum-scrollable:eq(1)",offset:100,duration:1}))}},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,init:function(){return 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(){"function"==typeof i.callBackYes&&i.callBackYes()})),!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)}},a=i,s=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){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");a.elLPOverlay.show(),a.setTitleModal(t.dataset.title),a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),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");a.elLPOverlay.show(),a.setTitleModal(t.dataset.title),a.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),a.callBackYes=function(){t.submit()}}))})))}});t.a=s},,,,function(e,t){e.exports=window.wp.url},,,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 h})),n.d(t,"initCourseTabs",(function(){return w})),n.d(t,"initCourseSidebar",(function(){return S})),n.d(t,"enrollCourse",(function(){return C}));var r=n(2),o=(n(13),n(14),n(5));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 s(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 l(e,t){return(l=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&&l(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)}}])&&s(t.prototype,n),r&&s(t,r),i}(r.Component);window.addEventListener("DOMContentLoaded",(function(){Object(o.a)()}));n(10);var p=n(6);function v(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return m(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 m(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 m(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,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).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){y(i,r,o,a,s,"next",e)}function s(e){y(i,r,o,a,s,"throw",e)}a(void 0)}))}}t.default=f;var h=function(){wp.element.render(React.createElement(f,null))},g=jQuery,w=function(){g("#learn-press-course-tabs").on("change",'input[name="learn-press-course-tab-radio"]',(function(e){var t=g('input[name="learn-press-course-tab-radio"]:checked').val();LP.Cookies.set("course-tab",t),g('label[for="'+g(e.target).attr("id")+'"]').closest("li").addClass("active").siblings().removeClass("active")}))},S=function(){var e=g(".course-summary-sidebar");if(e.length){var t=g(window),n=e.children(),r=e.offset(),o=e.height(),i=n.height(),a=32;t.on("scroll.fixed-course-sidebar",(function(){var s=t.scrollTop()-r.top+a;if(s<0)return e.removeClass("slide-top slide-down"),void n.css("top","");s>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,s;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,(s=o.message)&&i&&(r.style.display="none",e.innerHTML+='<div class="lp-enroll-notice '.concat(i,'">').concat(s,"</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()}))},L=function(){var e=document.querySelector(".lp-form-retake-course");if(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){e.preventDefault(),t.classList.add("loading"),t.disabled=!0,wp.apiFetch({path:"/lp/v1/courses/retake-course",method:"POST",data:{id:n}}).then((function(e){var n=e.status,o=e.message,i=e.data;r.innerHTML=o,null!=n&&"success"===n?(t.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.data.status+" "+e.message})).then((function(){t.classList.remove("loading"),t.disabled=!1,r.style.display="block"}))}))}};g(window).on("load",(function(){var e;g("#popup-course"),g("#learn-press-course-curriculum");v(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")}))})),w(),S(),C(),(e=document.querySelectorAll("form.purchase-course")).length>0&&e.forEach((function(e){var t=function(){var t=b(regeneratorRuntime.mark((function t(n,r){var o,i,a,s;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/purchase-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,(s=o.message)&&i&&(e.innerHTML+='<div class="lp-enroll-notice '.concat(i,'">').concat(s,"</div>"),"success"===i&&a&&(window.location.href=a)),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),e.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=purchase-course]").value,o=e.querySelector("button.button-purchase-course");o.classList.add("loading"),o.disabled=!0,t(r,o)}))})),L(),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)}}))}));v(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()}))}]);
assets/js/dist/frontend/single-curriculum.js CHANGED
@@ -96,14 +96,14 @@ this["LP"] = this["LP"] || {}; this["LP"]["singleCurriculum"] =
96
 
97
  "use strict";
98
  __webpack_require__.r(__webpack_exports__);
99
- /* harmony import */ var _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ultils/lp-modal-overlay */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/ultils/lp-modal-overlay.js");
100
  var $ = jQuery;
101
 
102
  var lpModalOverlayCompleteItem = {
103
  elBtnFinishCourse: null,
104
  elBtnCompleteItem: null,
105
  init: function init() {
106
- if (!_ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].init()) {
107
  return;
108
  }
109
 
@@ -118,11 +118,11 @@ var lpModalOverlayCompleteItem = {
118
  this.elBtnCompleteItem.addEventListener('click', function (e) {
119
  e.preventDefault();
120
  var form = e.target.closest('form');
121
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
122
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
123
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
124
 
125
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
126
  form.submit();
127
  };
128
  });
@@ -133,11 +133,11 @@ var lpModalOverlayCompleteItem = {
133
  return element.addEventListener('click', function (e) {
134
  e.preventDefault();
135
  var form = e.target.closest('form');
136
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
137
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
138
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
139
 
140
- _ultils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
141
  form.submit();
142
  };
143
  });
@@ -635,10 +635,10 @@ window.addEventListener('DOMContentLoaded', function () {
635
 
636
  /***/ }),
637
 
638
- /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/ultils/lp-modal-overlay.js":
639
- /*!**********************************************************************************************************************************************************************!*\
640
- !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/ultils/lp-modal-overlay.js ***!
641
- \**********************************************************************************************************************************************************************/
642
  /*! exports provided: default */
643
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
644
 
@@ -655,9 +655,7 @@ var lpModalOverlay = {
655
  elFooter: null,
656
  elCalledModal: null,
657
  callBackYes: null,
658
- instance: null,
659
  init: function init() {
660
- this.instance = this;
661
  this.elLPOverlay = $('.lp-overlay');
662
 
663
  if (!this.elLPOverlay.length) {
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_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js");
100
  var $ = jQuery;
101
 
102
  var lpModalOverlayCompleteItem = {
103
  elBtnFinishCourse: null,
104
  elBtnCompleteItem: null,
105
  init: function init() {
106
+ if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].init()) {
107
  return;
108
  }
109
 
118
  this.elBtnCompleteItem.addEventListener('click', function (e) {
119
  e.preventDefault();
120
  var form = e.target.closest('form');
121
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
122
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
123
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
124
 
125
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
126
  form.submit();
127
  };
128
  });
133
  return element.addEventListener('click', function (e) {
134
  e.preventDefault();
135
  var form = e.target.closest('form');
136
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
137
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
138
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
139
 
140
+ _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = function () {
141
  form.submit();
142
  };
143
  });
635
 
636
  /***/ }),
637
 
638
+ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js":
639
+ /*!*********************************************************************************************************************************************************************!*\
640
+ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress_v4_modify_step_install_after_activated/learnpress/assets/src/apps/js/utils/lp-modal-overlay.js ***!
641
+ \*********************************************************************************************************************************************************************/
642
  /*! exports provided: default */
643
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
644
 
655
  elFooter: null,
656
  elCalledModal: null,
657
  callBackYes: null,
 
658
  init: function init() {
 
659
  this.elLPOverlay = $('.lp-overlay');
660
 
661
  if (!this.elLPOverlay.length) {
assets/js/dist/frontend/single-curriculum.min.js CHANGED
@@ -1 +1 @@
1
- this.LP=this.LP||{},this.LP.singleCurriculum=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}return 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=21)}({2:function(e,t){e.exports=window.wp.element},21:function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return v}));var o=n(2),r=n(5),i=jQuery;n(8);function l(e){return(l="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 c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return(a=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 n,o=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==l(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 f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}jQuery;var p=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&&a(e,t)}(i,e);var t,n,o,r=s(i);function i(){return c(this,i),r.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)}}])&&u(t.prototype,n),o&&u(t,o),i}(o.Component),m=p;window.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"),o=e.querySelector(".search-course"),r=e.querySelector('.search-course input[type="text"]');if(!r||!n||!o)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=r.value;o.classList.add("searching"),t||o.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"),o=[];t.forEach((function(e){n.includes(e.dataset.id)&&o.push(e.dataset.id)})),0===o.length?e.classList.add("hide-if-js"):e.classList.remove("hide-if-js")}))},a=o.querySelector(".clear");a&&a.addEventListener("click",(function(e){e.preventDefault(),r.value="",u(e)})),o.addEventListener("submit",u),r.addEventListener("keyup",u)}}(),Object(r.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))+"%")})),function(){var e=document.querySelector(".lp-lesson-comment-btn");if(e){var t=e.textContent,n=e.dataset.close;window.location.hash.includes("comment")&&e.parentNode.classList.add("open-comments");var o=function(e,o){o.classList.contains("open-comments")?e.textContent=n:e.textContent=t};o(e,e.parentNode),e.addEventListener("click",(function(t){t.preventDefault(),e.parentNode.classList.toggle("open-comments"),o(e,e.parentNode)}))}}(),(new p).checkCourseDurationExpire()}));var y=n(6),v=(jQuery,t.default=m,function(){wp.element.render(React.createElement(m,null),document.getElementById("learn-press-course-curriculum"))});document.addEventListener("DOMContentLoaded",(function(e){LP.Hook.doAction("course-ready"),y.a.init()}))},5:function(e,t,n){"use strict";function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.d(t,"a",(function(){return c}));var i=jQuery,l=lodash.throttle,c=function(){var e,t=i("#popup-course"),n=i("#learn-press-course-curriculum");i("#sidebar-toggle").on("change",(function(e){LP.Cookies.set("sidebar-toggle",e.target.checked),r(e.target.checked)}));var r=function(e){i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),e?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open")};r(LP.Cookies.get("sidebar-toggle")),n.find(".section-desc").each((function(e,t){var n=i('<span class="show-desc"></span>').on("click",(function(){o.toggleClass("c")})),o=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)||[],r=parseInt(e.data("section-id")),i=n.findIndex((function(e){return e==r}));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,o(new Set(n)))}))})),t.length&&(n.on("scroll",l((function(){var t=i(this);t.addClass("scrolling"),e&&clearTimeout(e),e=setTimeout((function(){t.removeClass("scrolling")}),1e3)}),500)),LP.toElement(".course-item.current",{container:".curriculum-scrollable:eq(1)",offset:100,duration:1}))}},6:function(e,t,n){"use strict";var o=jQuery,r=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,this.elLPOverlay=o(".lp-overlay"),!!this.elLPOverlay.length&&(r=this.elLPOverlay,this.elMainContent=r.find(".main-content"),this.elTitle=r.find(".modal-title"),this.elBtnYes=r.find(".btn-yes"),this.elBtnNo=r.find(".btn-no"),this.elFooter=r.find(".lp-modal-footer"),o(document).on("click",".close, .btn-no",(function(){r.hide()})),o(document).on("click",".btn-yes",(function(){"function"==typeof i.callBackYes&&i.callBackYes()})),!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)}},l=i,c=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){l.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");l.elLPOverlay.show(),l.setTitleModal(t.dataset.title),l.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),l.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");l.elLPOverlay.show(),l.setTitleModal(t.dataset.title),l.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),l.callBackYes=function(){t.submit()}}))})))}});t.a=c},8:function(e,t){function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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,o=new Array(t);n<t;n++)o[n]=e[n];return o}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&&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}))}});
1
+ this.LP=this.LP||{},this.LP.singleCurriculum=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}return 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=21)}({2:function(e,t){e.exports=window.wp.element},21:function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return v}));var o=n(2),r=n(5),i=jQuery;n(8);function l(e){return(l="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 c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return(a=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 n,o=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==l(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 f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}jQuery;var p=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&&a(e,t)}(i,e);var t,n,o,r=s(i);function i(){return c(this,i),r.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)}}])&&u(t.prototype,n),o&&u(t,o),i}(o.Component),m=p;window.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"),o=e.querySelector(".search-course"),r=e.querySelector('.search-course input[type="text"]');if(!r||!n||!o)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=r.value;o.classList.add("searching"),t||o.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"),o=[];t.forEach((function(e){n.includes(e.dataset.id)&&o.push(e.dataset.id)})),0===o.length?e.classList.add("hide-if-js"):e.classList.remove("hide-if-js")}))},a=o.querySelector(".clear");a&&a.addEventListener("click",(function(e){e.preventDefault(),r.value="",u(e)})),o.addEventListener("submit",u),r.addEventListener("keyup",u)}}(),Object(r.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))+"%")})),function(){var e=document.querySelector(".lp-lesson-comment-btn");if(e){var t=e.textContent,n=e.dataset.close;window.location.hash.includes("comment")&&e.parentNode.classList.add("open-comments");var o=function(e,o){o.classList.contains("open-comments")?e.textContent=n:e.textContent=t};o(e,e.parentNode),e.addEventListener("click",(function(t){t.preventDefault(),e.parentNode.classList.toggle("open-comments"),o(e,e.parentNode)}))}}(),(new p).checkCourseDurationExpire()}));var y=n(6),v=(jQuery,t.default=m,function(){wp.element.render(React.createElement(m,null),document.getElementById("learn-press-course-curriculum"))});document.addEventListener("DOMContentLoaded",(function(e){LP.Hook.doAction("course-ready"),y.a.init()}))},5:function(e,t,n){"use strict";function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.d(t,"a",(function(){return c}));var i=jQuery,l=lodash.throttle,c=function(){var e,t=i("#popup-course"),n=i("#learn-press-course-curriculum");i("#sidebar-toggle").on("change",(function(e){LP.Cookies.set("sidebar-toggle",e.target.checked),r(e.target.checked)}));var r=function(e){i("body").removeClass("lp-sidebar-toggle__open"),i("body").removeClass("lp-sidebar-toggle__close"),e?i("body").addClass("lp-sidebar-toggle__close"):i("body").addClass("lp-sidebar-toggle__open")};r(LP.Cookies.get("sidebar-toggle")),n.find(".section-desc").each((function(e,t){var n=i('<span class="show-desc"></span>').on("click",(function(){o.toggleClass("c")})),o=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)||[],r=parseInt(e.data("section-id")),i=n.findIndex((function(e){return e==r}));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,o(new Set(n)))}))})),t.length&&(n.on("scroll",l((function(){var t=i(this);t.addClass("scrolling"),e&&clearTimeout(e),e=setTimeout((function(){t.removeClass("scrolling")}),1e3)}),500)),LP.toElement(".course-item.current",{container:".curriculum-scrollable:eq(1)",offset:100,duration:1}))}},6:function(e,t,n){"use strict";var o=jQuery,r=null,i={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,init:function(){return this.elLPOverlay=o(".lp-overlay"),!!this.elLPOverlay.length&&(r=this.elLPOverlay,this.elMainContent=r.find(".main-content"),this.elTitle=r.find(".modal-title"),this.elBtnYes=r.find(".btn-yes"),this.elBtnNo=r.find(".btn-no"),this.elFooter=r.find(".lp-modal-footer"),o(document).on("click",".close, .btn-no",(function(){r.hide()})),o(document).on("click",".btn-yes",(function(){"function"==typeof i.callBackYes&&i.callBackYes()})),!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)}},l=i,c=(jQuery,{elBtnFinishCourse:null,elBtnCompleteItem:null,init:function(){l.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");l.elLPOverlay.show(),l.setTitleModal(t.dataset.title),l.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),l.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");l.elLPOverlay.show(),l.setTitleModal(t.dataset.title),l.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),l.callBackYes=function(){t.submit()}}))})))}});t.a=c},8:function(e,t){function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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,o=new Array(t);n<t;n++)o[n]=e[n];return o}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&&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}))}});
assets/js/dist/utils.min.js CHANGED
@@ -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=9)}([,,,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)},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")}))}))},,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}},,,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(6),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}}]);
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=13)}({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}},13: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")}))}))}});
assets/src/apps/js/admin/pages/tools/database/upgrade.js CHANGED
@@ -1,4 +1,4 @@
1
- import { elLPOverlay, lpModalOverlay } from '../../../../utils/lp-modal-overlay';
2
  import handleAjax from '../../../../utils/handle-ajax-api';
3
 
4
  const $ = jQuery;
@@ -15,7 +15,7 @@ const upgradeDB = () => {
15
  if ( elWrapperTermsUpgrade.length ) { // Show Terms Upgrade.
16
  lpModalOverlay.setContentModal( elWrapperTermsUpgrade.html() );
17
 
18
- const elTermUpdate = elLPOverlay.find( '.terms-upgrade' );
19
  const elLPAgreeTerm = elTermUpdate.find( 'input[name=lp-agree-term]' );
20
  const elTermMessage = elTermUpdate.find( '.error' );
21
  const elMessageUpgrading = $( 'input[name=message-when-upgrading]' ).val();
@@ -64,7 +64,7 @@ const upgradeDB = () => {
64
  lpModalOverlay.elBtnNo.hide();
65
 
66
  const urlHandle = '/lp/v1/database/upgrade';
67
- const elGroupStep = elLPOverlay.find( '.lp-group-step' );
68
  const elItemSteps = elToolUpgradeDB.find( '.lp-item-step' );
69
 
70
  // Get params.
@@ -198,6 +198,11 @@ const getStepsUpgradeStatus = () => {
198
  return;
199
  }
200
 
 
 
 
 
 
201
  const elWrapperStatusUpgrade = $( '.wrapper-lp-status-upgrade' );
202
  const urlHandle = '/lp/v1/database/get_steps';
203
 
@@ -207,10 +212,7 @@ const getStepsUpgradeStatus = () => {
207
  const action = urlParams.get( 'action' );
208
 
209
  if ( 'upgrade-db' === action ) {
210
- elLPOverlay.show();
211
- if ( ! lpModalOverlay.instance ) {
212
- lpModalOverlay.init();
213
- }
214
  lpModalOverlay.setTitleModal( elToolUpgradeDB.find( 'h2' ).html() );
215
  lpModalOverlay.setContentModal( $( '.wrapper-lp-loading' ).html() );
216
  }
@@ -263,12 +265,7 @@ const getStepsUpgradeStatus = () => {
263
  }
264
 
265
  elBtnUpgradeDB.on( 'click', function() {
266
- // instance LP Modal Overlay.
267
- if ( ! lpModalOverlay.instance ) {
268
- lpModalOverlay.init();
269
- }
270
-
271
- elLPOverlay.show();
272
  upgradeDB();
273
  } );
274
  }
1
+ import lpModalOverlay from '../../../../utils/lp-modal-overlay';
2
  import handleAjax from '../../../../utils/handle-ajax-api';
3
 
4
  const $ = jQuery;
15
  if ( elWrapperTermsUpgrade.length ) { // Show Terms Upgrade.
16
  lpModalOverlay.setContentModal( elWrapperTermsUpgrade.html() );
17
 
18
+ const elTermUpdate = lpModalOverlay.elLPOverlay.find( '.terms-upgrade' );
19
  const elLPAgreeTerm = elTermUpdate.find( 'input[name=lp-agree-term]' );
20
  const elTermMessage = elTermUpdate.find( '.error' );
21
  const elMessageUpgrading = $( 'input[name=message-when-upgrading]' ).val();
64
  lpModalOverlay.elBtnNo.hide();
65
 
66
  const urlHandle = '/lp/v1/database/upgrade';
67
+ const elGroupStep = lpModalOverlay.elLPOverlay.find( '.lp-group-step' );
68
  const elItemSteps = elToolUpgradeDB.find( '.lp-item-step' );
69
 
70
  // Get params.
198
  return;
199
  }
200
 
201
+ // initial LP Modal Overlay
202
+ if ( ! lpModalOverlay.init() ) {
203
+ return;
204
+ }
205
+
206
  const elWrapperStatusUpgrade = $( '.wrapper-lp-status-upgrade' );
207
  const urlHandle = '/lp/v1/database/get_steps';
208
 
212
  const action = urlParams.get( 'action' );
213
 
214
  if ( 'upgrade-db' === action ) {
215
+ lpModalOverlay.elLPOverlay.show();
 
 
 
216
  lpModalOverlay.setTitleModal( elToolUpgradeDB.find( 'h2' ).html() );
217
  lpModalOverlay.setContentModal( $( '.wrapper-lp-loading' ).html() );
218
  }
265
  }
266
 
267
  elBtnUpgradeDB.on( 'click', function() {
268
+ lpModalOverlay.elLPOverlay.show();
 
 
 
 
 
269
  upgradeDB();
270
  } );
271
  }
assets/src/apps/js/frontend/show-lp-overlay-complete-item.js CHANGED
@@ -1,5 +1,5 @@
1
  const $ = jQuery;
2
- import lpModalOverlay from '../ultils/lp-modal-overlay';
3
 
4
  const lpModalOverlayCompleteItem = {
5
  elBtnFinishCourse: null,
1
  const $ = jQuery;
2
+ import lpModalOverlay from '../utils/lp-modal-overlay';
3
 
4
  const lpModalOverlayCompleteItem = {
5
  elBtnFinishCourse: null,
assets/src/apps/js/utils/handle-ajax-api.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const handleAjax = function( url, params, functions ) {
2
+ wp.apiFetch( {
3
+ path: url,
4
+ method: 'POST',
5
+ data: params,
6
+ } ).then( ( res ) => {
7
+ if ( 'function' === typeof functions.success ) {
8
+ functions.success( res );
9
+ }
10
+ } ).catch( ( err ) => {
11
+ if ( 'function' === typeof functions.error ) {
12
+ functions.error( err );
13
+ }
14
+ } ).then( () => {
15
+ if ( 'function' === typeof functions.completed ) {
16
+ functions.completed();
17
+ }
18
+ } );
19
+ };
20
+
21
+ export default handleAjax;
assets/src/apps/js/utils/lp-modal-overlay.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const $ = jQuery;
2
+ let elLPOverlay = null;
3
+ const lpModalOverlay = {
4
+ elLPOverlay: null,
5
+ elMainContent: null,
6
+ elTitle: null,
7
+ elBtnYes: null,
8
+ elBtnNo: null,
9
+ elFooter: null,
10
+ elCalledModal: null,
11
+ callBackYes: null,
12
+ init() {
13
+ this.elLPOverlay = $( '.lp-overlay' );
14
+
15
+ if ( ! this.elLPOverlay.length ) {
16
+ return false;
17
+ }
18
+ elLPOverlay = this.elLPOverlay;
19
+
20
+ this.elMainContent = elLPOverlay.find( '.main-content' );
21
+ this.elTitle = elLPOverlay.find( '.modal-title' );
22
+ this.elBtnYes = elLPOverlay.find( '.btn-yes' );
23
+ this.elBtnNo = elLPOverlay.find( '.btn-no' );
24
+ this.elFooter = elLPOverlay.find( '.lp-modal-footer' );
25
+
26
+ $( document ).on( 'click', '.close, .btn-no', function() {
27
+ elLPOverlay.hide();
28
+ } );
29
+
30
+ $( document ).on( 'click', '.btn-yes', function() {
31
+ if ( 'function' === typeof lpModalOverlay.callBackYes ) {
32
+ lpModalOverlay.callBackYes();
33
+ }
34
+ } );
35
+
36
+ return true;
37
+ },
38
+ setElCalledModal( elCalledModal ) {
39
+ this.elCalledModal = elCalledModal;
40
+ },
41
+ setContentModal( content, event ) {
42
+ this.elMainContent.html( content );
43
+ if ( 'function' === typeof event ) {
44
+ event();
45
+ }
46
+ },
47
+ setTitleModal( content ) {
48
+ this.elTitle.html( content );
49
+ },
50
+ };
51
+
52
+ export default lpModalOverlay;
inc/databases/class-lp-db.php CHANGED
@@ -22,6 +22,8 @@ class LP_Database {
22
  public $tb_lp_question_answers;
23
  public $tb_lp_question_answermeta;
24
  public $tb_lp_upgrade_db;
 
 
25
 
26
  protected function __construct() {
27
  /**
@@ -47,6 +49,7 @@ class LP_Database {
47
  $this->tb_lp_question_answermeta = $prefix . 'learnpress_question_answermeta';
48
  $this->tb_lp_upgrade_db = $prefix . 'learnpress_upgrade_db';
49
  $this->wpdb->hide_errors();
 
50
  }
51
 
52
  /**
@@ -62,6 +65,26 @@ class LP_Database {
62
  return self::$_instance;
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  /**
66
  * Get list Item by post type and user id
67
  *
@@ -91,7 +114,7 @@ class LP_Database {
91
  * @return int
92
  * @since 3.2.8
93
  */
94
- public function get_count_post_of_user( $filter ) {
95
  $query_append = '';
96
 
97
  $cache_key = _count_posts_cache_key( $filter->post_type );
@@ -245,7 +268,7 @@ class LP_Database {
245
  }
246
 
247
  if ( ! $col_exists ) {
248
- return $this->wpdb->query( "ALTER TABLE $name_table ADD COLUMN $name_col $type $query_add");
249
  }
250
 
251
  return true;
@@ -277,7 +300,7 @@ class LP_Database {
277
  * Add Index of Table
278
  *
279
  * @param string $name_table .
280
- * @param array $indexs .
281
  *
282
  * @return bool|int
283
  */
@@ -290,20 +313,20 @@ class LP_Database {
290
 
291
  foreach ( $indexs as $index ) {
292
  if ( $count_indexs === array_search( $index, $indexs ) ) {
293
- $add_index .= ' ADD INDEX ' . $index . ' (' . $index . '(190))';
294
  } else {
295
- $add_index .= ' ADD INDEX ' . $index . ' (' . $index . '(190)),';
296
  }
297
  }
298
 
299
- $query = $this->wpdb->prepare(
 
 
 
300
  "
301
- ALTER TABLE {$name_table}
302
- $add_index
303
- ", 1
304
  );
305
 
306
- return $this->wpdb->query( $query );
307
  }
308
 
309
  /**
@@ -331,21 +354,26 @@ class LP_Database {
331
  * Create table learnpress_user_item_results
332
  *
333
  * @return bool|int
 
334
  */
335
  public function create_tb_lp_user_item_results() {
336
- $query = $this->wpdb->prepare(
 
 
 
 
 
 
 
 
 
 
337
  "
338
- CREATE TABLE IF NOT EXISTS $this->tb_lp_user_item_results(
339
- id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
340
- user_item_id bigint(20) unsigned NOT NULL,
341
- result longtext,
342
- PRIMARY KEY (id),
343
- KEY user_item_id (user_item_id)
344
- )
345
- ", 1
346
  );
347
 
348
- return $this->wpdb->query( $query );
 
 
349
  }
350
 
351
  /**
@@ -354,17 +382,17 @@ class LP_Database {
354
  * @return bool|int
355
  */
356
  public function create_tb_lp_upgrade_db() {
357
- $query = $this->wpdb->prepare(
 
 
 
 
 
 
 
 
358
  "
359
- CREATE TABLE IF NOT EXISTS {$this->tb_lp_upgrade_db}(
360
- step varchar(255) PRIMARY KEY UNIQUE,
361
- status varchar(20),
362
- KEY status (status)
363
- )
364
- ", 1
365
  );
366
-
367
- return $this->wpdb->query( $query );
368
  }
369
 
370
  /**
@@ -382,7 +410,10 @@ class LP_Database {
382
 
383
  return $this->wpdb->insert(
384
  $this->tb_lp_upgrade_db,
385
- array( 'step' => $step, 'status' => $status ),
 
 
 
386
  array( '%s', '%s' )
387
  );
388
  }
@@ -395,4 +426,15 @@ class LP_Database {
395
  public function get_steps_completed() {
396
  return $this->wpdb->get_results( "SELECT step, status FROM {$this->tb_lp_upgrade_db}", OBJECT_K );
397
  }
 
 
 
 
 
 
 
 
 
 
 
398
  }
22
  public $tb_lp_question_answers;
23
  public $tb_lp_question_answermeta;
24
  public $tb_lp_upgrade_db;
25
+ private $collate = '';
26
+ public $max_index_length = '191';
27
 
28
  protected function __construct() {
29
  /**
49
  $this->tb_lp_question_answermeta = $prefix . 'learnpress_question_answermeta';
50
  $this->tb_lp_upgrade_db = $prefix . 'learnpress_upgrade_db';
51
  $this->wpdb->hide_errors();
52
+ $this->set_collate();
53
  }
54
 
55
  /**
65
  return self::$_instance;
66
  }
67
 
68
+ public function set_collate() {
69
+ $collate = '';
70
+
71
+ if ( $this->wpdb->has_cap( 'collation' ) ) {
72
+ if ( ! empty( $this->wpdb->charset ) ) {
73
+ $collate .= 'DEFAULT CHARACTER SET ' . $this->wpdb->charset;
74
+ }
75
+
76
+ if ( ! empty( $this->wpdb->collate ) ) {
77
+ $collate .= ' COLLATE ' . $this->wpdb->collate;
78
+ }
79
+ }
80
+
81
+ $this->collate = $collate;
82
+ }
83
+
84
+ public function get_collate(): string {
85
+ return $this->collate;
86
+ }
87
+
88
  /**
89
  * Get list Item by post type and user id
90
  *
114
  * @return int
115
  * @since 3.2.8
116
  */
117
+ public function get_count_post_of_user( LP_Post_Type_Filter $filter ): int {
118
  $query_append = '';
119
 
120
  $cache_key = _count_posts_cache_key( $filter->post_type );
268
  }
269
 
270
  if ( ! $col_exists ) {
271
+ return $this->wpdb->query( "ALTER TABLE $name_table ADD COLUMN $name_col $type $query_add" );
272
  }
273
 
274
  return true;
300
  * Add Index of Table
301
  *
302
  * @param string $name_table .
303
+ * @param array $indexs | ('type' => 'int', 'name' => '').
304
  *
305
  * @return bool|int
306
  */
313
 
314
  foreach ( $indexs as $index ) {
315
  if ( $count_indexs === array_search( $index, $indexs ) ) {
316
+ $add_index .= ' ADD INDEX ' . $index . ' (' . $index . ')';
317
  } else {
318
+ $add_index .= ' ADD INDEX ' . $index . ' (' . $index . '),';
319
  }
320
  }
321
 
322
+ $query = $this->wpdb->query(
323
+ "
324
+ ALTER TABLE {$name_table}
325
+ $add_index
326
  "
 
 
 
327
  );
328
 
329
+ return $query;
330
  }
331
 
332
  /**
354
  * Create table learnpress_user_item_results
355
  *
356
  * @return bool|int
357
+ * @throws Exception
358
  */
359
  public function create_tb_lp_user_item_results() {
360
+ $collate = $this->get_collate();
361
+
362
+ $execute = $this->wpdb->query(
363
+ "
364
+ CREATE TABLE IF NOT EXISTS $this->tb_lp_user_item_results(
365
+ id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
366
+ user_item_id bigint(20) unsigned NOT NULL,
367
+ result longtext,
368
+ PRIMARY KEY (id),
369
+ KEY user_item_id (user_item_id)
370
+ ) $collate
371
  "
 
 
 
 
 
 
 
 
372
  );
373
 
374
+ $this->check_execute_has_error();
375
+
376
+ return $execute;
377
  }
378
 
379
  /**
382
  * @return bool|int
383
  */
384
  public function create_tb_lp_upgrade_db() {
385
+ $collate = $this->get_collate();
386
+
387
+ return $this->wpdb->query(
388
+ "
389
+ CREATE TABLE IF NOT EXISTS {$this->tb_lp_upgrade_db}(
390
+ step varchar(50) PRIMARY KEY UNIQUE,
391
+ status varchar(10),
392
+ KEY status (status)
393
+ ) $collate
394
  "
 
 
 
 
 
 
395
  );
 
 
396
  }
397
 
398
  /**
410
 
411
  return $this->wpdb->insert(
412
  $this->tb_lp_upgrade_db,
413
+ array(
414
+ 'step' => $step,
415
+ 'status' => $status,
416
+ ),
417
  array( '%s', '%s' )
418
  );
419
  }
426
  public function get_steps_completed() {
427
  return $this->wpdb->get_results( "SELECT step, status FROM {$this->tb_lp_upgrade_db}", OBJECT_K );
428
  }
429
+
430
+ /**
431
+ * Check execute current has any errors.
432
+ *
433
+ * @throws Exception
434
+ */
435
+ public function check_execute_has_error() {
436
+ if ( $this->wpdb->last_error ) {
437
+ throw new Exception( $this->wpdb->last_error );
438
+ }
439
+ }
440
  }
inc/gateways/class-lp-gateway-abstract.php CHANGED
@@ -149,11 +149,11 @@ class LP_Gateway_Abstract extends LP_Abstract_Settings {
149
  /**
150
  * Process the payment.
151
  *
152
- * @param int $order
153
  *
154
  * @return array
155
  */
156
- public function process_payment( int $order ) {
157
  return array();
158
  }
159
 
149
  /**
150
  * Process the payment.
151
  *
152
+ * @param $order
153
  *
154
  * @return array
155
  */
156
+ public function process_payment( $order ) {
157
  return array();
158
  }
159
 
inc/handle-steps/class-lp-handle-steps.php CHANGED
@@ -4,6 +4,8 @@
4
  * Handle request(ajax|api) call step by step
5
  *
6
  * Class LP_Handle_Steps
 
 
7
  */
8
  class LP_Handle_Steps {
9
  /**
@@ -73,6 +75,6 @@ class LP_Handle_Steps {
73
  return call_user_func( $step_function, $data );
74
  }
75
 
76
- throw new Exception( __( 'Not found function', 'thim-core' ) . $step_function );
77
  }
78
  }
4
  * Handle request(ajax|api) call step by step
5
  *
6
  * Class LP_Handle_Steps
7
+ * @author tungnx
8
+ * @version 1.0.0
9
  */
10
  class LP_Handle_Steps {
11
  /**
75
  return call_user_func( $step_function, $data );
76
  }
77
 
78
+ throw new Exception( __( 'Not found function', 'learnpress' ) . $step_function );
79
  }
80
  }
inc/handle-steps/class-lp-handle-upgrade-db-steps.php CHANGED
@@ -1,9 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * Handle request(ajax|api) call step by step
5
  *
6
- * Class LP_Handle_Steps
 
 
7
  */
8
  class LP_Handle_Upgrade_Steps extends LP_Handle_Steps {
9
  /**
@@ -22,8 +24,8 @@ class LP_Handle_Upgrade_Steps extends LP_Handle_Steps {
22
  * @return LP_Step
23
  */
24
  public function finish_step( LP_Step $step, string $message ): LP_Step {
25
-
26
- do_action( 'lp/db/upgrade/finish', $step );
27
 
28
  $step->status = 'finished';
29
  $step->percent = 100;
@@ -31,4 +33,16 @@ class LP_Handle_Upgrade_Steps extends LP_Handle_Steps {
31
 
32
  return $step;
33
  }
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
1
  <?php
2
 
3
  /**
4
+ * Handle upgrade lp request(ajax|api) call step by step
5
  *
6
+ * Class LP_Handle_Upgrade_Steps
7
+ * @author tungnx
8
+ * @version 1.0.0
9
  */
10
  class LP_Handle_Upgrade_Steps extends LP_Handle_Steps {
11
  /**
24
  * @return LP_Step
25
  */
26
  public function finish_step( LP_Step $step, string $message ): LP_Step {
27
+ $lp_db = LP_Database::getInstance();
28
+ $lp_db->set_step_complete( $step->name, 'completed' );
29
 
30
  $step->status = 'finished';
31
  $step->percent = 100;
33
 
34
  return $step;
35
  }
36
+
37
+ /**
38
+ * Return error message of a step
39
+ *
40
+ * @param string $step
41
+ * @param string $message
42
+ *
43
+ * @return string
44
+ */
45
+ public function error_step( string $step, string $message ): string {
46
+ return sprintf( 'Step %s: %s', $step, $message );
47
+ }
48
  }
inc/lp-core-functions.php CHANGED
@@ -3800,3 +3800,69 @@ function lp_item_course_class( $class = array() ) {
3800
  }
3801
 
3802
  require_once dirname( __FILE__ ) . '/lp-custom-hooks.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3800
  }
3801
 
3802
  require_once dirname( __FILE__ ) . '/lp-custom-hooks.php';
3803
+
3804
+
3805
+ /**
3806
+ * Disable auto update
3807
+ *
3808
+ * @param $update
3809
+ * @param $item
3810
+ *
3811
+ * @return false
3812
+ * @author hungkv
3813
+ */
3814
+ function learnpress_disable_auto_update( $update, $item ) {
3815
+ $plugins = array( // Plugins to auto-update
3816
+ 'learnpress',
3817
+ );
3818
+ // Auto-update specified plugins
3819
+ if ( in_array( $item->slug, $plugins ) ) {
3820
+ return false;
3821
+ }
3822
+ }
3823
+ add_filter( 'auto_update_plugin', 'learnpress_disable_auto_update', 10, 2 );
3824
+
3825
+
3826
+ add_action( 'in_plugin_update_message-learnpress/learnpress.php', function ( $plugin_data ) {
3827
+ version_update_warning( LEARNPRESS_VERSION, $plugin_data['new_version'] );
3828
+ });
3829
+ /**
3830
+ * Custom message warning have new version
3831
+ *
3832
+ * @param $current_version
3833
+ * @param $new_version
3834
+ * @author hungkv
3835
+ */
3836
+ function version_update_warning( $current_version, $new_version ) {
3837
+ $current_version_minor_part = explode( '.', $current_version )[1];
3838
+ $new_version_minor_part = explode( '.', $new_version )[1];
3839
+ if ( $current_version_minor_part === $new_version_minor_part ) {
3840
+ return;
3841
+ }
3842
+ ?>
3843
+ <hr class="lp-update--warning__separator"/>
3844
+ <div class="lp-update--warning">
3845
+ <div>
3846
+ <div class="lp-update-warning__title">
3847
+ <?php echo esc_html__( 'Heads up, Please backup before upgrade!', 'learnpress' ); ?>
3848
+ </div>
3849
+ <div class="lp-update-warning__message">
3850
+ <?php echo esc_html__('The latest update includes some substantial changes across different areas of the plugin. We highly recommend you backup your site before upgrading, and make sure you first update in a staging environment','learnpress'); ?>
3851
+ </div>
3852
+ <style>
3853
+ #learnpress-update .update-message {
3854
+ background: #ff0000;
3855
+ }
3856
+ #learnpress-update .update-message p::after,
3857
+ #learnpress-update .update-message p::before {
3858
+ color: #fff;
3859
+ }
3860
+ .lp-update-warning__title, .lp-update-warning__message {
3861
+ color: #fff;
3862
+ }
3863
+ </style>
3864
+ </div>
3865
+ </div>
3866
+
3867
+ <?php
3868
+ }
inc/updates/learnpress-upgrade-4.php CHANGED
@@ -34,6 +34,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
34
  * @see create_tables
35
  * @see clone_tables
36
  * @see modify_tb_lp_user_items
 
37
  * @see convert_result_graduation_item
38
  * @see convert_result_questions
39
  * @see convert_retake_quiz
@@ -54,7 +55,10 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
54
  * @see convert_lp_settings
55
  */
56
  protected function __construct() {
57
- $this->version = '4.0.0';
 
 
 
58
  $this->group_steps = apply_filters(
59
  'lp/upgrade/4/steps',
60
  array(
@@ -62,32 +66,37 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
62
  'learnpress_user_items',
63
  '',
64
  array(
65
- 'create_tables' => new LP_Step(
66
  'create_tables',
67
  'Create tables',
68
  'learnpress_user_item_results'
69
  ),
70
- 'clone_tables' => new LP_Step(
71
  'clone_tables',
72
  'Backup Tables',
73
  'learnpress_user_items, learnpress_user_itemmeta, learnpress_question_answers, postmeta, options'
74
  ),
75
- 'modify_tb_lp_user_items' => new LP_Step(
76
  'modify_tb_lp_user_items',
77
  'Modify table learnpress_user_items',
78
  'Modify table learnpress_user_items, move the result of students on table learnpress_uset_itemmeta to learnpress_user_item_results'
79
  ),
80
- 'convert_result_graduation_item' => new LP_Step(
 
 
 
 
 
81
  'convert_result_graduation_item',
82
  'Convert Data Result courses, items\' courses',
83
  ''
84
  ),
85
- 'convert_result_questions' => new LP_Step(
86
  'convert_result_questions',
87
  'Convert Data Result questions',
88
  ''
89
  ),
90
- 'convert_retake_quiz' => new LP_Step(
91
  'convert_retake_quiz',
92
  'Convert retake quizzes',
93
  ''
@@ -97,72 +106,72 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
97
  'Create column extra_value',
98
  ''
99
  ),
100
- 'convert_meta_value_longtext' => new LP_Step(
101
  'convert_meta_value_longtext',
102
  'Copy meta_value longtext to extra_value',
103
  ''
104
  ),
105
- 'remove_data_lp_user_itemmeta' => new LP_Step(
106
  'remove_data_lp_user_itemmeta',
107
  'Remove data results of lp_user_itemmeta',
108
  ''
109
  ),
110
- 'modify_tb_lp_user_itemmeta' => new LP_Step(
111
  'modify_tb_lp_user_itemmeta',
112
  'Modify table learnpress_user_itemmeta',
113
  'Change type columns: meta_key, meta_value. Create Index: user_item_id, meta_key, meta_value'
114
  ),
115
- 'modify_tb_lp_quiz_questions' => new LP_Step(
116
  'modify_tb_lp_quiz_questions',
117
  'Modify table learnpress_quiz_questions',
118
  ''
119
  ),
120
- 'modify_tb_lp_question_answers' => new LP_Step(
121
  'modify_tb_lp_question_answers',
122
  'Modify table learnpress_question_answers',
123
  ''
124
  ),
125
- 'update_question_answers' => new LP_Step(
126
  'update_question_answers',
127
  'Update data table learnpress_question_answers',
128
  ''
129
  ),
130
- 'modify_tb_lp_question_answermeta' => new LP_Step(
131
  'modify_tb_lp_question_answermeta',
132
  'Modify table learnpress_question_answermeta',
133
  ''
134
  ),
135
- 'convert_question_type_fill_in_blank' => new LP_Step(
136
  'convert_question_type_fill_in_blank',
137
  'Update data question type "Fill in blank"',
138
  ''
139
  ),
140
- 'delete_columns_question_answers' => new LP_Step(
141
  'delete_columns_question_answers',
142
  'Delete data table learnpress_question_answers',
143
  ''
144
  ),
145
- 'modify_tb_lp_order_items' => new LP_Step(
146
  'modify_tb_lp_order_items',
147
  'Modify data table learnpress_order_items',
148
  ''
149
  ),
150
- 'modify_tb_lp_order_itemmeta' => new LP_Step(
151
  'modify_tb_lp_order_itemmeta',
152
  'Modify data table learnpress_order_itemmeta',
153
  ''
154
  ),
155
- 'modify_tb_lp_sections' => new LP_Step(
156
  'modify_tb_lp_sections',
157
  'Modify table learnpress_sections',
158
  'Create Index'
159
  ),
160
- 'modify_tb_lp_section_items' => new LP_Step(
161
  'modify_tb_lp_section_items',
162
  'Modify table learnpress_section_items',
163
  'Create Index'
164
  ),
165
- 'convert_lp_settings' => new LP_Step(
166
  'convert_lp_settings',
167
  'Convert data settings learnpress',
168
  'Courses thumbnail dimensions, Profile thumbnail dimensions, Profile rename dashboard to overview, Block course by duration, Block course when finished, Assessment course by quizzes - Evaluate, '
@@ -171,7 +180,6 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
171
  ),
172
  )
173
  );
174
- add_action( 'lp/db/upgrade/finish', array( $this, 'save_db_when_step_finish' ) );
175
  }
176
 
177
  /**
@@ -182,7 +190,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
182
  * @return LP_Step
183
  */
184
  protected function create_tables( array $data ): LP_Step {
185
- $response = new LP_Step( __FUNCTION__, '' );
186
  $key_create_table = 'create_table';
187
  $create_table = '';
188
 
@@ -195,7 +203,8 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
195
  * @see LP_Database::create_tb_lp_user_item_results
196
  * @see LP_Database::create_tb_lp_upgrade_db()
197
  */
198
- $lp_db = LP_Database::getInstance();
 
199
  $create_tables = array(
200
  'tb_lp_user_item_results',
201
  'tb_lp_upgrade_db',
@@ -206,7 +215,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
206
  if ( empty( $data ) ) {
207
  $create_table = $create_tables[0];
208
  } elseif ( ! empty( $data[ $key_create_table ] )
209
- && in_array( $data[ $key_create_table ], $create_tables ) ) {
210
  $create_table = $data[ $key_create_table ];
211
  }
212
 
@@ -241,7 +250,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
241
  }
242
  }
243
  } catch ( Exception $e ) {
244
- $response->message = $e->getMessage();
245
  }
246
 
247
  return $response;
@@ -278,7 +287,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
278
  if ( empty( $data ) ) {
279
  $clone_table = $clone_tables[0];
280
  } elseif ( ! empty( $data[ $key_clone_table ] )
281
- && in_array( $data[ $key_clone_table ], $clone_tables, true ) ) {
282
  $clone_table = $data[ $key_clone_table ];
283
  }
284
 
@@ -308,7 +317,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
308
  }
309
  }
310
  } catch ( Exception $e ) {
311
- $response->message = $e->getMessage();
312
  }
313
 
314
  return $response;
@@ -392,7 +401,63 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
392
  $indexs = array( 'user_id', 'item_id', 'item_type', 'status', 'ref_type', 'ref_id', 'parent_id' );
393
  $lp_db->add_indexs_table( $lp_db->tb_lp_user_items, $indexs );
394
  } catch ( Exception $e ) {
395
- $response->message = $e->getMessage();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  }
397
 
398
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
@@ -475,7 +540,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
475
  $response->data->p = ++ $page;
476
  $response->data->total_rows = $total_row;
477
  } catch ( Exception $e ) {
478
- $response->message = $e->getMessage();
479
  }
480
 
481
  return $response;
@@ -590,7 +655,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
590
  $response->data->p = ++ $page;
591
  $response->data->total_rows = $total_row;
592
  } catch ( Exception $e ) {
593
- $response->message = $e->getMessage();
594
  }
595
 
596
  return $response;
@@ -688,7 +753,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
688
  $response->data->p = ++ $page;
689
  $response->data->total_rows = $total_row;
690
  } catch ( Exception $e ) {
691
- $response->message = $e->getMessage();
692
  }
693
 
694
  return $response;
@@ -699,14 +764,14 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
699
  *
700
  * @return LP_Step
701
  */
702
- protected function create_col_extra_value_on_tb_lp_user_itemmeta() {
703
  $response = new LP_Step( __FUNCTION__, '' );
704
  $lp_db = LP_Database::getInstance();
705
 
706
  try {
707
  $lp_db->add_col_table( $lp_db->tb_lp_user_itemmeta, 'extra_value', 'longtext', 'meta_value' );
708
  } catch ( Exception $e ) {
709
- $response->message = $e->getMessage();
710
  }
711
 
712
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
@@ -717,11 +782,12 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
717
  *
718
  * @return LP_Step
719
  */
720
- protected function convert_meta_value_longtext() {
721
  $response = new LP_Step( __FUNCTION__, '' );
722
  $lp_db = LP_Database::getInstance();
723
 
724
  try {
 
725
  $lp_db->wpdb->query(
726
  "
727
  UPDATE $lp_db->tb_lp_user_itemmeta SET extra_value = meta_value
@@ -729,8 +795,17 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
729
  OR meta_key = '_lp_assignment_answer_upload'
730
  "
731
  );
 
 
 
 
 
 
 
 
 
732
  } catch ( Exception $e ) {
733
- $response->message = $e->getMessage();
734
  }
735
 
736
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
@@ -751,8 +826,8 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
751
  $lp_db->wpdb->query(
752
  "
753
  ALTER TABLE {$lp_db->tb_lp_user_itemmeta}
754
- CHANGE COLUMN `meta_key` `meta_key` VARCHAR(255) NOT NULL DEFAULT '',
755
- CHANGE COLUMN `meta_value` `meta_value` VARCHAR(255) NOT NULL DEFAULT ''
756
  "
757
  );
758
 
@@ -760,7 +835,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
760
  $indexs = array( 'learnpress_user_item_id', 'meta_key', 'meta_value' );
761
  $lp_db->add_indexs_table( $lp_db->tb_lp_user_itemmeta, $indexs );
762
  } catch ( Exception $e ) {
763
- $response->message = $e->getMessage();
764
  }
765
 
766
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
@@ -773,18 +848,19 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
773
  $response = new LP_Step( __FUNCTION__, '' );
774
  $lp_db = LP_Database::getInstance();
775
 
776
- /**
777
- * 1. Remove results course.
778
- * 2. Remove results item's course.
779
- * 3. Remove _question_answers.
780
- * 4. Remove grade.
781
- * 5. Remove _last_status.
782
- * 6. Remove _current_status.
783
- * 7. Remove finishing_type.
784
- * 8. Remove _retaken_items.
785
- */
786
- $query = $lp_db->wpdb->prepare(
787
- "
 
788
  DELETE FROM {$lp_db->tb_lp_user_itemmeta}
789
  WHERE meta_key LIKE 'course_results_evaluate_%'
790
  OR meta_key = '_question_answers'
@@ -794,10 +870,16 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
794
  OR meta_key = '_current_status'
795
  OR meta_key = 'finishing_type'
796
  OR meta_key = '_retaken_items'
797
- ",
798
- 1
799
- );
800
- $lp_db->wpdb->query( $query );
 
 
 
 
 
 
801
 
802
  return $this->finish_step(
803
  $response,
@@ -820,7 +902,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
820
  throw new Exception( $lp_db->wpdb->last_error );
821
  }
822
  } catch ( Exception $e ) {
823
- $response->message = $e->getMessage();
824
  }
825
 
826
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
@@ -888,7 +970,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
888
  throw new Exception( $lp_db->wpdb->last_error );
889
  }
890
  } catch ( Exception $e ) {
891
- $response->message = $e->getMessage();
892
  }
893
 
894
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
@@ -902,9 +984,9 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
902
  * @return LP_Step
903
  */
904
  protected function update_question_answers( array $data ): LP_Step {
905
- $response = new LP_Step( __FUNCTION__, '' );
906
- $lp_db = LP_Database::getInstance();
907
- global $wpdb;
908
  $page = 0;
909
  $offset = 0;
910
  $limit = 100;
@@ -974,6 +1056,10 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
974
  $row->question_answer_id
975
  );
976
  $wpdb->query( $update_sql );
 
 
 
 
977
  }
978
 
979
  $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
@@ -984,7 +1070,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
984
  $response->data->p = ++ $page;
985
  $response->data->total_rows = $total_row;
986
  } catch ( Exception $e ) {
987
- $response->message = $e->getMessage();
988
  }
989
 
990
  return $response;
@@ -1015,7 +1101,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1015
  "
1016
  );
1017
  } catch ( Exception $e ) {
1018
- $response->message = $e->getMessage();
1019
  }
1020
 
1021
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
@@ -1029,9 +1115,9 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1029
  * @return LP_Step
1030
  */
1031
  protected function convert_question_type_fill_in_blank( array $data = array() ): LP_Step {
1032
- $response = new LP_Step( __FUNCTION__, '' );
1033
- $lp_db = LP_Database::getInstance();
1034
- global $wpdb;
1035
  $page = 0;
1036
  $offset = 0;
1037
  $limit = 100;
@@ -1089,6 +1175,10 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1089
  );
1090
  $lp_db->wpdb->query( $query );
1091
 
 
 
 
 
1092
  $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
1093
 
1094
  $response->status = 'success';
@@ -1097,9 +1187,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1097
  $response->data->p = ++ $page;
1098
  $response->data->total_rows = $total_row;
1099
  } catch ( Exception $e ) {
1100
- LP_Debug::rollbackTransaction();
1101
-
1102
- $response->message = $e->getMessage();
1103
  }
1104
 
1105
  return $response;
@@ -1113,7 +1201,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1113
  $lp_db->drop_col_table( $lp_db->tb_lp_question_answers, 'answer_data' );
1114
  $lp_db->drop_col_table( $lp_db->tb_lp_question_answers, 'answer_order' );
1115
  } catch ( Exception $e ) {
1116
- $response->message = $e->getMessage();
1117
  }
1118
 
1119
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
@@ -1133,7 +1221,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1133
  $indexs = array( 'order_id', 'item_id', 'item_type' );
1134
  $lp_db->add_indexs_table( $lp_db->tb_lp_order_items, $indexs );
1135
  } catch ( Exception $e ) {
1136
- $response->message = $e->getMessage();
1137
  }
1138
 
1139
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
@@ -1152,8 +1240,8 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1152
  $lp_db->wpdb->query(
1153
  "
1154
  ALTER TABLE {$lp_db->tb_lp_order_itemmeta}
1155
- MODIFY COLUMN `meta_key` VARCHAR(255) NOT NULL DEFAULT '',
1156
- MODIFY COLUMN `meta_value` VARCHAR(255) NOT NULL DEFAULT ''
1157
  "
1158
  );
1159
 
@@ -1162,7 +1250,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1162
  $indexs = array( 'learnpress_order_item_id', 'meta_key', 'meta_value' );
1163
  $lp_db->add_indexs_table( $lp_db->tb_lp_order_itemmeta, $indexs );
1164
  } catch ( Exception $e ) {
1165
- $response->message = $e->getMessage();
1166
  }
1167
 
1168
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
@@ -1180,7 +1268,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1180
 
1181
  $lp_db->add_indexs_table( $lp_db->tb_lp_sections, $indexs );
1182
  } catch ( Exception $e ) {
1183
- $response->message = $e->getMessage();
1184
  }
1185
 
1186
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
@@ -1207,7 +1295,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1207
  $lp_db->wpdb->query( $query );
1208
 
1209
  } catch ( Exception $e ) {
1210
- $response->message = $e->getMessage();
1211
  }
1212
 
1213
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
@@ -1345,21 +1433,11 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
1345
  update_option( 'learnpress_db_version', '4' );
1346
  update_option( 'learnpress_version', LEARNPRESS_VERSION );
1347
  } catch ( Exception $e ) {
1348
- $response->message = $e->getMessage();
1349
  }
1350
 
1351
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1352
  }
1353
-
1354
- /**
1355
- * Save step status completed .
1356
- *
1357
- * @param LP_Step $step .
1358
- */
1359
- public function save_db_when_step_finish( LP_Step $step ) {
1360
- $lp_db = LP_Database::getInstance();
1361
- $lp_db->set_step_complete( $step->name, 'completed' );
1362
- }
1363
  }
1364
 
1365
  LP_Upgrade_4::get_instance();
34
  * @see create_tables
35
  * @see clone_tables
36
  * @see modify_tb_lp_user_items
37
+ * @see remove_course_status_cancelled
38
  * @see convert_result_graduation_item
39
  * @see convert_result_questions
40
  * @see convert_retake_quiz
55
  * @see convert_lp_settings
56
  */
57
  protected function __construct() {
58
+ $this->version = '4.0.0';
59
+ /**
60
+ * Name key not > 50 character
61
+ */
62
  $this->group_steps = apply_filters(
63
  'lp/upgrade/4/steps',
64
  array(
66
  'learnpress_user_items',
67
  '',
68
  array(
69
+ 'create_tables' => new LP_Step(
70
  'create_tables',
71
  'Create tables',
72
  'learnpress_user_item_results'
73
  ),
74
+ 'clone_tables' => new LP_Step(
75
  'clone_tables',
76
  'Backup Tables',
77
  'learnpress_user_items, learnpress_user_itemmeta, learnpress_question_answers, postmeta, options'
78
  ),
79
+ 'modify_tb_lp_user_items' => new LP_Step(
80
  'modify_tb_lp_user_items',
81
  'Modify table learnpress_user_items',
82
  'Modify table learnpress_user_items, move the result of students on table learnpress_uset_itemmeta to learnpress_user_item_results'
83
  ),
84
+ 'remove_course_status_cancelled' => new LP_Step(
85
+ 'remove_course_status_cancelled',
86
+ 'Remove courses has status cancelled',
87
+ 'learnpress_user_item_results'
88
+ ),
89
+ 'convert_result_graduation_item' => new LP_Step(
90
  'convert_result_graduation_item',
91
  'Convert Data Result courses, items\' courses',
92
  ''
93
  ),
94
+ 'convert_result_questions' => new LP_Step(
95
  'convert_result_questions',
96
  'Convert Data Result questions',
97
  ''
98
  ),
99
+ 'convert_retake_quiz' => new LP_Step(
100
  'convert_retake_quiz',
101
  'Convert retake quizzes',
102
  ''
106
  'Create column extra_value',
107
  ''
108
  ),
109
+ 'convert_meta_value_longtext' => new LP_Step(
110
  'convert_meta_value_longtext',
111
  'Copy meta_value longtext to extra_value',
112
  ''
113
  ),
114
+ 'remove_data_lp_user_itemmeta' => new LP_Step(
115
  'remove_data_lp_user_itemmeta',
116
  'Remove data results of lp_user_itemmeta',
117
  ''
118
  ),
119
+ 'modify_tb_lp_user_itemmeta' => new LP_Step(
120
  'modify_tb_lp_user_itemmeta',
121
  'Modify table learnpress_user_itemmeta',
122
  'Change type columns: meta_key, meta_value. Create Index: user_item_id, meta_key, meta_value'
123
  ),
124
+ 'modify_tb_lp_quiz_questions' => new LP_Step(
125
  'modify_tb_lp_quiz_questions',
126
  'Modify table learnpress_quiz_questions',
127
  ''
128
  ),
129
+ 'modify_tb_lp_question_answers' => new LP_Step(
130
  'modify_tb_lp_question_answers',
131
  'Modify table learnpress_question_answers',
132
  ''
133
  ),
134
+ 'update_question_answers' => new LP_Step(
135
  'update_question_answers',
136
  'Update data table learnpress_question_answers',
137
  ''
138
  ),
139
+ 'modify_tb_lp_question_answermeta' => new LP_Step(
140
  'modify_tb_lp_question_answermeta',
141
  'Modify table learnpress_question_answermeta',
142
  ''
143
  ),
144
+ 'convert_question_type_fill_in_blank' => new LP_Step(
145
  'convert_question_type_fill_in_blank',
146
  'Update data question type "Fill in blank"',
147
  ''
148
  ),
149
+ 'delete_columns_question_answers' => new LP_Step(
150
  'delete_columns_question_answers',
151
  'Delete data table learnpress_question_answers',
152
  ''
153
  ),
154
+ 'modify_tb_lp_order_items' => new LP_Step(
155
  'modify_tb_lp_order_items',
156
  'Modify data table learnpress_order_items',
157
  ''
158
  ),
159
+ 'modify_tb_lp_order_itemmeta' => new LP_Step(
160
  'modify_tb_lp_order_itemmeta',
161
  'Modify data table learnpress_order_itemmeta',
162
  ''
163
  ),
164
+ 'modify_tb_lp_sections' => new LP_Step(
165
  'modify_tb_lp_sections',
166
  'Modify table learnpress_sections',
167
  'Create Index'
168
  ),
169
+ 'modify_tb_lp_section_items' => new LP_Step(
170
  'modify_tb_lp_section_items',
171
  'Modify table learnpress_section_items',
172
  'Create Index'
173
  ),
174
+ 'convert_lp_settings' => new LP_Step(
175
  'convert_lp_settings',
176
  'Convert data settings learnpress',
177
  'Courses thumbnail dimensions, Profile thumbnail dimensions, Profile rename dashboard to overview, Block course by duration, Block course when finished, Assessment course by quizzes - Evaluate, '
180
  ),
181
  )
182
  );
 
183
  }
184
 
185
  /**
190
  * @return LP_Step
191
  */
192
  protected function create_tables( array $data ): LP_Step {
193
+ $response = new LP_Step( __FUNCTION__, 'Create table' );
194
  $key_create_table = 'create_table';
195
  $create_table = '';
196
 
203
  * @see LP_Database::create_tb_lp_user_item_results
204
  * @see LP_Database::create_tb_lp_upgrade_db()
205
  */
206
+ $lp_db = LP_Database::getInstance();
207
+
208
  $create_tables = array(
209
  'tb_lp_user_item_results',
210
  'tb_lp_upgrade_db',
215
  if ( empty( $data ) ) {
216
  $create_table = $create_tables[0];
217
  } elseif ( ! empty( $data[ $key_create_table ] )
218
+ && in_array( $data[ $key_create_table ], $create_tables ) ) {
219
  $create_table = $data[ $key_create_table ];
220
  }
221
 
250
  }
251
  }
252
  } catch ( Exception $e ) {
253
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
254
  }
255
 
256
  return $response;
287
  if ( empty( $data ) ) {
288
  $clone_table = $clone_tables[0];
289
  } elseif ( ! empty( $data[ $key_clone_table ] )
290
+ && in_array( $data[ $key_clone_table ], $clone_tables, true ) ) {
291
  $clone_table = $data[ $key_clone_table ];
292
  }
293
 
317
  }
318
  }
319
  } catch ( Exception $e ) {
320
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
321
  }
322
 
323
  return $response;
401
  $indexs = array( 'user_id', 'item_id', 'item_type', 'status', 'ref_type', 'ref_id', 'parent_id' );
402
  $lp_db->add_indexs_table( $lp_db->tb_lp_user_items, $indexs );
403
  } catch ( Exception $e ) {
404
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
405
+ }
406
+
407
+ return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
408
+ }
409
+
410
+ /**
411
+ * Remove courses has status "cancelled" and items child, itemmeta
412
+ *
413
+ * @return LP_Step
414
+ */
415
+ protected function remove_course_status_cancelled() : LP_Step {
416
+ $response = new LP_Step( __FUNCTION__, '' );
417
+ $lp_db = LP_Database::getInstance();
418
+
419
+ try {
420
+ $user_course_ids = $lp_db->wpdb->get_col(
421
+ $lp_db->wpdb->prepare(
422
+ "
423
+ SELECT user_item_id FROM $lp_db->tb_lp_user_items
424
+ WHERE item_type = %s
425
+ AND status = %s
426
+ ",
427
+ LP_COURSE_CPT,
428
+ 'cancelled'
429
+ )
430
+ );
431
+
432
+ $user_course_ids_str = implode( ',', $user_course_ids );
433
+
434
+ $user_item_ids = $lp_db->wpdb->get_col(
435
+ "
436
+ SELECT user_item_id FROM $lp_db->tb_lp_user_items
437
+ WHERE parent_id IN (" . $user_course_ids_str . ')
438
+ '
439
+ );
440
+
441
+ $user_item_ids_concat = array_merge( $user_course_ids, $user_item_ids );
442
+ $user_item_ids_concat_str = implode( ',', $user_item_ids_concat );
443
+
444
+ // Delete on tb lp_user_items
445
+ $lp_db->wpdb->query(
446
+ "
447
+ DELETE FROM $lp_db->tb_lp_user_items
448
+ WHERE user_item_id IN (" . $user_item_ids_concat_str . ')
449
+ '
450
+ );
451
+
452
+ // Delete on tb lp_user_itemmeta
453
+ $lp_db->wpdb->query(
454
+ "
455
+ DELETE FROM $lp_db->tb_lp_user_itemmeta
456
+ WHERE learnpress_user_item_id IN (" . $user_course_ids_str . ')
457
+ '
458
+ );
459
+ } catch ( Exception $e ) {
460
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
461
  }
462
 
463
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
540
  $response->data->p = ++ $page;
541
  $response->data->total_rows = $total_row;
542
  } catch ( Exception $e ) {
543
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
544
  }
545
 
546
  return $response;
655
  $response->data->p = ++ $page;
656
  $response->data->total_rows = $total_row;
657
  } catch ( Exception $e ) {
658
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
659
  }
660
 
661
  return $response;
753
  $response->data->p = ++ $page;
754
  $response->data->total_rows = $total_row;
755
  } catch ( Exception $e ) {
756
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
757
  }
758
 
759
  return $response;
764
  *
765
  * @return LP_Step
766
  */
767
+ protected function create_col_extra_value_on_tb_lp_user_itemmeta(): LP_Step {
768
  $response = new LP_Step( __FUNCTION__, '' );
769
  $lp_db = LP_Database::getInstance();
770
 
771
  try {
772
  $lp_db->add_col_table( $lp_db->tb_lp_user_itemmeta, 'extra_value', 'longtext', 'meta_value' );
773
  } catch ( Exception $e ) {
774
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
775
  }
776
 
777
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
782
  *
783
  * @return LP_Step
784
  */
785
+ protected function convert_meta_value_longtext(): LP_Step {
786
  $response = new LP_Step( __FUNCTION__, '' );
787
  $lp_db = LP_Database::getInstance();
788
 
789
  try {
790
+ // Copy meta_value to extra_value.
791
  $lp_db->wpdb->query(
792
  "
793
  UPDATE $lp_db->tb_lp_user_itemmeta SET extra_value = meta_value
795
  OR meta_key = '_lp_assignment_answer_upload'
796
  "
797
  );
798
+
799
+ // Empty meta_value.
800
+ $lp_db->wpdb->query(
801
+ "
802
+ UPDATE $lp_db->tb_lp_user_itemmeta SET meta_value = ''
803
+ WHERE meta_key = '_lp_assignment_answer_note'
804
+ OR meta_key = '_lp_assignment_answer_upload'
805
+ "
806
+ );
807
  } catch ( Exception $e ) {
808
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
809
  }
810
 
811
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
826
  $lp_db->wpdb->query(
827
  "
828
  ALTER TABLE {$lp_db->tb_lp_user_itemmeta}
829
+ CHANGE COLUMN `meta_key` `meta_key` VARCHAR(45) NOT NULL DEFAULT '',
830
+ CHANGE COLUMN `meta_value` `meta_value` VARCHAR(45) NOT NULL DEFAULT ''
831
  "
832
  );
833
 
835
  $indexs = array( 'learnpress_user_item_id', 'meta_key', 'meta_value' );
836
  $lp_db->add_indexs_table( $lp_db->tb_lp_user_itemmeta, $indexs );
837
  } catch ( Exception $e ) {
838
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
839
  }
840
 
841
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
848
  $response = new LP_Step( __FUNCTION__, '' );
849
  $lp_db = LP_Database::getInstance();
850
 
851
+ try {
852
+ /**
853
+ * 1. Remove results course.
854
+ * 2. Remove results item's course.
855
+ * 3. Remove _question_answers.
856
+ * 4. Remove grade.
857
+ * 5. Remove _last_status.
858
+ * 6. Remove _current_status.
859
+ * 7. Remove finishing_type.
860
+ * 8. Remove _retaken_items.
861
+ */
862
+ $query = $lp_db->wpdb->query(
863
+ "
864
  DELETE FROM {$lp_db->tb_lp_user_itemmeta}
865
  WHERE meta_key LIKE 'course_results_evaluate_%'
866
  OR meta_key = '_question_answers'
870
  OR meta_key = '_current_status'
871
  OR meta_key = 'finishing_type'
872
  OR meta_key = '_retaken_items'
873
+ "
874
+ );
875
+ $lp_db->wpdb->query( $query );
876
+
877
+ if ( $lp_db->wpdb->last_error ) {
878
+ throw new Exception( $lp_db->wpdb->last_error );
879
+ }
880
+ } catch ( Exception $e ) {
881
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
882
+ }
883
 
884
  return $this->finish_step(
885
  $response,
902
  throw new Exception( $lp_db->wpdb->last_error );
903
  }
904
  } catch ( Exception $e ) {
905
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
906
  }
907
 
908
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
970
  throw new Exception( $lp_db->wpdb->last_error );
971
  }
972
  } catch ( Exception $e ) {
973
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
974
  }
975
 
976
  return $this->finish_step( $response, 'Step ' . __FUNCTION__ . ' finished' );
984
  * @return LP_Step
985
  */
986
  protected function update_question_answers( array $data ): LP_Step {
987
+ $response = new LP_Step( __FUNCTION__, '' );
988
+ $lp_db = LP_Database::getInstance();
989
+ $wpdb = $lp_db->wpdb;
990
  $page = 0;
991
  $offset = 0;
992
  $limit = 100;
1056
  $row->question_answer_id
1057
  );
1058
  $wpdb->query( $update_sql );
1059
+
1060
+ if ( $lp_db->wpdb->last_error ) {
1061
+ throw new Exception( $lp_db->wpdb->last_error );
1062
+ }
1063
  }
1064
 
1065
  $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
1070
  $response->data->p = ++ $page;
1071
  $response->data->total_rows = $total_row;
1072
  } catch ( Exception $e ) {
1073
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1074
  }
1075
 
1076
  return $response;
1101
  "
1102
  );
1103
  } catch ( Exception $e ) {
1104
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1105
  }
1106
 
1107
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1115
  * @return LP_Step
1116
  */
1117
  protected function convert_question_type_fill_in_blank( array $data = array() ): LP_Step {
1118
+ $response = new LP_Step( __FUNCTION__, '' );
1119
+ $lp_db = LP_Database::getInstance();
1120
+ $wpdb = $lp_db->wpdb;
1121
  $page = 0;
1122
  $offset = 0;
1123
  $limit = 100;
1175
  );
1176
  $lp_db->wpdb->query( $query );
1177
 
1178
+ if ( $lp_db->wpdb->last_error ) {
1179
+ throw new Exception( $lp_db->wpdb->last_error );
1180
+ }
1181
+
1182
  $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
1183
 
1184
  $response->status = 'success';
1187
  $response->data->p = ++ $page;
1188
  $response->data->total_rows = $total_row;
1189
  } catch ( Exception $e ) {
1190
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
 
 
1191
  }
1192
 
1193
  return $response;
1201
  $lp_db->drop_col_table( $lp_db->tb_lp_question_answers, 'answer_data' );
1202
  $lp_db->drop_col_table( $lp_db->tb_lp_question_answers, 'answer_order' );
1203
  } catch ( Exception $e ) {
1204
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1205
  }
1206
 
1207
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1221
  $indexs = array( 'order_id', 'item_id', 'item_type' );
1222
  $lp_db->add_indexs_table( $lp_db->tb_lp_order_items, $indexs );
1223
  } catch ( Exception $e ) {
1224
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1225
  }
1226
 
1227
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1240
  $lp_db->wpdb->query(
1241
  "
1242
  ALTER TABLE {$lp_db->tb_lp_order_itemmeta}
1243
+ MODIFY COLUMN `meta_key` VARCHAR(45) NOT NULL DEFAULT '',
1244
+ MODIFY COLUMN `meta_value` VARCHAR(45) NOT NULL DEFAULT ''
1245
  "
1246
  );
1247
 
1250
  $indexs = array( 'learnpress_order_item_id', 'meta_key', 'meta_value' );
1251
  $lp_db->add_indexs_table( $lp_db->tb_lp_order_itemmeta, $indexs );
1252
  } catch ( Exception $e ) {
1253
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1254
  }
1255
 
1256
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1268
 
1269
  $lp_db->add_indexs_table( $lp_db->tb_lp_sections, $indexs );
1270
  } catch ( Exception $e ) {
1271
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1272
  }
1273
 
1274
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1295
  $lp_db->wpdb->query( $query );
1296
 
1297
  } catch ( Exception $e ) {
1298
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1299
  }
1300
 
1301
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1433
  update_option( 'learnpress_db_version', '4' );
1434
  update_option( 'learnpress_version', LEARNPRESS_VERSION );
1435
  } catch ( Exception $e ) {
1436
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
1437
  }
1438
 
1439
  return $this->finish_step( $response, __FUNCTION__ . ' finished' );
1440
  }
 
 
 
 
 
 
 
 
 
 
1441
  }
1442
 
1443
  LP_Upgrade_4::get_instance();
inc/user/abstract-lp-user.php CHANGED
@@ -723,20 +723,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
723
  $status = $item['status'];
724
  }
725
 
726
- $status = apply_filters( 'learn-press/user-item-status', $status, $item_id, $this->get_id(), $course_id );
727
-
728
- /**
729
- * @deprecated
730
- */
731
- $status = apply_filters(
732
- 'learn_press_user_course_item_status',
733
- $status,
734
- $item_id,
735
- $course_id,
736
- $this->get_id()
737
- );
738
-
739
- return $status;
740
  }
741
 
742
  /**
723
  $status = $item['status'];
724
  }
725
 
726
+ return apply_filters( 'learn-press/user-item-status', $status, $item_id, $this->get_id(), $course_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
727
  }
728
 
729
  /**
learnpress.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://thimpress.com/learnpress
5
  * Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  * Author: ThimPress
7
- * Version: 4.0.0
8
  * Author URI: http://thimpress.com
9
  * Requires at least: 3.8
10
  * Tested up to: 5.7
@@ -909,6 +909,8 @@ if ( ! class_exists( 'LearnPress' ) ) {
909
  * @return LearnPress
910
  */
911
  public static function instance() {
 
 
912
  if ( is_null( self::$_instance ) ) {
913
  self::$_instance = new self();
914
  }
4
  * Plugin URI: http://thimpress.com/learnpress
5
  * Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  * Author: ThimPress
7
+ * Version: 4.0.1
8
  * Author URI: http://thimpress.com
9
  * Requires at least: 3.8
10
  * Tested up to: 5.7
909
  * @return LearnPress
910
  */
911
  public static function instance() {
912
+ update_option( 'learnpress_version', LEARNPRESS_VERSION );
913
+
914
  if ( is_null( self::$_instance ) ) {
915
  self::$_instance = new self();
916
  }
readme.txt CHANGED
@@ -1,505 +1,510 @@
1
- === LearnPress - WordPress LMS Plugin ===
2
- Contributors: thimpress, tungnx89, nhamdv, hungkv, manhnl, tunnhn, phonglq.foobla, thongta, kendy73, leehld
3
- Donate link:
4
- Tags: elearning, education, course, lms, learning management system
5
- Requires at least: 5.6
6
- Tested up to: 5.7
7
- Requires PHP: 7.0
8
- Stable tag: 4.0.0
9
- License: GPLv2 or later
10
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
-
12
- A WordPress LMS Plugin to create WordPress Learning Management System. Turn your WordPress to LMS WordPress Website with Courses, Lessons, Quizzes & more.
13
-
14
- == Description ==
15
-
16
- **<a href="https://thimpress.com/learnpress" target="_blank">WordPress LMS Plugin</a>** - LearnPress is a comprehensive *WordPress LMS Plugin* for WordPress, like WordPress Moodle or Moodle for WordPress if you know what Moodle is. This is one of the best WordPress LMS Plugins which can be used to easily create & sell courses online. You can create a course curriculum with lessons & quizzes included which is managed with an easy-to-use interface for users. Having this WordPress LMS Plugin, now you have a chance to quickly and easily create education, online school, online-course websites with no coding knowledge required.
17
-
18
- <a href="https://demo-learnpress.thimpress.com/" target="_blank">Live Demo</a> | <a href="https://thimpress.com/product-category/themes/education-themes/" target="_blank">LearnPress Themes</a> | <a href="https://thimpress.com/forums/forum/plugins/learnpress-plugin/" target="_blank">Support</a>
19
-
20
- LearnPress is free and always will be, but it is still a premium high-quality WordPress Plugin that definitely helps you with making money from your **WordPress based LMS**. Just try and see how it is. LearnPress WordPress Online Course plugin is lightweight and super powerful with lots of Add-Ons to empower its core system.
21
-
22
- > Highly recommended by LearnPress users, we are pleased to introduce you to our best Education WordPress Themes which have LearnPress Theme Bundle included already.
23
- > [Eduma – Education WordPress Theme](https://themeforest.net/item/education-wordpress-theme-education-wp/14058034) (Bestseller).
24
- > [Colead - Coaching WordPress Theme](https://themeforest.net/item/speaker-and-life-coach-wordpress-theme-coaching-wp/17097658) (Rising Star).
25
- > [CBKit - Course Builder WordPress Theme](https://themeforest.net/item/course-builder-wordpress-learning-management-system-theme-elearning-software/20370918) (Potential).
26
-
27
- ###LMS & Education WordPress Themes###
28
-
29
- Take a look at Premium **[Eduma - Education WordPress Theme](https://themeforest.net/item/education-wordpress-theme-education-wp/14058034)**, **[Coaching WordPress Theme](https://themeforest.net/item/speaker-and-life-coach-wordpress-theme-coaching-wp/17097658)** & **[Epsilon – eLearning LMS WordPress Theme](https://themeforest.net/item/lms-wordpress-theme-elearning-wp/11797847)** & **[IvyPrep - Education & School WordPress Theme](https://themeforest.net/item/ivy-school-education-university-wordpress-theme/22773871)** & **[StarKid - Kindergarten WordPress Theme](https://themeforest.net/item/starkid-kindergarten-wordpress-theme/23451388)** (someone calls it LMS WordPress Template) we designed to work with LearnPress. All developers are welcome to develop WordPress LMS Theme based on LMS Plugin for WordPress - LearnPress. More WordPress LMS Themes are coming soon, both free and premium WordPress Themes for LearnPress.
30
-
31
- ###LearnPress Tutorials###
32
-
33
- - **[How to create a Udemy or Coursera clone easily with LearnPress](https://thimpress.com/create-udemy-coursera-clone-easily-learnpress/?utm_source=wporg&utm_medium=learnpress&ref=thimpress&utm_campaign=learnpress)**
34
-
35
- - Step-by-step Youtube guide on setting up your own Online Course site. **[Click here >>](https://www.youtube.com/watch?v=3LDa8vtDIAk)**
36
- [youtube https://www.youtube.com/watch?v=3LDa8vtDIAk&hd=1&&cc_load_policy=1]
37
-
38
- Are you looking for *the best LMS WordPress Plugin*?
39
-
40
- ###LearnPress features###
41
-
42
- **LearnPress - WordPress LMS Plugin works with your Theme**
43
- We create LearnPress LMS Plugin to work with any WordPress Themes.
44
-
45
- **LearnPress supports WordPress Multisite**
46
- Create WordPress based LMS as a multi-site.
47
-
48
- **Create course**
49
- LearnPress LMS Plugin provides an excellent user interface for online courses creating with any options you need. You can find it easy to make a full curriculum layout as well as edit and maintain it.
50
- You can also export and import your courses to another website using LearnPress.
51
-
52
- **Manage course**
53
- With the course you've created, you can share it, manage it, watch statistic about the number of students, trends, etc.
54
-
55
- **Sell course**
56
- LearnPress is free but it still allows you to sell your courses with many billing methods supported such as PayPal, WooCommerce, Stripe, etc.
57
-
58
- **Communicate with your students**
59
- BuddyPress makes it easier for you to communicate with your students or instructors via the WordPress forum. Studying, making friends and having fun.
60
-
61
- **LearnPress provides a bunch of add-ons**
62
- Add-ons are used to provide extra features for LearnPress and you can also write your own add-on for more purposes.
63
-
64
- **LearnPress is free and always will be**
65
- Education should be free and we want you to bring it to as many people as you can. Therefore, we create LearnPress as a tool for you to create online course and share it. We'll continue to develop it as long as we can and make it better and better.
66
-
67
- **LearnPress is actively developed**
68
- We are developing and improving LearnPress day by day and bringing you more new features cos we want LearnPress to become the **best WordPress LMS plugin**.
69
-
70
- <a href="https://docspress.thimpress.com/learnpress" target="_blank">LearnPress WordPress LMS Plugin Documentation</a>
71
-
72
- ###Free add-ons for LearnPress WordPress LMS Plugin###
73
-
74
- - [LearnPress Wishlist](https://wordpress.org/vilugins/learnpress-wishlist) - add courses to a wishlist for students.
75
- - [LearnPress Course Review](https://wordpress.org/plugins/learnpress-course-review) - review courses for enrolled students.
76
- - [LearnPress Import/Export](https://wordpress.org/plugins/learnpress-import-export) - export or import courses out-of-box.
77
- - [LearnPress Prerequisites Courses](https://wordpress.org/plugins/learnpress-prerequisites-courses) - require students need to pass the prerequisite course items to access the next ones.
78
- - [LearnPress bbPress Integration](https://wordpress.org/plugins/learnpress-bbpress) - interact with students and instructors in a course and discuss with each other about the course.
79
- - [LearnPress BuddyPress Integration](https://wordpress.org/plugins/learnpress-buddypress) - add BuddyPress support for LearnPress WordPress LMS Plugin, turn your WordPress BuddyPress website into *BuddyPress LMS* (*BuddyPress Learning Management System*)".
80
- - [LearnPress Offline Payment](https://wordpress.org/plugins/learnpress-offline-payment) - help you to manually create order for offline payment instead of paying via any payment gateways to sell course.
81
- - [LearnPress Fill In Blank](https://wordpress.org/plugins/learnpress-fill-in-blank) - Fill in Blank question type for LearnPress WordPress LMS Plugin.
82
-
83
- ###Premium add-ons for LearnPress WordPress LMS Plugin###
84
-
85
- - [Assignments add-on for LearnPress](https://thimpress.com/product/assignments-add-on-for-learnpress/) - Allow instructors to give assignments, homework for students and they can grade the students' work later on. The Assignments add-on is a great supplement to LearnPress and will make your courses more interactive.
86
- - [myCRED add-on for LearnPress](https://thimpress.com/product/mycred-add-on-for-learnpress/) - add myCRED support for LearnPress WordPress LMS plugin, you can add point system to your eLearning WordPress site using LearnPress + myCRED add-on.
87
- - [Certificates add-on for LearnPress](https://thimpress.com/product/certificates-add-on-for-learnpress/) - add drag & drop certificates builder as well as select designed certificate for each LMS course, your students will get particular certificates when they finished their courses.
88
- - [Co-instructors add-on for LearnPress](https://thimpress.com/product/co-instructors-add-on-for-learnpress/) - multiple instructors support for each LMS course.
89
- - [Collections add-on for LearnPress](https://thimpress.com/product/collections-add-on-for-learnpress/) – create LMS courses collection, this is helpful if you want to combine multiple LMS courses into a collection for a group of skills.
90
- - [Stripe Payment method for LearnPress](https://thimpress.com/product/stripe-add-on-for-learnpress/) - Stripe payment method for LearnPress WordPress LMS Plugin.
91
- - [2Checkout add-on for LearnPress](https://thimpress.com/product/2checkout-add-learnpress/) - make LearnPress plugin ready to use 2Checkout payment gateway to pay for courses.
92
- - [Authorize.Net add-ons for LearnPress](https://thimpress.com/product/authorize-net-add-ons-learnpress/) - Authorize.Net payment method for LearnPress WordPress LMS Plugin.
93
- - [WooCommerce add-on for LearnPress](https://thimpress.com/product/woocommerce-add-on-for-learnpress/) - use WooCommerce as payment gateway for LearnPress WordPress LMS Plugin.
94
- - [Content Drip add-on for LearnPress](https://thimpress.com/product/content-drip-add-on-for-learnpress/) - restrict the access of students to each lesson by progress, or time.
95
- - [Sorting Choices question type for LearnPress](https://thimpress.com/product/sorting-choice-add-on-for-learnpress/) - another interactive question type for LearnPress.
96
- - [Commission add-on for LearnPress](https://thimpress.com/product/commission-add-on-for-learnpress/) - provide a Commission Management system for LearnPress.
97
- - [Gradebook add-on for LearnPress](https://thimpress.com/product/gradebook-add-on-for-learnpress/) - view your class result, export these result to csv and post to frontend.
98
- - [Random Quiz add-on for LearnPress](https://thimpress.com/product/random-quiz-add-on-for-learnpress/) - allow you to create a random questions quiz. Each student will get different quiz within a same course.
99
- - [Paid Membership Pro add-on for LearnPress](https://thimpress.com/product/paid-membership-pro-add-learnpress/) - integrate Paid Membership Pro into LearnPress, bring membership feature to your powerful WordPress based LMS system.
100
- - [Announcement add-on for LearnPress](https://thimpress.com/product/announcement-add-on-for-learnpress/) - Announcement is a great way to promote your courses and update new features + contents of your courses, email notification included.
101
- - [Frontend Editor add-on for LearnPress](https://thimpress.com/product/frontend-editor-add-on-for-learnpress/) - Frontend Editor add-on for LearnPress enable your courses to be edited from the frontend. Your instructors doesn't need to go to the WP Dashboard to create and edit courses anymore with Frontend Editor add-on.
102
-
103
- ###LearnPress has been translated into the following languages###
104
-
105
- 1. English
106
- 2. French
107
- 3. Indonesian
108
- 4. Italian
109
- 5. German
110
- 6. Polish
111
- 7. Russian
112
- 8. Dutch (Netherlands)
113
- 9. Spanish (Costa Rica)
114
- 10. Spanish
115
- 11. Spanish (Mexico)
116
- 12. Spanish (Venezuela)
117
- 13. Indonesian
118
- 14. Chinese
119
-
120
-
121
- ##WordPress LMS Plugin - LearnPress ROADMAP##
122
-
123
- - Payment Method support (first priority)
124
- - Google Checkout
125
- - Amazon Payments
126
- - Dwolla
127
- - Braintree
128
- - Samurai by FeeFighters
129
- - WePay
130
- - Events
131
- - Share Grade
132
- - BadgeOS
133
- - Create quiz from random questions in question bank (DONE)
134
- - Attach restriction to lesson
135
- - Presentation support (maybe support SlideShare)
136
- - Student ranks
137
- - REST API for mobile app
138
- - No distraction mode (when doing quiz)
139
- - Report/feedback about a question/quiz/lesson
140
- - Commission for payment method (DONE)
141
- - Instructor's note
142
- - Private message from Admin to teacher
143
- - Group payment
144
-
145
- Any suggestions for this WordPress LMS Plugin? Send us <a href="https://thimpress.com/learnpress-suggestion/" target="_blank">here</a>.
146
-
147
- == Installation ==
148
-
149
- **From your WordPress dashboard**
150
- 1. Visit 'Plugin > Add new'.
151
- 2. Search for 'LearnPress'.
152
- 3. Activate LearnPress from your Plugins page.
153
-
154
- **From WordPress.org**
155
- 1. Search, select and download LearnPress.
156
- 2. Activate the plugin through the 'Plugins' menu in WordPress Dashboard.
157
-
158
- == Frequently Asked Questions ==
159
-
160
- = What is LearnPress? =
161
- LearnPress is a plugin for LMS website to spread out courses and sell courses online.
162
-
163
- = Where can I find LearnPress documentation and user guides? =
164
- If you want to use LearnPress to build a Learning Management System website, please refer to our user guides in <a href="https://docspress.thimpress.com/learnpress/" target="_blank">LearnPress official site.</a>
165
- And if you want to extend or use LearnPress, see our <a href="https://github.com/LearnPress/LearnPress/wiki" target="_blank">Wiki.</a>
166
-
167
- = Where can I get support or talk to other users? =
168
- If you get troubles when using LearnPress you can ask for help on the <a href="https://wordpress.org/support/plugin/learnpress">LearnPress Support Forum</a> or <a href="https://www.facebook.com/groups/learnpress/" target="_blank">join the private Facebook group</a>. You could share your feedback about LearnPress. And let us know which feature you want us to build next.
169
-
170
- For help with premium add-ons, use our <a href="https://thimpress.com/forums/forum/learnpress">helpdesk</a>.
171
-
172
- = Where can I ask for new features, suggest new ideas or new themes for LearnPress? =
173
- You can send us your thoughts through form <a href="https://thimpress.com/learnpress-suggestion/" target="_blank">here.</a>
174
-
175
- = Where can I report bugs or contribute to the project? =
176
- You can also report bugs on LearnPress Support Forum or LearnPress <a href="https://github.com/LearnPress/LearnPress" target="_blank">Github Repository</a>.
177
-
178
- = Where can I find the REST API documentation? =
179
- We will provide documentation about LearnPress REST API really soon.
180
-
181
- = LearnPress is great, can I contribute to it? =
182
- Yes, you can and we appreciate it. Join in our <a href="https://github.com/LearnPress/LearnPress" target="_blank">Github Repository</a>.
183
-
184
- **LearnPress Translation project**
185
- https://www.transifex.com/projects/p/learnpress/
186
-
187
- == Screenshots ==
188
-
189
- 1. Curriculum - Drag and Drop lesson or quiz.
190
- 2. Lesson content.
191
- 3. Quiz preview.
192
- 4. General settings.
193
- 5. Quiz settings.
194
- 6. Email settings.
195
- 7. Demo course page.
196
- 8. Add-ons of LearnPress.
197
-
198
- == Changelog ==
199
- = 4.0.0 =
200
- ~ Added new UI/UX for Quiz screen in frontend.
201
- ~ Added enable Gutenberg for lesson and quiz and question.
202
- ~ Added extra meta for course: Requirements, Target Audience, Key Features.
203
- ~ Improved quiz settings that made it simpler and easy to use.
204
- ~ Improved single course page.
205
- ~ Improved archive course page.
206
- ~ Restructure database tables.
207
- ~ Added some hooks/filters.
208
-
209
- = 3.2.8.8 =
210
- ~ Fix compatible PHP 8.0.3
211
- ~ Fix Yoat SEO course category title not working
212
-
213
- = 3.2.8.7 =
214
- ~ Fix: start quiz 404
215
- ~ Optimize
216
-
217
- = 3.2.8.6 =
218
- ~ Fix minor bug
219
- ~ Optimize enroll course
220
- ~ Add cache get items' course
221
- ~ Add reset progress by course_id
222
- ~ Fix "Enroll Button" is not appearing when disable "Auto Enroll" option
223
-
224
- = 3.2.8.5 =
225
- ~ Fix header lesson style error on iphone
226
- ~ Fix scrollbar error some themes
227
- ~ Fix scroll js to item user viewing
228
- ~ Add filter 'lp/email/type-order/object', 'lp/email/order/support_variable'
229
-
230
- = 3.2.8.4 =
231
- ~ Add function Scan database if have not index in table will create
232
- ~ Add function Repurchase course when course finished or block duration expire
233
- ~ Fix function Statistics
234
- ~ Fix error content lesson conflict when activated elementor & yoast seo
235
- ~ Fix order status on Dashboard screen
236
- ~ Remove js scrollbar jquery
237
- ~ Add option 'Enable Popup Confirm Finish Course, Complete Item
238
- ~ Add message block duration
239
-
240
- = 3.2.8.3 =
241
- ~ Fix compatible PHP 8.0
242
- ~ Fix checkout message error
243
- ~ Optimize
244
-
245
- = 3.2.8.2 =
246
- ~ Fix compatible WP 5.6
247
- ~ Fix error Yoast-Seo in course archive page
248
- ~ Error file global.js on 'Twenty Seventeen' theme
249
- ~ Fix error page course archive with YoastSeo
250
- ~ Fix count students enrolled course on list course backend
251
- ~ Fix toggle curriculum bar for right-to-left
252
-
253
- = 3.2.8.1 =
254
- ~ Fix WPBakery load style inline on course's item page
255
- ~ Fix make co-instructor not show list courses on backend
256
- ~ Fix miss lib vue js on LearnPress / Tools / Course page
257
-
258
- = 3.2.8 =
259
- ~ Fix query get posts (courses, items courses) on Backend - multiple site
260
- ~ Fix error not same param on hook of Yoast SEO vs Yoast SEO premium
261
- ~ Fix security XSS function view_log
262
- ~ Fix check if get user on function learn_press_course_purchase_button() is null
263
- ~ Fix create statics pages LP on 'lp setup' page
264
- ~ Show message duplicate class RWMB_Field with another plugins
265
-
266
- = 3.2.7.9 =
267
- ~ Fix question not show description
268
-
269
- = 3.2.7.8 =
270
- ~ Fix save author id when add item when edit course
271
- ~ Fix title, description item course when install yoast seo plugin
272
- ~ Fix Retake when not enable duration expire
273
- ~ Fix function 'Instructors Registration'
274
- ~ Add function Export order invoice PDF
275
-
276
- = 3.2.7.7 =
277
- ~ Add Evaluate via questions
278
- ~ Add Evaluate via mark
279
- ~ Fixed duration expire course
280
- ~ Fixed link 'Preview change' button when edit item course
281
- ~ Fixed title of course archive page
282
- ~ Fixed if quiz has only one question will not show paginate
283
-
284
- = 3.2.7.6 =
285
- ~ Fix missing file class-lp-course-database.php
286
-
287
- = 3.2.7.5 =
288
- ~ Fixed run Elementor with question.
289
- ~ Fixed lesson preview not show button complete when user enrolled.
290
- ~ Add tag apply_filter 'learn-press/order-item-not-course-id' on received-order.
291
- ~ Add tag apply_filter 'learn-press/tmpl-button-purchase-course' before return button purchase course.
292
- ~ Optimize (permalink of items course).
293
- ~ Show finish course button when items of course completed although the course not passed.
294
- ~ Fixed explanation of question when user completed quiz.
295
- ~ Hide description of quiz when the quiz completed.
296
-
297
- = 3.2.7.4 =
298
- ~ Fix can't load items when select on Order Backend
299
-
300
- = 3.2.7.3 =
301
- ~ Fixed error get_image() return bool not string on the file \templates\loop\course\thumbnail.php
302
- ~ Modify description for the function 'External Link'
303
- ~ Fixed LP_Datetime error with date = '0000-00-00 00:00:00'
304
- ~ Fixed not show number Duration of Lesson when translate text
305
- ~ Fixed not send mail for instructor when have new order
306
- ~ Remove hook get avatar of Ultimate member plugin
307
- ~ Fixed get value with, height image_size on LP setting
308
- ~ Fixed security, clear sanitize
309
- ~ Wilfried, security ninja at Synacktiv
310
- ~ Fixed compatible with Elementor on items of course (lesson, quizz, question v.v...)
311
-
312
- = 3.2.7.2 =
313
- ~ Fixed email setting not save tag html
314
-
315
- = 3.2.7.1 =
316
- ~ Fix save settings
317
-
318
- = 3.2.7 =
319
- ~ Fix sanitize
320
-
321
- = 3.2.6.10 =
322
- ~ Fix add-on GradeBook
323
-
324
- = 3.2.6.9 =
325
- ~ Revert library meta-box to v4.15.7
326
-
327
- = 3.2.6.8 =
328
- ~ Fixed security: remove functions low security
329
- ~ Fixed some minor bugs
330
- ~ Fixed confusing "external link button" name default of course
331
- ~ Fixed filter items of course
332
- ~ Fixed create same name, slug page Checkout with Woo
333
- ~ Improve performance
334
-
335
- = 3.2.6.7 (2020.03.16) =
336
- ~ Fixed security issues (CVE-2020-7916): uer logged can change role all users to Instructor
337
- ~ Fixed security issues (CVE-2020-7917): remove function low security
338
- ~ Fixed error preview Assignment
339
-
340
- = 3.2.6.6 =
341
- ~ Fixed option Block Lessons not working
342
-
343
- = 3.2.6.5 (20.11.2019) =
344
- ~ Fixed email doesn't send.
345
- ~ Fixed some js errors.
346
- ~ Fixed js call twice times.
347
- ~ Fixed question doesn't show after added to quiz.
348
- ~ Fixed ignore some metadata when copying course.
349
- ~ Fixed search orders in backend.
350
-
351
- = 3.2.6.4 =
352
- ~ Fixed some errors.
353
-
354
- = 3.2.6.3 =
355
- ~ Fixed css conflict with text block of vc.
356
- ~ Fixed show message 'Out of stock' for course reached limitation users.
357
- ~ Fixed show checked answers when review quiz.
358
- ~ Fixed review quiz option does not work properly.
359
- ~ Fixed update view after removing order's items.
360
-
361
- = 3.2.6.2 =
362
- ~ Fixed cannt add items to course.
363
-
364
- = 3.2.6 =
365
- ~ Added option to exclude js/css libraries unnecessary (used in theme or other plugins).
366
- ~ Added alt prop to user profile avatar.
367
- ~ Fixed can't next/prev questions when doing quiz.
368
- ~ Fixed wrong items navigation when learning course.
369
- ~ Fixed missing js of some pages in admin.
370
- ~ Fixed can't close admin notices.
371
- ~ Updated envato api to newer version.
372
-
373
- = 3.2.5.6 =
374
- ~ Added new strings for translating.
375
- ~ Corrected currency of Rwandan franc.
376
- ~ Fixed missing utils library when adding manually the orders.
377
- ~ Fixed upgrade function that doesn't hide the message when it done.
378
- ~ Fixed can't create new page in settings.
379
-
380
- = 3.2.5.5 =
381
- ~ Fixed guest can not start quiz with no require enroll course option.
382
- ~ Fixed sql to filter orders by user ID.
383
- ~ Fixed issue of sending email when finished course: not correct Grade.
384
- ~ Fixed can not see Actions buttons when adding questions into the quiz.
385
- ~ Fixed changed the logic of Continue button for Course: continue with the next incomplete item.
386
- ~ Fixed wrong code to pick up instructor email.
387
-
388
- = 3.2.5.4 =
389
- ~ Fixed load js missing dependencies and only in LP page.
390
-
391
- = 3.2.5.3 =
392
- ~ Changed SQL to read course items by user item ID.
393
- ~ Improved performance in admin orders page.
394
- ~ Upgraded Vue/Vuex to latest version.
395
- ~ Added new theme to LP ad.
396
-
397
- = 3.2.5.2 =
398
- ~ Fixed bug can't access course after purchased.
399
- ~ Fixed bug user can't redo quiz with option 'Retake' is 1.
400
- ~ Fixed bug can't order questions by date in questions bank.
401
- ~ Extracted purchased date to date and time in order emails.
402
- ~ Show point of quiz in result page.
403
-
404
- = 3.2.5.1 =
405
- ~ Fixed can not next/prev question when doing quiz.
406
- ~ Fixed get wrong total student of a course.
407
- ~ Updated language .POT file.
408
-
409
- = 3.2.5 =
410
- ~ Fixed button for creating LP pages does not work properly.
411
- ~ Fixed warning when getting course items does not exists.
412
- ~ Added button to close warning for outdated templates.
413
- ~ Fixed search order not working.
414
- ~ Fixed get course items in incorrect order.
415
- ~ Fixed can't start quiz when the course is not required enroll.
416
- ~ Fixed the amount number of enrolled users isn't updated correctly.
417
-
418
- = 3.2.4 =
419
- ~ Fixed cannot enroll course.
420
- ~ Fixed prev question button not working correct.
421
- ~ Fixed one extra answer option when add new question.
422
- ~ Fixed some deprecated keywords for PHP 7.3.
423
- ~ Fixed item is null for an item which doesn't support it's type (like assignment after deactivate).
424
- ~ Fixed bug the next and prev button not work in review mode of quiz.
425
-
426
- = 3.2.3 =
427
- ~ Removed un-security code in PP library.
428
- ~ Fixed get curriculum item types doesn't work properly.
429
- ~ Fixed sort sections/items wrong in SQL query.
430
-
431
- = 3.2.2 =
432
- ~ Fixed review quiz doesn't work properly.
433
- ~ Fixed table session create a lot of rows.
434
- ~ Fixed can't enroll to a course purchased.
435
- ~ Removed unused functions.
436
-
437
- = 3.2.1 =
438
- ~ Fixed can't enroll course.
439
- ~ Fixed upload issue and drag user avatar on mobile.
440
- ~ Fixed course duration does not work properly.
441
- ~ Fixed question with multi language.
442
- ~ Fixed mail to user 2 times when completed course.
443
-
444
- = 3.2.0 =
445
- ~ Fixed issue info of order added manual not correct.
446
- ~ Fixed issue course duplicated is published.
447
- ~ Fixed issue Course content column show as "No Content".
448
- ~ Fixed some issues related to cache.
449
-
450
- = 3.1.0 =
451
- ~ Fixed issue vulnerabilities.
452
- ~ Fixed issue related to object cache when doing quiz.
453
- ~ Fixed lesson 404 with Polylang.
454
- ~ Fixed PHP Fatal error class ‘LP_Plugins_Helper’ not found
455
-
456
- = 3.0.12 =
457
- ~ Fixed minor bug in gradebook list in admin
458
- ~ Made hook learn-press/course-tabs work
459
- ~ Fixed bug: not auto complete quiz. Add 1 more filter hook for checking publicity in profile page
460
- ~ Fixed bug: auto enroll course without permission to enroll course
461
- ~ Changed filter tag for get_default_meta of lesson
462
- ~ Auto full-screen in mobile view
463
- ~ Fixed bug: wrong count number in No Preview at Lessons List back-end page
464
- ~ Fixed bug: Instructor user cannot see comments of lesson
465
- ~ Changed version for template files
466
- ~ Added base url for construct nav in user profile
467
- ~ Added param for get_nav method
468
- ~ Fixed bug: answer correct all question but quiz result is failed with 0%
469
- ~ Fixed small bug in quiz editor
470
- ~ Fixed bug: wrong count number of the courses in back end because of the status of preview course
471
- ~ Fixed bug: not redirect to correct page after logged in in Profile page
472
- ~ Fixed bug fatal error include file
473
- ~ Added icon for chat-type-format of content item
474
- ~ Fixed header-sent when log file
475
-
476
- = 3.0.10 =
477
- ~ Added quiz option to minus a number of points for each wrong question in quiz
478
- ~ Added admin email to send to admin when an order is completed
479
- ~ Added button allows wp admin can send a request to subscriber
480
- ~ Improved auto redirecting to current question when user go to a quiz
481
- ~ Improved UI of course editor for RTL
482
- ~ Improved content of email sending to admin and instructor
483
- ~ Fixed page show 404 with pagination in courses page (conflict with WPML)
484
- ~ Fixed course price is still showing after user enrolled course
485
- ~ Fixed not auto redirecting to checkout after logged in
486
- ~ Fixed some issues made question can't edit
487
- ~ Fixed issue for requesting to get related themes/addons in admin
488
- ~ Fixed some issues with content header when viewing in Safari
489
- ~ Fixed wrong ordering of course item when adding new
490
- ~ Fixed order for multiple users is not show in list of orders
491
- ~ Fixed some text is not translatable
492
- ~ Fixed breadcrumb not show page name when viewing archive course
493
- ~ Fixed archive course show header is title of first course
494
-
495
- == Upgrade Notice ==
496
-
497
- = 4.0.0 =
498
- In this version, we have to change the database structure, so that if you have installed LP3 on your site before, please backup your site and follow these steps to upgrade.
499
-
500
- = 0.9.19 =
501
- In this version, we have changed a little bit about LearnPress Plugin directory structure and moved all add-ons to become independent plugins. If you face any problems related to add-ons, please completely remove old version and re-install LearnPress. It does not affect your current data. Thank you.
502
-
503
- == Other note ==
504
- <a href="https://docspress.thimpress.com/learnpress" target="_blank">Documentation</a> is available in ThimPress site.
505
- <a href="https://github.com/LearnPress/LearnPress/" target="_blank">LearnPress github repo</a>.
 
 
 
 
 
1
+ === LearnPress - WordPress LMS Plugin ===
2
+ Contributors: thimpress, tungnx89, nhamdv, hungkv, manhnl, tunnhn, phonglq.foobla, thongta, kendy73, leehld
3
+ Donate link:
4
+ Tags: elearning, education, course, lms, learning management system
5
+ Requires at least: 5.6
6
+ Tested up to: 5.7
7
+ Requires PHP: 7.0
8
+ Stable tag: 4.0.1
9
+ License: GPLv2 or later
10
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ A WordPress LMS Plugin to create WordPress Learning Management System. Turn your WordPress to LMS WordPress Website with Courses, Lessons, Quizzes & more.
13
+
14
+ == Description ==
15
+
16
+ **<a href="https://thimpress.com/learnpress" target="_blank">WordPress LMS Plugin</a>** - LearnPress is a comprehensive *WordPress LMS Plugin* for WordPress, like WordPress Moodle or Moodle for WordPress if you know what Moodle is. This is one of the best WordPress LMS Plugins which can be used to easily create & sell courses online. You can create a course curriculum with lessons & quizzes included which is managed with an easy-to-use interface for users. Having this WordPress LMS Plugin, now you have a chance to quickly and easily create education, online school, online-course websites with no coding knowledge required.
17
+
18
+ <a href="https://demo-learnpress.thimpress.com/" target="_blank">Live Demo</a> | <a href="https://thimpress.com/product-category/themes/education-themes/" target="_blank">LearnPress Themes</a> | <a href="https://thimpress.com/forums/forum/plugins/learnpress-plugin/" target="_blank">Support</a>
19
+
20
+ LearnPress is free and always will be, but it is still a premium high-quality WordPress Plugin that definitely helps you with making money from your **WordPress based LMS**. Just try and see how it is. LearnPress WordPress Online Course plugin is lightweight and super powerful with lots of Add-Ons to empower its core system.
21
+
22
+ > Highly recommended by LearnPress users, we are pleased to introduce you to our best Education WordPress Themes which have LearnPress Theme Bundle included already.
23
+ > [Eduma – Education WordPress Theme](https://themeforest.net/item/education-wordpress-theme-education-wp/14058034) (Bestseller).
24
+ > [Colead - Coaching WordPress Theme](https://themeforest.net/item/speaker-and-life-coach-wordpress-theme-coaching-wp/17097658) (Rising Star).
25
+ > [CBKit - Course Builder WordPress Theme](https://themeforest.net/item/course-builder-wordpress-learning-management-system-theme-elearning-software/20370918) (Potential).
26
+
27
+ ###LMS & Education WordPress Themes###
28
+
29
+ Take a look at Premium **[Eduma - Education WordPress Theme](https://themeforest.net/item/education-wordpress-theme-education-wp/14058034)**, **[Coaching WordPress Theme](https://themeforest.net/item/speaker-and-life-coach-wordpress-theme-coaching-wp/17097658)** & **[Epsilon – eLearning LMS WordPress Theme](https://themeforest.net/item/lms-wordpress-theme-elearning-wp/11797847)** & **[IvyPrep - Education & School WordPress Theme](https://themeforest.net/item/ivy-school-education-university-wordpress-theme/22773871)** & **[StarKid - Kindergarten WordPress Theme](https://themeforest.net/item/starkid-kindergarten-wordpress-theme/23451388)** (someone calls it LMS WordPress Template) we designed to work with LearnPress. All developers are welcome to develop WordPress LMS Theme based on LMS Plugin for WordPress - LearnPress. More WordPress LMS Themes are coming soon, both free and premium WordPress Themes for LearnPress.
30
+
31
+ ###LearnPress Tutorials###
32
+
33
+ - **[How to create a Udemy or Coursera clone easily with LearnPress](https://thimpress.com/create-udemy-coursera-clone-easily-learnpress/?utm_source=wporg&utm_medium=learnpress&ref=thimpress&utm_campaign=learnpress)**
34
+
35
+ - Step-by-step Youtube guide on setting up your own Online Course site. **[Click here >>](https://www.youtube.com/watch?v=3LDa8vtDIAk)**
36
+ [youtube https://www.youtube.com/watch?v=3LDa8vtDIAk&hd=1&&cc_load_policy=1]
37
+
38
+ Are you looking for *the best LMS WordPress Plugin*?
39
+
40
+ ###LearnPress features###
41
+
42
+ **LearnPress - WordPress LMS Plugin works with your Theme**
43
+ We create LearnPress LMS Plugin to work with any WordPress Themes.
44
+
45
+ **LearnPress supports WordPress Multisite**
46
+ Create WordPress based LMS as a multi-site.
47
+
48
+ **Create course**
49
+ LearnPress LMS Plugin provides an excellent user interface for online courses creating with any options you need. You can find it easy to make a full curriculum layout as well as edit and maintain it.
50
+ You can also export and import your courses to another website using LearnPress.
51
+
52
+ **Manage course**
53
+ With the course you've created, you can share it, manage it, watch statistic about the number of students, trends, etc.
54
+
55
+ **Sell course**
56
+ LearnPress is free but it still allows you to sell your courses with many billing methods supported such as PayPal, WooCommerce, Stripe, etc.
57
+
58
+ **Communicate with your students**
59
+ BuddyPress makes it easier for you to communicate with your students or instructors via the WordPress forum. Studying, making friends and having fun.
60
+
61
+ **LearnPress provides a bunch of add-ons**
62
+ Add-ons are used to provide extra features for LearnPress and you can also write your own add-on for more purposes.
63
+
64
+ **LearnPress is free and always will be**
65
+ Education should be free and we want you to bring it to as many people as you can. Therefore, we create LearnPress as a tool for you to create online course and share it. We'll continue to develop it as long as we can and make it better and better.
66
+
67
+ **LearnPress is actively developed**
68
+ We are developing and improving LearnPress day by day and bringing you more new features cos we want LearnPress to become the **best WordPress LMS plugin**.
69
+
70
+ <a href="https://docspress.thimpress.com/learnpress" target="_blank">LearnPress WordPress LMS Plugin Documentation</a>
71
+
72
+ ###Free add-ons for LearnPress WordPress LMS Plugin###
73
+
74
+ - [LearnPress Wishlist](https://wordpress.org/vilugins/learnpress-wishlist) - add courses to a wishlist for students.
75
+ - [LearnPress Course Review](https://wordpress.org/plugins/learnpress-course-review) - review courses for enrolled students.
76
+ - [LearnPress Import/Export](https://wordpress.org/plugins/learnpress-import-export) - export or import courses out-of-box.
77
+ - [LearnPress Prerequisites Courses](https://wordpress.org/plugins/learnpress-prerequisites-courses) - require students need to pass the prerequisite course items to access the next ones.
78
+ - [LearnPress bbPress Integration](https://wordpress.org/plugins/learnpress-bbpress) - interact with students and instructors in a course and discuss with each other about the course.
79
+ - [LearnPress BuddyPress Integration](https://wordpress.org/plugins/learnpress-buddypress) - add BuddyPress support for LearnPress WordPress LMS Plugin, turn your WordPress BuddyPress website into *BuddyPress LMS* (*BuddyPress Learning Management System*)".
80
+ - [LearnPress Offline Payment](https://wordpress.org/plugins/learnpress-offline-payment) - help you to manually create order for offline payment instead of paying via any payment gateways to sell course.
81
+ - [LearnPress Fill In Blank](https://wordpress.org/plugins/learnpress-fill-in-blank) - Fill in Blank question type for LearnPress WordPress LMS Plugin.
82
+
83
+ ###Premium add-ons for LearnPress WordPress LMS Plugin###
84
+
85
+ - [Assignments add-on for LearnPress](https://thimpress.com/product/assignments-add-on-for-learnpress/) - Allow instructors to give assignments, homework for students and they can grade the students' work later on. The Assignments add-on is a great supplement to LearnPress and will make your courses more interactive.
86
+ - [myCRED add-on for LearnPress](https://thimpress.com/product/mycred-add-on-for-learnpress/) - add myCRED support for LearnPress WordPress LMS plugin, you can add point system to your eLearning WordPress site using LearnPress + myCRED add-on.
87
+ - [Certificates add-on for LearnPress](https://thimpress.com/product/certificates-add-on-for-learnpress/) - add drag & drop certificates builder as well as select designed certificate for each LMS course, your students will get particular certificates when they finished their courses.
88
+ - [Co-instructors add-on for LearnPress](https://thimpress.com/product/co-instructors-add-on-for-learnpress/) - multiple instructors support for each LMS course.
89
+ - [Collections add-on for LearnPress](https://thimpress.com/product/collections-add-on-for-learnpress/) – create LMS courses collection, this is helpful if you want to combine multiple LMS courses into a collection for a group of skills.
90
+ - [Stripe Payment method for LearnPress](https://thimpress.com/product/stripe-add-on-for-learnpress/) - Stripe payment method for LearnPress WordPress LMS Plugin.
91
+ - [2Checkout add-on for LearnPress](https://thimpress.com/product/2checkout-add-learnpress/) - make LearnPress plugin ready to use 2Checkout payment gateway to pay for courses.
92
+ - [Authorize.Net add-ons for LearnPress](https://thimpress.com/product/authorize-net-add-ons-learnpress/) - Authorize.Net payment method for LearnPress WordPress LMS Plugin.
93
+ - [WooCommerce add-on for LearnPress](https://thimpress.com/product/woocommerce-add-on-for-learnpress/) - use WooCommerce as payment gateway for LearnPress WordPress LMS Plugin.
94
+ - [Content Drip add-on for LearnPress](https://thimpress.com/product/content-drip-add-on-for-learnpress/) - restrict the access of students to each lesson by progress, or time.
95
+ - [Sorting Choices question type for LearnPress](https://thimpress.com/product/sorting-choice-add-on-for-learnpress/) - another interactive question type for LearnPress.
96
+ - [Commission add-on for LearnPress](https://thimpress.com/product/commission-add-on-for-learnpress/) - provide a Commission Management system for LearnPress.
97
+ - [Gradebook add-on for LearnPress](https://thimpress.com/product/gradebook-add-on-for-learnpress/) - view your class result, export these result to csv and post to frontend.
98
+ - [Random Quiz add-on for LearnPress](https://thimpress.com/product/random-quiz-add-on-for-learnpress/) - allow you to create a random questions quiz. Each student will get different quiz within a same course.
99
+ - [Paid Membership Pro add-on for LearnPress](https://thimpress.com/product/paid-membership-pro-add-learnpress/) - integrate Paid Membership Pro into LearnPress, bring membership feature to your powerful WordPress based LMS system.
100
+ - [Announcement add-on for LearnPress](https://thimpress.com/product/announcement-add-on-for-learnpress/) - Announcement is a great way to promote your courses and update new features + contents of your courses, email notification included.
101
+ - [Frontend Editor add-on for LearnPress](https://thimpress.com/product/frontend-editor-add-on-for-learnpress/) - Frontend Editor add-on for LearnPress enable your courses to be edited from the frontend. Your instructors doesn't need to go to the WP Dashboard to create and edit courses anymore with Frontend Editor add-on.
102
+
103
+ ###LearnPress has been translated into the following languages###
104
+
105
+ 1. English
106
+ 2. French
107
+ 3. Indonesian
108
+ 4. Italian
109
+ 5. German
110
+ 6. Polish
111
+ 7. Russian
112
+ 8. Dutch (Netherlands)
113
+ 9. Spanish (Costa Rica)
114
+ 10. Spanish
115
+ 11. Spanish (Mexico)
116
+ 12. Spanish (Venezuela)
117
+ 13. Indonesian
118
+ 14. Chinese
119
+
120
+
121
+ ##WordPress LMS Plugin - LearnPress ROADMAP##
122
+
123
+ - Payment Method support (first priority)
124
+ - Google Checkout
125
+ - Amazon Payments
126
+ - Dwolla
127
+ - Braintree
128
+ - Samurai by FeeFighters
129
+ - WePay
130
+ - Events
131
+ - Share Grade
132
+ - BadgeOS
133
+ - Create quiz from random questions in question bank (DONE)
134
+ - Attach restriction to lesson
135
+ - Presentation support (maybe support SlideShare)
136
+ - Student ranks
137
+ - REST API for mobile app
138
+ - No distraction mode (when doing quiz)
139
+ - Report/feedback about a question/quiz/lesson
140
+ - Commission for payment method (DONE)
141
+ - Instructor's note
142
+ - Private message from Admin to teacher
143
+ - Group payment
144
+
145
+ Any suggestions for this WordPress LMS Plugin? Send us <a href="https://thimpress.com/learnpress-suggestion/" target="_blank">here</a>.
146
+
147
+ == Installation ==
148
+
149
+ **From your WordPress dashboard**
150
+ 1. Visit 'Plugin > Add new'.
151
+ 2. Search for 'LearnPress'.
152
+ 3. Activate LearnPress from your Plugins page.
153
+
154
+ **From WordPress.org**
155
+ 1. Search, select and download LearnPress.
156
+ 2. Activate the plugin through the 'Plugins' menu in WordPress Dashboard.
157
+
158
+ == Frequently Asked Questions ==
159
+
160
+ = What is LearnPress? =
161
+ LearnPress is a plugin for LMS website to spread out courses and sell courses online.
162
+
163
+ = Where can I find LearnPress documentation and user guides? =
164
+ If you want to use LearnPress to build a Learning Management System website, please refer to our user guides in <a href="https://docspress.thimpress.com/learnpress/" target="_blank">LearnPress official site.</a>
165
+ And if you want to extend or use LearnPress, see our <a href="https://github.com/LearnPress/LearnPress/wiki" target="_blank">Wiki.</a>
166
+
167
+ = Where can I get support or talk to other users? =
168
+ If you get troubles when using LearnPress you can ask for help on the <a href="https://wordpress.org/support/plugin/learnpress">LearnPress Support Forum</a> or <a href="https://www.facebook.com/groups/learnpress/" target="_blank">join the private Facebook group</a>. You could share your feedback about LearnPress. And let us know which feature you want us to build next.
169
+
170
+ For help with premium add-ons, use our <a href="https://thimpress.com/forums/forum/learnpress">helpdesk</a>.
171
+
172
+ = Where can I ask for new features, suggest new ideas or new themes for LearnPress? =
173
+ You can send us your thoughts through form <a href="https://thimpress.com/learnpress-suggestion/" target="_blank">here.</a>
174
+
175
+ = Where can I report bugs or contribute to the project? =
176
+ You can also report bugs on LearnPress Support Forum or LearnPress <a href="https://github.com/LearnPress/LearnPress" target="_blank">Github Repository</a>.
177
+
178
+ = Where can I find the REST API documentation? =
179
+ We will provide documentation about LearnPress REST API really soon.
180
+
181
+ = LearnPress is great, can I contribute to it? =
182
+ Yes, you can and we appreciate it. Join in our <a href="https://github.com/LearnPress/LearnPress" target="_blank">Github Repository</a>.
183
+
184
+ **LearnPress Translation project**
185
+ https://www.transifex.com/projects/p/learnpress/
186
+
187
+ == Screenshots ==
188
+
189
+ 1. Curriculum - Drag and Drop lesson or quiz.
190
+ 2. Lesson content.
191
+ 3. Quiz preview.
192
+ 4. General settings.
193
+ 5. Quiz settings.
194
+ 6. Email settings.
195
+ 7. Demo course page.
196
+ 8. Add-ons of LearnPress.
197
+
198
+ == Changelog ==
199
+
200
+ = 4.0.1 =
201
+ ~ Fixed: upgrade LP error if mysql version < 5.7 - "Specified key was too long".
202
+ ~ Fixed: minor bugs.
203
+
204
+ = 4.0.0 =
205
+ ~ Added new UI/UX for Quiz screen in frontend.
206
+ ~ Added enable Gutenberg for lesson and quiz and question.
207
+ ~ Added extra meta for course: Requirements, Target Audience, Key Features.
208
+ ~ Improved quiz settings that made it simpler and easy to use.
209
+ ~ Improved single course page.
210
+ ~ Improved archive course page.
211
+ ~ Restructure database tables.
212
+ ~ Added some hooks/filters.
213
+
214
+ = 3.2.8.8 =
215
+ ~ Fix compatible PHP 8.0.3
216
+ ~ Fix Yoat SEO course category title not working
217
+
218
+ = 3.2.8.7 =
219
+ ~ Fix: start quiz 404
220
+ ~ Optimize
221
+
222
+ = 3.2.8.6 =
223
+ ~ Fix minor bug
224
+ ~ Optimize enroll course
225
+ ~ Add cache get items' course
226
+ ~ Add reset progress by course_id
227
+ ~ Fix "Enroll Button" is not appearing when disable "Auto Enroll" option
228
+
229
+ = 3.2.8.5 =
230
+ ~ Fix header lesson style error on iphone
231
+ ~ Fix scrollbar error some themes
232
+ ~ Fix scroll js to item user viewing
233
+ ~ Add filter 'lp/email/type-order/object', 'lp/email/order/support_variable'
234
+
235
+ = 3.2.8.4 =
236
+ ~ Add function Scan database if have not index in table will create
237
+ ~ Add function Repurchase course when course finished or block duration expire
238
+ ~ Fix function Statistics
239
+ ~ Fix error content lesson conflict when activated elementor & yoast seo
240
+ ~ Fix order status on Dashboard screen
241
+ ~ Remove js scrollbar jquery
242
+ ~ Add option 'Enable Popup Confirm Finish Course, Complete Item
243
+ ~ Add message block duration
244
+
245
+ = 3.2.8.3 =
246
+ ~ Fix compatible PHP 8.0
247
+ ~ Fix checkout message error
248
+ ~ Optimize
249
+
250
+ = 3.2.8.2 =
251
+ ~ Fix compatible WP 5.6
252
+ ~ Fix error Yoast-Seo in course archive page
253
+ ~ Error file global.js on 'Twenty Seventeen' theme
254
+ ~ Fix error page course archive with YoastSeo
255
+ ~ Fix count students enrolled course on list course backend
256
+ ~ Fix toggle curriculum bar for right-to-left
257
+
258
+ = 3.2.8.1 =
259
+ ~ Fix WPBakery load style inline on course's item page
260
+ ~ Fix make co-instructor not show list courses on backend
261
+ ~ Fix miss lib vue js on LearnPress / Tools / Course page
262
+
263
+ = 3.2.8 =
264
+ ~ Fix query get posts (courses, items courses) on Backend - multiple site
265
+ ~ Fix error not same param on hook of Yoast SEO vs Yoast SEO premium
266
+ ~ Fix security XSS function view_log
267
+ ~ Fix check if get user on function learn_press_course_purchase_button() is null
268
+ ~ Fix create statics pages LP on 'lp setup' page
269
+ ~ Show message duplicate class RWMB_Field with another plugins
270
+
271
+ = 3.2.7.9 =
272
+ ~ Fix question not show description
273
+
274
+ = 3.2.7.8 =
275
+ ~ Fix save author id when add item when edit course
276
+ ~ Fix title, description item course when install yoast seo plugin
277
+ ~ Fix Retake when not enable duration expire
278
+ ~ Fix function 'Instructors Registration'
279
+ ~ Add function Export order invoice PDF
280
+
281
+ = 3.2.7.7 =
282
+ ~ Add Evaluate via questions
283
+ ~ Add Evaluate via mark
284
+ ~ Fixed duration expire course
285
+ ~ Fixed link 'Preview change' button when edit item course
286
+ ~ Fixed title of course archive page
287
+ ~ Fixed if quiz has only one question will not show paginate
288
+
289
+ = 3.2.7.6 =
290
+ ~ Fix missing file class-lp-course-database.php
291
+
292
+ = 3.2.7.5 =
293
+ ~ Fixed run Elementor with question.
294
+ ~ Fixed lesson preview not show button complete when user enrolled.
295
+ ~ Add tag apply_filter 'learn-press/order-item-not-course-id' on received-order.
296
+ ~ Add tag apply_filter 'learn-press/tmpl-button-purchase-course' before return button purchase course.
297
+ ~ Optimize (permalink of items course).
298
+ ~ Show finish course button when items of course completed although the course not passed.
299
+ ~ Fixed explanation of question when user completed quiz.
300
+ ~ Hide description of quiz when the quiz completed.
301
+
302
+ = 3.2.7.4 =
303
+ ~ Fix can't load items when select on Order Backend
304
+
305
+ = 3.2.7.3 =
306
+ ~ Fixed error get_image() return bool not string on the file \templates\loop\course\thumbnail.php
307
+ ~ Modify description for the function 'External Link'
308
+ ~ Fixed LP_Datetime error with date = '0000-00-00 00:00:00'
309
+ ~ Fixed not show number Duration of Lesson when translate text
310
+ ~ Fixed not send mail for instructor when have new order
311
+ ~ Remove hook get avatar of Ultimate member plugin
312
+ ~ Fixed get value with, height image_size on LP setting
313
+ ~ Fixed security, clear sanitize
314
+ ~ Wilfried, security ninja at Synacktiv
315
+ ~ Fixed compatible with Elementor on items of course (lesson, quizz, question v.v...)
316
+
317
+ = 3.2.7.2 =
318
+ ~ Fixed email setting not save tag html
319
+
320
+ = 3.2.7.1 =
321
+ ~ Fix save settings
322
+
323
+ = 3.2.7 =
324
+ ~ Fix sanitize
325
+
326
+ = 3.2.6.10 =
327
+ ~ Fix add-on GradeBook
328
+
329
+ = 3.2.6.9 =
330
+ ~ Revert library meta-box to v4.15.7
331
+
332
+ = 3.2.6.8 =
333
+ ~ Fixed security: remove functions low security
334
+ ~ Fixed some minor bugs
335
+ ~ Fixed confusing "external link button" name default of course
336
+ ~ Fixed filter items of course
337
+ ~ Fixed create same name, slug page Checkout with Woo
338
+ ~ Improve performance
339
+
340
+ = 3.2.6.7 (2020.03.16) =
341
+ ~ Fixed security issues (CVE-2020-7916): uer logged can change role all users to Instructor
342
+ ~ Fixed security issues (CVE-2020-7917): remove function low security
343
+ ~ Fixed error preview Assignment
344
+
345
+ = 3.2.6.6 =
346
+ ~ Fixed option Block Lessons not working
347
+
348
+ = 3.2.6.5 (20.11.2019) =
349
+ ~ Fixed email doesn't send.
350
+ ~ Fixed some js errors.
351
+ ~ Fixed js call twice times.
352
+ ~ Fixed question doesn't show after added to quiz.
353
+ ~ Fixed ignore some metadata when copying course.
354
+ ~ Fixed search orders in backend.
355
+
356
+ = 3.2.6.4 =
357
+ ~ Fixed some errors.
358
+
359
+ = 3.2.6.3 =
360
+ ~ Fixed css conflict with text block of vc.
361
+ ~ Fixed show message 'Out of stock' for course reached limitation users.
362
+ ~ Fixed show checked answers when review quiz.
363
+ ~ Fixed review quiz option does not work properly.
364
+ ~ Fixed update view after removing order's items.
365
+
366
+ = 3.2.6.2 =
367
+ ~ Fixed cannt add items to course.
368
+
369
+ = 3.2.6 =
370
+ ~ Added option to exclude js/css libraries unnecessary (used in theme or other plugins).
371
+ ~ Added alt prop to user profile avatar.
372
+ ~ Fixed can't next/prev questions when doing quiz.
373
+ ~ Fixed wrong items navigation when learning course.
374
+ ~ Fixed missing js of some pages in admin.
375
+ ~ Fixed can't close admin notices.
376
+ ~ Updated envato api to newer version.
377
+
378
+ = 3.2.5.6 =
379
+ ~ Added new strings for translating.
380
+ ~ Corrected currency of Rwandan franc.
381
+ ~ Fixed missing utils library when adding manually the orders.
382
+ ~ Fixed upgrade function that doesn't hide the message when it done.
383
+ ~ Fixed can't create new page in settings.
384
+
385
+ = 3.2.5.5 =
386
+ ~ Fixed guest can not start quiz with no require enroll course option.
387
+ ~ Fixed sql to filter orders by user ID.
388
+ ~ Fixed issue of sending email when finished course: not correct Grade.
389
+ ~ Fixed can not see Actions buttons when adding questions into the quiz.
390
+ ~ Fixed changed the logic of Continue button for Course: continue with the next incomplete item.
391
+ ~ Fixed wrong code to pick up instructor email.
392
+
393
+ = 3.2.5.4 =
394
+ ~ Fixed load js missing dependencies and only in LP page.
395
+
396
+ = 3.2.5.3 =
397
+ ~ Changed SQL to read course items by user item ID.
398
+ ~ Improved performance in admin orders page.
399
+ ~ Upgraded Vue/Vuex to latest version.
400
+ ~ Added new theme to LP ad.
401
+
402
+ = 3.2.5.2 =
403
+ ~ Fixed bug can't access course after purchased.
404
+ ~ Fixed bug user can't redo quiz with option 'Retake' is 1.
405
+ ~ Fixed bug can't order questions by date in questions bank.
406
+ ~ Extracted purchased date to date and time in order emails.
407
+ ~ Show point of quiz in result page.
408
+
409
+ = 3.2.5.1 =
410
+ ~ Fixed can not next/prev question when doing quiz.
411
+ ~ Fixed get wrong total student of a course.
412
+ ~ Updated language .POT file.
413
+
414
+ = 3.2.5 =
415
+ ~ Fixed button for creating LP pages does not work properly.
416
+ ~ Fixed warning when getting course items does not exists.
417
+ ~ Added button to close warning for outdated templates.
418
+ ~ Fixed search order not working.
419
+ ~ Fixed get course items in incorrect order.
420
+ ~ Fixed can't start quiz when the course is not required enroll.
421
+ ~ Fixed the amount number of enrolled users isn't updated correctly.
422
+
423
+ = 3.2.4 =
424
+ ~ Fixed cannot enroll course.
425
+ ~ Fixed prev question button not working correct.
426
+ ~ Fixed one extra answer option when add new question.
427
+ ~ Fixed some deprecated keywords for PHP 7.3.
428
+ ~ Fixed item is null for an item which doesn't support it's type (like assignment after deactivate).
429
+ ~ Fixed bug the next and prev button not work in review mode of quiz.
430
+
431
+ = 3.2.3 =
432
+ ~ Removed un-security code in PP library.
433
+ ~ Fixed get curriculum item types doesn't work properly.
434
+ ~ Fixed sort sections/items wrong in SQL query.
435
+
436
+ = 3.2.2 =
437
+ ~ Fixed review quiz doesn't work properly.
438
+ ~ Fixed table session create a lot of rows.
439
+ ~ Fixed can't enroll to a course purchased.
440
+ ~ Removed unused functions.
441
+
442
+ = 3.2.1 =
443
+ ~ Fixed can't enroll course.
444
+ ~ Fixed upload issue and drag user avatar on mobile.
445
+ ~ Fixed course duration does not work properly.
446
+ ~ Fixed question with multi language.
447
+ ~ Fixed mail to user 2 times when completed course.
448
+
449
+ = 3.2.0 =
450
+ ~ Fixed issue info of order added manual not correct.
451
+ ~ Fixed issue course duplicated is published.
452
+ ~ Fixed issue Course content column show as "No Content".
453
+ ~ Fixed some issues related to cache.
454
+
455
+ = 3.1.0 =
456
+ ~ Fixed issue vulnerabilities.
457
+ ~ Fixed issue related to object cache when doing quiz.
458
+ ~ Fixed lesson 404 with Polylang.
459
+ ~ Fixed PHP Fatal error class ‘LP_Plugins_Helper’ not found
460
+
461
+ = 3.0.12 =
462
+ ~ Fixed minor bug in gradebook list in admin
463
+ ~ Made hook learn-press/course-tabs work
464
+ ~ Fixed bug: not auto complete quiz. Add 1 more filter hook for checking publicity in profile page
465
+ ~ Fixed bug: auto enroll course without permission to enroll course
466
+ ~ Changed filter tag for get_default_meta of lesson
467
+ ~ Auto full-screen in mobile view
468
+ ~ Fixed bug: wrong count number in No Preview at Lessons List back-end page
469
+ ~ Fixed bug: Instructor user cannot see comments of lesson
470
+ ~ Changed version for template files
471
+ ~ Added base url for construct nav in user profile
472
+ ~ Added param for get_nav method
473
+ ~ Fixed bug: answer correct all question but quiz result is failed with 0%
474
+ ~ Fixed small bug in quiz editor
475
+ ~ Fixed bug: wrong count number of the courses in back end because of the status of preview course
476
+ ~ Fixed bug: not redirect to correct page after logged in in Profile page
477
+ ~ Fixed bug fatal error include file
478
+ ~ Added icon for chat-type-format of content item
479
+ ~ Fixed header-sent when log file
480
+
481
+ = 3.0.10 =
482
+ ~ Added quiz option to minus a number of points for each wrong question in quiz
483
+ ~ Added admin email to send to admin when an order is completed
484
+ ~ Added button allows wp admin can send a request to subscriber
485
+ ~ Improved auto redirecting to current question when user go to a quiz
486
+ ~ Improved UI of course editor for RTL
487
+ ~ Improved content of email sending to admin and instructor
488
+ ~ Fixed page show 404 with pagination in courses page (conflict with WPML)
489
+ ~ Fixed course price is still showing after user enrolled course
490
+ ~ Fixed not auto redirecting to checkout after logged in
491
+ ~ Fixed some issues made question can't edit
492
+ ~ Fixed issue for requesting to get related themes/addons in admin
493
+ ~ Fixed some issues with content header when viewing in Safari
494
+ ~ Fixed wrong ordering of course item when adding new
495
+ ~ Fixed order for multiple users is not show in list of orders
496
+ ~ Fixed some text is not translatable
497
+ ~ Fixed breadcrumb not show page name when viewing archive course
498
+ ~ Fixed archive course show header is title of first course
499
+
500
+ == Upgrade Notice ==
501
+
502
+ = 4.0.0 =
503
+ In this version, we have to change the database structure, so that if you have installed LP3 on your site before, please backup your site and follow these steps to upgrade.
504
+
505
+ = 0.9.19 =
506
+ In this version, we have changed a little bit about LearnPress Plugin directory structure and moved all add-ons to become independent plugins. If you face any problems related to add-ons, please completely remove old version and re-install LearnPress. It does not affect your current data. Thank you.
507
+
508
+ == Other note ==
509
+ <a href="https://docspress.thimpress.com/learnpress" target="_blank">Documentation</a> is available in ThimPress site.
510
+ <a href="https://github.com/LearnPress/LearnPress/" target="_blank">LearnPress github repo</a>.
templates/single-course/buttons/purchase.php CHANGED
@@ -14,11 +14,16 @@ defined( 'ABSPATH' ) || exit();
14
  if ( ! isset( $course ) ) {
15
  $course = learn_press_get_course();
16
  }
 
 
 
 
 
17
  ?>
18
 
19
  <?php do_action( 'learn-press/before-purchase-form' ); ?>
20
 
21
- <form name="purchase-course" class="purchase-course" method="post" enctype="multipart/form-data">
22
 
23
  <?php do_action( 'learn-press/before-purchase-button' ); ?>
24
 
14
  if ( ! isset( $course ) ) {
15
  $course = learn_press_get_course();
16
  }
17
+
18
+ $classes_purchase = 'purchase-course';
19
+ $classes_purchase .= ( LP()->checkout()->is_enable_guest_checkout() ) ? ' guest_checkout' : '';
20
+
21
+ $classes_purchase = apply_filters( 'lp/btn/purchase/classes', $classes_purchase );
22
  ?>
23
 
24
  <?php do_action( 'learn-press/before-purchase-form' ); ?>
25
 
26
+ <form name="purchase-course" class="<?php echo esc_attr( $classes_purchase ); ?>" method="post" enctype="multipart/form-data">
27
 
28
  <?php do_action( 'learn-press/before-purchase-button' ); ?>
29
 
templates/single-course/content-protected.php CHANGED
@@ -20,7 +20,7 @@ $message = '';
20
  if ( ! is_user_logged_in() ) {
21
  $message = sprintf(
22
  wp_kses_post(
23
- 'This content is protected, please <a href="%s">login</a> and enroll course to view this content!',
24
  'learnpress'
25
  ),
26
  learn_press_get_login_url( learn_press_get_current_url() )
@@ -29,4 +29,4 @@ if ( ! is_user_logged_in() ) {
29
  $message = $can_view_item->message;
30
  }
31
 
32
- learn_press_display_message( $message, 'error' );
20
  if ( ! is_user_logged_in() ) {
21
  $message = sprintf(
22
  wp_kses_post(
23
+ 'This content is protected, please <a class="lp-link-login" href="%s">login</a> and enroll course to view this content!',
24
  'learnpress'
25
  ),
26
  learn_press_get_login_url( learn_press_get_current_url() )
29
  $message = $can_view_item->message;
30
  }
31
 
32
+ learn_press_display_message( $message, 'learn-press-content-protected-message error' );
templates/single-course/item-comments.php CHANGED
@@ -10,7 +10,7 @@
10
  defined( 'ABSPATH' ) || exit;
11
  ?>
12
 
13
- <a class="lp-lesson-comment-btn" href="#" data-close="<?php esc_attr_e( 'Close comments', 'learnpress' ); ?>"><?php esc_html_e( 'Open comments', 'learnpress' ); ?></a>
14
 
15
  <div id="learn-press-item-comments">
16
  <div class="learn-press-comments">
10
  defined( 'ABSPATH' ) || exit;
11
  ?>
12
 
13
+ <a class="lp-lesson-comment-btn" href="#" data-close="<?php esc_attr_e( 'Close comments', 'learnpress' ); ?>"><?php esc_html_e( 'View comments', 'learnpress' ); ?></a>
14
 
15
  <div id="learn-press-item-comments">
16
  <div class="learn-press-comments">