123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- (function($){
- $.upload = function(form,option,fun,before,going){
- var settings = {
- type:'image'
- };
- if(option) $.extend(settings,option);
- new AjaxUpload(form,{
- action:"{{ public_path('')}}",
- name:$(form).attr('name'),
- data:settings,
- responseType:'json',
-
- onSubmit:function(file,ext){
-
- if(before && !1 == before()) return !1;
- form.disabled = "disabled";
- },
- onComplete:function(file,result){
- form.disabled = "";
- if(result.status==1){
- fun && fun(result);
- }else{
- alert(result.msg);
- if(result.dialog) location.reload();
- }
- }
- });
- };
- })(jQuery);
|