PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.1
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / assets / js / admin / utils-admin.min.js

utils-admin.min.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.1, at assets/js/admin/utils-admin.min.js

1 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import*as Utils from"../utils.js";import TomSelect from"tom-select";import Api from"../api.js";const AdminUtilsFunctions={buildTomSelect(t,e,o,n,i){if(!t)return;const s={plugins:{remove_button:{title:"Remove this item"},dropdown_input:{}},onInitialize(){},onItemAdd(e){if(o){const s=Array.from(t.selectedOptions).map(t=>t.value);s.push(e),n.id_not_in=s.join(","),o("",n,i)}}};o&&(s.load=(e,s)=>{const c=Array.from(t.selectedOptions).map(t=>t.value);n.id_not_in=c.join(","),o(e,n,AdminUtilsFunctions.callBackTomSelectSearchAPI(s,i))});(e={...s,...e}).options;return new TomSelect(t,e)},callBackTomSelectSearchAPI:(t,e)=>({success:o=>{const n=e.success(o);t(n)}}),fetchCourses(t="",e={},o){const n=Api.admin.apiSearchCourses;e.search=t;const i={headers:{"Content-Type":"application/json","X-WP-Nonce":lpDataAdmin.nonce},method:"POST",body:JSON.stringify(e)};Utils.lpFetchAPI(n,i,o)},fetchUsers(t="",e={},o){const n=Api.admin.apiSearchUsers;e.search=t;const i={headers:{"Content-Type":"application/json","X-WP-Nonce":lpDataAdmin.nonce},method:"POST",body:JSON.stringify(e)};Utils.lpFetchAPI(n,i,o)}};export{Utils,AdminUtilsFunctions,Api};