PageRenderTime 32ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/jandcode-wax-core/src/jandcode/wax/core/js/jquery/plupload/plupload.full.js

https://bitbucket.org/gkraser/jandcode-core
JavaScript | 2525 lines | 2475 code | 49 blank | 1 comment | 499 complexity | 8a40eb9acae765e78c8ede482f418aa9 MD5 | raw file
  1. /*1.5.4*/
  2. (function() {
  3. var f = 0, l = [], n = {}, j = {}, a = {"<": "lt", ">": "gt", "&": "amp", '"': "quot", "'": "#39"}, m = /[<>&\"\']/g, b, c = window.setTimeout, d = {}, e;
  4. function h() {
  5. this.returnValue = false
  6. }
  7. function k() {
  8. this.cancelBubble = true
  9. }
  10. (function(o) {
  11. var p = o.split(/,/), q, s, r;
  12. for (q = 0; q < p.length; q += 2) {
  13. r = p[q + 1].split(/ /);
  14. for (s = 0; s < r.length; s++) {
  15. j[r[s]] = p[q]
  16. }
  17. }
  18. })("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mpga mpega mp2 mp3,audio/x-wav,wav,audio/mp4,m4a,image/bmp,bmp,image/gif,gif,image/jpeg,jpeg jpg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/vnd.rn-realvideo,rv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe");
  19. var g = {VERSION: "1.5.4", STOPPED: 1, STARTED: 2, QUEUED: 1, UPLOADING: 2, FAILED: 4, DONE: 5, GENERIC_ERROR: -100, HTTP_ERROR: -200, IO_ERROR: -300, SECURITY_ERROR: -400, INIT_ERROR: -500, FILE_SIZE_ERROR: -600, FILE_EXTENSION_ERROR: -601, IMAGE_FORMAT_ERROR: -700, IMAGE_MEMORY_ERROR: -701, IMAGE_DIMENSIONS_ERROR: -702, mimeTypes: j, ua: (function() {
  20. var s = navigator, r = s.userAgent, t = s.vendor, p, o, q;
  21. p = /WebKit/.test(r);
  22. q = p && t.indexOf("Apple") !== -1;
  23. o = window.opera && window.opera.buildNumber;
  24. return{windows: navigator.platform.indexOf("Win") !== -1, ie: !p && !o && (/MSIE/gi).test(r) && (/Explorer/gi).test(s.appName), webkit: p, gecko: !p && /Gecko/.test(r), safari: q, opera: !!o}
  25. }()), typeOf: function(p) {
  26. return({}).toString.call(p).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()
  27. }, extend: function(o) {
  28. g.each(arguments, function(p, q) {
  29. if (q > 0) {
  30. g.each(p, function(s, r) {
  31. o[r] = s
  32. })
  33. }
  34. });
  35. return o
  36. }, cleanName: function(o) {
  37. var p, q;
  38. q = [/[\300-\306]/g, "A", /[\340-\346]/g, "a", /\307/g, "C", /\347/g, "c", /[\310-\313]/g, "E", /[\350-\353]/g, "e", /[\314-\317]/g, "I", /[\354-\357]/g, "i", /\321/g, "N", /\361/g, "n", /[\322-\330]/g, "O", /[\362-\370]/g, "o", /[\331-\334]/g, "U", /[\371-\374]/g, "u"];
  39. for (p = 0; p < q.length; p += 2) {
  40. o = o.replace(q[p], q[p + 1])
  41. }
  42. o = o.replace(/\s+/g, "_");
  43. o = o.replace(/[^a-z0-9_\-\.]+/gi, "");
  44. return o
  45. }, addRuntime: function(o, p) {
  46. p.name = o;
  47. l[o] = p;
  48. l.push(p);
  49. return p
  50. }, guid: function() {
  51. var o = new Date().getTime().toString(32), p;
  52. for (p = 0; p < 5; p++) {
  53. o += Math.floor(Math.random() * 65535).toString(32)
  54. }
  55. return(g.guidPrefix || "p") + o + (f++).toString(32)
  56. }, buildUrl: function(p, o) {
  57. var q = "";
  58. g.each(o, function(s, r) {
  59. q += (q ? "&" : "") + encodeURIComponent(r) + "=" + encodeURIComponent(s)
  60. });
  61. if (q) {
  62. p += (p.indexOf("?") > 0 ? "&" : "?") + q
  63. }
  64. return p
  65. }, each: function(r, s) {
  66. var q, p, o;
  67. if (r) {
  68. q = r.length;
  69. if (q === b) {
  70. for (p in r) {
  71. if (r.hasOwnProperty(p)) {
  72. if (s(r[p], p) === false) {
  73. return
  74. }
  75. }
  76. }
  77. } else {
  78. for (o = 0; o < q; o++) {
  79. if (s(r[o], o) === false) {
  80. return
  81. }
  82. }
  83. }
  84. }
  85. }, formatSize: function(o) {
  86. if (o === b || /\D/.test(o)) {
  87. return g.translate("N/A")
  88. }
  89. if (o > 1073741824) {
  90. return Math.round(o / 1073741824, 1) + " GB"
  91. }
  92. if (o > 1048576) {
  93. return Math.round(o / 1048576, 1) + " MB"
  94. }
  95. if (o > 1024) {
  96. return Math.round(o / 1024, 1) + " KB"
  97. }
  98. return o + " b"
  99. }, getPos: function(p, t) {
  100. var u = 0, s = 0, w, v = document, q, r;
  101. p = p;
  102. t = t || v.body;
  103. function o(C) {
  104. var A, B, z = 0, D = 0;
  105. if (C) {
  106. B = C.getBoundingClientRect();
  107. A = v.compatMode === "CSS1Compat" ? v.documentElement : v.body;
  108. z = B.left + A.scrollLeft;
  109. D = B.top + A.scrollTop
  110. }
  111. return{x: z, y: D}
  112. }
  113. if (p && p.getBoundingClientRect && ((navigator.userAgent.indexOf("MSIE") > 0) && (v.documentMode < 8))) {
  114. q = o(p);
  115. r = o(t);
  116. return{x: q.x - r.x, y: q.y - r.y}
  117. }
  118. w = p;
  119. while (w && w != t && w.nodeType) {
  120. u += w.offsetLeft || 0;
  121. s += w.offsetTop || 0;
  122. w = w.offsetParent
  123. }
  124. w = p.parentNode;
  125. while (w && w != t && w.nodeType) {
  126. u -= w.scrollLeft || 0;
  127. s -= w.scrollTop || 0;
  128. w = w.parentNode
  129. }
  130. return{x: u, y: s}
  131. }, getSize: function(o) {
  132. return{w: o.offsetWidth || o.clientWidth, h: o.offsetHeight || o.clientHeight}
  133. }, parseSize: function(o) {
  134. var p;
  135. if (typeof(o) == "string") {
  136. o = /^([0-9]+)([mgk]?)$/.exec(o.toLowerCase().replace(/[^0-9mkg]/g, ""));
  137. p = o[2];
  138. o = +o[1];
  139. if (p == "g") {
  140. o *= 1073741824
  141. }
  142. if (p == "m") {
  143. o *= 1048576
  144. }
  145. if (p == "k") {
  146. o *= 1024
  147. }
  148. }
  149. return o
  150. }, xmlEncode: function(o) {
  151. return o ? ("" + o).replace(m, function(p) {
  152. return a[p] ? "&" + a[p] + ";" : p
  153. }) : o
  154. }, toArray: function(q) {
  155. var p, o = [];
  156. for (p = 0; p < q.length; p++) {
  157. o[p] = q[p]
  158. }
  159. return o
  160. }, inArray: function(q, r) {
  161. if (r) {
  162. if (Array.prototype.indexOf) {
  163. return Array.prototype.indexOf.call(r, q)
  164. }
  165. for (var o = 0, p = r.length; o < p; o++) {
  166. if (r[o] === q) {
  167. return o
  168. }
  169. }
  170. }
  171. return -1
  172. }, addI18n: function(o) {
  173. return g.extend(n, o)
  174. }, translate: function(o) {
  175. return n[o] || o
  176. }, isEmptyObj: function(o) {
  177. if (o === b) {
  178. return true
  179. }
  180. for (var p in o) {
  181. return false
  182. }
  183. return true
  184. }, hasClass: function(q, p) {
  185. var o;
  186. if (q.className == "") {
  187. return false
  188. }
  189. o = new RegExp("(^|\\s+)" + p + "(\\s+|$)");
  190. return o.test(q.className)
  191. }, addClass: function(p, o) {
  192. if (!g.hasClass(p, o)) {
  193. p.className = p.className == "" ? o : p.className.replace(/\s+$/, "") + " " + o
  194. }
  195. }, removeClass: function(q, p) {
  196. var o = new RegExp("(^|\\s+)" + p + "(\\s+|$)");
  197. q.className = q.className.replace(o, function(s, r, t) {
  198. return r === " " && t === " " ? " " : ""
  199. })
  200. }, getStyle: function(p, o) {
  201. if (p.currentStyle) {
  202. return p.currentStyle[o]
  203. } else {
  204. if (window.getComputedStyle) {
  205. return window.getComputedStyle(p, null)[o]
  206. }
  207. }
  208. }, addEvent: function(t, o, u) {
  209. var s, r, q, p;
  210. p = arguments[3];
  211. o = o.toLowerCase();
  212. if (e === b) {
  213. e = "Plupload_" + g.guid()
  214. }
  215. if (t.addEventListener) {
  216. s = u;
  217. t.addEventListener(o, s, false)
  218. } else {
  219. if (t.attachEvent) {
  220. s = function() {
  221. var v = window.event;
  222. if (!v.target) {
  223. v.target = v.srcElement
  224. }
  225. v.preventDefault = h;
  226. v.stopPropagation = k;
  227. u(v)
  228. };
  229. t.attachEvent("on" + o, s)
  230. }
  231. }
  232. if (t[e] === b) {
  233. t[e] = g.guid()
  234. }
  235. if (!d.hasOwnProperty(t[e])) {
  236. d[t[e]] = {}
  237. }
  238. r = d[t[e]];
  239. if (!r.hasOwnProperty(o)) {
  240. r[o] = []
  241. }
  242. r[o].push({func: s, orig: u, key: p})
  243. }, removeEvent: function(t, o) {
  244. var r, u, q;
  245. if (typeof(arguments[2]) == "function") {
  246. u = arguments[2]
  247. } else {
  248. q = arguments[2]
  249. }
  250. o = o.toLowerCase();
  251. if (t[e] && d[t[e]] && d[t[e]][o]) {
  252. r = d[t[e]][o]
  253. } else {
  254. return
  255. }
  256. for (var p = r.length - 1; p >= 0; p--) {
  257. if (r[p].key === q || r[p].orig === u) {
  258. if (t.removeEventListener) {
  259. t.removeEventListener(o, r[p].func, false)
  260. } else {
  261. if (t.detachEvent) {
  262. t.detachEvent("on" + o, r[p].func)
  263. }
  264. }
  265. r[p].orig = null;
  266. r[p].func = null;
  267. r.splice(p, 1);
  268. if (u !== b) {
  269. break
  270. }
  271. }
  272. }
  273. if (!r.length) {
  274. delete d[t[e]][o]
  275. }
  276. if (g.isEmptyObj(d[t[e]])) {
  277. delete d[t[e]];
  278. try {
  279. delete t[e]
  280. } catch(s) {
  281. t[e] = b
  282. }
  283. }
  284. }, removeAllEvents: function(p) {
  285. var o = arguments[1];
  286. if (p[e] === b || !p[e]) {
  287. return
  288. }
  289. g.each(d[p[e]], function(r, q) {
  290. g.removeEvent(p, q, o)
  291. })
  292. }};
  293. g.Uploader = function(s) {
  294. var p = {}, v, u = [], r, q = false;
  295. v = new g.QueueProgress();
  296. s = g.extend({chunk_size: 0, multipart: true, multi_selection: true, file_data_name: "file", filters: []}, s);
  297. function t() {
  298. var x, y = 0, w;
  299. if (this.state == g.STARTED) {
  300. for (w = 0; w < u.length; w++) {
  301. if (!x && u[w].status == g.QUEUED) {
  302. x = u[w];
  303. x.status = g.UPLOADING;
  304. if (this.trigger("BeforeUpload", x)) {
  305. this.trigger("UploadFile", x)
  306. }
  307. } else {
  308. y++
  309. }
  310. }
  311. if (y == u.length) {
  312. this.stop();
  313. this.trigger("UploadComplete", u)
  314. }
  315. }
  316. }
  317. function o() {
  318. var x, w;
  319. v.reset();
  320. for (x = 0; x < u.length; x++) {
  321. w = u[x];
  322. if (w.size !== b) {
  323. v.size += w.size;
  324. v.loaded += w.loaded
  325. } else {
  326. v.size = b
  327. }
  328. if (w.status == g.DONE) {
  329. v.uploaded++
  330. } else {
  331. if (w.status == g.FAILED) {
  332. v.failed++
  333. } else {
  334. v.queued++
  335. }
  336. }
  337. }
  338. if (v.size === b) {
  339. v.percent = u.length > 0 ? Math.ceil(v.uploaded / u.length * 100) : 0
  340. } else {
  341. v.bytesPerSec = Math.ceil(v.loaded / ((+new Date() - r || 1) / 1000));
  342. v.percent = v.size > 0 ? Math.ceil(v.loaded / v.size * 100) : 0
  343. }
  344. }
  345. g.extend(this, {state: g.STOPPED, runtime: "", features: {}, files: u, settings: s, total: v, id: g.guid(), init: function() {
  346. var B = this, C, y, x, A = 0, z;
  347. if (typeof(s.preinit) == "function") {
  348. s.preinit(B)
  349. } else {
  350. g.each(s.preinit, function(E, D) {
  351. B.bind(D, E)
  352. })
  353. }
  354. s.page_url = s.page_url || document.location.pathname.replace(/\/[^\/]+$/g, "/");
  355. if (!/^(\w+:\/\/|\/)/.test(s.url)) {
  356. s.url = s.page_url + s.url
  357. }
  358. s.chunk_size = g.parseSize(s.chunk_size);
  359. s.max_file_size = g.parseSize(s.max_file_size);
  360. B.bind("FilesAdded", function(D, G) {
  361. var F, E, I = 0, J, H = s.filters;
  362. if (H && H.length) {
  363. J = [];
  364. g.each(H, function(K) {
  365. g.each(K.extensions.split(/,/), function(L) {
  366. if (/^\s*\*\s*$/.test(L)) {
  367. J.push("\\.*")
  368. } else {
  369. J.push("\\." + L.replace(new RegExp("[" + ("/^$.*+?|()[]{}\\".replace(/./g, "\\$&")) + "]", "g"), "\\$&"))
  370. }
  371. })
  372. });
  373. J = new RegExp(J.join("|") + "$", "i")
  374. }
  375. for (F = 0; F < G.length; F++) {
  376. E = G[F];
  377. E.loaded = 0;
  378. E.percent = 0;
  379. E.status = g.QUEUED;
  380. if (J && !J.test(E.name)) {
  381. D.trigger("Error", {code: g.FILE_EXTENSION_ERROR, message: g.translate("File extension error."), file: E});
  382. continue
  383. }
  384. if (E.size !== b && E.size > s.max_file_size) {
  385. D.trigger("Error", {code: g.FILE_SIZE_ERROR, message: g.translate("File size error."), file: E});
  386. continue
  387. }
  388. u.push(E);
  389. I++
  390. }
  391. if (I) {
  392. c(function() {
  393. B.trigger("QueueChanged");
  394. B.refresh()
  395. }, 1)
  396. } else {
  397. return false
  398. }
  399. });
  400. if (s.unique_names) {
  401. B.bind("UploadFile", function(D, E) {
  402. var G = E.name.match(/\.([^.]+)$/), F = "tmp";
  403. if (G) {
  404. F = G[1]
  405. }
  406. E.target_name = E.id + "." + F
  407. })
  408. }
  409. B.bind("UploadProgress", function(D, E) {
  410. E.percent = E.size > 0 ? Math.ceil(E.loaded / E.size * 100) : 100;
  411. o()
  412. });
  413. B.bind("StateChanged", function(D) {
  414. if (D.state == g.STARTED) {
  415. r = (+new Date())
  416. } else {
  417. if (D.state == g.STOPPED) {
  418. for (C = D.files.length - 1; C >= 0; C--) {
  419. if (D.files[C].status == g.UPLOADING) {
  420. D.files[C].status = g.QUEUED;
  421. o()
  422. }
  423. }
  424. }
  425. }
  426. });
  427. B.bind("QueueChanged", o);
  428. B.bind("Error", function(D, E) {
  429. if (E.file) {
  430. E.file.status = g.FAILED;
  431. o();
  432. if (D.state == g.STARTED) {
  433. c(function() {
  434. t.call(B)
  435. }, 1)
  436. }
  437. }
  438. });
  439. B.bind("FileUploaded", function(D, E) {
  440. E.status = g.DONE;
  441. E.loaded = E.size;
  442. D.trigger("UploadProgress", E);
  443. c(function() {
  444. t.call(B)
  445. }, 1)
  446. });
  447. if (s.runtimes) {
  448. y = [];
  449. z = s.runtimes.split(/\s?,\s?/);
  450. for (C = 0; C < z.length; C++) {
  451. if (l[z[C]]) {
  452. y.push(l[z[C]])
  453. }
  454. }
  455. } else {
  456. y = l
  457. }
  458. function w() {
  459. var G = y[A++], F, D, E;
  460. if (G) {
  461. F = G.getFeatures();
  462. D = B.settings.required_features;
  463. if (D) {
  464. D = D.split(",");
  465. for (E = 0; E < D.length; E++) {
  466. if (!F[D[E]]) {
  467. w();
  468. return
  469. }
  470. }
  471. }
  472. G.init(B, function(H) {
  473. if (H && H.success) {
  474. B.features = F;
  475. B.runtime = G.name;
  476. B.trigger("Init", {runtime: G.name});
  477. B.trigger("PostInit");
  478. B.refresh()
  479. } else {
  480. w()
  481. }
  482. })
  483. } else {
  484. B.trigger("Error", {code: g.INIT_ERROR, message: g.translate("Init error.")})
  485. }
  486. }
  487. w();
  488. if (typeof(s.init) == "function") {
  489. s.init(B)
  490. } else {
  491. g.each(s.init, function(E, D) {
  492. B.bind(D, E)
  493. })
  494. }
  495. }, refresh: function() {
  496. this.trigger("Refresh")
  497. }, start: function() {
  498. if (u.length && this.state != g.STARTED) {
  499. this.state = g.STARTED;
  500. this.trigger("StateChanged");
  501. t.call(this)
  502. }
  503. }, stop: function() {
  504. if (this.state != g.STOPPED) {
  505. this.state = g.STOPPED;
  506. this.trigger("CancelUpload");
  507. this.trigger("StateChanged")
  508. }
  509. }, disableBrowse: function() {
  510. q = arguments[0] !== b ? arguments[0] : true;
  511. this.trigger("DisableBrowse", q)
  512. }, getFile: function(x) {
  513. var w;
  514. for (w = u.length - 1; w >= 0; w--) {
  515. if (u[w].id === x) {
  516. return u[w]
  517. }
  518. }
  519. }, removeFile: function(x) {
  520. var w;
  521. for (w = u.length - 1; w >= 0; w--) {
  522. if (u[w].id === x.id) {
  523. return this.splice(w, 1)[0]
  524. }
  525. }
  526. }, splice: function(y, w) {
  527. var x;
  528. x = u.splice(y === b ? 0 : y, w === b ? u.length : w);
  529. this.trigger("FilesRemoved", x);
  530. this.trigger("QueueChanged");
  531. return x
  532. }, trigger: function(x) {
  533. var z = p[x.toLowerCase()], y, w;
  534. if (z) {
  535. w = Array.prototype.slice.call(arguments);
  536. w[0] = this;
  537. for (y = 0; y < z.length; y++) {
  538. if (z[y].func.apply(z[y].scope, w) === false) {
  539. return false
  540. }
  541. }
  542. }
  543. return true
  544. }, hasEventListener: function(w) {
  545. return !!p[w.toLowerCase()]
  546. }, bind: function(w, y, x) {
  547. var z;
  548. w = w.toLowerCase();
  549. z = p[w] || [];
  550. z.push({func: y, scope: x || this});
  551. p[w] = z
  552. }, unbind: function(w) {
  553. w = w.toLowerCase();
  554. var z = p[w], x, y = arguments[1];
  555. if (z) {
  556. if (y !== b) {
  557. for (x = z.length - 1; x >= 0; x--) {
  558. if (z[x].func === y) {
  559. z.splice(x, 1);
  560. break
  561. }
  562. }
  563. } else {
  564. z = []
  565. }
  566. if (!z.length) {
  567. delete p[w]
  568. }
  569. }
  570. }, unbindAll: function() {
  571. var w = this;
  572. g.each(p, function(y, x) {
  573. w.unbind(x)
  574. })
  575. }, destroy: function() {
  576. this.stop();
  577. this.trigger("Destroy");
  578. this.unbindAll()
  579. }})
  580. };
  581. g.File = function(r, p, q) {
  582. var o = this;
  583. o.id = r;
  584. o.name = p;
  585. o.size = q;
  586. o.loaded = 0;
  587. o.percent = 0;
  588. o.status = 0
  589. };
  590. g.Runtime = function() {
  591. this.getFeatures = function() {
  592. };
  593. this.init = function(o, p) {
  594. }
  595. };
  596. g.QueueProgress = function() {
  597. var o = this;
  598. o.size = 0;
  599. o.loaded = 0;
  600. o.uploaded = 0;
  601. o.failed = 0;
  602. o.queued = 0;
  603. o.percent = 0;
  604. o.bytesPerSec = 0;
  605. o.reset = function() {
  606. o.size = o.loaded = o.uploaded = o.failed = o.queued = o.percent = o.bytesPerSec = 0
  607. }
  608. };
  609. g.runtimes = {};
  610. window.plupload = g
  611. })();
  612. (function() {
  613. if (window.google && google.gears) {
  614. return
  615. }
  616. var a = null;
  617. if (typeof GearsFactory != "undefined") {
  618. a = new GearsFactory()
  619. } else {
  620. try {
  621. a = new ActiveXObject("Gears.Factory");
  622. if (a.getBuildInfo().indexOf("ie_mobile") != -1) {
  623. a.privateSetGlobalObject(this)
  624. }
  625. } catch(b) {
  626. if ((typeof navigator.mimeTypes != "undefined") && navigator.mimeTypes["application/x-googlegears"]) {
  627. a = document.createElement("object");
  628. a.style.display = "none";
  629. a.width = 0;
  630. a.height = 0;
  631. a.type = "application/x-googlegears";
  632. document.documentElement.appendChild(a)
  633. }
  634. }
  635. }
  636. if (!a) {
  637. return
  638. }
  639. if (!window.google) {
  640. window.google = {}
  641. }
  642. if (!google.gears) {
  643. google.gears = {factory: a}
  644. }
  645. })();
  646. (function(e, b, c, d) {
  647. var f = {};
  648. function a(h, k, m) {
  649. var g, j, l, o;
  650. j = google.gears.factory.create("beta.canvas");
  651. try {
  652. j.decode(h);
  653. if (!k.width) {
  654. k.width = j.width
  655. }
  656. if (!k.height) {
  657. k.height = j.height
  658. }
  659. o = Math.min(width / j.width, height / j.height);
  660. if (o < 1 || (o === 1 && m === "image/jpeg")) {
  661. j.resize(Math.round(j.width * o), Math.round(j.height * o));
  662. if (k.quality) {
  663. return j.encode(m, {quality: k.quality / 100})
  664. }
  665. return j.encode(m)
  666. }
  667. } catch(n) {
  668. }
  669. return h
  670. }
  671. c.runtimes.Gears = c.addRuntime("gears", {getFeatures: function() {
  672. return{dragdrop: true, jpgresize: true, pngresize: true, chunks: true, progress: true, multipart: true, multi_selection: true}
  673. }, init: function(l, n) {
  674. var m, h, g = false;
  675. if (!e.google || !google.gears) {
  676. return n({success: false})
  677. }
  678. try {
  679. m = google.gears.factory.create("beta.desktop")
  680. } catch(k) {
  681. return n({success: false})
  682. }
  683. function j(q) {
  684. var p, o, r = [], s;
  685. for (o = 0; o < q.length; o++) {
  686. p = q[o];
  687. s = c.guid();
  688. f[s] = p.blob;
  689. r.push(new c.File(s, p.name, p.blob.length))
  690. }
  691. l.trigger("FilesAdded", r)
  692. }
  693. l.bind("PostInit", function() {
  694. var p = l.settings, o = b.getElementById(p.drop_element);
  695. if (o) {
  696. c.addEvent(o, "dragover", function(q) {
  697. m.setDropEffect(q, "copy");
  698. q.preventDefault()
  699. }, l.id);
  700. c.addEvent(o, "drop", function(r) {
  701. var q = m.getDragData(r, "application/x-gears-files");
  702. if (q) {
  703. j(q.files)
  704. }
  705. r.preventDefault()
  706. }, l.id);
  707. o = 0
  708. }
  709. c.addEvent(b.getElementById(p.browse_button), "click", function(u) {
  710. var t = [], r, q, s;
  711. u.preventDefault();
  712. if (g) {
  713. return
  714. }
  715. no_type_restriction:for (r = 0; r < p.filters.length; r++) {
  716. s = p.filters[r].extensions.split(",");
  717. for (q = 0; q < s.length; q++) {
  718. if (s[q] === "*") {
  719. t = [];
  720. break no_type_restriction
  721. }
  722. t.push("." + s[q])
  723. }
  724. }
  725. m.openFiles(j, {singleFile: !p.multi_selection, filter: t})
  726. }, l.id)
  727. });
  728. l.bind("CancelUpload", function() {
  729. if (h.abort) {
  730. h.abort()
  731. }
  732. });
  733. l.bind("UploadFile", function(u, r) {
  734. var w = 0, v, s, t = 0, q = u.settings.resize, o;
  735. if (q && /\.(png|jpg|jpeg)$/i.test(r.name)) {
  736. f[r.id] = a(f[r.id], q, /\.png$/i.test(r.name) ? "image/png" : "image/jpeg")
  737. }
  738. r.size = f[r.id].length;
  739. s = u.settings.chunk_size;
  740. o = s > 0;
  741. v = Math.ceil(r.size / s);
  742. if (!o) {
  743. s = r.size;
  744. v = 1
  745. }
  746. function p() {
  747. var C, y = u.settings.multipart, x = 0, B = {name: r.target_name || r.name}, z = u.settings.url;
  748. function A(E) {
  749. var D, J = "----pluploadboundary" + c.guid(), G = "--", I = "\r\n", F, H;
  750. if (y) {
  751. h.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + J);
  752. D = google.gears.factory.create("beta.blobbuilder");
  753. c.each(c.extend(B, u.settings.multipart_params), function(L, K) {
  754. D.append(G + J + I + 'Content-Disposition: form-data; name="' + K + '"' + I + I);
  755. D.append(L + I)
  756. });
  757. H = c.mimeTypes[r.name.replace(/^.+\.([^.]+)/, "$1").toLowerCase()] || "application/octet-stream";
  758. D.append(G + J + I + 'Content-Disposition: form-data; name="' + u.settings.file_data_name + '"; filename="' + r.name + '"' + I + "Content-Type: " + H + I + I);
  759. D.append(E);
  760. D.append(I + G + J + G + I);
  761. F = D.getAsBlob();
  762. x = F.length - E.length;
  763. E = F
  764. }
  765. h.send(E)
  766. }
  767. if (r.status == c.DONE || r.status == c.FAILED || u.state == c.STOPPED) {
  768. return
  769. }
  770. if (o) {
  771. B.chunk = w;
  772. B.chunks = v
  773. }
  774. C = Math.min(s, r.size - (w * s));
  775. if (!y) {
  776. z = c.buildUrl(u.settings.url, B)
  777. }
  778. h = google.gears.factory.create("beta.httprequest");
  779. h.open("POST", z);
  780. if (!y) {
  781. h.setRequestHeader("Content-Disposition", 'attachment; filename="' + r.name + '"');
  782. h.setRequestHeader("Content-Type", "application/octet-stream")
  783. }
  784. c.each(u.settings.headers, function(E, D) {
  785. h.setRequestHeader(D, E)
  786. });
  787. h.upload.onprogress = function(D) {
  788. r.loaded = t + D.loaded - x;
  789. u.trigger("UploadProgress", r)
  790. };
  791. h.onreadystatechange = function() {
  792. var D;
  793. if (h.readyState == 4 && u.state !== c.STOPPED) {
  794. if (h.status == 200) {
  795. D = {chunk: w, chunks: v, response: h.responseText, status: h.status};
  796. u.trigger("ChunkUploaded", r, D);
  797. if (D.cancelled) {
  798. r.status = c.FAILED;
  799. return
  800. }
  801. t += C;
  802. if (++w >= v) {
  803. r.status = c.DONE;
  804. u.trigger("FileUploaded", r, {response: h.responseText, status: h.status})
  805. } else {
  806. p()
  807. }
  808. } else {
  809. u.trigger("Error", {code: c.HTTP_ERROR, message: c.translate("HTTP Error."), file: r, chunk: w, chunks: v, status: h.status})
  810. }
  811. }
  812. };
  813. if (w < v) {
  814. A(f[r.id].slice(w * s, C))
  815. }
  816. }
  817. p()
  818. });
  819. l.bind("DisableBrowse", function(o, p) {
  820. g = p
  821. });
  822. l.bind("Destroy", function(o) {
  823. var p, q, r = {browseButton: o.settings.browse_button, dropElm: o.settings.drop_element};
  824. for (p in r) {
  825. q = b.getElementById(r[p]);
  826. if (q) {
  827. c.removeAllEvents(q, o.id)
  828. }
  829. }
  830. });
  831. n({success: true})
  832. }})
  833. })(window, document, plupload);
  834. (function(g, b, d, e) {
  835. var a = {}, h = {};
  836. function c(o) {
  837. var n, m = typeof o, j, l, k;
  838. if (o === e || o === null) {
  839. return"null"
  840. }
  841. if (m === "string") {
  842. n = "\bb\tt\nn\ff\rr\"\"''\\\\";
  843. return'"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(r, q) {
  844. var p = n.indexOf(q);
  845. if (p + 1) {
  846. return"\\" + n.charAt(p + 1)
  847. }
  848. r = q.charCodeAt().toString(16);
  849. return"\\u" + "0000".substring(r.length) + r
  850. }) + '"'
  851. }
  852. if (m == "object") {
  853. j = o.length !== e;
  854. n = "";
  855. if (j) {
  856. for (l = 0; l < o.length; l++) {
  857. if (n) {
  858. n += ","
  859. }
  860. n += c(o[l])
  861. }
  862. n = "[" + n + "]"
  863. } else {
  864. for (k in o) {
  865. if (o.hasOwnProperty(k)) {
  866. if (n) {
  867. n += ","
  868. }
  869. n += c(k) + ":" + c(o[k])
  870. }
  871. }
  872. n = "{" + n + "}"
  873. }
  874. return n
  875. }
  876. return"" + o
  877. }
  878. function f(s) {
  879. var v = false, j = null, o = null, k, l, m, u, n, q = 0;
  880. try {
  881. try {
  882. o = new ActiveXObject("AgControl.AgControl");
  883. if (o.IsVersionSupported(s)) {
  884. v = true
  885. }
  886. o = null
  887. } catch(r) {
  888. var p = navigator.plugins["Silverlight Plug-In"];
  889. if (p) {
  890. k = p.description;
  891. if (k === "1.0.30226.2") {
  892. k = "2.0.30226.2"
  893. }
  894. l = k.split(".");
  895. while (l.length > 3) {
  896. l.pop()
  897. }
  898. while (l.length < 4) {
  899. l.push(0)
  900. }
  901. m = s.split(".");
  902. while (m.length > 4) {
  903. m.pop()
  904. }
  905. do {
  906. u = parseInt(m[q], 10);
  907. n = parseInt(l[q], 10);
  908. q++
  909. } while (q < m.length && u === n);
  910. if (u <= n && !isNaN(u)) {
  911. v = true
  912. }
  913. }
  914. }
  915. } catch(t) {
  916. v = false
  917. }
  918. return v
  919. }
  920. d.silverlight = {trigger: function(n, k) {
  921. var m = a[n], l, j;
  922. if (m) {
  923. j = d.toArray(arguments).slice(1);
  924. j[0] = "Silverlight:" + k;
  925. setTimeout(function() {
  926. m.trigger.apply(m, j)
  927. }, 0)
  928. }
  929. }};
  930. d.runtimes.Silverlight = d.addRuntime("silverlight", {getFeatures: function() {
  931. return{jpgresize: true, pngresize: true, chunks: true, progress: true, multipart: true, multi_selection: true}
  932. }, init: function(p, q) {
  933. var o, m = "", n = p.settings.filters, l, k = b.body;
  934. if (!f("2.0.31005.0") || (g.opera && g.opera.buildNumber)) {
  935. q({success: false});
  936. return
  937. }
  938. h[p.id] = false;
  939. a[p.id] = p;
  940. o = b.createElement("div");
  941. o.id = p.id + "_silverlight_container";
  942. d.extend(o.style, {position: "absolute", top: "0px", background: p.settings.shim_bgcolor || "transparent", zIndex: 99999, width: "100px", height: "100px", overflow: "hidden", opacity: p.settings.shim_bgcolor || b.documentMode > 8 ? "" : 0.01});
  943. o.className = "plupload silverlight";
  944. if (p.settings.container) {
  945. k = b.getElementById(p.settings.container);
  946. if (d.getStyle(k, "position") === "static") {
  947. k.style.position = "relative"
  948. }
  949. }
  950. k.appendChild(o);
  951. for (l = 0; l < n.length; l++) {
  952. m += (m != "" ? "|" : "") + n[l].title + " | *." + n[l].extensions.replace(/,/g, ";*.")
  953. }
  954. o.innerHTML = '<object id="' + p.id + '_silverlight" data="data:application/x-silverlight," type="application/x-silverlight-2" style="outline:none;" width="1024" height="1024"><param name="source" value="' + p.settings.silverlight_xap_url + '"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="id=' + p.id + ",filter=" + m + ",multiselect=" + p.settings.multi_selection + '"/></object>';
  955. function j() {
  956. return b.getElementById(p.id + "_silverlight").content.Upload
  957. }
  958. p.bind("Silverlight:Init", function() {
  959. var r, s = {};
  960. if (h[p.id]) {
  961. return
  962. }
  963. h[p.id] = true;
  964. p.bind("Silverlight:StartSelectFiles", function(t) {
  965. r = []
  966. });
  967. p.bind("Silverlight:SelectFile", function(t, w, u, v) {
  968. var x;
  969. x = d.guid();
  970. s[x] = w;
  971. s[w] = x;
  972. r.push(new d.File(x, u, v))
  973. });
  974. p.bind("Silverlight:SelectSuccessful", function() {
  975. if (r.length) {
  976. p.trigger("FilesAdded", r)
  977. }
  978. });
  979. p.bind("Silverlight:UploadChunkError", function(t, w, u, x, v) {
  980. p.trigger("Error", {code: d.IO_ERROR, message: "IO Error.", details: v, file: t.getFile(s[w])})
  981. });
  982. p.bind("Silverlight:UploadFileProgress", function(t, x, u, w) {
  983. var v = t.getFile(s[x]);
  984. if (v.status != d.FAILED) {
  985. v.size = w;
  986. v.loaded = u;
  987. t.trigger("UploadProgress", v)
  988. }
  989. });
  990. p.bind("Refresh", function(t) {
  991. var u, v, w;
  992. u = b.getElementById(t.settings.browse_button);
  993. if (u) {
  994. v = d.getPos(u, b.getElementById(t.settings.container));
  995. w = d.getSize(u);
  996. d.extend(b.getElementById(t.id + "_silverlight_container").style, {top: v.y + "px", left: v.x + "px", width: w.w + "px", height: w.h + "px"})
  997. }
  998. });
  999. p.bind("Silverlight:UploadChunkSuccessful", function(t, w, u, z, y) {
  1000. var x, v = t.getFile(s[w]);
  1001. x = {chunk: u, chunks: z, response: y};
  1002. t.trigger("ChunkUploaded", v, x);
  1003. if (v.status != d.FAILED && t.state !== d.STOPPED) {
  1004. j().UploadNextChunk()
  1005. }
  1006. if (u == z - 1) {
  1007. v.status = d.DONE;
  1008. t.trigger("FileUploaded", v, {response: y})
  1009. }
  1010. });
  1011. p.bind("Silverlight:UploadSuccessful", function(t, w, u) {
  1012. var v = t.getFile(s[w]);
  1013. v.status = d.DONE;
  1014. t.trigger("FileUploaded", v, {response: u})
  1015. });
  1016. p.bind("FilesRemoved", function(t, v) {
  1017. var u;
  1018. for (u = 0; u < v.length; u++) {
  1019. j().RemoveFile(s[v[u].id])
  1020. }
  1021. });
  1022. p.bind("UploadFile", function(t, v) {
  1023. var w = t.settings, u = w.resize || {};
  1024. j().UploadFile(s[v.id], t.settings.url, c({name: v.target_name || v.name, mime: d.mimeTypes[v.name.replace(/^.+\.([^.]+)/, "$1").toLowerCase()] || "application/octet-stream", chunk_size: w.chunk_size, image_width: u.width, image_height: u.height, image_quality: u.quality || 90, multipart: !!w.multipart, multipart_params: w.multipart_params || {}, file_data_name: w.file_data_name, headers: w.headers}))
  1025. });
  1026. p.bind("CancelUpload", function() {
  1027. j().CancelUpload()
  1028. });
  1029. p.bind("Silverlight:MouseEnter", function(t) {
  1030. var u, v;
  1031. u = b.getElementById(p.settings.browse_button);
  1032. v = t.settings.browse_button_hover;
  1033. if (u && v) {
  1034. d.addClass(u, v)
  1035. }
  1036. });
  1037. p.bind("Silverlight:MouseLeave", function(t) {
  1038. var u, v;
  1039. u = b.getElementById(p.settings.browse_button);
  1040. v = t.settings.browse_button_hover;
  1041. if (u && v) {
  1042. d.removeClass(u, v)
  1043. }
  1044. });
  1045. p.bind("Silverlight:MouseLeftButtonDown", function(t) {
  1046. var u, v;
  1047. u = b.getElementById(p.settings.browse_button);
  1048. v = t.settings.browse_button_active;
  1049. if (u && v) {
  1050. d.addClass(u, v);
  1051. d.addEvent(b.body, "mouseup", function() {
  1052. d.removeClass(u, v)
  1053. })
  1054. }
  1055. });
  1056. p.bind("Sliverlight:StartSelectFiles", function(t) {
  1057. var u, v;
  1058. u = b.getElementById(p.settings.browse_button);
  1059. v = t.settings.browse_button_active;
  1060. if (u && v) {
  1061. d.removeClass(u, v)
  1062. }
  1063. });
  1064. p.bind("DisableBrowse", function(t, u) {
  1065. j().DisableBrowse(u)
  1066. });
  1067. p.bind("Destroy", function(t) {
  1068. var u;
  1069. d.removeAllEvents(b.body, t.id);
  1070. delete h[t.id];
  1071. delete a[t.id];
  1072. u = b.getElementById(t.id + "_silverlight_container");
  1073. if (u) {
  1074. k.removeChild(u)
  1075. }
  1076. });
  1077. q({success: true})
  1078. })
  1079. }})
  1080. })(window, document, plupload);
  1081. (function(f, b, d, e) {
  1082. var a = {}, g = {};
  1083. function c() {
  1084. var h;
  1085. try {
  1086. h = navigator.plugins["Shockwave Flash"];
  1087. h = h.description
  1088. } catch(k) {
  1089. try {
  1090. h = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")
  1091. } catch(j) {
  1092. h = "0.0"
  1093. }
  1094. }
  1095. h = h.match(/\d+/g);
  1096. return parseFloat(h[0] + "." + h[1])
  1097. }
  1098. d.flash = {trigger: function(k, h, j) {
  1099. setTimeout(function() {
  1100. var n = a[k], m, l;
  1101. if (n) {
  1102. n.trigger("Flash:" + h, j)
  1103. }
  1104. }, 0)
  1105. }};
  1106. d.runtimes.Flash = d.addRuntime("flash", {getFeatures: function() {
  1107. return{jpgresize: true, pngresize: true, maxWidth: 8091, maxHeight: 8091, chunks: true, progress: true, multipart: true, multi_selection: true}
  1108. }, init: function(n, p) {
  1109. var l, m, h = 0, j = b.body;
  1110. if (c() < 10) {
  1111. p({success: false});
  1112. return
  1113. }
  1114. g[n.id] = false;
  1115. a[n.id] = n;
  1116. l = b.getElementById(n.settings.browse_button);
  1117. m = b.createElement("div");
  1118. m.id = n.id + "_flash_container";
  1119. d.extend(m.style, {position: "absolute", top: "0px", background: n.settings.shim_bgcolor || "transparent", zIndex: 99999, width: "100%", height: "100%"});
  1120. m.className = "plupload flash";
  1121. if (n.settings.container) {
  1122. j = b.getElementById(n.settings.container);
  1123. if (d.getStyle(j, "position") === "static") {
  1124. j.style.position = "relative"
  1125. }
  1126. }
  1127. j.appendChild(m);
  1128. (function() {
  1129. var q, r;
  1130. q = '<object id="' + n.id + '_flash" type="application/x-shockwave-flash" data="' + n.settings.flash_swf_url + '" ';
  1131. if (d.ua.ie) {
  1132. q += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
  1133. }
  1134. q += 'width="100%" height="100%" style="outline:0"><param name="movie" value="' + n.settings.flash_swf_url + '" /><param name="flashvars" value="id=' + escape(n.id) + '" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>';
  1135. if (d.ua.ie) {
  1136. r = b.createElement("div");
  1137. m.appendChild(r);
  1138. r.outerHTML = q;
  1139. r = null
  1140. } else {
  1141. m.innerHTML = q
  1142. }
  1143. }());
  1144. function o() {
  1145. return b.getElementById(n.id + "_flash")
  1146. }
  1147. function k() {
  1148. if (h++ > 5000) {
  1149. p({success: false});
  1150. return
  1151. }
  1152. if (g[n.id] === false) {
  1153. setTimeout(k, 1)
  1154. }
  1155. }
  1156. k();
  1157. l = m = null;
  1158. n.bind("Destroy", function(q) {
  1159. var r;
  1160. d.removeAllEvents(b.body, q.id);
  1161. delete g[q.id];
  1162. delete a[q.id];
  1163. r = b.getElementById(q.id + "_flash_container");
  1164. if (r) {
  1165. j.removeChild(r)
  1166. }
  1167. });
  1168. n.bind("Flash:Init", function() {
  1169. var s = {}, r;
  1170. try {
  1171. o().setFileFilters(n.settings.filters, n.settings.multi_selection)
  1172. } catch(q) {
  1173. p({success: false});
  1174. return
  1175. }
  1176. if (g[n.id]) {
  1177. return
  1178. }
  1179. g[n.id] = true;
  1180. n.bind("UploadFile", function(t, v) {
  1181. var w = t.settings, u = n.settings.resize || {};
  1182. o().uploadFile(s[v.id], w.url, {name: v.target_name || v.name, mime: d.mimeTypes[v.name.replace(/^.+\.([^.]+)/, "$1").toLowerCase()] || "application/octet-stream", chunk_size: w.chunk_size, width: u.width, height: u.height, quality: u.quality, multipart: w.multipart, multipart_params: w.multipart_params || {}, file_data_name: w.file_data_name, format: /\.(jpg|jpeg)$/i.test(v.name) ? "jpg" : "png", headers: w.headers, urlstream_upload: w.urlstream_upload})
  1183. });
  1184. n.bind("CancelUpload", function() {
  1185. o().cancelUpload()
  1186. });
  1187. n.bind("Flash:UploadProcess", function(u, t) {
  1188. var v = u.getFile(s[t.id]);
  1189. if (v.status != d.FAILED) {
  1190. v.loaded = t.loaded;
  1191. v.size = t.size;
  1192. u.trigger("UploadProgress", v)
  1193. }
  1194. });
  1195. n.bind("Flash:UploadChunkComplete", function(t, v) {
  1196. var w, u = t.getFile(s[v.id]);
  1197. w = {chunk: v.chunk, chunks: v.chunks, response: v.text};
  1198. t.trigger("ChunkUploaded", u, w);
  1199. if (u.status !== d.FAILED && t.state !== d.STOPPED) {
  1200. o().uploadNextChunk()
  1201. }
  1202. if (v.chunk == v.chunks - 1) {
  1203. u.status = d.DONE;
  1204. t.trigger("FileUploaded", u, {response: v.text})
  1205. }
  1206. });
  1207. n.bind("Flash:SelectFiles", function(t, w) {
  1208. var v, u, x = [], y;
  1209. for (u = 0; u < w.length; u++) {
  1210. v = w[u];
  1211. y = d.guid();
  1212. s[y] = v.id;
  1213. s[v.id] = y;
  1214. x.push(new d.File(y, v.name, v.size))
  1215. }
  1216. if (x.length) {
  1217. n.trigger("FilesAdded", x)
  1218. }
  1219. });
  1220. n.bind("Flash:SecurityError", function(t, u) {
  1221. n.trigger("Error", {code: d.SECURITY_ERROR, message: d.translate("Security error."), details: u.message, file: n.getFile(s[u.id])})
  1222. });
  1223. n.bind("Flash:GenericError", function(t, u) {
  1224. n.trigger("Error", {code: d.GENERIC_ERROR, message: d.translate("Generic error."), details: u.message, file: n.getFile(s[u.id])})
  1225. });
  1226. n.bind("Flash:IOError", function(t, u) {
  1227. n.trigger("Error", {code: d.IO_ERROR, message: d.translate("IO error."), details: u.message, file: n.getFile(s[u.id])})
  1228. });
  1229. n.bind("Flash:ImageError", function(t, u) {
  1230. n.trigger("Error", {code: parseInt(u.code, 10), message: d.translate("Image error."), file: n.getFile(s[u.id])})
  1231. });
  1232. n.bind("Flash:StageEvent:rollOver", function(t) {
  1233. var u, v;
  1234. u = b.getElementById(n.settings.browse_button);
  1235. v = t.settings.browse_button_hover;
  1236. if (u && v) {
  1237. d.addClass(u, v)
  1238. }
  1239. });
  1240. n.bind("Flash:StageEvent:rollOut", function(t) {
  1241. var u, v;
  1242. u = b.getElementById(n.settings.browse_button);
  1243. v = t.settings.browse_button_hover;
  1244. if (u && v) {
  1245. d.removeClass(u, v)
  1246. }
  1247. });
  1248. n.bind("Flash:StageEvent:mouseDown", function(t) {
  1249. var u, v;
  1250. u = b.getElementById(n.settings.browse_button);
  1251. v = t.settings.browse_button_active;
  1252. if (u && v) {
  1253. d.addClass(u, v);
  1254. d.addEvent(b.body, "mouseup", function() {
  1255. d.removeClass(u, v)
  1256. }, t.id)
  1257. }
  1258. });
  1259. n.bind("Flash:StageEvent:mouseUp", function(t) {
  1260. var u, v;
  1261. u = b.getElementById(n.settings.browse_button);
  1262. v = t.settings.browse_button_active;
  1263. if (u && v) {
  1264. d.removeClass(u, v)
  1265. }
  1266. });
  1267. n.bind("Flash:ExifData", function(t, u) {
  1268. n.trigger("ExifData", n.getFile(s[u.id]), u.data)
  1269. });
  1270. n.bind("Flash:GpsData", function(t, u) {
  1271. n.trigger("GpsData", n.getFile(s[u.id]), u.data)
  1272. });
  1273. n.bind("QueueChanged", function(t) {
  1274. n.refresh()
  1275. });
  1276. n.bind("FilesRemoved", function(t, v) {
  1277. var u;
  1278. for (u = 0; u < v.length; u++) {
  1279. o().removeFile(s[v[u].id])
  1280. }
  1281. });
  1282. n.bind("StateChanged", function(t) {
  1283. n.refresh()
  1284. });
  1285. n.bind("Refresh", function(t) {
  1286. var u, v, w;
  1287. o().setFileFilters(n.settings.filters, n.settings.multi_selection);
  1288. u = b.getElementById(t.settings.browse_button);
  1289. if (u) {
  1290. v = d.getPos(u, b.getElementById(t.settings.container));
  1291. w = d.getSize(u);
  1292. d.extend(b.getElementById(t.id + "_flash_container").style, {top: v.y + "px", left: v.x + "px", width: w.w + "px", height: w.h + "px"})
  1293. }
  1294. });
  1295. n.bind("DisableBrowse", function(t, u) {
  1296. o().disableBrowse(u)
  1297. });
  1298. p({success: true})
  1299. })
  1300. }})
  1301. })(window, document, plupload);
  1302. (function(a) {
  1303. a.runtimes.BrowserPlus = a.addRuntime("browserplus", {getFeatures: function() {
  1304. return{dragdrop: true, jpgresize: true, pngresize: true, chunks: true, progress: true, multipart: true, multi_selection: true}
  1305. }, init: function(g, j) {
  1306. var e = window.BrowserPlus, h = {}, d = g.settings, c = d.resize;
  1307. function f(o) {
  1308. var n, m, k = [], l, p;
  1309. for (m = 0; m < o.length; m++) {
  1310. l = o[m];
  1311. p = a.guid();
  1312. h[p] = l;
  1313. k.push(new a.File(p, l.name, l.size))
  1314. }
  1315. if (m) {
  1316. g.trigger("FilesAdded", k)
  1317. }
  1318. }
  1319. function b() {
  1320. var k = false;
  1321. g.bind("PostInit", function() {
  1322. var o, m = d.drop_element, q = g.id + "_droptarget", l = document.getElementById(m), n;
  1323. function r(t, s) {
  1324. e.DragAndDrop.AddDropTarget({id: t}, function(u) {
  1325. e.DragAndDrop.AttachCallbacks({id: t, hover: function(v) {
  1326. if (!v && s) {
  1327. s()
  1328. }
  1329. }, drop: function(v) {
  1330. if (s) {
  1331. s()
  1332. }
  1333. f(v)
  1334. }}, function() {
  1335. })
  1336. })
  1337. }
  1338. function p() {
  1339. document.getElementById(q).style.top = "-1000px"
  1340. }
  1341. if (l) {
  1342. if (document.attachEvent && (/MSIE/gi).test(navigator.userAgent)) {
  1343. o = document.createElement("div");
  1344. o.setAttribute("id", q);
  1345. a.extend(o.style, {position: "absolute", top: "-1000px", background: "red", filter: "alpha(opacity=0)", opacity: 0});
  1346. document.body.appendChild(o);
  1347. a.addEvent(l, "dragenter", function(t) {
  1348. var s, u;
  1349. s = document.getElementById(m);
  1350. u = a.getPos(s);
  1351. a.extend(document.getElementById(q).style, {top: u.y + "px", left: u.x + "px", width: s.offsetWidth + "px", height: s.offsetHeight + "px"})
  1352. });
  1353. r(q, p)
  1354. } else {
  1355. r(m)
  1356. }
  1357. }
  1358. a.addEvent(document.getElementById(d.browse_button), "click", function(y) {
  1359. var s = [], u, t, x = d.filters, w, v;
  1360. y.preventDefault();
  1361. if (k) {
  1362. return
  1363. }
  1364. no_type_restriction:for (u = 0; u < x.length; u++) {
  1365. w = x[u].extensions.split(",");
  1366. for (t = 0; t < w.length; t++) {
  1367. if (w[t] === "*") {
  1368. s = [];
  1369. break no_type_restriction
  1370. }
  1371. v = a.mimeTypes[w[t]];
  1372. if (v && a.inArray(v, s) === -1) {
  1373. s.push(a.mimeTypes[w[t]])
  1374. }
  1375. }
  1376. }
  1377. e.FileBrowse.OpenBrowseDialog({mimeTypes: s}, function(z) {
  1378. if (z.success) {
  1379. f(z.value)
  1380. }
  1381. })
  1382. });
  1383. l = o = null
  1384. });
  1385. g.bind("CancelUpload", function() {
  1386. e.Uploader.cancel({}, function() {
  1387. })
  1388. });
  1389. g.bind("DisableBrowse", function(l, m) {
  1390. k = m
  1391. });
  1392. g.bind("UploadFile", function(o, l) {
  1393. var n = h[l.id], t = {}, m = o.settings.chunk_size, p, q = [];
  1394. function s(u, w) {
  1395. var v;
  1396. if (l.status == a.FAILED) {
  1397. return
  1398. }
  1399. t.name = l.target_name || l.name;
  1400. if (m) {
  1401. t.chunk = "" + u;
  1402. t.chunks = "" + w
  1403. }
  1404. v = q.shift();
  1405. e.Uploader.upload({url: o.settings.url, files: {file: v}, cookies: document.cookies, postvars: a.extend(t, o.settings.multipart_params), progressCallback: function(z) {
  1406. var y, x = 0;
  1407. p[u] = parseInt(z.filePercent * v.size / 100, 10);
  1408. for (y = 0; y < p.length; y++) {
  1409. x += p[y]
  1410. }
  1411. l.loaded = x;
  1412. o.trigger("UploadProgress", l)
  1413. }}, function(y) {
  1414. var x, z;
  1415. if (y.success) {
  1416. x = y.value.statusCode;
  1417. if (m) {
  1418. o.trigger("ChunkUploaded", l, {chunk: u, chunks: w, response: y.value.body, status: x})
  1419. }
  1420. if (q.length > 0) {
  1421. s(++u, w)
  1422. } else {
  1423. l.status = a.DONE;
  1424. o.trigger("FileUploaded", l, {response: y.value.body, status: x});
  1425. if (x >= 400) {
  1426. o.trigger("Error", {code: a.HTTP_ERROR, message: a.translate("HTTP Error."), file: l, status: x})
  1427. }
  1428. }
  1429. } else {
  1430. o.trigger("Error", {code: a.GENERIC_ERROR, message: a.translate("Generic Error."), file: l, details: y.error})
  1431. }
  1432. })
  1433. }
  1434. function r(u) {
  1435. l.size = u.size;
  1436. if (m) {
  1437. e.FileAccess.chunk({file: u, chunkSize: m}, function(x) {
  1438. if (x.success) {
  1439. var y = x.value, v = y.length;
  1440. p = Array(v);
  1441. for (var w = 0; w < v; w++) {
  1442. p[w] = 0;
  1443. q.push(y[w])
  1444. }
  1445. s(0, v)
  1446. }
  1447. })
  1448. } else {
  1449. p = Array(1);
  1450. q.push(u);
  1451. s(0, 1)
  1452. }
  1453. }
  1454. if (c && /\.(png|jpg|jpeg)$/i.test(l.name)) {
  1455. BrowserPlus.ImageAlter.transform({file: n, quality: c.quality || 90, actions: [
  1456. {scale: {maxwidth: c.width, maxheight: c.height}}
  1457. ]}, function(u) {
  1458. if (u.success) {
  1459. r(u.value.file)
  1460. }
  1461. })
  1462. } else {
  1463. r(n)
  1464. }
  1465. });
  1466. j({success: true})
  1467. }
  1468. if (e) {
  1469. e.init(function(l) {
  1470. var k = [
  1471. {service: "Uploader", version: "3"},
  1472. {service: "DragAndDrop", version: "1"},
  1473. {service: "FileBrowse", version: "1"},
  1474. {service: "FileAccess", version: "2"}
  1475. ];
  1476. if (c) {
  1477. k.push({service: "ImageAlter", version: "4"})
  1478. }
  1479. if (l.success) {
  1480. e.require({services: k}, function(m) {
  1481. if (m.success) {
  1482. b()
  1483. } else {
  1484. j()
  1485. }
  1486. })
  1487. } else {
  1488. j()
  1489. }
  1490. })
  1491. } else {
  1492. j()
  1493. }
  1494. }})
  1495. })(plupload);
  1496. (function(h, k, j, e) {
  1497. var c = {}, g;
  1498. function m(o, p) {
  1499. var n;
  1500. if ("FileReader" in h) {
  1501. n = new FileReader();
  1502. n.readAsDataURL(o);
  1503. n.onload = function() {
  1504. p(n.result)
  1505. }
  1506. } else {
  1507. return p(o.getAsDataURL())
  1508. }
  1509. }
  1510. function l(o, p) {
  1511. var n;
  1512. if ("FileReader" in h) {
  1513. n = new FileReader();
  1514. n.readAsBinaryString(o);
  1515. n.onload = function() {
  1516. p(n.result)
  1517. }
  1518. } else {
  1519. return p(o.getAsBinary())
  1520. }
  1521. }
  1522. function d(r, p, n, v) {
  1523. var q, o, u, s, t = this;
  1524. m(c[r.id], function(w) {
  1525. q = k.createElement("canvas");
  1526. q.style.display = "none";
  1527. k.body.appendChild(q);
  1528. o = q.getContext("2d");
  1529. u = new Image();
  1530. u.onerror = u.onabort = function() {
  1531. v({success: false})
  1532. };
  1533. u.onload = function() {
  1534. var B, x, z, y, A;
  1535. if (!p.width) {
  1536. p.width = u.width
  1537. }
  1538. if (!p.height) {
  1539. p.height = u.height
  1540. }
  1541. s = Math.min(p.width / u.width, p.height / u.height);
  1542. if (s < 1 || (s === 1 && n === "image/jpeg")) {
  1543. B = Math.round(u.width * s);
  1544. x = Math.round(u.height * s);
  1545. q.width = B;
  1546. q.height = x;
  1547. o.drawImage(u, 0, 0, B, x);
  1548. if (n === "image/jpeg") {
  1549. y = new f(atob(w.substring(w.indexOf("base64,") + 7)));
  1550. if (y.headers && y.headers.length) {
  1551. A = new a();
  1552. if (A.init(y.get("exif")[0])) {
  1553. A.setExif("PixelXDimension", B);
  1554. A.setExif("PixelYDimension", x);
  1555. y.set("exif", A.getBinary());
  1556. if (t.hasEventListener("ExifData")) {
  1557. t.trigger("ExifData", r, A.EXIF())
  1558. }
  1559. if (t.hasEventListener("GpsData")) {
  1560. t.trigger("GpsData", r, A.GPS())
  1561. }
  1562. }
  1563. }
  1564. if (p.quality) {
  1565. try {
  1566. w = q.toDataURL(n, p.quality / 100)
  1567. } catch(C) {
  1568. w = q.toDataURL(n)
  1569. }
  1570. }
  1571. } else {
  1572. w = q.toDataURL(n)
  1573. }
  1574. w = w.substring(w.indexOf("base64,") + 7);
  1575. w = atob(w);
  1576. if (y && y.headers && y.headers.length) {
  1577. w = y.restore(w);
  1578. y.purge()
  1579. }
  1580. q.parentNode.removeChild(q);
  1581. v({success: true, data: w})
  1582. } else {
  1583. v({success: false})
  1584. }
  1585. };
  1586. u.src = w
  1587. })
  1588. }
  1589. j.runtimes.Html5 = j.addRuntime("html5", {getFeatures: function() {
  1590. var s, o, r, q, p, n;
  1591. o = r = p = n = false;
  1592. if (h.XMLHttpRequest) {
  1593. s = new XMLHttpRequest();
  1594. r = !!s.upload;
  1595. o = !!(s.sendAsBinary || s.upload)
  1596. }
  1597. if (o) {
  1598. q = !!(s.sendAsBinary || (h.Uint8Array && h.ArrayBuffer));
  1599. p = !!(File && (File.prototype.getAsDataURL || h.FileReader) && q);
  1600. n = !!(File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice))
  1601. }
  1602. g = j.ua.safari && j.ua.windows;
  1603. return{html5: o, dragdrop: (function() {
  1604. var t = k.createElement("div");
  1605. return("draggable" in t) || ("ondragstart" in t && "ondrop" in t)
  1606. }()), jpgresize: p, pngresize: p, multipart: p || !!h.FileReader || !!h.FormData, canSendBinary: q, cantSendBlobInFormData: !!(j.ua.gecko && h.FormData && h.FileReader && !FileReader.prototype.readAsArrayBuffer), progress: r, chunks: n, multi_selection: !(j.ua.safari && j.ua.windows), triggerDialog: (j.ua.gecko && h.FormData || j.ua.webkit)}
  1607. }, init: function(p, r) {
  1608. var n, q;
  1609. function o(w) {
  1610. var u, t, v = [], x, s = {};
  1611. for (t = 0; t < w.length; t++) {
  1612. u = w[t];
  1613. if (s[u.name]) {
  1614. continue
  1615. }
  1616. s[u.name] = true;
  1617. x = j.guid();
  1618. c[x] = u;
  1619. v.push(new j.File(x, u.fileName || u.name, u.fileSize || u.size))
  1620. }
  1621. if (v.length) {
  1622. p.trigger("FilesAdded", v)
  1623. }
  1624. }
  1625. n = this.getFeatures();
  1626. if (!n.html5) {
  1627. r({success: false});
  1628. return
  1629. }
  1630. p.bind("Init", function(w) {
  1631. var G, F, C = [], v, D, t = w.settings.filters, u, B, s = k.body, E;
  1632. G = k.createElement("div");
  1633. G.id = w.id + "_html5_container";
  1634. j.extend(G.style, {position: "absolute", background: p.settings.shim_bgcolor || "transparent", width: "100px", height: "100px", overflow: "hidden", zIndex: 99999, opacity: p.settings.shim_bgcolor ? "" : 0});
  1635. G.className = "plupload html5";
  1636. if (p.settings.container) {
  1637. s = k.getElementById(p.settings.container);
  1638. if (j.getStyle(s, "position") === "static") {
  1639. s.style.position = "relative"
  1640. }
  1641. }
  1642. s.appendChild(G);
  1643. no_type_restriction:for (v = 0; v < t.length; v++) {
  1644. u = t[v].extensions.split(/,/);
  1645. for (D = 0; D < u.length; D++) {
  1646. if (u[D] === "*") {
  1647. C = [];
  1648. break no_type_restriction
  1649. }
  1650. B = j.mimeTypes[u[D]];
  1651. if (B && j.inArray(B, C) === -1) {
  1652. C.push(B)
  1653. }
  1654. }
  1655. }
  1656. G.innerHTML = '<input id="' + p.id + '_html5" style="font-size:999px" type="file" accept="' + C.join(",") + '" ' + (p.settings.multi_selection && p.features.multi_selection ? 'multiple="multiple"' : "") + " />";
  1657. G.scrollTop = 100;
  1658. E = k.getElementById(p.id + "_html5");
  1659. if (w.features.triggerDialog) {
  1660. j.extend(E.style, {position: "absolute", width: "100%", height: "100%"})
  1661. } else {
  1662. j.extend(E.style, {cssFloat: "right", styleFloat: "right"})
  1663. }
  1664. E.onchange = function() {
  1665. o(this.files);
  1666. this.value = ""
  1667. };
  1668. F = k.getElementById(w.settings.browse_button);
  1669. if (F) {
  1670. var z = w.settings.browse_button_hover, A = w.settings.browse_button_active, x = w.features.triggerDialog ? F : G;
  1671. if (z) {
  1672. j.addEvent(x, "mouseover", function() {
  1673. j.addClass(F, z)
  1674. }, w.id);
  1675. j.addEvent(x, "mouseout", function() {
  1676. j.removeClass(F, z)
  1677. }, w.id)
  1678. }
  1679. if (A) {
  1680. j.addEvent(x, "mousedown", function() {
  1681. j.addClass(F, A)
  1682. }, w.id);
  1683. j.addEvent(k.body, "mouseup", function() {
  1684. j.removeClass(F, A)
  1685. }, w.id)
  1686. }
  1687. if (w.features.triggerDialog) {
  1688. j.addEvent(F, "click", function(H) {
  1689. var y = k.getElementById(w.id + "_html5");
  1690. if (y && !y.disabled) {
  1691. y.click()
  1692. }
  1693. H.preventDefault()
  1694. }, w.id)
  1695. }
  1696. }
  1697. });
  1698. p.bind("PostInit", function() {
  1699. var s = k.getElementById(p.settings.drop_element);
  1700. if (s) {
  1701. if (g) {
  1702. j.addEvent(s, "dragenter", function(w) {
  1703. var v, t, u;
  1704. v = k.getElementById(p.id + "_drop");
  1705. if (!v) {
  1706. v = k.createElement("input");
  1707. v.setAttribute("type", "file");
  1708. v.setAttribute("id", p.id + "_drop");
  1709. v.setAttribute("multiple", "multiple");
  1710. j.addEvent(v, "change", function() {
  1711. o(this.files);
  1712. j.removeEvent(v, "change", p.id);
  1713. v.parentNode.removeChild(v)
  1714. }, p.id);
  1715. s.appendChild(v)
  1716. }
  1717. t = j.getPos(s, k.getElementById(p.settings.container));
  1718. u = j.getSize(s);
  1719. if (j.getStyle(s, "position") === "static") {
  1720. j.extend(s.style, {position: "relative"})
  1721. }
  1722. j.extend(v.style, {position: "absolute", display: "block", top: 0, left: 0, width: u.w + "px", height: u.h + "px", opacity: 0})
  1723. }, p.id);
  1724. return
  1725. }
  1726. j.addEvent(s, "dragover", function(t) {
  1727. t.preventDefault()
  1728. }, p.id);
  1729. j.addEvent(s, "drop", function(u) {
  1730. var t = u.dataTransfer;
  1731. if (t && t.files) {
  1732. o(t.files)
  1733. }
  1734. u.preventDefault()
  1735. }, p.id)
  1736. }
  1737. });
  1738. p.bind("Refresh", function(s) {
  1739. var t, u, v, x, w;
  1740. t = k.getElementById(p.settings.browse_button);
  1741. if (t) {
  1742. u = j.getPos(t, k.getElementById(s.settings.container));
  1743. v = j.getSize(t);
  1744. x = k.getElementById(p.id + "_html5_container");
  1745. j.extend(x.style, {top: u.y + "px", left: u.x + "px", width: v.w + "px", height: v.h + "px"});
  1746. if (p.features.triggerDialog) {
  1747. if (j.getStyle(t, "position") === "static") {
  1748. j.extend(t.style, {position: "relative"})
  1749. }
  1750. w = parseInt(j.getStyle(t, "z-index"), 10);
  1751. if (isNaN(w)) {
  1752. w = 0
  1753. }
  1754. j.extend(t.style, {zIndex: w});
  1755. j.extend(x.style, {zIndex: w - 1})
  1756. }
  1757. }
  1758. });
  1759. p.bind("DisableBrowse", function(s, u) {
  1760. var t = k.getElementById(s.id + "_html5");
  1761. if (t) {
  1762. t.disabled = u
  1763. }
  1764. });
  1765. p.bind("CancelUpload", function() {
  1766. if (q && q.abort) {
  1767. q.abort()
  1768. }
  1769. });
  1770. p.bind("UploadFile", function(s, u) {
  1771. var v = s.settings, y, t;
  1772. function x(A, D, z) {
  1773. var B;
  1774. if (File.prototype.slice) {
  1775. try {
  1776. A.slice();
  1777. return A.slice(D, z)
  1778. } catch(C) {
  1779. return A.slice(D, z - D)
  1780. }
  1781. } else {
  1782. if (B = File.prototype.webkitSlice || File.prototype.mozSlice) {
  1783. return B.call(A, D, z)
  1784. } else {
  1785. return null
  1786. }
  1787. }
  1788. }
  1789. function w(A) {
  1790. var D = 0, C = 0, z = ("FileReader" in h) ? new FileReader : null;
  1791. function B() {
  1792. var I, M, K, L, H, J, F, E = s.settings.url;
  1793. function G(V) {
  1794. var T = 0, N = "----pluploadboundary" + j.guid(), O, P = "--", U = "\r\n", R = "";
  1795. q = new XMLHttpRequest;
  1796. if (q.upload) {
  1797. q.upload.onprogress = function(W) {
  1798. u.loaded = Math.min(u.size, C + W.loaded - T);
  1799. s.trigger("UploadProgress", u)
  1800. }
  1801. }
  1802. q.onreadystatechange = function() {
  1803. var W, Y;
  1804. if (q.readyState == 4 && s.state !== j.STOPPED) {
  1805. try {
  1806. W = q.status
  1807. } catch(X) {
  1808. W = 0
  1809. }
  1810. if (W >= 400) {
  1811. s.trigger("Error", {code: j.HTTP_ERROR, message: j.translate("HTTP Error."), file: u, status: W})
  1812. } else {
  1813. if (K) {
  1814. Y = {chunk: D, chunks: K, response: q.responseText, status: W};
  1815. s.trigger("ChunkUploaded", u, Y);
  1816. C += J;
  1817. if (Y.cancelled) {
  1818. u.status = j.FAILED;
  1819. return
  1820. }
  1821. u.loaded = Math.min(u.size, (D + 1) * H)
  1822. } else {
  1823. u.loaded = u.size
  1824. }
  1825. s.trigger("UploadProgress", u);
  1826. V = I = O = R = null;
  1827. if (!K || ++D >= K) {
  1828. u.status = j.DONE;
  1829. s.trigger("FileUploaded", u, {response: q.responseText, status: W})
  1830. } else {
  1831. B()
  1832. }
  1833. }
  1834. }
  1835. };
  1836. if (s.settings.multipart && n.multipart) {
  1837. L.name = u.target_name || u.name;
  1838. q.open("post", E, true);
  1839. j.each(s.settings.headers, function(X, W) {
  1840. q.setRequestHeader(W, X)
  1841. });
  1842. if (typeof(V) !== "string" && !!h.FormData) {
  1843. O = new FormData();
  1844. j.each(j.extend(L, s.settings.multipart_params), function(X, W) {
  1845. O.append(W, X)
  1846. });
  1847. O.append(s.settings.file_data_name, V);
  1848. q.send(O);
  1849. return
  1850. }
  1851. if (typeof(V) === "string") {
  1852. q.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + N);
  1853. j.each(j.extend(L, s.settings.multipart_params), function(X, W) {
  1854. R += P + N + U + 'Content-Disposition: form-data; name="' + W + '"' + U + U;
  1855. R += unescape(encodeURIComponent(X)) + U
  1856. });
  1857. F = j.mimeTypes[u.name.replace(/^.+\.([^.]+)/, "$1").toLowerCase()] || "application/octet-stream";
  1858. R += P + N + U + 'Content-Disposition: form-data; name="' + s.settings.file_data_name + '"; filename="' + unescape(encodeURIComponent(u.name)) + '"' + U + "Content-Type: " + F + U + U + V + U + P + N + P + U;
  1859. T = R.length - V.length;
  1860. V = R;
  1861. if (q.sendAsBinary) {
  1862. q.sendAsBinary(V)
  1863. } else {
  1864. if (n.canSendBinary) {
  1865. var S = new Uint8Array(V.length);
  1866. for (var Q = 0; Q < V.length; Q++) {
  1867. S[Q] = (V.charCodeAt(Q) & 255)
  1868. }
  1869. q.send(S.buffer)
  1870. }
  1871. }
  1872. return
  1873. }
  1874. }
  1875. E = j.buildUrl(s.settings.url, j.extend(L, s.settings.multipart_params));
  1876. q.open("post", E, true);
  1877. q.setRequestHeader("Content-Type", "application/octet-stream");
  1878. j.each(s.settings.headers, function(X, W) {
  1879. q.setRequestHeader(W, X)
  1880. });
  1881. q.send(V)
  1882. }
  1883. if (u.status == j.DONE || u.status == j.FAILED || s.state == j.STOPPED) {
  1884. return
  1885. }
  1886. L = {name: u.target_name || u.name};
  1887. if (v.chunk_size && u.size > v.chunk_size && (n.chunks || typeof(A) == "string")) {
  1888. H = v.chunk_size;
  1889. K = Math.ceil(u.size / H);
  1890. J = Math.min(H, u.size - (D * H));
  1891. if (typeof(A) == "string") {
  1892. I = A.substring(D * H, D * H + J)
  1893. } else {
  1894. I = x(A, D * H, D * H + J)
  1895. }
  1896. L.chunk = D;
  1897. L.chunks = K
  1898. } else {
  1899. J = u.size;
  1900. I = A
  1901. }
  1902. if (s.settings.multipart && n.multipart && typeof(I) !== "string" && z && n.cantSendBlobInFormData && n.chunks && s.settings.chunk_size) {
  1903. z.onload = function() {
  1904. G(z.result)
  1905. };
  1906. z.readAsBinaryString(I)
  1907. } else {
  1908. G(I)
  1909. }
  1910. }
  1911. B()
  1912. }
  1913. y = c[u.id];
  1914. if (n.jpgresize && s.settings.resize && /\.(png|jpg|jpeg)$/i.test(u.name)) {
  1915. d.call(s, u, s.settings.resize, /\.png$/i.test(u.name) ? "image/png" : "image/jpeg", function(z) {
  1916. if (z.success) {
  1917. u.size = z.data.length;
  1918. w(z.data)
  1919. } else {
  1920. if (n.chunks) {
  1921. w(y)
  1922. } else {
  1923. l(y, w)
  1924. }
  1925. }
  1926. })
  1927. } else {
  1928. if (!n.chunks && n.jpgresize) {
  1929. l(y, w)
  1930. } else {
  1931. w(y)
  1932. }
  1933. }
  1934. });
  1935. p.bind("Destroy", function(s) {
  1936. var u, v, t = k.body, w = {inputContainer: s.id + "_html5_container", inputFile: s.id + "_html5", browseButton: s.settings.browse_button, dropElm: s.settings.drop_element};
  1937. for (u in w) {
  1938. v = k.getElementById(w[u]);
  1939. if (v) {
  1940. j.removeAllEvents(v, s.id)
  1941. }
  1942. }
  1943. j.removeAllEvents(k.body, s.id);
  1944. if (s.settings.container) {
  1945. t = k.getElementById(s.settings.container)
  1946. }
  1947. t.removeChild(k.getElementById(w.inputContainer))
  1948. });
  1949. r({success: true})
  1950. }});
  1951. function b() {
  1952. var q = false, o;
  1953. function r(t, v) {
  1954. var s = q ? 0 : -8 * (v - 1), w = 0, u;
  1955. for (u = 0; u < v; u++) {
  1956. w |= (o.charCodeAt(t + u) << Math.abs(s + u * 8))
  1957. }
  1958. return w
  1959. }
  1960. function n(u, s, t) {
  1961. var t = arguments.length === 3 ? t : o.length - s - 1;
  1962. o = o.substr(0, s) + u + o.substr(t + s)
  1963. }
  1964. function p(t, u, w) {
  1965. var x = "", s = q ? 0 : -8 * (w - 1), v;
  1966. for (v = 0; v < w; v++) {
  1967. x += String.fromCharCode((u >> Math.abs(s + v * 8)) & 255)
  1968. }
  1969. n(x, t, w)
  1970. }
  1971. return{II: function(s) {
  1972. if (s === e) {
  1973. return q
  1974. } else {
  1975. q = s
  1976. }
  1977. }, init: function(s) {
  1978. q = false;
  1979. o = s
  1980. }, SEGMENT: function(s, u, t) {
  1981. switch(arguments.length) {
  1982. case 1:
  1983. return o.substr(s, o.length - s - 1);
  1984. case 2:
  1985. return o.substr(s, u);
  1986. case 3:
  1987. n(t, s, u);
  1988. break;
  1989. default:
  1990. return o
  1991. }
  1992. }, BYTE: function(s) {
  1993. return r(s, 1)
  1994. }, SHORT: function(s) {
  1995. return r(s, 2)
  1996. }, LONG: function(s, t) {
  1997. if (t === e) {
  1998. return r(s, 4)
  1999. } else {
  2000. p(s, t, 4)
  2001. }
  2002. }, SLONG: function(s) {
  2003. var t = r(s, 4);
  2004. return(t > 2147483647 ? t - 4294967296 : t)
  2005. }, STRING: function(s, t) {
  2006. var u = "";
  2007. for (t += s; s < t; s++) {
  2008. u += String.fromCharCode(r(s, 1))
  2009. }
  2010. return u
  2011. }}
  2012. }
  2013. function f(s) {
  2014. var u = {65505: {app: "EXIF", name: "APP1", signature: "Exif\0"}, 65506: {app: "ICC", name: "APP2", signature: "ICC_PROFILE\0"}, 65517: {app: "IPTC", name: "APP13", signature: "Photoshop 3.0\0"}}, t = [], r, n, p = e, q = 0, o;
  2015. r = new b();
  2016. r.init(s);
  2017. if (r.SHORT(0) !== 65496) {
  2018. return
  2019. }
  2020. n = 2;
  2021. o = Math.min(1048576, s.length);
  2022. while (n <= o) {
  2023. p = r.SHORT(n);
  2024. if (p >= 65488 && p <= 65495) {
  2025. n += 2;
  2026. continue
  2027. }
  2028. if (p === 65498 || p === 65497) {
  2029. break
  2030. }
  2031. q = r.SHORT(n + 2) + 2;
  2032. if (u[p] && r.STRING(n + 4, u[p].signature.length) === u[p].signature) {
  2033. t.push({hex: p, app: u[p].app.toUpperCase(), name: u[p].name.toUpperCase(), start: n, length: q, segment: r.SEGMENT(n, q)})
  2034. }
  2035. n += q
  2036. }
  2037. r.init(null);
  2038. return{headers: t, restore: function(y) {
  2039. r.init(y);
  2040. var w = new f(y);
  2041. if (!w.headers) {
  2042. return false
  2043. }
  2044. for (var x = w.headers.length; x > 0; x--) {
  2045. var z = w.headers[x - 1];
  2046. r.SEGMENT(z.start, z.length, "")
  2047. }
  2048. w.purge();
  2049. n = r.SHORT(2) == 65504 ? 4 + r.SHORT(4) : 2;
  2050. for (var x = 0, v = t.length; x < v; x++) {
  2051. r.SEGMENT(n, 0, t[x].segment);
  2052. n += t[x].length
  2053. }
  2054. return r.SEGMENT()
  2055. }, get: function(x) {
  2056. var y = [];
  2057. for (var w = 0, v = t.length; w < v; w++) {
  2058. if (t[w].app === x.toUpperCase()) {
  2059. y.push(t[w].segment)
  2060. }
  2061. }
  2062. return y
  2063. }, set: function(y, x) {
  2064. var z = [];
  2065. if (typeof(x) === "string") {
  2066. z.push(x)
  2067. } else {
  2068. z = x
  2069. }
  2070. for (var w = ii = 0, v = t.length; w < v; w++) {
  2071. if (t[w].app === y.toUpperCase()) {
  2072. t[w].segment = z[ii];
  2073. t[w].length = z[ii].length;
  2074. ii++
  2075. }
  2076. if (ii >= z.length) {
  2077. break
  2078. }
  2079. }
  2080. }, purge: function() {
  2081. t = [];
  2082. r.init(null)
  2083. }}
  2084. }
  2085. function a() {
  2086. var q, n, o = {}, t;
  2087. q = new b();
  2088. n = {tiff: {274: "Orientation", 34665: "ExifIFDPointer", 34853: "GPSInfoIFDPointer"}, exif: {36864: "ExifVersion", 40961: "ColorSpace", 40962: "PixelXDimension", 40963: "PixelYDimension", 36867: "DateTimeOriginal", 33434: "ExposureTime", 33437: "FNumber", 34855: "ISOSpeedRatings", 37377: "ShutterSpeedValue", 37378: "ApertureValue", 37383: "MeteringMode", 37384: "LightSource", 37385: "Flash", 41986: "ExposureMode", 41987: "WhiteBalance", 41990: "SceneCaptureType", 41988: "DigitalZoomRatio", 41992: "Contrast", 41993: "Saturation", 41994: "Sharpness"}, gps: {0: "GPSVersionID", 1: "GPSLatitudeRef", 2: "GPSLatitude", 3: "GPSLongitudeRef", 4: "GPSLongitude"}};
  2089. t = {ColorSpace: {1: "sRGB", 0: "Uncalibrated"}, MeteringMode: {0: "Unknown", 1: "Average", 2: "CenterWeightedAverage", 3: "Spot", 4: "MultiSpot", 5: "Pattern", 6: "Partial", 255: "Other"}, LightSource: {1: "Daylight", 2: "Fliorescent", 3: "Tungsten", 4: "Flash", 9: "Fine weather", 10: "Cloudy weather", 11: "Shade", 12: "Daylight fluorescent (D 5700 - 7100K)", 13: "Day white fluorescent (N 4600 -5400K)", 14: "Cool white fluorescent (W 3900 - 4500K)", 15: "White fluorescent (WW 3200 - 3700K)", 17: "Standard light A", 18: "Standard light B", 19: "Standard light C", 20: "D55", 21: "D65", 22: "D75", 23: "D50", 24: "ISO studio tungsten", 255: "Other"}, Flash: {0: "Flash did not fire.", 1: "Flash fired.", 5: "Strobe return light not detected.", 7: "Strobe return light detected.", 9: "Flash fired, compulsory flash mode", 13: "Flash fired, compulsory flash mode, return light not detected", 15: "Flash fired, compulsory flash mode, return light detected", 16: "Flash did not fire, compulsory flash mode", 24: "Flash did not fire, auto mode", 25: "Flash fired, auto mode", 29: "Flash fired, auto mode, return light not detected", 31: "Flash fired, auto mode, return light detected", 32: "No flash function", 65: "Flash fired, red-eye reduction mode", 69: "Flash fired, red-eye reduction mode, return light not detected", 71: "Flash fired, red-eye reduction mode, return light detected", 73: "Flash fired, compulsory flash mode, red-eye reduction mode", 77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected", 79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected", 89: "Flash fired, auto mode, red-eye reduction mode", 93: "Flash fired, auto mode, return light not detected, red-eye reduction mode", 95: "Flash fired, auto mode, return light detected, red-eye reduction mode"}, ExposureMode: {0: "Auto exposure", 1: "Manual exposure", 2: "Auto bracket"}, WhiteBalance: {0: "Auto white balance", 1: "Manual white balance"}, SceneCaptureType: {0: "Standard", 1: "Landscape", 2: "Portrait", 3: "Night scene"}, Contrast: {0: "Normal", 1: "Soft", 2: "Hard"}, Saturation: {0: "Normal", 1: "Low saturation", 2: "High saturation"}, Sharpness: {0: "Normal", 1: "Soft", 2: "Hard"}, GPSLatitudeRef: {N: "North latitude", S: "South latitude"}, GPSLongitudeRef: {E: "East longitude", W: "West longitude"}};
  2090. function p(u, C) {
  2091. var w = q.SHORT(u), z, F, G, B, A, v, x, D, E = [], y = {};
  2092. for (z = 0; z < w; z++) {
  2093. x = v = u + 12 * z + 2;
  2094. G = C[q.SHORT(x)];
  2095. if (G === e) {
  2096. continue
  2097. }
  2098. B = q.SHORT(x += 2);
  2099. A = q.LONG(x += 2);
  2100. x += 4;
  2101. E = [];
  2102. switch(B) {
  2103. case 1:
  2104. case 7:
  2105. if (A > 4) {
  2106. x = q.LONG(x) + o.tiffHeader
  2107. }
  2108. for (F = 0; F < A; F++) {
  2109. E[F] = q.BYTE(x + F)
  2110. }
  2111. break;
  2112. case 2:
  2113. if (A > 4) {
  2114. x = q.LONG(x) + o.tiffHeader
  2115. }
  2116. y[G] = q.STRING(x, A - 1);
  2117. continue;
  2118. case 3:
  2119. if (A > 2) {
  2120. x = q.LONG(x) + o.tiffHeader
  2121. }
  2122. for (F = 0; F < A; F++) {
  2123. E[F] = q.SHORT(x + F * 2)
  2124. }
  2125. break;
  2126. case 4:
  2127. if (A > 1) {
  2128. x = q.LONG(x) + o.tiffHeader
  2129. }
  2130. for (F = 0; F < A; F++) {
  2131. E[F] = q.LONG(x + F * 4)
  2132. }
  2133. break;
  2134. case 5:
  2135. x = q.LONG(x) + o.tiffHeader;
  2136. for (F = 0; F < A; F++) {
  2137. E[F] = q.LONG(x + F * 4) / q.LONG(x + F * 4 + 4)
  2138. }
  2139. break;
  2140. case 9:
  2141. x = q.LONG(x) + o.tiffHeader;
  2142. for (F = 0; F < A; F++) {
  2143. E[F] = q.SLONG(x + F * 4)
  2144. }
  2145. break;
  2146. case 10:
  2147. x = q.LONG(x) + o.tiffHeader;
  2148. for (F = 0; F < A; F++) {
  2149. E[F] = q.SLONG(x + F * 4) / q.SLONG(x + F * 4 + 4)
  2150. }
  2151. break;
  2152. default:
  2153. continue
  2154. }
  2155. D = (A == 1 ? E[0] : E);
  2156. if (t.hasOwnProperty(G) && typeof D != "object") {
  2157. y[G] = t[G][D]
  2158. } else {
  2159. y[G] = D
  2160. }
  2161. }
  2162. return y
  2163. }
  2164. function s() {
  2165. var v = e, u = o.tiffHeader;
  2166. q.II(q.SHORT(u) == 18761);
  2167. if (q.SHORT(u += 2) !== 42) {
  2168. return false
  2169. }
  2170. o.IFD0 = o.tiffHeader + q.LONG(u += 2);
  2171. v = p(o.IFD0, n.tiff);
  2172. o.exifIFD = ("ExifIFDPointer" in v ? o.tiffHeader + v.ExifIFDPointer : e);
  2173. o.gpsIFD = ("GPSInfoIFDPointer" in v ? o.tiffHeader + v.GPSInfoIFDPointer : e);
  2174. return true
  2175. }
  2176. function r(w, u, z) {
  2177. var B, y, x, A = 0;
  2178. if (typeof(u) === "string") {
  2179. var v = n[w.toLowerCase()];
  2180. for (hex in v) {
  2181. if (v[hex] === u) {
  2182. u = hex;
  2183. break
  2184. }
  2185. }
  2186. }
  2187. B = o[w.toLowerCase() + "IFD"];
  2188. y = q.SHORT(B);
  2189. for (i = 0; i < y; i++) {
  2190. x = B + 12 * i + 2;
  2191. if (q.SHORT(x) == u) {
  2192. A = x + 8;
  2193. break
  2194. }
  2195. }
  2196. if (!A) {
  2197. return false
  2198. }
  2199. q.LONG(A, z);
  2200. return true
  2201. }
  2202. return{init: function(u) {
  2203. o = {tiffHeader: 10};
  2204. if (u === e || !u.length) {
  2205. return false
  2206. }
  2207. q.init(u);
  2208. if (q.SHORT(0) === 65505 && q.STRING(4, 5).toUpperCase() === "EXIF\0") {
  2209. return s()
  2210. }
  2211. return false
  2212. }, EXIF: function() {
  2213. var v;
  2214. v = p(o.exifIFD, n.exif);
  2215. if (v.ExifVersion && j.typeOf(v.ExifVersion) === "array") {
  2216. for (var w = 0, u = ""; w < v.ExifVersion.length; w++) {
  2217. u += String.fromCharCode(v.ExifVersion[w])
  2218. }
  2219. v.ExifVersion = u
  2220. }
  2221. return v
  2222. }, GPS: function() {
  2223. var u;
  2224. u = p(o.gpsIFD, n.gps);
  2225. if (u.GPSVersionID) {
  2226. u.GPSVersionID = u.GPSVersionID.join(".")
  2227. }
  2228. return u
  2229. }, setExif: function(u, v) {
  2230. if (u !== "PixelXDimension" && u !== "PixelYDimension") {
  2231. return false
  2232. }
  2233. return r("exif", u, v)
  2234. }, getBinary: function() {
  2235. return q.SEGMENT()
  2236. }}
  2237. }
  2238. })(window, document, plupload);
  2239. (function(d, a, b, c) {
  2240. function e(f) {
  2241. return a.getElementById(f)
  2242. }
  2243. b.runtimes.Html4 = b.addRuntime("html4", {getFeatures: function() {
  2244. return{multipart: true, triggerDialog: (b.ua.gecko && d.FormData || b.ua.webkit)}
  2245. }, init: function(f, g) {
  2246. f.bind("Init", function(p) {
  2247. var j = a.body, n, h = "javascript", k, x, q, z = [], r = /MSIE/.test(navigator.userAgent), t = [], m = p.settings.filters, o, l, s, w;
  2248. no_type_restriction:for (o = 0; o < m.length; o++) {
  2249. l = m[o].extensions.split(/,/);
  2250. for (w = 0; w < l.length; w++) {
  2251. if (l[w] === "*") {
  2252. t = [];
  2253. break no_type_restriction
  2254. }
  2255. s = b.mimeTypes[l[w]];
  2256. if (s && b.inArray(s, t) === -1) {
  2257. t.push(s)
  2258. }
  2259. }
  2260. }
  2261. t = t.join(",");
  2262. function v() {
  2263. var C, A, y, B;
  2264. q = b.guid();
  2265. z.push(q);
  2266. C = a.createElement("form");
  2267. C.setAttribute("id", "form_" + q);
  2268. C.setAttribute("method", "post");
  2269. C.setAttribute("enctype", "multipart/form-data");
  2270. C.setAttribute("encoding", "multipart/form-data");
  2271. C.setAttribute("target", p.id + "_iframe");
  2272. C.style.position = "absolute";
  2273. A = a.createElement("input");
  2274. A.setAttribute("id", "input_" + q);
  2275. A.setAttribute("type", "file");
  2276. A.setAttribute("accept", t);
  2277. A.setAttribute("size", 1);
  2278. B = e(p.settings.browse_button);
  2279. if (p.features.triggerDialog && B) {
  2280. b.addEvent(e(p.settings.browse_button), "click", function(D) {
  2281. if (!A.disabled) {
  2282. A.click()
  2283. }
  2284. D.preventDefault()
  2285. }, p.id)
  2286. }
  2287. b.extend(A.style, {width: "100%", height: "100%", opacity: 0, fontSize: "99px", cursor: "pointer"});
  2288. b.extend(C.style, {overflow: "hidden"});
  2289. y = p.settings.shim_bgcolor;
  2290. if (y) {
  2291. C.style.background = y
  2292. }
  2293. if (r) {
  2294. b.extend(A.style, {filter: "alpha(opacity=0)"})
  2295. }
  2296. b.addEvent(A, "change", function(G) {
  2297. var E = G.target, D, F = [], H;
  2298. if (E.value) {
  2299. e("form_" + q).style.top = -1048575 + "px";
  2300. D = E.value.replace(/\\/g, "/");
  2301. D = D.substring(D.length, D.lastIndexOf("/") + 1);
  2302. F.push(new b.File(q, D));
  2303. if (!p.features.triggerDialog) {
  2304. b.removeAllEvents(C, p.id)
  2305. } else {
  2306. b.removeEvent(B, "click", p.id)
  2307. }
  2308. b.removeEvent(A, "change", p.id);
  2309. v();
  2310. if (F.length) {
  2311. f.trigger("FilesAdded", F)
  2312. }
  2313. }
  2314. }, p.id);
  2315. C.appendChild(A);
  2316. j.appendChild(C);
  2317. p.refresh()
  2318. }
  2319. function u() {
  2320. var y = a.createElement("div");
  2321. y.innerHTML = '<iframe id="' + p.id + '_iframe" name="' + p.id + '_iframe" src="' + h + ':&quot;&quot;" style="display:none"></iframe>';
  2322. n = y.firstChild;
  2323. j.appendChild(n);
  2324. b.addEvent(n, "load", function(D) {
  2325. var E = D.target, C, A;
  2326. if (!k) {
  2327. return
  2328. }
  2329. try {
  2330. C = E.contentWindow.document || E.contentDocument || d.frames[E.id].document
  2331. } catch(B) {
  2332. p.trigger("Error", {code: b.SECURITY_ERROR, message: b.translate("Security error."), file: k});
  2333. return
  2334. }
  2335. A = C.body.innerHTML;
  2336. if (A) {
  2337. k.status = b.DONE;
  2338. k.loaded = 1025;
  2339. k.percent = 100;
  2340. p.trigger("UploadProgress", k);
  2341. p.trigger("FileUploaded", k, {response: A})
  2342. }
  2343. }, p.id)
  2344. }
  2345. if (p.settings.container) {
  2346. j = e(p.settings.container);
  2347. if (b.getStyle(j, "position") === "static") {
  2348. j.style.position = "relative"
  2349. }
  2350. }
  2351. p.bind("UploadFile", function(y, B) {
  2352. var C, A;
  2353. if (B.status == b.DONE || B.status == b.FAILED || y.state == b.STOPPED) {
  2354. return
  2355. }
  2356. C = e("form_" + B.id);
  2357. A = e("input_" + B.id);
  2358. A.setAttribute("name", y.settings.file_data_name);
  2359. C.setAttribute("action", y.settings.url);
  2360. b.each(b.extend({name: B.target_name || B.name}, y.settings.multipart_params), function(F, D) {
  2361. var E = a.createElement("input");
  2362. b.extend(E, {type: "hidden", name: D, value: F});
  2363. C.insertBefore(E, C.firstChild)
  2364. });
  2365. k = B;
  2366. e("form_" + q).style.top = -1048575 + "px";
  2367. C.submit()
  2368. });
  2369. p.bind("FileUploaded", function(y) {
  2370. y.refresh()
  2371. });
  2372. p.bind("StateChanged", function(y) {
  2373. if (y.state == b.STARTED) {
  2374. u()
  2375. } else {
  2376. if (y.state == b.STOPPED) {
  2377. d.setTimeout(function() {
  2378. b.removeEvent(n, "load", y.id);
  2379. if (n.parentNode) {
  2380. n.parentNode.removeChild(n)
  2381. }
  2382. }, 0)
  2383. }
  2384. }
  2385. b.each(y.files, function(B, A) {
  2386. if (B.status === b.DONE || B.status === b.FAILED) {
  2387. var C = e("form_" + B.id);
  2388. if (C) {
  2389. C.parentNode.removeChild(C)
  2390. }
  2391. }
  2392. })
  2393. });
  2394. p.bind("Refresh", function(A) {
  2395. var G, B, C, D, y, H, I, F, E;
  2396. G = e(A.settings.browse_button);
  2397. if (G) {
  2398. y = b.getPos(G, e(A.settings.container));
  2399. H = b.getSize(G);
  2400. I = e("form_" + q);
  2401. F = e("input_" + q);
  2402. b.extend(I.style, {top: y.y + "px", left: y.x + "px", width: H.w + "px", height: H.h + "px"});
  2403. if (A.features.triggerDialog) {
  2404. if (b.getStyle(G, "position") === "static") {
  2405. b.extend(G.style, {position: "relative"})
  2406. }
  2407. E = parseInt(G.style.zIndex, 10);
  2408. if (isNaN(E)) {
  2409. E = 0
  2410. }
  2411. b.extend(G.style, {zIndex: E});
  2412. b.extend(I.style, {zIndex: E - 1})
  2413. }
  2414. C = A.settings.browse_button_hover;
  2415. D = A.settings.browse_button_active;
  2416. B = A.features.triggerDialog ? G : I;
  2417. if (C) {
  2418. b.addEvent(B, "mouseover", function() {
  2419. b.addClass(G, C)
  2420. }, A.id);
  2421. b.addEvent(B, "mouseout", function() {
  2422. b.removeClass(G, C)
  2423. }, A.id)
  2424. }
  2425. if (D) {
  2426. b.addEvent(B, "mousedown", function() {
  2427. b.addClass(G, D)
  2428. }, A.id);
  2429. b.addEvent(a.body, "mouseup", function() {
  2430. b.removeClass(G, D)
  2431. }, A.id)
  2432. }
  2433. }
  2434. });
  2435. f.bind("FilesRemoved", function(y, B) {
  2436. var A, C;
  2437. for (A = 0; A < B.length; A++) {
  2438. C = e("form_" + B[A].id);
  2439. if (C) {
  2440. C.parentNode.removeChild(C)
  2441. }
  2442. }
  2443. });
  2444. f.bind("DisableBrowse", function(y, B) {
  2445. var A = a.getElementById("input_" + q);
  2446. if (A) {
  2447. A.disabled = B
  2448. }
  2449. });
  2450. f.bind("Destroy", function(y) {
  2451. var A, B, C, D = {inputContainer: "form_" + q, inputFile: "input_" + q, browseButton: y.settings.browse_button};
  2452. for (A in D) {
  2453. B = e(D[A]);
  2454. if (B) {
  2455. b.removeAllEvents(B, y.id)
  2456. }
  2457. }
  2458. b.removeAllEvents(a.body, y.id);
  2459. b.each(z, function(F, E) {
  2460. C = e("form_" + F);
  2461. if (C) {
  2462. j.removeChild(C)
  2463. }
  2464. })
  2465. });
  2466. v()
  2467. });
  2468. g({success: true})
  2469. }})
  2470. })(window, document, plupload);