angular.module("RdmApp").controller("profileCtrl",["$scope","$rootScope","common","DTOptionsBuilder","DTColumnBuilder","$http","$q","ApiServer",function(t,e,o,i,r,s,n,a){e.password={},t.hapusLogo=function(){$.blockUI({}),a.get("proktor/hapuslogo",(function(t){$.unblockUI({}),t.success?(e.getprofile(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Logo berhasil dihapus",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message})}))},t.savePimpinan=function(){$.blockUI({}),a.post("proktor/savepimpinan",e.pimpinan,(function(t){$.unblockUI({}),t.success?(e.getprofile(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message})}))},t.syncProfile=function(){$.blockUI({}),a.post("proktor/syncprofile",e.pimpinan,(function(t){$.unblockUI({}),t.success?(e.getprofile(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message})}))},t.savePassword=function(){$.blockUI({}),a.post("proktor/ubahpassword",e.password,(function(t){$.unblockUI({}),t.success?(e.password.password="",e.password.konfirmasi="",Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message})}))},t.browseimage=function(){$("#imageFile").click()},t.$on("pictureInsert",(function(t,o){$("#imageFile").val(null),e.profile.lembaga_foto=o}))}]),angular.module("RdmApp").directive("myDirective",["httpPostFactory",function(t){return{restrict:"A",scope:!0,link:function(e,o,i){o.bind("change",(function(){$.blockUI({});var i=new FormData;i.append("file",o[0].files[0]);var r=o[0].getAttribute("data-url");o[0].getAttribute("image-container");t(r,i,(function(t){$.unblockUI({}),t&&t.success?e.$emit("pictureInsert",t.data):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.data})}))}))}}}]);