//============================================================================== // // TOBESOFT Co., Ltd. // Copyright 2014 TOBESOFT Co., Ltd. // All Rights Reserved. // // NOTICE: TOBESOFT permits you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // // Readme URL: http://www.nexacro.co.kr/legal/nexacro-public-license-readme-1.1.html // //============================================================================== if (nexacro.Browser != "Runtime") { if (window._popup && window.opener && window.opener != window) { window.application = window.opener.application; window.system = window.opener.system; window.nexacro._typedefinition_url = window.opener.nexacro._typedefinition_url; window.nexacro._project_url = window.opener.nexacro._project_url; window.nexacro._addlocalthemecacheurl = window.opener.nexacro._addlocalthemecacheurl; if (window.opener.nexacro.Application) { window._pApplication = window.opener.nexacro.Application; } else { var _parent = window.opener; while (!_parent.nexacro.Application) { _parent = _parent.opener; } if (_parent) { window._pApplication = _parent.nexacro.Application; } } } if (!nexacro.Init_systembase_html) { nexacro.Init_systembase_html = true; if (window.console) { trace = function () { var a = arguments; var n = arguments.length; switch (n) { case 1: window.console.log(a[0] + ''); break; case 2: window.console.log(a[0], ' ', a[1]); break; case 3: window.console.log(a[0], ' ', a[1], ' ', a[2]); break; case 4: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3]); break; case 5: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3], ' ', a[4]); break; case 6: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3], ' ', a[4], ' ', a[5]); break; case 7: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3], ' ', a[4], ' ', a[5], ' ', a[6]); break; case 8: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3], ' ', a[4], ' ', a[5], ' ', a[6], ' ', a[7]); break; case 9: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3], ' ', a[4], ' ', a[5], ' ', a[6], ' ', a[7], ' ', a[8]); break; case 10: window.console.log(a[0], ' ', a[1], ' ', a[2], ' ', a[3], ' ', a[4], ' ', a[5], ' ', a[6], ' ', a[7], ' ', a[8], ' ', a[9]); break; } }; } else { trace = function () { if (nexacro.OS == "Windows Phone") { var str = arguments[0]; var params = '{"message":"' + str + '"}'; var jsonstr = 'DebugConsole,Debug,' + this._id + ',' + params; window.external.Notify(jsonstr); } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { var str = ""; var a = arguments; for (var i = 0; i < a.length; i++) { str += a[i]; str += ' '; } var aa = 0; } }; } nexacro._updateWindow = nexacro._emptyFn; nexacro._nexacroconsole = function (str, w, h) { var target = document.getElementById("mainframe_childframe_form"); var console = document.getElementById("nexacroconsole"); if (!console) { console = document.createElement("div"); console.id = "nexacroconsole"; console.className = "nexacroconsole"; if (w) { console.style.width = (parseInt(w) | 0) + "%"; } if (h) { console.style.height = (parseInt(h) | 0) + "%"; } target && target.appendChild(console); } console.innerHTML += str + "
"; }; nexacro.Browser_RoundBorder = 0; nexacro.Browser_BorderImage = 0; nexacro.Browser_Gradation = 0; nexacro.Browser_RoundShadow = false; nexacro.Browser_ColorAlpha = false; nexacro.OS = ""; nexacro.OSVersion = ""; nexacro.DEVICE = ""; nexacro.SystemType = ""; nexacro.BrowserLang = ""; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { if (nexacro.BrowserVersion >= 9) { nexacro.Browser_RoundBorder = 1; nexacro.Browser_BorderImage = 1; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; } else { nexacro.Browser_RoundBorder = 0; nexacro.Browser_BorderImage = 0; nexacro.Browser_RoundShadow = false; nexacro.Browser_ColorAlpha = false; } nexacro.Browser_Gradation = 2; } else if (nexacro.Browser == "Opera") { nexacro.Browser_RoundBorder = 1; nexacro.Browser_BorderImage = 1; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; nexacro.Browser_Gradation = 1; } else if (nexacro.Browser == "Chrome") { nexacro.Browser_RoundBorder = 1; nexacro.Browser_BorderImage = 2; nexacro.Browser_Gradation = 2; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; } else if (nexacro.Browser == "MobileSafari") { nexacro.Browser_RoundBorder = 1; nexacro.Browser_BorderImage = 2; nexacro.Browser_Gradation = 2; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; } else if (nexacro.Browser == "Safari") { nexacro.Browser_RoundBorder = 4; nexacro.Browser_BorderImage = 2; nexacro.Browser_Gradation = 1; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; } else if (nexacro.Browser == "WebKit") { nexacro.Browser_RoundBorder = 1; nexacro.Browser_BorderImage = 2; nexacro.Browser_Gradation = 2; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; } else if (nexacro.Browser == "Gecko") { if (nexacro.BrowserVersion < 2) { nexacro.Browser_RoundBorder = 4; } else if (nexacro.BrowserVersion >= 10) { nexacro.Browser_RoundBorder = 1; } else { nexacro.Browser_RoundBorder = 1; } nexacro.Browser_BorderImage = 3; nexacro.Browser_Gradation = 3; nexacro.Browser_RoundShadow = true; nexacro.Browser_ColorAlpha = true; } (function () { var _regexp_detectos = [{ OS : "Windows", systype : "win32", expr : "Windows\\sNT\\s([0-9\\.]*)" }, { OS : "Windows Phone", systype : "win32", expr : "Windows Phone.*OS\\s([\\d_]+)" }, { OS : "Mac OS", systype : "mac", expr : "Mac\\sOS[\\s|a-z|A-Z]+\\s([\\d_]+)" }, { OS : "iOS", systype : "ipad", expr : "iPad[\\s|a-z|A-Z|;]+OS\\s([\\d_]+)" }, { OS : "iOS", systype : "iphone", expr : "iPhone\\sOS\\s([\\d_]+)" }, { OS : "Android", systype : "android", expr : "Android\\s+([\\d.]+)" }, { OS : "Linux", systype : "linux", expr : "Linux\\s+([\\w]+)" } ]; var cnt = _regexp_detectos.length; for (var i = 0; i < cnt; i++) { var info = _regexp_detectos[i]; var version = navigator.userAgent.match(new RegExp(info.expr, 'i')); if (version) { nexacro.OS = info.OS; nexacro.SystemType = info.systype; nexacro.OSVersion = version[1].replace(/_/g, '.'); break; } } if (nexacro.OS == "") { var version = navigator.userAgent.match("Android"); if (version) { nexacro.OS = version[0]; } } })(); if (navigator) { nexacro.BrowserLang = (navigator.language || navigator.browserLanguage || navigator.systemLanguage || navigator.userLanguage); nexacro.SystemLang = (navigator.systemLanguage || navigator.BrowserLang); } nexacro.checkDocument = { hasInnerText : document.documentElement.innerText !== undefined, hasTextContent : document.documentElement.textContent !== undefined, hasElementFromPoint : document.documentElement.elementFromPoint !== undefined, hasScreenLeftTop : (document.defaultView || document.parentWindow).screenLeft !== undefined, hasGetBoxObjectFor : document.getBoxObjectFor !== undefined, hasGetBoundingClientRect : document.documentElement.getBoundingClientRect !== undefined, hasOnInput : document.documentElement.oninput !== undefined, quirksMode : document.compatMode === "BackCompat", strictMode : document.compatMode === "CSS1Compat" }; if (nexacro.Browser == "MobileSafari") { nexacro.KeyCode_ImeInput = 0; } else { nexacro.KeyCode_ImeInput = 229; } nexacro._error = function (e, at) { var msg = []; msg.push(e.toString()); if (at && at.length) { msg.push("at : " + at); } if (e.fileName) { msg.push("at : " + e.fileName + ": " + e.lineNumber); } if (self.__debuginfo) { msg.push("at : " + self.__debuginfo); } alert(msg.join('\n')); }; nexacro._alert = function (cur_frame, str, caption, type) { var _handle, _window; if (cur_frame instanceof nexacro.Frame) { _window = cur_frame._getWindow(); if (_window) { _window._cancelEvent(); _handle = _window._handle; } else { _handle = nexacro._getMainWindowHandle(); } } else { _handle = nexacro._getMainWindowHandle(); } str = nexacro._toString(str); _handle.alert(str); }; nexacro._confirm = function (cur_frame, str, caption, type) { var _handle, _window; if (cur_frame instanceof nexacro.Frame) { _window = cur_frame._getWindow(); if (_window) { _window._cancelEvent(); _handle = _window._handle; } else { _handle = nexacro._getMainWindowHandle(); } } else { _handle = nexacro._getMainWindowHandle(); } return _handle.confirm(str); }; nexacro._setCookie = function (name, value, days) { var expires = ""; if (days) { if (typeof (days) == "string") { expires = "; expires=" + days; } else if ((typeof days) == "object" && (days instanceof Date)) { expires = "; expires=" + days.toGMTString(); } } else { expires = ""; } document.cookie = name + "=" + value + expires + "; path=/"; }; nexacro._getCookie = function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(nameEQ) == 0) { return c.substring(nameEQ.length); } } return null; }; nexacro._removeCookie = function (name) { this.setCookie(name, "", -1); }; nexacro._setFileSecureLevel = function (lvl) { application.filesecurelevel = nexacro._parseInt(lvl); }; nexacro._setNetworkSecureLevel = function (lvl) { application.networksecurelevel = nexacro._parseInt(lvl); }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro._getExceptionMessage = function (e) { var msg = e.message; if (e.stack) { msg += "\r\n" + e.stack; } return msg; }; nexacro._getEvalExceptionMessage = function (e, src_url, base_line) { var msg = e.toString() + '\r\nin eval script(' + decodeURI(src_url) + ')'; return msg; }; } else if (nexacro.Browser == "Gecko") { nexacro._getExceptionMessage = function (e) { var msg = e.toString() + "\r\n"; msg += "\r\n" + e.stack; return msg; }; nexacro._getEvalExceptionMessage = function (e, src_url, base_line) { var msg = e.toString() + '\r\nat line ' + (e.lineNumber - base_line); msg += ', in eval script(' + decodeURI(src_url) + ')'; return msg; }; } else if (nexacro.Browser == "Chrome") { Error.prepareStackTrace = function (error, stack) { return stack; }; nexacro._getExceptionMessage = function (e) { var msg = e.toString(); if (e.stack && e.stack.length > 0) { var frame = e.stack[0]; var url = frame.getEvalOrigin(); msg += "\r\nat line " + frame.getLineNumber() + ", in function: " + frame.getMethodName() + " in " + decodeURI(url); } return msg; }; nexacro._getEvalExceptionMessage = function (e, src_url, base_line) { var msg = e.toString() + '\r\nin eval script(' + decodeURI(src_url) + ')'; return msg; }; } else if (nexacro.BrowserType == "WebKit") { nexacro._getExceptionMessage = function (e) { var sourceName = e.sourceURL ? decodeURI(e.sourceURL) : "(anonymous)"; var lineNumber = e.line; var msg = e.toString() + "\r\n" + sourceName + ' (at line ' + lineNumber + ')'; if (e.stack) { msg += "\r\n" + e.stack; } return msg; }; nexacro._getEvalExceptionMessage = function (e, src_url, base_line) { var msg = e.toString() + '\r\nin eval script(' + decodeURI(src_url) + ')'; return msg; }; } else { nexacro._getExceptionMessage = function (e) { var msg = e.toString(); if (e.stack) { msg += "\r\n" + e.stack; } return msg; }; nexacro._getEvalExceptionMessage = function (e, src_url, base_line) { var msg = e.toString() + '\r\nin eval script(' + decodeURI(src_url) + ')'; return msg; }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__pseudoGarbageCollector = function () { this._handle = null; this._hasGargageNode = false; }; var _pGarbageCollector = nexacro.__pseudoGarbageCollector.prototype; _pGarbageCollector.init = function (_cur_doc, id) { if (_cur_doc) { var gc = _cur_doc.getElementById(id); if (!gc) { gc = _cur_doc.createElement('div'); gc.id = id; gc.style.display = 'none'; _cur_doc.body.appendChild(gc); this._hasGargageNode = false; } this._handle = gc; } }; _pGarbageCollector.append = function (node) { if (this._handle && node) { this._handle.appendChild(node); this._hasGargageNode = true; } }; _pGarbageCollector.clear = function () { if (this._handle && this._hasGargageNode) { this._handle.innerText = ""; this._hasGargageNode = false; } }; _pGarbageCollector.destroy = function () { if (this._handle) { this.clear(); this._handle = null; } }; delete _pGarbageCollector; nexacro._createWindowGC_Funcs = function (_cur_win) { _cur_win.__createGC = function () { var _doc = _cur_win.document; var gc = new nexacro.__pseudoGarbageCollector(); gc.init(_doc, 'nexacro__pseudoGarbageCollector'); _doc.__nexacro_gc = gc; var unlinkgc = new nexacro.__pseudoGarbageCollector(); unlinkgc.init(_doc, 'nexacro__unlinkGarbageCollector'); _doc.__nexacro_unlinkgc = unlinkgc; }; _cur_win.__clearGC = function () { var _doc = _cur_win.document; var gc = _doc.__nexacro_gc; if (gc) { gc.clear(); } }; _cur_win.__destroyGC = function () { var _doc = _cur_win.document; var unlinkgc = _doc.__nexacro_unlinkgc; if (unlinkgc && unlinkgc._handle) { var node = unlinkgc._handle.firstChild; while (node) { var next = node.nextSibling; var elem = node._linked_element; if (elem) { if (elem.linkedcontrol) { elem.linkedcontrol.destroy(); } else { elem.destroy(); } } node = next; } unlinkgc.destroy(); } _doc.__nexacro_unlinkgc = null; var gc = _doc.__nexacro_gc; if (gc) { gc.destroy(); } _doc.__nexacro_gc = null; }; }; nexacro.__appendDOMNode = function (parent_node, node) { parent_node.appendChild(node); }; nexacro.__insertDOMNode = function (parent_node, node, before_node) { if (before_node) { parent_node.insertBefore(node, before_node); } else { parent_node.appendChild(node); } }; nexacro.__removeDOMNode = function (parent_node, node) { if (node) { if (!parent_node) { parent_node = node.parentNode; } try { parent_node.removeChild(node); var gc = node.ownerDocument.__nexacro_gc; if (gc) { gc.append(node); } else { gc = document.__nexacro_gc; if (gc) { gc.append(node); } } } catch (e) { } } }; nexacro.__unlinkDOMNode = function (parent_node, node) { if (node) { if (!parent_node) { parent_node = node.parentNode; } parent_node.removeChild(node); var gc = node.ownerDocument.__nexacro_unlinkgc; if (gc) { gc.append(node); } } }; } else { nexacro._createWindowGC_Funcs = function (_cur_win) { _cur_win.__createGC = nexacro._emptyFn; _cur_win.__clearGC = nexacro._emptyFn; _cur_win.__destroyGC = nexacro._emptyFn; }; nexacro.__appendDOMNode = function (parent_node, node) { parent_node.appendChild(node); }; nexacro.__insertDOMNode = function (parent_node, node, before_node) { if (before_node) { parent_node.insertBefore(node, before_node); } else { parent_node.appendChild(node); } }; nexacro.__removeDOMNode = function (parent_node, node) { if (node && parent_node) { try { parent_node.removeChild(node); } catch (e) { } } }; nexacro.__unlinkDOMNode = function (parent_node, node) { if (node && parent_node) { parent_node.removeChild(node); } }; } nexacro.__getPrevDOMNode = function (node) { do { node = node.prevSibling; } while (node && node.nodeType != 1); return node; }; nexacro.__getNextDOMNode = function (node) { do { node = node.nextSibling; } while (node && node.nodeType != 1); return node; }; nexacro.__getFirstChildDOMNode = function (node) { var child_node = node.firstChild; while (child_node && child_node.nodeType != 1) { child_node = child_node.nextSibling; } return child_node; }; nexacro.__getLastChildDOMNode = function (node) { var child_node = node.lastChild; while (child_node && child_node.nodeType != 1) { child_node = child_node.prevSibling; } return child_node; }; nexacro.__bringDOMNodeToFront = function (node) { var parent_node = node.parentNode; if (parent_node) { var last_node = nexacro.__getLastChildDOMNode(parent_node); if (node != last_node) { parent_node.appendChild(node); } } }; nexacro.__sendDOMNodeToBack = function (node) { var parent_node = node.parentNode; if (parent_node) { var first_node = parent_node.firstChild; if (node != first_node) { parent_node.insertBefore(node, first_node); } } }; nexacro.__moveDOMNodeToPrev = function (node, target_node) { if (target_node && target_node != node) { var parent_node = node.parentNode; if (parent_node && parent_node == target_node.parentNode) { var next_node = nexacro.__getNextDOMNode(target_node); if (next_node != node) { if (next_node) { parent_node.insertBefore(node, next_node); } else { parent_node.appendChild(node); } } } } }; nexacro.__moveDOMNodeToNext = function (node, target_node) { if (target_node && target_node != node) { var parent_node = node.parentNode; if (parent_node && parent_node == target_node.parentNode) { var target_prev_node = nexacro.__getPrevDOMNode(target_node); if (target_prev_node != node) { parent_node.insertBefore(node, target_node); } } } }; nexacro.__setDOMNodeStyleFilterTransparent = function (node_style) { node_style.filter = "alpha(Opacity=0)"; node_style.backgroundColor = "#FFFFFF"; }; nexacro.__setDOMNodeStyleAbsolute = function (node_style) { node_style.position = "absolute"; node_style.overflow = "hidden"; }; nexacro.__setDOMNodeStyleRelative = function (node_style) { node_style.position = "relative"; node_style.overflow = "hidden"; }; nexacro.__setDOMNodeStyleFixed = function (node_style) { node_style.position = "fixed"; node_style.overflow = "hidden"; }; nexacro.__setDOMNodeStyleAbsoluteTransparent = function (node_style) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.overflowX = "hidden"; node_style.overflowY = "hidden"; node_style.backgroundColor = "transparent"; }; nexacro.__setDOMNodeStyleTextOverFlow = function (node_style) { node_style.textOverflow = "ellipsis"; node_style.whiteSpace = "nowrap"; node_style.overflow = "hidden"; }; if (nexacro.OS == "Android" || nexacro.Browser == "Opera") { nexacro.__setTextAreaDOMNodeStyleAbsoluteTransparent = function (node_style) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.backgroundColor = "transparent"; }; } else { nexacro.__setTextAreaDOMNodeStyleAbsoluteTransparent = function (node_style) { node_style.position = "absolute"; node_style.overflow = "scroll"; node_style.backgroundColor = "transparent"; }; } nexacro.__setMobileIframeDOMNodeStyleScroll = function (node_style) { node_style.overflow = "auto"; node_style.webkitOverflowScrolling = "touch"; }; nexacro.__setDOMNodeStylePosLeftTop = function (node_style, left, top) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.left = (left | 0) + "px"; node_style.top = (top | 0) + "px"; }; nexacro.__setDOMNodeStylePosRightTop = function (node_style, right, top) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.right = (right | 0) + "px"; node_style.top = (top | 0) + "px"; }; nexacro.__setDOMNodeStylePosLeftBottom = function (node_style, left, bottom) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.left = (left | 0) + "px"; node_style.bottom = (bottom | 0) + "px"; }; nexacro.__setDOMNodeStylePosRightBottom = function (node_style, right, bottom) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.right = (right | 0) + "px"; node_style.bottom = (bottom | 0) + "px"; }; nexacro.__setDOMNodeStylePosSize = function (node_style, left, top, width, height) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.left = (left | 0) + "px"; node_style.top = (top | 0) + "px"; node_style.width = (width | 0) + "px"; node_style.height = (height | 0) + "px"; }; nexacro.__setDOMNodeStylePosUnitSize = function (node_style, left, top, width, height) { node_style.position = "absolute"; node_style.overflow = "hidden"; node_style.left = (left | 0) + "px"; node_style.top = (top | 0) + "px"; node_style.width = width; node_style.height = height; }; nexacro.__setDOMNodeStylePos = function (node_style, left, top) { node_style.left = (left | 0) + "px"; node_style.top = (top | 0) + "px"; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro.__setCanvasNodeStylePos = function (node_style, left, top) { node_style.left = (left | 0) + "px"; node_style.top = (top | 0) + "px"; }; } else { nexacro.__setCanvasNodeStylePos = function (node_style, left, top) { node_style.left = (left | 0); node_style.top = (top | 0); }; } ; nexacro.__setDOMNodeStyleSize = function (node_style, width, height) { if (width >= 0 && height >= 0) { node_style.width = (width | 0) + "px"; node_style.height = (height | 0) + "px"; } }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 8) { nexacro.__setDOMNodeStyleTextSize = function (node_style, height) { node_style.maxHeight = (height | 0) + "px"; node_style.height = (height | 0) + "px"; }; } else { nexacro.__setDOMNodeStyleTextSize = function (node_style, height) { node_style.maxHeight = (height | 0) + "px"; }; } ; nexacro.__setDOMNodeStyleUnitSize = function (node_style, width, height) { node_style.width = width; node_style.height = height; }; nexacro.__setDOMNodeStyleDirection = function (node_style, direction) { if (direction) { node_style.direction = direction; } }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 10) { if (nexacro.BrowserVersion == 9) { nexacro.__setDOMNodeStyleTransformMirror = function (node_style, bMirror) { var value = ""; if (bMirror) { value = "ScaleX(-1)"; } node_style.msTransform = value; }; nexacro.__setDOMNodeStyleTransformScale = function (node_style, scale) { node_style.MsTransformOrigin = "0 0"; node_style.MsTransform = "scale(" + scale + ", " + scale + ")"; }; } else { nexacro.__setDOMNodeStyleTransformMirror = function (node_style, bMirror) { var value = ""; if (bMirror) { value = "progid:DXImageTransform.Microsoft.BasicImage(mirror=1)"; } node_style.filter += value; }; nexacro.__setDOMNodeStyleTransformScale = function (node_style, scale) { nexacro.__setDOMNodeZoom(node_style, scale * 100); }; } } else if (nexacro.BrowserType == "WebKit") { nexacro.__setDOMNodeStyleTransformMirror = function (node_style, bMirror) { var value = ""; if (bMirror) { value = "ScaleX(-1)"; } node_style.WebkitTransform = value; }; nexacro.__setDOMNodeStyleTransformScale = function (node_style, scale) { node_style.WebkitTransformOriginX = 0; node_style.WebkitTransformOriginY = 0; node_style.WebkitTransform = "scale(" + scale + ", " + scale + ")"; }; } else if (nexacro.BrowserType == "Gecko") { nexacro.__setDOMNodeStyleTransformMirror = function (node_style, bMirror) { var value = ""; if (bMirror) { value = "ScaleX(-1)"; } node_style.MozTransform = value; }; nexacro.__setDOMNodeStyleTransformScale = function (node_style, scale) { node_style.MozTransformOrigin = "0px 0px"; node_style.MozTransform = "scale(" + scale + ", " + scale + ")"; }; } else if (nexacro.BrowserType == "Opera") { nexacro.__setDOMNodeStyleTransformMirror = function (node_style, bMirror) { var value = ""; if (bMirror) { value = "ScaleX(-1)"; } node_style.OTransform = value; }; nexacro.__setDOMNodeStyleTransformScale = function (node_style, scale) { node_style.OTransformOriginX = 0; node_style.OTransformOriginY = 0; node_style.OTransform = "scale(" + scale + ", " + scale + ")"; }; } else { nexacro.__setDOMNodeStyleTransformMirror = function (node_style, bMirror) { var value = ""; if (bMirror) { value = "ScaleX(-1)"; } node_style.transform = value; }; nexacro.__setDOMNodeStyleTransformScale = function (node_style, scale) { node_style.transformOriginX = 0; node_style.transformOriginY = 0; node_style.transformOrigin = "0 0"; node_style.transform = "scale(" + scale + ", " + scale + ")"; }; } nexacro.__setDOMNodeStylePointerEvents = function (node_style, value) { node_style.pointerEvents = value; }; nexacro.__setDOMNodeSize = function (node, width, height) { if (width >= 0 && height >= 0) { node.width = width + "px"; node.height = height + "px"; } }; nexacro.__setCanvasNodeSize = function (node, width, height) { if (width >= 0 && height >= 0) { node.width = width; node.height = height; } }; nexacro.__setDOMNodeOffset = function (node, offset_x, offset_y) { node.scrollLeft = offset_x; node.scrollTop = offset_y; }; nexacro.__setDOMNodeHScrollPos = function (node, pos) { node.scrollLeft = pos; }; nexacro.__setDOMNodeVScrollPos = function (node, pos) { node.scrollTop = pos; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { if (nexacro.BrowserVersion >= 9) { nexacro.__setDOMNodeStyleTranslate = function (node_style, offset_x, offset_y) { node_style.msTransform = "translate3d(" + offset_x + "px, " + offset_y + "px, 0)"; }; nexacro.__setDOMNodeStyleTranslateX = function (node_style, pos) { node_style.msTransform = "translateX(" + pos + "px)"; }; nexacro.__setDOMNodeStyleTranslateY = function (node_style, pos) { node_style.msTransform = "translateY(" + pos + "px)"; }; } else { nexacro.__setDOMNodeStyleTranslate = function (node_style, offset_x, offset_y) { nexacro.__setDOMNodeStylePos(node_style, offset_x, offset_y); }; nexacro.__setDOMNodeStyleTranslateX = function (node_style, pos) { node_style.left = pos + "px"; }; nexacro.__setDOMNodeStyleTranslateY = function (node_style, pos) { node_style.top = pos + "px"; }; } } else if (nexacro.BrowserType == "WebKit") { nexacro.__setDOMNodeStyleTranslate = function (node_style, offset_x, offset_y) { node_style.WebkitTransform = "translate3d(" + offset_x + "px, " + offset_y + "px, 0)"; }; nexacro.__setDOMNodeStyleTranslateX = function (node_style, pos) { node_style.WebkitTransform = "translateX(" + pos + "px)"; }; nexacro.__setDOMNodeStyleTranslateY = function (node_style, pos) { node_style.WebkitTransform = "translateY(" + pos + "px)"; }; } else if (nexacro.Browser == "Gecko") { nexacro.__setDOMNodeStyleTranslate = function (node_style, offset_x, offset_y) { node_style.MozTransform = "translate3d(" + offset_x + "px, " + offset_y + "px, 0)"; }; nexacro.__setDOMNodeStyleTranslateX = function (node_style, pos) { node_style.MozTransform = "translateX(" + pos + "px)"; }; nexacro.__setDOMNodeStyleTranslateY = function (node_style, pos) { node_style.MozTransform = "translateY(" + pos + "px)"; }; } else if (nexacro.Browser == "Opera") { nexacro.__setDOMNodeStyleTranslate = function (node_style, offset_x, offset_y) { node_style.OTransform = "translate3d(" + offset_x + "px, " + offset_y + "px, 0)"; }; nexacro.__setDOMNodeStyleTranslateX = function (node_style, pos) { node_style.OTransform = "translateX(" + pos + "px)"; }; nexacro.__setDOMNodeStyleTranslateY = function (node_style, pos) { node_style.OTransform = "translateY(" + pos + "px)"; }; } else { nexacro.__setDOMNodeStyleTranslate = function (node_style, offset_x, offset_y) { node_style.transform = "translate3d(" + offset_x + "px, " + offset_y + "px, 0)"; }; nexacro.__setDOMNodeStyleTranslateX = function (node_style, pos) { node_style.transform = "translateX(" + pos + "px)"; }; nexacro.__setDOMNodeStyleTranslateY = function (node_style, pos) { node_style.transform = "translateY(" + pos + "px)"; }; } nexacro.__setDOMNodeStyleZindex = function (node_style, zindex) { node_style.zIndex = zindex; }; nexacro.__getDOMNodeZoom = function (node_style) { return node_style.zoom; }; nexacro.__setDOMNodeZoom = function (node_style, zoomFactor) { node_style.zoom = zoomFactor + "%"; }; nexacro.__setDOMNodeStyleVisible = function (node_style, visible_flag) { node_style.visibility = (visible_flag == true) ? "" : "hidden"; }; nexacro.__setDOMNodeStyleForceVisibility = function (node_style, visible_flag) { node_style.visibility = (visible_flag == true) ? "visible" : "hidden"; }; nexacro.__setDOMNodeStyleDisplay = function (node_style, v) { node_style.display = v; }; nexacro.__setDOMNodeEnable = function (node, enable_flag) { node.disabled = (enable_flag ? false : true); }; nexacro.__setTextAreaDOMNodeEnable = function (node, enable_flag) { node.disabled = (enable_flag ? false : true); nexacro.__setDOMNodeSelectable(node, enable_flag); }; nexacro.__setDOMNodeReadOnly = function (node, readonly_flag) { node.readOnly = readonly_flag; }; nexacro.__setDOMNodeTabIndex = function (node, index) { node.tabIndex = index; }; nexacro.__setDOMNodeId = function (node, parentid, id) { node.id = parentid + id; }; nexacro.__setDOMNodeToolTip = function (node, tooltiptext, tooltiptype) { node.title = tooltiptext; }; nexacro.__getDOMNodeToolTip = function (node) { if (node) { return node.title; } return ""; }; if ((nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) || nexacro.Browser == "Opera") { nexacro.__setDOMNodeSelectable = function (node, selectable_flag) { node.unselectable = selectable_flag ? "off" : "on"; }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion > 9) { nexacro.__setDOMNodeSelectable = function (node, selectable_flag) { node.style.msUserSelect = selectable_flag ? "text" : "none"; }; } else if (nexacro.BrowserType == "Gecko") { nexacro.__setDOMNodeSelectable = function (node, selectable_flag) { node.style.MozUserSelect = selectable_flag ? "" : "none"; }; } else if (nexacro.BrowserType == "WebKit") { nexacro.__setDOMNodeSelectable = function (node, selectable_flag) { node.style.webkitUserSelect = selectable_flag ? "" : "none"; }; } else { nexacro.__setDOMNodeSelectable = function (node, selectable_flag) { node.style.userSelect = selectable_flag ? "" : "none"; }; } if ((nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) || nexacro.Browser == "Opera") { nexacro.__isDOMNodeSelectable = function (node) { return (node.unselectable == "off"); }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion > 9) { nexacro.__isDOMNodeSelectable = function (node) { return (node.style.msUserSelect == ""); }; } else if (nexacro.BrowserType == "Gecko") { nexacro.__isDOMNodeSelectable = function (node) { return (node.style.MozUserSelect == ""); }; } else if (nexacro.BrowserType == "WebKit") { nexacro.__isDOMNodeSelectable = function (node) { return (node.style.webkitUserSelect == ""); }; } else { nexacro.__isDOMNodeSelectable = function (node) { return (node.style.userSelect == ""); }; } nexacro.__setDOMNodeTitle = function (node, text) { if (!text) { text = ""; } if (!node.title || node.title != text) { return node.title = text; } }; nexacro.__setDOMNodeAlt = function (node, text) { if (!text) { text = ""; } if (!node.alt || node.alt != text) { return node.alt = text; } }; if (nexacro.Browser == "Chrome") { nexacro.__setImageDOMNodeImageUrl = function (node, imageurl) { if (imageurl && imageurl.substring(0, 17) == "data:image;base64") { var frontStr = imageurl.substr(0, 10); var rearStr = imageurl.substr(10, imageurl.length - 1); imageurl = frontStr + "/*" + rearStr; } node.src = imageurl; }; } else { nexacro.__setImageDOMNodeImageUrl = function (node, imageurl) { if (!imageurl && nexacro.Browser == "Safari") { node.src = null; } else { node.src = imageurl; } }; } nexacro.__setBKImageDOMNodeStyleImageUrl = function (node_style, imageurl) { node_style.backgroundImage = imageurl ? "url(" + imageurl + ")" : ""; }; nexacro.__setDOMNodeValue = function (node, value) { node.value = value; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 9) { (function () { var re_check = /\r|\n/; var re_newline = /\r\n|\n|\r/g; nexacro.__setDOMNodeSinglelineText = function (node, text) { if (re_check.test(text)) { node.innerText = text.replace(re_newline, " "); } else { node.innerText = text; } }; nexacro.__setDOMNodeMultilineText = function (node, text) { node.innerText = text; }; })(); } else { (function () { var re_check = /\r|\n/; var re_newline = /\r\n|\n|\r/g; nexacro.__setDOMNodeSinglelineText = function (node, text) { if (re_check.test(text)) { node.textContent = text.replace(re_newline, " "); } else { node.textContent = text; } }; nexacro.__setDOMNodeMultilineText = function (node, text) { node.textContent = text; }; })(); } if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" || nexacro.Browser == "Gecko") { (function () { var re_check = /\r|\n/; var re_amp = /&/g; var re_lt = //g; var re_quat = /\"/g; var re_apos = /\'/g; var re_newline = /\r\n|\r|\n/g; var re_space = / /g; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeMultilineTextWithoutWordwrap = function (node, text) { var ch = text.charAt(text.length - 1); if (ch == "\n" || ch == "\r") { text += "\n"; } node.innerHTML = text.replace(re_amp, "&").replace(re_lt, "<").replace(re_gt, ">").replace(re_quat, """).replace(re_apos, "'").replace(re_newline, "
").replace(re_space, " "); }; } else { nexacro.__setDOMNodeMultilineTextWithoutWordwrap = function (node, text) { var ch = text.charAt(text.length - 1); if (ch == "\n" || ch == "\r") { text += "\n"; } node.innerHTML = text.replace(re_amp, "&").replace(re_lt, "<").replace(re_gt, ">").replace(re_quat, """).replace(re_apos, "'").replace(re_newline, "
"); }; } })(); } else { nexacro.__setDOMNodeMultilineTextWithoutWordwrap = function (node, text) { var ch = text.charAt(text.length - 1); if (ch == "\n" || ch == "\r") { text += "\n"; } node.innerText = text; }; } nexacro.__setDOMNodeText = function (node, text, _multi_line, _wordwrap) { if (_multi_line) { if (_wordwrap != "none") { nexacro.__setDOMNodeMultilineText(node, text); } else { nexacro.__setDOMNodeMultilineTextWithoutWordwrap(node, text); } } else { nexacro.__setDOMNodeSinglelineText(node, text); } }; nexacro.__setDOMNodeStyleDecorateText = function (node, text) { node.innerHTML = nexacro._decorateString(text); }; nexacro.__setDOMNodeMaxLength = function (node, maxlength) { node.maxLength = (maxlength > 0) ? maxlength : 65535; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeStyleBorderType = nexacro._emptyFn; nexacro.__clearDOMNodeStyleBorderType = nexacro._emptyFn; } else if (nexacro.Browser == "Gecko" && nexacro.BrowserVersion < 2) { nexacro.__setDOMNodeStyleBorderType = function (node_style, bordertype, target) { if (bordertype.type != "normal" && bordertype.type != "") { var radius_str = bordertype._radiusx + "px " + bordertype._radiusy + "px"; if (bordertype._lefttop && bordertype._righttop && bordertype._rightbottom && bordertype._leftbottom && bordertype._radiusx == bordertype._radiusy) { node_style.MozBorderRadius = radius_str; } else { if (bordertype._lefttop) { node_style.MozBorderRadiusTopleft = radius_str; } else { node_style.MozBorderRadiusTopleft = "0px"; } if (bordertype._righttop) { node_style.MozBorderRadiusTopright = radius_str; } else { node_style.MozBorderRadiusTopright = "0px"; } if (bordertype._rightbottom) { node_style.MozBorderRadiusBottomright = radius_str; } else { node_style.MozBorderRadiusBottomright = "0px"; } if (bordertype._leftbottom) { node_style.MozBorderRadiusBottomleft = radius_str; } else { node_style.MozBorderRadiusBottomleft = "0px"; } } } else { nexacro.__clearDOMNodeStyleBorderType(node_style); } }; nexacro.__clearDOMNodeStyleBorderType = function (node_style) { node_style.MozBorderRadius = "0px"; }; } else { nexacro.__setDOMNodeStyleBorderType = function (node_style, bordertype, target) { if (bordertype.type != "normal" && bordertype.type != "") { var radius_str = bordertype._radiusx + "px " + bordertype._radiusy + "px"; if (bordertype._lefttop && bordertype._righttop && bordertype._rightbottom && bordertype._leftbottom && bordertype._radiusx == bordertype._radiusy) { node_style.borderRadius = radius_str; } else { if (bordertype._lefttop) { node_style.borderTopLeftRadius = radius_str; } else { node_style.borderTopLeftRadius = "0px"; } if (bordertype._righttop) { node_style.borderTopRightRadius = radius_str; } else { node_style.borderTopRightRadius = "0px"; } if (bordertype._rightbottom) { node_style.borderBottomRightRadius = radius_str; } else { node_style.borderBottomRightRadius = "0px"; } if (bordertype._leftbottom) { node_style.borderBottomLeftRadius = radius_str; } else { node_style.borderBottomLeftRadius = "0px"; } } } else { nexacro.__clearDOMNodeStyleBorderType(node_style); } if (nexacro.BrowserType == "WebKit") { (function (node, recursive) { if (node && node.style) { var _display = node.style.display; node.style.display = 'initial'; var _offsetHeight = node.offsetHeight; node.style.display = _display; } if (node && node.hasChildNodes && node.hasChildNodes() && recursive) { for (var child in node.childNodes) { arguments.callee(child, recursive); } } })(target, false); } }; nexacro.__clearDOMNodeStyleBorderType = function (node_style) { node_style.borderRadius = "0px"; }; } nexacro.__setDOMNodeStyleBorder = function (node_style, border) { if (border && !border._is_real_empty()) { if (border._linecnt == 1) { node_style.border = border._systop; } else { node_style.borderTop = border._systop; node_style.borderRight = border._sysright; node_style.borderBottom = border._sysbottom; node_style.borderLeft = border._sysleft; } } else { node_style.border = ""; } }; nexacro.__setDOMNodeStyleBackgroundColor = function (node_style, color) { node_style.backgroundColor = (color ? color : "transparent"); }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeStyleBackgroundImage = function (node_style, url, repeat, bkpos) { if (url) { node_style.backgroundImage = "url(" + url + ")"; node_style.backgroundRepeat = repeat; node_style.backgroundPosition = bkpos; } else { node_style.backgroundImage = ""; } }; nexacro.__setDOMNodeStyleBackgroundGradation = function (node_style, sysgradation) { }; nexacro.__setDOMNodeStyleBackgroundImageGradation = function (node_style, url, sysgradation, repeat, bkpos) { if (url) { node_style.backgroundImage = "url(" + url + ")"; node_style.backgroundRepeat = repeat; node_style.backgroundPosition = bkpos; } else { node_style.backgroundImage = ""; } }; } else { nexacro.__setDOMNodeStyleBackgroundImage = function (node_style, url, repeat, bkpos) { if (url) { if (repeat == "stretch") { node_style.backgroundImage = "url(" + url + ")"; node_style.backgroundRepeat = ""; node_style.backgroundPosition = ""; node_style.backgroundSize = "100% 100%"; } else { node_style.backgroundImage = "url(" + url + ")"; node_style.backgroundRepeat = repeat; node_style.backgroundPosition = bkpos; } } else { node_style.backgroundImage = ""; } }; nexacro.__setDOMNodeStyleBackgroundGradation = function (node_style, sysgradation) { if (sysgradation) { node_style.backgroundImage = sysgradation; node_style.backgroundRepeat = ""; node_style.backgroundPosition = ""; node_style.backgroundSize = ""; } else { node_style.backgroundImage = ""; } }; nexacro.__setDOMNodeStyleBackgroundImageGradation = function (node_style, url, sysgradation, repeat, bkpos) { if (url && sysgradation) { if (repeat == "stretch") { node_style.backgroundImage = "url(" + url + ")," + sysgradation; node_style.backgroundRepeat = "no-repeat"; node_style.backgroundPosition = ""; node_style.backgroundSize = "100% 100%"; } else { node_style.backgroundImage = "url(" + url + ")," + sysgradation; node_style.backgroundRepeat = repeat; node_style.backgroundPosition = bkpos; node_style.backgroundSize = ""; } } else if (url) { if (repeat == "stretch") { node_style.backgroundImage = "url(" + url + ")"; node_style.backgroundRepeat = "no-repeat"; node_style.backgroundPosition = ""; node_style.backgroundSize = "100% 100%"; } else { node_style.backgroundImage = "url(" + url + ")"; node_style.backgroundRepeat = repeat; node_style.backgroundPosition = bkpos; node_style.backgroundSize = ""; } } else if (sysgradation) { node_style.backgroundImage = sysgradation; node_style.backgroundRepeat = "no-repeat"; node_style.backgroundPosition = ""; node_style.backgroundSize = ""; } else { node_style.backgroundImage = ""; } }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) { nexacro.__setDOMNodeStyleEdgeBorder = nexacro._emptyFn; } else if (nexacro.Browser == "Gecko") { nexacro.__setDOMNodeStyleEdgeBorder = function (node_style, url, edgex, edgey, zoomedgex, zoomedgey) { var edge = (zoomedgex != undefined && zoomedgey != undefined) ? zoomedgey + ' ' + zoomedgex : edgey + ' ' + edgex; node_style.borderWidth = edge; node_style.backgroundImage = ""; node_style.backgroundSize = ""; node_style.borderStyle = "solid"; edge = edgey + ' ' + edgex; node_style.MozBorderImage = "url(" + url + ") " + edge + " stretch"; node_style.borderImageSlice = edge + " fill"; }; } else if (nexacro.Browser == "WebKit" || nexacro.Browser == "Safari" || nexacro.Browser == "MobileSafari") { nexacro.__setDOMNodeStyleEdgeBorder = function (node_style, url, edgex, edgey, zoomedgex, zoomedgey) { var edge = (zoomedgex != undefined && zoomedgey != undefined) ? zoomedgey + ' ' + zoomedgex : edgey + ' ' + edgex; node_style.borderWidth = edge; node_style.backgroundImage = ""; node_style.backgroundSize = ""; node_style.borderStyle = "solid"; edge = edgey + ' ' + edgex; node_style.webkitBorderImage = "url(" + url + ") " + edge + " stretch"; node_style.webkitBorderImageSlice = edge + " fill"; }; } else if (nexacro.Browser == "Opera") { nexacro.__setDOMNodeStyleEdgeBorder = function (node_style, url, edgex, edgey, zoomedgex, zoomedgey) { var edge = (zoomedgex != undefined && zoomedgey != undefined) ? zoomedgey + ' ' + zoomedgex : edgey + ' ' + edgex; node_style.borderWidth = edge; node_style.backgroundImage = ""; node_style.backgroundSize = ""; node_style.borderStyle = "solid"; edge = edgey + ' ' + edgex; node_style.OBorderImage = "url(" + url + ") " + edge + " stretch"; }; } else { nexacro.__setDOMNodeStyleEdgeBorder = function (node_style, url, edgex, edgey, zoomedgex, zoomedgey) { var edge = (zoomedgex != undefined && zoomedgey != undefined) ? zoomedgey + ' ' + zoomedgex : edgey + ' ' + edgex; node_style.borderWidth = edge; node_style.backgroundImage = ""; node_style.backgroundSize = ""; node_style.borderStyle = "solid"; edge = edgey + ' ' + edgex; node_style.borderImage = "url(" + url + ") " + edge + " stretch"; node_style.borderImageSlice = edge + " fill"; }; } nexacro.__setDOMNodeStyleAlign = function (node_style, align) { node_style.textAlign = align._halign; node_style.verticalAlign = align._valign; }; nexacro.__setDOMNodeStyleAlignXY = function (node_style, halign, valign) { if (halign) { node_style.textAlign = halign; } if (valign) { node_style.verticalAlign = valign; } }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion == 8) { nexacro.__setTextDOMNodeStyleAlign = function (node_style, align) { if (node_style.textAlign == align._halign) { node_style.textAlign = ""; } node_style.textAlign = align._halign; node_style.verticalAlign = align._valign; }; nexacro.__setTextDOMNodeStyleAlignXY = function (node_style, halign, valign) { if (halign != node_style.textAlign) { node_style.textAlign = ""; if (halign) { node_style.textAlign = halign; } } if (valign) { node_style.verticalAlign = valign; } }; } else { nexacro.__setTextDOMNodeStyleAlign = nexacro.__setDOMNodeStyleAlign; nexacro.__setTextDOMNodeStyleAlignXY = nexacro.__setDOMNodeStyleAlignXY; } if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { if (nexacro.BrowserVersion < 9) { nexacro.__setInputDOMNodeStyleAlignXY = function (node_style, halign, valign, parent_height, parent_width, txt_height) { if (halign != node_style.textAlign) { node_style.textAlign = ""; if (halign) { node_style.textAlign = halign; } } var offset_top = 0; if (valign && parent_height && txt_height) { switch (valign) { case "middle": if (parent_height <= txt_height) { break; } offset_top = ((parent_height - txt_height) / 2); break; case "bottom": offset_top = (parent_height - txt_height); break; } node_style.paddingTop = offset_top + "px"; node_style.paddingBottom = ""; node_style.height = (parent_height - offset_top) + "px"; node_style.width = parent_width + "px"; } }; } else if (nexacro.BrowserVersion < 11) { nexacro.__setInputDOMNodeStyleAlignXY = function (node_style, halign, valign, parent_height, parent_width, txt_height) { node_style.textAlign = halign; if (valign && parent_height && txt_height) { var offset_top = 0, offset_bottom = 0; switch (valign) { case "top": offset_bottom = (parent_height - txt_height); break; case "bottom": offset_top = (parent_height - txt_height); break; } node_style.paddingTop = offset_top + "px"; node_style.paddingBottom = offset_bottom + "px"; node_style.height = (parent_height - offset_top - offset_bottom) + "px"; node_style.width = parent_width + "px"; } }; } else { nexacro.__setInputDOMNodeStyleAlignXY = function (node_style, halign, valign, parent_height, parent_width, txt_height) { node_style.textAlign = halign; if (valign && parent_height && txt_height) { switch (valign) { case "top": node_style.paddingTop = "0px"; node_style.paddingBottom = (parent_height - txt_height) > 0 ? (parent_height - txt_height) + "px" : "0px"; break; case "middle": node_style.paddingTop = "0px"; node_style.paddingBottom = "0px"; break; case "bottom": node_style.paddingTop = (parent_height - txt_height) + "px"; node_style.paddingBottom = "0px"; break; } } }; } } else if (nexacro.Browser == "WebKit" || nexacro.Browser == "Safari" || nexacro.Browser == "MobileSafari") { nexacro.__setInputDOMNodeStyleAlignXY = function (node_style, halign, valign, parent_height, parent_width, txt_height) { node_style.textAlign = halign; if (valign && parent_height && txt_height) { switch (valign) { case "top": node_style.top = "0px"; node_style.height = txt_height + "px"; break; case "middle": node_style.top = "0px"; node_style.height = parent_height + "px"; break; case "bottom": node_style.top = (parent_height - txt_height) + "px"; node_style.height = txt_height + "px"; break; } } }; } else { nexacro.__setInputDOMNodeStyleAlignXY = function (node_style, halign, valign, parent_height, parent_width, txt_height) { node_style.textAlign = halign; if (valign && parent_height && txt_height) { switch (valign) { case "top": node_style.paddingTop = "0px"; node_style.paddingBottom = (parent_height - txt_height) > 0 ? (parent_height - txt_height) + "px" : "0px"; break; case "middle": node_style.paddingTop = "0px"; node_style.paddingBottom = "0px"; break; case "bottom": node_style.paddingTop = (parent_height - txt_height) + "px"; node_style.paddingBottom = "0px"; break; } } }; } nexacro.__setTextAreaDOMNodeStyleAlignXY = function (node_style, halign, valign, blank_height) { node_style.textAlign = halign; switch (valign) { case "top": node_style.paddingTop = "0px"; node_style.paddingBottom = "0px"; break; case "middle": node_style.paddingTop = (blank_height / 2) + "px"; node_style.paddingBottom = "0px"; break; case "bottom": node_style.paddingTop = blank_height + "px"; node_style.paddingBottom = "0px"; break; } }; nexacro.__setBKImageDOMNodeStyleAlign = function (node_style, align) { node_style.backgroundPosition = align.halign + ' ' + (align.valign == "middle" ? "center" : align.valign); }; nexacro.__setBKImageDOMNodeStyleAlignXY = function (node_style, halign, valign) { node_style.backgroundPosition = halign + ' ' + (valign == "middle" ? "center" : valign); }; nexacro.__setDOMNodeStyleColor = function (node_style, color) { node_style.color = color._syscolor; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro.__setDOMNodeStyleFont = function (node_style, font) { if (font._bold) { node_style.fontWeight = "bold"; } else { node_style.fontWeight = "normal"; } if (font._italic) { node_style.fontStyle = "italic"; } else { node_style.fontStyle = "normal"; } node_style.fontFamily = font.face; node_style.fontSize = font.size >= 0 ? font.size + "pt" : Math.abs(font.size) + "px"; node_style.textDecoration = font._sysdecoration; }; } else { nexacro.__setDOMNodeStyleFont = function (node_style, font) { node_style.font = font._sysvalue; node_style.textDecoration = font._sysdecoration; }; } nexacro.__setDOMNodeStylePadding = function (node_style, padding) { if (padding) { node_style.paddingLeft = ((padding.left < 0) ? 0 : padding.left) + "px"; node_style.paddingTop = ((padding.top < 0) ? 0 : padding.top) + "px"; node_style.paddingRight = ((padding.right < 0) ? 0 : padding.right) + "px"; node_style.paddingBottom = ((padding.bottom < 0) ? 0 : padding.bottom) + "px"; } else { node_style.padding = "0px"; } }; nexacro.__setDOMNodeStylePaddingXY = function (node_style, left, top, right, bottom) { node_style.paddingLeft = left + "px"; node_style.paddingTop = top + "px"; node_style.paddingRight = right + "px"; node_style.paddingBottom = bottom + "px"; }; nexacro.__setDOMNodeStyleMargin = function (node_style, margin) { if (margin) { } else { node_style.margin = "0px"; } }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeStyleCursor = function (node_style, cursor, deftype) { var cur_type = (cursor && !cursor._is_empty) ? cursor._value : (deftype ? deftype : "arrow"); if (cur_type == "auto") { cur_type = "default"; } else if (cur_type == "no") { cur_type = "not-allowed"; } else if (cur_type == "pointer") { cur_type = "hand"; } else if (cur_type == "arrowwait") { cur_type = "progress"; } else if (cur_type == "arrow") { cur_type = "default"; } else if (cur_type == "coll-resize" || cur_type == "colr-resize") { cur_type = "col-resize"; } else if (cur_type == "rowt-resize" || cur_type == "rowb-resize") { cur_type = "row-resize"; } node_style.cursor = cur_type; }; } else if (nexacro.Browser != "IE" || (nexacro.Browser == "IE" && nexacro.BrowserVersion >= 9)) { nexacro.__setDOMNodeStyleCursor = function (node_style, cursor, deftype) { var cur_type = (cursor && !cursor._is_empty) ? cursor._value : (deftype ? deftype : "arrow"); if (cur_type == "auto") { cur_type = "default"; } else if (cur_type == "no") { cur_type = "not-allowed"; } else if (cur_type == "hand") { cur_type = "pointer"; } else if (cur_type == "text") { cur_type = "text"; } else if (cur_type == "arrow") { cur_type = "default"; } else if (cur_type == "arrowwait") { cur_type = "progress"; } else if (cur_type == "coll-resize" || cur_type == "colr-resize") { cur_type = "col-resize"; } else if (cur_type == "rowt-resize" || cur_type == "rowb-resize") { cur_type = "row-resize"; } node_style.cursor = cur_type; }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeStyleShadow = function (node_style, shadow) { }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion >= 9) { nexacro.__setDOMNodeStyleShadow = function (node_style, shadow) { node_style.boxShadow = shadow._sysvalue; }; } else if (nexacro.Browser == "Gecko" && nexacro.BrowserVersion < 2) { nexacro.__setDOMNodeStyleShadow = function (node_style, shadow) { node_style.MozBoxShadow = shadow._sysvalue; }; } else if (nexacro.BrowserType == "WebKit") { nexacro.__setDOMNodeStyleShadow = function (node_style, shadow) { node_style.webkitBoxShadow = shadow._sysvalue; }; } else { nexacro.__setDOMNodeStyleShadow = function (node_style, shadow) { node_style.boxShadow = shadow._sysvalue; }; } nexacro.__setDOMNodeStyleLineSpace = function (node_style, linespace) { node_style.lineHeight = (linespace < 0) ? "" : linespace + "px"; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 8) { nexacro.__setDOMNodeWordWrap = function (node, use_wordwrap) { var node_style = node.style; if (use_wordwrap == "char") { node_style.whiteSpace = "pre"; node_style.wordWrap = "break-word"; node_style.wordBreak = "break-all"; } else if (use_wordwrap == "english") { node_style.whiteSpace = "pre"; node_style.wordWrap = "break-word"; node_style.wordBreak = ""; } else { node_style.whiteSpace = "pre"; node_style.wordWrap = "normal"; } }; } else { nexacro.__setDOMNodeWordWrap = function (node, use_wordwrap) { var node_style = node.style; if (use_wordwrap == "char") { node_style.whiteSpace = "pre-wrap"; node_style.wordWrap = "break-word"; node_style.wordBreak = "break-all"; } else if (use_wordwrap == "english") { node_style.whiteSpace = "pre-wrap"; node_style.wordWrap = "break-word"; node_style.wordBreak = ""; } else { node_style.whiteSpace = "pre"; node_style.wordWrap = "normal"; node_style.wordBreak = ""; } }; } nexacro.__setTextAreaDOMNodeWordWrap = function (node, use_wordwrap) { var node_style = node.style; if (use_wordwrap == "char" || use_wordwrap == "english") { node.wrap = "hard"; } else { node.wrap = "off"; } nexacro.__setDOMNodeWordWrap(node, use_wordwrap); }; nexacro.__setDOMNodeFocusBorder = function (node, border) { }; nexacro.__setDOMNodeTabIndentSize = function (node, nTabSize) { var node_style = node.style; node_style.tabSize = nTabSize; }; nexacro.__setDOMNodeSelectBackgroundColor = function (node, color) { }; nexacro.__setDOMNodeSelectColor = function (node, color) { }; nexacro.__setDOMNodeCaretColor = function (node, color) { }; nexacro.__setDOMNodeCompositeColor = function (node, color) { }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__changeInputDOMNodeType = function (node, type) { if (node.type == type) { return node; } var doc = node.ownerDocument; var parent = (node.parentNode || node.parentElement); var outerHTML = node.outerHTML; outerHTML = outerHTML.replace(/type=[a-z]*/, ""); outerHTML = outerHTML.replace(/value=""/, "value=\"" + node.value + "\""); var new_node = doc.createElement(outerHTML); new_node.setAttribute("type", type ? type : "text"); nexacro.__insertDOMNode(parent, new_node, node); nexacro.__removeDOMNode(parent, node); return new_node; }; } else { nexacro.__changeInputDOMNodeType = function (node, type) { if (node.type != type) { node.type = type; } return node; }; } nexacro.__setDOMNodeImeMode = function (node, mode) { var imemodestr = null; if (mode == "alpha" || mode == "alpha,full") { imemodestr = "inactive"; } else if (mode == "hangul" || mode == "hangul,full") { imemodestr = "active"; } else if (mode == "katakana" || mode == "katakana,full") { imemodestr = "auto"; } else if (mode == "hiragana") { imemodestr = "active"; } else if (mode == "direct") { imemodestr = "inactive"; } else if (mode == "disabled") { imemodestr = "disabled"; } else { imemodestr = ""; } node.style.imeMode = imemodestr; }; nexacro.__setDOMNodeSelect = function (_doc, node) { node.select(); }; if (nexacro.Browser == "IE") { nexacro.__setDOMNodeSetSelect = function (_doc, node, start, end) { if (typeof start == 'number') { end = (typeof end == 'number') ? end : start; if (node.createTextRange) { var range = node.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } } }; nexacro.__setTextAreaDOMNodeSetSelect = function (_doc, node, start, end) { if (typeof start == 'number') { if (node.createTextRange) { var range = node.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } } }; } else { nexacro.__setDOMNodeSetSelect = function (_doc, node, start, end) { if (node.type == "date") { return; } if (typeof start == 'number') { end = (typeof end == 'number') ? end : start; if (node.setSelectionRange) { node.setSelectionRange(start, end); } else if (node.createTextRange) { var range = node.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } } }; nexacro.__setTextAreaDOMNodeSetSelect = function (_doc, node, start, end) { if (typeof start == 'number') { if (node.setSelectionRange) { node.setSelectionRange(start, end); } else if (node.createTextRange) { var range = node.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } } }; } nexacro.__getNodeSelectionStart = function (node) { return node.selectionStart; }; nexacro.__getNodeSelectionEnd = function (node) { return node.selectionEnd; }; nexacro.__getDOMNodeCaretPos = function (_doc, node) { if (node.type === "date") { return -1; } var begin = 0, end = 0; if (node.setSelectionRange) { begin = nexacro.__getNodeSelectionStart(node); end = nexacro.__getNodeSelectionEnd(node); } else if (_doc.selection && _doc.selection.createRange) { var range = _doc.selection.createRange(); begin = 0 - range.duplicate().moveStart('character', -100000); end = begin + range.text.length; } return { begin : begin, end : end }; }; nexacro.__getTextAreaDOMNodeCaretPos = function (_doc, node) { var begin = 0, end = 0; var value = node.value; if (node.setSelectionRange) { begin = nexacro.__getNodeSelectionStart(node); end = nexacro.__getNodeSelectionEnd(node); if (nexacro.Browser == "IE" && nexacro.BrowserVersion == 11) { var len = value.length; if (begin > len) { begin = len; } if (end > len) { end = len; } } } else if (_doc.selection && _doc.selection.createRange) { var range = _doc.selection.createRange(); var n_value = value.replace(/\r\n/g, '\n'); var len = n_value.length; var txtRange = node.createTextRange(); txtRange.moveToBookmark(range.getBookmark()); var endRange = node.createTextRange(); endRange.collapse(false); if (txtRange.compareEndPoints('StartToEnd', endRange) > -1) { begin = end = len; } else { begin = -txtRange.moveStart('character', -len); if (txtRange.compareEndPoints('EndToEnd', endRange) > -1) { end = len; } else { end = -txtRange.moveEnd('character', -len); } } } return { begin : begin, end : end }; }; nexacro.__getDOMNodeCaretLine = function (_doc, node) { var start = 0, end = 0, normalizedValue, range, textInputRange, len, endRange; var selectionStart = nexacro.__getNodeSelectionStart(node); var selectionEnd = nexacro.__getNodeSelectionEnd(node); if (typeof selectionStart == "number" && typeof selectionEnd == "number") { if (nexacro.Browser != "IE" && node.selectionDirection == "forward") { start = selectionEnd; } else { start = selectionStart; } var text = node.value.slice(0, start); var textarr = text.split("\n"); var line = textarr.length; var element = node._linked_element; if (element.wordwrap != "none") { var i = 0; var curline = 0; var checkline = 0; var subline = 0; for (i = 0; i < line; i++) { var t = textarr[i]; curline = nexacro._getLineCountWithWordwrap(element, t, element.wordwrap); subline += curline; } if (line == textarr.length) { textarr = node.value.slice(0, start + 2).split("\n"); var text_temp = textarr[line - 1]; checkline = nexacro._getLineCountWithWordwrap(element, text_temp, element.wordwrap); if (checkline > curline) { subline++; } } line = subline; } return line; } else { node.setActive(); var element = node._linked_element; var line = 0; range = _doc.selection.createRange(); if (range && range.parentElement() == node) { len = node.value.length; normalizedValue = node.value.replace(/\r\n/g, "\n"); textInputRange = node.createTextRange(); textInputRange.moveToBookmark(range.getBookmark()); endRange = node.createTextRange(); endRange.collapse(false); var text; if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { textarr = normalizedValue.slice(0, len).split("\n"); } else { start = -textInputRange.moveStart("character", -len); textarr = normalizedValue.slice(0, start).split("\n"); } if (textarr === undefined || textarr == null) { return 1; } line = textarr.length; if (element.wordwrap != "none") { var i = 0; var curline = 0; var checkline = 0; var subline = 0; for (i = 0; i < line; i++) { var t = textarr[i]; curline = nexacro._getLineCountWithWordwrap(element, t, element.wordwrap); subline += curline; } var text_temp; if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { textarr = normalizedValue.slice(0, len + 2).split("\n"); } else { textarr = normalizedValue.slice(0, start + 2).split("\n"); } if (line == textarr.length) { text_temp = textarr[line - 1]; checkline = nexacro._getLineCountWithWordwrap(element, text_temp, element.wordwrap); if (checkline > curline) { subline++; } } line = subline; } } return line; } }; nexacro.__getDOMNodeValue = function (node) { if (node) { return node.value; } }; nexacro.__getHTMLStyleAbsolute = function () { return "position:absolute;overflow:hidden;"; }; nexacro.__getHTMLStyleRelative = function () { return "position:relative;overflow:hidden;"; }; nexacro.__getHTMLStyleAbsoluteTransparent = function () { return "position:absolute;overflow:hidden;background-color:transparent;"; }; nexacro.__getTextAreaHTMLStyleAbsoluteTransparent = function () { return "position:relative;overflow:scroll;background-color:transparent;"; }; nexacro.__getMobileIframeHTMLStyleScroll = function () { return "overflow:auto;-webkit-overflow-scrolling:touch;"; }; nexacro.__getHTMLStylePosLeftTop = function (left, top) { return "position:absolute;overflow:hidden;left:" + (left | 0) + "px;top:" + (top | 0) + "px;"; }; nexacro.__getHTMLStylePosRightTop = function (right, top) { return "position:absolute;overflow:hidden;right:" + (right | 0) + "px;top:" + (top | 0) + "px;"; }; nexacro.__getHTMLStylePosLeftBottom = function (left, bottom) { return "position:absolute;overflow:hidden;left:" + (left | 0) + "px;bottom:" + (bottom | 0) + "px;"; }; nexacro.__getHTMLStylePosRightBottom = function (right, bottom) { return "position:absolute;overflow:hidden;right:" + (right | 0) + "px;bottom:" + (bottom | 0) + "px;"; }; nexacro.__getHTMLStylePosSize = function (left, top, width, height) { return "position:absolute;overflow:hidden;" + "left:" + (left | 0) + "px;" + "top:" + (top | 0) + "px;" + "width:" + (width | 0) + "px;" + "height:" + (height | 0) + "px;"; }; nexacro.__getHTMLStylePosUnitSize = function (left, top, width, height) { return "position:absolute;overflow:hidden;" + "left:" + (left | 0) + "px;" + "top:" + (top | 0) + "px;" + "width:" + width + ";" + "height:" + height + ";"; }; nexacro.__getHTMLStylePos = function (left, top) { return "left:" + (left | 0) + "px;" + "top:" + (top | 0) + "px;"; }; nexacro.__getHTMLStyleSize = function (width, height) { if (width >= 0 && height >= 0) { return "width:" + (width | 0) + "px;" + "height:" + (height | 0) + "px;"; } return ""; }; nexacro.__getHTMLStyleUnitSize = function (width, height) { return "width:" + (width | 0) + ";" + "height:" + (height | 0) + ";"; }; nexacro.__getHTMLAttrSize = function (width, height) { if (width >= 0 && height >= 0) { return " width='" + width + "px' height='" + height + "px'"; } return ""; }; nexacro.__getHTMLCanvasAttrSize = function (width, height) { if (width >= 0 && height >= 0) { return " width='" + width + "' height='" + height + "'"; } return ""; }; nexacro.__getHTMLStyleVisible = function (width, height) { return (visible_flag == true) ? "" : "visibility:hidden;"; }; nexacro.__getHTMLStyleDisplay = function (width, height) { return "display:" + v + ";"; }; nexacro.__getHTMLAttrEnable = function (enable_flag) { return enable_flag ? "" : " disabled='true'"; }; nexacro.__getTextAreaHTMLAttrEnable = function (enable_flag) { return enable_flag ? nexacro.__getHTMLAttrSelectable(enable_flag) : (" disabled='true'" + nexacro.__getHTMLAttrSelectable(enable_flag)); }; nexacro.__getHTMLAttrReadOnly = function (readonly_flag) { return readonly_flag ? " readOnly='true'" : ""; }; nexacro.__getHTMLAttrTabIndex = function (index) { return index > -1 ? " tabIndex='" + index + "'" : ""; }; nexacro.__getHTMLAttrToolTip = function (tooltiptext, tooltiptype) { return " title='" + nexacro._encodeXML(tooltiptext) + "'"; }; if ((nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) || nexacro.Browser == "Opera") { nexacro.__getHTMLAttrSelectable = function (selectable_flag) { return " unselectable=" + (selectable_flag ? "'off'" : "'on'"); }; nexacro.__getHTMLStyleSelectable = function (selectable_flag) { return ""; }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion > 9) { nexacro.__getHTMLAttrSelectable = function (selectable_flag) { return ""; }; nexacro.__getHTMLStyleSelectable = function (selectable_flag) { return selectable_flag ? "" : "-ms-user-select:none;"; }; } else if (nexacro.BrowserType == "Gecko") { nexacro.__getHTMLAttrSelectable = function (selectable_flag) { return ""; }; nexacro.__getHTMLStyleSelectable = function (selectable_flag) { return selectable_flag ? "" : "-moz-user-select:none;"; }; } else if (nexacro.BrowserType == "WebKit") { nexacro.__getHTMLAttrSelectable = function (selectable_flag) { return ""; }; nexacro.__getHTMLStyleSelectable = function (selectable_flag) { return selectable_flag ? "" : "-webkit-user-select:none;"; }; } else { nexacro.__getHTMLAttrSelectable = function (selectable_flag) { return ""; }; nexacro.__getHTMLStyleSelectable = function (selectable_flag) { return selectable_flag ? "" : "user-select:none;"; }; } nexacro.__getImageHTMLImageUrl = function (imageurl) { return " src='" + nexacro._encodeXML(imageurl) + "'"; }; nexacro.__getBKImageHTMLStyleImageUrl = function (imageurl) { return "background-image:url(" + nexacro._encodeXML(imageurl) + ");"; }; nexacro.__getHTMLAttrValue = function (value) { return " value='" + nexacro._encodeXML(value) + "'"; }; (function () { var re_check = /\r|\n/; var re_newline = /\r\n|\n|\r/g; nexacro.__getSinglelineText = function (text) { if (re_check.test(text)) { return text.replace(re_newline, " "); } else { return text; } }; })(); nexacro.__getHTMLText = function (text, _new_line) { if (_new_line) { return nexacro.__toInnerHTMLText(nexacro.__getSinglelineText(text)); } else { return nexacro.__toInnerHTMLText(text); } }; nexacro.__getHTMLStyleDecorateText = function (text, _new_line) { return "text-decoration:" + nexacro._encodeXML(nexacro._decorateString(text)); }; nexacro.__getHTMLAttrMaxLength = function (maxlength) { return " maxlength='" + ((maxlength > 0) ? maxlength : 65535) + "'"; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__getHTMLStyleBorderType = function (bordertype) { return ""; }; } else if (nexacro.Browser != "IE" || (nexacro.Browser == "IE" && nexacro.BrowserVersion >= 9)) { if (nexacro.Browser == "Gecko" && nexacro.BrowserVersion < 2) { nexacro.__getHTMLStyleBorderType = function (bordertype) { if (bordertype.type != "normal" && bordertype.type != "") { var radius_str = bordertype._radiusx + "px " + bordertype._radiusy + "px"; if (bordertype._lefttop && bordertype._righttop && bordertype._rightbottom && bordertype._leftbottom) { return "-moz-border-radius:" + radius_str + ";"; } else { return "-moz-border-radius-topleft:" + ((bordertype._lefttop) ? radius_str : "0px") + ";" + "-moz-border-radius-topright:" + ((bordertype._righttop) ? radius_str : "0px") + ";" + "-moz-border-radius-bottomright:" + ((bordertype._rightbottom) ? radius_str : "0px") + ";" + "-moz-border-radius-bottomleft:" + ((bordertype._leftbottom) ? radius_str : "0px") + ";"; } } else { return ""; } }; } else { nexacro.__getHTMLStyleBorderType = function (bordertype) { if (bordertype.type != "normal" && bordertype.type != "") { var radius_str = bordertype._radiusx + "px " + bordertype._radiusy + "px"; if (bordertype._lefttop && bordertype._righttop && bordertype._rightbottom && bordertype._leftbottom) { return "border-radius:" + radius_str + ";"; } else { return "border-top-left-radius:" + ((bordertype._lefttop) ? radius_str : "0px") + ";" + "border-top-right-radius:" + ((bordertype._righttop) ? radius_str : "0px") + ";" + "border-bottom-right-radius:" + ((bordertype._rightbottom) ? radius_str : "0px") + ";" + "border-bottom-left-radius:" + ((bordertype._leftbottom) ? radius_str : "0px") + ";"; } } else { return ""; } }; } } nexacro.__getHTMLStyleBorder = function (border) { if (border && !border._is_real_empty()) { if (border._linecnt == 1) { return "border:" + border._systop + ";"; } else { return "border-top:" + border._systop + ";" + "border-right:" + border._sysright + ";" + "border-bottom:" + border._sysbottom + ";" + "border-left:" + border._sysleft + ";"; } } else { return ""; } }; nexacro.__getHTMLStyleBackgroundColor = function (color) { if (color) { return "background-color:" + color + ";"; } else { return ""; } }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__getHTMLStyleBackgroundImage = function (url, repeat, bkpos) { if (url) { return "background-image:" + "url(" + url + ")" + ";" + "background-repeat:" + repeat + ";" + "background-position:" + bkpos + ";"; } else { return ""; } }; nexacro.__getHTMLStyleBackgroundGradation = function (sysgradation) { return ""; }; nexacro.__getHTMLStyleBackgroundImageGradation = function (url, sysgradation, repeat, bkpos) { if (url) { return "background-image:" + "url(" + url + ")" + ";" + "background-repeat:" + repeat + ";" + "background-position:" + bkpos + ";"; } else { return ""; } }; } else { nexacro.__getHTMLStyleBackgroundImage = function (url, repeat, bkpos) { if (url) { if (repeat == "stretch") { return "background-image:" + "url(" + url + ")" + ";" + "background-size:100% 100%;"; } else { return "background-image:" + "url(" + url + ")" + ";" + "background-repeat:" + repeat + ";" + "background-position:" + bkpos + ";"; } } else { return ""; } }; nexacro.__getHTMLStyleBackgroundGradation = function (sysgradation) { if (sysgradation) { return "background-image:" + sysgradation + ";"; } else { return ""; } }; nexacro.__getHTMLStyleBackgroundImageGradation = function (url, sysgradation, repeat, bkpos) { if (url && sysgradation) { if (repeat == "stretch") { return "background-image:" + "url(" + url + ")," + sysgradation + ";" + "background-size:100% 100%;"; } else { return "background-image:" + "url(" + url + ")," + sysgradation + ";" + "background-repeat:" + repeat + ";" + "background-position:" + bkpos + ";"; } } else if (url) { if (repeat == "stretch") { return "background-image:" + "url(" + url + ");" + "background-size:100% 100%;"; } else { return "background-image:" + "url(" + url + ");" + "background-repeat:" + repeat + ";" + "background-position:" + bkpos + ";"; } } else if (sysgradation) { return "background-image:" + sysgradation + ";"; } else { return ""; } }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) { nexacro.__getHTMLStyleOpacity = function (sysopacity) { ""; }; } else { nexacro.__getHTMLStyleOpacity = function (sysopacity) { if (sysopacity < 100) { return "opacity:" + (sysopacity / 100) + ";"; } }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) { nexacro.__getHTMLStyleEdgeBorder = function (url, edgex, edgey) { return ""; }; } else { if (nexacro.Browser == "Gecko") { nexacro.__getHTMLStyleEdgeBorder = function (node_style, url, edgex, edgey) { var edge = edgey + ' ' + edgex; return "border-style:solid;" + "border-width:" + edge + ";" + "-moz-border-image:" + "url(" + url + ") " + edge + " stretch;" + "border-border-image-slice:" + edge + " fill;"; }; } else if (nexacro.Browser == "WebKit" || nexacro.Browser == "Safari" || nexacro.Browser == "MobileSafari") { nexacro.__getHTMLStyleEdgeBorder = function (node_style, url, edgex, edgey) { var edge = edgey + ' ' + edgex; return "border-style:solid;" + "border-width:" + edge + ";" + "-webkit-border-image:" + "url(" + url + ") " + edge + " stretch;" + "-webkit-border-image-slice:" + edge + " fill;"; }; } else if (nexacro.Browser == "Opera") { nexacro.__getHTMLStyleEdgeBorder = function (node_style, url, edgex, edgey) { var edge = edgey + ' ' + edgex; return "border-style:solid;" + "border-width:" + edge + ";" + "-o-border-image:" + "url(" + url + ") " + edge + " stretch;"; }; } else { nexacro.__getHTMLStyleEdgeBorder = function (node_style, url, edgex, edgey) { var edge = edgey + ' ' + edgex; return "border-style:solid;" + "border-width:" + edge + ";" + "border-image:" + "url(" + url + ") " + edge + " stretch;" + "border-image-slice:" + edge + " fill;"; }; } } nexacro.__getHTMLStyleAlign = function (align) { return "text-align:" + align._halign + ";vertical-align:" + align._valign + ";"; }; nexacro.__getHTMLStyleAlignXY = function (halign, valign) { return ((halign) ? ("text-align:" + halign + ";") : "") + ((valign) ? ("vertical-align:" + align._valign + ";") : ""); }; nexacro.__getBKImageHTMLStyleAlign = function (align) { return (align) ? ("background-position:" + align._halign + ' ' + (align.valign == "middle" ? "center" : align.valign) + ";") : ""; }; nexacro.__getBKImageHTMLStyleAlignXY = function (halign, valign) { return "background-position:" + halign + ' ' + (valign == "middle" ? "center" : valign) + ";"; }; nexacro.__getHTMLStyleColor = function (color) { return (color) ? ("color:" + color._syscolor + ";") : ""; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__getHTMLStyleFont = function (font) { return (font) ? ((font._bold ? "font-weight:bold;" : "") + (font._italic ? "font-style:italic;" : "") + "font-family:" + font.face + ";" + "font-size:" + (font.size >= 0 ? font.size + "pt;" : Math.abs(font.size) + "px;") + (font._sysdecoration ? ("text-decoration:" + font._sysdecoration + ";") : "")) : ""; }; } else { nexacro.__getHTMLStyleFont = function (font) { return (font) ? ("font:" + font._sysvalue + ";" + (font._sysdecoration ? ("text-decoration:" + font._sysdecoration + ";") : "")) : ""; }; } nexacro.__getHTMLStylePadding = function (padding) { return (padding) ? ("padding:" + padding.top + "px " + padding.right + "px " + padding.bottom + "px " + padding.left + "px;") : "padding:0px;"; }; nexacro.__getHTMLStylePaddingXY = function (left, top, right, bottom) { return "padding:" + top + "px " + right + "px " + bottom + "px " + left + "px;"; }; nexacro.__getHTMLStyleMargin = function (margin) { if (margin) { return ""; } else { return ""; } }; nexacro.__getHTMLStyleHAlign = function (halign) { return "text-align:" + halign + ";"; }; nexacro.__getHTMLStyleAlign = function (align) { return "text-align:" + align._halign + ";vertical-align:" + align._valign + ";"; }; nexacro.__getHTMLStyleAlignXY = function (halign, valign) { return "text-align:" + halign + ";vertical-align:" + valign + ";"; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 9) { nexacro.__getInputHTMLStyleAlignXY = function (halign, valign, container_height, txt_height) { var halign_str = "text-align:" + halign + ";"; if (valign == "top") { return halign_str + "padding-top:0px;"; } else if (valign == "middle") { return halign_str + ((container_height > txt_height) ? "padding-top:" + ((container_height - txt_height) / 2) + "px;" : ""); } else if (valign == "bottom") { return halign_str + ((container_height - txt_height) ? "padding-top:" + (container_height - txt_height) + "px;" : ""); } return halign_str; }; } else if (nexacro.BrowserType == "WebKit") { nexacro.__getInputHTMLStyleAlignXY = function (halign, valign, container_height, txt_height) { var halign_str = "text-align:" + halign + ";"; if (valign == "top") { return halign_str + "top:0px;height:" + txt_height + "px;"; } else if (valign == "middle") { return halign_str + "top:0px;height:" + container_height + "px;"; } else if (valign == "bottom") { return halign_str + "top:" + (container_height - txt_height) + "px;height:" + txt_height + "px;"; } return halign_str; }; } else { nexacro.__getInputHTMLStyleAlignXY = function (halign, valign, container_height, txt_height) { var halign_str = "text-align:" + halign + ";"; if (valign == "top") { return halign_str + "padding-top:0px;padding-bottom:" + (container_height - txt_height) + "px;"; } else if (valign == "middle") { return halign_str + "padding-top:0px;padding-bottom:0px;"; } else if (valign == "bottom") { return halign_str + "padding-top:" + (container_height - txt_height) + "px;padding-bottom:0px;"; } return halign_str; }; } nexacro.__getTextAreaHTMLStyleAlignXY = function (halign, valign, blank_height) { blank_height = blank_height >= 0 ? blank_height : 0; if (valign == "top") { return "text-align:" + halign + ";padding-top:0px;padding-bottom:0px;"; } else if (valign == "middle") { return "text-align:" + halign + ";padding-top:" + (blank_height / 2) + "px;padding-bottom:0px;"; } else if (valign == "bottom") { return "text-align:" + halign + ";padding-top:" + blank_height + "px;padding-bottom:0px;"; } return "text-align:" + halign + ";"; }; nexacro.__getHTMLStyleVAlignMargin = function (valign, container_height, txt_height) { var offset = 0; if (valign == "middle") { offset = (container_height - txt_height) / 2; } else if (valign == "bottom") { offset = (container_height - txt_height); } return "margin-top:" + offset + "px;"; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__getHTMLStyleCursor = function (cursor, deftype) { var cur_type = (cursor && !cursor._is_empty) ? cursor._value : (deftype ? deftype : "arrow"); if (cur_type == "no") { cur_type = "not-allowed"; } else if (cur_type == "pointer") { cur_type = "hand"; } else if (cur_type == "arrowwait") { cur_type = "progress"; } else if (cur_type == "arrow") { cur_type = "default"; } return "cursor:" + cur_type + ";"; }; } else if (nexacro.Browser != "IE" || (nexacro.Browser == "IE" && nexacro.BrowserVersion >= 9)) { nexacro.__getHTMLStyleCursor = function (cursor, deftype) { var cur_type = (cursor && !cursor._is_empty) ? cursor._value : (deftype ? deftype : "arrow"); if (cur_type == "no") { cur_type = "not-allowed"; } else if (cur_type == "hand") { cur_type = "pointer"; } else if (cur_type == "text") { cur_type = "text"; } else if (cur_type == "arrow") { cur_type = "default"; } else if (cur_type == "arrowwait") { cur_type = "progress"; } return "cursor:" + cur_type + ";"; }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro.__getHTMLStyleShadow = function (shadow) { return ""; }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion >= 9) { nexacro.__getHTMLStyleShadow = function (shadow) { return "box-shadow:" + shadow._sysvalue + ";"; }; } else if (nexacro.Browser == "Gecko" && nexacro.BrowserVersion < 2) { nexacro.__getHTMLStyleShadow = function (shadow) { return "-moz-box-shadow:" + shadow._sysvalue + ";"; }; } else if (nexacro.BrowserType == "WebKit") { nexacro.__getHTMLStyleShadow = function (shadow) { return "-webkit-box-shadow:" + shadow._sysvalue + ";"; }; } else { nexacro.__getHTMLStyleShadow = function (shadow) { return "box-shadow:" + shadow._sysvalue + ";"; }; } nexacro.__getHTMLStyleLineSpace = function (linespace) { return (linespace < 0) ? "" : "line-height:" + linespace; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro.__getHTMLAttrWordWrap = function (use_wordwrap) { if (use_wordwrap != "none") { return " wrap='hard'"; } else { return " wrap='off'"; } }; } else { nexacro.__getHTMLAttrWordWrap = function (use_wordwrap) { return ""; }; } if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 8) { nexacro.__getHTMLStyleWordWrap = function (use_wordwrap) { if (use_wordwrap == "char" || use_wordwrap == "english") { return "white-space:pre;word-wrap:break-word;"; } else { return "white-space:pre;word-wrap:normal;"; } }; } else { nexacro.__getHTMLStyleWordWrap = function (use_wordwrap) { if (use_wordwrap == "char") { return "white-space:pre;word-wrap:break-word;"; } else if (use_wordwrap == "english") { return "white-space:pre-wrap;word-wrap:break-word;"; } else { return "white-space:pre;word-wrap:normal;"; } }; } nexacro.__getHTMLAttrFocusBorder = function (shadow) { return ""; }; nexacro.__getHTMLAttrTabIndentSize = function (nTabSize) { return ""; }; nexacro.__getHTMLStyleDecorateText = function (text) { "text-decoration:" + nexacro._encodeXML(nexacro._decorateString(text)) + ";"; }; nexacro.__getHTMLStylemeMode = function (mode) { var imemodestr = null; if (mode == "alpha" || mode == "alpha,full") { imemodestr = "inactive"; } else if (mode == "hangul" || mode == "hangul,full") { imemodestr = "active"; } else if (mode == "katakana" || mode == "katakana,full") { imemodestr = "auto"; } else if (mode == "hiragana") { imemodestr = "active"; } else if (mode == "direct") { imemodestr = "inactive"; } else if (mode == "disabled") { imemodestr = "disabled"; } else { return ""; } return "ime-mode:" + imemodestr + ";"; }; nexacro.__getHTMLAttrSelectBackgroundColor = function (color) { return ""; }; nexacro.__getHTMLAttrSelectColor = function (color) { return ""; }; nexacro.__getHTMLAttrCaretColor = function (color) { return ""; }; nexacro.__getHTMLAttrCompositeColor = function (color) { return ""; }; nexacro._firstLoadFocus = true; nexacro.__isActiveWindow = function (_doc) { if (_doc.hasFocus) { return _doc.hasFocus(); } }; nexacro._checkWindowActive = function (_window) { var is_active; var _doc = _window._doc; if (_doc) { if (_doc.hasFocus) { is_active = _doc.hasFocus(); _window._is_active_window = is_active; } if (is_active === undefined) { is_active = _window._is_active_window; } } return is_active; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { if (nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeFocus = function (node) { var is_active_window; var owner_doc = (node.ownerDocument || node.document); if (owner_doc.hasFocus) { is_active_window = owner_doc.hasFocus(); } if (is_active_window === undefined) { if (!node || !node._linked_element || !node._linked_element._parent_elem) { return; } var comp = node._linked_element._parent_elem.linkedcontrol; var _window = comp ? comp._getWindow() : null; if (_window) { is_active_window = _window._is_active_window; } } if (is_active_window) { owner_doc.focus(); if (node.unselectable == "on") { node.unselectable == "off"; try { node.setActive(); } catch (e) { } node.unselectable == "on"; } else { node.setActive(); } } }; nexacro.__setInputDOMNodeFocus = function (node) { var is_active_window; var owner_doc = (node.ownerDocument || node.document); if (owner_doc.hasFocus) { is_active_window = owner_doc.hasFocus(); } if (is_active_window === undefined) { if (!node || !node._linked_element || !node._linked_element._parent_elem) { return; } var comp = node._linked_element._parent_elem.linkedcontrol; var _window = comp ? comp._getWindow() : null; if (_window) { is_active_window = _window._is_active_window; } } if (is_active_window) { owner_doc.focus(); if (node.style.visibility == "hidden" || node.style.display == "none") { node.setActive(); } else if (node.offsetWidth == 0 || node.offsetHeight == 0) { node.setActive(); } else if (node.readOnly || node.disabled) { node.setActive(); } else { node.setActive(); node.blur(); try { node.focus(); } catch (e) { ; } } } }; } else { nexacro.__setDOMNodeFocus = function (node, selffocus) { var is_active_window; var owner_doc = (node.ownerDocument || node.document); if (!node || !node._linked_element || !node._linked_element._parent_elem) { return; } var comp = node._linked_element._parent_elem.linkedcontrol; var _window = comp ? comp._getWindow() : null; if (owner_doc.hasFocus) { is_active_window = _window ? (_window._is_active_window || owner_doc.hasFocus()) : owner_doc.hasFocus(); } if (is_active_window === undefined && _window) { is_active_window = _window._is_active_window; } if (is_active_window) { if (selffocus) { owner_doc.focus(); node.focus(); } else { var owner_bodynode = owner_doc.body; if (owner_bodynode) { owner_bodynode.focus(); } } } }; nexacro.__setInputDOMNodeFocus = function (node) { var is_active_window; var owner_doc = (node.ownerDocument || node.document); if (owner_doc.hasFocus) { is_active_window = owner_doc.hasFocus(); } if (is_active_window === undefined) { if (!node || !node._linked_element || !node._linked_element._parent_elem) { return; } var comp = node._linked_element._parent_elem.linkedcontrol; var _window = comp ? comp._getWindow() : null; if (_window) { is_active_window = _window._is_active_window; } } if (is_active_window) { owner_doc.focus(); node.focus(); } if (nexacro.BrowserVersion >= 10) { if (!is_active_window && nexacro._firstLoadFocus) { owner_doc.focus(); node.focus(); nexacro._firstLoadFocus = false; } } }; } } else { nexacro.__setDOMNodeFocus = function (node, selffocus) { var is_active_window; var owner_doc = (node.ownerDocument || node.document); if (!node || !node._linked_element || !node._linked_element._parent_elem) { return; } var comp = node._linked_element._parent_elem.linkedcontrol; var _window = comp ? comp._getWindow() : null; if (_window) { if (owner_doc.hasFocus) { is_active_window = _window._is_active_window || owner_doc.hasFocus(); } else { is_active_window = _window._is_active_window; } } if (is_active_window || (nexacro.OS == "iOS" && nexacro._isHybrid && nexacro._isHybrid())) { if (selffocus) { node.focus(); } else { var owner_body = owner_doc.body; if (owner_body) { owner_body.focus(); } } } }; nexacro.__setInputDOMNodeFocus = function (node) { var is_active_window; var owner_doc = (node.ownerDocument || node.document); if (!node || !node._linked_element || !node._linked_element._parent_elem) { return; } var comp = node._linked_element._parent_elem.linkedcontrol; var _window = comp ? comp._getWindow() : null; if (_window) { if (owner_doc.hasFocus) { is_active_window = _window._is_active_window || owner_doc.hasFocus(); } else { is_active_window = _window._is_active_window; } } if (is_active_window || (nexacro.OS == "iOS" && nexacro._isHybrid && nexacro._isHybrid())) { node.focus(); } }; } if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { if (nexacro.BrowserVersion <= 8) { nexacro.__setDOMNodeBlur = function (node) { try { node.blur(); } catch (e) { } }; } else { nexacro.__setDOMNodeBlur = function (node) { node.blur(); }; } } else { nexacro.__setDOMNodeBlur = function (node) { node.blur(); }; } nexacro._setDOMNodeRemoveCaret = function () { document.selection.empty(); }; nexacro._degreesToRadians = function (degrees) { return degrees * (Math.PI / 180); }; nexacro._radiansToDegrees = function (radians) { return radians * (180 / Math.PI); }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro._createMatrixIdentity = function () { return [[1, 0, 0], [0, 1, 0], [0, 0, 1] ]; }; nexacro._matrixMultiply = function (m1, m2) { var result = nexacro._createMatrixIdentity(); for (var x = 0; x < 3; x++) { for (var y = 0; y < 3; y++) { var sum = 0; for (var z = 0; z < 3; z++) { sum += m1[x][z] * m2[z][y]; } result[x][y] = sum; } } return result; }; nexacro._setMatrix = function (canvas, m, updateLineScale) { if (!nexacro._matrixIsFinite(m)) { return; } canvas._matrix = m; if (updateLineScale) { var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; canvas._line_scale = Math.sqrt(Math.abs(det)); } }; nexacro._matrixIsFinite = function (m) { for (var i = 0; i < 3; i++) { for (var j = 0; j < 2; j++) { if (!isFinite(m[i][j]) || isNaN(m[i][j])) { return false; } } } return true; }; nexacro._isPointInPath = function (path, pt) { for (var c = false, i = -1, l = path.length, j = l - 1; ++i < l; j = i) { if (((path[i].y <= pt.y && pt.y < path[j].y) || (path[j].y <= pt.y && pt.y < path[i].y)) && (pt.x < (path[j].x - path[i].x) * (pt.y - path[i].y) / (path[j].y - path[i].y) + path[i].x) && (c = !c)) { c = true; } } return c; }; nexacro.CanvasGradient = function (type) { this.type_ = type; this.x0 = 0; this.y0 = 0; this.r0 = 0; this.x1 = 0; this.y1 = 0; this.r1 = 0; this.colors = []; }; var _pCanvasGradient = nexacro.CanvasGradient.prototype; _pCanvasGradient.addColorStop = function (aOffset, aColor) { var color = nexacro._getWebColorFromXreColor(aColor); var alpha = nexacro._getXreColorAlpha(aColor) / 255; this.colors.push({ offset : aOffset, color : color, alpha : alpha }); }; delete _pCanvasGradient; nexacro.__setCanvasFillStyle = function (canvas, clrrgb, clra) { }; nexacro.__setCanvasStrokeStyle = function (canvas, strokecolor) { canvas._stroke_color = nexacro._getWebColorFromXreColor(strokecolor.value); canvas._stroke_alpha = nexacro._getXreColorAlpha(strokecolor.value) / 255; }; nexacro.__setCanvasLineCap = function (canvas, eCapType) { }; nexacro.__setCanvasLineJoin = function (canvas, eJoinType) { }; nexacro.__setCanvasLineWidth = function (canvas, nSize) { }; nexacro.__setCanvasMiterLimit = function (canvas, nLimit) { }; nexacro.__setCanvasShadowColor = function (canvas, clrRGA, clrA) { }; nexacro.__setCanvasShadowOffsetX = function (canvas, sX) { }; nexacro.__setCanvasShadowOffsetY = function (canvas, sY) { }; nexacro.__setCanvasShadowBlur = function (canvas, nFact) { }; nexacro.__setCanvasFont = function (canvas, font, sysvalue) { }; nexacro.__setCanvasFillColor = function (canvas, fillstyle) { canvas._fill_type = 1; canvas._fill_color = nexacro._getWebColorFromXreColor(fillstyle.value); canvas._fill_alpha = nexacro._getXreColorAlpha(fillstyle.value) / 255; }; nexacro.__setCanvasFillGradation = function (canvas, fillstyle) { canvas._fill_type = 2; canvas._fill_gradation = fillstyle; }; nexacro.__setCanvasTextAlign = function (canvas, eAlignValue) { if (eAlignValue == "center") { canvas._textAlign = 0; } else if (eAlignValue == "end") { canvas._textAlign = 1; } else if (eAlignValue == "start") { canvas._textAlign = 2; } else if (eAlignValue == "right") { canvas._textAlign = 3; } else if (eAlignValue == "left") { canvas._textAlign = 4; } }; nexacro.__setCanvasTextBaseline = function (canvas, eBaseValue) { if (eBaseValue == "alphabetic") { canvas._textBaseline = 0; } else if (eBaseValue == "hanging") { canvas._textBaseline = 1; } else if (eBaseValue == "top") { canvas._textBaseline = 2; } else if (eBaseValue == "bottom") { canvas._textBaseline = 3; } else if (eBaseValue == "middle") { canvas._textBaseline = 4; } }; nexacro.__drawCanvasBeginPath = function (canvas) { canvas._path_str = ""; }; nexacro.__drawCanvasClosePath = function (canvas) { canvas._path_str += 'x '; }; nexacro.__drawCanvasStrokeRect = function (canvas, x, y, dx, dy) { nexacro.__rectCanvas(canvas, x, y, dx, dy, true); nexacro.__strokeCanvas(canvas); nexacro.__drawCanvasBeginPath(canvas); }; nexacro.__drawCanvasFillRect = function (canvas, x, y, dx, dy) { nexacro.__drawCanvasmoveTo(canvas, x, y); nexacro.__drawCanvaslineTo(canvas, x + dx, y); nexacro.__drawCanvaslineTo(canvas, x + dx, y + dy); nexacro.__drawCanvaslineTo(canvas, x, y + dy); nexacro.__drawCanvasClosePath(canvas); nexacro.__fillCanvas(canvas); }; nexacro.__drawCanvasRect = nexacro.__drawCanvasStrokeRect; nexacro.__drawCanvasClearRect = function (canvas) { }; nexacro.__drawCanvaslineTo = function (canvas, x, y) { var elem = canvas._linked_element; var pt = elem._getCoordSize(x, y); canvas._pathArray.push({ x : canvas._curx, y : canvas._cury }); canvas._pathArray.push({ x : pt.x, y : pt.y }); var sub = 'l ' + pt.x + ',' + pt.y + ' '; canvas._path_str += sub; canvas._curx = pt.x; canvas._cury = pt.y; }; nexacro.__drawCanvasmoveTo = function (canvas, x, y) { var elem = canvas._linked_element; var pt = elem._getCoordSize(x, y); var sub = 'm ' + pt.x + ',' + pt.y + ' '; canvas._path_str += sub; canvas._curx = pt.x; canvas._cury = pt.y; }; nexacro.__drawCanvasQuadraticCurveTo = function (canvas, cp1x, cp1y, cp2x, cp2y) { if (!canvas._curx) { nexacro.__drawCanvasmoveTo(canvas, cp1x, cp1y); } var elem = canvas._linked_element; var cp = elem._getCoordSize(cp1x, cp1y); var p = elem._getCoordSize(cp2x, cp2y); var cp1 = { x : Math.round(canvas._curx + 2.0 / 3.0 * (cp.x - canvas._curx)), y : Math.round(canvas._cury + 2.0 / 3.0 * (cp.y - canvas._cury)) }; var cp2 = { x : Math.round(cp1.x + (p.x - canvas._curx) / 3.0), y : Math.round(cp1.y + (p.y - canvas._cury) / 3.0) }; canvas._pathArray.push({ x : cp1.x, y : cp1.y }); canvas._pathArray.push({ x : cp2.x, y : cp2.y }); canvas._pathArray.push({ x : p.x, y : p.y }); var sub = 'c ' + cp1.x + ',' + cp1.y + ',' + cp2.x + ',' + cp2.y + ',' + p.x + ',' + p.y + ' '; canvas._path_str += sub; canvas._curx = p.x; canvas._cury = p.y; }; nexacro.__drawCanvasBezierCurveTo = function (canvas, cp1x, cp1y, cp2x, cp2y, x, y) { if (!canvas._curx) { nexacro.__drawCanvasmoveTo(canvas, cp1x, cp1y); } var elem = canvas._linked_element; var p = elem._getCoordSize(cp1x, cp1y); canvas._pathArray.push({ x : p.x, y : p.y }); var cp1 = elem._getCoordSize(cp2x, cp2y); canvas._pathArray.push({ x : cp1.x, y : cp1.y }); var cp2 = elem._getCoordSize(x, y); canvas._pathArray.push({ x : cp2.x, y : cp2.y }); var sub = 'c ' + p.x + ',' + p.y + ',' + cp1.x + ',' + cp1.y + ',' + cp2.x + ',' + cp2.y + ' '; canvas._path_str += sub; canvas._curx = cp2.x; canvas._cury = cp2.y; }; nexacro.__darwCanvasArc = function (canvas, x, y, r, sA, eA, eCw) { var _canvas = canvas; var scale = canvas._scale; var hscale = canvas._half_scale; var _r = r * scale; var arcType = eCw ? 'at' : 'wa'; var xStart = x + Math.cos(sA) * _r - hscale; var yStart = y + Math.sin(sA) * _r - hscale; var xEnd = x + Math.cos(eA) * _r - hscale; var yEnd = y + Math.sin(eA) * _r - hscale; var elem = canvas._linked_element; var p = elem._getCoordSize(x, y); var pStart = elem._getCoordSize(xStart, yStart); var pEnd = elem._getCoordSize(xEnd, yEnd); if (parseInt(xStart) == parseInt(xStart) && eCw) { pStart.x -= 1; pStart.y -= 1; } else { pStart.x += 1; pStart.y += 1; } var sub = arcType + ' ' + (p.x - _r) + ',' + (p.y - _r) + ' ' + (p.x + _r) + ',' + (p.y + _r) + ' ' + parseInt(pStart.x) + ',' + parseInt(pStart.y) + ' ' + parseInt(pEnd.x) + ',' + parseInt(pEnd.y) + ' '; canvas._curx = pEnd.x; canvas._cury = pEnd.y; canvas._path_str += sub; }; nexacro.__drawCanvasArcTo = function (canvas, x, y, x2, y2, r) { if (canvas._curx) { var p0 = { x : canvas._curx / 10, y : canvas._cury / 10 }; var p1 = { x : x, y : y }; var p2 = { x : x2, y : y2 }; var radius = r; if ((p1.x == p0.x && p1.y == p0.y) || (p1.x == p2.x && p1.y == p2.y) || radius == 0) { nexacro.__drawCanvaslineTo(canvas, p1.x, p1.y); return true; } var p1p0 = { x : (p0.x - p1.x), y : (p0.y - p1.y) }; var p1p2 = { x : (p2.x - p1.x), y : (p2.y - p1.y) }; var p1p0_length = Math.sqrt(p1p0.x * p1p0.x + p1p0.y * p1p0.y); var p1p2_length = Math.sqrt(p1p2.x * p1p2.x + p1p2.y * p1p2.y); var cos_phi = (p1p0.x * p1p2.x + p1p0.y * p1p2.y) / (p1p0_length * p1p2_length); if (-1 == cos_phi) { element.lineTo(p1.x, p1.y); return true; } if (1 == cos_phi) { var max_length = 65535; var factor_max = max_length / p1p0_length; var ep = { x : (p0.x + factor_max * p1p0.x), y : (p0.y + factor_max * p1p0.y) }; nexacro.__drawCanvaslineTo(canvas, Math.round(ep.x), Math.round(ep.y)); return true; } var tangent = radius / Math.tan(Math.acos(cos_phi) / 2); var factor_p1p0 = tangent / p1p0_length; var t_p1p0 = { x : (p1.x + factor_p1p0 * p1p0.x), y : (p1.y + factor_p1p0 * p1p0.y) }; var orth_p1p0 = { x : p1p0.y, y : -p1p0.x }; var orth_p1p0_length = Math.sqrt(orth_p1p0.x * orth_p1p0.x + orth_p1p0.y * orth_p1p0.y); var factor_ra = radius / orth_p1p0_length; var cos_alpha = (orth_p1p0.x * p1p2.x + orth_p1p0.y * p1p2.y) / (orth_p1p0_length * p1p2_length); if (cos_alpha < 0) { orth_p1p0.x = -orth_p1p0.x; orth_p1p0.y = -orth_p1p0.y; } var p = { x : (t_p1p0.x + factor_ra * orth_p1p0.x), y : (t_p1p0.y + factor_ra * orth_p1p0.y) }; orth_p1p0.x = -orth_p1p0.x; orth_p1p0.y = -orth_p1p0.y; var sa = Math.acos(orth_p1p0.x / orth_p1p0_length); if (orth_p1p0.y < 0) { sa = 2 * Math.PI - sa; } var anticlockwise = false; var factor_p1p2 = tangent / p1p2_length; var t_p1p2 = { x : p1.x + factor_p1p2 * p1p2.x, y : p1.y + factor_p1p2 * p1p2.y }; var orth_p1p2 = { x : t_p1p2.x - p.x, y : t_p1p2.y - p.y }; var orth_p1p2_length = Math.sqrt(orth_p1p2.x * orth_p1p2.x + orth_p1p2.y * orth_p1p2.y); var ea = Math.acos(orth_p1p2.x / orth_p1p2_length); if (orth_p1p2.y < 0) { ea = 2 * Math.PI - ea; } if ((sa > ea) && ((sa - ea) < Math.PI)) { anticlockwise = true; } if ((sa < ea) && ((ea - sa) > Math.PI)) { anticlockwise = true; } nexacro.__drawCanvaslineTo(canvas, Math.round(t_p1p0.x), Math.round(t_p1p0.y)); nexacro.__darwCanvasArc(canvas, Math.round(p.x), Math.round(p.y), radius, sa, ea, anticlockwise); return true; } else { nexacro.__drawCanvasmoveTo(canvas, x, y); } }; nexacro.__isPointInCanvasPath = function (canvas, x, y) { if (canvas) { var elem = canvas._linked_element; var p = elem._getCoordSize(x, y); return nexacro._isPointInPath(canvas._pathArray, p); } }; nexacro.__clipCanvas = function (canvas) { }; nexacro.__setCanvasTransform = function (canvas, a, b, c, d, e, f) { var m = [[a, b, 0], [c, d, 0], [e, f, 1] ]; nexacro._setMatrix(canvas, m, true); }; nexacro.__measureCanvas = function (canvas, text) { }; nexacro.__createCanvasLinearGradient = function (canvas, aX0, aY0, aX1, aY1) { var gradient = new nexacro.CanvasGradient('gradient'); gradient.x0 = aX0; gradient.y0 = aY0; gradient.x1 = aX1; gradient.y1 = aY1; return gradient; }; nexacro.__createCanvasRadialGradient = function (canvas, x0, y0, x1, y1, r0, r1) { var gradient = new nexacro.CanvasGradient('gradientradial'); gradient.x0 = x0; gradient.y0 = y0; gradient.r0 = r0; gradient.x1 = x1; gradient.y1 = y1; gradient.r1 = r1; return gradient; }; nexacro.__rectCanvas = function (canvas, x, y, w, h) { var element = canvas._linked_element; if (canvas._path_str) { var gap = element.lineOffset; var gap2 = (h > 0) ? gap : -gap; element.moveTo(x - gap, y - gap2); element.lineTo(x + w + gap, y - gap2); element.lineTo(x + w + gap, y + h + gap2); element.lineTo(x - gap, y + h + gap2); element.closePath(); element.moveTo(x + gap, y + gap2); element.lineTo(x + w - gap, y + gap2); element.lineTo(x + w - gap, y + h - gap2); element.lineTo(x + gap, y + h - gap2); element.closePath(); } else { element.moveTo(x, y); element.lineTo(x + w, y); element.lineTo(x + w, y + h); element.lineTo(x, y + h); element.closePath(); } }; nexacro.__fillCanvas = function (canvas) { var elem = canvas._linked_element; if (canvas && canvas._path_str) { var vml_str = "" + ""; } else { vml_str += "fillcolor='" + canvas._fill_color + "' "; if (canvas._fill_alpha != 1) { vml_str += "opacity='" + canvas._fill_alpha + "' "; } vml_str += "path='" + canvas._path_str + "' />"; } canvas._vml_str += vml_str; canvas._draw_node.innerHTML = canvas._vml_str; } }; nexacro.__strokeCanvas = function (canvas) { var elem = canvas._linked_element; if (canvas._path_str) { var lineWidth = canvas._line_scale * elem.lineWidth; var vml_str = ""; vml_str += ""; vml_str += ""; vml_str += ""; canvas._vml_str += vml_str; canvas._draw_node.innerHTML = canvas._vml_str; } }; nexacro.__fillCanvasRect = function (canvas, x, y, dx, dy) { var elem = canvas._linked_element; elem.beginPath(); elem.moveTo(x, y); elem.lineTo(x + dx, y); elem.lineTo(x + dx, y + dy); elem.lineTo(x, y + dy); elem.closePath(); elem.fill(); }; nexacro.__scaleCanvas = function (canvas, dx, dy) { canvas._scale *= dx; canvas._half_scale *= dy; var m1 = [[dx, 0, 0], [0, dy, 0], [0, 0, 1] ]; nexacro._setMatrix(canvas, nexacro._matrixMultiply(m1, canvas._matrix), true); }; nexacro.__rotateCanvas = function (canvas, angle) { var c = Math.cos(angle); var s = Math.sin(angle); var m1 = [[c, s, 0], [-s, c, 0], [0, 0, 1] ]; nexacro._setMatrix(canvas, nexacro._matrixMultiply(m1, canvas._matrix), false); }; nexacro.__translateCanvas = function (canvas, dX, dY) { var m1 = [[1, 0, 0], [0, 1, 0], [dX, dY, 1] ]; nexacro._setMatrix(canvas, nexacro._matrixMultiply(m1, canvas._matrix), false); }; nexacro.__transformCanvas = function (canvas, a, b, c, d, e, f) { var m1 = [[a, b, 0], [c, d, 0], [e, f, 1] ]; nexacro._setMatrix(canvas, nexacro._matrixMultiply(m1, canvas._matrix), true); }; nexacro.__drawCanvasFillText = function (canvas, text, x, y, maxwidth) { var element = canvas._linked_element; if (typeof text == "string") { text = nexacro._encodeXml(text); } var textAlign = canvas._textAlign; var font = element.font; var color = canvas._fill_color; var textsize = nexacro._getTextSize(text, font); var textwidth = textsize[0]; var textheight = textsize[1]; var conY = nexacro._getTextBaseline(canvas._textBaseline, y, textheight); var carlen = (textwidth / text.length); if (nexacro.BrowserVersion == 8) { carlen *= 1.5; } var x1, y1 = conY, x2, y2 = conY + 0.125; var vtextAlign = "left"; if (textAlign == 2 || textAlign == 4 || textAlign === undefined) { x1 = x; x2 = x1 + textwidth; } else if (textAlign == 1 || textAlign == 3) { x1 = x - textwidth - carlen; x2 = x; vtextAlign = "right"; } else { x1 = (x - textwidth / 2) - carlen; x2 = (x + textwidth / 2); } var bpt = element._getCoordPos(x1, y1); var ept = element._getCoordPos(x2, y2); var vml_str = "" + ""; canvas._vml_str += vml_str; canvas._draw_node.innerHTML = canvas._vml_str; }; nexacro.__drawCanvasStrokeText = function (canvas, text, x, y) { var element = canvas._linked_element; if (typeof text == "string") { text = nexacro._encodeXml(text); } var vml_str = ""; var pt = element._getCoordPos(x, y); if (canvas) { var strokecolor = canvas._stroke_color; var font = element._font; vml_str += ""; vml_str += ""; } canvas._vml_str += vml_str; canvas._draw_node.innerHTML = canvas._vml_str; }; nexacro.__drawCanvasImage = function (canvas, image, x, y, imgWidth, imgHeight) { var dx, dy, dw, dh, sx, sy, sw, sh; var elem = canvas._linked_element; var w = image.width; var h = image.height; if (arguments.length == 4) { dx = x; dy = y; sx = sy = 0; sw = dw = w; sh = dh = h; } else if (arguments.length == 6) { dx = x; dy = y; dw = imgWidth; dh = imgHeight; sx = sy = 0; sw = w; sh = h; } else { throw Error('Invalid number of arguments'); } var d = elem._getCoordSize(dx, dy); var w2 = sw / 2; var h2 = sh / 2; var vmlStr = []; vmlStr.push(' ', '', ''); canvas.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); canvas._vml_str += vmlStr; }; nexacro.__setCanvasGlobalAlpha = function (canvas, f) { }; nexacro.__setCanvasGlobalCompositeOperation = function (canvas, eOperation) { }; nexacro.__toDataURLCanvas = function (_handle) { }; nexacro.__restoreCanvas = function (canvas) { var element = canvas._linked_element; var cur_status = element._status_stack.pop(); if (cur_status) { element.setElementStrokeStyle(nexacro._getCachedStyleObj("color", cur_status.strokeStyle)); element.setElementFillStyle(nexacro._getCachedStyleObj("color", cur_status.fillStyle)); element.setElementGlobalAlpha(cur_status.globalAlpha); element.setElementLineWidth(cur_status.lineWidth); element.setElementLineCap(cur_status.lineCap); element.setElementLineJoin(cur_status.lineJoin); element.setElementMiterLimit(cur_status.miterLimit); element.setElementShadowOffsetX(cur_status.shadowOffsetX); element.setElementShadowOffsetY(cur_status.shadowOffsetY); element.setElementShadowBlur(cur_status.shadowBlur); element.setElementShadowColor(nexacro._getCachedStyleObj("color", cur_status.shadowColor)); element.setElementGlobalCompositeOperation(cur_status.globalCompositeOperation); element.setElementFont(cur_status.font); element.setElementTextAlign(cur_status.textAlign); element.setElementTextBaseline(cur_status.textBaseline); element.setElementStrokeStyle(cur_status.strokeColor); } canvas._matrix = element._matrix_stack.pop(); }; nexacro.__saveCanvas = function (canvas) { var elem = canvas._linked_element; var cur_status = { "strokeStyle" : elem.strokeStyle, "fillStyle" : elem.fillStyle, "globalAlpha" : elem.globalAlpha, "lineWidth" : elem.lineWidth, "lineCap" : elem.lineCap, "lineJoin" : elem.lineJoin, "miterLimit" : elem.miterLimit, "shadowOffsetX" : elem.shadowOffsetX, "shadowOffsetY" : elem.shadowOffsetY, "shadowBlur" : elem.shadowBlur, "shadowColor" : elem.shadowColor, "globalCompositeOperation" : elem.globalCompositeOperation, "font" : elem.font, "textAlign" : elem.textAlign, "textBaseline" : elem.textBaseline, "strokeColor" : elem.strokeColor, "lineScale" : canvas._line_scale }; elem._status_stack.push(cur_status); elem._matrix_stack.push(canvas._matrix); canvas._matrix = nexacro._matrixMultiply(nexacro._createMatrixIdentity(), canvas._matrix); }; } else { nexacro.__setCanvasFillColor = function (canvas, color) { canvas._draw_ctx.fillStyle = nexacro._getWebColorFromXreColor(color.value); }; nexacro.__setCanvasFillGradation = function (canvas, fillstyle) { var gradation = nexacro.__createCanvasLinearGradient(canvas, fillstyle._start_x, fillstyle._start_y, fillstyle._end_x, fillstyle._end_y); gradation.addColorStop(0, fillstyle.start_color); gradation.addColorStop(1, fillstyle.end_color); canvas._draw_ctx.fillStyle = gradation; }; nexacro.__setCanvasFillStyle = function (canvas, clrrgb, clra) { canvas._draw_ctx.fillStyle = clrrgb; }; nexacro.__setCanvasStrokeStyle = function (canvas, color) { canvas._draw_ctx.strokeStyle = color._syscolor; }; nexacro.__setCanvasLineCap = function (canvas, eCapType) { canvas._draw_ctx.lineCap = eCapType; }; nexacro.__setCanvasLineJoin = function (canvas, eJoinType) { canvas._draw_ctx.lineJoin = eJoinType; }; nexacro.__setCanvasLineWidth = function (canvas, nSize) { canvas._draw_ctx.lineWidth = nSize; }; nexacro.__setCanvasMiterLimit = function (canvas, nLimit) { canvas._draw_ctx.miterLimit = nLimit; }; nexacro.__setCanvasShadowColor = function (canvas, clrRGA, clrA) { canvas._draw_ctx.shadowColor = canvas._shadowColor; }; nexacro.__setCanvasShadowOffsetX = function (canvas, sX) { canvas._draw_ctx.shadowOffsetX = sX; }; nexacro.__setCanvasShadowOffsetY = function (canvas, sY) { canvas._draw_ctx.shadowOffsetY = sY; }; nexacro.__setCanvasShadowBlur = function (canvas, nFact) { canvas._draw_ctx.shadowBlur = nFact; }; nexacro.__setCanvasFont = function (canvas, font, sysvalue) { canvas._draw_ctx.font = sysvalue; }; nexacro.__setCanvasTextAlign = function (canvas, eAlignValue) { canvas._draw_ctx.textAlign = eAlignValue; }; nexacro.__setCanvasTextBaseline = function (canvas, eBaseValue) { canvas._draw_ctx.textBaseline = eBaseValue; }; nexacro.__drawCanvasBeginPath = function (canvas) { canvas._draw_ctx.beginPath(); }; nexacro.__drawCanvasClosePath = function (canvas) { canvas._draw_ctx.closePath(); }; nexacro.__drawCanvasFillRect = function (canvas, x, y, dx, dy) { var ctx = canvas._draw_ctx; ctx.rect(x, y, dx, dy); ctx.fill(); ctx.beginPath(); }; nexacro.__drawCanvasStrokeRect = function (canvas, x, y, dx, dy) { canvas._draw_ctx.strokeRect(x, y, dx, dy); }; nexacro.__drawCanvasRect = function (canvas, x, y, dx, dy) { var ctx = canvas._draw_ctx; crx.rect(x, y, dx, dy); ctx.stroke(); ctx.beginPath(); }; nexacro.__drawCanvasClearRect = function (canvas, x, y, dx, dy) { canvas._draw_ctx.clearRect(x, y, dx, dy); }; nexacro.__drawCanvaslineTo = function (canvas, x, y) { canvas._draw_ctx.lineTo(x, y); }; nexacro.__drawCanvasmoveTo = function (canvas, x, y) { canvas._draw_ctx.moveTo(x, y); }; nexacro.__drawCanvasQuadraticCurveTo = function (canvas, cp1x, cp1y, cp2x, cp2y) { canvas._draw_ctx.quadraticCurveTo(cp1x, cp1y, cp2x, cp2y); }; nexacro.__drawCanvasBezierCurveTo = function (canvas, cp1x, cp1y, cp2x, cp2y, x, y) { canvas._draw_ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); }; nexacro.__darwCanvasArc = function (canvas, x, y, r, sA, eA, eCw) { canvas._draw_ctx.arc(x, y, r, sA, eA, eCw); }; nexacro.__drawCanvasArcTo = function (canvas, x, y, x2, y2, r) { canvas._draw_ctx.arcTo(x, y, x2, y2, r); }; nexacro.__isPointInCanvasPath = function (canvas, x, y) { return canvas._draw_ctx.isPointInPath(x, y); }; nexacro.__clipCanvas = function (canvas) { canvas._draw_ctx.clip(); }; nexacro.__setCanvasTransform = function (canvas, a, b, c, d, e, f) { canvas._draw_ctx.setTransform(a, b, c, d, e, f); }; nexacro.__measureCanvas = function (canvas, text) { canvas._draw_ctx.measureText(text); }; nexacro.__createCanvasLinearGradient = function (canvas, aX0, aY0, aX1, aY1) { return canvas._draw_ctx.createLinearGradient(aX0, aY0, aX1, aY1); }; nexacro.__createCanvasRadialGradient = function (canvas, x0, y0, x1, y1, r0, r1) { return canvas._draw_ctx.createRadialGradient(x0, y0, x1, y1, r0, r1); }; nexacro.__rectCanvas = function (canvas, x, y, w, h) { canvas._draw_ctx.rect(x, y, w, h); }; nexacro.__fillCanvas = function (canvas) { canvas._draw_ctx.fill(); }; nexacro.__strokeCanvas = function (canvas) { canvas._draw_ctx.stroke(); }; nexacro.__fillCanvasRect = function (canvas, x, y, dx, dy) { canvas._draw_ctx.fillRect(x, y, dx, dy); }; nexacro.__scaleCanvas = function (canvas, dx, dy) { canvas._draw_ctx.scale(dx, dy); }; nexacro.__rotateCanvas = function (canvas, angle) { canvas._draw_ctx.rotate(angle); }; nexacro.__translateCanvas = function (canvas, dX, dY) { canvas._draw_ctx.translate(dX, dY); }; nexacro.__transformCanvas = function (canvas, a, b, c, d, e, f) { canvas._draw_ctx.transform(a, b, c, d, e, f); }; nexacro.__drawCanvasFillText = function (canvas, text, x, y, maxWidth) { if (maxWidth) { canvas._draw_ctx.fillText(text, x, y, maxWidth); } else { canvas._draw_ctx.fillText(text, x, y); } }; nexacro.__drawCanvasStrokeText = function (canvas, text, x, y, maxWidth) { if (maxWidth) { canvas._draw_ctx.strokeText(text, x, y, maxWidth); } else { canvas._draw_ctx.strokeText(text, x, y); } }; nexacro.__drawCanvasImage = function (canvas, image, x, y, imgWidth, imgHeight) { canvas._draw_ctx.drawImage(image, x, y, imgWidth, imgHeight); }; nexacro.__setCanvasGlobalAlpha = function (canvas, f) { canvas._draw_ctx.globalAlpha = f; }; nexacro.__setCanvasGlobalCompositeOperation = function (canvas, eOperation) { canvas._draw_ctx.globalCompositeOperation = eOperation; }; nexacro.__toDataURLCanvas = function (canvas) { var url = canvas._draw_node.toDataURL(); if (url) { var imgObj = new nexacro.Image(); imgObj.set_src(url); return imgObj; } }; nexacro.__restoreCanvas = function (canvas) { canvas._draw_ctx.restore(); }; nexacro.__saveCanvas = function (canvas) { canvas._draw_ctx.save(); }; } if (nexacro.Browser == "MobileSafari") { nexacro.__setDOMNodeAccessibilityEnable = function (node, enable) { if (enable == false) { node.setAttribute("role", "document"); node.setAttribute("aria-label", " "); node.setAttribute("aria-description", ""); } }; nexacro.__setDOMNodeAccessibilityLabel = function (node, label) { if (label) { node.setAttribute("aria-label", label); } }; nexacro.__setDOMNodeAccessibilityLabelBy = nexacro._emptyFn; nexacro.__setDOMNodeAccessibilityDescription = nexacro._emptyFn; nexacro.__setDOMNodeAccessibilityDescriptionBy = nexacro._emptyFn; } else { nexacro.__setDOMNodeAccessibilityEnable = function (node, enable) { if (enable == false) { node.setAttribute("role", "document"); node.setAttribute("aria-label", " "); node.setAttribute("aria-description", ""); node.setAttribute("aria-labelledby", "accessibility_notify_0"); } }; nexacro.__setDOMNodeAccessibilityLabel = function (node, label) { if (label) { node.setAttribute("aria-label", label); } node.setAttribute("aria-labelledby", "accessibility_notify_0"); }; nexacro.__setDOMNodeAccessibilityLabelBy = function (node, id) { node.setAttribute("aria-labelledby", id); }; nexacro.__setDOMNodeAccessibilityDescription = function (node, desc) { node.setAttribute("aria-description", desc); }; nexacro.__setDOMNodeAccessibilityDescriptionBy = function (node, id) { node.setAttribute("aria-describedby", id); }; } nexacro.__setDOMNodeAccessibilityDescLevel = function (node, level) { }; nexacro.__setDOMNodeAccessibilityStatNormal = function (node, normal) { }; nexacro.__setDOMNodeAccessibilityStatDisabled = function (node, disable) { node.setAttribute("aria-disabled", disable); }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro.__setDOMNodeAccessibilityStatHidden = function (node, hidden) { node.setAttribute("aria-hidden", hidden); }; } else { nexacro.__setDOMNodeAccessibilityStatHidden = nexacro._emptyFn; } nexacro.__setDOMNodeAccessibilityHidden = function (node, hidden) { if (hidden) { node.setAttribute("aria-hidden", hidden); } else { node.removeAttribute("aria-hidden"); } }; nexacro.__setDOMNodeAccessibilityStatChecked = function (node, check) { node.setAttribute("aria-checked", check); }; nexacro.__setDOMNodeAccessibilityStatPressed = function (node, press) { if (press) { node.setAttribute("aria-pressed", press); } else { node.removeAttribute("aria-pressed"); } }; nexacro.__setDOMNodeAccessibilityStatSelected = function (node, select) { node.setAttribute("aria-selected", select); }; nexacro.__setDOMNodeAccessibilityStatExpanded = function (node, expanded) { node.setAttribute("aria-expanded", expanded); }; nexacro.__setDOMNodeAccessibilityStatAutoComplete = function (node, autocomplete) { node.setAttribute("aria-autocomplete", autocomplete); }; nexacro.__setDOMNodeAccessibilityStatHasPopup = function (node, haspopup) { node.setAttribute("aria-haspopup", haspopup); }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro.__setDOMNodeAccessibilityStatFocus = function (node, label) { var acclabel = label; if (!label) { acclabel = node.getAttribute("aria-label"); } nexacro.__notifyAccessibility(node, acclabel, "focus"); }; } else { nexacro.__setDOMNodeAccessibilityStatFocus = function (node, label) { var acclabel = label; if (!label) { acclabel = node.getAttribute("aria-label"); } nexacro.__notifyAccessibility(node, acclabel, "focus"); }; } nexacro.__setDOMNodeAccessibilityFlagDefaultButton = function (node, button) { }; nexacro.__setDOMNodeAccessibilityFlagFocusable = function (node, focus) { }; nexacro.__setDOMNodeAccessibilityFlagReadOnly = function (node, readonly) { node.setAttribute("aria-readonly", readonly); }; nexacro.__setDOMNodeAccessibilityFlagPassword = function (node, password) { }; nexacro.__setDOMNodeAccessibilityFlagMultiLine = function (node, multiline) { node.setAttribute("aria-multiline", multiline); }; nexacro.__setDOMNodeAccessibilityFlagMultiSelectable = function (node, multiselectable) { node.setAttribute("aria-multiselectable", multiselectable); }; nexacro.__setDOMNodeAccessibilityFlagSelectable = function (node, selectable) { node.setAttribute("aria-selected", selectable); }; nexacro.__setDOMNodeAccessibilityInfoCount = function (node, count) { node.setAttribute("aria-setsize", count); }; nexacro.__setDOMNodeAccessibilityInfoIndex = function (node, index) { node.setAttribute("aria-posinset", index); }; nexacro.__setDOMNodeAccessibilityInfoValueMax = function (node, maxvalue) { node.setAttribute("aria-valuemax", maxvalue); }; nexacro.__setDOMNodeAccessibilityInfoValueMin = function (node, minvalue) { node.setAttribute("aria-valuemin", minvalue); }; nexacro.__setDOMNodeAccessibilityInfoValueCur = function (node, value) { node.setAttribute("aria-valuenow", value); }; nexacro.__setDOMNodeAccessibilityInfoValueText = function (node, text) { node.setAttribute("aria-valuetext", text); }; nexacro.__setDOMNodeAccessibilityInfoLevel = function (node, level) { if (level) { node.setAttribute("aria-level", level); } }; nexacro.__setDOMNodeAccessibilitySelection = function (node, select) { }; nexacro.__setDOMNodeAccessibilityRole = function (node, role) { if (role) { node.setAttribute("role", role); } else { node.removeAttribute("role"); } }; nexacro.__setDOMNodeAccessibilityHotKey = function (node, select) { }; nexacro.__setDOMNodeAccessibilityActiveDescendant = function (node, id) { node.setAttribute("aria-activedescendant", id); }; nexacro.__setDOMNodeAccessibilityTabStop = function (node, id) { }; nexacro.__setDOMNodeAccessibilityLive = function (node) { node.innerHTML = "accessibilityLiveNode"; node.setAttribute("aria-relevant", "text"); node.setAttribute("aria-live", "assertive"); node.setAttribute("aria-atomic", "false"); }; nexacro.__setDOMNodeAccessibilityValue = function (node, value, elem, bfocus) { nexacro.__notifyAccessibility(node, value, "valuechange", elem, bfocus); }; nexacro._AccessibilityNotifyManager = function () { this._nodes = []; this._index = -1; this._count = 0; }; var _pAccessibilityNotifyManager = nexacro._createPrototype(Object, nexacro._AccessibilityNotifyManager); nexacro._AccessibilityNotifyManager.prototype = _pAccessibilityNotifyManager; if (nexacro.Browser == "Gecko") { _pAccessibilityNotifyManager._getNotifyNode = function () { if (this._index == -1) { var _doc = document; var node = _doc.createElement("div"); node.id = "accessibility_notify_" + this._count; var node_style = node.style; nexacro.__setDOMNodeStyleAbsolute(node_style); nexacro.__setDOMNodeStyleSize(node_style, 0, 0); nexacro.__setDOMNodeTabIndex(node, -1); nexacro.__setDOMNodeAccessibilityRole(node, "document"); _doc.body.appendChild(node); this._nodes.push(node); this._count = this._count + 1; var node2 = _doc.createElement("div"); node2.id = "accessibility_notify_" + this._count; var node2_style = node2.style; nexacro.__setDOMNodeStyleAbsolute(node2_style); nexacro.__setDOMNodeStyleSize(node2_style, 0, 0); nexacro.__setDOMNodeTabIndex(node2, -1); _doc.body.appendChild(node2); nexacro.__setDOMNodeAccessibilityRole(node2, "document"); this._nodes.push(node2); this._index = 0; } return this._nodes; }; _pAccessibilityNotifyManager._notify = function (_handle, label, notifyevent, elem) { var nodes = this._getNotifyNode(); if (nodes) { if (notifyevent == "notify") { var node = nodes[this._index]; node.innerText = label; nexacro.__setDOMNodeTitle(node, label); node.focus(); nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else { var node = nodes[0]; node.innerText = label; nexacro.__setDOMNodeTitle(node, label); } } this._index = this._index ^ 1; }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion == 11) { _pAccessibilityNotifyManager._getNotifyNode = function () { if (this._index == -1) { var _doc = document; var node = _doc.createElement("div"); node.id = "accessibility_notify_" + this._count; var node_style = node.style; nexacro.__setDOMNodeStyleAbsolute(node_style); nexacro.__setDOMNodeStyleSize(node_style, 0, 0); nexacro.__setDOMNodeTabIndex(node, -1); nexacro.__setDOMNodeAccessibilityRole(node, "document"); _doc.body.appendChild(node); this._nodes.push(node); this._count = this._count + 1; var node2 = _doc.createElement("div"); node2.id = "accessibility_notify_" + this._count; var node2_style = node2.style; nexacro.__setDOMNodeStyleAbsolute(node2_style); nexacro.__setDOMNodeStyleSize(node2_style, 0, 0); nexacro.__setDOMNodeTabIndex(node2, -1); _doc.body.appendChild(node2); nexacro.__setDOMNodeAccessibilityRole(node2, "document"); this._nodes.push(node2); this._index = 0; } return this._nodes; }; _pAccessibilityNotifyManager._notify = function (_handle, label, notifyevent, elem, bfocus) { var nodes = this._getNotifyNode(); if (nodes) { if (notifyevent == "notify") { var node = nodes[this._index]; node.innerText = label; if (elem) { if (elem.accessibility_role != "textbox") { nexacro.__setDOMNodeAccessibilityRole(node, elem.accessibility_role); } else { nexacro.__setDOMNodeAccessibilityRole(node, "document"); } nexacro.__setDOMNodeStylePos(node.style, elem.left, elem.top); } else { nexacro.__setDOMNodeAccessibilityRole(node, _handle.getAttribute('role')); } node.focus(); nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "valuechange") { var node = nodes[0]; node.innerText = ""; if (elem && elem._input_handle) { var linkedcontrol = _handle._linked_element.linkedcontrol; var comp = linkedcontrol._getRootComponent(linkedcontrol); var _is_popup_frame = application._isPopupFrame(comp._getOwnerFrame().id); if (_is_popup_frame) { nexacro.__setDOMNodeAccessibilityRole(elem._input_handle, "document"); _handle.focus(); } } else { if (bfocus) { node.focus(); } } nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "daychange") { var node = nodes[0]; node.innerText = label; node.focus(); nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "wholeread") { var node = nodes[0]; node.innerText = label; nexacro.__setDOMNodeAccessibilityRole(node, "document"); node.focus(); } else { var node = nodes[0]; node.innerText = label; } } this._index = this._index ^ 1; }; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion >= 9) { _pAccessibilityNotifyManager._getNotifyNode = function () { if (this._index == -1) { var _doc = document; var node = _doc.createElement("div"); node.id = "accessibility_notify_" + this._count; var node_style = node.style; nexacro.__setDOMNodeStyleAbsolute(node_style); nexacro.__setDOMNodeStyleSize(node_style, 0, 0); nexacro.__setDOMNodeTabIndex(node, -1); nexacro.__setDOMNodeAccessibilityRole(node, "document"); _doc.body.appendChild(node); this._nodes.push(node); this._count = this._count + 1; var node2 = _doc.createElement("div"); node2.id = "accessibility_notify_" + this._count; var node2_style = node2.style; nexacro.__setDOMNodeStyleAbsolute(node2_style); nexacro.__setDOMNodeStyleSize(node2_style, 0, 0); nexacro.__setDOMNodeTabIndex(node2, -1); _doc.body.appendChild(node2); nexacro.__setDOMNodeAccessibilityRole(node2, "document"); this._nodes.push(node2); this._index = 0; } return this._nodes; }; _pAccessibilityNotifyManager._notify = function (_handle, label, notifyevent, elem, bfocus) { var nodes = this._getNotifyNode(); if (nodes) { if (notifyevent == "notify") { var node = nodes[this._index]; node.innerText = label; if (elem) { if (elem.accessibility_role != "textbox") { nexacro.__setDOMNodeAccessibilityRole(node, elem.accessibility_role); } else { nexacro.__setDOMNodeAccessibilityRole(node, "document"); } nexacro.__setDOMNodeStylePos(node.style, elem.left, elem.top); } else { nexacro.__setDOMNodeAccessibilityRole(node, _handle.getAttribute('role')); } node.focus(); nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "valuechange") { var node = nodes[0]; node.innerText = ""; if (elem && elem._input_handle) { } if (bfocus) { node.focus(); } nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "daychange") { var node = nodes[0]; node.innerText = label; nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "wholeread") { var node = nodes[0]; node.innerText = label; nexacro.__setDOMNodeAccessibilityRole(node, "document"); node.focus(); } else { var node = nodes[0]; node.innerText = label; } } this._index = this._index ^ 1; }; } else if (nexacro.Browser == "MobileSafari") { _pAccessibilityNotifyManager._getNotifyNode = nexacro._emptyFn; _pAccessibilityNotifyManager._notify = function (_handle, label, notifyevent, elem, bfocus) { }; } else if (true) { _pAccessibilityNotifyManager._getNotifyNode = function () { if (this._index == -1) { var _doc = document; var node = _doc.createElement("div"); node.id = "accessibility_notify_" + this._count; var node_style = node.style; nexacro.__setDOMNodeStyleAbsolute(node_style); nexacro.__setDOMNodeStyleSize(node_style, 0, 0); nexacro.__setDOMNodeTabIndex(node, -1); nexacro.__setDOMNodeAccessibilityRole(node, "document"); _doc.body.appendChild(node); this._nodes.push(node); this._count = this._count + 1; var node2 = _doc.createElement("div"); node2.id = "accessibility_notify_" + this._count; var node2_style = node2.style; nexacro.__setDOMNodeStyleAbsolute(node2_style); nexacro.__setDOMNodeStyleSize(node2_style, 0, 0); nexacro.__setDOMNodeTabIndex(node2, -1); _doc.body.appendChild(node2); nexacro.__setDOMNodeAccessibilityRole(node2, "document"); this._nodes.push(node2); this._index = 0; } return this._nodes; }; _pAccessibilityNotifyManager._notify = function (_handle, label, notifyevent, elem, bfocus) { var nodes = this._getNotifyNode(); if (nodes) { if (notifyevent == "notify") { var node = nodes[this._index]; node.innerText = label; if (elem) { if (elem.accessibility_role != "textbox") { nexacro.__setDOMNodeAccessibilityRole(node, elem.accessibility_role); } else { nexacro.__setDOMNodeAccessibilityRole(node, "document"); } nexacro.__setDOMNodeStylePos(node.style, elem.left, elem.top); } else { nexacro.__setDOMNodeAccessibilityRole(node, _handle.getAttribute('role')); } node.focus(); nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "valuechange") { var node = nodes[0]; if (label == "#textarea:msg_accessibility_emptyline") { label = application._getErrorMessge("msg_accessibility_emptyline"); } node.innerText = label; nexacro.__setDOMNodeAccessibilityRole(node, "listitem"); nexacro.__setDOMNodeAccessibilityActiveDescendant(_handle, node.id); if (elem && elem._input_handle) { } if (bfocus) { node.focus(); } nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "daychange") { var node = nodes[0]; node.innerText = label; nexacro.__setDOMNodeAccessibilityActiveDescendant(_handle, node.id); nexacro.__setDOMNodeStylePos(node.style, 0, 0); } else if (notifyevent == "wholeread") { var node = nodes[0]; node.innerText = label; nexacro.__setDOMNodeAccessibilityRole(node, "document"); node.focus(); } else { var node = nodes[0]; node.innerText = label; } } this._index = this._index ^ 1; }; } else { _pAccessibilityNotifyManager._getNotifyNode = function () { if (this._index == -1) { var _doc = document; var node = _doc.createElement("div"); node.id = "accessibility_notify_" + this._count; var node_style = node.style; nexacro.__setDOMNodeStyleAbsolute(node_style); nexacro.__setDOMNodeStyleSize(node_style, 0, 0); nexacro.__setDOMNodeTabIndex(node, -1); _doc.body.appendChild(node); node_style.background = "transparent"; nexacro.__setDOMNodeAccessibilityRole(node, "log"); nexacro.__setDOMNodeAccessibilityLabel(node, "temporary"); nexacro.__setDOMNodeAccessibilityLive(node); this._nodes.push(node); this._count = this._count + 1; this._index = 0; } return this._nodes; }; _pAccessibilityNotifyManager._notify = function (_handle, label) { var nodes = this._getNotifyNode(); if (nodes) { var node = nodes[this._index]; nexacro.AccessibilityUtil.setDOMNodeLabel(node, label); } }; } delete _pAccessibilityNotifyManager; nexacro.__notifyAccessibility = function (node, label, notifyevent, elem, bfocus) { if (!nexacro._AccessibilityNotifyNode) { nexacro._AccessibilityNotifyNode = new nexacro._AccessibilityNotifyManager(); } nexacro._AccessibilityNotifyNode._notify(node, label, notifyevent, elem, bfocus); }; nexacro._notifyAccessibilityValue = function (elem, label, notifyevent) { if (!nexacro._AccessibilityNotifyNode) { nexacro._AccessibilityNotifyNode = new nexacro._AccessibilityNotifyManager(); } var _handle = elem._handle; if (_handle) { nexacro._AccessibilityNotifyNode._notify(_handle, label, notifyevent, elem); } }; (function () { var re_special_htmlchar = /&|"|'|\<|\>|\r|\n/g; function _replace_htmlChar (chr) { if (chr == "&") { return "&"; } else if (chr == "'") { return "'"; } else if (chr == '"') { return """; } else if (chr == "<") { return "<"; } else if (chr == ">") { return ">"; } else if (chr == "\r") { return ""; } else if (chr == "\n") { return "
"; } else { return chr; } } nexacro.__toInnerHTMLText = function (text) { return text.replace(re_special_htmlchar, _replace_htmlChar); }; })(); (function () { var re_special_xmlchar = /[&"'\<\>\r\n\t ]/g; function _encode_xmlChar (chr) { if (chr == "&") { return "&"; } else if (chr == "'") { return "'"; } else if (chr == '"') { return """; } else if (chr == "<") { return "<"; } else if (chr == ">") { return ">"; } else if (chr == "\r") { return " "; } else if (chr == "\n") { return " "; } else if (chr == "\t") { return " "; } else if (chr == " ") { return " "; } else { return chr; } } nexacro._encodeXml = function (str) { if (!nexacro._isNull(str)) { var tempStr = ""; var l = str.length; for (i = 0; i < l; i++) { var charCode = str.charCodeAt(i); if ((charCode & 0x80) != 0x00 || charCode >= 0x20 || charCode == 0xA || charCode == 0xD || charCode == 0x9) { tempStr += String.fromCharCode(charCode); } } str = tempStr; return str.replace(re_special_xmlchar, _encode_xmlChar); } }; var re_encoded_xmlchar = /&#[0-9]+;|&[a-z]+;/g; function _decode_xmlStr (str) { if (str.charAt(1) == "#") { return String.fromCharCode(str.substring(2, str.length - 1) | 0); } else { var code = str.substring(1, str.length - 1); if (code == "amp") { return "&"; } else if (code == "quot") { return "\""; } else if (code == "apos") { return "\'"; } else if (code == "lt") { return "<"; } else if (code == "gt") { return ">"; } else { return ""; } } } nexacro._decodeXml = function (str) { if (!nexacro._isNull(str)) { var tempStr = ""; var l = str.length; for (i = 0; i < l; i++) { var charCode = str.charCodeAt(i); if ((charCode & 0x80) != 0x00 || charCode >= 0x20 || charCode == 0xA || charCode == 0xD || charCode == 0x9) { tempStr += String.fromCharCode(charCode); } } str = tempStr; if (str.indexOf("&") >= 0) { return str.replace(re_encoded_xmlchar, _decode_xmlStr); } } return str; }; })(); nexacro._getDisplayText = function (text, _type) { return text; }; nexacro._getHTMLOuter = function (node, doc) { if (!node || !node.tagName) { return ''; } var txt = node.outerHTML; if (!txt) { var el = doc.createElement("div"); el.appendChild(node); txt = el.innerHTML; el = null; } return txt; }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 9) { nexacro._getCloneNode = function (node) { var clone = document.createElement("div"); clone.innerHTML = node.innerHTML; return clone; }; nexacro._makeFakePrintNode = function (comps) { var remove_targets = []; for (var i = 0, len = comps.length; i < len; i++) { if (comps[i]._type_name == "WebBrowser") { var doc = comps[i].document; if (doc) { var fake_chart_node = document.createElement("div"); fake_chart_node.innerHTML = doc.body.innerHTML; var style = comps[i]._control_element._client_element._handle.style; fake_chart_node.style.position = "absolute"; fake_chart_node.style.left = style.left; fake_chart_node.style.top = style.top; fake_chart_node.style.width = style.width; fake_chart_node.style.height = style.height; comps[i]._control_element._handle.appendChild(fake_chart_node); remove_targets.push(fake_chart_node); } } } return remove_targets; }; } else { nexacro._getCloneNode = function (node) { return node.cloneNode(true); }; nexacro._makeFakePrintNode = function (comps) { var remove_targets = []; for (var i = 0, len = comps.length; i < len; i++) { var doc = comps[i].document; if (doc) { var canvases = doc.getElementsByTagName("canvas"); if (canvases && canvases.length) { var cv = doc.createElement("canvas"); var context = cv.getContext("2d"); var w, h; w = h = 0; for (var j = 0, cv_len = canvases.length; j < cv_len; j++) { if (w < canvases[j].clientWidth) { w = canvases[j].clientWidth; } if (h < canvases[j].clientHeight) { h = canvases[j].clientHeight; } } cv.width = w; cv.height = h; for (var j = 0, cv_len = canvases.length; j < cv_len; j++) { context.drawImage(canvases[j], parseInt(canvases[j].style.left), parseInt(canvases[j].style.top), canvases[j].clientWidth, canvases[j].clientHeight); } var fake_chart_node = document.createElement("img"); fake_chart_node.src = cv.toDataURL("image/png"); var style = comps[i]._control_element._client_element._handle.style; fake_chart_node.style.position = style.position; fake_chart_node.style.left = style.left; fake_chart_node.style.top = style.top; fake_chart_node.style.width = style.width; fake_chart_node.style.height = style.height; comps[i]._control_element._handle.appendChild(fake_chart_node); remove_targets.push(fake_chart_node); } } } return remove_targets; }; } nexacro._searchFakePrintNode = function (comp, make_targets) { if (comp._is_form) { var comps = comp.components; for (var i = 0, len = comps.length; i < len; i++) { if (comps[i]._type_name == "WebBrowser") { make_targets.push(comps[i]); } else if (comps[i]._is_form) { make_targets = nexacro._searchFakePrintNode(comps[i], make_targets); } } } return make_targets; }; nexacro._beforePrintCheckPlugin = function (comp, refform, defaultprint, valign, halign, is_recursive) { var make_targets = []; var remove_targets = []; if (comp._is_form) { make_targets = nexacro._searchFakePrintNode(comp, make_targets); remove_targets = nexacro._makeFakePrintNode(make_targets); } else if (comp._type_name == "WebBrowser") { if (nexacro.BrowserVersion > 8 && (nexacro.Browser == "Edge" || nexacro.Browser == "IE")) { make_targets.push(comp); remove_targets = nexacro._makeFakePrintNode(make_targets); } else { nexacro._printInnerContents(comp); return; } } nexacro._print(comp, comp._refform, defaultprint, valign, halign); for (var i = 0, len = remove_targets.length; i < len; i++) { remove_targets[i].parentNode.removeChild(remove_targets[i]); } make_targets = null; remove_targets = null; }; nexacro._print = function (pThis, refform, defaultprint, valign, halign) { var form_elem = refform.getElement(); var doc = form_elem.getRootWindowHandle(); var clone_handle = nexacro._getCloneNode(pThis._control_element._handle); if (pThis._control_element.container_maxwidth) { clone_handle.style.width = pThis._control_element.container_maxwidth + "px"; if (clone_handle.firstChild) { clone_handle.firstChild.style.width = pThis._control_element.container_maxwidth + "px"; } } if (pThis._control_element.container_maxheight) { clone_handle.style.height = pThis._control_element.container_maxheight + "px"; if (clone_handle.firstChild) { clone_handle.firstChild.style.height = pThis._control_element.container_maxheight + "px"; } } if (clone_handle.lastChild && clone_handle.lastChild.id == clone_handle.id + "_vscrollbar") { clone_handle.removeChild(clone_handle.lastChild); } if (clone_handle.lastChild && clone_handle.lastChild.id == clone_handle.id + "_hscrollbar") { clone_handle.lastChild.style.width = clone_handle.style.width; clone_handle.lastChild.style.top = parseInt(clone_handle.style.height) - parseInt(clone_handle.lastChild.style.height) + "px"; } clone_handle.style.left = "0px"; clone_handle.style.top = "0px"; clone_handle.style.overflow = ""; var html = '\n\n'; if (doc.getElementsByTagName != null) { var headTags = doc.getElementsByTagName("head"); if (headTags.length > 0) { html += headTags[0].innerHTML; } } if (clone_handle.getElementsByTagName != null) { var inputTags = clone_handle.getElementsByTagName("input"); var temp = pThis._control_element._handle.getElementsByTagName("input"); for (var i = 0; i < inputTags.length; i++) { inputTags[i].setAttribute("value", temp[i].value); } } html += '\n\n\n'; html += '\n'; html += nexacro._getHTMLOuter(clone_handle, doc); html += '\n\n\n\n'; var wnd = window; if (refform && refform._control_element && refform._control_element.linkedcontrol && refform._control_element.linkedcontrol._getWindow()._doc.parentWindow) { wnd = doc.parentWindow; } var printWin = window.open("", "printSpecial", "top=" + wnd.screenTop + ",left=" + wnd.screenLeft + ", width=auto, height=auto"); printWin.document.open(); printWin.document.write(html); printWin.document.close(); }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro._printInnerContents = function (comp) { try { var current_focus = document.activeElement; var win = comp._ifrm_elem._handle.contentWindow; if (!win.onafterprint) { win.onafterprint = function () { current_focus.focus(); }; } win.document.body.focus(); win.print(); return true; } catch (e) { return false; } }; } else { nexacro._printInnerContents = function (comp) { try { comp.callMethod("print"); return true; } catch (e) { return false; } }; } nexacro._managerFrameDoc = null; nexacro._managerFrameNode = null; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 8) { nexacro._managerFrameSrc = "\n" + "\n" + "\n" + "" + "" + "\n" + "\n" + "\n" + "\n" + ""; } else if (nexacro.Browser == "IE" && nexacro.BrowserVersion == 9) { nexacro._managerFrameSrc = "\n" + "\n" + "\n" + "" + "" + "\n" + "\n" + "\n" + "\n" + ""; } else if (nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion > 9) { nexacro._managerFrameSrc = "\n" + "\n" + "\n" + "" + "" + "\n" + "\n" + "\n" + "\n" + ""; } else { nexacro._managerFrameSrc = "\n" + "\n" + "" + "" + "\n" + "\n" + "\n" + "\n" + ""; } if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro._managerPopupFrameSrc = "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + ""; } else { nexacro._managerPopupFrameSrc = "\n" + "\n" + "\n" + "\n" + "\n" + ""; } nexacro._preparePopupManagerFrame = function (popupWin) { var _doc = popupWin.document; var iframeobj = _doc.createElement("IFRAME"); iframeobj.frameborder = "0"; iframeobj.scrolling = "no"; iframeobj.style.visibility = 'hidden'; iframeobj.style.position = 'absolute'; iframeobj.style.border = 'none'; var str_title = application._getErrorMessge("msg_accessibility_emptyframe"); nexacro.__setDOMNodeTitle(iframeobj, str_title); _doc.body.appendChild(iframeobj); iframeobj.src = "about:blank"; var _frame_doc; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { _frame_doc = iframeobj.contentWindow.document; } else { _frame_doc = iframeobj.contentDocument; } _frame_doc.open(); _frame_doc.write(nexacro._managerPopupFrameSrc); _frame_doc.close(); nexacro._managerPopupFrameNode = iframeobj; nexacro._managerPopupFrameDoc = _frame_doc; }; nexacro._prepareManagerFrame = function () { var _doc = document; var iframeobj = _doc.createElement("IFRAME"); iframeobj.frameborder = "0"; iframeobj.scrolling = "no"; iframeobj.style.visibility = 'hidden'; iframeobj.style.position = 'absolute'; iframeobj.style.border = 'none'; if (nexacro.OS == "iOS") { iframeobj.style.display = 'none'; } var str_title = application._getErrorMessge("msg_accessibility_emptyframe"); nexacro.__setDOMNodeTitle(iframeobj, str_title); nexacro.__setDOMNodeAccessibilityHidden(iframeobj, true); _doc.body.appendChild(iframeobj); iframeobj.src = "about:blank"; var _frame_doc; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { _frame_doc = iframeobj.contentWindow.document; } else { _frame_doc = iframeobj.contentDocument; } _frame_doc.open(); _frame_doc.write(nexacro._managerFrameSrc); _frame_doc.close(); nexacro._managerFrameNode = iframeobj; nexacro._managerFrameDoc = _frame_doc; }; nexacro._destroyManagerFrame = function (_win_handle) { var dest_handle = nexacro._getWindowDestinationHandle(_win_handle); if (nexacro._managerFrameNode && dest_handle) { nexacro.__removeDOMNode(dest_handle, nexacro._managerFrameNode); } nexacro._managerFrameNode = null; nexacro._managerFrameDoc = null; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { nexacro._createFrameNode = function (node, left, top, _doc) { var framehandle = _doc.createElement("iframe"); framehandle.id = node.id + "_iframe"; framehandle.frameborder = 0; framehandle.scrolling = "no"; framehandle.style.border = 'none'; framehandle.style.filter = "Alpha(Opacity=0);"; framehandle.left = left; framehandle.top = top; framehandle.style.width = "100%"; framehandle.style.height = "100%"; nexacro.__appendDOMNode(node, framehandle); return framehandle; }; nexacro._destroyFrameNode = function (node, framehandle) { if (framehandle) { nexacro.__removeDOMNode(node, framehandle); } framehandle = null; }; } else { nexacro._createFrameNode = nexacro._destroyFrameNode = nexacro._emptyFn; } if (nexacro.Browser == "IE") { nexacro._TextCacheNodeCnt = 0; nexacro._TextInfoCacheManager = function (font) { this.font = font; this.nowrapnode_arr = []; this.font_height = 0; this.space_width = 0; this.space_width1 = 0; this.cache = { }; this._getFontInfo(); this.wordwrapnode = null; }; _pTextInfoCacheManager = nexacro._createPrototype(Object, nexacro._TextInfoCacheManager); nexacro._TextInfoCacheManager.prototype = _pTextInfoCacheManager; _pTextInfoCacheManager.getNowrapTextNode = function () { var node = this.nowrapnode_arr.pop(); if (node == null) { var _doc = nexacro._managerFrameDoc; node = _doc.createElement("div"); node.id = "calculate_text_" + nexacro._TextCacheNodeCnt; var node_style = node.style; node_style.position = "absolute"; node_style.height = "auto"; node_style.width = "auto"; node_style.left = "0px"; node_style.top = "0px"; node_style.visibility = "hidden"; this._setStyleFont(node_style, this.font); _doc.body.appendChild(node); nexacro._TextCacheNodeCnt++; } return node; }; _pTextInfoCacheManager.restoreNode = function (node) { this.restoreNowrapTextNode(node); }; _pTextInfoCacheManager.restoreNowrapTextNode = function (node) { this.nowrapnode_arr.push(node); }; _pTextInfoCacheManager._getFontInfo = function () { var node = this.getNowrapTextNode(); nexacro.__setDOMNodeSinglelineText(node, "gH"); this.font_height = node.clientHeight; var font_width = node.clientWidth; nexacro.__setDOMNodeSinglelineText(node, "g H"); var font_total_width = node.clientWidth; this.space_width = font_total_width - font_width; nexacro.__setDOMNodeSinglelineText(node, " "); this.space_width1 = node.clientWidth; this.restoreNowrapTextNode(node); }; _pTextInfoCacheManager.getWordTextWidth = function (word) { var text_width = this.cache[word]; if (text_width == null) { var textnode = this.getNowrapTextNode(); try { nexacro.__setDOMNodeSinglelineText(textnode, word); } catch (e) { } text_width = textnode.clientWidth; this.restoreNowrapTextNode(textnode); this.cache[word] = text_width; } return text_width; }; } else { nexacro._TextCacheNodeCnt = 0; nexacro._TextInfoCacheManager = function (font) { this.font = font; this.canvas_arr = []; this.font_height = 0; this.space_width = 0; this.space_width1 = 0; this.cache = { }; this._getFontInfo(); this.wordwrapnode = null; }; _pTextInfoCacheManager = nexacro._createPrototype(Object, nexacro._TextInfoCacheManager); nexacro._TextInfoCacheManager.prototype = _pTextInfoCacheManager; if (nexacro.Browser == "Gecko") { nexacro._HTMLNodeSizeGap = 1; } else { nexacro._HTMLNodeSizeGap = 0; } _pTextInfoCacheManager.getCanvasNode = function () { var canvasinfo = this.canvas_arr.pop(); if (canvasinfo == null) { var node = document.createElement("canvas"); var ctx = node.getContext('2d'); this._setCanvasStyleFont(ctx, this.font); canvasinfo = { node : node, ctx : ctx }; } return canvasinfo; }; _pTextInfoCacheManager.restoreNode = function (node) { this.restoreCanvasNode(node); }; _pTextInfoCacheManager.restoreCanvasNode = function (canvas_info) { this.canvas_arr.push(canvas_info); }; _pTextInfoCacheManager._getFontInfo = function () { var _doc = nexacro._managerFrameDoc; var node = _doc.createElement("div"); node.id = "calculate_text_" + nexacro._TextCacheNodeCnt; var node_style = node.style; node_style.position = "absolute"; node_style.height = "auto"; node_style.width = "auto"; node_style.left = "0px"; node_style.top = "0px"; node_style.visibility = "hidden"; this._setStyleFont(node_style, this.font); _doc.body.appendChild(node); nexacro._TextCacheNodeCnt++; nexacro.__setDOMNodeSinglelineText(node, "gH"); this.font_height = node.clientHeight - nexacro._HTMLNodeSizeGap; _doc.body.removeChild(node); var node = document.createElement("canvas"); var ctx = node.getContext('2d'); this._setCanvasStyleFont(ctx, this.font); this.space_width = ctx.measureText(" ").width; this.space_width1 = ctx.measureText(" ").width; this.restoreCanvasNode({ node : node, ctx : ctx }); }; _pTextInfoCacheManager.getWordTextWidth = function (word) { var text_width = this.cache[word]; if (text_width == null) { var canvasinfo = this.getCanvasNode(); text_width = canvasinfo.ctx.measureText(word).width; this.restoreCanvasNode(canvasinfo); this.cache[word] = text_width; } return text_width; }; } _pTextInfoCacheManager.getWordwrapTextNode = function (width, wordwrap) { var node = this.wordwrapnode; if (node == null) { var _doc = nexacro._managerFrameDoc; node = _doc.createElement("div"); node.id = "calculate_wraptext_" + nexacro._TextCacheNodeCnt; var node_style = node.style; node_style.position = "absolute"; node_style.height = "auto"; node_style.width = width + "px"; node_style.left = "0px"; node_style.top = "0px"; node_style.visibility = "hidden"; this._setStyleFont(node_style, this.font); if (wordwrap == undefined || wordwrap == true || wordwrap == "true") { wordwrap = "char"; } else if (wordwrap == false || wordwrap == "false") { wordwrap = "none"; } nexacro.__setDOMNodeWordWrap(node, wordwrap); _doc.body.appendChild(node); nexacro._TextCacheNodeCnt++; } else { node_style.width = width + "px"; } return node; }; _pTextInfoCacheManager.getWordWrapTextSize = function (text, width, wordwrap) { var strw = text + "#width" + width; var strh = strw + "#height"; var text_width = this.cache[strw]; var text_height = this.cache[strh]; if (text_width == null) { var textnode = this.getWordwrapTextNode(width, wordwrap); try { nexacro.__setDOMNodeMultilineText(textnode, text); } catch (e) { } text_width = textnode.clientWidth; text_height = textnode.clientHeight; this.cache[strw] = text_width; this.cache[strh] = text_height; } return [text_width, text_height]; }; if (nexacro.Browser == "Edge" || nexacro.Browser == "IE") { _pTextInfoCacheManager._setStyleFont = function (node_style, font) { if (font._bold) { node_style.fontWeight = "bold"; } else { node_style.fontWeight = "normal"; } if (font._italic) { node_style.fontStyle = "italic"; } else { node_style.fontStyle = "normal"; } node_style.fontFamily = font.face; node_style.fontSize = font.size >= 0 ? font.size + "pt" : Math.abs(font.size) + "px"; }; } else { _pTextInfoCacheManager._setStyleFont = function (node_style, font) { node_style.font = font._sysvalue; }; } _pTextInfoCacheManager._setCanvasStyleFont = function (node_style, font) { node_style.font = font._sysvalue; }; delete _pTextInfoCacheManager; nexacro._TextSizeCacheManagers = { }; (function () { var re_newline = /\r\n|\n|\r/; var re_space = /\s/; nexacro.__getSinglelineTextSize = function (manager, text) { var words = text.split(re_space); var wcnt = words.length; var text_size = 0; for (var i = 0; i < wcnt; i++) { var word = words[i]; if (word) { text_size += manager.getWordTextWidth(word); } } var idx_space = text.indexOf(" "); if (idx_space > -1) { text_size += (wcnt - 1) * manager.space_width1; } else { text_size += (wcnt - 1) * manager.space_width; } return text_size; }; nexacro._getSinglelineTextSize = function (manager, text) { var text_width = nexacro.__getSinglelineTextSize(manager, text.replace(/\r\n|\n|\r/, ' ')); return [text_width, manager.font_height]; }; nexacro._getMultilineTextSize = function (manager, text) { var lines = text.split(re_newline); var lcnt = lines.length; var text_width = 0; for (var i = 0; i < lcnt; i++) { var line_width = nexacro.__getSinglelineTextSize(manager, lines[i]); if (line_width > text_width) { text_width = line_width; } } return [text_width, manager.font_height * lcnt]; }; nexacro._getWordwrapTextSize = function (manager, text, content_width, wordwrap) { var text_size = manager.getWordWrapTextSize(text, content_width, wordwrap); return text_size; }; })(); nexacro._getFontHeight = function (font) { var cacheManager = nexacro._TextSizeCacheManagers[font._sysvalue]; if (cacheManager == null) { cacheManager = new nexacro._TextInfoCacheManager(font); nexacro._TextSizeCacheManagers[font._sysvalue] = cacheManager; } return cacheManager.font_height; }; nexacro._getTextSize = function (text, font, multiline, content_width, wordwrap) { if (text && text.length > 0 && font && !font._is_empty) { var cacheManager = nexacro._TextSizeCacheManagers[font._sysvalue]; if (cacheManager == null) { cacheManager = new nexacro._TextInfoCacheManager(font); nexacro._TextSizeCacheManagers[font._sysvalue] = cacheManager; } if (multiline) { if (content_width != null) { return nexacro._getWordwrapTextSize(cacheManager, text, content_width, wordwrap); } else { return nexacro._getMultilineTextSize(cacheManager, text); } } else { return nexacro._getSinglelineTextSize(cacheManager, text); } } return [0, 0]; }; nexacro._getTextSize2 = nexacro._getTextSize; nexacro.getTextSize = function (text, font, width, wordwrap) { if (typeof (wordwrap) == "string") { wordwrap = wordwrap.toLowerCase(); } if (wordwrap == true || wordwrap == "true") { wordwrap = "char"; } else if (wordwrap == false || wordwrap == "false") { wordwrap = "none"; } var line = true; if (wordwrap == "none") { line = false; } else if (wordwrap == "line") { wordwrap = null; } var retn = nexacro._getTextSize(text, font, line, width, wordwrap); var obj = { nx : retn[0], ny : retn[1] }; return obj; }; nexacro._getTextBaseline = function (textBaseline, y, h) { var cony = y; var s = h / 7; if (textBaseline == 3) { cony -= h / 3 - s; } else if (textBaseline == 2) { cony += h / 2; } else if (textBaseline == 0) { cony = y - h / 3 + s; } else if (textBaseline == 1) { cony = y + h / 2 + s; } return cony; }; nexacro._getLineCountWithWordwrap = function (elem, text, wordwrap) { var gap = (parseInt(elem._handle.style.paddingLeft) | 0) + (parseInt(elem._handle.style.paddingRight) | 0); var content_width = parseInt(elem.width) - gap - 2; var cacheManager = nexacro._TextSizeCacheManagers[elem.font._sysvalue]; if (cacheManager == null) { cacheManager = new nexacro._TextInfoCacheManager(elem.font); nexacro._TextSizeCacheManagers[elem.font._sysvalue] = cacheManager; } var text_size = nexacro._getWordwrapTextSize(cacheManager, text, content_width, wordwrap); var linecount = Math.round(text_size[1] / cacheManager.font_height); return Math.max(linecount, 1); }; nexacro._ImgInfoCacheManager = { cnt : 0, ready : [], loadinglist : { }, get_imgnode : function () { var node = this.ready.pop(); if (node == null) { var _doc = nexacro._managerFrameDoc; node = _doc.createElement("img"); node.id = "calculate_img_" + this.cnt; nexacro.__setDOMNodeAlt(node, ""); if (nexacro._allow_default_pinchzoom) { var imgcontainer = _doc.getElementById("calculate_img_container"); if (!imgcontainer) { imgcontainer = _doc.createElement("div"); imgcontainer.id = "calculate_img_container"; imgcontainer.style.position = 'absolute'; imgcontainer.style.overflow = 'hidden'; imgcontainer.style.width = "1px"; imgcontainer.style.height = "1px"; _doc.body.appendChild(imgcontainer); } imgcontainer.appendChild(node); } else { _doc.body.appendChild(node); } this.cnt++; } return node; }, restore_imgnode : function (node) { if (!(nexacro.Browser == "Edge" || nexacro.Browser == "IE" && nexacro.BrowserVersion >= 10)) { var src = node.getAttributeNode("src"); if (src) { node.removeAttributeNode(src); } } this.ready.push(node); }, clear_imgnode : function () { var _doc = nexacro._managerFrameDoc; var node = null; while (this.ready.length > 0) { node = this.ready.pop(); nexacro.__removeDOMNode(_doc.body, node); node = null; } this.ready = null; } }; if (nexacro.Browser == "IE" && nexacro.BrowserVersion <= 9) { nexacro._bind_imgloadhandler_onload_recall = function (node) { return function () { if (node) { nexacro._imgloadhandler_onload(node); } }; }; } nexacro._imgloadhandler_onload = function (node) { var img_url = node._cacheurl; node._cacheurl = null; var width = node.width; var height = node.height; nexacro._ImgInfoCacheList[img_url] = { width : width, height : height }; delete nexacro._ImgInfoCacheManager.loadinglist[img_url]; nexacro._stopSysObserving(node, "load", "onload", nexacro._imgloadhandler_onload_forward); nexacro._stopSysObserving(node, "error", "onerror", nexacro._imgloadhandler_onerror_forward); if (node._callbackList) { var callbacklist = node._callbackList; var cnt = callbacklist.length; for (var i = 0; i < cnt; i++) { callbacklist[i].callback.call(callbacklist[i].target, img_url, width, height); callbacklist[i].target = null; } node._callbackList = null; } nexacro._ImgInfoCacheManager.restore_imgnode(node); }; nexacro._imgloadhandler_onerror = function (node) { var img_url = node._cacheurl; delete node._cacheurl; node._cacheurl = null; nexacro._ImgInfoCacheList[img_url] = { width : 0, height : 0 }; delete nexacro._ImgInfoCacheManager.loadinglist[img_url]; nexacro._stopSysObserving(node, "load", "onload", nexacro._imgloadhandler_onload_forward); nexacro._stopSysObserving(node, "error", "onerror", nexacro._imgloadhandler_onerror_forward); if (node._callbackList) { var callbacklist = node._callbackList; var cnt = callbacklist.length; for (var i = 0; i < cnt; i++) { callbacklist[i].callback.call(callbacklist[i].target, img_url, 0, 0, node, -1); } delete node._callbackList; node._callbackList = null; } nexacro._ImgInfoCacheManager.restore_imgnode(node); }; nexacro._getImageSize = function (src, callbackFn, pThis, base_url) { if (!src) { return null; } if (src.substring(0, 4).toLowerCase() == "url(") { src = src.substring(5, src.length - 2); } if (!src) { return null; } var img_url = src; if (img_url.substring(0, 17) == "data:image;base64") { var frontStr = img_url.substr(0, 10); var rearStr = img_url.substr(10, img_url.length - 1); if (nexacro.Browser == "Chrome") { img_url = frontStr + "/*" + rearStr; } } else { img_url = nexacro._getImageLocation(src, base_url); } var retval = nexacro._ImgInfoCacheList[img_url]; if (retval) { return retval; } if (img_url) { var imgnode = nexacro._ImgInfoCacheManager.loadinglist[img_url]; if (imgnode) { imgnode._callbackList.push({ target : pThis, callback : callbackFn }); } else { imgnode = nexacro._ImgInfoCacheManager.get_imgnode(); nexacro._ImgInfoCacheManager.loadinglist[img_url] = imgnode; imgnode._callbackList = [{ target : pThis, callback : callbackFn }]; imgnode._cacheurl = img_url; nexacro._observeSysEvent(imgnode, "load", "onload", nexacro._imgloadhandler_onload_forward); nexacro._observeSysEvent(imgnode, "error", "onerror", nexacro._imgloadhandler_onerror_forward); imgnode.src = img_url; } retval = nexacro._ImgInfoCacheList[img_url]; imgnode = null; } return retval ? retval : null; }; nexacro._getImageObject = function (src, callbackFn, pThis, base_url) { if (src.substring(0, 4).toLowerCase() == "url(") { src = src.substring(5, src.length - 2); } if (!src) { return null; } var img_url = nexacro._getImageLocation(src, base_url); if (img_url) { var retval = nexacro._ImgInfoCacheList[img_url]; var imgnode = nexacro._ImgInfoCacheManager.loadinglist[img_url]; if (imgnode) { imgnode._callbackList.push({ target : pThis, callback : callbackFn }); var retval = nexacro._ImgInfoCacheList[img_url]; if (retval) { nexacro._imgloadhandler_onload_forward(imgnode); } } else { imgnode = nexacro._ImgInfoCacheManager.get_imgnode(); var imagesize = nexacro._ImgInfoCacheList[img_url]; if (imagesize) { imgnode.src = img_url; callbackFn.call(pThis, img_url, imagesize.width, imagesize.height, imgnode); } else { nexacro._ImgInfoCacheManager.loadinglist[img_url] = imgnode; imgnode._callbackList = [{ target : pThis, callback : callbackFn }]; imgnode._cacheurl = img_url; nexacro._observeSysEvent(imgnode, "load", "onload", nexacro._imgloadhandler_onload_forward); nexacro._observeSysEvent(imgnode, "error", "onerror", nexacro._imgloadhandler_onerror_forward); imgnode.src = img_url; } } return imgnode; } return null; }; nexacro._IframeManager = { formlist : [], create_form : function (name, iframe_id, pThis) { var _doc = nexacro._managerFrameDoc; var node = _doc.createElement("FORM"); node.id = name; node.name = name; node.enctype = "multipart/form-data"; node.encoding = "multipart/form-data"; node.method = "post"; node.target = iframe_id; var uploadiframe; if (nexacro.Browser == "IE" && nexacro.BrowserVersion < 9) { uploadiframe = _doc.createElement("