/*
 * DEXTUploadX5 - DX5HDUpdateProgress
 * http://www.dextsolution.com
 *
 * Copyright ⓒ DEXTSolution Inc.
 */
var DX5HDUpdateProgress = 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-ud-style") === -1) { var popcss = tdoc.createElement("link"); popcss.setAttribute("rel", "stylesheet"); popcss.setAttribute("type", "text/css"); popcss.setAttribute("href", combinePath(manager.rootPath, "./pop/dextuploadx5-ud-style.css"));
headTag.appendChild(popcss); popwin.declarationDX5PopupStyle.push("dextuploadx5-ud-style"); } var pudwin = tdoc.createElement("div"); pudwin.classList.add("dx5-pop-ud"); tdoc.documentElement.appendChild(pudwin); var pudctn = tdoc.createElement("div"); pudctn.classList.add("dx5-pop-ud-container"); pudwin.appendChild(pudctn); var pudobj = tdoc.createElement("object"); pudobj.classList.add("dx5-pop-ud-svg"); pudobj.style.width = "100%"; pudobj.style.height = "100%"; pudobj.type = "image/svg+xml"; pudobj.data = combinePath(manager.rootPath, "./pop/dextuploadx5-ud.svg"); pudctn.appendChild(pudobj);
this.pwn = pudwin; this.pob = pudobj; this.mng = manager; }; DX5HDUpdateProgress.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-19", mn.errs.get("EX5-19", "_The progress update 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); }; DX5HDUpdateProgress.prototype.hide = function (id, force, callback) { console.log("DX5: Hide the progress window(" + id + ") of updating " + (force ? "by force" : "") + "."); var tw = this.pwn; var to = this.pob; var mn = this.mng; var md = mn.get(id); if (to && to.contentDocument && typeof (to.contentDocument.stopUI) == "function") { to.contentDocument.stopUI(); removeClass(tw, "is-visible"); if (callback && typeof (callback) == "function") callback(); }
}; 