微信公众号管理后台

webuploader.min.js 112KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045
  1. /* WebUploader 0.1.2 */
  2. !function(a, b) {
  3. var c, d = {}, e = function(a, b) {
  4. var c, d, e;
  5. if ("string" == typeof a)
  6. return h(a);
  7. for (c = [],
  8. d = a.length,
  9. e = 0; d > e; e++)
  10. c.push(h(a[e]));
  11. return b.apply(null, c)
  12. }, f = function(a, b, c) {
  13. 2 === arguments.length && (c = b,
  14. b = null),
  15. e(b || [], function() {
  16. g(a, c, arguments)
  17. })
  18. }, g = function(a, b, c) {
  19. var f, g = {
  20. exports: b
  21. };
  22. "function" == typeof b && (c.length || (c = [e, g.exports, g]),
  23. f = b.apply(null, c),
  24. void 0 !== f && (g.exports = f)),
  25. d[a] = g.exports
  26. }, h = function(b) {
  27. var c = d[b] || a[b];
  28. if (!c)
  29. throw new Error("`" + b + "` is undefined");
  30. return c
  31. }, i = function(a) {
  32. var b, c, e, f, g, h;
  33. h = function(a) {
  34. return a && a.charAt(0).toUpperCase() + a.substr(1)
  35. }
  36. ;
  37. for (b in d)
  38. if (c = a,
  39. d.hasOwnProperty(b)) {
  40. for (e = b.split("/"),
  41. g = h(e.pop()); f = h(e.shift()); )
  42. c[f] = c[f] || {},
  43. c = c[f];
  44. c[g] = d[b]
  45. }
  46. }, j = b(a, f, e);
  47. i(j),
  48. "object" == typeof module && "object" == typeof module.exports ? module.exports = j : "function" == typeof define && define.amd ? define([], j) : (c = a.WebUploader,
  49. a.WebUploader = j,
  50. a.WebUploader.noConflict = function() {
  51. a.WebUploader = c
  52. }
  53. )
  54. }(this, function(a, b, c) {
  55. return b("dollar-third", [], function() {
  56. return a.jQuery || a.Zepto
  57. }),
  58. b("dollar", ["dollar-third"], function(a) {
  59. return a
  60. }),
  61. b("promise-third", ["dollar"], function(a) {
  62. return {
  63. Deferred: a.Deferred,
  64. when: a.when,
  65. isPromise: function(a) {
  66. return a && "function" == typeof a.then
  67. }
  68. }
  69. }),
  70. b("promise", ["promise-third"], function(a) {
  71. return a
  72. }),
  73. b("base", ["dollar", "promise"], function(b, c) {
  74. function d(a) {
  75. return function() {
  76. return h.apply(a, arguments)
  77. }
  78. }
  79. function e(a, b) {
  80. return function() {
  81. return a.apply(b, arguments)
  82. }
  83. }
  84. function f(a) {
  85. var b;
  86. return Object.create ? Object.create(a) : (b = function() {}
  87. ,
  88. b.prototype = a,
  89. new b)
  90. }
  91. var g = function() {}
  92. , h = Function.call;
  93. return {
  94. version: "0.1.2",
  95. $: b,
  96. Deferred: c.Deferred,
  97. isPromise: c.isPromise,
  98. when: c.when,
  99. browser: function(a) {
  100. var b = {}
  101. , c = a.match(/WebKit\/([\d.]+)/)
  102. , d = a.match(/Chrome\/([\d.]+)/) || a.match(/CriOS\/([\d.]+)/)
  103. , e = a.match(/MSIE\s([\d\.]+)/) || a.match(/(?:trident)(?:.*rv:([\w.]+))?/i)
  104. , f = a.match(/Firefox\/([\d.]+)/)
  105. , g = a.match(/Safari\/([\d.]+)/)
  106. , h = a.match(/OPR\/([\d.]+)/);
  107. return c && (b.webkit = parseFloat(c[1])),
  108. d && (b.chrome = parseFloat(d[1])),
  109. e && (b.ie = parseFloat(e[1])),
  110. f && (b.firefox = parseFloat(f[1])),
  111. g && (b.safari = parseFloat(g[1])),
  112. h && (b.opera = parseFloat(h[1])),
  113. b
  114. }(navigator.userAgent),
  115. os: function(a) {
  116. var b = {}
  117. , c = a.match(/(?:Android);?[\s\/]+([\d.]+)?/)
  118. , d = a.match(/(?:iPad|iPod|iPhone).*OS\s([\d_]+)/);
  119. return c && (b.android = parseFloat(c[1])),
  120. d && (b.ios = parseFloat(d[1].replace(/_/g, "."))),
  121. b
  122. }(navigator.userAgent),
  123. inherits: function(a, c, d) {
  124. var e;
  125. return "function" == typeof c ? (e = c,
  126. c = null) : e = c && c.hasOwnProperty("constructor") ? c.constructor : function() {
  127. return a.apply(this, arguments)
  128. }
  129. ,
  130. b.extend(!0, e, a, d || {}),
  131. e.__super__ = a.prototype,
  132. e.prototype = f(a.prototype),
  133. c && b.extend(!0, e.prototype, c),
  134. e
  135. },
  136. noop: g,
  137. bindFn: e,
  138. log: function() {
  139. return a.console ? e(console.log, console) : g
  140. }(),
  141. nextTick: function() {
  142. return function(a) {
  143. setTimeout(a, 1)
  144. }
  145. }(),
  146. slice: d([].slice),
  147. guid: function() {
  148. var a = 0;
  149. return function(b) {
  150. for (var c = (+new Date).toString(32), d = 0; 5 > d; d++)
  151. c += Math.floor(65535 * Math.random()).toString(32);
  152. return (b || "wu_") + c + (a++).toString(32)
  153. }
  154. }(),
  155. formatSize: function(a, b, c) {
  156. var d;
  157. for (c = c || ["B", "K", "M", "G", "TB"]; (d = c.shift()) && a > 1024; )
  158. a /= 1024;
  159. return ("B" === d ? a : a.toFixed(b || 2)) + d
  160. }
  161. }
  162. }),
  163. b("mediator", ["base"], function(a) {
  164. function b(a, b, c, d) {
  165. return f.grep(a, function(a) {
  166. return !(!a || b && a.e !== b || c && a.cb !== c && a.cb._cb !== c || d && a.ctx !== d)
  167. })
  168. }
  169. function c(a, b, c) {
  170. f.each((a || "").split(h), function(a, d) {
  171. c(d, b)
  172. })
  173. }
  174. function d(a, b) {
  175. for (var c, d = !1, e = -1, f = a.length; ++e < f; )
  176. if (c = a[e],
  177. c.cb.apply(c.ctx2, b) === !1) {
  178. d = !0;
  179. break
  180. }
  181. return !d
  182. }
  183. var e, f = a.$, g = [].slice, h = /\s+/;
  184. return e = {
  185. on: function(a, b, d) {
  186. var e, f = this;
  187. return b ? (e = this._events || (this._events = []),
  188. c(a, b, function(a, b) {
  189. var c = {
  190. e: a
  191. };
  192. c.cb = b,
  193. c.ctx = d,
  194. c.ctx2 = d || f,
  195. c.id = e.length,
  196. e.push(c)
  197. }),
  198. this) : this
  199. },
  200. once: function(a, b, d) {
  201. var e = this;
  202. return b ? (c(a, b, function(a, b) {
  203. var c = function() {
  204. return e.off(a, c),
  205. b.apply(d || e, arguments)
  206. };
  207. c._cb = b,
  208. e.on(a, c, d)
  209. }),
  210. e) : e
  211. },
  212. off: function(a, d, e) {
  213. var g = this._events;
  214. return g ? a || d || e ? (c(a, d, function(a, c) {
  215. f.each(b(g, a, c, e), function() {
  216. delete g[this.id]
  217. })
  218. }),
  219. this) : (this._events = [],
  220. this) : this
  221. },
  222. trigger: function(a) {
  223. var c, e, f;
  224. return this._events && a ? (c = g.call(arguments, 1),
  225. e = b(this._events, a),
  226. f = b(this._events, "all"),
  227. d(e, c) && d(f, arguments)) : this
  228. }
  229. },
  230. f.extend({
  231. installTo: function(a) {
  232. return f.extend(a, e)
  233. }
  234. }, e)
  235. }),
  236. b("uploader", ["base", "mediator"], function(a, b) {
  237. function c(a) {
  238. this.options = d.extend(!0, {}, c.options, a),
  239. this._init(this.options)
  240. }
  241. var d = a.$;
  242. return c.options = {},
  243. b.installTo(c.prototype),
  244. d.each({
  245. upload: "start-upload",
  246. stop: "stop-upload",
  247. getFile: "get-file",
  248. getFiles: "get-files",
  249. addFile: "add-file",
  250. addFiles: "add-file",
  251. sort: "sort-files",
  252. removeFile: "remove-file",
  253. skipFile: "skip-file",
  254. retry: "retry",
  255. isInProgress: "is-in-progress",
  256. makeThumb: "make-thumb",
  257. getDimension: "get-dimension",
  258. addButton: "add-btn",
  259. getRuntimeType: "get-runtime-type",
  260. refresh: "refresh",
  261. disable: "disable",
  262. enable: "enable",
  263. reset: "reset"
  264. }, function(a, b) {
  265. c.prototype[a] = function() {
  266. return this.request(b, arguments)
  267. }
  268. }),
  269. d.extend(c.prototype, {
  270. state: "pending",
  271. _init: function(a) {
  272. var b = this;
  273. b.request("init", a, function() {
  274. b.state = "ready",
  275. b.trigger("ready")
  276. })
  277. },
  278. option: function(a, b) {
  279. var c = this.options;
  280. return arguments.length > 1 ? void (d.isPlainObject(b) && d.isPlainObject(c[a]) ? d.extend(c[a], b) : c[a] = b) : a ? c[a] : c
  281. },
  282. getStats: function() {
  283. var a = this.request("get-stats");
  284. return {
  285. successNum: a.numOfSuccess,
  286. cancelNum: a.numOfCancel,
  287. invalidNum: a.numOfInvalid,
  288. uploadFailNum: a.numOfUploadFailed,
  289. queueNum: a.numOfQueue
  290. }
  291. },
  292. trigger: function(a) {
  293. var c = [].slice.call(arguments, 1)
  294. , e = this.options
  295. , f = "on" + a.substring(0, 1).toUpperCase() + a.substring(1);
  296. return b.trigger.apply(this, arguments) === !1 || d.isFunction(e[f]) && e[f].apply(this, c) === !1 || d.isFunction(this[f]) && this[f].apply(this, c) === !1 || b.trigger.apply(b, [this, a].concat(c)) === !1 ? !1 : !0
  297. },
  298. request: a.noop
  299. }),
  300. a.create = c.create = function(a) {
  301. return new c(a)
  302. }
  303. ,
  304. a.Uploader = c,
  305. c
  306. }),
  307. b("runtime/runtime", ["base", "mediator"], function(a, b) {
  308. function c(b) {
  309. this.options = d.extend({
  310. container: document.body
  311. }, b),
  312. this.uid = a.guid("rt_")
  313. }
  314. var d = a.$
  315. , e = {}
  316. , f = function(a) {
  317. for (var b in a)
  318. if (a.hasOwnProperty(b))
  319. return b;
  320. return null
  321. };
  322. return d.extend(c.prototype, {
  323. getContainer: function() {
  324. var a, b, c = this.options;
  325. return this._container ? this._container : (a = d(c.container || document.body),
  326. b = d(document.createElement("div")),
  327. b.attr("id", "rt_" + this.uid),
  328. b.css({
  329. position: "absolute",
  330. top: "0px",
  331. left: "0px",
  332. width: "1px",
  333. height: "1px",
  334. overflow: "hidden"
  335. }),
  336. a.append(b),
  337. a.addClass("webuploader-container"),
  338. this._container = b,
  339. b)
  340. },
  341. init: a.noop,
  342. exec: a.noop,
  343. destroy: function() {
  344. this._container && this._container.parentNode.removeChild(this.__container),
  345. this.off()
  346. }
  347. }),
  348. c.orders = "html5,flash",
  349. c.addRuntime = function(a, b) {
  350. e[a] = b
  351. }
  352. ,
  353. c.hasRuntime = function(a) {
  354. return !!(a ? e[a] : f(e))
  355. }
  356. ,
  357. c.create = function(a, b) {
  358. var g, h;
  359. if (b = b || c.orders,
  360. d.each(b.split(/\s*,\s*/g), function() {
  361. return e[this] ? (g = this,
  362. !1) : void 0
  363. }),
  364. g = g || f(e),
  365. !g)
  366. throw new Error("Runtime Error");
  367. return h = new e[g](a)
  368. }
  369. ,
  370. b.installTo(c.prototype),
  371. c
  372. }),
  373. b("runtime/client", ["base", "mediator", "runtime/runtime"], function(a, b, c) {
  374. function d(b, d) {
  375. var f, g = a.Deferred();
  376. this.uid = a.guid("client_"),
  377. this.runtimeReady = function(a) {
  378. return g.done(a)
  379. }
  380. ,
  381. this.connectRuntime = function(b, h) {
  382. if (f)
  383. throw new Error("already connected!");
  384. return g.done(h),
  385. "string" == typeof b && e.get(b) && (f = e.get(b)),
  386. f = f || e.get(null, d),
  387. f ? (a.$.extend(f.options, b),
  388. f.__promise.then(g.resolve),
  389. f.__client++) : (f = c.create(b, b.runtimeOrder),
  390. f.__promise = g.promise(),
  391. f.once("ready", g.resolve),
  392. f.init(),
  393. e.add(f),
  394. f.__client = 1),
  395. d && (f.__standalone = d),
  396. f
  397. }
  398. ,
  399. this.getRuntime = function() {
  400. return f
  401. }
  402. ,
  403. this.disconnectRuntime = function() {
  404. f && (f.__client--,
  405. f.__client <= 0 && (e.remove(f),
  406. delete f.__promise,
  407. f.destroy()),
  408. f = null)
  409. }
  410. ,
  411. this.exec = function() {
  412. if (f) {
  413. var c = a.slice(arguments);
  414. return b && c.unshift(b),
  415. f.exec.apply(this, c)
  416. }
  417. }
  418. ,
  419. this.getRuid = function() {
  420. return f && f.uid
  421. }
  422. ,
  423. this.destroy = function(a) {
  424. return function() {
  425. a && a.apply(this, arguments),
  426. this.trigger("destroy"),
  427. this.off(),
  428. this.exec("destroy"),
  429. this.disconnectRuntime()
  430. }
  431. }(this.destroy)
  432. }
  433. var e;
  434. return e = function() {
  435. var a = {};
  436. return {
  437. add: function(b) {
  438. a[b.uid] = b
  439. },
  440. get: function(b, c) {
  441. var d;
  442. if (b)
  443. return a[b];
  444. for (d in a)
  445. if (!c || !a[d].__standalone)
  446. return a[d];
  447. return null
  448. },
  449. remove: function(b) {
  450. delete a[b.uid]
  451. }
  452. }
  453. }(),
  454. b.installTo(d.prototype),
  455. d
  456. }),
  457. b("lib/dnd", ["base", "mediator", "runtime/client"], function(a, b, c) {
  458. function d(a) {
  459. a = this.options = e.extend({}, d.options, a),
  460. a.container = e(a.container),
  461. a.container.length && c.call(this, "DragAndDrop")
  462. }
  463. var e = a.$;
  464. return d.options = {
  465. accept: null,
  466. disableGlobalDnd: !1
  467. },
  468. a.inherits(c, {
  469. constructor: d,
  470. init: function() {
  471. var a = this;
  472. a.connectRuntime(a.options, function() {
  473. a.exec("init"),
  474. a.trigger("ready")
  475. })
  476. },
  477. destroy: function() {
  478. this.disconnectRuntime()
  479. }
  480. }),
  481. b.installTo(d.prototype),
  482. d
  483. }),
  484. b("widgets/widget", ["base", "uploader"], function(a, b) {
  485. function c(a) {
  486. if (!a)
  487. return !1;
  488. var b = a.length
  489. , c = e.type(a);
  490. return 1 === a.nodeType && b ? !0 : "array" === c || "function" !== c && "string" !== c && (0 === b || "number" == typeof b && b > 0 && b - 1 in a)
  491. }
  492. function d(a) {
  493. this.owner = a,
  494. this.options = a.options
  495. }
  496. var e = a.$
  497. , f = b.prototype._init
  498. , g = {}
  499. , h = [];
  500. return e.extend(d.prototype, {
  501. init: a.noop,
  502. invoke: function(a, b) {
  503. var c = this.responseMap;
  504. return c && a in c && c[a]in this && e.isFunction(this[c[a]]) ? this[c[a]].apply(this, b) : g
  505. },
  506. request: function() {
  507. return this.owner.request.apply(this.owner, arguments)
  508. }
  509. }),
  510. e.extend(b.prototype, {
  511. _init: function() {
  512. var a = this
  513. , b = a._widgets = [];
  514. return e.each(h, function(c, d) {
  515. b.push(new d(a))
  516. }),
  517. f.apply(a, arguments)
  518. },
  519. request: function(b, d, e) {
  520. var f, h, i, j, k = 0, l = this._widgets, m = l.length, n = [], o = [];
  521. for (d = c(d) ? d : [d]; m > k; k++)
  522. f = l[k],
  523. h = f.invoke(b, d),
  524. h !== g && (a.isPromise(h) ? o.push(h) : n.push(h));
  525. return e || o.length ? (i = a.when.apply(a, o),
  526. j = i.pipe ? "pipe" : "then",
  527. i[j](function() {
  528. var b = a.Deferred()
  529. , c = arguments;
  530. return setTimeout(function() {
  531. b.resolve.apply(b, c)
  532. }, 1),
  533. b.promise()
  534. })[j](e || a.noop)) : n[0]
  535. }
  536. }),
  537. b.register = d.register = function(b, c) {
  538. var f, g = {
  539. init: "init"
  540. };
  541. return 1 === arguments.length ? (c = b,
  542. c.responseMap = g) : c.responseMap = e.extend(g, b),
  543. f = a.inherits(d, c),
  544. h.push(f),
  545. f
  546. }
  547. ,
  548. d
  549. }),
  550. b("widgets/filednd", ["base", "uploader", "lib/dnd", "widgets/widget"], function(a, b, c) {
  551. var d = a.$;
  552. return b.options.dnd = "",
  553. b.register({
  554. init: function(b) {
  555. if (b.dnd && "html5" === this.request("predict-runtime-type")) {
  556. var e, f = this, g = a.Deferred(), h = d.extend({}, {
  557. disableGlobalDnd: b.disableGlobalDnd,
  558. container: b.dnd,
  559. accept: b.accept
  560. });
  561. return e = new c(h),
  562. e.once("ready", g.resolve),
  563. e.on("drop", function(a) {
  564. f.request("add-file", [a])
  565. }),
  566. e.on("accept", function(a) {
  567. return f.owner.trigger("dndAccept", a)
  568. }),
  569. e.init(),
  570. g.promise()
  571. }
  572. }
  573. })
  574. }),
  575. b("lib/filepaste", ["base", "mediator", "runtime/client"], function(a, b, c) {
  576. function d(a) {
  577. a = this.options = e.extend({}, a),
  578. a.container = e(a.container || document.body),
  579. c.call(this, "FilePaste")
  580. }
  581. var e = a.$;
  582. return a.inherits(c, {
  583. constructor: d,
  584. init: function() {
  585. var a = this;
  586. a.connectRuntime(a.options, function() {
  587. a.exec("init"),
  588. a.trigger("ready")
  589. })
  590. },
  591. destroy: function() {
  592. this.exec("destroy"),
  593. this.disconnectRuntime(),
  594. this.off()
  595. }
  596. }),
  597. b.installTo(d.prototype),
  598. d
  599. }),
  600. b("widgets/filepaste", ["base", "uploader", "lib/filepaste", "widgets/widget"], function(a, b, c) {
  601. var d = a.$;
  602. return b.register({
  603. init: function(b) {
  604. if (b.paste && "html5" === this.request("predict-runtime-type")) {
  605. var e, f = this, g = a.Deferred(), h = d.extend({}, {
  606. container: b.paste,
  607. accept: b.accept
  608. });
  609. return e = new c(h),
  610. e.once("ready", g.resolve),
  611. e.on("paste", function(a) {
  612. f.owner.request("add-file", [a])
  613. }),
  614. e.init(),
  615. g.promise()
  616. }
  617. }
  618. })
  619. }),
  620. b("lib/blob", ["base", "runtime/client"], function(a, b) {
  621. function c(a, c) {
  622. var d = this;
  623. d.source = c,
  624. d.ruid = a,
  625. b.call(d, "Blob"),
  626. this.uid = c.uid || this.uid,
  627. this.type = c.type || "",
  628. this.size = c.size || 0,
  629. a && d.connectRuntime(a)
  630. }
  631. return a.inherits(b, {
  632. constructor: c,
  633. slice: function(a, b) {
  634. return this.exec("slice", a, b)
  635. },
  636. getSource: function() {
  637. return this.source
  638. }
  639. }),
  640. c
  641. }),
  642. b("lib/file", ["base", "lib/blob"], function(a, b) {
  643. function c(a, c) {
  644. var f;
  645. b.apply(this, arguments),
  646. this.name = c.name || "untitled" + d++,
  647. f = e.exec(c.name) ? RegExp.$1.toLowerCase() : "",
  648. !f && this.type && (f = /\/(jpg|jpeg|png|gif|bmp)$/i.exec(this.type) ? RegExp.$1.toLowerCase() : "",
  649. this.name += "." + f),
  650. !this.type && ~"jpg,jpeg,png,gif,bmp".indexOf(f) && (this.type = "image/" + ("jpg" === f ? "jpeg" : f)),
  651. this.ext = f,
  652. this.lastModifiedDate = c.lastModifiedDate || (new Date).toLocaleString()
  653. }
  654. var d = 1
  655. , e = /\.([^.]+)$/;
  656. return a.inherits(b, c)
  657. }),
  658. b("lib/filepicker", ["base", "runtime/client", "lib/file"], function(b, c, d) {
  659. function e(a) {
  660. if (a = this.options = f.extend({}, e.options, a),
  661. a.container = f(a.id),
  662. !a.container.length)
  663. throw new Error("按钮指定错误");
  664. a.innerHTML = a.innerHTML || a.label || a.container.html() || "",
  665. a.button = f(a.button || document.createElement("div")),
  666. a.button.html(a.innerHTML),
  667. a.container.html(a.button),
  668. c.call(this, "FilePicker", !0)
  669. }
  670. var f = b.$;
  671. return e.options = {
  672. button: null,
  673. container: null,
  674. label: null,
  675. innerHTML: null,
  676. multiple: !0,
  677. accept: null,
  678. name: "file"
  679. },
  680. b.inherits(c, {
  681. constructor: e,
  682. init: function() {
  683. var b = this
  684. , c = b.options
  685. , e = c.button;
  686. e.addClass("webuploader-pick"),
  687. b.on("all", function(a) {
  688. var g;
  689. switch (a) {
  690. case "mouseenter":
  691. e.addClass("webuploader-pick-hover");
  692. break;
  693. case "mouseleave":
  694. e.removeClass("webuploader-pick-hover");
  695. break;
  696. case "change":
  697. g = b.exec("getFiles"),
  698. b.trigger("select", f.map(g, function(a) {
  699. return a = new d(b.getRuid(),a),
  700. a._refer = c.container,
  701. a
  702. }), c.container)
  703. }
  704. }),
  705. b.connectRuntime(c, function() {
  706. b.refresh(),
  707. b.exec("init", c),
  708. b.trigger("ready")
  709. }),
  710. f(a).on("resize", function() {
  711. b.refresh()
  712. })
  713. },
  714. refresh: function() {
  715. var a = this.getRuntime().getContainer()
  716. , b = this.options.button
  717. , c = b.outerWidth ? b.outerWidth() : b.width()
  718. , d = b.outerHeight ? b.outerHeight() : b.height()
  719. , e = b.offset();
  720. c && d && a.css({
  721. bottom: "auto",
  722. right: "auto",
  723. width: c + "px",
  724. height: d + "px"
  725. }).offset(e)
  726. },
  727. enable: function() {
  728. var a = this.options.button;
  729. a.removeClass("webuploader-pick-disable"),
  730. this.refresh()
  731. },
  732. disable: function() {
  733. var a = this.options.button;
  734. this.getRuntime().getContainer().css({
  735. top: "-99999px"
  736. }),
  737. a.addClass("webuploader-pick-disable")
  738. },
  739. destroy: function() {
  740. this.runtime && (this.exec("destroy"),
  741. this.disconnectRuntime())
  742. }
  743. }),
  744. e
  745. }),
  746. b("widgets/filepicker", ["base", "uploader", "lib/filepicker", "widgets/widget"], function(a, b, c) {
  747. var d = a.$;
  748. return d.extend(b.options, {
  749. pick: null,
  750. accept: null
  751. }),
  752. b.register({
  753. "add-btn": "addButton",
  754. refresh: "refresh",
  755. disable: "disable",
  756. enable: "enable"
  757. }, {
  758. init: function(a) {
  759. return this.pickers = [],
  760. a.pick && this.addButton(a.pick)
  761. },
  762. refresh: function() {
  763. d.each(this.pickers, function() {
  764. this.refresh()
  765. })
  766. },
  767. addButton: function(b) {
  768. var e, f, g, h = this, i = h.options, j = i.accept;
  769. if (b)
  770. return g = a.Deferred(),
  771. d.isPlainObject(b) || (b = {
  772. id: b
  773. }),
  774. e = d.extend({}, b, {
  775. accept: d.isPlainObject(j) ? [j] : j,
  776. swf: i.swf,
  777. runtimeOrder: i.runtimeOrder
  778. }),
  779. f = new c(e),
  780. f.once("ready", g.resolve),
  781. f.on("select", function(a) {
  782. h.owner.request("add-file", [a])
  783. }),
  784. f.init(),
  785. this.pickers.push(f),
  786. g.promise()
  787. },
  788. disable: function() {
  789. d.each(this.pickers, function() {
  790. this.disable()
  791. })
  792. },
  793. enable: function() {
  794. d.each(this.pickers, function() {
  795. this.enable()
  796. })
  797. }
  798. })
  799. }),
  800. b("lib/image", ["base", "runtime/client", "lib/blob"], function(a, b, c) {
  801. function d(a) {
  802. this.options = e.extend({}, d.options, a),
  803. b.call(this, "Image"),
  804. this.on("load", function() {
  805. this._info = this.exec("info"),
  806. this._meta = this.exec("meta")
  807. })
  808. }
  809. var e = a.$;
  810. return d.options = {
  811. quality: 90,
  812. crop: !1,
  813. preserveHeaders: !0,
  814. allowMagnify: !0
  815. },
  816. a.inherits(b, {
  817. constructor: d,
  818. info: function(a) {
  819. return a ? (this._info = a,
  820. this) : this._info
  821. },
  822. meta: function(a) {
  823. return a ? (this._meta = a,
  824. this) : this._meta
  825. },
  826. loadFromBlob: function(a) {
  827. var b = this
  828. , c = a.getRuid();
  829. this.connectRuntime(c, function() {
  830. b.exec("init", b.options),
  831. b.exec("loadFromBlob", a)
  832. })
  833. },
  834. resize: function() {
  835. var b = a.slice(arguments);
  836. return this.exec.apply(this, ["resize"].concat(b))
  837. },
  838. getAsDataUrl: function(a) {
  839. return this.exec("getAsDataUrl", a)
  840. },
  841. getAsBlob: function(a) {
  842. var b = this.exec("getAsBlob", a);
  843. return new c(this.getRuid(),b)
  844. }
  845. }),
  846. d
  847. }),
  848. b("widgets/image", ["base", "uploader", "lib/image", "widgets/widget"], function(a, b, c) {
  849. var d, e = a.$;
  850. return d = function(a) {
  851. var b = 0
  852. , c = []
  853. , d = function() {
  854. for (var d; c.length && a > b; )
  855. d = c.shift(),
  856. b += d[0],
  857. d[1]()
  858. };
  859. return function(a, e, f) {
  860. c.push([e, f]),
  861. a.once("destroy", function() {
  862. b -= e,
  863. setTimeout(d, 1)
  864. }),
  865. setTimeout(d, 1)
  866. }
  867. }(5242880),
  868. e.extend(b.options, {
  869. thumb: {
  870. width: 110,
  871. height: 110,
  872. quality: 70,
  873. allowMagnify: !0,
  874. crop: !0,
  875. preserveHeaders: !1,
  876. type: "image/jpeg"
  877. },
  878. compress: {
  879. width: 1600,
  880. height: 1600,
  881. quality: 90,
  882. allowMagnify: !1,
  883. crop: !1,
  884. preserveHeaders: !0
  885. }
  886. }),
  887. b.register({
  888. "make-thumb": "makeThumb",
  889. "before-send-file": "compressImage"
  890. }, {
  891. makeThumb: function(a, b, f, g) {
  892. var h, i;
  893. return a = this.request("get-file", a),
  894. a.type.match(/^image/) ? (h = e.extend({}, this.options.thumb),
  895. e.isPlainObject(f) && (h = e.extend(h, f),
  896. f = null),
  897. f = f || h.width,
  898. g = g || h.height,
  899. i = new c(h),
  900. i.once("load", function() {
  901. a._info = a._info || i.info(),
  902. a._meta = a._meta || i.meta(),
  903. i.resize(f, g)
  904. }),
  905. i.once("complete", function() {
  906. b(!1, i.getAsDataUrl(h.type)),
  907. i.destroy()
  908. }),
  909. i.once("error", function() {
  910. b(!0),
  911. i.destroy()
  912. }),
  913. void d(i, a.source.size, function() {
  914. a._info && i.info(a._info),
  915. a._meta && i.meta(a._meta),
  916. i.loadFromBlob(a.source)
  917. })) : void b(!0)
  918. },
  919. compressImage: function(b) {
  920. var d, f, g = this.options.compress || this.options.resize, h = g && g.compressSize || 307200;
  921. return b = this.request("get-file", b),
  922. !g || !~"image/jpeg,image/jpg".indexOf(b.type) || b.size < h || b._compressed ? void 0 : (g = e.extend({}, g),
  923. f = a.Deferred(),
  924. d = new c(g),
  925. f.always(function() {
  926. d.destroy(),
  927. d = null
  928. }),
  929. d.once("error", f.reject),
  930. d.once("load", function() {
  931. b._info = b._info || d.info(),
  932. b._meta = b._meta || d.meta(),
  933. d.resize(g.width, g.height)
  934. }),
  935. d.once("complete", function() {
  936. var a, c;
  937. try {
  938. a = d.getAsBlob(g.type),
  939. c = b.size,
  940. a.size < c && (b.source = a,
  941. b.size = a.size,
  942. b.trigger("resize", a.size, c)),
  943. b._compressed = !0,
  944. f.resolve()
  945. } catch (e) {
  946. f.resolve()
  947. }
  948. }),
  949. b._info && d.info(b._info),
  950. b._meta && d.meta(b._meta),
  951. d.loadFromBlob(b.source),
  952. f.promise())
  953. }
  954. })
  955. }),
  956. b("file", ["base", "mediator"], function(a, b) {
  957. function c() {
  958. return f + g++
  959. }
  960. function d(a) {
  961. this.name = a.name || "Untitled",
  962. this.size = a.size || 0,
  963. this.type = a.type || "application",
  964. this.lastModifiedDate = a.lastModifiedDate || 1 * new Date,
  965. this.id = c(),
  966. this.ext = h.exec(this.name) ? RegExp.$1 : "",
  967. this.statusText = "",
  968. i[this.id] = d.Status.INITED,
  969. this.source = a,
  970. this.loaded = 0,
  971. this.on("error", function(a) {
  972. this.setStatus(d.Status.ERROR, a)
  973. })
  974. }
  975. var e = a.$
  976. , f = "WU_FILE_"
  977. , g = 0
  978. , h = /\.([^.]+)$/
  979. , i = {};
  980. return e.extend(d.prototype, {
  981. setStatus: function(a, b) {
  982. var c = i[this.id];
  983. "undefined" != typeof b && (this.statusText = b),
  984. a !== c && (i[this.id] = a,
  985. this.trigger("statuschange", a, c))
  986. },
  987. getStatus: function() {
  988. return i[this.id]
  989. },
  990. getSource: function() {
  991. return this.source
  992. },
  993. destory: function() {
  994. delete i[this.id]
  995. }
  996. }),
  997. b.installTo(d.prototype),
  998. d.Status = {
  999. INITED: "inited",
  1000. QUEUED: "queued",
  1001. PROGRESS: "progress",
  1002. ERROR: "error",
  1003. COMPLETE: "complete",
  1004. CANCELLED: "cancelled",
  1005. INTERRUPT: "interrupt",
  1006. INVALID: "invalid"
  1007. },
  1008. d
  1009. }),
  1010. b("queue", ["base", "mediator", "file"], function(a, b, c) {
  1011. function d() {
  1012. this.stats = {
  1013. numOfQueue: 0,
  1014. numOfSuccess: 0,
  1015. numOfCancel: 0,
  1016. numOfProgress: 0,
  1017. numOfUploadFailed: 0,
  1018. numOfInvalid: 0
  1019. },
  1020. this._queue = [],
  1021. this._map = {}
  1022. }
  1023. var e = a.$
  1024. , f = c.Status;
  1025. return e.extend(d.prototype, {
  1026. append: function(a) {
  1027. return this._queue.push(a),
  1028. this._fileAdded(a),
  1029. this
  1030. },
  1031. prepend: function(a) {
  1032. return this._queue.unshift(a),
  1033. this._fileAdded(a),
  1034. this
  1035. },
  1036. getFile: function(a) {
  1037. return "string" != typeof a ? a : this._map[a]
  1038. },
  1039. fetch: function(a) {
  1040. var b, c, d = this._queue.length;
  1041. for (a = a || f.QUEUED,
  1042. b = 0; d > b; b++)
  1043. if (c = this._queue[b],
  1044. a === c.getStatus())
  1045. return c;
  1046. return null
  1047. },
  1048. sort: function(a) {
  1049. "function" == typeof a && this._queue.sort(a)
  1050. },
  1051. getFiles: function() {
  1052. for (var a, b = [].slice.call(arguments, 0), c = [], d = 0, f = this._queue.length; f > d; d++)
  1053. a = this._queue[d],
  1054. (!b.length || ~e.inArray(a.getStatus(), b)) && c.push(a);
  1055. return c
  1056. },
  1057. _fileAdded: function(a) {
  1058. var b = this
  1059. , c = this._map[a.id];
  1060. c || (this._map[a.id] = a,
  1061. a.on("statuschange", function(a, c) {
  1062. b._onFileStatusChange(a, c)
  1063. })),
  1064. a.setStatus(f.QUEUED)
  1065. },
  1066. _onFileStatusChange: function(a, b) {
  1067. var c = this.stats;
  1068. switch (b) {
  1069. case f.PROGRESS:
  1070. c.numOfProgress--;
  1071. break;
  1072. case f.QUEUED:
  1073. c.numOfQueue--;
  1074. break;
  1075. case f.ERROR:
  1076. c.numOfUploadFailed--;
  1077. break;
  1078. case f.INVALID:
  1079. c.numOfInvalid--
  1080. }
  1081. switch (a) {
  1082. case f.QUEUED:
  1083. c.numOfQueue++;
  1084. break;
  1085. case f.PROGRESS:
  1086. c.numOfProgress++;
  1087. break;
  1088. case f.ERROR:
  1089. c.numOfUploadFailed++;
  1090. break;
  1091. case f.COMPLETE:
  1092. c.numOfSuccess++;
  1093. break;
  1094. case f.CANCELLED:
  1095. c.numOfCancel++;
  1096. break;
  1097. case f.INVALID:
  1098. c.numOfInvalid++
  1099. }
  1100. }
  1101. }),
  1102. b.installTo(d.prototype),
  1103. d
  1104. }),
  1105. b("widgets/queue", ["base", "uploader", "queue", "file", "lib/file", "runtime/client", "widgets/widget"], function(a, b, c, d, e, f) {
  1106. var g = a.$
  1107. , h = /\.\w+$/
  1108. , i = d.Status;
  1109. return b.register({
  1110. "sort-files": "sortFiles",
  1111. "add-file": "addFiles",
  1112. "get-file": "getFile",
  1113. "fetch-file": "fetchFile",
  1114. "get-stats": "getStats",
  1115. "get-files": "getFiles",
  1116. "remove-file": "removeFile",
  1117. retry: "retry",
  1118. reset: "reset",
  1119. "accept-file": "acceptFile"
  1120. }, {
  1121. init: function(b) {
  1122. var d, e, h, i, j, k, l, m = this;
  1123. if (g.isPlainObject(b.accept) && (b.accept = [b.accept]),
  1124. b.accept) {
  1125. for (j = [],
  1126. h = 0,
  1127. e = b.accept.length; e > h; h++)
  1128. i = b.accept[h].extensions,
  1129. i && j.push(i);
  1130. j.length && (k = "\\." + j.join(",").replace(/,/g, "$|\\.").replace(/\*/g, ".*") + "$"),
  1131. m.accept = new RegExp(k,"i")
  1132. }
  1133. return m.queue = new c,
  1134. m.stats = m.queue.stats,
  1135. "html5" === this.request("predict-runtime-type") ? (d = a.Deferred(),
  1136. l = new f("Placeholder"),
  1137. l.connectRuntime({
  1138. runtimeOrder: "html5"
  1139. }, function() {
  1140. m._ruid = l.getRuid(),
  1141. d.resolve()
  1142. }),
  1143. d.promise()) : void 0
  1144. },
  1145. _wrapFile: function(a) {
  1146. if (!(a instanceof d)) {
  1147. if (!(a instanceof e)) {
  1148. if (!this._ruid)
  1149. throw new Error("Can't add external files.");
  1150. a = new e(this._ruid,a)
  1151. }
  1152. a = new d(a)
  1153. }
  1154. return a
  1155. },
  1156. acceptFile: function(a) {
  1157. var b = !a || a.size < 6 || this.accept && h.exec(a.name) && !this.accept.test(a.name);
  1158. return !b
  1159. },
  1160. _addFile: function(a) {
  1161. var b = this;
  1162. return a = b._wrapFile(a),
  1163. b.owner.trigger("beforeFileQueued", a) ? b.acceptFile(a) ? (b.queue.append(a),
  1164. b.owner.trigger("fileQueued", a),
  1165. a) : void b.owner.trigger("error", "Q_TYPE_DENIED", a) : void 0
  1166. },
  1167. getFile: function(a) {
  1168. return this.queue.getFile(a)
  1169. },
  1170. addFiles: function(a) {
  1171. var b = this;
  1172. a.length || (a = [a]),
  1173. a = g.map(a, function(a) {
  1174. return b._addFile(a)
  1175. }),
  1176. b.owner.trigger("filesQueued", a),
  1177. b.options.auto && b.request("start-upload")
  1178. },
  1179. getStats: function() {
  1180. return this.stats
  1181. },
  1182. removeFile: function(a) {
  1183. var b = this;
  1184. a = a.id ? a : b.queue.getFile(a),
  1185. a.setStatus(i.CANCELLED),
  1186. b.owner.trigger("fileDequeued", a)
  1187. },
  1188. getFiles: function() {
  1189. return this.queue.getFiles.apply(this.queue, arguments)
  1190. },
  1191. fetchFile: function() {
  1192. return this.queue.fetch.apply(this.queue, arguments)
  1193. },
  1194. retry: function(a, b) {
  1195. var c, d, e, f = this;
  1196. if (a)
  1197. return a = a.id ? a : f.queue.getFile(a),
  1198. a.setStatus(i.QUEUED),
  1199. void (b || f.request("start-upload"));
  1200. for (c = f.queue.getFiles(i.ERROR),
  1201. d = 0,
  1202. e = c.length; e > d; d++)
  1203. a = c[d],
  1204. a.setStatus(i.QUEUED);
  1205. f.request("start-upload")
  1206. },
  1207. sortFiles: function() {
  1208. return this.queue.sort.apply(this.queue, arguments)
  1209. },
  1210. reset: function() {
  1211. this.queue = new c,
  1212. this.stats = this.queue.stats
  1213. }
  1214. })
  1215. }),
  1216. b("widgets/runtime", ["uploader", "runtime/runtime", "widgets/widget"], function(a, b) {
  1217. return a.support = function() {
  1218. return b.hasRuntime.apply(b, arguments)
  1219. }
  1220. ,
  1221. a.register({
  1222. "predict-runtime-type": "predictRuntmeType"
  1223. }, {
  1224. init: function() {
  1225. if (!this.predictRuntmeType())
  1226. throw Error("Runtime Error")
  1227. },
  1228. predictRuntmeType: function() {
  1229. var a, c, d = this.options.runtimeOrder || b.orders, e = this.type;
  1230. if (!e)
  1231. for (d = d.split(/\s*,\s*/g),
  1232. a = 0,
  1233. c = d.length; c > a; a++)
  1234. if (b.hasRuntime(d[a])) {
  1235. this.type = e = d[a];
  1236. break
  1237. }
  1238. return e
  1239. }
  1240. })
  1241. }),
  1242. b("lib/transport", ["base", "runtime/client", "mediator"], function(a, b, c) {
  1243. function d(a) {
  1244. var c = this;
  1245. a = c.options = e.extend(!0, {}, d.options, a || {}),
  1246. b.call(this, "Transport"),
  1247. this._blob = null,
  1248. this._formData = a.formData || {},
  1249. this._headers = a.headers || {},
  1250. this.on("progress", this._timeout),
  1251. this.on("load error", function() {
  1252. c.trigger("progress", 1),
  1253. clearTimeout(c._timer)
  1254. })
  1255. }
  1256. var e = a.$;
  1257. return d.options = {
  1258. server: "",
  1259. method: "POST",
  1260. withCredentials: !1,
  1261. fileVal: "file",
  1262. timeout: 12e4,
  1263. formData: {},
  1264. headers: {},
  1265. sendAsBinary: !1
  1266. },
  1267. e.extend(d.prototype, {
  1268. appendBlob: function(a, b, c) {
  1269. var d = this
  1270. , e = d.options;
  1271. d.getRuid() && d.disconnectRuntime(),
  1272. d.connectRuntime(b.ruid, function() {
  1273. d.exec("init")
  1274. }),
  1275. d._blob = b,
  1276. e.fileVal = a || e.fileVal,
  1277. e.filename = c || e.filename
  1278. },
  1279. append: function(a, b) {
  1280. "object" == typeof a ? e.extend(this._formData, a) : this._formData[a] = b
  1281. },
  1282. setRequestHeader: function(a, b) {
  1283. "object" == typeof a ? e.extend(this._headers, a) : this._headers[a] = b
  1284. },
  1285. send: function(a) {
  1286. this.exec("send", a),
  1287. this._timeout()
  1288. },
  1289. abort: function() {
  1290. return clearTimeout(this._timer),
  1291. this.exec("abort")
  1292. },
  1293. destroy: function() {
  1294. this.trigger("destroy"),
  1295. this.off(),
  1296. this.exec("destroy"),
  1297. this.disconnectRuntime()
  1298. },
  1299. getResponse: function() {
  1300. return this.exec("getResponse")
  1301. },
  1302. getResponseAsJson: function() {
  1303. return this.exec("getResponseAsJson")
  1304. },
  1305. getStatus: function() {
  1306. return this.exec("getStatus")
  1307. },
  1308. _timeout: function() {
  1309. var a = this
  1310. , b = a.options.timeout;
  1311. b && (clearTimeout(a._timer),
  1312. a._timer = setTimeout(function() {
  1313. a.abort(),
  1314. a.trigger("error", "timeout")
  1315. }, b))
  1316. }
  1317. }),
  1318. c.installTo(d.prototype),
  1319. d
  1320. }),
  1321. b("widgets/upload", ["base", "uploader", "file", "lib/transport", "widgets/widget"], function(a, b, c, d) {
  1322. function e(a, b) {
  1323. for (var c, d = [], e = a.source, f = e.size, g = b ? Math.ceil(f / b) : 1, h = 0, i = 0; g > i; )
  1324. c = Math.min(b, f - h),
  1325. d.push({
  1326. file: a,
  1327. start: h,
  1328. end: b ? h + c : f,
  1329. total: f,
  1330. chunks: g,
  1331. chunk: i++
  1332. }),
  1333. h += c;
  1334. return a.blocks = d.concat(),
  1335. a.remaning = d.length,
  1336. {
  1337. file: a,
  1338. has: function() {
  1339. return !!d.length
  1340. },
  1341. fetch: function() {
  1342. return d.shift()
  1343. }
  1344. }
  1345. }
  1346. var f = a.$
  1347. , g = a.isPromise
  1348. , h = c.Status;
  1349. f.extend(b.options, {
  1350. prepareNextFile: !1,
  1351. chunked: !1,
  1352. chunkSize: 5242880,
  1353. chunkRetry: 2,
  1354. threads: 3,
  1355. formData: null
  1356. }),
  1357. b.register({
  1358. "start-upload": "start",
  1359. "stop-upload": "stop",
  1360. "skip-file": "skipFile",
  1361. "is-in-progress": "isInProgress"
  1362. }, {
  1363. init: function() {
  1364. var b = this.owner;
  1365. this.runing = !1,
  1366. this.pool = [],
  1367. this.pending = [],
  1368. this.remaning = 0,
  1369. this.__tick = a.bindFn(this._tick, this),
  1370. b.on("uploadComplete", function(a) {
  1371. a.blocks && f.each(a.blocks, function(a, b) {
  1372. b.transport && (b.transport.abort(),
  1373. b.transport.destroy()),
  1374. delete b.transport
  1375. }),
  1376. delete a.blocks,
  1377. delete a.remaning
  1378. })
  1379. },
  1380. start: function() {
  1381. var b = this;
  1382. f.each(b.request("get-files", h.INVALID), function() {
  1383. b.request("remove-file", this)
  1384. }),
  1385. b.runing || (b.runing = !0,
  1386. f.each(b.pool, function(a, c) {
  1387. var d = c.file;
  1388. d.getStatus() === h.INTERRUPT && (d.setStatus(h.PROGRESS),
  1389. b._trigged = !1,
  1390. c.transport && c.transport.send())
  1391. }),
  1392. b._trigged = !1,
  1393. b.owner.trigger("startUpload"),
  1394. a.nextTick(b.__tick))
  1395. },
  1396. stop: function(a) {
  1397. var b = this;
  1398. b.runing !== !1 && (b.runing = !1,
  1399. a && f.each(b.pool, function(a, b) {
  1400. b.transport && b.transport.abort(),
  1401. b.file.setStatus(h.INTERRUPT)
  1402. }),
  1403. b.owner.trigger("stopUpload"))
  1404. },
  1405. isInProgress: function() {
  1406. return !!this.runing
  1407. },
  1408. getStats: function() {
  1409. return this.request("get-stats")
  1410. },
  1411. skipFile: function(a, b) {
  1412. a = this.request("get-file", a),
  1413. a.setStatus(b || h.COMPLETE),
  1414. a.skipped = !0,
  1415. a.blocks && f.each(a.blocks, function(a, b) {
  1416. var c = b.transport;
  1417. c && (c.abort(),
  1418. c.destroy(),
  1419. delete b.transport)
  1420. }),
  1421. this.owner.trigger("uploadSkip", a)
  1422. },
  1423. _tick: function() {
  1424. var b, c, d = this, e = d.options;
  1425. return d._promise ? d._promise.always(d.__tick) : void (d.pool.length < e.threads && (c = d._nextBlock()) ? (d._trigged = !1,
  1426. b = function(b) {
  1427. d._promise = null,
  1428. b && b.file && d._startSend(b),
  1429. a.nextTick(d.__tick)
  1430. }
  1431. ,
  1432. d._promise = g(c) ? c.always(b) : b(c)) : d.remaning || d.getStats().numOfQueue || (d.runing = !1,
  1433. d._trigged || a.nextTick(function() {
  1434. d.owner.trigger("uploadFinished")
  1435. }),
  1436. d._trigged = !0))
  1437. },
  1438. _nextBlock: function() {
  1439. var a, b, c = this, d = c._act, f = c.options;
  1440. return d && d.has() && d.file.getStatus() === h.PROGRESS ? (f.prepareNextFile && !c.pending.length && c._prepareNextFile(),
  1441. d.fetch()) : c.runing ? (!c.pending.length && c.getStats().numOfQueue && c._prepareNextFile(),
  1442. a = c.pending.shift(),
  1443. b = function(a) {
  1444. return a ? (d = e(a, f.chunked ? f.chunkSize : 0),
  1445. c._act = d,
  1446. d.fetch()) : null
  1447. }
  1448. ,
  1449. g(a) ? a[a.pipe ? "pipe" : "then"](b) : b(a)) : void 0
  1450. },
  1451. _prepareNextFile: function() {
  1452. var a, b = this, c = b.request("fetch-file"), d = b.pending;
  1453. c && (a = b.request("before-send-file", c, function() {
  1454. return c.getStatus() === h.QUEUED ? (b.owner.trigger("uploadStart", c),
  1455. c.setStatus(h.PROGRESS),
  1456. c) : b._finishFile(c)
  1457. }),
  1458. a.done(function() {
  1459. var b = f.inArray(a, d);
  1460. ~b && d.splice(b, 1, c)
  1461. }),
  1462. a.fail(function(a) {
  1463. c.setStatus(h.ERROR, a),
  1464. b.owner.trigger("uploadError", c, a),
  1465. b.owner.trigger("uploadComplete", c)
  1466. }),
  1467. d.push(a))
  1468. },
  1469. _popBlock: function(a) {
  1470. var b = f.inArray(a, this.pool);
  1471. this.pool.splice(b, 1),
  1472. a.file.remaning--,
  1473. this.remaning--
  1474. },
  1475. _startSend: function(b) {
  1476. var c, d = this, e = b.file;
  1477. d.pool.push(b),
  1478. d.remaning++,
  1479. b.blob = 1 === b.chunks ? e.source : e.source.slice(b.start, b.end),
  1480. c = d.request("before-send", b, function() {
  1481. e.getStatus() === h.PROGRESS ? d._doSend(b) : (d._popBlock(b),
  1482. a.nextTick(d.__tick))
  1483. }),
  1484. c.fail(function() {
  1485. 1 === e.remaning ? d._finishFile(e).always(function() {
  1486. b.percentage = 1,
  1487. d._popBlock(b),
  1488. d.owner.trigger("uploadComplete", e),
  1489. a.nextTick(d.__tick)
  1490. }) : (b.percentage = 1,
  1491. d._popBlock(b),
  1492. a.nextTick(d.__tick))
  1493. })
  1494. },
  1495. _doSend: function(b) {
  1496. var c, e, g = this, i = g.owner, j = g.options, k = b.file, l = new d(j), m = f.extend({}, j.formData), n = f.extend({}, j.headers);
  1497. b.transport = l,
  1498. l.on("destroy", function() {
  1499. delete b.transport,
  1500. g._popBlock(b),
  1501. a.nextTick(g.__tick)
  1502. }),
  1503. l.on("progress", function(a) {
  1504. var c = 0
  1505. , d = 0;
  1506. c = b.percentage = a,
  1507. b.chunks > 1 && (f.each(k.blocks, function(a, b) {
  1508. d += (b.percentage || 0) * (b.end - b.start)
  1509. }),
  1510. c = d / k.size),
  1511. i.trigger("uploadProgress", k, c || 0)
  1512. }),
  1513. c = function(a) {
  1514. var c;
  1515. return e = l.getResponseAsJson() || {},
  1516. e._raw = l.getResponse(),
  1517. c = function(b) {
  1518. a = b
  1519. }
  1520. ,
  1521. i.trigger("uploadAccept", b, e, c) || (a = a || "server"),
  1522. a
  1523. }
  1524. ,
  1525. l.on("error", function(a, d) {
  1526. b.retried = b.retried || 0,
  1527. b.chunks > 1 && ~"http,abort".indexOf(a) && b.retried < j.chunkRetry ? (b.retried++,
  1528. l.send()) : (d || "server" !== a || (a = c(a)),
  1529. k.setStatus(h.ERROR, a),
  1530. i.trigger("uploadError", k, a),
  1531. i.trigger("uploadComplete", k))
  1532. }),
  1533. l.on("load", function() {
  1534. var a;
  1535. return (a = c()) ? void l.trigger("error", a, !0) : void (1 === k.remaning ? g._finishFile(k, e) : l.destroy())
  1536. }),
  1537. m = f.extend(m, {
  1538. id: k.id,
  1539. name: k.name,
  1540. type: k.type,
  1541. lastModifiedDate: k.lastModifiedDate,
  1542. size: k.size
  1543. }),
  1544. b.chunks > 1 && f.extend(m, {
  1545. chunks: b.chunks,
  1546. chunk: b.chunk
  1547. }),
  1548. i.trigger("uploadBeforeSend", b, m, n),
  1549. l.appendBlob(j.fileVal, b.blob, k.name),
  1550. l.append(m),
  1551. l.setRequestHeader(n),
  1552. l.send()
  1553. },
  1554. _finishFile: function(a, b, c) {
  1555. var d = this.owner;
  1556. return d.request("after-send-file", arguments, function() {
  1557. a.setStatus(h.COMPLETE),
  1558. d.trigger("uploadSuccess", a, b, c)
  1559. }).fail(function(b) {
  1560. a.getStatus() === h.PROGRESS && a.setStatus(h.ERROR, b),
  1561. d.trigger("uploadError", a, b)
  1562. }).always(function() {
  1563. d.trigger("uploadComplete", a)
  1564. })
  1565. }
  1566. })
  1567. }),
  1568. b("widgets/validator", ["base", "uploader", "file", "widgets/widget"], function(a, b, c) {
  1569. var d, e = a.$, f = {};
  1570. return d = {
  1571. addValidator: function(a, b) {
  1572. f[a] = b
  1573. },
  1574. removeValidator: function(a) {
  1575. delete f[a]
  1576. }
  1577. },
  1578. b.register({
  1579. init: function() {
  1580. var a = this;
  1581. e.each(f, function() {
  1582. this.call(a.owner)
  1583. })
  1584. }
  1585. }),
  1586. d.addValidator("fileNumLimit", function() {
  1587. var a = this
  1588. , b = a.options
  1589. , c = 0
  1590. , d = b.fileNumLimit >> 0
  1591. , e = !0;
  1592. d && (a.on("beforeFileQueued", function(a) {
  1593. return c >= d && e && (e = !1,
  1594. this.trigger("error", "Q_EXCEED_NUM_LIMIT", d, a),
  1595. setTimeout(function() {
  1596. e = !0
  1597. }, 1)),
  1598. c >= d ? !1 : !0
  1599. }),
  1600. a.on("fileQueued", function() {
  1601. c++
  1602. }),
  1603. a.on("fileDequeued", function() {
  1604. c--
  1605. }),
  1606. a.on("uploadFinished", function() {
  1607. c = 0
  1608. }))
  1609. }),
  1610. d.addValidator("fileSizeLimit", function() {
  1611. var a = this
  1612. , b = a.options
  1613. , c = 0
  1614. , d = b.fileSizeLimit >> 0
  1615. , e = !0;
  1616. d && (a.on("beforeFileQueued", function(a) {
  1617. var b = c + a.size > d;
  1618. return b && e && (e = !1,
  1619. this.trigger("error", "Q_EXCEED_SIZE_LIMIT", d, a),
  1620. setTimeout(function() {
  1621. e = !0
  1622. }, 1)),
  1623. b ? !1 : !0
  1624. }),
  1625. a.on("fileQueued", function(a) {
  1626. c += a.size
  1627. }),
  1628. a.on("fileDequeued", function(a) {
  1629. c -= a.size
  1630. }),
  1631. a.on("uploadFinished", function() {
  1632. c = 0
  1633. }))
  1634. }),
  1635. d.addValidator("fileSingleSizeLimit", function() {
  1636. var a = this
  1637. , b = a.options
  1638. , d = b.fileSingleSizeLimit;
  1639. d && a.on("beforeFileQueued", function(a) {
  1640. return a.size > d ? (a.setStatus(c.Status.INVALID, "exceed_size"),
  1641. this.trigger("error", "F_EXCEED_SIZE", a),
  1642. !1) : void 0
  1643. })
  1644. }),
  1645. d.addValidator("duplicate", function() {
  1646. function a(a) {
  1647. for (var b, c = 0, d = 0, e = a.length; e > d; d++)
  1648. b = a.charCodeAt(d),
  1649. c = b + (c << 6) + (c << 16) - c;
  1650. return c
  1651. }
  1652. var b = this
  1653. , c = b.options
  1654. , d = {};
  1655. c.duplicate || (b.on("beforeFileQueued", function(b) {
  1656. var c = b.__hash || (b.__hash = a(b.name + b.size + b.lastModifiedDate));
  1657. return d[c] ? (this.trigger("error", "F_DUPLICATE", b),
  1658. !1) : void 0
  1659. }),
  1660. b.on("fileQueued", function(a) {
  1661. var b = a.__hash;
  1662. b && (d[b] = !0)
  1663. }),
  1664. b.on("fileDequeued", function(a) {
  1665. var b = a.__hash;
  1666. b && delete d[b]
  1667. }))
  1668. }),
  1669. d
  1670. }),
  1671. b("runtime/compbase", [], function() {
  1672. function a(a, b) {
  1673. this.owner = a,
  1674. this.options = a.options,
  1675. this.getRuntime = function() {
  1676. return b
  1677. }
  1678. ,
  1679. this.getRuid = function() {
  1680. return b.uid
  1681. }
  1682. ,
  1683. this.trigger = function() {
  1684. return a.trigger.apply(a, arguments)
  1685. }
  1686. }
  1687. return a
  1688. }),
  1689. b("runtime/html5/runtime", ["base", "runtime/runtime", "runtime/compbase"], function(b, c, d) {
  1690. function e() {
  1691. var a = {}
  1692. , d = this
  1693. , e = this.destory;
  1694. c.apply(d, arguments),
  1695. d.type = f,
  1696. d.exec = function(c, e) {
  1697. var f, h = this, i = h.uid, j = b.slice(arguments, 2);
  1698. return g[c] && (f = a[i] = a[i] || new g[c](h,d),
  1699. f[e]) ? f[e].apply(f, j) : void 0
  1700. }
  1701. ,
  1702. d.destory = function() {
  1703. return e && e.apply(this, arguments)
  1704. }
  1705. }
  1706. var f = "html5"
  1707. , g = {};
  1708. return b.inherits(c, {
  1709. constructor: e,
  1710. init: function() {
  1711. var a = this;
  1712. setTimeout(function() {
  1713. a.trigger("ready")
  1714. }, 1)
  1715. }
  1716. }),
  1717. e.register = function(a, c) {
  1718. var e = g[a] = b.inherits(d, c);
  1719. return e
  1720. }
  1721. ,
  1722. a.Blob && a.FileReader && a.DataView && c.addRuntime(f, e),
  1723. e
  1724. }),
  1725. b("runtime/html5/blob", ["runtime/html5/runtime", "lib/blob"], function(a, b) {
  1726. return a.register("Blob", {
  1727. slice: function(a, c) {
  1728. var d = this.owner.source
  1729. , e = d.slice || d.webkitSlice || d.mozSlice;
  1730. return d = e.call(d, a, c),
  1731. new b(this.getRuid(),d)
  1732. }
  1733. })
  1734. }),
  1735. b("runtime/html5/dnd", ["base", "runtime/html5/runtime", "lib/file"], function(a, b, c) {
  1736. var d = a.$
  1737. , e = "webuploader-dnd-";
  1738. return b.register("DragAndDrop", {
  1739. init: function() {
  1740. var b = this.elem = this.options.container;
  1741. this.dragEnterHandler = a.bindFn(this._dragEnterHandler, this),
  1742. this.dragOverHandler = a.bindFn(this._dragOverHandler, this),
  1743. this.dragLeaveHandler = a.bindFn(this._dragLeaveHandler, this),
  1744. this.dropHandler = a.bindFn(this._dropHandler, this),
  1745. this.dndOver = !1,
  1746. b.on("dragenter", this.dragEnterHandler),
  1747. b.on("dragover", this.dragOverHandler),
  1748. b.on("dragleave", this.dragLeaveHandler),
  1749. b.on("drop", this.dropHandler),
  1750. this.options.disableGlobalDnd && (d(document).on("dragover", this.dragOverHandler),
  1751. d(document).on("drop", this.dropHandler))
  1752. },
  1753. _dragEnterHandler: function(a) {
  1754. var b, c = this, d = c._denied || !1;
  1755. return a = a.originalEvent || a,
  1756. c.dndOver || (c.dndOver = !0,
  1757. b = a.dataTransfer.items,
  1758. b && b.length && (c._denied = d = !c.trigger("accept", b)),
  1759. c.elem.addClass(e + "over"),
  1760. c.elem[d ? "addClass" : "removeClass"](e + "denied")),
  1761. a.dataTransfer.dropEffect = d ? "none" : "copy",
  1762. !1
  1763. },
  1764. _dragOverHandler: function(a) {
  1765. var b = this.elem.parent().get(0);
  1766. return b && !d.contains(b, a.currentTarget) ? !1 : (clearTimeout(this._leaveTimer),
  1767. this._dragEnterHandler.call(this, a),
  1768. !1)
  1769. },
  1770. _dragLeaveHandler: function() {
  1771. var a, b = this;
  1772. return a = function() {
  1773. b.dndOver = !1,
  1774. b.elem.removeClass(e + "over " + e + "denied")
  1775. }
  1776. ,
  1777. clearTimeout(b._leaveTimer),
  1778. b._leaveTimer = setTimeout(a, 100),
  1779. !1
  1780. },
  1781. _dropHandler: function(a) {
  1782. var b = this
  1783. , f = b.getRuid()
  1784. , g = b.elem.parent().get(0);
  1785. return g && !d.contains(g, a.currentTarget) ? !1 : (b._getTansferFiles(a, function(a) {
  1786. b.trigger("drop", d.map(a, function(a) {
  1787. return new c(f,a)
  1788. }))
  1789. }),
  1790. b.dndOver = !1,
  1791. b.elem.removeClass(e + "over"),
  1792. !1)
  1793. },
  1794. _getTansferFiles: function(b, c) {
  1795. var d, e, f, g, h, i, j, k, l = [], m = [];
  1796. for (b = b.originalEvent || b,
  1797. f = b.dataTransfer,
  1798. d = f.items,
  1799. e = f.files,
  1800. k = !(!d || !d[0].webkitGetAsEntry),
  1801. i = 0,
  1802. j = e.length; j > i; i++)
  1803. g = e[i],
  1804. h = d && d[i],
  1805. k && h.webkitGetAsEntry().isDirectory ? m.push(this._traverseDirectoryTree(h.webkitGetAsEntry(), l)) : l.push(g);
  1806. a.when.apply(a, m).done(function() {
  1807. l.length && c(l)
  1808. })
  1809. },
  1810. _traverseDirectoryTree: function(b, c) {
  1811. var d = a.Deferred()
  1812. , e = this;
  1813. return b.isFile ? b.file(function(a) {
  1814. c.push(a),
  1815. d.resolve()
  1816. }) : b.isDirectory && b.createReader().readEntries(function(b) {
  1817. var f, g = b.length, h = [], i = [];
  1818. for (f = 0; g > f; f++)
  1819. h.push(e._traverseDirectoryTree(b[f], i));
  1820. a.when.apply(a, h).then(function() {
  1821. c.push.apply(c, i),
  1822. d.resolve()
  1823. }, d.reject)
  1824. }),
  1825. d.promise()
  1826. },
  1827. destroy: function() {
  1828. var a = this.elem;
  1829. a.off("dragenter", this.dragEnterHandler),
  1830. a.off("dragover", this.dragEnterHandler),
  1831. a.off("dragleave", this.dragLeaveHandler),
  1832. a.off("drop", this.dropHandler),
  1833. this.options.disableGlobalDnd && (d(document).off("dragover", this.dragOverHandler),
  1834. d(document).off("drop", this.dropHandler))
  1835. }
  1836. })
  1837. }),
  1838. b("runtime/html5/filepaste", ["base", "runtime/html5/runtime", "lib/file"], function(a, b, c) {
  1839. return b.register("FilePaste", {
  1840. init: function() {
  1841. var b, c, d, e, f = this.options, g = this.elem = f.container, h = ".*";
  1842. if (f.accept) {
  1843. for (b = [],
  1844. c = 0,
  1845. d = f.accept.length; d > c; c++)
  1846. e = f.accept[c].mimeTypes,
  1847. e && b.push(e);
  1848. b.length && (h = b.join(","),
  1849. h = h.replace(/,/g, "|").replace(/\*/g, ".*"))
  1850. }
  1851. this.accept = h = new RegExp(h,"i"),
  1852. this.hander = a.bindFn(this._pasteHander, this),
  1853. g.on("paste", this.hander)
  1854. },
  1855. _pasteHander: function(a) {
  1856. var b, d, e, f, g, h = [], i = this.getRuid();
  1857. for (a = a.originalEvent || a,
  1858. b = a.clipboardData.items,
  1859. f = 0,
  1860. g = b.length; g > f; f++)
  1861. d = b[f],
  1862. "file" === d.kind && (e = d.getAsFile()) && h.push(new c(i,e));
  1863. h.length && (a.preventDefault(),
  1864. a.stopPropagation(),
  1865. this.trigger("paste", h))
  1866. },
  1867. destroy: function() {
  1868. this.elem.off("paste", this.hander)
  1869. }
  1870. })
  1871. }),
  1872. b("runtime/html5/filepicker", ["base", "runtime/html5/runtime"], function(a, b) {
  1873. var c = a.$;
  1874. return b.register("FilePicker", {
  1875. init: function() {
  1876. var a, b, d, e, f = this.getRuntime().getContainer(), g = this, h = g.owner, i = g.options, j = c(document.createElement("label")), k = c(document.createElement("input"));
  1877. if (k.attr("type", "file"),
  1878. k.attr("name", i.name),
  1879. k.addClass("webuploader-element-invisible"),
  1880. j.on("click", function() {
  1881. k.trigger("click")
  1882. }),
  1883. j.css({
  1884. opacity: 0,
  1885. width: "100%",
  1886. height: "100%",
  1887. display: "block",
  1888. cursor: "pointer",
  1889. background: "#ffffff"
  1890. }),
  1891. i.accept && i.accept.length > 0) {
  1892. for (a = [],
  1893. b = 0,
  1894. d = i.accept.length; d > b; b++)
  1895. a.push(i.accept[b].mimeTypes);
  1896. k.attr("accept", a.join(","))
  1897. }
  1898. f.append(k),
  1899. f.append(j),
  1900. e = function(a) {
  1901. h.trigger(a.type)
  1902. }
  1903. ,
  1904. k.on("change", function(a) {
  1905. var b, d = arguments.callee;
  1906. g.files = a.target.files,
  1907. b = this.cloneNode(!0),
  1908. this.parentNode.replaceChild(b, this),
  1909. k.off(),
  1910. k = c(b).on("change", d).on("mouseenter mouseleave", e),
  1911. h.trigger("change")
  1912. }),
  1913. j.on("mouseenter mouseleave", e)
  1914. },
  1915. getFiles: function() {
  1916. return this.files
  1917. },
  1918. destroy: function() {}
  1919. })
  1920. }),
  1921. b("runtime/html5/util", ["base"], function(b) {
  1922. var c = a.createObjectURL && a || a.URL && URL.revokeObjectURL && URL || a.webkitURL
  1923. , d = b.noop
  1924. , e = d;
  1925. return c && (d = function() {
  1926. return c.createObjectURL.apply(c, arguments)
  1927. }
  1928. ,
  1929. e = function() {
  1930. return c.revokeObjectURL.apply(c, arguments)
  1931. }
  1932. ),
  1933. {
  1934. createObjectURL: d,
  1935. revokeObjectURL: e,
  1936. dataURL2Blob: function(a) {
  1937. var b, c, d, e, f, g;
  1938. for (g = a.split(","),
  1939. b = ~g[0].indexOf("base64") ? atob(g[1]) : decodeURIComponent(g[1]),
  1940. d = new ArrayBuffer(b.length),
  1941. c = new Uint8Array(d),
  1942. e = 0; e < b.length; e++)
  1943. c[e] = b.charCodeAt(e);
  1944. return f = g[0].split(":")[1].split(";")[0],
  1945. this.arrayBufferToBlob(d, f)
  1946. },
  1947. dataURL2ArrayBuffer: function(a) {
  1948. var b, c, d, e;
  1949. for (e = a.split(","),
  1950. b = ~e[0].indexOf("base64") ? atob(e[1]) : decodeURIComponent(e[1]),
  1951. c = new Uint8Array(b.length),
  1952. d = 0; d < b.length; d++)
  1953. c[d] = b.charCodeAt(d);
  1954. return c.buffer
  1955. },
  1956. arrayBufferToBlob: function(b, c) {
  1957. var d, e = a.BlobBuilder || a.WebKitBlobBuilder;
  1958. return e ? (d = new e,
  1959. d.append(b),
  1960. d.getBlob(c)) : new Blob([b],c ? {
  1961. type: c
  1962. } : {})
  1963. },
  1964. canvasToDataUrl: function(a, b, c) {
  1965. return a.toDataURL(b, c / 100)
  1966. },
  1967. parseMeta: function(a, b) {
  1968. b(!1, {})
  1969. },
  1970. updateImageHead: function(a) {
  1971. return a
  1972. }
  1973. }
  1974. }),
  1975. b("runtime/html5/imagemeta", ["runtime/html5/util"], function(a) {
  1976. var b;
  1977. return b = {
  1978. parsers: {
  1979. 65505: []
  1980. },
  1981. maxMetaDataSize: 262144,
  1982. parse: function(a, b) {
  1983. var c = this
  1984. , d = new FileReader;
  1985. d.onload = function() {
  1986. b(!1, c._parse(this.result)),
  1987. d = d.onload = d.onerror = null
  1988. }
  1989. ,
  1990. d.onerror = function(a) {
  1991. b(a.message),
  1992. d = d.onload = d.onerror = null
  1993. }
  1994. ,
  1995. a = a.slice(0, c.maxMetaDataSize),
  1996. d.readAsArrayBuffer(a.getSource())
  1997. },
  1998. _parse: function(a, c) {
  1999. if (!(a.byteLength < 6)) {
  2000. var d, e, f, g, h = new DataView(a), i = 2, j = h.byteLength - 4, k = i, l = {};
  2001. if (65496 === h.getUint16(0)) {
  2002. for (; j > i && (d = h.getUint16(i),
  2003. d >= 65504 && 65519 >= d || 65534 === d) && (e = h.getUint16(i + 2) + 2,
  2004. !(i + e > h.byteLength)); ) {
  2005. if (f = b.parsers[d],
  2006. !c && f)
  2007. for (g = 0; g < f.length; g += 1)
  2008. f[g].call(b, h, i, e, l);
  2009. i += e,
  2010. k = i
  2011. }
  2012. k > 6 && (l.imageHead = a.slice ? a.slice(2, k) : new Uint8Array(a).subarray(2, k))
  2013. }
  2014. return l
  2015. }
  2016. },
  2017. updateImageHead: function(a, b) {
  2018. var c, d, e, f = this._parse(a, !0);
  2019. return e = 2,
  2020. f.imageHead && (e = 2 + f.imageHead.byteLength),
  2021. d = a.slice ? a.slice(e) : new Uint8Array(a).subarray(e),
  2022. c = new Uint8Array(b.byteLength + 2 + d.byteLength),
  2023. c[0] = 255,
  2024. c[1] = 216,
  2025. c.set(new Uint8Array(b), 2),
  2026. c.set(new Uint8Array(d), b.byteLength + 2),
  2027. c.buffer
  2028. }
  2029. },
  2030. a.parseMeta = function() {
  2031. return b.parse.apply(b, arguments)
  2032. }
  2033. ,
  2034. a.updateImageHead = function() {
  2035. return b.updateImageHead.apply(b, arguments)
  2036. }
  2037. ,
  2038. b
  2039. }),
  2040. b("runtime/html5/imagemeta/exif", ["base", "runtime/html5/imagemeta"], function(a, b) {
  2041. var c = {};
  2042. return c.ExifMap = function() {
  2043. return this
  2044. }
  2045. ,
  2046. c.ExifMap.prototype.map = {
  2047. Orientation: 274
  2048. },
  2049. c.ExifMap.prototype.get = function(a) {
  2050. return this[a] || this[this.map[a]]
  2051. }
  2052. ,
  2053. c.exifTagTypes = {
  2054. 1: {
  2055. getValue: function(a, b) {
  2056. return a.getUint8(b)
  2057. },
  2058. size: 1
  2059. },
  2060. 2: {
  2061. getValue: function(a, b) {
  2062. return String.fromCharCode(a.getUint8(b))
  2063. },
  2064. size: 1,
  2065. ascii: !0
  2066. },
  2067. 3: {
  2068. getValue: function(a, b, c) {
  2069. return a.getUint16(b, c)
  2070. },
  2071. size: 2
  2072. },
  2073. 4: {
  2074. getValue: function(a, b, c) {
  2075. return a.getUint32(b, c)
  2076. },
  2077. size: 4
  2078. },
  2079. 5: {
  2080. getValue: function(a, b, c) {
  2081. return a.getUint32(b, c) / a.getUint32(b + 4, c)
  2082. },
  2083. size: 8
  2084. },
  2085. 9: {
  2086. getValue: function(a, b, c) {
  2087. return a.getInt32(b, c)
  2088. },
  2089. size: 4
  2090. },
  2091. 10: {
  2092. getValue: function(a, b, c) {
  2093. return a.getInt32(b, c) / a.getInt32(b + 4, c)
  2094. },
  2095. size: 8
  2096. }
  2097. },
  2098. c.exifTagTypes[7] = c.exifTagTypes[1],
  2099. c.getExifValue = function(b, d, e, f, g, h) {
  2100. var i, j, k, l, m, n, o = c.exifTagTypes[f];
  2101. if (!o)
  2102. return void a.log("Invalid Exif data: Invalid tag type.");
  2103. if (i = o.size * g,
  2104. j = i > 4 ? d + b.getUint32(e + 8, h) : e + 8,
  2105. j + i > b.byteLength)
  2106. return void a.log("Invalid Exif data: Invalid data offset.");
  2107. if (1 === g)
  2108. return o.getValue(b, j, h);
  2109. for (k = [],
  2110. l = 0; g > l; l += 1)
  2111. k[l] = o.getValue(b, j + l * o.size, h);
  2112. if (o.ascii) {
  2113. for (m = "",
  2114. l = 0; l < k.length && (n = k[l],
  2115. "\x00" !== n); l += 1)
  2116. m += n;
  2117. return m
  2118. }
  2119. return k
  2120. }
  2121. ,
  2122. c.parseExifTag = function(a, b, d, e, f) {
  2123. var g = a.getUint16(d, e);
  2124. f.exif[g] = c.getExifValue(a, b, d, a.getUint16(d + 2, e), a.getUint32(d + 4, e), e)
  2125. }
  2126. ,
  2127. c.parseExifTags = function(b, c, d, e, f) {
  2128. var g, h, i;
  2129. if (d + 6 > b.byteLength)
  2130. return void a.log("Invalid Exif data: Invalid directory offset.");
  2131. if (g = b.getUint16(d, e),
  2132. h = d + 2 + 12 * g,
  2133. h + 4 > b.byteLength)
  2134. return void a.log("Invalid Exif data: Invalid directory size.");
  2135. for (i = 0; g > i; i += 1)
  2136. this.parseExifTag(b, c, d + 2 + 12 * i, e, f);
  2137. return b.getUint32(h, e)
  2138. }
  2139. ,
  2140. c.parseExifData = function(b, d, e, f) {
  2141. var g, h, i = d + 10;
  2142. if (1165519206 === b.getUint32(d + 4)) {
  2143. if (i + 8 > b.byteLength)
  2144. return void a.log("Invalid Exif data: Invalid segment size.");
  2145. if (0 !== b.getUint16(d + 8))
  2146. return void a.log("Invalid Exif data: Missing byte alignment offset.");
  2147. switch (b.getUint16(i)) {
  2148. case 18761:
  2149. g = !0;
  2150. break;
  2151. case 19789:
  2152. g = !1;
  2153. break;
  2154. default:
  2155. return void a.log("Invalid Exif data: Invalid byte alignment marker.")
  2156. }
  2157. if (42 !== b.getUint16(i + 2, g))
  2158. return void a.log("Invalid Exif data: Missing TIFF marker.");
  2159. h = b.getUint32(i + 4, g),
  2160. f.exif = new c.ExifMap,
  2161. h = c.parseExifTags(b, i, i + h, g, f)
  2162. }
  2163. }
  2164. ,
  2165. b.parsers[65505].push(c.parseExifData),
  2166. c
  2167. }),
  2168. b("runtime/html5/jpegencoder", [], function() {
  2169. function a(a) {
  2170. function b(a) {
  2171. for (var b = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], c = 0; 64 > c; c++) {
  2172. var d = y((b[c] * a + 50) / 100);
  2173. 1 > d ? d = 1 : d > 255 && (d = 255),
  2174. z[P[c]] = d
  2175. }
  2176. for (var e = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], f = 0; 64 > f; f++) {
  2177. var g = y((e[f] * a + 50) / 100);
  2178. 1 > g ? g = 1 : g > 255 && (g = 255),
  2179. A[P[f]] = g
  2180. }
  2181. for (var h = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], i = 0, j = 0; 8 > j; j++)
  2182. for (var k = 0; 8 > k; k++)
  2183. B[i] = 1 / (z[P[i]] * h[j] * h[k] * 8),
  2184. C[i] = 1 / (A[P[i]] * h[j] * h[k] * 8),
  2185. i++
  2186. }
  2187. function c(a, b) {
  2188. for (var c = 0, d = 0, e = new Array, f = 1; 16 >= f; f++) {
  2189. for (var g = 1; g <= a[f]; g++)
  2190. e[b[d]] = [],
  2191. e[b[d]][0] = c,
  2192. e[b[d]][1] = f,
  2193. d++,
  2194. c++;
  2195. c *= 2
  2196. }
  2197. return e
  2198. }
  2199. function d() {
  2200. t = c(Q, R),
  2201. u = c(U, V),
  2202. v = c(S, T),
  2203. w = c(W, X)
  2204. }
  2205. function e() {
  2206. for (var a = 1, b = 2, c = 1; 15 >= c; c++) {
  2207. for (var d = a; b > d; d++)
  2208. E[32767 + d] = c,
  2209. D[32767 + d] = [],
  2210. D[32767 + d][1] = c,
  2211. D[32767 + d][0] = d;
  2212. for (var e = -(b - 1); -a >= e; e++)
  2213. E[32767 + e] = c,
  2214. D[32767 + e] = [],
  2215. D[32767 + e][1] = c,
  2216. D[32767 + e][0] = b - 1 + e;
  2217. a <<= 1,
  2218. b <<= 1
  2219. }
  2220. }
  2221. function f() {
  2222. for (var a = 0; 256 > a; a++)
  2223. O[a] = 19595 * a,
  2224. O[a + 256 >> 0] = 38470 * a,
  2225. O[a + 512 >> 0] = 7471 * a + 32768,
  2226. O[a + 768 >> 0] = -11059 * a,
  2227. O[a + 1024 >> 0] = -21709 * a,
  2228. O[a + 1280 >> 0] = 32768 * a + 8421375,
  2229. O[a + 1536 >> 0] = -27439 * a,
  2230. O[a + 1792 >> 0] = -5329 * a
  2231. }
  2232. function g(a) {
  2233. for (var b = a[0], c = a[1] - 1; c >= 0; )
  2234. b & 1 << c && (I |= 1 << J),
  2235. c--,
  2236. J--,
  2237. 0 > J && (255 == I ? (h(255),
  2238. h(0)) : h(I),
  2239. J = 7,
  2240. I = 0)
  2241. }
  2242. function h(a) {
  2243. H.push(N[a])
  2244. }
  2245. function i(a) {
  2246. h(a >> 8 & 255),
  2247. h(255 & a)
  2248. }
  2249. function j(a, b) {
  2250. var c, d, e, f, g, h, i, j, k, l = 0, m = 8, n = 64;
  2251. for (k = 0; m > k; ++k) {
  2252. c = a[l],
  2253. d = a[l + 1],
  2254. e = a[l + 2],
  2255. f = a[l + 3],
  2256. g = a[l + 4],
  2257. h = a[l + 5],
  2258. i = a[l + 6],
  2259. j = a[l + 7];
  2260. var o = c + j
  2261. , p = c - j
  2262. , q = d + i
  2263. , r = d - i
  2264. , s = e + h
  2265. , t = e - h
  2266. , u = f + g
  2267. , v = f - g
  2268. , w = o + u
  2269. , x = o - u
  2270. , y = q + s
  2271. , z = q - s;
  2272. a[l] = w + y,
  2273. a[l + 4] = w - y;
  2274. var A = .707106781 * (z + x);
  2275. a[l + 2] = x + A,
  2276. a[l + 6] = x - A,
  2277. w = v + t,
  2278. y = t + r,
  2279. z = r + p;
  2280. var B = .382683433 * (w - z)
  2281. , C = .5411961 * w + B
  2282. , D = 1.306562965 * z + B
  2283. , E = .707106781 * y
  2284. , G = p + E
  2285. , H = p - E;
  2286. a[l + 5] = H + C,
  2287. a[l + 3] = H - C,
  2288. a[l + 1] = G + D,
  2289. a[l + 7] = G - D,
  2290. l += 8
  2291. }
  2292. for (l = 0,
  2293. k = 0; m > k; ++k) {
  2294. c = a[l],
  2295. d = a[l + 8],
  2296. e = a[l + 16],
  2297. f = a[l + 24],
  2298. g = a[l + 32],
  2299. h = a[l + 40],
  2300. i = a[l + 48],
  2301. j = a[l + 56];
  2302. var I = c + j
  2303. , J = c - j
  2304. , K = d + i
  2305. , L = d - i
  2306. , M = e + h
  2307. , N = e - h
  2308. , O = f + g
  2309. , P = f - g
  2310. , Q = I + O
  2311. , R = I - O
  2312. , S = K + M
  2313. , T = K - M;
  2314. a[l] = Q + S,
  2315. a[l + 32] = Q - S;
  2316. var U = .707106781 * (T + R);
  2317. a[l + 16] = R + U,
  2318. a[l + 48] = R - U,
  2319. Q = P + N,
  2320. S = N + L,
  2321. T = L + J;
  2322. var V = .382683433 * (Q - T)
  2323. , W = .5411961 * Q + V
  2324. , X = 1.306562965 * T + V
  2325. , Y = .707106781 * S
  2326. , Z = J + Y
  2327. , $ = J - Y;
  2328. a[l + 40] = $ + W,
  2329. a[l + 24] = $ - W,
  2330. a[l + 8] = Z + X,
  2331. a[l + 56] = Z - X,
  2332. l++
  2333. }
  2334. var _;
  2335. for (k = 0; n > k; ++k)
  2336. _ = a[k] * b[k],
  2337. F[k] = _ > 0 ? _ + .5 | 0 : _ - .5 | 0;
  2338. return F
  2339. }
  2340. function k() {
  2341. i(65504),
  2342. i(16),
  2343. h(74),
  2344. h(70),
  2345. h(73),
  2346. h(70),
  2347. h(0),
  2348. h(1),
  2349. h(1),
  2350. h(0),
  2351. i(1),
  2352. i(1),
  2353. h(0),
  2354. h(0)
  2355. }
  2356. function l(a, b) {
  2357. i(65472),
  2358. i(17),
  2359. h(8),
  2360. i(b),
  2361. i(a),
  2362. h(3),
  2363. h(1),
  2364. h(17),
  2365. h(0),
  2366. h(2),
  2367. h(17),
  2368. h(1),
  2369. h(3),
  2370. h(17),
  2371. h(1)
  2372. }
  2373. function m() {
  2374. i(65499),
  2375. i(132),
  2376. h(0);
  2377. for (var a = 0; 64 > a; a++)
  2378. h(z[a]);
  2379. h(1);
  2380. for (var b = 0; 64 > b; b++)
  2381. h(A[b])
  2382. }
  2383. function n() {
  2384. i(65476),
  2385. i(418),
  2386. h(0);
  2387. for (var a = 0; 16 > a; a++)
  2388. h(Q[a + 1]);
  2389. for (var b = 0; 11 >= b; b++)
  2390. h(R[b]);
  2391. h(16);
  2392. for (var c = 0; 16 > c; c++)
  2393. h(S[c + 1]);
  2394. for (var d = 0; 161 >= d; d++)
  2395. h(T[d]);
  2396. h(1);
  2397. for (var e = 0; 16 > e; e++)
  2398. h(U[e + 1]);
  2399. for (var f = 0; 11 >= f; f++)
  2400. h(V[f]);
  2401. h(17);
  2402. for (var g = 0; 16 > g; g++)
  2403. h(W[g + 1]);
  2404. for (var j = 0; 161 >= j; j++)
  2405. h(X[j])
  2406. }
  2407. function o() {
  2408. i(65498),
  2409. i(12),
  2410. h(3),
  2411. h(1),
  2412. h(0),
  2413. h(2),
  2414. h(17),
  2415. h(3),
  2416. h(17),
  2417. h(0),
  2418. h(63),
  2419. h(0)
  2420. }
  2421. function p(a, b, c, d, e) {
  2422. for (var f, h = e[0], i = e[240], k = 16, l = 63, m = 64, n = j(a, b), o = 0; m > o; ++o)
  2423. G[P[o]] = n[o];
  2424. var p = G[0] - c;
  2425. c = G[0],
  2426. 0 == p ? g(d[0]) : (f = 32767 + p,
  2427. g(d[E[f]]),
  2428. g(D[f]));
  2429. for (var q = 63; q > 0 && 0 == G[q]; q--)
  2430. ;
  2431. if (0 == q)
  2432. return g(h),
  2433. c;
  2434. for (var r, s = 1; q >= s; ) {
  2435. for (var t = s; 0 == G[s] && q >= s; ++s)
  2436. ;
  2437. var u = s - t;
  2438. if (u >= k) {
  2439. r = u >> 4;
  2440. for (var v = 1; r >= v; ++v)
  2441. g(i);
  2442. u = 15 & u
  2443. }
  2444. f = 32767 + G[s],
  2445. g(e[(u << 4) + E[f]]),
  2446. g(D[f]),
  2447. s++
  2448. }
  2449. return q != l && g(h),
  2450. c
  2451. }
  2452. function q() {
  2453. for (var a = String.fromCharCode, b = 0; 256 > b; b++)
  2454. N[b] = a(b)
  2455. }
  2456. function r(a) {
  2457. if (0 >= a && (a = 1),
  2458. a > 100 && (a = 100),
  2459. x != a) {
  2460. var c = 0;
  2461. c = Math.floor(50 > a ? 5e3 / a : 200 - 2 * a),
  2462. b(c),
  2463. x = a
  2464. }
  2465. }
  2466. function s() {
  2467. a || (a = 50),
  2468. q(),
  2469. d(),
  2470. e(),
  2471. f(),
  2472. r(a)
  2473. }
  2474. var t, u, v, w, x, y = (Math.round,
  2475. Math.floor), z = new Array(64), A = new Array(64), B = new Array(64), C = new Array(64), D = new Array(65535), E = new Array(65535), F = new Array(64), G = new Array(64), H = [], I = 0, J = 7, K = new Array(64), L = new Array(64), M = new Array(64), N = new Array(256), O = new Array(2048), P = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], Q = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], S = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], T = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], U = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], V = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], W = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], X = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  2476. this.encode = function(a, b) {
  2477. b && r(b),
  2478. H = new Array,
  2479. I = 0,
  2480. J = 7,
  2481. i(65496),
  2482. k(),
  2483. m(),
  2484. l(a.width, a.height),
  2485. n(),
  2486. o();
  2487. var c = 0
  2488. , d = 0
  2489. , e = 0;
  2490. I = 0,
  2491. J = 7,
  2492. this.encode.displayName = "_encode_";
  2493. for (var f, h, j, q, s, x, y, z, A, D = a.data, E = a.width, F = a.height, G = 4 * E, N = 0; F > N; ) {
  2494. for (f = 0; G > f; ) {
  2495. for (s = G * N + f,
  2496. x = s,
  2497. y = -1,
  2498. z = 0,
  2499. A = 0; 64 > A; A++)
  2500. z = A >> 3,
  2501. y = 4 * (7 & A),
  2502. x = s + z * G + y,
  2503. N + z >= F && (x -= G * (N + 1 + z - F)),
  2504. f + y >= G && (x -= f + y - G + 4),
  2505. h = D[x++],
  2506. j = D[x++],
  2507. q = D[x++],
  2508. K[A] = (O[h] + O[j + 256 >> 0] + O[q + 512 >> 0] >> 16) - 128,
  2509. L[A] = (O[h + 768 >> 0] + O[j + 1024 >> 0] + O[q + 1280 >> 0] >> 16) - 128,
  2510. M[A] = (O[h + 1280 >> 0] + O[j + 1536 >> 0] + O[q + 1792 >> 0] >> 16) - 128;
  2511. c = p(K, B, c, t, v),
  2512. d = p(L, C, d, u, w),
  2513. e = p(M, C, e, u, w),
  2514. f += 32
  2515. }
  2516. N += 8
  2517. }
  2518. if (J >= 0) {
  2519. var P = [];
  2520. P[1] = J + 1,
  2521. P[0] = (1 << J + 1) - 1,
  2522. g(P)
  2523. }
  2524. i(65497);
  2525. var Q = "data:image/jpeg;base64," + btoa(H.join(""));
  2526. return H = [],
  2527. Q
  2528. }
  2529. ,
  2530. s()
  2531. }
  2532. return a.encode = function(b, c) {
  2533. var d = new a(c);
  2534. return d.encode(b)
  2535. }
  2536. ,
  2537. a
  2538. }),
  2539. b("runtime/html5/androidpatch", ["runtime/html5/util", "runtime/html5/jpegencoder", "base"], function(a, b, c) {
  2540. var d, e = a.canvasToDataUrl;
  2541. a.canvasToDataUrl = function(a, f, g) {
  2542. var h, i, j, k, l;
  2543. return c.os.android ? ("image/jpeg" === f && "undefined" == typeof d && (k = e.apply(null, arguments),
  2544. l = k.split(","),
  2545. k = ~l[0].indexOf("base64") ? atob(l[1]) : decodeURIComponent(l[1]),
  2546. k = k.substring(0, 2),
  2547. d = 255 === k.charCodeAt(0) && 216 === k.charCodeAt(1)),
  2548. "image/jpeg" !== f || d ? e.apply(null, arguments) : (i = a.width,
  2549. j = a.height,
  2550. h = a.getContext("2d"),
  2551. b.encode(h.getImageData(0, 0, i, j), g))) : e.apply(null, arguments)
  2552. }
  2553. }),
  2554. b("runtime/html5/image", ["base", "runtime/html5/runtime", "runtime/html5/util"], function(a, b, c) {
  2555. var d = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D";
  2556. return b.register("Image", {
  2557. modified: !1,
  2558. init: function() {
  2559. var a = this
  2560. , b = new Image;
  2561. b.onload = function() {
  2562. a._info = {
  2563. type: a.type,
  2564. width: this.width,
  2565. height: this.height
  2566. },
  2567. a._metas || "image/jpeg" !== a.type ? a.owner.trigger("load") : c.parseMeta(a._blob, function(b, c) {
  2568. a._metas = c,
  2569. a.owner.trigger("load")
  2570. })
  2571. }
  2572. ,
  2573. b.onerror = function() {
  2574. a.owner.trigger("error")
  2575. }
  2576. ,
  2577. a._img = b
  2578. },
  2579. loadFromBlob: function(a) {
  2580. var b = this
  2581. , d = b._img;
  2582. b._blob = a,
  2583. b.type = a.type,
  2584. d.src = c.createObjectURL(a.getSource()),
  2585. b.owner.once("load", function() {
  2586. c.revokeObjectURL(d.src)
  2587. })
  2588. },
  2589. resize: function(a, b) {
  2590. var c = this._canvas || (this._canvas = document.createElement("canvas"));
  2591. this._resize(this._img, c, a, b),
  2592. this._blob = null,
  2593. this.modified = !0,
  2594. this.owner.trigger("complete")
  2595. },
  2596. getAsBlob: function(a) {
  2597. var b, d = this._blob, e = this.options;
  2598. if (a = a || this.type,
  2599. this.modified || this.type !== a) {
  2600. if (b = this._canvas,
  2601. "image/jpeg" === a) {
  2602. if (d = c.canvasToDataUrl(b, "image/jpeg", e.quality),
  2603. e.preserveHeaders && this._metas && this._metas.imageHead)
  2604. return d = c.dataURL2ArrayBuffer(d),
  2605. d = c.updateImageHead(d, this._metas.imageHead),
  2606. d = c.arrayBufferToBlob(d, a)
  2607. } else
  2608. d = c.canvasToDataUrl(b, a);
  2609. d = c.dataURL2Blob(d)
  2610. }
  2611. return d
  2612. },
  2613. getAsDataUrl: function(a) {
  2614. var b = this.options;
  2615. return a = a || this.type,
  2616. "image/jpeg" === a ? c.canvasToDataUrl(this._canvas, a, b.quality) : this._canvas.toDataURL(a)
  2617. },
  2618. getOrientation: function() {
  2619. return this._metas && this._metas.exif && this._metas.exif.get("Orientation") || 1
  2620. },
  2621. info: function(a) {
  2622. return a ? (this._info = a,
  2623. this) : this._info
  2624. },
  2625. meta: function(a) {
  2626. return a ? (this._meta = a,
  2627. this) : this._meta
  2628. },
  2629. destroy: function() {
  2630. var a = this._canvas;
  2631. this._img.onload = null,
  2632. a && (a.getContext("2d").clearRect(0, 0, a.width, a.height),
  2633. a.width = a.height = 0,
  2634. this._canvas = null),
  2635. this._img.src = d,
  2636. this._img = this._blob = null
  2637. },
  2638. _resize: function(a, b, c, d) {
  2639. var e, f, g, h, i, j = this.options, k = a.width, l = a.height, m = this.getOrientation();
  2640. ~[5, 6, 7, 8].indexOf(m) && (c ^= d,
  2641. d ^= c,
  2642. c ^= d),
  2643. e = Math[j.crop ? "max" : "min"](c / k, d / l),
  2644. j.allowMagnify || (e = Math.min(1, e)),
  2645. f = k * e,
  2646. g = l * e,
  2647. j.crop ? (b.width = c,
  2648. b.height = d) : (b.width = f,
  2649. b.height = g),
  2650. h = (b.width - f) / 2,
  2651. i = (b.height - g) / 2,
  2652. j.preserveHeaders || this._rotate2Orientaion(b, m),
  2653. this._renderImageToCanvas(b, a, h, i, f, g)
  2654. },
  2655. _rotate2Orientaion: function(a, b) {
  2656. var c = a.width
  2657. , d = a.height
  2658. , e = a.getContext("2d");
  2659. switch (b) {
  2660. case 5:
  2661. case 6:
  2662. case 7:
  2663. case 8:
  2664. a.width = d,
  2665. a.height = c
  2666. }
  2667. switch (b) {
  2668. case 2:
  2669. e.translate(c, 0),
  2670. e.scale(-1, 1);
  2671. break;
  2672. case 3:
  2673. e.translate(c, d),
  2674. e.rotate(Math.PI);
  2675. break;
  2676. case 4:
  2677. e.translate(0, d),
  2678. e.scale(1, -1);
  2679. break;
  2680. case 5:
  2681. e.rotate(.5 * Math.PI),
  2682. e.scale(1, -1);
  2683. break;
  2684. case 6:
  2685. e.rotate(.5 * Math.PI),
  2686. e.translate(0, -d);
  2687. break;
  2688. case 7:
  2689. e.rotate(.5 * Math.PI),
  2690. e.translate(c, -d),
  2691. e.scale(-1, 1);
  2692. break;
  2693. case 8:
  2694. e.rotate(-.5 * Math.PI),
  2695. e.translate(-c, 0)
  2696. }
  2697. },
  2698. _renderImageToCanvas: function() {
  2699. function b(a, b, c) {
  2700. var d, e, f, g = document.createElement("canvas"), h = g.getContext("2d"), i = 0, j = c, k = c;
  2701. for (g.width = 1,
  2702. g.height = c,
  2703. h.drawImage(a, 0, 0),
  2704. d = h.getImageData(0, 0, 1, c).data; k > i; )
  2705. e = d[4 * (k - 1) + 3],
  2706. 0 === e ? j = k : i = k,
  2707. k = j + i >> 1;
  2708. return f = k / c,
  2709. 0 === f ? 1 : f
  2710. }
  2711. function c(a) {
  2712. var b, c, d = a.naturalWidth, e = a.naturalHeight;
  2713. return d * e > 1048576 ? (b = document.createElement("canvas"),
  2714. b.width = b.height = 1,
  2715. c = b.getContext("2d"),
  2716. c.drawImage(a, -d + 1, 0),
  2717. 0 === c.getImageData(0, 0, 1, 1).data[3]) : !1
  2718. }
  2719. return a.os.ios ? a.os.ios >= 7 ? function(a, c, d, e, f, g) {
  2720. var h = c.naturalWidth
  2721. , i = c.naturalHeight
  2722. , j = b(c, h, i);
  2723. return a.getContext("2d").drawImage(c, 0, 0, h * j, i * j, d, e, f, g)
  2724. }
  2725. : function(a, d, e, f, g, h) {
  2726. var i, j, k, l, m, n, o, p = d.naturalWidth, q = d.naturalHeight, r = a.getContext("2d"), s = c(d), t = "image/jpeg" === this.type, u = 1024, v = 0, w = 0;
  2727. for (s && (p /= 2,
  2728. q /= 2),
  2729. r.save(),
  2730. i = document.createElement("canvas"),
  2731. i.width = i.height = u,
  2732. j = i.getContext("2d"),
  2733. k = t ? b(d, p, q) : 1,
  2734. l = Math.ceil(u * g / p),
  2735. m = Math.ceil(u * h / q / k); q > v; ) {
  2736. for (n = 0,
  2737. o = 0; p > n; )
  2738. j.clearRect(0, 0, u, u),
  2739. j.drawImage(d, -n, -v),
  2740. r.drawImage(i, 0, 0, u, u, e + o, f + w, l, m),
  2741. n += u,
  2742. o += l;
  2743. v += u,
  2744. w += m
  2745. }
  2746. r.restore(),
  2747. i = j = null
  2748. }
  2749. : function(a, b, c, d, e, f) {
  2750. a.getContext("2d").drawImage(b, c, d, e, f)
  2751. }
  2752. }()
  2753. })
  2754. }),
  2755. b("runtime/html5/transport", ["base", "runtime/html5/runtime"], function(a, b) {
  2756. var c = a.noop
  2757. , d = a.$;
  2758. return b.register("Transport", {
  2759. init: function() {
  2760. this._status = 0,
  2761. this._response = null
  2762. },
  2763. send: function() {
  2764. var b, c, e, f = this.owner, g = this.options, h = this._initAjax(), i = f._blob, j = g.server;
  2765. g.sendAsBinary ? (j += (/\?/.test(j) ? "&" : "?") + d.param(f._formData),
  2766. c = i.getSource()) : (b = new FormData,
  2767. d.each(f._formData, function(a, c) {
  2768. b.append(a, c)
  2769. }),
  2770. b.append(g.fileVal, i.getSource(), g.filename || f._formData.name || "")),
  2771. g.withCredentials && "withCredentials"in h ? (h.open(g.method, j, !0),
  2772. h.withCredentials = !0) : h.open(g.method, j),
  2773. this._setRequestHeader(h, g.headers),
  2774. c ? (h.overrideMimeType("application/octet-stream"),
  2775. a.os.android ? (e = new FileReader,
  2776. e.onload = function() {
  2777. h.send(this.result),
  2778. e = e.onload = null
  2779. }
  2780. ,
  2781. e.readAsArrayBuffer(c)) : h.send(c)) : h.send(b)
  2782. },
  2783. getResponse: function() {
  2784. return this._response
  2785. },
  2786. getResponseAsJson: function() {
  2787. return this._parseJson(this._response)
  2788. },
  2789. getStatus: function() {
  2790. return this._status
  2791. },
  2792. abort: function() {
  2793. var a = this._xhr;
  2794. a && (a.upload.onprogress = c,
  2795. a.onreadystatechange = c,
  2796. a.abort(),
  2797. this._xhr = a = null)
  2798. },
  2799. destroy: function() {
  2800. this.abort()
  2801. },
  2802. _initAjax: function() {
  2803. var a = this
  2804. , b = new XMLHttpRequest
  2805. , d = this.options;
  2806. return !d.withCredentials || "withCredentials"in b || "undefined" == typeof XDomainRequest || (b = new XDomainRequest),
  2807. b.upload.onprogress = function(b) {
  2808. var c = 0;
  2809. return b.lengthComputable && (c = b.loaded / b.total),
  2810. a.trigger("progress", c)
  2811. }
  2812. ,
  2813. b.onreadystatechange = function() {
  2814. return 4 === b.readyState ? (b.upload.onprogress = c,
  2815. b.onreadystatechange = c,
  2816. a._xhr = null,
  2817. a._status = b.status,
  2818. b.status >= 200 && b.status < 300 ? (a._response = b.responseText,
  2819. a.trigger("load")) : b.status >= 500 && b.status < 600 ? (a._response = b.responseText,
  2820. a.trigger("error", "server")) : a.trigger("error", a._status ? "http" : "abort")) : void 0
  2821. }
  2822. ,
  2823. a._xhr = b,
  2824. b
  2825. },
  2826. _setRequestHeader: function(a, b) {
  2827. return;
  2828. d.each(b, function(b, c) {
  2829. a.setRequestHeader(b, c)
  2830. })
  2831. },
  2832. _parseJson: function(a) {
  2833. var b;
  2834. try {
  2835. b = JSON.parse(a)
  2836. } catch (c) {
  2837. b = {}
  2838. }
  2839. return b
  2840. }
  2841. })
  2842. }),
  2843. b("runtime/flash/runtime", ["base", "runtime/runtime", "runtime/compbase"], function(b, c, d) {
  2844. function e() {
  2845. var a;
  2846. try {
  2847. a = navigator.plugins["Shockwave Flash"],
  2848. a = a.description
  2849. } catch (b) {
  2850. try {
  2851. a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")
  2852. } catch (c) {
  2853. a = "0.0"
  2854. }
  2855. }
  2856. return a = a.match(/\d+/g),
  2857. parseFloat(a[0] + "." + a[1], 10)
  2858. }
  2859. function f() {
  2860. function d(a, b) {
  2861. var c, d, e = a.type || a;
  2862. c = e.split("::"),
  2863. d = c[0],
  2864. e = c[1],
  2865. "Ready" === e && d === j.uid ? j.trigger("ready") : f[d] && f[d].trigger(e.toLowerCase(), a, b)
  2866. }
  2867. var e = {}
  2868. , f = {}
  2869. , g = this.destory
  2870. , j = this
  2871. , k = b.guid("webuploader_");
  2872. c.apply(j, arguments),
  2873. j.type = h,
  2874. j.exec = function(a, c) {
  2875. var d, g = this, h = g.uid, k = b.slice(arguments, 2);
  2876. return f[h] = g,
  2877. i[a] && (e[h] || (e[h] = new i[a](g,j)),
  2878. d = e[h],
  2879. d[c]) ? d[c].apply(d, k) : j.flashExec.apply(g, arguments)
  2880. }
  2881. ,
  2882. a[k] = function() {
  2883. var a = arguments;
  2884. setTimeout(function() {
  2885. d.apply(null, a)
  2886. }, 1)
  2887. }
  2888. ,
  2889. this.jsreciver = k,
  2890. this.destory = function() {
  2891. return g && g.apply(this, arguments)
  2892. }
  2893. ,
  2894. this.flashExec = function(a, c) {
  2895. var d = j.getFlash()
  2896. , e = b.slice(arguments, 2);
  2897. return d.exec(this.uid, a, c, e)
  2898. }
  2899. }
  2900. var g = b.$
  2901. , h = "flash"
  2902. , i = {};
  2903. return b.inherits(c, {
  2904. constructor: f,
  2905. init: function() {
  2906. var a, c = this.getContainer(), d = this.options;
  2907. c.css({
  2908. position: "absolute",
  2909. top: "-8px",
  2910. left: "-8px",
  2911. width: "9px",
  2912. height: "9px",
  2913. overflow: "hidden"
  2914. }),
  2915. a = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + d.swf + '" ',
  2916. b.browser.ie && (a += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),
  2917. a += 'width="100%" height="100%" style="outline:0"><param name="movie" value="' + d.swf + '" /><param name="flashvars" value="uid=' + this.uid + "&jsreciver=" + this.jsreciver + '" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>',
  2918. c.html(a)
  2919. },
  2920. getFlash: function() {
  2921. return this._flash ? this._flash : (this._flash = g("#" + this.uid).get(0),
  2922. this._flash)
  2923. }
  2924. }),
  2925. f.register = function(a, c) {
  2926. return c = i[a] = b.inherits(d, g.extend({
  2927. flashExec: function() {
  2928. var a = this.owner
  2929. , b = this.getRuntime();
  2930. return b.flashExec.apply(a, arguments)
  2931. }
  2932. }, c))
  2933. }
  2934. ,
  2935. e() >= 11.4 && c.addRuntime(h, f),
  2936. f
  2937. }),
  2938. b("runtime/flash/filepicker", ["base", "runtime/flash/runtime"], function(a, b) {
  2939. var c = a.$;
  2940. return b.register("FilePicker", {
  2941. init: function(a) {
  2942. var b, d, e = c.extend({}, a);
  2943. for (b = e.accept && e.accept.length,
  2944. d = 0; b > d; d++)
  2945. e.accept[d].title || (e.accept[d].title = "Files");
  2946. delete e.button,
  2947. delete e.container,
  2948. this.flashExec("FilePicker", "init", e)
  2949. },
  2950. destroy: function() {}
  2951. })
  2952. }),
  2953. b("runtime/flash/image", ["runtime/flash/runtime"], function(a) {
  2954. return a.register("Image", {
  2955. loadFromBlob: function(a) {
  2956. var b = this.owner;
  2957. b.info() && this.flashExec("Image", "info", b.info()),
  2958. b.meta() && this.flashExec("Image", "meta", b.meta()),
  2959. this.flashExec("Image", "loadFromBlob", a.uid)
  2960. }
  2961. })
  2962. }),
  2963. b("runtime/flash/transport", ["base", "runtime/flash/runtime", "runtime/client"], function(a, b, c) {
  2964. var d = a.$;
  2965. return b.register("Transport", {
  2966. init: function() {
  2967. this._status = 0,
  2968. this._response = null,
  2969. this._responseJson = null
  2970. },
  2971. send: function() {
  2972. var a, b = this.owner, c = this.options, e = this._initAjax(), f = b._blob, g = c.server;
  2973. e.connectRuntime(f.ruid),
  2974. c.sendAsBinary ? (g += (/\?/.test(g) ? "&" : "?") + d.param(b._formData),
  2975. a = f.uid) : (d.each(b._formData, function(a, b) {
  2976. e.exec("append", a, b)
  2977. }),
  2978. e.exec("appendBlob", c.fileVal, f.uid, c.filename || b._formData.name || "")),
  2979. this._setRequestHeader(e, c.headers),
  2980. e.exec("send", {
  2981. method: c.method,
  2982. url: g
  2983. }, a)
  2984. },
  2985. getStatus: function() {
  2986. return this._status
  2987. },
  2988. getResponse: function() {
  2989. return this._response
  2990. },
  2991. getResponseAsJson: function() {
  2992. return this._responseJson
  2993. },
  2994. abort: function() {
  2995. var a = this._xhr;
  2996. a && (a.exec("abort"),
  2997. a.destroy(),
  2998. this._xhr = a = null)
  2999. },
  3000. destroy: function() {
  3001. this.abort()
  3002. },
  3003. _initAjax: function() {
  3004. var a = this
  3005. , b = new c("XMLHttpRequest");
  3006. return b.on("uploadprogress progress", function(b) {
  3007. return a.trigger("progress", b.loaded / b.total)
  3008. }),
  3009. b.on("load", function() {
  3010. var c = b.exec("getStatus")
  3011. , d = "";
  3012. return b.off(),
  3013. a._xhr = null,
  3014. c >= 200 && 300 > c ? (a._response = b.exec("getResponse"),
  3015. a._responseJson = b.exec("getResponseAsJson")) : c >= 500 && 600 > c ? (a._response = b.exec("getResponse"),
  3016. a._responseJson = b.exec("getResponseAsJson"),
  3017. d = "server") : d = "http",
  3018. b.destroy(),
  3019. b = null,
  3020. d ? a.trigger("error", d) : a.trigger("load")
  3021. }),
  3022. b.on("error", function() {
  3023. b.off(),
  3024. a._xhr = null,
  3025. a.trigger("error", "http")
  3026. }),
  3027. a._xhr = b,
  3028. b
  3029. },
  3030. _setRequestHeader: function(a, b) {
  3031. d.each(b, function(b, c) {
  3032. a.exec("setRequestHeader", b, c)
  3033. })
  3034. }
  3035. })
  3036. }),
  3037. b("preset/all", ["base", "widgets/filednd", "widgets/filepaste", "widgets/filepicker", "widgets/image", "widgets/queue", "widgets/runtime", "widgets/upload", "widgets/validator", "runtime/html5/blob", "runtime/html5/dnd", "runtime/html5/filepaste", "runtime/html5/filepicker", "runtime/html5/imagemeta/exif", "runtime/html5/androidpatch", "runtime/html5/image", "runtime/html5/transport", "runtime/flash/filepicker", "runtime/flash/image", "runtime/flash/transport"], function(a) {
  3038. return a
  3039. }),
  3040. b("webuploader", ["preset/all"], function(a) {
  3041. return a
  3042. }),
  3043. c("webuploader")
  3044. });