| Server IP : 103.48.194.25 / Your IP : 216.73.217.33 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/nguyenlieumyphamgiasi.vn/public_html/webadmin/templates/js/ |
Upload File : |
var imgLib = {
configdefault:{
url:url,
url_img:urlimg,
url_lib:url+'file_manager/image_manager',
dir_img:'',
width: 0,
height:0,
method:'imglib',
action:'',
callback:'',
return_tag:''
},
config:{},
openLib :function (option)
{
this.config = $.extend({},this.configdefault,option);
this.config.url_lib = this.config.url_lib+'/index/'+this.config.return_tag+'/'+this.config.width+'/'+this.config.height ;
if(this.config.method=='imgcrop')
{
this.config.url_lib = url+'file_manager/image_manager/cropimage';
}
$.colorbox({href:this.config.url_lib,iframe:true, innerWidth:"980px", innerHeight:"600px"});
},
insert:function(data)
{
if(this.config.callback!= '' )
{
this.config.callback(data);
}
else
{
if(this.config.action=='imgcrop')
{
var rt_data = data[0];
var file = rt_data.lb_dir+'/'+rt_data.lb_name;
var rt_html = "";
rt_html += '<input type="hidden" name="'+this.config.return_tag+'" value="images/'+file+'" id="'+this.config.return_tag+'"/>';
rt_html += '<a href="javascript:imgLib.openLib({dir_img:\'images/'+file+'\',width:\''+this.config.width+'\',height:\''+this.config.height+'\',method:\'imgcrop\',return_tag:\''+this.config.return_tag+'\',action:\'imgcrop\'});"> <img src="'+this.config.url_img+'images/'+file+'" width="100px"/></a>';
$("."+this.config.return_tag).html(rt_html);
$(".cboxElement").colorbox({width:"985px", height:"600px",iframe:true});
}
else if(this.config.action=='editor')
{
}
}
},
crop:function(data)
{
if(this.config.callback!= '' ){
this.config.callback(data);
}else{
if(this.config.action=='imgcrop'){
var rt_html = "";
rt_html += '<input type="hidden" name="'+this.config.return_tag+'" value="temp/'+data.file_name+'" id="'+this.config.return_tag+'"/>';
rt_html += '<a onclick="imgLib.openLib({dir_img:\'temp/'+data.file_name+'\',width:\''+this.config.width+'\',height:\''+this.config.height+'\',method:\'imgcrop\',return_tag:\''+this.config.return_tag+'\',action:\'imgcrop\'});" href="javascript:void(0);"> <img src="'+this.config.url_img+'temp/'+data.file_name+'" width="100px"/></a>';
$("."+this.config.return_tag).html(rt_html);
$(".cboxElement").colorbox({width:"950", height:"650",iframe:true});
}
}
}
};