Your IP : 216.73.216.240


Current Path : /home/juvelize/martine/tmp/install_61b0f5c54c150/media/js/vue/
Upload File :
Current File : /home/juvelize/martine/tmp/install_61b0f5c54c150/media/js/vue/installed_plugins.min.js

jQuery(document).ready(function(i){if(Vue.component("vue-switch",{props:["plugin","ischecked"],data:function(){return{id:"vue-switch_",loading:!1,disabled:!1}},mounted:function(){this.id+=this.plugin.id},methods:{toggleActive(e){if(this.loading)return!0;this.loading=!0,this.disabled=!0;let t=ACYM_AJAX_URL+"&ctrl=plugins&task=toggleActivate&id="+e;i.get(t,i=>{if((i=acym_helper.parseJson(i)).error)return acym_helperNotification.addNotification(i.message,"error"),!1;this.loading=!1,this.disabled=!1})}},template:'<div class="cell shrink grid-x"><div class="switch cell shrink"> <input class="switch-input" :id="id" type="checkbox" name="exampleSwitch" :checked="ischecked"> <label class="switch-paddle" @click="toggleActive(plugin.id)" :for="id"> </label> </div><i v-show="loading" class="cell shrink acym__card__loader acymicon-circle-o-notch acymicon-spin"></i></div>'}),i("#acym__plugin__installed__application").length>0){const e=(i,e)=>i.filter(i=>i.id!==e);new Vue({directives:{infiniteScroll:infiniteScroll},el:"#acym__plugin__installed__application",data:{allPlugins:[],displayedPlugins:[1],search:acym_helper.getCookie("acym_installed_plugins_search"),type:acym_helper.getCookie("acym_installed_plugins_type"),level:acym_helper.getCookie("acym_installed_plugins_level"),loading:!0,noPluginTodisplay:!1,typingTimer:"",doneTypingInterval:1e3,currentLevel:"",downloading:{},pluginToggling:{},updating:{},pageDisplay:1,busy:!1,showSettings:{}},mounted:function(){acym_helperBack.config_get("level").done(i=>{if(i.error)return acym_helperNotification.addNotification(i.message,"error"),!1;let e=acym_helper.parseJson(document.getElementById("acym__plugins__all").value);this.allPlugins=e.elements,this.currentLevel=i.data.value.toLowerCase(),this.resetDisplay(),0===this.displayedPlugins.length&&(this.noPluginTodisplay=!0),this.fillPluginToggling(),this.fillUpdating(),acym_helper.setSubmitButtonGlobal(),this.loading=!1,setTimeout(()=>{this.$forceUpdate(),this.afterRender()},100)})},methods:{afterRender(){i(document).foundation(),i(".reveal-overlay").appendTo("#acym_form"),i(document).trigger("acym_plugins_installed_loaded"),acym_helperTooltip.setTooltip(),acym_helper.setSubmitButtonGlobal(),acym_helperRadio.setRadioIconsGlobal(),acym_helperSwitch.setSwitchFieldsGlobal(),acym_helperDatePicker.setRSDateChoice(),acym_helperDatePicker.setDatePickerGlobal(),acym_helperSelect2.setSelect2(),acym_helperInput.setMulticouple()},setShowSettings(){for(let i in this.allPlugins)this.showSettings[this.allPlugins[i].id]=!1},toggleSettings(e){let t=i("#acym__plugins__card__"+e),l=i(".acym__plugins__card__flip");!t.hasClass("acym__plugins__card__flip")&&l.length>0&&this.flipCard(l),this.flipCard(t),i('[name="plugin__folder_name"]').val(t.hasClass("acym__plugins__card__flip")?e:"")},flipCard(i){i.toggleClass("acym__plugins__card__flip"),setTimeout(()=>{i.toggleClass("acym__plugins__card__flipped"),acym_helperTooltip.setTooltip()},110)},updatePlugin(e){if(this.updating[e.id])return!0;this.updating[e.id]=!0,this.updating={...this.updating};let t=ACYM_AJAX_URL+"&ctrl=plugins&task=update";i.ajax({url:t,type:"POST",data:{plugin:e}}).then(i=>{if((i=acym_helper.parseJson(i)).error)return acym_helperNotification.addNotification(i.message,"error"),this.updating[e.id]=!1,this.updating={...this.updating},!1;acym_helperNotification.addNotification(i.message,"info"),this.updating[e.id]=!1,this.updating={...this.updating},this.toggleUptodateCurrentApp(e.id)})},removeOnePluginInApp(i){this.allPlugins=e(this.allPlugins,i),this.displayedPlugins=e(this.displayedPlugins,i)},resetDisplay(){this.pageDisplay=1,this.fillDisplayPlugins()},fillDisplayPlugins(){this.displayedPlugins=this.filterPlugin().slice(0,18*this.pageDisplay),this.displayedPlugins=[...this.displayedPlugins]},rightLevel(i){return"starter"===i||("essential"===i&&-1!==["essential","enterprise"].indexOf(this.currentLevel)||"enterprise"===i&&"enterprise"===this.currentLevel)},filterPlugin(){return this.allPlugins.filter(i=>-1!==i.level.toLowerCase().indexOf(this.level.toLowerCase())&&-1!==i.category.toLowerCase().indexOf(this.type.toLowerCase())&&-1!==i.folder_name.toLowerCase().indexOf(this.search.toLowerCase()))},toggleCurrentApp(i){this.allPlugins.map(e=>{e.id===i&&(e.active="1"===e.active?"0":"1")}),this.displayedPlugins=[...this.displayedPlugins]},toggleUptodateCurrentApp(i){this.allPlugins.map(e=>{e.id===i&&(e.uptodate="1"===e.uptodate?"0":"1")}),this.displayedPlugins=[...this.displayedPlugins]},deletePlugin(e){if(acym_helper.confirm(ACYM_JS_TXT.ACYM_ARE_YOU_SURE_DELETE_ADD_ON)){let t=ACYM_AJAX_URL+"&ctrl=plugins&task=deletePlugin&id="+e;i.get(t,i=>(i=acym_helper.parseJson(i)).error?(acym_helperNotification.addNotification(i.message,"error"),!1):(acym_helperNotification.addNotification(i.message,"info"),this.removeOnePluginInApp(e),!0))}},fillPluginToggling(){for(let i in this.allPlugins)this.pluginToggling[this.allPlugins[i].id]=!1},fillUpdating(){for(let i in this.allPlugins)this.updating[this.allPlugins[i].id]=!1},transitionDelay:i=>"transition-delay: "+.1*i+"s;",isActivated:i=>1==i?"checked":"",loadMorePlugins(){this.pageDisplay++,this.fillDisplayPlugins()},imageUrl:(i,e)=>"CORE"===e?ACYM_CORE_DYNAMICS_URL+i+"/banner.png":"PLUGIN"===e?ACYM_MEDIA_URL+"images/plugins/"+i+".png":AJAX_URL_UPDATEME+"integrationv6&task=getImage&plugin="+i,documentationUrl:i=>AJAX_URL_UPDATEME+"integrationv6&task=getDocumentation&plugin="+i,isOverflown(i){return void 0===this.$refs.plugins||void 0===this.$refs.plugins[i]?"":this.$refs.plugins[i].scrollHeight>this.$refs.plugins[i].clientHeight?"acym__plugins__card__params_desc__overflown":""}},watch:{displayedPlugins(i,e){this.noPluginTodisplay=0===this.displayedPlugins.length&&1!==e[0]},search(i){clearTimeout(this.typingTimer),document.cookie="acym_installed_plugins_search="+i+";",""===i?this.resetDisplay():this.typingTimer=setTimeout(()=>{this.resetDisplay()},this.doneTypingInterval)},type(){document.cookie="acym_installed_plugins_type="+this.type+";",this.resetDisplay()},level(){document.cookie="acym_installed_plugins_level="+this.level+";",this.resetDisplay()}}})}});