/*
 * DEXTUploadX5 - DX5CompressProgress
 * http://www.dextsolution.com
 *
 * Copyright ⓒ DEXTSolution Inc.
 */
var DX5CompressProgress = function (manager, popwin) { var tdoc = popwin.document; var headTag = tdoc.querySelector("head"); if (!headTag) { headTag = tdoc.createElement("head"); tdoc.documentElement.appendChild(headTag); } if (!popwin.declarationDX5PopupStyle) {       popwin.declarationDX5PopupStyle = []; } if (popwin.declarationDX5PopupStyle.indexOf("dextuploadx5-cp-style") === -1) { var popcss = tdoc.createElement("link"); popcss.setAttribute("rel", "stylesheet"); popcss.setAttribute("type", "text/css"); popcss.setAttribute("href", combinePath(manager.rootPath, "./pop/dextuploadx5-cp-style.css"));
headTag.appendChild(popcss); popwin.declarationDX5PopupStyle.push("dextuploadx5-cp-style"); } var pcpwin = tdoc.createElement("div"); pcpwin.classList.add("dx5-pop-cp"); tdoc.documentElement.appendChild(pcpwin); var pcpctn = tdoc.createElement("div"); pcpctn.classList.add("dx5-pop-cp-container"); pcpwin.appendChild(pcpctn); var pcpobj = tdoc.createElement("object"); pcpobj.classList.add("dx5-pop-cp-svg"); pcpobj.style.width = "100%"; pcpobj.style.height = "100%"; pcpobj.type = "image/svg+xml"; pcpobj.data = combinePath(manager.rootPath, "./pop/dextuploadx5-cp.svg"); pcpctn.appendChild(pcpobj);
this.pwn = pcpwin; this.pob = pcpobj; this.mng = manager; }; DX5CompressProgress.prototype.show = function (id) { if (!id) return; var tw = this.pwn; var to = this.pob; var mn = this.mng; addClass(tw, "is-visible"); (function detectPopup(delay) { if (delay < 0) { mn.throwErr(id, "EX5-15", mn.errs.get("EX5-15", "_The progress compress window doesn't exist for DEXTUploadX5.")); return; } if (to && to.contentDocument && typeof (to.contentDocument.updateUI) == "function") { to.contentDocument.updateUI(mn.get(id)); } else {
setTimeout(function () { detectPopup(delay - 1000); }, 100); } })(3000); }; DX5CompressProgress.prototype.hide = function (id, force, callback) { console.log("DX5: Hide progress compress window(" + id + ") " + (force ? "by force" : "") + "."); var tw = this.pwn; var to = this.pob; var mn = this.mng; var md = mn.get(id);   if (md && force) md.stopCompressWaiting(); if (to && to.contentDocument && typeof (to.contentDocument.stopUI) == "function") { to.contentDocument.stopUI(); removeClass(tw, "is-visible"); if (callback && typeof (callback) == "function") callback();
} }; 