You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
34 KiB
JavaScript
38 lines
34 KiB
JavaScript
2 months ago
|
/*
|
||
|
SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
|
||
|
|
||
|
mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
|
||
|
|
||
|
SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
|
||
|
http://www.opensource.org/licenses/mit-license.php
|
||
|
|
||
|
SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
|
||
|
http://www.opensource.org/licenses/mit-license.php
|
||
|
*/
|
||
|
|
||
|
var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if(typeof(a)!=="string"||a.match(/^https?:\/\//i)||a.match(/^\//)){return a}var c=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var b=window.location.pathname.lastIndexOf("/");if(b<=0){path="/"}else{path=window.location.pathname.substr(0,b)+"/"}return path+a};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.but
|
||
|
|
||
|
/*
|
||
|
Uploadify v3.0.0
|
||
|
Copyright (c) 2010 Ronnie Garcia
|
||
|
|
||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
|
of this software and associated documentation files (the "Software"), to deal
|
||
|
in the Software without restriction, including without limitation the rights
|
||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
|
copies of the Software, and to permit persons to whom the Software is
|
||
|
furnished to do so, subject to the following conditions:
|
||
|
|
||
|
The above copyright notice and this permission notice shall be included in
|
||
|
all copies or substantial portions of the Software.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||
|
THE SOFTWARE.
|
||
|
*/
|
||
|
|
||
|
if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b,c){a(this).each(function(){var r=a(this).clone();var k=a.extend({id:a(this).attr("id"),swf:"uploadify.swf",uploader:"uploadify.php",auto:false,buttonClass:"",buttonCursor:"hand",buttonImage:false,buttonText:"SELECT FILES",cancelImage:"uploadify-cancel.png",checkExisting:"uploadify-check-existing.php",debug:false,fileObjName:"Filedata",fileSizeLimit:0,fileTypeDesc:"All Files (*.*)",fileTypeExts:"*.*",height:30,method:"post",multi:false,queueID:false,queueSizeLimit:999,removeCompleted:true,removeTimeout:3,requeueErrors:true,postData:{},preventCaching:true,progressData:"percentage",successTimeout:30,transparent:true,uploadLimit:999,uploaderType:"html5",width:120,skipDefault:[],onClearQueue:function(){},onDialogOpen:function(){},onDialogClose:function(){},onInit:function(){},onQueueComplete:function(){},onSelectError:function(){},onSelect:function(){},onSWFReady:function(){},onUploadCancel:function(){},onUploadComplete:function(){},onUploadError:function(){},onUploadProgress:function(){},onUploadStart:function(){}},b);var d={assume_success_timeout:k.successTimeout,button_placeholder_id:k.id,button_image_url:k.buttonImage,button_width:k.width,button_height:k.height,button_text:null,button_text_style:null,button_text_top_padding:0,button_text_left_padding:0,button_action:(k.multi?SWFUpload.BUTTON_ACTION.SELECT_FILES:SWFUpload.BUTTON_ACTION.SELECT_FILE),button_disabled:false,button_cursor:(k.buttonCursor=="arrow"?SWFUpload.CURSOR.ARROW:SWFUpload.CURSOR.HAND),button_window_mode:(k.transparent&&!k.buttonImage?SWFUpload.WINDOW_MODE.TRANSPARENT:SWFUpload.WINDOW_MODE.OPAQUE),debug:k.debug,requeue_on_error:k.requeueErrors,file_post_name:k.fileObjName,file_size_limit:k.fileSizeLimit,file_types:k.fileTypeExts,file_types_description:k.fileTypeDesc,file_queue_limit:k.queueSizeLimit,file_upload_limit:k.uploadLimit,flash_url:k.swf,prevent_swf_caching:k.preventCaching,post_params:k.postData,upload_url:k.uploader,use_query_string:(k.method=="get"),file_dialog_complete_handler:e,file_dialog_start_handler:t,file_queued_handler:p,file_queue_error_handler:q,flash_ready_handler:k.onSWFReady,upload_complete_handler:i,upload_error_handler:s,upload_progress_handler:g,upload_start_handler:h,upload_success_handler:n};if(c){d=a.extend(d,c)}d=a.extend(d,k);window["uploadify_"+k.id]=new SWFUpload(d);var j=window["uploadify_"+k.id];j.original=r;var f=a("<div />",{id:k.id,"class":"uploadify",css:{height:k.height+"px",position:"relative",width:k.width+"px"}});a("#"+j.movieName).wrap(f);if(!k.queueID){var m=a("<div />",{id:k.id+"_queue","class":"uploadifyQueue"});a("#"+k.id).after(m);j.settings.queueID=k.queueID=k.id+"_queue"}j.queue={files:{},filesSelected:0,filesQueued:0,filesReplaced:0,filesCancelled:0,filesErrored:0,averageSpeed:0,queueLength:0,queueSize:0,uploadSize:0,queueBytesUploaded:0,uploadQueue:[],errorMsg:"Some files were not added to the queue:"};if(!k.buttonImage){var l=a("<div />",{id:k.id+"_button","class":"uploadifyButton "+k.buttonClass,html:'<span class="uploadifyButtonText">'+k.buttonText+"</span>"});a("#"+k.id).append(l);a("#"+j.movieName).css({position:"absolute","z-index":1})}else{a("#"+j.movieName).addClass(k.buttonClass)}function e(u,w,x){var v=j.getStats();j.queue.filesErrored=u-w;j.queue.filesSelected=u;j.queue.filesQueued=w-j.queue.filesCancelled;j.queue.queueLength=x;if(a.inArray("onDialogClose",j.settings.skipDefault)<0){if(j.queue.filesErrored>0){alert(j.queue.errorMsg)}}if(j.settings.onDialogClose){j.settings.onDialogClose(j.queue)}if(j.settings.auto){a("#"+j.settings.id).uploadifyUpload("*")}}function t(){j.queue.errorMsg="Some files were not added to the queue:";j.queue.filesReplaced=0;j.queue.filesCancelled=0;if(j.settings.onDialogOpen){j.settings.onDialogOpen()}}function p(w){if(a.inArray("onSelect",j.settings.skipDefault)<0){var v={};for(var B in j.queue.files){v=j.queue.files[B];if(v.name==w.name){var x=confirm('The file named "'+w.name+'" is already in the queue.\nDo you want to replace the existing item in the queue?');if(!x){j.cancelUpload(w.id);j.queue.file
|