/* Product Name: dhtmlxSuite Version: 5.2.0 Edition: Professional License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com Copyright UAB Dinamenta http://www.dhtmlx.com */ if (typeof(window.dhx) == "undefined") { window.dhx = window.dhx4 = { version: "5.2.0", skin: null, skinDetect: function(a) { var c = Math.floor(dhx4.readFromCss(a + "_skin_detect") / 10) * 10; return { 10: "dhx_skyblue", 20: "dhx_web", 30: "dhx_terrace", 40: "material" }[c] || null }, readFromCss: function(e, g, h) { var c = document.createElement("DIV"); c.className = e; if (document.body.firstChild != null) { document.body.insertBefore(c, document.body.firstChild) } else { document.body.appendChild(c) } if (typeof(h) == "string") { c.innerHTML = h } var a = c[g || "offsetWidth"]; c.parentNode.removeChild(c); c = null; return a }, lastId: 1, newId: function() { return this.lastId++ }, zim: { data: {}, step: 5, first: function() { return 100 }, last: function() { var e = this.first(); for (var c in this.data) { e = Math.max(e, this.data[c]) } return e }, reserve: function(a) { this.data[a] = this.last() + this.step; return this.data[a] }, clear: function(a) { if (this.data[a] != null) { this.data[a] = null; delete this.data[a] } } }, s2b: function(a) { if (typeof(a) == "string") { a = a.toLowerCase() } return (a == true || a == 1 || a == "true" || a == "1" || a == "yes" || a == "y" || a == "on") }, s2j: function(s) { var obj = null; dhx4.temp = null; try { eval("dhx4.temp=" + s) } catch (e) { dhx4.temp = null } obj = dhx4.temp; dhx4.temp = null; return obj }, absLeft: function(a) { if (typeof(a) == "string") { a = document.getElementById(a) } return this.getOffset(a).left }, absTop: function(a) { if (typeof(a) == "string") { a = document.getElementById(a) } return this.getOffset(a).top }, _aOfs: function(a) { var e = 0, c = 0; while (a) { e = e + parseInt(a.offsetTop); c = c + parseInt(a.offsetLeft); a = a.offsetParent } return { top: e, left: c } }, _aOfsRect: function(g) { var m = g.getBoundingClientRect(); var n = document.body; var c = document.documentElement; var a = window.pageYOffset || c.scrollTop || n.scrollTop; var h = window.pageXOffset || c.scrollLeft || n.scrollLeft; var l = c.clientTop || n.clientTop || 0; var o = c.clientLeft || n.clientLeft || 0; var q = m.top + a - l; var e = m.left + h - o; return { top: Math.round(q), left: Math.round(e) } }, getOffset: function(a) { if (a.getBoundingClientRect) { return this._aOfsRect(a) } else { return this._aOfs(a) } }, _isObj: function(a) { return (a != null && typeof(a) == "object" && typeof(a.length) == "undefined") }, _copyObj: function(g) { if (this._isObj(g)) { var e = {}; for (var c in g) { if (typeof(g[c]) == "object" && g[c] != null) { e[c] = this._copyObj(g[c]) } else { e[c] = g[c] } } } else { var e = []; for (var c = 0; c < g.length; c++) { if (typeof(g[c]) == "object" && g[c] != null) { e[c] = this._copyObj(g[c]) } else { e[c] = g[c] } } } return e }, screenDim: function() { var a = (navigator.userAgent.indexOf("MSIE") >= 0); var c = {}; c.left = document.body.scrollLeft; c.right = c.left + (window.innerWidth || document.body.clientWidth); c.top = Math.max((a ? document.documentElement : document.getElementsByTagName("html")[0]).scrollTop, document.body.scrollTop); c.bottom = c.top + (a ? Math.max(document.documentElement.clientHeight || 0, document.documentElement.offsetHeight || 0) : window.innerHeight); return c }, selectTextRange: function(h, m, c) { h = (typeof(h) == "string" ? document.getElementById(h) : h); var a = h.value.length; m = Math.max(Math.min(m, a), 0); c = Math.min(c, a); if (h.setSelectionRange) { try { h.setSelectionRange(m, c) } catch (l) {} } else { if (h.createTextRange) { var g = h.createTextRange(); g.moveStart("character", m); g.moveEnd("character", c - a); try { g.select() } catch (l) {} } } }, transData: null, transDetect: function() { if (this.transData == null) { this.transData = { transProp: false, transEv: null }; var e = { MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd", OTransition: "oTransitionEnd", msTransition: "transitionend", transition: "transitionend" }; for (var c in e) { if (this.transData.transProp == false && document.documentElement.style[c] != null) { this.transData.transProp = c; this.transData.transEv = e[c] } } e = null } return this.transData }, _xmlNodeValue: function(a) { var e = ""; for (var c = 0; c < a.childNodes.length; c++) { e += (a.childNodes[c].nodeValue != null ? a.childNodes[c].nodeValue.toString().replace(/^[\n\r\s]{0,}/, "").replace(/[\n\r\s]{0,}$/, "") : "") } return e } }; window.dhx4.isIE = (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0); window.dhx4.isIE6 = (window.XMLHttpRequest == null && navigator.userAgent.indexOf("MSIE") >= 0); window.dhx4.isIE7 = (navigator.userAgent.indexOf("MSIE 7.0") >= 0 && navigator.userAgent.indexOf("Trident") < 0); window.dhx4.isIE8 = (navigator.userAgent.indexOf("MSIE 8.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0); window.dhx4.isIE9 = (navigator.userAgent.indexOf("MSIE 9.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0); window.dhx4.isIE10 = (navigator.userAgent.indexOf("MSIE 10.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0 && window.navigator.pointerEnabled != true); window.dhx4.isIE11 = (navigator.userAgent.indexOf("Trident") >= 0 && window.navigator.pointerEnabled == true); window.dhx4.isEdge = (navigator.userAgent.indexOf("Edge") >= 0); window.dhx4.isOpera = (navigator.userAgent.indexOf("Opera") >= 0); window.dhx4.isChrome = (navigator.userAgent.indexOf("Chrome") >= 0) && !window.dhx4.isEdge; window.dhx4.isKHTML = (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0) && !window.dhx4.isEdge; window.dhx4.isFF = (navigator.userAgent.indexOf("Firefox") >= 0); window.dhx4.isIPad = (navigator.userAgent.search(/iPad/gi) >= 0); window.dhx4.dnd = { evs: {}, p_en: ((window.dhx4.isIE || window.dhx4.isEdge) && (window.navigator.pointerEnabled || window.navigator.msPointerEnabled)), _mTouch: function(a) { return (window.dhx4.isIE10 && a.pointerType == a.MSPOINTER_TYPE_MOUSE || window.dhx4.isIE11 && a.pointerType == "mouse" || window.dhx4.isEdge && a.pointerType == "mouse") }, _touchOn: function(a) { if (a == null) { a = document.body } a.style.touchAction = a.style.msTouchAction = ""; a = null }, _touchOff: function(a) { if (a == null) { a = document.body } a.style.touchAction = a.style.msTouchAction = "none"; a = null } }; if (window.navigator.pointerEnabled == true) { window.dhx4.dnd.evs = { start: "pointerdown", move: "pointermove", end: "pointerup" } } else { if (window.navigator.msPointerEnabled == true) { window.dhx4.dnd.evs = { start: "MSPointerDown", move: "MSPointerMove", end: "MSPointerUp" } } else { if (typeof(window.addEventListener) != "undefined") { window.dhx4.dnd.evs = { start: "touchstart", move: "touchmove", end: "touchend" } } } } } if (typeof(window.dhx4.template) == "undefined") { window.dhx4.trim = function(a) { return String(a).replace(/^\s{1,}/, "").replace(/\s{1,}$/, "") }; window.dhx4.template = function(c, e, a) { return c.replace(/#([a-z0-9_-]{1,})(\|([^#]*))?#/gi, function() { var m = arguments[1]; var l = window.dhx4.trim(arguments[3]); var n = null; var h = [e[m]]; if (l.length > 0) { l = l.split(":"); var g = []; for (var o = 0; o < l.length; o++) { if (o > 0 && g[g.length - 1].match(/\\$/) != null) { g[g.length - 1] = g[g.length - 1].replace(/\\$/, "") + ":" + l[o] } else { g.push(l[o]) } } n = g[0]; for (var o = 1; o < g.length; o++) { h.push(g[o]) } } if (typeof(n) == "string" && typeof(window.dhx4.template[n]) == "function") { return window.dhx4.template[n].apply(window.dhx4.template, h) } if (m.length > 0 && typeof(e[m]) != "undefined") { if (!e[m] && e[m] !== 0) { return "" } if (a == true) { return window.dhx4.trim(e[m]) } return String(e[m]) } return "" }) }; window.dhx4.template.date = function(a, c) { if (a != null) { if (a instanceof Date) { return window.dhx4.date2str(a, c) } else { a = a.toString(); if (a.match(/^\d*$/) != null) { return window.dhx4.date2str(new Date(parseInt(a)), c) } return a } } return "" }; window.dhx4.template.maxlength = function(c, a) { return String(c).substr(0, a) }; window.dhx4.template.number_format = function(g, h, e, a) { var c = window.dhx4.template._parseFmt(h, e, a); if (c == false) { return g } return window.dhx4.template._getFmtValue(g, c) }; window.dhx4.template.lowercase = function(a) { if (typeof(a) == "undefined" || a == null) { a = "" } return String(a).toLowerCase() }; window.dhx4.template.uppercase = function(a) { if (typeof(a) == "undefined" || a == null) { a = "" } return String(a).toUpperCase() }; window.dhx4.template._parseFmt = function(m, e, a) { var g = m.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/); if (g == null || g.length != 4) { return false } var c = { i_len: false, i_sep: (typeof(e) == "string" ? e : ","), d_len: false, d_sep: (typeof(a) == "string" ? a : "."), s_bef: (typeof(g[1]) == "string" ? g[1] : ""), s_aft: (typeof(g[3]) == "string" ? g[3] : "") }; var l = g[2].split("."); if (l[1] != null) { c.d_len = l[1].length } var h = l[0].split(","); if (h.length > 1) { c.i_len = h[h.length - 1].length } return c }; window.dhx4.template._getFmtValue = function(value, fmt) { var r = String(value).match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/); if (r != null && r.length == 5) { var v0 = ""; if (r[1] != null) { v0 += r[1] } v0 += fmt.s_bef; if (fmt.i_len !== false) { var i = 0; var v1 = ""; for (var q = r[2].length - 1; q >= 0; q--) { v1 = "" + r[2].charAt(q) + v1; if (++i == fmt.i_len && q > 0) { v1 = fmt.i_sep + v1; i = 0 } } v0 += v1 } else { v0 += r[2] } if (fmt.d_len !== false) { if (r[4] == null) { r[4] = "" } while (r[4].length < fmt.d_len) { r[4] += "0" } eval("dhx4.temp = new RegExp(/\\d{" + fmt.d_len + "}/);"); var t1 = (r[4]).match(dhx4.temp); if (t1 != null) { v0 += fmt.d_sep + t1 } dhx4.temp = t1 = null } v0 += fmt.s_aft; return v0 } return value } } if (typeof(window.dhx4.dateLang) == "undefined") { window.dhx4.dateLang = "en"; window.dhx4.dateStrings = { en: { monthFullName: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthShortName: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dayFullName: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], dayShortName: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] } }; window.dhx4.dateFormat = { en: "%Y-%m-%d" }; window.dhx4.date2str = function(l, g, a) { if (g == null || typeof(g) == "undefined") { g = window.dhx4.dateFormat[window.dhx4.dateLang] } if (a == null || typeof(a) == "undefined") { a = window.dhx4.dateStrings[window.dhx4.dateLang] } if (l instanceof Date) { var h = function(m) { return (String(m).length == 1 ? "0" + String(m) : m) }; var c = function(o) { switch (o) { case "%d": return h(l.getDate()); case "%j": return l.getDate(); case "%D": return a.dayShortName[l.getDay()]; case "%l": return a.dayFullName[l.getDay()]; case "%m": return h(l.getMonth() + 1); case "%n": return l.getMonth() + 1; case "%M": return a.monthShortName[l.getMonth()]; case "%F": return a.monthFullName[l.getMonth()]; case "%y": return h(l.getYear() % 100); case "%Y": return l.getFullYear(); case "%g": return (l.getHours() + 11) % 12 + 1; case "%h": return h((l.getHours() + 11) % 12 + 1); case "%G": return l.getHours(); case "%H": return h(l.getHours()); case "%i": return h(l.getMinutes()); case "%s": return h(l.getSeconds()); case "%a": return (l.getHours() > 11 ? "pm" : "am"); case "%A": return (l.getHours() > 11 ? "PM" : "AM"); case "%%": return "%"; case "%u": return l.getMilliseconds(); case "%P": if (window.dhx4.temp_calendar != null && window.dhx4.temp_calendar.tz != null) { return window.dhx4.temp_calendar.tz } var r = l.getTimezoneOffset(); var q = Math.abs(Math.floor(r / 60)); var n = Math.abs(r) - q * 60; return (r > 0 ? "-" : "+") + h(q) + ":" + h(n); default: return o } }; var e = String(g || window.dhx4.dateFormat).replace(/%[a-zA-Z]/g, c) } return (e || String(l)) }; window.dhx4.str2date = function(l, A, E) { if (A == null || typeof(A) == "undefined") { A = window.dhx4.dateFormat[window.dhx4.dateLang] } if (E == null || typeof(E) == "undefined") { E = window.dhx4.dateStrings[window.dhx4.dateLang] } A = A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g, "\\$&"); var D = []; var o = []; A = A.replace(/%[a-z]/gi, function(e) { switch (e) { case "%d": case "%m": case "%y": case "%h": case "%H": case "%i": case "%s": o.push(e); return "(\\d{2})"; case "%D": case "%l": case "%M": case "%F": o.push(e); return "([a-z??????\u0430-\u044F\u0451]{1,})"; case "%j": case "%n": case "%g": case "%G": o.push(e); return "(\\d{1,2})"; case "%Y": o.push(e); return "(\\d{4})"; case "%a": o.push(e); return "([a|p]m)"; case "%A": o.push(e); return "([A|P]M)"; case "%u": o.push(e); return "(\\d{1,6})"; case "%P": o.push(e); return "([+-]\\d{1,2}:\\d{1,2})" } return e }); var F = new RegExp(A, "i"); var s = l.match(F); if (s == null || s.length - 1 != o.length) { return "Invalid Date" } for (var c = 1; c < s.length; c++) { D.push(s[c]) } var g = { "%y": 1, "%Y": 1, "%n": 2, "%m": 2, "%M": 2, "%F": 2, "%d": 3, "%j": 3, "%a": 4, "%A": 4, "%H": 5, "%G": 5, "%h": 5, "%g": 5, "%i": 6, "%s": 7, "%u": 7, "%P": 7 }; var u = {}; var n = {}; for (var c = 0; c < o.length; c++) { if (typeof(g[o[c]]) != "undefined") { var h = g[o[c]]; if (!u[h]) { u[h] = []; n[h] = [] } u[h].push(D[c]); n[h].push(o[c]) } } D = []; o = []; for (var c = 1; c <= 7; c++) { if (u[c] != null) { for (var y = 0; y < u[c].length; y++) { D.push(u[c][y]); o.push(n[c][y]) } } } var a = new Date(); a.setDate(1); a.setHours(0); a.setMinutes(0); a.setSeconds(0); a.setMilliseconds(0); var x = function(v, e) { for (var r = 0; r < e.length; r++) { if (e[r].toLowerCase() == v) { return r } } return -1 }; for (var c = 0; c < D.length; c++) { switch (o[c]) { case "%d": case "%j": case "%n": case "%m": case "%Y": case "%H": case "%G": case "%i": case "%s": case "%u": if (!isNaN(D[c])) { a[{ "%d": "setDate", "%j": "setDate", "%n": "setMonth", "%m": "setMonth", "%Y": "setFullYear", "%H": "setHours", "%G": "setHours", "%i": "setMinutes", "%s": "setSeconds", "%u": "setMilliseconds" }[o[c]]](Number(D[c]) + (o[c] == "%m" || o[c] == "%n" ? -1 : 0)) } break; case "%M": case "%F": var m = x(D[c].toLowerCase(), E[{ "%M": "monthShortName", "%F": "monthFullName" }[o[c]]]); if (m >= 0) { a.setMonth(m) } break; case "%y": if (!isNaN(D[c])) { var C = Number(D[c]); a.setFullYear(C + (C > 50 ? 1900 : 2000)) } break; case "%g": case "%h": if (!isNaN(D[c])) { var C = Number(D[c]); if (C <= 12 && C >= 0) { a.setHours(C + (x("pm", D) >= 0 ? (C == 12 ? 0 : 12) : (C == 12 ? -12 : 0))) } } break; case "%P": if (window.dhx4.temp_calendar != null) { window.dhx4.temp_calendar.tz = D[c] } break } } return a } } if (typeof(window.dhx4.ajax) == "undefined") { window.dhx4.ajax = function(c) { return dhx4.ajax.get(c) }; var ajaxbase = { cache: false, method: "get", parse: function(a) { if (typeof a !== "string") { return a } a = a.replace(/^[\s]+/, ""); if (window.DOMParser && !dhx4.isIE) { var c = (new window.DOMParser()).parseFromString(a, "text/xml") } else { if (window.ActiveXObject !== window.undefined) { var c = new window.ActiveXObject("Microsoft.XMLDOM"); c.async = "false"; c.loadXML(a) } } return c }, xmltop: function(a, h, g) { if (typeof h.status == "undefined" || h.status < 400) { xml = (!h.responseXML) ? dhx4.ajax.parse(h.responseText || h) : (h.responseXML || h); if (xml && xml.documentElement !== null) { try { if (!xml.getElementsByTagName("parsererror").length) { return xml.getElementsByTagName(a)[0] } } catch (c) {} } } if (g !== -1) { dhx4.callEvent("onLoadXMLError", ["Incorrect XML", arguments[1], g]) } return document.createElement("DIV") }, xpath: function(g, a) { if (!a.nodeName) { a = a.responseXML || a } if (dhx4.isIE) { try { return a.selectNodes(g) || [] } catch (l) { return [] } } else { var h = []; var m; var c = (a.ownerDocument || a).evaluate(g, a, null, XPathResult.ANY_TYPE, null); while (m = c.iterateNext()) { h.push(m) } return h } }, query: function(a) { return dhx4.ajax._call((a.method || "GET"), a.url, a.data || "", (a.async || true), a.callback, null, a.headers) }, get: function(a, c) { return this._call("GET", a, null, true, c) }, getSync: function(a) { return this._call("GET", a, null, false) }, put: function(c, a, e) { return this._call("PUT", c, a, true, e) }, del: function(c, a, e) { return this._call("DELETE", c, a, true, e) }, post: function(c, a, e) { if (arguments.length == 1) { a = "" } else { if (arguments.length == 2 && (typeof(a) == "function" || typeof(window[a]) == "function")) { e = a; a = "" } else { if (!a || typeof a !== "object") { a = String(a) } } } return this._call("POST", c, a, true, e) }, postSync: function(c, a) { a = (a == null ? "" : String(a)); return this._call("POST", c, a, false) }, getLong: function(a, c) { this._call("GET", a, null, true, c, { url: a }) }, postLong: function(c, a, e) { if (arguments.length == 2 && (typeof(a) == "function" || typeof(window[a]))) { e = a; a = "" } this._call("POST", c, a, true, e, { url: c, postData: a }) }, _call: function(c, e, g, n, q, v, l) { if (typeof g === "object") { var m = []; for (var r in g) { m.push(r + "=" + encodeURIComponent(g[r])) } g = m.join("&") } var h = dhx.promise.defer(); var u = (window.XMLHttpRequest && !dhx4.isIE ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP")); var o = (navigator.userAgent.match(/AppleWebKit/) != null && navigator.userAgent.match(/Qt/) != null && navigator.userAgent.match(/Safari/) != null); if (n == true) { u.onreadystatechange = function() { if ((u.readyState == 4) || (o == true && u.readyState == 3)) { if (u.status != 200 || u.responseText == "") { h.reject(u); if (!dhx4.callEvent("onAjaxError", [{ xmlDoc: u, filePath: e, async: n }])) { return } } window.setTimeout(function() { if (typeof(q) == "function") { try { q.apply(window, [{ xmlDoc: u, filePath: e, async: n }]) } catch (a) { h.reject(a) } } if (v != null) { if (typeof(v.postData) != "undefined") { dhx4.ajax.postLong(v.url, v.postData, q) } else { dhx4.ajax.getLong(v.url, q) } } h.resolve(u.responseText); q = null; u = null }, 1) } } } if (c == "GET") { e += this._dhxr(e) } u.open(c, e, n); if (l != null) { for (var s in l) { u.setRequestHeader(s, l[s]) } } else { if (c == "POST" || c == "PUT" || c == "DELETE") { u.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } else { if (c == "GET") { g = null } } } u.setRequestHeader("X-Requested-With", "XMLHttpRequest"); u.send(g); if (n != true) { if ((u.readyState == 4) || (o == true && u.readyState == 3)) { if (u.status != 200 || u.responseText == "") { dhx4.callEvent("onAjaxError", [{ xmlDoc: u, filePath: e, async: n }]) } } } h.xmlDoc = u; h.filePath = e; h.async = n; return h }, _dhxr: function(a, c) { if (this.cache != true) { if (a.match(/^[\?\&]$/) == null) { a = (a.indexOf("?") >= 0 ? "&" : "?") } if (typeof(c) == "undefined") { c = true } return a + "dhxr" + new Date().getTime() + (c == true ? "=1" : "") } return "" } }; for (var key in ajaxbase) { dhx4.ajax[key] = ajaxbase[key] } } if (typeof(window.dhx4._enableDataLoading) == "undefined") { window.dhx4._enableDataLoading = function(m, e, l, h, n) { if (n == "clear") { for (var c in m._dhxdataload) { m._dhxdataload[c] = null; delete m._dhxdataload[c] } m._loadData = null; m._dhxdataload = null; m.load = null; m.loadStruct = null; m = null; return } m._dhxdataload = { initObj: e, xmlToJson: l, xmlRootTag: h, onBeforeXLS: null }; m._loadData = function(u, v, w) { if (arguments.length == 2) { w = v; v = null } var s = null; if (arguments.length == 3) { w = arguments[2] } this.callEvent("onXLS", []); if (typeof(u) == "string") { var r = u.replace(/^\s{1,}/, "").replace(/\s{1,}$/, ""); var A = new RegExp("^<" + this._dhxdataload.xmlRootTag); if (A.test(r.replace(/^<\?xml[^\?]*\?>\s*/, ""))) { s = dhx4.ajax.parse(u); if (s != null) { s = this[this._dhxdataload.xmlToJson].apply(this, [s]) } } if (s == null && (r.match(/^[\s\S]*{[.\s\S]*}[\s\S]*$/) != null || r.match(/^[\s\S]*\[[.\s\S]*\][\s\S]*$/) != null)) { s = dhx4.s2j(r) } if (s == null) { var q = []; if (typeof(this._dhxdataload.onBeforeXLS) == "function") { var r = this._dhxdataload.onBeforeXLS.apply(this, [u]); if (r != null && typeof(r) == "object") { if (r.url != null) { u = r.url } if (r.params != null) { for (var x in r.params) { q.push(x + "=" + encodeURIComponent(r.params[x])) } } } } var y = this; var o = function(a) { var C = null; if ((a.xmlDoc.getResponseHeader("Content-Type") || "").search(/xml/gi) >= 0 || (a.xmlDoc.responseText.replace(/^\s{1,}/, "")).match(/^) != null) { C = y[y._dhxdataload.xmlToJson].apply(y, [a.xmlDoc.responseXML]) } else { C = dhx4.s2j(a.xmlDoc.responseText) } if (C != null) { y[y._dhxdataload.initObj].apply(y, [C, u]) } y.callEvent("onXLE", []); if (w != null) { if (typeof(w) == "function") { w.apply(y, []) } else { if (typeof(window[w]) == "function") { window[w].apply(y, []) } } } o = w = null; C = a = y = null }; q = q.join("&") + (typeof(v) == "string" ? "&" + v : ""); if (dhx4.ajax.method == "post") { return dhx4.ajax.post(u, q, o) } else { if (dhx4.ajax.method == "get") { return dhx4.ajax.get(u + (q.length > 0 ? (u.indexOf("?") > 0 ? "&" : "?") + q : ""), o) } } return } } else { if (typeof(u.documentElement) == "object" || (typeof(u.tagName) != "undefined" && typeof(u.getElementsByTagName) != "undefined" && u.getElementsByTagName(this._dhxdataload.xmlRootTag).length > 0)) { s = this[this._dhxdataload.xmlToJson].apply(this, [u]) } else { s = window.dhx4._copyObj(u) } } if (s != null) { this[this._dhxdataload.initObj].apply(this, [s]) } this.callEvent("onXLE", []); if (w != null) { if (typeof(w) == "function") { w.apply(this, []) } else { if (typeof(window[w]) == "function") { window[w].apply(this, []) } } w = null } }; if (n != null) { var g = { struct: "loadStruct", data: "load" }; for (var c in n) { if (n[c] == true) { m[g[c]] = function() { return this._loadData.apply(this, arguments) } } } } m = null } } if (typeof(window.dhx4._eventable) == "undefined") { window.dhx4._eventable = function(a, c) { if (c == "clear") { a.detachAllEvents(); a.dhxevs = null; a.attachEvent = null; a.detachEvent = null; a.checkEvent = null; a.callEvent = null; a.detachAllEvents = null; a = null; return } a.dhxevs = { data: {} }; a.attachEvent = function(e, h) { e = String(e).toLowerCase(); if (!this.dhxevs.data[e]) { this.dhxevs.data[e] = {} } var g = window.dhx4.newId(); this.dhxevs.data[e][g] = h; return g }; a.detachEvent = function(l) { for (var g in this.dhxevs.data) { var h = 0; for (var e in this.dhxevs.data[g]) { if (e == l) { this.dhxevs.data[g][e] = null; delete this.dhxevs.data[g][e] } else { h++ } } if (h == 0) { this.dhxevs.data[g] = null; delete this.dhxevs.data[g] } } }; a.checkEvent = function(e) { e = String(e).toLowerCase(); return (this.dhxevs.data[e] != null) }; a.callEvent = function(g, l) { g = String(g).toLowerCase(); if (this.dhxevs.data[g] == null) { return true } var h = true; for (var e in this.dhxevs.data[g]) { h = this.dhxevs.data[g][e].apply(this, l) && h } return h }; a.detachAllEvents = function() { for (var g in this.dhxevs.data) { for (var e in this.dhxevs.data[g]) { this.dhxevs.data[g][e] = null; delete this.dhxevs.data[g][e] } this.dhxevs.data[g] = null; delete this.dhxevs.data[g] } }; a = null }; dhx4._eventable(dhx4) } if (!window.dhtmlxValidation) { dhtmlxValidation = function() {}; dhtmlxValidation.prototype = { isEmpty: function(a) { return a == "" }, isNotEmpty: function(a) { return (a instanceof Array ? a.length > 0 : !a == "") }, isValidBoolean: function(a) { return !!a.toString().match(/^(0|1|true|false)$/) }, isValidEmail: function(a) { return !!a.toString().match(/^[a-z0-9][0-9a-z\-_\.]*@[0-9a-z_\-\.]*\.[a-z]{2,5}$/i) }, isValidInteger: function(a) { return !!a.toString().match(/(^-?\d+$)/) }, isValidNumeric: function(a) { return !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/) }, isValidAplhaNumeric: function(a) { return !!a.toString().match(/^[_\-a-z0-9]+$/gi) }, isValidDatetime: function(c) { var a = c.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/); return a && !!(a[1] <= 9999 && a[2] <= 12 && a[3] <= 31 && a[4] <= 59 && a[5] <= 59 && a[6] <= 59) || false }, isValidDate: function(a) { var c = a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/); return c && !!(c[1] <= 9999 && c[2] <= 12 && c[3] <= 31) || false }, isValidTime: function(c) { var a = c.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/); return a && !!(a[1] <= 24 && a[2] <= 59 && a[3] <= 59) || false }, isValidIPv4: function(a) { var c = a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/); return c && !!(c[1] <= 255 && c[2] <= 255 && c[3] <= 255 && c[4] <= 255) || false }, isValidCurrency: function(a) { return a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/) && true || false }, isValidSSN: function(a) { return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/) && true || false }, isValidSIN: function(a) { return a.toString().match(/^\d{9}$/) && true || false } }; dhtmlxValidation = new dhtmlxValidation() } if (typeof(window.dhtmlx) == "undefined") { window.dhtmlx = {} } if (!window.dhtmlx.extend) { window.dhtmlx.extend = function(e, c) { for (var g in c) { if (!e[g]) { e[g] = c[g] } } return e }; window.dhtmlx.extend_api = function(a, g, e) { var c = window[a]; if (!c) { return } window[a] = function(m) { if (m && typeof m == "object" && !m.tagName) { var l = c.apply(this, (g._init ? g._init(m) : arguments)); for (var h in dhtmlx) { if (g[h]) { this[g[h]](dhtmlx[h]) } } for (var h in m) { if (g[h]) { this[g[h]](m[h]) } else { if (h.indexOf("on") === 0) { this.attachEvent(h, m[h]) } } } } else { var l = c.apply(this, arguments) } if (g._patch) { g._patch(this) } return l || this }; window[a].prototype = c.prototype; if (e) { dhtmlx.extend(window[a].prototype, e) } }; window.dhtmlx.url = function(a) { if (a.indexOf("?") != -1) { return "&" } else { return "?" } } } function dhtmlDragAndDropObject() { if (window.dhtmlDragAndDrop) { return window.dhtmlDragAndDrop } this.lastLanding = 0; this.dragNode = 0; this.dragStartNode = 0; this.dragStartObject = 0; this.tempDOMU = null; this.tempDOMM = null; this.waitDrag = 0; window.dhtmlDragAndDrop = this; return this } dhtmlDragAndDropObject.prototype.removeDraggableItem = function(a) { a.onmousedown = null; a.dragStarter = null; a.dragLanding = null }; dhtmlDragAndDropObject.prototype.addDraggableItem = function(a, c) { a.onmousedown = this.preCreateDragCopy; a.dragStarter = c; this.addDragLanding(a, c) }; dhtmlDragAndDropObject.prototype.addDragLanding = function(a, c) { a.dragLanding = c }; dhtmlDragAndDropObject.prototype.preCreateDragCopy = function(a) { if ((a || window.event) && (a || event).button == 2) { return } if (window.dhtmlDragAndDrop.waitDrag) { window.dhtmlDragAndDrop.waitDrag = 0; document.body.onmouseup = window.dhtmlDragAndDrop.tempDOMU; document.body.onmousemove = window.dhtmlDragAndDrop.tempDOMM; return false } if (window.dhtmlDragAndDrop.dragNode) { window.dhtmlDragAndDrop.stopDrag(a) } window.dhtmlDragAndDrop.waitDrag = 1; window.dhtmlDragAndDrop.tempDOMU = document.body.onmouseup; window.dhtmlDragAndDrop.tempDOMM = document.body.onmousemove; window.dhtmlDragAndDrop.dragStartNode = this; window.dhtmlDragAndDrop.dragStartObject = this.dragStarter; document.body.onmouseup = window.dhtmlDragAndDrop.preCreateDragCopy; document.body.onmousemove = window.dhtmlDragAndDrop.callDrag; window.dhtmlDragAndDrop.downtime = new Date().valueOf(); if ((a) && (a.preventDefault)) { a.preventDefault(); return false } return false }; dhtmlDragAndDropObject.prototype.callDrag = function(g) { if (!g) { g = window.event } dragger = window.dhtmlDragAndDrop; if ((new Date()).valueOf() - dragger.downtime < 100) { return } if (!dragger.dragNode) { if (dragger.waitDrag) { dragger.dragNode = dragger.dragStartObject._createDragNode(dragger.dragStartNode, g); if (!dragger.dragNode) { return dragger.stopDrag() } dragger.dragNode.onselectstart = function() { return false }; dragger.gldragNode = dragger.dragNode; document.body.appendChild(dragger.dragNode); document.body.onmouseup = dragger.stopDrag; dragger.waitDrag = 0; dragger.dragNode.pWindow = window; dragger.initFrameRoute() } else { return dragger.stopDrag(g, true) } } if (dragger.dragNode.parentNode != window.document.body && dragger.gldragNode) { var a = dragger.gldragNode; if (dragger.gldragNode.old) { a = dragger.gldragNode.old } a.parentNode.removeChild(a); var c = dragger.dragNode.pWindow; if (a.pWindow && a.pWindow.dhtmlDragAndDrop.lastLanding) { a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding) } if (_isIE) { var l = document.createElement("Div"); l.innerHTML = dragger.dragNode.outerHTML; dragger.dragNode = l.childNodes[0] } else { dragger.dragNode = dragger.dragNode.cloneNode(true) } dragger.dragNode.pWindow = window; dragger.gldragNode.old = dragger.dragNode; document.body.appendChild(dragger.dragNode); c.dhtmlDragAndDrop.dragNode = dragger.dragNode } dragger.dragNode.style.left = g.clientX + 15 + (dragger.fx ? dragger.fx * (-1) : 0) + (document.body.scrollLeft || document.documentElement.scrollLeft) + "px"; dragger.dragNode.style.top = g.clientY + 3 + (dragger.fy ? dragger.fy * (-1) : 0) + (document.body.scrollTop || document.documentElement.scrollTop) + "px"; if (!g.srcElement) { var h = g.target } else { h = g.srcElement } dragger.checkLanding(h, g) }; dhtmlDragAndDropObject.prototype.calculateFramePosition = function(h) { if (window.name) { var e = parent.frames[window.name].frameElement.offsetParent; var g = 0; var c = 0; while (e) { g += e.offsetLeft; c += e.offsetTop; e = e.offsetParent } if ((parent.dhtmlDragAndDrop)) { var a = parent.dhtmlDragAndDrop.calculateFramePosition(1); g += a.split("_")[0] * 1; c += a.split("_")[1] * 1 } if (h) { return g + "_" + c } else { this.fx = g } this.fy = c } return "0_0" }; dhtmlDragAndDropObject.prototype.checkLanding = function(c, a) { if ((c) && (c.dragLanding)) { if (this.lastLanding) { this.lastLanding.dragLanding._dragOut(this.lastLanding) } this.lastLanding = c; this.lastLanding = this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, a.clientX, a.clientY, a); this.lastLanding_scr = (_isIE ? a.srcElement : a.target) } else { if ((c) && (c.tagName != "BODY")) { this.checkLanding(c.parentNode, a) } else { if (this.lastLanding) { this.lastLanding.dragLanding._dragOut(this.lastLanding, a.clientX, a.clientY, a) } this.lastLanding = 0; if (this._onNotFound) { this._onNotFound() } } } }; dhtmlDragAndDropObject.prototype.stopDrag = function(c, g) { dragger = window.dhtmlDragAndDrop; if (!g) { dragger.stopFrameRoute(); var a = dragger.lastLanding; dragger.lastLanding = null; if (a) { a.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, a, (_isIE ? event.srcElement : c.target)) } } dragger.lastLanding = null; if ((dragger.dragNode) && (dragger.dragNode.parentNode == document.body)) { dragger.dragNode.parentNode.removeChild(dragger.dragNode) } dragger.dragNode = 0; dragger.gldragNode = 0; dragger.fx = 0; dragger.fy = 0; dragger.dragStartNode = 0; dragger.dragStartObject = 0; document.body.onmouseup = dragger.tempDOMU; document.body.onmousemove = dragger.tempDOMM; dragger.tempDOMU = null; dragger.tempDOMM = null; dragger.waitDrag = 0 }; dhtmlDragAndDropObject.prototype.stopFrameRoute = function(g) { if (g) { window.dhtmlDragAndDrop.stopDrag(1, 1) } for (var a = 0; a < window.frames.length; a++) { try { if ((window.frames[a] != g) && (window.frames[a].dhtmlDragAndDrop)) { window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window) } } catch (c) {} } try { if ((parent.dhtmlDragAndDrop) && (parent != window) && (parent != g)) { parent.dhtmlDragAndDrop.stopFrameRoute(window) } } catch (c) {} }; dhtmlDragAndDropObject.prototype.initFrameRoute = function(g, h) { if (g) { window.dhtmlDragAndDrop.preCreateDragCopy(); window.dhtmlDragAndDrop.dragStartNode = g.dhtmlDragAndDrop.dragStartNode; window.dhtmlDragAndDrop.dragStartObject = g.dhtmlDragAndDrop.dragStartObject; window.dhtmlDragAndDrop.dragNode = g.dhtmlDragAndDrop.dragNode; window.dhtmlDragAndDrop.gldragNode = g.dhtmlDragAndDrop.dragNode; window.document.body.onmouseup = window.dhtmlDragAndDrop.stopDrag; window.waitDrag = 0; if (((!_isIE) && (h)) && ((!_isFF) || (_FFrv < 1.8))) { window.dhtmlDragAndDrop.calculateFramePosition() } } try { if ((parent.dhtmlDragAndDrop) && (parent != window) && (parent != g)) { parent.dhtmlDragAndDrop.initFrameRoute(window) } } catch (c) {} for (var a = 0; a < window.frames.length; a++) { try { if ((window.frames[a] != g) && (window.frames[a].dhtmlDragAndDrop)) { window.frames[a].dhtmlDragAndDrop.initFrameRoute(window, ((!g || h) ? 1 : 0)) } } catch (c) {} } }; _isFF = false; _isIE = false; _isOpera = false; _isKHTML = false; _isMacOS = false; _isChrome = false; _FFrv = false; _KHTMLrv = false; _OperaRv = false; if (navigator.userAgent.indexOf("Macintosh") != -1) { _isMacOS = true } if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) { _isChrome = true } if ((navigator.userAgent.indexOf("Safari") != -1) || (navigator.userAgent.indexOf("Konqueror") != -1)) { _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari") + 7, 5)); if (_KHTMLrv > 525) { _isFF = true; _FFrv = 1.9 } else { _isKHTML = true } } else { if (navigator.userAgent.indexOf("Opera") != -1) { _isOpera = true; _OperaRv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera") + 6, 3)) } else { if (navigator.appName.indexOf("Microsoft") != -1) { _isIE = true; if ((navigator.appVersion.indexOf("MSIE 8.0") != -1 || navigator.appVersion.indexOf("MSIE 9.0") != -1 || navigator.appVersion.indexOf("MSIE 10.0") != -1 || document.documentMode > 7) && document.compatMode != "BackCompat") { _isIE = 8 } } else { if (navigator.appName == "Netscape" && navigator.userAgent.indexOf("Trident") != -1) { _isIE = 8 } else { _isFF = true; _FFrv = parseFloat(navigator.userAgent.split("rv:")[1]) } } } } if (typeof(window.dhtmlxEvent) == "undefined") { window.dhtmlxEvent = function(c, e, a) { if (c.addEventListener) { c.addEventListener(e, a, false) } else { if (c.attachEvent) { c.attachEvent("on" + e, a) } } } } if (dhtmlxEvent.touchDelay == null) { dhtmlxEvent.touchDelay = 2000 } if (typeof(dhtmlxEvent.initTouch) == "undefined") { dhtmlxEvent.initTouch = function() { var g; var h; var c, a; dhtmlxEvent(document.body, "touchstart", function(l) { h = l.touches[0].target; c = l.touches[0].clientX; a = l.touches[0].clientY; g = window.setTimeout(e, dhtmlxEvent.touchDelay) }); function e() { if (h) { var l = document.createEvent("HTMLEvents"); l.initEvent("dblclick", true, true); h.dispatchEvent(l); g = h = null } } dhtmlxEvent(document.body, "touchmove", function(l) { if (g) { if (Math.abs(l.touches[0].clientX - c) > 50 || Math.abs(l.touches[0].clientY - a) > 50) { window.clearTimeout(g); g = h = false } } }); dhtmlxEvent(document.body, "touchend", function(l) { if (g) { window.clearTimeout(g); g = h = false } }); dhtmlxEvent.initTouch = function() {} } }(function(c) { var e = typeof setImmediate !== "undefined" ? setImmediate : function(h) { setTimeout(h, 0) }; function g(l, m) { var h = this; h.promise = h; h.state = "pending"; h.val = null; h.fn = l || null; h.er = m || null; h.next = [] } g.prototype.resolve = function(l) { var h = this; if (h.state === "pending") { h.val = l; h.state = "resolving"; e(function() { h.fire() }) } }; g.prototype.reject = function(l) { var h = this; if (h.state === "pending") { h.val = l; h.state = "rejecting"; e(function() { h.fire() }) } }; g.prototype.then = function(l, n) { var h = this; var m = new g(l, n); h.next.push(m); if (h.state === "resolved") { m.resolve(h.val) } if (h.state === "rejected") { m.reject(h.val) } return m }; g.prototype.fail = function(h) { return this.then(null, h) }; g.prototype.finish = function(m) { var h = this; h.state = m; if (h.state === "resolved") { for (var l = 0; l < h.next.length; l++) { h.next[l].resolve(h.val) } } if (h.state === "rejected") { for (var l = 0; l < h.next.length; l++) { h.next[l].reject(h.val) } if (!h.next.length) { throw (h.val) } } }; g.prototype.thennable = function(o, h, m, s, r) { var l = this; r = r || l.val; if (typeof r === "object" && typeof o === "function") { try { var n = 0; o.call(r, function(u) { if (n++ !== 0) { return } h(u) }, function(u) { if (n++ !== 0) { return } m(u) }) } catch (q) { m(q) } } else { s(r) } }; g.prototype.fire = function() { var h = this; var l; try { l = h.val && h.val.then } catch (m) { h.val = m; h.state = "rejecting"; return h.fire() } h.thennable(l, function(n) { h.val = n; h.state = "resolving"; h.fire() }, function(n) { h.val = n; h.state = "rejecting"; h.fire() }, function(n) { h.val = n; if (h.state === "resolving" && typeof h.fn === "function") { try { h.val = h.fn.call(undefined, h.val) } catch (o) { h.val = o; return h.finish("rejected") } } if (h.state === "rejecting" && typeof h.er === "function") { try { h.val = h.er.call(undefined, h.val); h.state = "resolving" } catch (o) { h.val = o; return h.finish("rejected") } } if (h.val === h) { h.val = TypeError(); return h.finish("rejected") } h.thennable(l, function(q) { h.val = q; h.finish("resolved") }, function(q) { h.val = q; h.finish("rejected") }, function(q) { h.val = q; h.state === "resolving" ? h.finish("resolved") : h.finish("rejected") }) }) }; g.prototype.done = function() { if (this.state = "rejected" && !this.next) { throw this.val } return null }; g.prototype.nodeify = function(h) { if (typeof h === "function") { return this.then(function(m) { try { h(null, m) } catch (l) { setImmediate(function() { throw l }) } return m }, function(m) { try { h(m) } catch (l) { setImmediate(function() { throw l }) } return m }) } return this }; g.prototype.spread = function(h, l) { return this.all().then(function(m) { return typeof h === "function" && h.apply(null, m) }, l) }; g.prototype.all = function() { var h = this; return this.then(function(w) { var m = new g(); if (!(w instanceof Array)) { m.reject(TypeError); return m } var o = 0; var v = w.length; function r() { if (++o === v) { m.resolve(w) } } for (var s = 0, q = w.length; s < q; s++) { var x = w[s]; var n; try { n = x && x.then } catch (u) { m.reject(u); break }(function(l) { h.thennable(n, function(y) { w[l] = y; r() }, function(y) { m.reject(y) }, function() { r() }, x) })(s) } return m }) }; var a = { all: function(h) { var l = new g(null, null); l.resolve(h); return l.all() }, defer: function() { return new g(null, null) }, fcall: function() { var m = new g(); var h = Array.apply([], arguments); var l = h.shift(); try { var o = l.apply(null, h); m.resolve(o) } catch (n) { m.reject(n) } return m }, nfcall: function() { var m = new g(); var h = Array.apply([], arguments); var l = h.shift(); try { h.push(function(o, q) { if (o) { return m.reject(o) } return m.resolve(q) }); l.apply(null, h) } catch (n) { m.reject(n) } return m } }; c.promise = a })(dhx); if (!window.dhtmlx) { dhtmlx = {} } dhtmlx.assert = function(c, a) { if (!c) { dhtmlx.error(a) } }; dhtmlx.assert_enabled = function() { return false }; dhtmlx.assert_event = function(l, e) { if (!l._event_check) { l._event_check = {}; l._event_check_size = {} } for (var c in e) { l._event_check[c.toLowerCase()] = e[c]; var h = -1; for (var g in e[c]) { h++ } l._event_check_size[c.toLowerCase()] = h } }; dhtmlx.assert_method_info = function(h, c, g, l) { var a = []; for (var e = 0; e < l.length; e++) { a.push(l[e][0] + " : " + l[e][1] + "\n " + l[e][2].describe() + (l[e][3] ? "; optional" : "")) } return h.name + "." + c + "\n" + g + "\n Arguments:\n - " + a.join("\n - ") }; dhtmlx.assert_method = function(e, a) { for (var c in a) { dhtmlx.assert_method_process(e, c, a[c].descr, a[c].args, (a[c].min || 99), a[c].skip) } }; dhtmlx.assert_method_process = function(l, c, h, m, e, g) { var a = l[c]; if (!g) { l[c] = function() { if (arguments.length != m.length && arguments.length < e) { dhtmlx.log("warn", "Incorrect count of parameters\n" + l[c].describe() + "\n\nExpecting " + m.length + " but have only " + arguments.length) } else { for (var n = 0; n < m.length; n++) { if (!m[n][3] && !m[n][2](arguments[n])) { dhtmlx.log("warn", "Incorrect method call\n" + l[c].describe() + "\n\nActual value of " + (n + 1) + " parameter: {" + (typeof arguments[n]) + "} " + arguments[n]) } } } return a.apply(this, arguments) } } l[c].describe = function() { return dhtmlx.assert_method_info(l, c, h, m) } }; dhtmlx.assert_event_call = function(e, c, a) { if (e._event_check) { if (!e._event_check[c]) { dhtmlx.log("warn", "Not expected event call :" + c) } else { if (dhtmlx.isNotDefined(a)) { dhtmlx.log("warn", "Event without parameters :" + c) } else { if (e._event_check_size[c] != a.length) { dhtmlx.log("warn", "Incorrect event call, expected " + e._event_check_size[c] + " parameter(s), but have " + a.length + " parameter(s), for " + c + " event") } } } } }; dhtmlx.assert_event_attach = function(c, a) { if (c._event_check && !c._event_check[a]) { dhtmlx.log("warn", "Unknown event name: " + a) } }; dhtmlx.assert_property = function(c, a) { if (!c._settings_check) { c._settings_check = {} } dhtmlx.extend(c._settings_check, a) }; dhtmlx.assert_check = function(e, c) { if (typeof e == "object") { for (var a in e) { dhtmlx.assert_settings(a, e[a], c) } } }; dhtmlx.assert_settings = function(n, h, g) { g = g || this._settings_check; if (g) { if (!g[n]) { return dhtmlx.log("warn", "Unknown propery: " + n) } var m = ""; var c = ""; var a = false; for (var e = 0; e < g[n].length; e++) { var l = g[n][e]; if (typeof l == "string") { continue } if (typeof l == "function") { a = a || l(h) } else { if (typeof l == "object" && typeof l[1] == "function") { a = a || l[1](h); if (a && l[2]) { dhtmlx.assert_check(h, l[2]) } } } if (a) { break } } if (!a) { dhtmlx.log("warn", "Invalid configuration\n" + dhtmlx.assert_info(n, g) + "\nActual value: {" + (typeof h) + "} " + h) } } }; dhtmlx.assert_info = function(c, l) { var a = l[c]; var h = ""; var g = []; for (var e = 0; e < a.length; e++) { if (typeof rule == "string") { h = a[e] } else { if (a[e].describe) { g.push(a[e].describe()) } else { if (a[e][1] && a[e][1].describe) { g.push(a[e][1].describe()) } } } } return "Property: " + c + ", " + h + " \nExpected value: \n - " + g.join("\n - ") }; if (dhtmlx.assert_enabled()) { dhtmlx.assert_rule_color = function(a) { if (typeof a != "string") { return false } if (a.indexOf("#") !== 0) { return false } if (a.substr(1).replace(/[0-9A-F]/gi, "") !== "") { return false } return true }; dhtmlx.assert_rule_color.describe = function() { return "{String} Value must start from # and contain hexadecimal code of color" }; dhtmlx.assert_rule_template = function(a) { if (typeof a == "function") { return true } if (typeof a == "string") { return true } return false }; dhtmlx.assert_rule_template.describe = function() { return "{Function},{String} Value must be a function which accepts data object and return text string, or a sting with optional template markers" }; dhtmlx.assert_rule_boolean = function(a) { if (typeof a == "boolean") { return true } return false }; dhtmlx.assert_rule_boolean.describe = function() { return "{Boolean} true or false" }; dhtmlx.assert_rule_object = function(a, c) { if (typeof a == "object") { return true } return false }; dhtmlx.assert_rule_object.describe = function() { return "{Object} Configuration object" }; dhtmlx.assert_rule_string = function(a) { if (typeof a == "string") { return true } return false }; dhtmlx.assert_rule_string.describe = function() { return "{String} Plain string" }; dhtmlx.assert_rule_htmlpt = function(a) { return !!dhtmlx.toNode(a) }; dhtmlx.assert_rule_htmlpt.describe = function() { return "{Object},{String} HTML node or ID of HTML Node" }; dhtmlx.assert_rule_notdocumented = function(a) { return false }; dhtmlx.assert_rule_notdocumented.describe = function() { return "This options wasn't documented" }; dhtmlx.assert_rule_key = function(c) { var a = function(e) { return c[e] }; a.describe = function() { var g = []; for (var e in c) { g.push(e) } return "{String} can take one of next values: " + g.join(", ") }; return a }; dhtmlx.assert_rule_dimension = function(a) { if (a * 1 == a && !isNaN(a) && a >= 0) { return true } return false }; dhtmlx.assert_rule_dimension.describe = function() { return "{Integer} value must be a positive number" }; dhtmlx.assert_rule_number = function(a) { if (typeof a == "number") { return true } return false }; dhtmlx.assert_rule_number.describe = function() { return "{Integer} value must be a number" }; dhtmlx.assert_rule_function = function(a) { if (typeof a == "function") { return true } return false }; dhtmlx.assert_rule_function.describe = function() { return "{Function} value must be a custom function" }; dhtmlx.assert_rule_any = function(a) { return true }; dhtmlx.assert_rule_any.describe = function() { return "Any value" }; dhtmlx.assert_rule_mix = function(e, c) { var g = function(a) { if (e(a) || c(a)) { return true } return false }; g.describe = function() { return e.describe() }; return g } } dhtmlx.codebase = "./"; dhtmlx.copy = function(c) { var a = dhtmlx.copy._function; a.prototype = c; return new a() }; dhtmlx.copy._function = function() {}; dhtmlx.extend = function(c, a) { for (var e in a) { c[e] = a[e] } if (dhtmlx.assert_enabled() && a._assert) { c._assert(); c._assert = null } dhtmlx.assert(c, "Invalid nesting target"); dhtmlx.assert(a, "Invalid nesting source"); if (a._init) { c._init() } return c }; dhtmlx.proto_extend = function() { var l = arguments; var e = l[0]; var c = []; for (var h = l.length - 1; h > 0; h--) { if (typeof l[h] == "function") { l[h] = l[h].prototype } for (var g in l[h]) { if (g == "_init") { c.push(l[h][g]) } else { if (!e[g]) { e[g] = l[h][g] } } } } if (l[0]._init) { c.push(l[0]._init) } e._init = function() { for (var m = 0; m < c.length; m++) { c[m].apply(this, arguments) } }; e.base = l[1]; var a = function(m) { this._init(m); if (this._parseSettings) { this._parseSettings(m, this.defaults) } }; a.prototype = e; e = l = null; return a }; dhtmlx.bind = function(c, a) { return function() { return c.apply(a, arguments) } }; dhtmlx.require = function(a) { if (!dhtmlx._modules[a]) { dhtmlx.assert(dhtmlx.ajax, "load module is required"); dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase + a).responseText); dhtmlx._modules[a] = true } }; dhtmlx._modules = {}; dhtmlx.exec = function(code) { if (window.execScript) { window.execScript(code) } else { window.eval(code) } }; dhtmlx.methodPush = function(a, e, c) { return function() { var g = false; g = a[e].apply(a, arguments); return g } }; dhtmlx.isNotDefined = function(c) { return typeof c == "undefined" }; dhtmlx.delay = function(g, c, e, a) { setTimeout(function() { var h = g.apply(c, e); g = c = e = null; return h }, a || 1) }; dhtmlx.uid = function() { if (!this._seed) { this._seed = (new Date).valueOf() } this._seed++; return this._seed }; dhtmlx.toNode = function(a) { if (typeof a == "string") { return document.getElementById(a) } return a }; dhtmlx.toArray = function(a) { return dhtmlx.extend((a || []), dhtmlx.PowerArray) }; dhtmlx.toFunctor = function(str) { return (typeof(str) == "string") ? eval(str) : str }; dhtmlx._events = {}; dhtmlx.event = function(g, e, a, c) { g = dhtmlx.toNode(g); var h = dhtmlx.uid(); dhtmlx._events[h] = [g, e, a]; if (c) { a = dhtmlx.bind(a, c) } if (g.addEventListener) { g.addEventListener(e, a, false) } else { if (g.attachEvent) { g.attachEvent("on" + e, a) } } return h }; dhtmlx.eventRemove = function(c) { if (!c) { return } dhtmlx.assert(this._events[c], "Removing non-existing event"); var a = dhtmlx._events[c]; if (a[0].removeEventListener) { a[0].removeEventListener(a[1], a[2], false) } else { if (a[0].detachEvent) { a[0].detachEvent("on" + a[1], a[2]) } } delete this._events[c] }; dhtmlx.log = function(c, e, a) { if (window.console && console.log) { c = c.toLowerCase(); if (window.console[c]) { window.console[c](e || "unknown error") } else { window.console.log(c + ": " + e) } if (a) { window.console.log(a) } } }; dhtmlx.log_full_time = function(a) { dhtmlx._start_time_log = new Date(); dhtmlx.log("Info", "Timing start [" + a + "]"); window.setTimeout(function() { var c = new Date(); dhtmlx.log("Info", "Timing end [" + a + "]:" + (c.valueOf() - dhtmlx._start_time_log.valueOf()) / 1000 + "s") }, 1) }; dhtmlx.log_time = function(a) { var e = "_start_time_log" + a; if (!dhtmlx[e]) { dhtmlx[e] = new Date(); dhtmlx.log("Info", "Timing start [" + a + "]") } else { var c = new Date(); dhtmlx.log("Info", "Timing end [" + a + "]:" + (c.valueOf() - dhtmlx[e].valueOf()) / 1000 + "s"); dhtmlx[e] = null } }; dhtmlx.error = function(c, a) { dhtmlx.log("error", c, a) }; dhtmlx.EventSystem = { _init: function() { this._events = {}; this._handlers = {}; this._map = {} }, block: function() { this._events._block = true }, unblock: function() { this._events._block = false }, mapEvent: function(a) { dhtmlx.extend(this._map, a) }, callEvent: function(e, h) { if (this._events._block) { return true } e = e.toLowerCase(); dhtmlx.assert_event_call(this, e, h); var g = this._events[e.toLowerCase()]; var a = true; if (dhtmlx.debug) { dhtmlx.log("info", "[" + this.name + "] event:" + e, h) } if (g) { for (var c = 0; c < g.length; c++) { if (g[c].apply(this, (h || [])) === false) { a = false } } } if (this._map[e] && !this._map[e].callEvent(e, h)) { a = false } return a }, attachEvent: function(c, a, g) { c = c.toLowerCase(); dhtmlx.assert_event_attach(this, c); g = g || dhtmlx.uid(); a = dhtmlx.toFunctor(a); var e = this._events[c] || dhtmlx.toArray(); e.push(a); this._events[c] = e; this._handlers[g] = { f: a, t: c }; return g }, detachEvent: function(g) { if (this._handlers[g]) { var c = this._handlers[g].t; var a = this._handlers[g].f; var e = this._events[c]; e.remove(a); delete this._handlers[g] } } }; dhtmlx.PowerArray = { removeAt: function(c, a) { if (c >= 0) { this.splice(c, (a || 1)) } }, remove: function(a) { this.removeAt(this.find(a)) }, insertAt: function(c, e) { if (!e && e !== 0) { this.push(c) } else { var a = this.splice(e, (this.length - e)); this[e] = c; this.push.apply(this, a) } }, find: function(c) { for (var a = 0; a < this.length; a++) { if (c == this[a]) { return a } } return -1 }, each: function(a, e) { for (var c = 0; c < this.length; c++) { a.call((e || this), this[c]) } }, map: function(a, e) { for (var c = 0; c < this.length; c++) { this[c] = a.call((e || this), this[c]) } return this } }; dhtmlx.env = {}; if (navigator.userAgent.indexOf("Opera") != -1) { dhtmlx._isOpera = true } else { dhtmlx._isIE = !!document.all; dhtmlx._isFF = !document.all; dhtmlx._isWebKit = (navigator.userAgent.indexOf("KHTML") != -1); if (navigator.appVersion.indexOf("MSIE 8.0") != -1 && document.compatMode != "BackCompat") { dhtmlx._isIE = 8 } if (navigator.appVersion.indexOf("MSIE 9.0") != -1 && document.compatMode != "BackCompat") { dhtmlx._isIE = 9 } } dhtmlx.env = {}; (function() { dhtmlx.env.transform = false; dhtmlx.env.transition = false; var a = {}; a.names = ["transform", "transition"]; a.transform = ["transform", "WebkitTransform", "MozTransform", "oTransform", "msTransform"]; a.transition = ["transition", "WebkitTransition", "MozTransition", "oTransition"]; var g = document.createElement("DIV"); var e; for (var c = 0; c < a.names.length; c++) { while (p = a[a.names[c]].pop()) { if (typeof g.style[p] != "undefined") { dhtmlx.env[a.names[c]] = true } } } })(); dhtmlx.env.transform_prefix = (function() { var a; if (dhtmlx._isOpera) { a = "-o-" } else { a = ""; if (dhtmlx._isFF) { a = "-moz-" } if (dhtmlx._isWebKit) { a = "-webkit-" } } return a })(); dhtmlx.env.svg = (function() { return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") })(); dhtmlx.zIndex = { drag: 10000 }; dhtmlx.html = { create: function(c, a, e) { a = a || {}; var g = document.createElement(c); for (var h in a) { g.setAttribute(h, a[h]) } if (a.style) { g.style.cssText = a.style } if (a["class"]) { g.className = a["class"] } if (e) { g.innerHTML = e } return g }, getValue: function(a) { a = dhtmlx.toNode(a); if (!a) { return "" } return dhtmlx.isNotDefined(a.value) ? a.innerHTML : a.value }, remove: function(c) { if (c instanceof Array) { for (var a = 0; a < c.length; a++) { this.remove(c[a]) } } else { if (c && c.parentNode) { c.parentNode.removeChild(c) } } }, insertBefore: function(c, e, a) { if (!c) { return } if (e) { e.parentNode.insertBefore(c, e) } else { a.appendChild(c) } }, locate: function(c, h) { c = c || event; var a = c.target || c.srcElement; while (a) { if (a.getAttribute) { var g = a.getAttribute(h); if (g) { return g } } a = a.parentNode } return null }, offset: function(g) { if (g.getBoundingClientRect) { var m = g.getBoundingClientRect(); var n = document.body; var c = document.documentElement; var a = window.pageYOffset || c.scrollTop || n.scrollTop; var h = window.pageXOffset || c.scrollLeft || n.scrollLeft; var l = c.clientTop || n.clientTop || 0; var o = c.clientLeft || n.clientLeft || 0; var q = m.top + a - l; var e = m.left + h - o; return { y: Math.round(q), x: Math.round(e) } } else { var q = 0, e = 0; while (g) { q = q + parseInt(g.offsetTop, 10); e = e + parseInt(g.offsetLeft, 10); g = g.offsetParent } return { y: q, x: e } } }, pos: function(a) { a = a || event; if (a.pageX || a.pageY) { return { x: a.pageX, y: a.pageY } } var c = ((dhtmlx._isIE) && (document.compatMode != "BackCompat")) ? document.documentElement : document.body; return { x: a.clientX + c.scrollLeft - c.clientLeft, y: a.clientY + c.scrollTop - c.clientTop } }, preventEvent: function(a) { if (a && a.preventDefault) { a.preventDefault() } dhtmlx.html.stopEvent(a) }, stopEvent: function(a) { (a || event).cancelBubble = true; return false }, addCss: function(c, a) { c.className += " " + a }, removeCss: function(c, a) { c.className = c.className.replace(RegExp(a, "g"), "") } }; (function() { var a = document.getElementsByTagName("SCRIPT"); dhtmlx.assert(a.length, "Can't locate codebase"); if (a.length) { a = (a[a.length - 1].getAttribute("src") || "").split("/"); a.splice(a.length - 1, 1); dhtmlx.codebase = a.slice(0, a.length).join("/") + "/" } })(); if (!dhtmlx.ui) { dhtmlx.ui = {} } dhtmlx.Destruction = { _init: function() { dhtmlx.destructors.push(this) }, destructor: function(a) { this.destructor = function() {}; this._htmlmap = null; this._htmlrows = null; if (this._html) { document.body.appendChild(this._html) } this._html = null; if (this._obj) { this._obj.innerHTML = ""; this._obj._htmlmap = null } this._obj = this._dataobj = null; this.data = null; this._events = this._handlers = {}; this.canvases = []; if (this.render) { this.render = function() {} } } }; dhtmlx.destructors = []; dhtmlx.event(window, "unload", function() { if (dhtmlx.destructors) { for (var e = 0; e < dhtmlx.destructors.length; e++) { dhtmlx.destructors[e].destructor(-1) } dhtmlx.destructors = [] } for (var c in dhtmlx._events) { var g = dhtmlx._events[c]; if (g[0].removeEventListener) { g[0].removeEventListener(g[1], g[2], false) } else { if (g[0].detachEvent) { g[0].detachEvent("on" + g[1], g[2]) } } delete dhtmlx._events[c] } }); dhtmlx.ajax = function(a, c, e) { if (arguments.length !== 0) { var g = new dhtmlx.ajax(); if (e) { g.master = e } g.get(a, null, c) } if (!this.getXHR) { return new dhtmlx.ajax() } return this }; dhtmlx.ajax.prototype = { getXHR: function() { if (dhtmlx._isIE) { return new ActiveXObject("Microsoft.xmlHTTP") } else { return new XMLHttpRequest() } }, send: function(h, o, m) { var c = this.getXHR(); if (typeof m == "function") { m = [m] } if (typeof o == "object") { var l = []; for (var e in o) { var n = o[e]; if (n === null || n === dhtmlx.undefined) { n = "" } l.push(e + "=" + encodeURIComponent(n)) } o = l.join("&") } if (o && !this.post) { h = h + (h.indexOf("?") != -1 ? "&" : "?") + o; o = null } c.open(this.post ? "POST" : "GET", h, !this._sync); if (this.post) { c.setRequestHeader("Content-type", "application/x-www-form-urlencoded") } var g = this; c.onreadystatechange = function() { if (!c.readyState || c.readyState == 4) { if (m && g) { for (var a = 0; a < m.length; a++) { if (m[a]) { m[a].call((g.master || g), c.responseText, c.responseXML, c) } } } g.master = null; m = g = null } }; c.send(o || null); return c }, get: function(a, e, c) { this.post = false; return this.send(a, e, c) }, post: function(a, e, c) { this.post = true; return this.send(a, e, c) }, sync: function() { this._sync = true; return this } }; dhtmlx.AtomDataLoader = { _init: function(a) { this.data = {}; if (a) { this._settings.datatype = a.datatype || "json"; this._after_init.push(this._load_when_ready) } }, _load_when_ready: function() { this._ready_for_data = true; if (this._settings.url) { this.url_setter(this._settings.url) } if (this._settings.data) { this.data_setter(this._settings.data) } }, url_setter: function(a) { if (!this._ready_for_data) { return a } this.load(a, this._settings.datatype); return a }, data_setter: function(a) { if (!this._ready_for_data) { return a } this.parse(a, this._settings.datatype); return true }, load: function(a, c) { this.callEvent("onXLS", []); if (typeof c == "string") { this.data.driver = dhtmlx.DataDriver[c]; c = arguments[2] } else { this.data.driver = dhtmlx.DataDriver[this._settings.datatype || "xml"] } if (window.dhx4) { return dhx4.ajax.get(a, dhtmlx.bind(function(g) { var e = g.xmlDoc; var l = e.responseText; var h = e.responseXML; if (this._onLoad) { this._onLoad.call(this, l, h, e) } if (c) { c.call(this, l, h, e) } }, this)) } else { dhtmlx.ajax(a, [this._onLoad, c], this) } }, parse: function(c, a) { this.callEvent("onXLS", []); this.data.driver = dhtmlx.DataDriver[a || "xml"]; this._onLoad(c, null) }, _onLoad: function(h, c, a) { var e = this.data.driver; var g = e.getRecords(e.toObject(h, c))[0]; this.data = (e ? e.getDetails(g) : h); this.callEvent("onXLE", []) }, _check_data_feed: function(c) { if (!this._settings.dataFeed || this._ignore_feed || !c) { return true } var a = this._settings.dataFeed; if (typeof a == "function") { return a.call(this, (c.id || c), c) } a = a + (a.indexOf("?") == -1 ? "?" : "&") + "action=get&id=" + encodeURIComponent(c.id || c); this.callEvent("onXLS", []); dhtmlx.ajax(a, function(g, e) { this._ignore_feed = true; this.setValues(dhtmlx.DataDriver.json.toObject(g)[0]); this._ignore_feed = false; this.callEvent("onXLE", []) }, this); return false } }; dhtmlx.DataDriver = {}; dhtmlx.DataDriver.json = { toObject: function(data) { if (!data) { data = "[]" } if (typeof data == "string") { eval("dhtmlx.temp=" + data); return dhtmlx.temp } return data }, getRecords: function(a) { if (a && a.data) { a = a.data } if (a && !(a instanceof Array)) { return [a] } return a }, getDetails: function(a) { return a }, getInfo: function(a) { return { _size: (a.total_count || 0), _from: (a.pos || 0), _key: (a.dhx_security) } } }; dhtmlx.DataDriver.json_ext = { toObject: function(data) { if (!data) { data = "[]" } if (typeof data == "string") { var temp; eval("temp=" + data); dhtmlx.temp = []; var header = temp.header; for (var i = 0; i < temp.data.length; i++) { var item = {}; for (var j = 0; j < header.length; j++) { if (typeof(temp.data[i][j]) != "undefined") { item[header[j]] = temp.data[i][j] } } dhtmlx.temp.push(item) } return dhtmlx.temp } return data }, getRecords: function(a) { if (a && !(a instanceof Array)) { return [a] } return a }, getDetails: function(a) { return a }, getInfo: function(a) { return { _size: (a.total_count || 0), _from: (a.pos || 0) } } }; dhtmlx.DataDriver.html = { toObject: function(c) { if (typeof c == "string") { var a = null; if (c.indexOf("<") == -1) { a = dhtmlx.toNode(c) } if (!a) { a = document.createElement("DIV"); a.innerHTML = c } return a.getElementsByTagName(this.tag) } return c }, getRecords: function(a) { if (a.tagName) { return a.childNodes } return a }, getDetails: function(a) { return dhtmlx.DataDriver.xml.tagToObject(a) }, getInfo: function(a) { return { _size: 0, _from: 0 } }, tag: "LI" }; dhtmlx.DataDriver.jsarray = { toObject: function(data) { if (typeof data == "string") { eval("dhtmlx.temp=" + data); return dhtmlx.temp } return data }, getRecords: function(a) { return a }, getDetails: function(e) { var a = {}; for (var c = 0; c < e.length; c++) { a["data" + c] = e[c] } return a }, getInfo: function(a) { return { _size: 0, _from: 0 } } }; dhtmlx.DataDriver.csv = { toObject: function(a) { return a }, getRecords: function(a) { return a.split(this.row) }, getDetails: function(e) { e = this.stringToArray(e); var a = {}; for (var c = 0; c < e.length; c++) { a["data" + c] = e[c] } return a }, getInfo: function(a) { return { _size: 0, _from: 0 } }, stringToArray: function(c) { c = c.split(this.cell); for (var a = 0; a < c.length; a++) { c[a] = c[a].replace(/^[ \t\n\r]*(\"|)/g, "").replace(/(\"|)[ \t\n\r]*$/g, "") } return c }, row: "\n", cell: "," }; dhtmlx.DataDriver.xml = { toObject: function(c, a) { if (a && (a = this.checkResponse(c, a))) { return a } if (typeof c == "string") { return this.fromString(c) } return c }, getRecords: function(a) { return this.xpath(a, this.records) }, records: "/*/item", getDetails: function(a) { return this.tagToObject(a, {}) }, getInfo: function(a) { return { _size: (a.documentElement.getAttribute("total_count") || 0), _from: (a.documentElement.getAttribute("pos") || 0), _key: (a.documentElement.getAttribute("dhx_security")) } }, xpath: function(h, q) { if (window.XPathResult) { var g = h; if (h.nodeName.indexOf("document") == -1) { h = h.ownerDocument } var n = []; var c = h.evaluate(q, g, null, XPathResult.ANY_TYPE, null); var o = c.iterateNext(); while (o) { n.push(o); o = c.iterateNext() } return n } else { var m = true; try { if (typeof(h.selectNodes) == "undefined") { m = false } } catch (l) {} if (m) { return h.selectNodes(q) } else { var a = q.split("/").pop(); return h.getElementsByTagName(a) } } }, tagToObject: function(e, o) { o = o || {}; var h = false; var c = e.childNodes; var n = {}; for (var m = 0; m < c.length; m++) { if (c[m].nodeType == 1) { var l = c[m].tagName; if (typeof o[l] != "undefined") { if (!(o[l] instanceof Array)) { o[l] = [o[l]] } o[l].push(this.tagToObject(c[m], {})) } else { o[c[m].tagName] = this.tagToObject(c[m], {}) } h = true } } var g = e.attributes; if (g && g.length) { for (var m = 0; m < g.length; m++) { o[g[m].name] = g[m].value } h = true } if (!h) { return this.nodeValue(e) } o.value = this.nodeValue(e); return o }, nodeValue: function(a) { if (a.firstChild) { return a.firstChild.wholeText || a.firstChild.data } return "" }, fromString: function(c) { if (window.DOMParser && !dhtmlx._isIE) { return (new DOMParser()).parseFromString(c, "text/xml") } if (window.ActiveXObject) { var a = new ActiveXObject("Microsoft.xmlDOM"); a.loadXML(c); return a } dhtmlx.error("Load from xml string is not supported") }, checkResponse: function(g, e) { if (e && (e.firstChild && e.firstChild.tagName != "parsererror")) { return e } var c = this.fromString(g.replace(/^[\s]+/, "")); if (c) { return c } dhtmlx.error("xml can't be parsed", g) } }; dhtmlx.DataLoader = { _init: function(a) { a = a || ""; this.name = "DataStore"; this.data = (a.datastore) || (new dhtmlx.DataStore()); this._readyHandler = this.data.attachEvent("onStoreLoad", dhtmlx.bind(this._call_onready, this)) }, load: function(a, c) { dhtmlx.AtomDataLoader.load.apply(this, arguments); if (!this.data.feed) { this.data.feed = function(g, e) { if (this._load_count) { return this._load_count = [g, e] } else { this._load_count = true } this.load(a + ((a.indexOf("?") == -1) ? "?" : "&") + "posStart=" + g + "&count=" + e, function() { var h = this._load_count; this._load_count = false; if (typeof h == "object") { this.data.feed.apply(this, h) } }) } } }, _onLoad: function(e, c, a) { this.data._parse(this.data.driver.toObject(e, c)); this.callEvent("onXLE", []); if (this._readyHandler) { this.data.detachEvent(this._readyHandler); this._readyHandler = null } }, dataFeed_setter: function(a) { this.data.attachEvent("onBeforeFilter", dhtmlx.bind(function(m, l) { if (this._settings.dataFeed) { var h = {}; if (!m && !h) { return } if (typeof m == "function") { if (!l) { return } m(l, h) } else { h = { text: l } } this.clearAll(); var c = this._settings.dataFeed; if (typeof c == "function") { return c.call(this, l, h) } var g = []; for (var e in h) { g.push("dhx_filter[" + e + "]=" + encodeURIComponent(h[e])) } this.load(c + (c.indexOf("?") < 0 ? "?" : "&") + g.join("&"), this._settings.datatype); return false } }, this)); return a }, _call_onready: function() { if (this._settings.ready) { var a = dhtmlx.toFunctor(this._settings.ready); if (a && a.call) { a.apply(this, arguments) } } } }; dhtmlx.DataStore = function() { this.name = "DataStore"; dhtmlx.extend(this, dhtmlx.EventSystem); this.setDriver("xml"); this.pull = {}; this.order = dhtmlx.toArray() }; dhtmlx.DataStore.prototype = { setDriver: function(a) { dhtmlx.assert(dhtmlx.DataDriver[a], "incorrect DataDriver"); this.driver = dhtmlx.DataDriver[a] }, _parse: function(h) { this.callEvent("onParse", [this.driver, h]); if (this._filter_order) { this.filter() } var l = this.driver.getInfo(h); if (l._key) { dhtmlx.security_key = l._key } var g = this.driver.getRecords(h); var n = (l._from || 0) * 1; if (n === 0 && this.order[0]) { n = this.order.length } var c = 0; for (var e = 0; e < g.length; e++) { var a = this.driver.getDetails(g[e]); var m = this.id(a); if (!this.pull[m]) { this.order[c + n] = m; c++ } this.pull[m] = a; if (this.extraParser) { this.extraParser(a) } if (this._scheme) { if (this._scheme.$init) { this._scheme.$update(a) } else { if (this._scheme.$update) { this._scheme.$update(a) } } } } for (var e = 0; e < l._size; e++) { if (!this.order[e]) { var m = dhtmlx.uid(); var a = { id: m, $template: "loading" }; this.pull[m] = a; this.order[e] = m } } this.callEvent("onStoreLoad", [this.driver, h]); this.refresh() }, id: function(a) { return a.id || (a.id = dhtmlx.uid()) }, changeId: function(c, a) { dhtmlx.assert(this.pull[c], "Can't change id, for non existing item: " + c); this.pull[a] = this.pull[c]; this.pull[a].id = a; this.order[this.order.find(c)] = a; if (this._filter_order) { this._filter_order[this._filter_order.find(c)] = a } this.callEvent("onIdChange", [c, a]); if (this._render_change_id) { this._render_change_id(c, a) } }, get: function(a) { return this.item(a) }, set: function(c, a) { return this.update(c, a) }, item: function(a) { return this.pull[a] }, update: function(c, a) { if (this._scheme && this._scheme.$update) { this._scheme.$update(a) } if (this.callEvent("onBeforeUpdate", [c, a]) === false) { return false } this.pull[c] = a; this.refresh(c) }, refresh: function(a) { if (this._skip_refresh) { return } if (a) { this.callEvent("onStoreUpdated", [a, this.pull[a], "update"]) } else { this.callEvent("onStoreUpdated", [null, null, null]) } }, silent: function(a) { this._skip_refresh = true; a.call(this); this._skip_refresh = false }, getRange: function(g, e) { if (g) { g = this.indexById(g) } else { g = this.startOffset || 0 } if (e) { e = this.indexById(e) } else { e = Math.min((this.endOffset || Infinity), (this.dataCount() - 1)); if (e < 0) { e = 0 } } if (this.min) { g = this.min } if (this.max) { e = this.max } if (g > e) { var c = e; e = g; g = c } return this.getIndexRange(g, e) }, getIndexRange: function(g, e) { e = Math.min((e || Infinity), this.dataCount() - 1); var a = dhtmlx.toArray(); for (var c = (g || 0); c <= e; c++) { a.push(this.item(this.order[c])) } return a }, dataCount: function() { return this.order.length }, exists: function(a) { return !!(this.pull[a]) }, move: function(a, g) { if (a < 0 || g < 0) { dhtmlx.error("DataStore::move", "Incorrect indexes"); return } var e = this.idByIndex(a); var c = this.item(e); this.order.removeAt(a); this.order.insertAt(e, Math.min(this.order.length, g)); this.callEvent("onStoreUpdated", [e, c, "move"]) }, scheme: function(a) { this._scheme = a }, sync: function(h, g, a) { if (typeof g != "function") { a = g; g = null } if (dhtmlx.debug_bind) { this.debug_sync_master = h; dhtmlx.log("[sync] " + this.debug_bind_master.name + "@" + this.debug_bind_master._settings.id + " <= " + this.debug_sync_master.name + "@" + this.debug_sync_master._settings.id) } var e = h; if (h.name != "DataStore") { h = h.data } var c = dhtmlx.bind(function(n, l, m) { if (m != "update" || g) { n = null } if (!n) { this.order = dhtmlx.toArray([].concat(h.order)); this._filter_order = null; this.pull = h.pull; if (g) { this.silent(g) } if (this._on_sync) { this._on_sync() } } if (dhtmlx.debug_bind) { dhtmlx.log("[sync:request] " + this.debug_sync_master.name + "@" + this.debug_sync_master._settings.id + " <= " + this.debug_bind_master.name + "@" + this.debug_bind_master._settings.id) } if (!a) { this.refresh(n) } else { a = false } }, this); h.attachEvent("onStoreUpdated", c); this.feed = function(m, l) { e.loadNext(l, m) }; c() }, add: function(h, a) { if (this._scheme) { h = h || {}; for (var c in this._scheme) { h[c] = h[c] || this._scheme[c] } if (this._scheme) { if (this._scheme.$init) { this._scheme.$update(h) } else { if (this._scheme.$update) { this._scheme.$update(h) } } } } var l = this.id(h); var g = this.dataCount(); if (dhtmlx.isNotDefined(a) || a < 0) { a = g } if (a > g) { dhtmlx.log("Warning", "DataStore:add", "Index of out of bounds"); a = Math.min(this.order.length, a) } if (this.callEvent("onBeforeAdd", [l, h, a]) === false) { return false } if (this.exists(l)) { return dhtmlx.error("Not unique ID") } this.pull[l] = h; this.order.insertAt(l, a); if (this._filter_order) { var e = this._filter_order.length; if (!a && this.order.length) { e = 0 } this._filter_order.insertAt(l, e) } this.callEvent("onafterAdd", [l, a]); this.callEvent("onStoreUpdated", [l, h, "add"]); return l }, remove: function(e) { if (e instanceof Array) { for (var a = 0; a < e.length; a++) { this.remove(e[a]) } return } if (this.callEvent("onBeforeDelete", [e]) === false) { return false } if (!this.exists(e)) { return dhtmlx.error("Not existing ID", e) } var c = this.item(e); this.order.remove(e); if (this._filter_order) { this._filter_order.remove(e) } delete this.pull[e]; this.callEvent("onafterdelete", [e]); this.callEvent("onStoreUpdated", [e, c, "delete"]) }, clearAll: function() { this.pull = {}; this.order = dhtmlx.toArray(); this.feed = null; this._filter_order = null; this.callEvent("onClearAll", []); this.refresh() }, idByIndex: function(a) { if (a >= this.order.length || a < 0) { dhtmlx.log("Warning", "DataStore::idByIndex Incorrect index") } return this.order[a] }, indexById: function(c) { var a = this.order.find(c); return a }, next: function(c, a) { return this.order[this.indexById(c) + (a || 1)] }, first: function() { return this.order[0] }, last: function() { return this.order[this.order.length - 1] }, previous: function(c, a) { return this.order[this.indexById(c) - (a || 1)] }, sort: function(l, c, a) { var e = l; if (typeof l == "function") { e = { as: l, dir: c } } else { if (typeof l == "string") { e = { by: l, dir: c, as: a } } } var h = [e.by, e.dir, e.as]; if (!this.callEvent("onbeforesort", h)) { return } if (this.order.length) { var m = dhtmlx.sort.create(e); var g = this.getRange(this.first(), this.last()); g.sort(m); this.order = g.map(function(n) { return this.id(n) }, this) } this.refresh(); this.callEvent("onaftersort", h) }, filter: function(h, g) { if (!this.callEvent("onBeforeFilter", [h, g])) { return } if (this._filter_order) { this.order = this._filter_order; delete this._filter_order } if (!this.order.length) { return } if (h) { var c = h; g = g || ""; if (typeof h == "string") { h = dhtmlx.Template.fromHTML(h); g = g.toString().toLowerCase(); c = function(n, m) { return h(n).toLowerCase().indexOf(m) != -1 } } var e = dhtmlx.toArray(); for (var a = 0; a < this.order.length; a++) { var l = this.order[a]; if (c(this.item(l), g)) { e.push(l) } } this._filter_order = this.order; this.order = e } this.refresh(); this.callEvent("onAfterFilter", []) }, each: function(e, c) { for (var a = 0; a < this.order.length; a++) { e.call((c || this), this.item(this.order[a])) } }, provideApi: function(g, c) { this.debug_bind_master = g; if (c) { this.mapEvent({ onbeforesort: g, onaftersort: g, onbeforeadd: g, onafteradd: g, onbeforedelete: g, onafterdelete: g, onbeforeupdate: g }) } var e = ["get", "set", "sort", "add", "remove", "exists", "idByIndex", "indexById", "item", "update", "refresh", "dataCount", "filter", "next", "previous", "clearAll", "first", "last", "serialize"]; for (var a = 0; a < e.length; a++) { g[e[a]] = dhtmlx.methodPush(this, e[a]) } if (dhtmlx.assert_enabled()) { this.assert_event(g) } }, serialize: function() { var e = this.order; var a = []; for (var c = 0; c < e.length; c++) { a.push(this.pull[e[c]]) } return a } }; dhtmlx.sort = { create: function(a) { return dhtmlx.sort.dir(a.dir, dhtmlx.sort.by(a.by, a.as)) }, as: { "int": function(e, c) { e = e * 1; c = c * 1; return e > c ? 1 : (e < c ? -1 : 0) }, string_strict: function(e, c) { e = e.toString(); c = c.toString(); return e > c ? 1 : (e < c ? -1 : 0) }, string: function(e, c) { e = e.toString().toLowerCase(); c = c.toString().toLowerCase(); return e > c ? 1 : (e < c ? -1 : 0) } }, by: function(c, a) { if (!c) { return a } if (typeof a != "function") { a = dhtmlx.sort.as[a || "string"] } c = dhtmlx.Template.fromHTML(c); return function(g, e) { return a(c(g), c(e)) } }, dir: function(c, a) { if (c == "asc") { return a } return function(g, e) { return a(g, e) * -1 } } }; dhtmlx.KeyEvents = { _init: function() { dhtmlx.event(this._obj, "keypress", this._onKeyPress, this) }, _onKeyPress: function(c) { c = c || event; var a = c.which || c.keyCode; this.callEvent((this._edit_id ? "onEditKeyPress" : "onKeyPress"), [a, c.ctrlKey, c.shiftKey, c]) } }; dhtmlx.MouseEvents = { _init: function() { if (this.on_click) { dhtmlx.event(this._obj, "click", this._onClick, this); dhtmlx.event(this._obj, "contextmenu", this._onContext, this) } if (this.on_dblclick) { dhtmlx.event(this._obj, "dblclick", this._onDblClick, this) } if (this.on_mouse_move) { dhtmlx.event(this._obj, "mousemove", this._onMouse, this); dhtmlx.event(this._obj, (dhtmlx._isIE ? "mouseleave" : "mouseout"), this._onMouse, this) } }, _onClick: function(a) { return this._mouseEvent(a, this.on_click, "ItemClick") }, _onDblClick: function(a) { return this._mouseEvent(a, this.on_dblclick, "ItemDblClick") }, _onContext: function(a) { var c = dhtmlx.html.locate(a, this._id); if (c && !this.callEvent("onBeforeContextMenu", [c, a])) { return dhtmlx.html.preventEvent(a) } }, _onMouse: function(a) { if (dhtmlx._isIE) { a = document.createEventObject(event) } if (this._mouse_move_timer) { window.clearTimeout(this._mouse_move_timer) } this.callEvent("onMouseMoving", [a]); this._mouse_move_timer = window.setTimeout(dhtmlx.bind(function() { if (a.type == "mousemove") { this._onMouseMove(a) } else { this._onMouseOut(a) } }, this), 500) }, _onMouseMove: function(a) { if (!this._mouseEvent(a, this.on_mouse_move, "MouseMove")) { this.callEvent("onMouseOut", [a || event]) } }, _onMouseOut: function(a) { this.callEvent("onMouseOut", [a || event]) }, _mouseEvent: function(m, l, c) { m = m || event; var a = m.target || m.srcElement; var g = ""; var n = null; var h = false; while (a && a.parentNode) { if (!h && a.getAttribute) { n = a.getAttribute(this._id); if (n) { if (a.getAttribute("userdata")) { this.callEvent("onLocateData", [n, a, m]) } if (!this.callEvent("on" + c, [n, m, a])) { return } h = true } } g = a.className; if (g) { g = g.split(" "); g = g[0] || g[1]; if (l[g]) { return l[g].call(this, m, n || dhtmlx.html.locate(m, this._id), a) } } a = a.parentNode } return h } }; dhtmlx.Settings = { _init: function() { this._settings = this.config = {} }, define: function(c, a) { if (typeof c == "object") { return this._parseSeetingColl(c) } return this._define(c, a) }, _define: function(c, a) { dhtmlx.assert_settings.call(this, c, a); var e = this[c + "_setter"]; return this._settings[c] = e ? e.call(this, a) : a }, _parseSeetingColl: function(e) { if (e) { for (var c in e) { this._define(c, e[c]) } } }, _parseSettings: function(e, a) { var c = dhtmlx.extend({}, a); if (typeof e == "object" && !e.tagName) { dhtmlx.extend(c, e) } this._parseSeetingColl(c) }, _mergeSettings: function(a, e) { for (var c in e) { switch (typeof a[c]) { case "object": a[c] = this._mergeSettings((a[c] || {}), e[c]); break; case "undefined": a[c] = e[c]; break; default: break } } return a }, _parseContainer: function(c, a, e) { if (typeof c == "object" && !c.tagName) { c = c.container } this._obj = this.$view = dhtmlx.toNode(c); if (!this._obj && e) { this._obj = e(c) } dhtmlx.assert(this._obj, "Incorrect html container"); this._obj.className += " " + a; this._obj.onselectstart = function() { return false }; this._dataobj = this._obj }, _set_type: function(a) { if (typeof a == "object") { return this.type_setter(a) } dhtmlx.assert(this.types, "RenderStack :: Types are not defined"); dhtmlx.assert(this.types[a], "RenderStack :: Inccorect type name", a); this.type = dhtmlx.extend({}, this.types[a]); this.customize() }, customize: function(a) { if (a) { dhtmlx.extend(this.type, a) } this.type._item_start = dhtmlx.Template.fromHTML(this.template_item_start(this.type)); this.type._item_end = this.template_item_end(this.type); this.render() }, type_setter: function(a) { this._set_type(typeof a == "object" ? dhtmlx.Type.add(this, a) : a); return a }, template_setter: function(a) { return this.type_setter({ template: a }) }, css_setter: function(a) { this._obj.className += " " + a; return a } }; dhtmlx.Template = { _cache: {}, empty: function() { return "" }, setter: function(a) { return dhtmlx.Template.fromHTML(a) }, obj_setter: function(c) { var a = dhtmlx.Template.setter(c); var e = this; return function() { return a.apply(e, arguments) } }, fromHTML: function(a) { if (typeof a == "function") { return a } if (this._cache[a]) { return this._cache[a] } a = (a || "").toString(); a = a.replace(/[\r\n]+/g, "\\n"); a = a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g, '"+(obj.$1?"$2":"$3")+"'); a = a.replace(/\{common\.([^}\(]*)\}/g, '"+common.$1+"'); a = a.replace(/\{common\.([^\}\(]*)\(\)\}/g, '"+(common.$1?common.$1(obj):"")+"'); a = a.replace(/\{obj\.([^}]*)\}/g, '"+obj.$1+"'); a = a.replace(/#([a-z0-9_]+)#/gi, '"+obj.$1+"'); a = a.replace(/\{obj\}/g, '"+obj+"'); a = a.replace(/\{-obj/g, "{obj"); a = a.replace(/\{-common/g, "{common"); a = 'return "' + a + '";'; return this._cache[a] = Function("obj", "common", a) } }; dhtmlx.Type = { add: function(e, c) { if (!e.types && e.prototype.types) { e = e.prototype } if (dhtmlx.assert_enabled()) { this.assert_event(c) } var a = c.name || "default"; this._template(c); this._template(c, "edit"); this._template(c, "loading"); e.types[a] = dhtmlx.extend(dhtmlx.extend({}, (e.types[a] || this._default)), c); return a }, _default: { css: "default", template: function() { return "" }, template_edit: function() { return "" }, template_loading: function() { return "..." }, width: 150, height: 80, margin: 5, padding: 0 }, _template: function(e, a) { a = "template" + (a ? ("_" + a) : ""); var c = e[a]; if (c && (typeof c == "string")) { if (c.indexOf("->") != -1) { c = c.split("->"); switch (c[0]) { case "html": c = dhtmlx.html.getValue(c[1]).replace(/\"/g, '\\"'); break; case "http": c = new dhtmlx.ajax().sync().get(c[1], { uid: (new Date()).valueOf() }).responseText; break; default: break } } e[a] = dhtmlx.Template.fromHTML(c) } } }; dhtmlx.SingleRender = { _init: function() {}, _toHTML: function(a) { return this.type._item_start(a, this.type) + this.type.template(a, this.type) + this.type._item_end }, render: function() { if (!this.callEvent || this.callEvent("onBeforeRender", [this.data])) { if (this.data) { this._dataobj.innerHTML = this._toHTML(this.data) } if (this.callEvent) { this.callEvent("onAfterRender", []) } } } }; dhtmlx.ui.Tooltip = function(a) { this.name = "Tooltip"; if (dhtmlx.assert_enabled()) { this._assert() } if (typeof a == "string") { a = { template: a } } dhtmlx.extend(this, dhtmlx.Settings); dhtmlx.extend(this, dhtmlx.SingleRender); this._parseSettings(a, { type: "default", dy: 0, dx: 20 }); this._dataobj = this._obj = document.createElement("DIV"); this._obj.className = "dhx_tooltip"; dhtmlx.html.insertBefore(this._obj, document.body.firstChild) }; dhtmlx.ui.Tooltip.prototype = { show: function(a, c) { if (this._disabled) { return } if (this.data != a) { this.data = a; this.render(a) } this._obj.style.top = c.y + this._settings.dy + "px"; this._obj.style.left = c.x + this._settings.dx + "px"; this._obj.style.display = "block" }, hide: function() { this.data = null; this._obj.style.display = "none" }, disable: function() { this._disabled = true }, enable: function() { this._disabled = false }, types: { "default": dhtmlx.Template.fromHTML("{obj.id}") }, template_item_start: dhtmlx.Template.empty, template_item_end: dhtmlx.Template.empty }; dhtmlx.AutoTooltip = { tooltip_setter: function(c) { var a = new dhtmlx.ui.Tooltip(c); this.attachEvent("onMouseMove", function(h, g) { a.show(this.get(h), dhtmlx.html.pos(g)) }); this.attachEvent("onMouseOut", function(h, g) { a.hide() }); this.attachEvent("onMouseMoving", function(h, g) { a.hide() }); return a } }; dhtmlx.compat = function(a, c) { if (dhtmlx.compat[a]) { dhtmlx.compat[a](c) } }; if (!dhtmlx.attaches) { dhtmlx.attaches = {} } dhtmlx.attaches.attachAbstract = function(c, a) { var h = document.createElement("DIV"); h.id = "CustomObject_" + dhtmlx.uid(); h.style.width = "100%"; h.style.height = "100%"; h.cmp = "grid"; document.body.appendChild(h); this.attachObject(h.id); a.container = h.id; var g = this.vs[this.av]; g.grid = new window[c](a); g.gridId = h.id; g.gridObj = h; g.grid.setSizes = function() { if (this.resize) { this.resize() } else { this.render() } }; var e = "_viewRestore"; return this.vs[this[e]()].grid }; dhtmlx.attaches.attachDataView = function(a) { return this.attachAbstract("dhtmlXDataView", a) }; dhtmlx.attaches.attachChart = function(a) { return this.attachAbstract("dhtmlXChart", a) }; dhtmlx.compat.layout = function() {}; function dhtmlXCellObject(e, a) { this.cell = document.createElement("DIV"); this.cell.className = "dhx_cell" + (a || ""); this._idd = e; this._isCell = true; this.conf = { borders: true, idx: {}, css: a || "", idx_data: { cont: "dhx_cell_cont", pr1: "dhx_cell_progress_bar", pr2: "dhx_cell_progress_img", pr3: "dhx_cell_progress_svg", menu: "dhx_cell_menu", toolbar: "dhx_cell_toolbar", ribbon: "dhx_cell_ribbon", sb: "dhx_cell_statusbar", cover: "dhx_cell_cover" }, ofs_nodes: { t: {}, b: {} } }; this.dataNodes = {}; this.views = {}; var c = document.createElement("DIV"); c.className = "dhx_cell_cont" + this.conf.css; this.cell.appendChild(c); c = null; this._updateIdx = function() { for (var g in this.conf.idx) { this.conf.idx[g] = null; delete this.conf.idx[g] } for (var m = 0; m < this.cell.childNodes.length; m++) { var h = this.cell.childNodes[m].className; for (var g in this.conf.idx_data) { var l = new RegExp(this.conf.idx_data[g]); if (h.match(l) != null) { this.conf.idx[g] = m } } } this.callEvent("_onIdxUpdated", []) }; this._adjustAttached = function() { for (var g in this.dataNodes) { if (this.dataNodes[g] != null && typeof(this.dataNodes[g].setSizes) == "function") { this.dataNodes[g].setSizes() } } if (this.dataObj != null && typeof(this.dataObj.setSizes) == "function") { if (this.dataType == "layout" && typeof(window.dhtmlXLayoutCell) == "function" && this instanceof window.dhtmlXLayoutCell && this.dataObj._getMainInst() != this.layout._getMainInst()) { this.dataObj.setSizes(); return } this.dataObj.setSizes.apply(this.dataObj, arguments) } }; this._setSize = function(u, r, v, n, o, q, l, m) { if (this.conf.size == null) { this.conf.size = {} } if (m == null) { m = {} } var A = { left: "x", top: "y", width: "w", height: "h" }; this.conf.size.x = u; this.conf.size.y = r; this.conf.size.w = Math.max(v, 0); this.conf.size.h = Math.max(n, 0); for (var s in A) { var g = (m[s] || s); this.cell.style[g] = this.conf.size[A[s]] + "px" } this.callEvent("_onSetSize", []); if (q !== true) { this._adjustCont(o, l) } else { this._adjustAttached(o) } this._adjustProgress() }; this._adjustCont = function(o, m) { var n = this.cell.childNodes[this.conf.idx.cont]; if (typeof(window.dhtmlXLayoutCell) == "function" && this instanceof window.dhtmlXLayoutCell && this.conf.collapsed == true) { n.style.left = n.style.top = "0px"; n.style.width = n.style.height = "200px"; n = null; return } var l = 0; for (var g in this.conf.ofs_nodes.t) { var h = this.conf.ofs_nodes.t[g]; l += (h == "func" ? this[g]() : (h == true ? this.cell.childNodes[this.conf.idx[g]].offsetHeight : 0)) } var q = 0; for (var g in this.conf.ofs_nodes.b) { var h = this.conf.ofs_nodes.b[g]; q += (h == "func" ? this[g]() : (h == true ? this.cell.childNodes[this.conf.idx[g]].offsetHeight : 0)) } n.style.left = "0px"; n.style.top = l + "px"; if (this.conf.cells_cont == null) { this.conf.cells_cont = {}; n.style.width = this.cell.offsetWidth + "px"; n.style.height = Math.max(this.cell.offsetHeight - l - q, 0) + "px"; this.conf.cells_cont.w = parseInt(n.style.width) - n.offsetWidth; this.conf.cells_cont.h = parseInt(n.style.height) - n.offsetHeight } n.style.left = "0px"; n.style.top = l + "px"; n.style.width = Math.max(this.cell.offsetWidth + this.conf.cells_cont.w, 0) + "px"; n.style.height = Math.max(this.conf.size.h - l - q + this.conf.cells_cont.h, 0) + "px"; n = null; this._adjustAttached(o); if (m == "expand" && this.dataType == "editor" && this.dataObj != null) { this.dataObj._prepareContent(true) } }; this._mtbUpdBorder = function() { var h = ["menu", "toolbar", "ribbon"]; for (var m = 0; m < h.length; m++) { if (this.conf.idx[h[m]] != null) { var n = this.cell.childNodes[this.conf.idx[h[m]]]; var l = "dhx_cell_" + h[m] + "_no_borders"; var g = "dhx_cell_" + h[m] + "_def"; n.className = n.className.replace(new RegExp(this.conf.borders ? l : g), this.conf.borders ? g : l); n = null } } }; this._resetSizeState = function() { this.conf.cells_cont = null }; this.conf.view = "def"; this.conf.views_loaded = {}; this.conf.views_loaded[this.conf.view] = true; this._viewSave = function(l) { this.views[l] = { borders: this.conf.borders, ofs_nodes: { t: {}, b: {} }, url_data: this.conf.url_data, dataType: this.dataType, dataObj: this.dataObj, cellCont: [], dataNodes: {}, dataNodesCont: {} }; var m = this.cell.childNodes[this.conf.idx.cont]; while (m.childNodes.length > 0) { this.views[l].cellCont.push(m.firstChild); m.removeChild(m.firstChild) } m = null; this.dataType = null; this.dataObj = null; this.conf.url_data = null; for (var h in this.dataNodes) { for (var g in this.conf.ofs_nodes) { if (typeof(this.conf.ofs_nodes[g][h]) != "undefined") { this.views[l].ofs_nodes[g][h] = this.conf.ofs_nodes[g][h]; this.conf.ofs_nodes[g][h] = null; delete this.conf.ofs_nodes[g][h] } } this.views[l].dataNodesCont[h] = this.cell.childNodes[this.conf.idx[h]]; this.cell.removeChild(this.cell.childNodes[this.conf.idx[h]]); this.views[l].dataNodes[h] = this.dataNodes[h]; this.dataNodes[h] = null; delete this.dataNodes[h]; this._updateIdx() } this.callEvent("_onViewSave", [l]) }; this._viewRestore = function(l) { if (this.views[l] == null) { return } this.dataObj = this.views[l].dataObj; this.dataType = this.views[l].dataType; this.conf.url_data = this.views[l].url_data; for (var m = 0; m < this.views[l].cellCont.length; m++) { this.cell.childNodes[this.conf.idx.cont].appendChild(this.views[l].cellCont[m]) } for (var h in this.views[l].dataNodes) { this.dataNodes[h] = this.views[l].dataNodes[h]; if (h == "menu") { this.cell.insertBefore(this.views[l].dataNodesCont[h], this.cell.childNodes[this.conf.idx.toolbar || this.conf.idx.cont]) } if (h == "toolbar") { this.cell.insertBefore(this.views[l].dataNodesCont[h], this.cell.childNodes[this.conf.idx.cont]) } if (h == "ribbon") { this.cell.insertBefore(this.views[l].dataNodesCont[h], this.cell.childNodes[this.conf.idx.cont]) } if (h == "sb") { this.cell.appendChild(this.views[l].dataNodesCont[h]) } this._updateIdx() } for (var h in this.views[l].ofs_nodes) { for (var g in this.views[l].ofs_nodes[h]) { this.conf.ofs_nodes[h][g] = this.views[l].ofs_nodes[h][g] } } if (this.conf.borders != this.views[l].borders) { this[this.views[l].borders ? "_showBorders" : "_hideBorders"](true) } if (this.dataType == "url" && this.conf.url_data != null && this.conf.url_data.ajax == false && this.conf.url_data.post_data != null) { this.reloadURL() } this.callEvent("_onViewRestore", [l]); this._viewDelete(l) }; this._viewDelete = function(l) { if (this.views[l] == null) { return } this.views[l].borders = null; for (var h in this.views[l].ofs_nodes) { for (var g in this.views[l].ofs_nodes[h]) { this.views[l].ofs_nodes[h][g] = null } this.views[l].ofs_nodes[h] = null } this.views[l].dataType = null; this.views[l].dataObj = null; this.views[l].url_data = null; for (var m = 0; m < this.views[l].cellCont.length; m++) { this.views[l].cellCont[m] = null } this.views[l].cellCont = null; for (var h in this.views[l].dataNodes) { this.views[l].dataNodes[h] = null; this.views[l].dataNodesCont[h] = null } this.views[l].dataNodes = this.views[l].dataNodesCont = null; this.views[l] = null; delete this.views[l] }; window.dhx4._eventable(this); this._updateIdx(); return this } dhtmlXCellObject.prototype.showView = function(a) { if (this.conf.view == a) { return false } this._viewSave(this.conf.view); this._viewRestore(a); this._updateIdx(); this._adjustCont(); this.conf.view = a; var c = (typeof(this.conf.views_loaded[this.conf.view]) == "undefined"); this.conf.views_loaded[this.conf.view] = true; return c }; dhtmlXCellObject.prototype.getViewName = function() { return this.conf.view }; dhtmlXCellObject.prototype.unloadView = function(g) { if (g == this.conf.view) { var h = this.conf.unloading; this.conf.unloading = true; if (typeof(this.detachMenu) == "function") { this.detachMenu() } if (typeof(this.detachToolbar) == "function") { this.detachToolbar() } if (typeof(this.detachRibbon) == "function") { this.detachRibbon() } this.detachStatusBar(); this._detachObject(null, true); this.conf.unloading = h; if (!this.conf.unloading) { this._adjustCont(this._idd) } return } if (this.views[g] == null) { return } var e = this.views[g]; for (var c in e.dataNodes) { if (typeof(e.dataNodes[c].unload) == "function") { e.dataNodes[c].unload() } e.dataNodes[c] = null; e.dataNodesCont[c] = null } if (e.dataType == "url") { if (e.cellCont != null && e.cellCont[0] != "null") { this._detachURLEvents(e.cellCont[0]) } } else { if (e.dataObj != null) { if (typeof(e.dataObj.unload) == "function") { e.dataObj.unload() } else { if (typeof(e.dataObj.destructor) == "function") { e.dataObj.destructor() } } e.dataObj = null } } e = null; this._viewDelete(g); if (typeof(this.conf.views_loaded[g]) != "undefined") { delete this.conf.views_loaded[g] } }; dhtmlXCellObject.prototype.getId = function() { return this._idd }; dhtmlXCellObject.prototype.progressOn = function() { if (this.conf.progress == true) { return } this.conf.progress = true; var c = document.createElement("DIV"); c.className = this.conf.idx_data.pr1; var a = document.createElement("DIV"); if (this.conf.skin == "material" && (window.dhx4.isFF || window.dhx4.isChrome || window.dhx4.isOpera || window.dhx4.isEdge)) { a.className = this.conf.idx_data.pr3; a.innerHTML = '' } else { a.className = this.conf.idx_data.pr2 } if (this.conf.idx.cover != null) { this.cell.insertBefore(a, this.cell.childNodes[this.conf.idx.cover]) } else { this.cell.appendChild(a) } this.cell.insertBefore(c, a); c = a = null; this._updateIdx(); this._adjustProgress() }; dhtmlXCellObject.prototype.progressOff = function() { if (this.conf.progress != true) { return } for (var c in { pr3: 3, pr2: 2, pr1: 1 }) { var e = this.cell.childNodes[this.conf.idx[c]]; if (e != null) { e.parentNode.removeChild(e) } e = null } this.conf.progress = false; this._updateIdx() }; dhtmlXCellObject.prototype._adjustProgress = function() { if (this.conf.idx.pr1 == null) { return } if (!this.conf.pr) { this.conf.pr = {} } var c = this.cell.childNodes[this.conf.idx.pr1]; var a = this.cell.childNodes[this.conf.idx.pr2] || this.cell.childNodes[this.conf.idx.pr3]; if (!this.conf.pr.ofs) { a.style.width = c.offsetWidth + "px"; a.style.height = c.offsetHeight + "px"; this.conf.pr.ofs = { w: a.offsetWidth - a.clientWidth, h: a.offsetHeight - a.clientHeight } } a.style.width = c.offsetWidth - this.conf.pr.ofs.w + "px"; a.style.height = c.offsetHeight - this.conf.pr.ofs.h + "px"; c = a = null }; dhtmlXCellObject.prototype._showCellCover = function() { if (this.conf.cover == true) { return } this.conf.cover = true; var a = document.createElement("DIV"); a.className = this.conf.idx_data.cover; this.cell.appendChild(a); a = null; this._updateIdx() }; dhtmlXCellObject.prototype._hideCellCover = function() { if (this.conf.cover != true) { return } this.cell.removeChild(this.cell.childNodes[this.conf.idx.cover]); this._updateIdx(); this.conf.cover = false }; dhtmlXCellObject.prototype._showBorders = function(a) { if (this.conf.borders) { return } this.conf.borders = true; this.cell.childNodes[this.conf.idx.cont].className = "dhx_cell_cont" + this.conf.css; this.conf.cells_cont = null; this._mtbUpdBorder(); this.callEvent("_onBorderChange", [true]); if (a !== true) { this._adjustCont(this._idd) } }; dhtmlXCellObject.prototype._hideBorders = function(a) { if (!this.conf.borders) { return } this.conf.borders = false; this.cell.childNodes[this.conf.idx.cont].className = "dhx_cell_cont" + this.conf.css + " dhx_cell_cont_no_borders"; this.conf.cells_cont = null; this._mtbUpdBorder(); this.callEvent("_onBorderChange", [false]); if (a !== true) { this._adjustCont(this._idd) } }; dhtmlXCellObject.prototype._getWidth = function() { return this.cell.offsetWidth }; dhtmlXCellObject.prototype._getHeight = function() { return this.cell.offsetHeight }; dhtmlXCellObject.prototype.showInnerScroll = function() { this.cell.childNodes[this.conf.idx.cont].style.overflow = "auto" }; dhtmlXCellObject.prototype._unload = function() { this.conf.unloading = true; this.callEvent("_onCellUnload", []); this.progressOff(); this.unloadView(this.conf.view); this.dataNodes = null; this.cell.parentNode.removeChild(this.cell); this.cell = null; window.dhx4._eventable(this, "clear"); for (var c in this.views) { this.unloadView(c) } this.conf = null; for (var c in this) { this[c] = null } }; dhtmlXCellObject.prototype.attachObject = function(g, e) { if (window.dhx4.s2b(e) && !(typeof(window.dhtmlXWindowsCell) == "function" && this instanceof window.dhtmlXWindowsCell)) { e = false } if (typeof(g) == "string") { g = document.getElementById(g) } if (g.parentNode == this.cell.childNodes[this.conf.idx.cont]) { g = null; return } if (e) { g.style.display = ""; var a = g.offsetWidth; var c = g.offsetHeight } this._attachObject(g); this.dataType = "obj"; g.style.display = ""; g = null; if (e) { this._adjustByCont(a, c) } }; dhtmlXCellObject.prototype.appendObject = function(a) { if (typeof(a) == "string") { a = document.getElementById(a) } if (a.parentNode == this.cell.childNodes[this.conf.idx.cont]) { a = null; return } if (!this.conf.append_mode) { this.cell.childNodes[this.conf.idx.cont].style.overflow = "auto"; this.conf.append_mode = true } this._attachObject(a, null, null, true); this.dataType = "obj"; a.style.display = ""; a = null }; dhtmlXCellObject.prototype.detachObject = function(c, a) { this._detachObject(null, c, a) }; dhtmlXCellObject.prototype.getAttachedStatusBar = function() { return this.dataNodes.sb }; dhtmlXCellObject.prototype.getAttachedObject = function() { if (this.dataType == "obj" || this.dataType == "url" || this.dataType == "url-ajax") { return this.cell.childNodes[this.conf.idx.cont].firstChild } else { return this.dataObj } }; dhtmlXCellObject.prototype.attachURL = function(c, s, g) { if (g == true) { g = {} } var h = (typeof(g) != "undefined" && g != false && g != null); if (this.conf.url_data == null) { this.conf.url_data = {} } this.conf.url_data.url = c; this.conf.url_data.ajax = (s == true); this.conf.url_data.post_data = (g == true ? {} : (g || null)); if (this.conf.url_data.xml_doc != null) { try { this.conf.url_data.xml_doc.xmlDoc.abort() } catch (n) {} this.conf.url_data.xml_doc.xmlDoc = null; this.conf.url_data.xml_doc = null } if (s == true) { var r = this; if (h) { var l = ""; for (var q in g) { l += "&" + encodeURIComponent(q) + "=" + encodeURIComponent(g[q]) } this.conf.url_data.xml_doc = dhx4.ajax.post(c, l, function(a) { if (r.attachHTMLString != null && typeof(a.xmlDoc.responseText) == "string") { r.attachHTMLString("