/*
 * DEXTUploadX5 - DX5ImagePreivew
 * http://www.dextsolution.com
 *
 * Copyright ⓒ DEXTSolution Inc.
 */
var DX5ImagePreivew = 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-pv-style") === -1) { var popcss = tdoc.createElement("link"); popcss.setAttribute("rel", "stylesheet"); popcss.setAttribute("type", "text/css"); popcss.setAttribute("href", combinePath(manager.rootPath, "./pop/dextuploadx5-pv-style.css"));
headTag.appendChild(popcss); popwin.declarationDX5PopupStyle.push("dextuploadx5-pv-style"); } var self = this; var ppvwin = tdoc.createElement("div"); ppvwin.classList.add("dx5-pop-pv"); ppvwin.style.cursor = "pointer"; ppvwin.onclick = function () { self.hide(); }; tdoc.documentElement.appendChild(ppvwin); var ppvimg = tdoc.createElement("img"); ppvimg.classList.add("dx5-pop-pv-media"); ppvimg.src = ""; ppvimg.alt = "preview"; ppvimg.style.cursor = "pointer"; ppvimg.onclick = function () { self.hide(); }; ppvwin.appendChild(ppvimg);
this.pwn = ppvwin; this.pob = ppvimg; this.mng = manager; }; DX5ImagePreivew.prototype.show = function (source, color) { if (!this.pwn.style.backgroundColor || this.pwn.style.backgroundColor != color) { this.pwn.style.backgroundColor = color; } this.pob.src = source; addClass(this.pwn, "is-visible"); addClass(this.pob, "is-visible"); }; DX5ImagePreivew.prototype.hide = function () { this.pob.src = ""; removeClass(this.pob, "is-visible"); removeClass(this.pwn, "is-visible"); }; 