All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.blueimpfileupload.js.jquery.fileupload-angular.min.js Maven / Gradle / Ivy

Go to download

File Upload widget with multiple file selection, drag and drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.

There is a newer version: 1.2.2.1-jre17
Show newest version
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","angular","./jquery.fileupload-image","./jquery.fileupload-audio","./jquery.fileupload-video","./jquery.fileupload-validate"],a)}else{if(typeof exports==="object"){a(require("jquery"),require("angular"),require("./jquery.fileupload-image"),require("./jquery.fileupload-audio"),require("./jquery.fileupload-video"),require("./jquery.fileupload-validate"))}else{a()}}}(function(){angular.module("blueimp.fileupload",[]).provider("fileUpload",function(){var c=function(e){var d=angular.element(this).fileupload("option","scope");d.$evalAsync(e)},a=function(e,g){var f=g.files,d=f[0];angular.forEach(f,function(i,h){i._index=h;i.$state=function(){return g.state()};i.$processing=function(){return g.processing()};i.$progress=function(){return g.progress()};i.$response=function(){return g.response()}});d.$submit=function(){if(!d.error){return g.submit()}};d.$cancel=function(){return g.abort()}},b;b=this.defaults={handleResponse:function(g,f){var d=f.result&&f.result.files;if(d){f.scope.replace(f.files,d)}else{if(f.errorThrown||f.textStatus==="error"){f.files[0].error=f.errorThrown||f.textStatus}}},add:function(h,g){if(h.isDefaultPrevented()){return false}var f=g.scope,d=[];angular.forEach(g.files,function(e){d.push(e)});f.$parent.$applyAsync(function(){a(f,g);var e=f.option("prependFiles")?"unshift":"push";Array.prototype[e].apply(f.queue,g.files)});g.process(function(){return f.process(g)}).always(function(){f.$parent.$applyAsync(function(){a(f,g);f.replace(d,g.files)})}).then(function(){if((f.option("autoUpload")||g.autoUpload)&&g.autoUpload!==false){g.submit()}})},done:function(g,f){if(g.isDefaultPrevented()){return false}var d=this;f.scope.$apply(function(){f.handleResponse.call(d,g,f)})},fail:function(h,g){if(h.isDefaultPrevented()){return false}var f=this,d=g.scope;if(g.errorThrown==="abort"){d.clear(g.files);return}d.$apply(function(){g.handleResponse.call(f,h,g)})},stop:c,processstart:c,processstop:c,getNumberOfFiles:function(){var d=this.scope;return d.queue.length-d.processing()},dataType:"json",autoUpload:false};this.$get=[function(){return{defaults:b}}]}).provider("formatFileSizeFilter",function(){var a={units:[{size:1000000000,suffix:" GB"},{size:1000000,suffix:" MB"},{size:1000,suffix:" KB"}]};this.defaults=a;this.$get=function(){return function(b){if(!angular.isNumber(b)){return""}var d=true,c=0,e,f;while(d){d=a.units[c];e=d.prefix||"";f=d.suffix||"";if(c===a.units.length-1||b>=d.size){return e+(b/d.size).toFixed(2)+f}c+=1}}}}).controller("FileUploadController",["$scope","$element","$attrs","$window","fileUpload","$q",function(d,b,a,g,e,c){var f={progress:function(){return b.fileupload("progress")},active:function(){return b.fileupload("active")},option:function(h,i){if(arguments.length===1){return b.fileupload("option",h)}b.fileupload("option",h,i)},add:function(h){return b.fileupload("add",h)},send:function(h){return b.fileupload("send",h)},process:function(h){return b.fileupload("process",h)},processing:function(h){return b.fileupload("processing",h)}};d.disabled=!g.jQuery.support.fileInput;d.queue=d.queue||[];d.clear=function(m){var h=this.queue,k=h.length,j=m,l=1;if(angular.isArray(m)){j=m[0];l=m.length}while(k){k-=1;if(h[k]===j){return h.splice(k,l)}}};d.replace=function(k,o){var h=this.queue,n=k[0],m,l;for(m=0;m




© 2015 - 2025 Weber Informatics LLC | Privacy Policy