book = { width: 600, height: 400, minWidth: 560, scale: 1, getSize: function () { document.getElementById("Page") && (book.width = 400 < document.getElementById("Page").offsetWidth ? document.getElementById("Page").offsetWidth : 400, book.height = document.getElementById("Page").offsetHeight, book.minWidth = 400 >= book.width ? book.width + 160 : book.minWidth, document.getElementsByTagName("body")[0].style.minWidth = book.minWidth + "px") }, correct: function () { book.width > workspace.w - 160 ? (workspace.w > book.minWidth ? (book.scale = (workspace.w - 160) / book.width, document.getElementById("Book").style.width = book.width * book.scale + "px") : (book.scale = 400 / book.width, document.getElementById("Book").style.width = "400px"), document.getElementById("Page").style.height = book.height * book.scale + "px") : 400 > document.getElementById("Book").offsetWidth && (book.scale = 400 / document.getElementById("Book").style.width.split("px")[0], document.getElementById("Book").style.width = "400px", document.getElementById("Page").style.height = book.height * book.scale + "px", console.log("scale: " + book.scale)); document.getElementById("navigation") && (document.getElementById("navigation").style.width = book.width * book.scale > book.minWidth ? book.width * book.scale + 120 + "px" : book.minWidth + "px", book.minWidth < workspace.w && (browser.supportHTML5 ? document.getElementById("navigation").style.left = (workspace.w - book.width * book.scale - 135) / 2 + "px" : document.getElementById("navigation").style.left = (workspace.w - book.width * book.scale - 120) / 2 + "px")); if (!browser.supportHTML5) { var c = document.getElementById("bodyBg"), d = c.currentStyle || window.getComputedStyle(c, null); if ("none" != d.backgroundImage) { var a = document.createElement("img"); a.src = d.backgroundImage.substr(5, d.backgroundImage.length - 7); a.style.position = "fixed"; a.style.top = "0px"; a.style.left = "0px"; a.style.width = "100%"; a.style.height = "100%"; c.appendChild(a); c.style.backgroundImage = "none" } } }, checkLongString: function () { for (var c = document.getElementsByTagName("td"), d = 0; d < c.length; d++) { var a = c[d].parentNode.parentNode.parentNode, a = "LI" == a.tagName ? a : "LI" == a.parentNode.tagName ? a.parentNode : NaN; if (c[d].offsetWidth > a.offsetWidth - 40) { var a = a.offsetWidth - 40, b = c[d].getElementsByTagName("a"); b[0].innerText && (b[0].innerText = b[0].innerText.substring(0, a / 8) + "..."); b[0].innerHTML && (b[0].innerHTML = b[0].innerHTML.substring(0, a / 8) + "...") } } } }; function initContent() { book.getSize(); book.correct(); workspace.addListener(book.correct); window.sessionStorage && !window.sessionStorage.getItem(encodeURIComponent(FULL_SRC)) && (window.sessionStorage.setItem(encodeURIComponent(FULL_SRC), !0), about.action()); -1 != document.location.pathname.indexOf("toc.html") ? book.checkLongString() : zoom(book.scale) } var about = { isShow: !1, action: function () { about.isShow ? (document.getElementById("infoBalloon").style.opacity = 0, window.setTimeout(function () { document.getElementById("infoBalloon").style.display = "none" }, 500), about.isShow = !1) : (document.getElementById("infoBalloon").style.display = "block", document.getElementById("infoBalloon").style.opacity = 1, about.isShow = !0) } }; function localPending() { document.getElementById("fullVersionLink").innerText = LOCALS.FULL_VERSION; document.getElementById("fullVersionLink").href = "" != CURRENT_PAGE ? FULL_SRC + "#" + CURRENT_PAGE : FULL_SRC; document.getElementById("tocLink") && (document.getElementById("tocLink").innerText = LOCALS.TOC_TITLE); var c = "", c = "" != CURRENT_PAGE ? "index.html#" + CURRENT_PAGE : "index.html", d = "" != CURRENT_PAGE ? FULL_SRC + "#" + CURRENT_PAGE : FULL_SRC, c = browser.isFlash ? browser.supportHTML5 ? LOCALS.SEO_INFO_RECOMMENDATION1.replace("{0}", "<a href='" + decodeURIComponent("http://" + d) + "'>").replace("{1}", "</a>").replace("{2}", "<a href='" + c + "'>").replace("{3}", "</a>") : LOCALS.SEO_INFO_RECOMMENDATION1.replace("{0}", "<a href='" + decodeURIComponent("http://" + d) + "'>").split("{1}")[0] + "</a>" + LOCALS.SEO_INFO_RECOMMENDATION1.split("{3}")[1] : browser.supportHTML5 ? LOCALS.SEO_INFO_RECOMMENDATION3.replace("{0}", "<a href='" + decodeURIComponent("http://" + c) + "'>").replace("{1}", "</a>").replace("{2}", "<a href='" + decodeURIComponent("http://get.adobe.com/flashplayer/") + "' target='_blank'>").replace("{3}", "</a>") : LOCALS.SEO_INFO_RECOMMENDATION2.replace("{0}", "<a href='" + decodeURIComponent("http://windows.microsoft.com/en-us/internet-explorer/download-ie") + "' target='_blank'>").replace("{1}", "</a>").replace("{2}", "<a href='" + decodeURIComponent("http://get.adobe.com/flashplayer/") + "' target='_blank'>").replace("{3}", "</a>"); document.getElementById("boxVersion").innerHTML = LOCALS.SEO_VERSION + "<span style='position: relative; top:0px; left:0px; overflow: hidden;'><img src='./style/info.png' style='width: 14px; height:14px; cursor: pointer; position: relative; top: 4px; left:0px;' onclick='javascript:about.action();'><div class='balloon' id='infoBalloon'><div class='arrow'></div><a href='javascript:about.action();' class='closeButton' title='Close'></a><h2>" + LOCALS.SEO_INFO_TITLE.replace("{0}", document.title) + "</h2><p>" + LOCALS.SEO_INFO_TEXT.replace("{0}", "<b>" + document.title + "</b>").replace("{1}", "<br>") + "</p><br><p>" + c + "</p></div></span>"; document.getElementById("TocHeader") && (document.getElementById("TocHeader").getElementsByTagName("h2")[0].innerText = LOCALS.TOC_TITLE); document.getElementById("TocHeader") && (document.getElementById("TocHeader").getElementsByTagName("h2")[0].innerText = LOCALS.TOC_TITLE); document.getElementById("RightToolText") && "SPAN" != document.getElementById("RightToolText").tagName && (-1 != document.getElementById("RightToolText").href.indexOf("toc.html") ? document.getElementById("RightToolText").title = LOCALS.TOC_TITLE : document.getElementById("RightToolText").title = LOCALS.PAGE + " " + document.getElementById("RightToolText").title); document.getElementById("LeftToolText") && "SPAN" != document.getElementById("LeftToolText").tagName && (-1 != document.getElementById("LeftToolText").href.indexOf("toc.html") ? document.getElementById("LeftToolText").title = LOCALS.TOC_TITLE : document.getElementById("LeftToolText").title = LOCALS.PAGE + " " + document.getElementById("LeftToolText").title); notification.show(); initContent() } function rotateContent(c) { var d = c.style.transform.substr(7, c.style.transform.length - 11), d = d.replace(",", "."); c.style.overflow = "visible"; var a = c.offsetWidth, b = Math.cos(d), e = Math.sin(d); 9 > 1 * browser.versionIE ? (c = c.childNodes[0], c.style.filter = 'progid:DXImageTransform.Microsoft.Matrix(sizingMethod="auto expand", M11 = ' + b + ", M12 = " + -e + ", M21 = " + e + ", M22 = " + b + ")", Math.PI / 2 <= d && d < Math.PI ? c.style.marginLeft = Math.round(a * b) + "px" : Math.PI <= d && d < 3 * Math.PI / 2 ? (c.style.marginLeft = Math.round(a * b) + "px", c.style.marginTop = Math.round(a * e) + "px") : 3 * Math.PI / 2 <= d && d < 2 * Math.PI && (c.style.marginTop = Math.round(a * e) + "px")) : 9 == 1 * browser.versionIE && (c.style.msTransformOrigin = "0 0 0", c.style.msTransform = " rotate(" + d + "rad)", c.style.left = 1 * c.style.left.replace("px", "") - c.style.width.replace("px", "") / 2 + Math.round(a * b / 2) + "px", c.style.top = 1 * c.style.top.replace("px", "") + Math.round(a * e / 2) + "px") } function zoom(c) { for (var d = document.getElementById("Page").childNodes, a = 0; a < d.length; a++) if ("DIV" == d[a].tagName) { if (1 != c && !d[a].id) { d[a].style.top = 1 * d[a].style.top.replace("px", "") * c + "px"; d[a].style.left = 1 * d[a].style.left.replace("px", "") * c + "px"; d[a].style.width = Math.abs(d[a].style.width.replace("px", "")) * c + "px"; d[a].style.height = Math.abs(d[a].style.height.replace("px", "")) * c + "px"; var b = d[a].getElementsByTagName("img")[0]; if (b) { var e = b.currentStyle || window.getComputedStyle(d[a], null); b.style.top = 1 * b.style.width.replace("px", "") * c + "px"; b.style.left = 1 * b.style.width.replace("px", "") * c + "px"; b.style.width = 1 * b.style.width.replace("px", "") * c + "px"; b.style.height = 1 * b.style.height.replace("px", "") * c + "px" } if (b = d[a].getElementsByTagName("iframe")[0]) b.currentStyle || window.getComputedStyle(d[a], null), b.style.top = 1 * b.style.width.replace("px", "") * c + "px", b.style.left = 1 * b.style.width.replace("px", "") * c + "px", b.style.width = 1 * b.style.width.replace("px", "") * c + "px", b.style.height = 1 * b.style.height.replace("px", "") * c + "px" } if (b = d[a].getElementsByTagName("span")[0]) { e = b.currentStyle || window.getComputedStyle(b, null); scale = b.style.fontSize ? Math.abs(b.style.fontSize.replace("px", "")) * c : Math.abs(e.fontSize.replace("px", "")) * c; b.style.fontSize = scale + "px"; if (b.offsetWidth > d[a].offsetWidth) for (; b.offsetWidth > d[a].offsetWidth && 1 < scale; ) scale -= 1, b.style.fontSize = scale + "px"; else if (b.offsetWidth < d[a].offsetWidth) { for (e = 0; b.offsetWidth < d[a].offsetWidth && 5 > e; ) scale += 1, e++, b.style.fontSize = scale + "px"; b.offsetWidth > d[a].offsetWidth && (scale -= 1, b.style.fontSize = scale + "px") } e = (d[a].offsetHeight - b.offsetHeight) / 2; e = e.toFixed(); 0 < e && (b.style.padding = e + "px 0px"); b.style.top = (d[a].offsetHeight - b.offsetHeight) / 2 + "px" } browser.isIE && d[a].style.transform && rotateContent(d[a]) } };