Sindbad~EG File Manager
function PsProfileAvatar(){this.g_coords={x:0,y:0,x2:0,y2:0,w:0,h:0}}var profileavatar=new PsProfileAvatar;PsProfileAvatar.prototype.setCoords=function(t){this.g_coords.x=t.x,this.g_coords.y=t.y,this.g_coords.x2=t.x2,this.g_coords.y2=t.y2,this.g_coords.w=t.w,this.g_coords.h=t.h},PsProfileAvatar.prototype.saveThumbnail=function(){var t,a=this,o=+jQuery("#cWindowContent [name=is_tmp]").val()?1:0,e=jQuery("#cWindowContent .large-profile-pic"),r=e.width(),i=e.height(),n=e[0].naturalWidth||r,s=e[0].naturalHeight||i,c=1500;(c<n||c<s)&&(s<n?(s*=c/n,n=c):(n*=c/s,s=c)),t=n/r,req={u:peepsodata.userid,x:Math.round(this.g_coords.x*t),y:Math.round(this.g_coords.y*t),x2:Math.round(this.g_coords.x2*t),y2:Math.round(this.g_coords.y2*t),width:n,height:s,tmp:o,_wpnonce:jQuery("#_photononce").val()},peepso.get("profile.crop",req,function(t){var e="?"+Math.floor(1e4*Math.random()),r=jQuery("#cWindowContent .large-profile-pic");ps_crop.detach(r),t.success&&(o?jQuery("#cWindowContent .js-focus-avatar img").attr("src",t.data.image_url+e):a.refreshThumbnail())}),jQuery("#cWindowContent .update-thumbnail").show(),jQuery("#cWindowContent .update-thumbnail-save").hide(),jQuery("#cWindowContent .update-thumbnail-guide").hide()},PsProfileAvatar.prototype.imgSelect=function(t,e){this.g_coords.x=e.x1,this.g_coords.y=e.y1,this.g_coords.x2=e.x2,this.g_coords.y2=e.y2,this.g_coords.w=e.width,this.g_coords.h=e.height},PsProfileAvatar.prototype.updateThumbnail=function(){var e=jQuery("#cWindowContent .large-profile-pic");ps_crop.init({elem:e,change:jQuery.proxy(function(t){this.imgSelect(e[0],{x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height,width:t.width,height:t.height})},this)}),jQuery("#cWindowContent .update-thumbnail").hide(),jQuery("#cWindowContent .update-thumbnail-save").show(),jQuery("#cWindowContent .update-thumbnail-guide").show()},PsProfileAvatar.prototype.refreshThumbnail=function(){var o=Math.random(),t=jQuery("#cWindowContent .thumbnail-profile-pic").attr("src");jQuery("#cWindowContent .thumbnail-profile-pic").attr("src",t+"?"+o);var e=(t=jQuery(".js-focus-avatar img").attr("src")).split("?",1);jQuery(".js-focus-avatar img").attr("src",e+"?"+o);var r=document.getElementById("ps-profile-avatar-iframe");r.innerHTML=r.innerHTML;var a=jQuery("#ps-profile-avatar-iframe");t=a.attr("src");if(a.attr("src",t),-1!==t.indexOf("/peepso/assets/images/user")){var i=jQuery(".js-focus-avatar img").attr("src");i.replace("-full.jpg",".jpg"),t=i}var n=jQuery("img.cavatar");jQuery.each(n,function(t,e){var r=jQuery(e).data("author");if((r=parseInt(r))===peepsodata.currentuserid){var a=jQuery(e).attr("src");0<a.indexOf("?")&&(a=a.split("?",1)),jQuery(e).attr("src",a+"?"+o)}})},PsProfileAvatar.prototype.cleanup_after_imgareaslect=function(){jQuery(".imgareaselect-selection").parent().hide(),jQuery(".imgareaselect-outer").hide()},jQuery(document).ready(function(t){peepso.observer.addFilter("pswindow_close",function(){profileavatar.cleanup_after_imgareaslect()})});
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists