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.

32 lines
52 KiB
Plaintext

11 months ago
/*
Uploadify v3.2
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
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<6C><7A>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
SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
; var swfobject = function () { var aq = "undefined", aD = "object", ab = "Shockwave Flash", X = "ShockwaveFlash.ShockwaveFlash", aE = "application/x-shockwave-flash", ac = "SWFObjectExprInst", ax = "onreadystatechange", af = window, aL = document, aB = navigator, aa = false, Z = [aN], aG = [], ag = [], al = [], aJ, ad, ap, at, ak = false, aU = false, aH, an, aI = true, ah = function () { var a = typeof aL.getElementById != aq && typeof aL.getElementsByTagName != aq && typeof aL.createElement != aq, e = aB.userAgent.toLowerCase(), c = aB.platform.toLowerCase(), h = c ? /win/.test(c) : /win/.test(e), j = c ? /mac/.test(c) : /mac/.test(e), g = /webkit/.test(e) ? parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, d = ! +"\v1", f = [0, 0, 0], k = null; if (typeof aB.plugins != aq && typeof aB.plugins[ab] == aD) { k = aB.plugins[ab].description; if (k && !(typeof aB.mimeTypes != aq && aB.mimeTypes[aE] && !aB.mimeTypes[aE].enabledPlugin)) { aa = true; d = false; k = k.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); f[0] = parseInt(k.replace(/^(.*)\..*$/, "$1"), 10); f[1] = parseInt(k.replace(/^.*\.(.*)\s.*$/, "$1"), 10); f[2] = /[a-zA-Z]/.test(k) ? parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; } } else { if (typeof af.ActiveXObject != aq) { try { var i = new ActiveXObject(X); if (i) { k = i.GetVariable("$version"); if (k) { d = true; k = k.split(" ")[1].split(","); f = [parseInt(k[0], 10), parseInt(k[1], 10), parseInt(k[2], 10)]; } } } catch (b) { } } } return { w3: a, pv: f, wk: g, ie: d, win: h, mac: j }; } (), aK = function () { if (!ah.w3) { return; } if ((typeof aL.readyState != aq && aL.readyState == "complete") || (typeof aL.readyState == aq && (aL.getElementsByTagName("body")[0] || aL.body))) { aP(); } if (!ak) { if (typeof aL.addEventListener != aq) { aL.addEventListener("DOMContentLoaded", aP, false); } if (ah.ie && ah.win) { aL.attachEvent(ax, function () { if (aL.readyState == "complete") { aL.detachEvent(ax, arguments.callee); aP(); } }); if (af == top) { (function () { if (ak) { return; } try { aL.documentElement.doScroll("left"); } catch (a) { setTimeout(arguments.callee, 0); return; } aP(); })(); } } if (ah.wk) { (function () { if (ak) { return; } if (!/loaded|complete/.test(aL.readyState)) { setTimeout(arguments.callee, 0); return; } aP(); })(); } aC(aP); } } (); function aP() { if (ak) { return; } try { var b = aL.getElementsByTagName("body")[0].appendChild(ar("span")); b.parentNode.removeChild(b); } catch (a) { return; } ak = true; var d = Z.length; for (var c = 0; c < d; c++) { Z[c](); } } function aj(a) { if (ak) { a(); } else { Z[Z.length] = a; } } function aC(a) { if (typeof af.addEventListener != aq) { af.addEventListener("load", a, false); } else { if (typeof aL.addEventListener != aq) { aL.addEventListener("load", a, false); } else { if (typeof af.attachEvent != aq) { aM(af, "onload", a); } else { if (typeof af.onload == "function") { var b = af.onload; af.onload = function () { b(); a(); }; } else { af.onload = a; } } } } } function aN() { if (aa) { Y(); } else { am(); } } function Y() { var d = aL.getElementsByTagName("body")[0]; var b = ar(aD); b.setAttribute("type", aE); var a = d.appendChild(b); if (a) { var c = 0; (function () { if (typeof a.GetVariable != aq) { var e = a.GetVariable("$version"); if (e) { e = e.split(" ")[1].split(","); ah.pv = [parseInt(e[0], 10), parseInt(e[1], 10), parseInt(e[2], 10)]; } } else { if (c < 10) { c++; setTimeout(arguments.callee, 10); return; } } d.removeChild(b); a = null; am(); })(); } else { am(); } } function am() { var g = aG.length; if (g > 0) { for (var h = 0; h < g; h++) { var c = aG[h].id; var l = aG[h].callbackFn; var a = { success: false, id: c }; if (ah.pv[0] > 0) { var i = aS(c); if (i) { if (ao(aG[h].swfVersion) && !(ah.wk && ah.wk < 312)) { ay(c, true); if (l) { a.success = true; a.ref = av(c); l(a); } } else { if (aG[h].expressInstall && au()) { var e = {}; e.data = aG[h].expressInstall; e.width = i.getAttribute("width") || "0"; e.height = i.getAttribute("height") || "0"; if (i.getAttribute("class")) { e.styleclass = i.getAttribu
var obj = ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">'].join(""),
params = [
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
'<param name="movie" value="', this.settings.flash_url, '" />',
'<param name="quality" value="high" />',
'<param name="menu" value="false" />',
'<param name="allowScriptAccess" value="always" />',
'<param name="flashvars" value="', this.getFlashVars(), '" />'
].join("");
if (navigator.userAgent.search(/MSIE/) > -1) {
obj = ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="', this.movieName, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">'].join("");
params += '<param name="src" value="' + this.settings.flash_url + '" />';
}
return [obj, params, '</object>'].join("");
}; SWFUpload.prototype.getFlashVars = function () { var c = this.buildParamString(); var d = this.settings.http_success.join(","); return ["movieName=", encodeURIComponent(this.movieName), "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url), "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string), "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), "&amp;httpSuccess=", encodeURIComponent(d), "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), "&amp;params=", encodeURIComponent(c), "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name), "&amp;fileTypes=", encodeURIComponent(this.settings.file_types), "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled), "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url), "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width), "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height), "&amp;buttonText=", encodeURIComponent(this.settings.button_text), "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), "&amp;buttonAction=", encodeURIComponent(this.settings.button_action), "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled), "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)].join(""); }; SWFUpload.prototype.getMovieElement = function () { if (this.movieElement == undefined) { this.movieElement = document.getElementById(this.movieName); } if (this.movieElement === null) { throw "Could not find Flash element"; } return this.movieElement; }; SWFUpload.prototype.buildParamString = function () { var f = this.settings.post_params; var d = []; if (typeof (f) === "object") { for (var e in f) { if (f.hasOwnProperty(e)) { d.push(encodeURIComponent(e.toString()) + "=" + encodeURIComponent(f[e].toString())); } } } return d.join("&amp;"); }; SWFUpload.prototype.destroy = function () { try { this.cancelUpload(null, false); var g = null; g = this.getMovieElement(); if (g && typeof (g.CallFunction) === "unknown") { for (var j in g) { try { if (typeof (g[j]) === "function") { g[j] = null; } } catch (h) { } } try { g.parentNode.removeChild(g); } catch (f) { } } window[this.movieName] = null; SWFUpload.instances[this.movieName] = null; delete SWFUpload.instances[this.movieName]; this.movieElement = null; this.settings = null; this.customSettings = null; this.eventQueue = null; this.movieName = null; return true; } catch (i) { return false; } }; SWFUpload.prototype.displayDebugInfo = function () { this.debug(["---SWFUpload Instance Info---\n", "Version: ", SWFUpload.version, "\n", "Movie Name: ", this.movieName, "\n", "Settings:\n", "\t", "upload_url: ", this.settings.upload_url, "\n", "\t", "flash_url: ", this.settings.flash_url, "\n", "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n", "\t", "http_success: ", this.settings.http_success.join(", "), "\n", "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n", "\t", "file_post_name: ", this.settings.file_post_name, "\n", "\t", "post_params: ", this.settings.post_params.toString(), "\n", "\t", "file_types: ", this.settings.file_types, "\n", "\t", "file_types_description: ", this.settings.file_types_description, "\n", "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", "\t", "file_upload_limit: