web/res/js/jquery-rockupload.js
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* 无刷新上传
* createname:雨中磐石
* homeurl:http://www.rockoa.com/
* Copyright (c) 2016 rainrock (xh829.com)
* Date:2016-01-01
*/
(function ($) {
maxupgloble = 0;
function rockupload(opts){
var me = this;
var opts = js.apply({inputfile:'',initpdbool:false,initremove:true,uptype:'*',maxsize:5,onchange:function(){},onchangebefore:function(){},upurl:'',onprogress:function(){},urlparams:{},updir:'',onsuccess:function(){},quality:0.7,xu:0,fileallarr:[],autoup:true,oldids:'',
onerror:function(){},fileidinput:'fileid',
onabort:function(){},
allsuccess:function(){}
},opts);
this._init=function(){
for(var a in opts)this[a]=opts[a];
//加载最大可上传大小
if(maxupgloble==0)$.getJSON(js.apiurl('login','getmaxup'),function(res){
try{
if(res.code==200){
var maxup = parseFloat(res.data.maxup);
me.maxsize= maxup;
maxupgloble = maxup;
}}catch(e){}
});
if(maxupgloble>0)this.maxsize= maxupgloble;
if(!this.autoup)return;
if(this.initremove){
$('#'+this.inputfile+'').parent().remove();
var s='<form style="display:none;height:0px;width:0px" name="form_'+this.inputfile+'"><input type="file" id="'+this.inputfile+'"></form>';
$('body').append(s);
}
$('#'+this.inputfile+'').change(function(){
me.change(this, 0);
});
};
this.reset=function(){
if(!this.autoup)return;
var fids = 'form_'+this.inputfile+'';
if(document[fids])document[fids].reset();
};
this.setparams=function(ars){
this.oparams = js.apply({uptype:this.uptype}, ars);
this.uptype=this.oparams.uptype;
};
this.setuptype=function(lx){
this.uptype = lx;
};
this.setupurl=function(ul){
this.upurl = ul;
};
this.click=function(ars){
if(this.upbool)return;
this.setparams(ars);
get(this.inputfile).click();
};
后面还有 287 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
