").appendTo(tooltip),
id = tooltip.uniqueId().attr("id");
this._addClass(content, "ui-tooltip-content");
this._addClass(tooltip, "ui-tooltip", "ui-widget ui-widget-content");
tooltip.appendTo(this._appendTo(element));
return this.tooltips[id] = {
element: element,
tooltip: tooltip
};
},
_find: function(target) {
var id = target.data("ui-tooltip-id");
return id ? this.tooltips[id] : null;
},
_removeTooltip: function(tooltip) {
// Clear the interval for delayed tracking tooltips
clearInterval(this.delayedShow);
tooltip.remove();
delete this.tooltips[tooltip.attr("id")];
},
_appendTo: function(target) {
var element = target.closest(".ui-front, dialog");
if (!element.length) {
element = this.document[0].body;
}
return element;
},
_destroy: function() {
var that = this;
// Close open tooltips
$.each(this.tooltips, function(id, tooltipData) {
// Delegate to close method to handle common cleanup
var event = $.Event("blur"),
element = tooltipData.element;
event.target = event.currentTarget = element[0];
that.close(event, true);
// Remove immediately; destroying an open tooltip doesn't use the
// hide animation
$("#" + id).remove();
// Restore the title
if (element.data("ui-tooltip-title")) {
// If the title attribute has changed since open(), don't restore
if (!element.attr("title")) {
element.attr("title", element.data("ui-tooltip-title"));
}
element.removeData("ui-tooltip-title");
}
});
this.liveRegion.remove();
}
});
// DEPRECATED
// TODO: Switch return back to widget declaration at top of file when this is removed
if ($.uiBackCompat !== false) {
// Backcompat for tooltipClass option
$.widget("ui.tooltip", $.ui.tooltip, {
options: {
tooltipClass: null
},
_tooltip: function() {
var tooltipData = this._superApply(arguments);
if (this.options.tooltipClass) {
tooltipData.tooltip.addClass(this.options.tooltipClass);
}
return tooltipData;
}
});
}
var widgetsTooltip = $.ui.tooltip;
});
! function(a) {
a.jGrowl = function(b, c) {
0 === a("#jGrowl").length && a('
').addClass(c && c.position ? c.position : a.jGrowl.defaults.position).appendTo(c && c.appendTo ? c.appendTo : a.jGrowl.defaults.appendTo), a("#jGrowl").jGrowl(b, c)
}, a.fn.jGrowl = function(b, c) {
if (void 0 === c && a.isPlainObject(b) && (c = b, b = c.message), a.isFunction(this.each)) {
var d = arguments;
return this.each(function() {
void 0 === a(this).data("jGrowl.instance") && (a(this).data("jGrowl.instance", a.extend(new a.fn.jGrowl, {
notifications: [],
element: null,
interval: null
})), a(this).data("jGrowl.instance").startup(this)), a.isFunction(a(this).data("jGrowl.instance")[b]) ? a(this).data("jGrowl.instance")[b].apply(a(this).data("jGrowl.instance"), a.makeArray(d).slice(1)) : a(this).data("jGrowl.instance").create(b, c)
})
}
}, a.extend(a.fn.jGrowl.prototype, {
defaults: {
pool: 0,
header: "",
group: "",
sticky: !1,
position: "top-right",
appendTo: "body",
glue: "after",
theme: "default",
themeState: "highlight",
corners: "10px",
check: 250,
life: 3e3,
closeDuration: "normal",
openDuration: "normal",
easing: "swing",
closer: !0,
closeTemplate: "×",
closerTemplate: "
[ close all ]
",
log: function() {},
beforeOpen: function() {},
afterOpen: function() {},
open: function() {},
beforeClose: function() {},
close: function() {},
click: function() {},
animateOpen: {
opacity: "show"
},
animateClose: {
opacity: "hide"
}
},
notifications: [],
element: null,
interval: null,
create: function(b, c) {
var d = a.extend({}, this.defaults, c);
"undefined" != typeof d.speed && (d.openDuration = d.speed, d.closeDuration = d.speed), this.notifications.push({
message: b,
options: d
}), d.log.apply(this.element, [this.element, b, d])
},
render: function(b) {
var c = this,
d = b.message,
e = b.options;
e.themeState = "" === e.themeState ? "" : "ui-state-" + e.themeState;
var f = a("
").addClass("jGrowl-notification alert " + e.themeState + " ui-corner-all" + (void 0 !== e.group && "" !== e.group ? " " + e.group : "")).append(a("
").addClass("jGrowl-close").html(e.closeTemplate)).append(a("
").addClass("jGrowl-header").html(e.header)).append(a("
").addClass("jGrowl-message").html(d)).data("jGrowl", e).addClass(e.theme).children(".jGrowl-close").bind("click.jGrowl", function() {
return a(this).parent().trigger("jGrowl.beforeClose"), !1
}).parent();
a(f).bind("mouseover.jGrowl", function() {
a(".jGrowl-notification", c.element).data("jGrowl.pause", !0)
}).bind("mouseout.jGrowl", function() {
a(".jGrowl-notification", c.element).data("jGrowl.pause", !1)
}).bind("jGrowl.beforeOpen", function() {
e.beforeOpen.apply(f, [f, d, e, c.element]) !== !1 && a(this).trigger("jGrowl.open")
}).bind("jGrowl.open", function() {
e.open.apply(f, [f, d, e, c.element]) !== !1 && ("after" == e.glue ? a(".jGrowl-notification:last", c.element).after(f) : a(".jGrowl-notification:first", c.element).before(f), a(this).animate(e.animateOpen, e.openDuration, e.easing, function() {
a.support.opacity === !1 && this.style.removeAttribute("filter"), null !== a(this).data("jGrowl") && "undefined" != typeof a(this).data("jGrowl") && (a(this).data("jGrowl").created = new Date), a(this).trigger("jGrowl.afterOpen")
}))
}).bind("jGrowl.afterOpen", function() {
e.afterOpen.apply(f, [f, d, e, c.element])
}).bind("click", function() {
e.click.apply(f, [f.message, e, c.element])
}).bind("jGrowl.beforeClose", function() {
e.beforeClose.apply(f, [f, d, e, c.element]) !== !1 && a(this).trigger("jGrowl.close")
}).bind("jGrowl.close", function() {
a(this).data("jGrowl.pause", !0), a(this).animate(e.animateClose, e.closeDuration, e.easing, function() {
a.isFunction(e.close) ? e.close.apply(f, [f, d, e, c.element]) !== !1 && a(this).remove() : a(this).remove()
})
}).trigger("jGrowl.beforeOpen"), "" !== e.corners && void 0 !== a.fn.corner && a(f).corner(e.corners), a(".jGrowl-notification:parent", c.element).length > 1 && 0 === a(".jGrowl-closer", c.element).length && this.defaults.closer !== !1 && a(this.defaults.closerTemplate).addClass("jGrowl-closer " + this.defaults.themeState + " ui-corner-all").addClass(this.defaults.theme).appendTo(c.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing).bind("click.jGrowl", function() {
a(this).siblings().trigger("jGrowl.beforeClose"), a.isFunction(c.defaults.closer) && c.defaults.closer.apply(a(this).parent()[0], [a(this).parent()[0]])
})
},
update: function() {
a(this.element).find(".jGrowl-notification:parent").each(function() {
void 0 !== a(this).data("jGrowl") && void 0 !== a(this).data("jGrowl").created && a(this).data("jGrowl").created.getTime() + parseInt(a(this).data("jGrowl").life, 10) < (new Date).getTime() && a(this).data("jGrowl").sticky !== !0 && (void 0 === a(this).data("jGrowl.pause") || a(this).data("jGrowl.pause") !== !0) && a(this).trigger("jGrowl.beforeClose")
}), this.notifications.length > 0 && (0 === this.defaults.pool || a(this.element).find(".jGrowl-notification:parent").length < this.defaults.pool) && this.render(this.notifications.shift()), a(this.element).find(".jGrowl-notification:parent").length < 2 && a(this.element).find(".jGrowl-closer").animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing, function() {
a(this).remove()
})
},
startup: function(b) {
this.element = a(b).addClass("jGrowl").append('
'), this.interval = setInterval(function() {
a(b).data("jGrowl.instance").update()
}, parseInt(this.defaults.check, 10))
},
shutdown: function() {
a(this.element).removeClass("jGrowl").find(".jGrowl-notification").trigger("jGrowl.close").parent().empty(), clearInterval(this.interval)
},
close: function() {
a(this.element).find(".jGrowl-notification").each(function() {
a(this).trigger("jGrowl.beforeClose")
})
}
}), a.jGrowl.defaults = a.fn.jGrowl.prototype.defaults
}(jQuery);
var $jscomp = {
scope: {},
findInternal: function(a, l, d) {
a instanceof String && (a = String(a));
for (var p = a.length, h = 0; h < p; h++) {
var b = a[h];
if (l.call(d, b, h, a)) return {
i: h,
v: b
}
}
return {
i: -1,
v: void 0
}
}
};
$jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, l, d) {
if (d.get || d.set) throw new TypeError("ES3 does not support getters and setters.");
a != Array.prototype && a != Object.prototype && (a[l] = d.value)
};
$jscomp.getGlobal = function(a) {
return "undefined" != typeof window && window === a ? a : "undefined" != typeof global && null != global ? global : a
};
$jscomp.global = $jscomp.getGlobal(this);
$jscomp.polyfill = function(a, l, d, p) {
if (l) {
d = $jscomp.global;
a = a.split(".");
for (p = 0; p < a.length - 1; p++) {
var h = a[p];
h in d || (d[h] = {});
d = d[h]
}
a = a[a.length - 1];
p = d[a];
l = l(p);
l != p && null != l && $jscomp.defineProperty(d, a, {
configurable: !0,
writable: !0,
value: l
})
}
};
$jscomp.polyfill("Array.prototype.find", function(a) {
return a ? a : function(a, d) {
return $jscomp.findInternal(this, a, d).v
}
}, "es6-impl", "es3");
(function(a, l, d) {
"function" === typeof define && define.amd ? define(["jquery"], a) : "object" === typeof exports ? module.exports = a(require("jquery")) : a(l || d)
})(function(a) {
var l = function(b, e, f) {
var c = {
invalid: [],
getCaret: function() {
try {
var a, r = 0,
g = b.get(0),
e = document.selection,
f = g.selectionStart;
if (e && -1 === navigator.appVersion.indexOf("MSIE 10")) a = e.createRange(), a.moveStart("character", -c.val().length), r = a.text.length;
else if (f || "0" === f) r = f;
return r
} catch (C) {}
},
setCaret: function(a) {
try {
if (b.is(":focus")) {
var c,
g = b.get(0);
g.setSelectionRange ? g.setSelectionRange(a, a) : (c = g.createTextRange(), c.collapse(!0), c.moveEnd("character", a), c.moveStart("character", a), c.select())
}
} catch (B) {}
},
events: function() {
b.on("keydown.mask", function(a) {
b.data("mask-keycode", a.keyCode || a.which);
b.data("mask-previus-value", b.val());
b.data("mask-previus-caret-pos", c.getCaret());
c.maskDigitPosMapOld = c.maskDigitPosMap
}).on(a.jMaskGlobals.useInput ? "input.mask" : "keyup.mask", c.behaviour).on("paste.mask drop.mask", function() {
setTimeout(function() {
b.keydown().keyup()
},
100)
}).on("change.mask", function() {
b.data("changed", !0)
}).on("blur.mask", function() {
d === c.val() || b.data("changed") || b.trigger("change");
b.data("changed", !1)
}).on("blur.mask", function() {
d = c.val()
}).on("focus.mask", function(b) {
!0 === f.selectOnFocus && a(b.target).select()
}).on("focusout.mask", function() {
f.clearIfNotMatch && !h.test(c.val()) && c.val("")
})
},
getRegexMask: function() {
for (var a = [], b, c, f, n, d = 0; d < e.length; d++)(b = m.translation[e.charAt(d)]) ? (c = b.pattern.toString().replace(/.{1}$|^.{1}/g, ""), f = b.optional,
(b = b.recursive) ? (a.push(e.charAt(d)), n = {
digit: e.charAt(d),
pattern: c
}) : a.push(f || b ? c + "?" : c)) : a.push(e.charAt(d).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
a = a.join("");
n && (a = a.replace(new RegExp("(" + n.digit + "(.*" + n.digit + ")?)"), "($1)?").replace(new RegExp(n.digit, "g"), n.pattern));
return new RegExp(a)
},
destroyEvents: function() {
b.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask "))
},
val: function(a) {
var c = b.is("input") ? "val" : "text";
if (0 < arguments.length) {
if (b[c]() !== a) b[c](a);
c = b
} else c = b[c]();
return c
},
calculateCaretPosition: function() {
var a = b.data("mask-previus-value") || "",
e = c.getMasked(),
g = c.getCaret();
if (a !== e) {
var f = b.data("mask-previus-caret-pos") || 0,
e = e.length,
d = a.length,
m = a = 0,
h = 0,
l = 0,
k;
for (k = g; k < e && c.maskDigitPosMap[k]; k++) m++;
for (k = g - 1; 0 <= k && c.maskDigitPosMap[k]; k--) a++;
for (k = g - 1; 0 <= k; k--) c.maskDigitPosMap[k] && h++;
for (k = f - 1; 0 <= k; k--) c.maskDigitPosMapOld[k] && l++;
g > d ? g = 10 * e : f >= g && f !== d ? c.maskDigitPosMapOld[g] || (f = g, g = g - (l - h) - a, c.maskDigitPosMap[g] && (g = f)) : g > f &&
(g = g + (h - l) + m)
}
return g
},
behaviour: function(f) {
f = f || window.event;
c.invalid = [];
var e = b.data("mask-keycode");
if (-1 === a.inArray(e, m.byPassKeys)) {
var e = c.getMasked(),
g = c.getCaret();
setTimeout(function() {
c.setCaret(c.calculateCaretPosition())
}, a.jMaskGlobals.keyStrokeCompensation);
c.val(e);
c.setCaret(g);
return c.callbacks(f)
}
},
getMasked: function(a, b) {
var g = [],
d = void 0 === b ? c.val() : b + "",
n = 0,
h = e.length,
q = 0,
l = d.length,
k = 1,
r = "push",
p = -1,
t = 0,
y = [],
v, z;
f.reverse ? (r = "unshift", k = -1, v = 0, n = h - 1, q = l - 1, z = function() {
return -1 <
n && -1 < q
}) : (v = h - 1, z = function() {
return n < h && q < l
});
for (var A; z();) {
var x = e.charAt(n),
w = d.charAt(q),
u = m.translation[x];
if (u) w.match(u.pattern) ? (g[r](w), u.recursive && (-1 === p ? p = n : n === v && n !== p && (n = p - k), v === p && (n -= k)), n += k) : w === A ? (t--, A = void 0) : u.optional ? (n += k, q -= k) : u.fallback ? (g[r](u.fallback), n += k, q -= k) : c.invalid.push({
p: q,
v: w,
e: u.pattern
}), q += k;
else {
if (!a) g[r](x);
w === x ? (y.push(q), q += k) : (A = x, y.push(q + t), t++);
n += k
}
}
d = e.charAt(v);
h !== l + 1 || m.translation[d] || g.push(d);
g = g.join("");
c.mapMaskdigitPositions(g,
y, l);
return g
},
mapMaskdigitPositions: function(a, b, e) {
a = f.reverse ? a.length - e : 0;
c.maskDigitPosMap = {};
for (e = 0; e < b.length; e++) c.maskDigitPosMap[b[e] + a] = 1
},
callbacks: function(a) {
var h = c.val(),
g = h !== d,
m = [h, a, b, f],
q = function(a, b, c) {
"function" === typeof f[a] && b && f[a].apply(this, c)
};
q("onChange", !0 === g, m);
q("onKeyPress", !0 === g, m);
q("onComplete", h.length === e.length, m);
q("onInvalid", 0 < c.invalid.length, [h, a, b, c.invalid, f])
}
};
b = a(b);
var m = this,
d = c.val(),
h;
e = "function" === typeof e ? e(c.val(), void 0, b, f) : e;
m.mask =
e;
m.options = f;
m.remove = function() {
var a = c.getCaret();
m.options.placeholder && b.removeAttr("placeholder");
b.data("mask-maxlength") && b.removeAttr("maxlength");
c.destroyEvents();
c.val(m.getCleanVal());
c.setCaret(a);
return b
};
m.getCleanVal = function() {
return c.getMasked(!0)
};
m.getMaskedVal = function(a) {
return c.getMasked(!1, a)
};
m.init = function(d) {
d = d || !1;
f = f || {};
m.clearIfNotMatch = a.jMaskGlobals.clearIfNotMatch;
m.byPassKeys = a.jMaskGlobals.byPassKeys;
m.translation = a.extend({}, a.jMaskGlobals.translation, f.translation);
m = a.extend(!0, {}, m, f);
h = c.getRegexMask();
if (d) c.events(), c.val(c.getMasked());
else {
f.placeholder && b.attr("placeholder", f.placeholder);
b.data("mask") && b.attr("autocomplete", "off");
d = 0;
for (var l = !0; d < e.length; d++) {
var g = m.translation[e.charAt(d)];
if (g && g.recursive) {
l = !1;
break
}
}
l && b.attr("maxlength", e.length).data("mask-maxlength", !0);
c.destroyEvents();
c.events();
d = c.getCaret();
c.val(c.getMasked());
c.setCaret(d)
}
};
m.init(!b.is("input"))
};
a.maskWatchers = {};
var d = function() {
var b = a(this),
e = {},
f = b.attr("data-mask");
b.attr("data-mask-reverse") && (e.reverse = !0);
b.attr("data-mask-clearifnotmatch") && (e.clearIfNotMatch = !0);
"true" === b.attr("data-mask-selectonfocus") && (e.selectOnFocus = !0);
if (p(b, f, e)) return b.data("mask", new l(this, f, e))
},
p = function(b, e, f) {
f = f || {};
var c = a(b).data("mask"),
d = JSON.stringify;
b = a(b).val() || a(b).text();
try {
return "function" === typeof e && (e = e(b)), "object" !== typeof c || d(c.options) !== d(f) || c.mask !== e
} catch (t) {}
},
h = function(a) {
var b = document.createElement("div"),
d;
a = "on" + a;
d = a in b;
d || (b.setAttribute(a,
"return;"), d = "function" === typeof b[a]);
return d
};
a.fn.mask = function(b, d) {
d = d || {};
var e = this.selector,
c = a.jMaskGlobals,
h = c.watchInterval,
c = d.watchInputs || c.watchInputs,
t = function() {
if (p(this, b, d)) return a(this).data("mask", new l(this, b, d))
};
a(this).each(t);
e && "" !== e && c && (clearInterval(a.maskWatchers[e]), a.maskWatchers[e] = setInterval(function() {
a(document).find(e).each(t)
}, h));
return this
};
a.fn.masked = function(a) {
return this.data("mask").getMaskedVal(a)
};
a.fn.unmask = function() {
clearInterval(a.maskWatchers[this.selector]);
delete a.maskWatchers[this.selector];
return this.each(function() {
var b = a(this).data("mask");
b && b.remove().removeData("mask")
})
};
a.fn.cleanVal = function() {
return this.data("mask").getCleanVal()
};
a.applyDataMask = function(b) {
b = b || a.jMaskGlobals.maskElements;
(b instanceof a ? b : a(b)).filter(a.jMaskGlobals.dataMaskAttr).each(d)
};
h = {
maskElements: "input,td,span,div",
dataMaskAttr: "*[data-mask]",
dataMask: !0,
watchInterval: 300,
watchInputs: !0,
keyStrokeCompensation: 10,
useInput: !/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent) &&
h("input"),
watchDataMask: !1,
byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91],
translation: {
0: {
pattern: /\d/
},
9: {
pattern: /\d/,
optional: !0
},
"#": {
pattern: /\d/,
recursive: !0
},
A: {
pattern: /[a-zA-Z0-9]/
},
S: {
pattern: /[a-zA-Z]/
}
}
};
a.jMaskGlobals = a.jMaskGlobals || {};
h = a.jMaskGlobals = a.extend(!0, {}, h, a.jMaskGlobals);
h.dataMask && a.applyDataMask();
setInterval(function() {
a.jMaskGlobals.watchDataMask && a.applyDataMask()
}, h.watchInterval)
}, window.jQuery, window.Zepto);
if (!window.dhtmlx)
window.dhtmlx = {};
(function() {
var _dhx_msg_cfg = null;
function callback(config, result) {
var usercall = config.callback;
modality(false);
config.box.parentNode.removeChild(config.box);
_dhx_msg_cfg = config.box = null;
if (usercall)
usercall(result);
}
function modal_key(e) {
if (_dhx_msg_cfg) {
e = e || event;
var code = e.which || event.keyCode;
if (dhtmlx.message.keyboard) {
if (code == 13 || code == 32)
callback(_dhx_msg_cfg, true);
if (code == 27)
callback(_dhx_msg_cfg, false);
}
if (e.preventDefault)
e.preventDefault();
return !(e.cancelBubble = true);
}
}
if (document.attachEvent)
document.attachEvent("onkeydown", modal_key);
else
document.addEventListener("keydown", modal_key, true);
function modality(mode) {
if (!modality.cover) {
modality.cover = document.createElement("DIV");
//necessary for IE only
modality.cover.onkeydown = modal_key;
modality.cover.className = "dhx_modal_cover";
document.body.appendChild(modality.cover);
}
var height = document.body.scrollHeight;
modality.cover.style.display = mode ? "inline-block" : "none";
}
function button(text, result) {
return "";
}
function info(text) {
if (!t.area) {
t.area = document.createElement("DIV");
t.area.className = "dhtmlx_message_area";
t.area.style[t.position] = "5px";
document.body.appendChild(t.area);
}
t.hide(text.id);
var message = document.createElement("DIV");
message.innerHTML = "
" + text.text + "
";
message.className = "dhtmlx-info dhtmlx-" + text.type;
message.onclick = function() {
t.hide(text.id);
text = null;
};
if (t.position == "bottom" && t.area.firstChild)
t.area.insertBefore(message, t.area.firstChild);
else
t.area.appendChild(message);
if (text.expire > 0)
t.timers[text.id] = window.setTimeout(function() {
t.hide(text.id);
}, text.expire);
t.pull[text.id] = message;
message = null;
return text.id;
}
function _boxStructure(config, ok, cancel) {
var box = document.createElement("DIV");
box.className = " dhtmlx_modal_box dhtmlx-" + config.type;
box.setAttribute("dhxbox", 1);
var inner = '';
if (config.width)
box.style.width = config.width;
if (config.height)
box.style.height = config.height;
if (config.title)
inner += '';
inner += '';
box.innerHTML = inner;
if (config.content) {
var node = config.content;
if (typeof node == "string")
node = document.getElementById(node);
if (node.style.display == 'none')
node.style.display = "";
box.childNodes[config.title ? 1 : 0].appendChild(node);
}
box.onclick = function(e) {
e = e || event;
var source = e.target || e.srcElement;
if (!source.className) source = source.parentNode;
if (source.className == "dhtmlx_popup_button") {
var result = source.getAttribute("result");
result = (result == "true") || (result == "false" ? false : result);
callback(config, result);
}
};
config.box = box;
if (ok || cancel)
_dhx_msg_cfg = config;
return box;
}
function _createBox(config, ok, cancel) {
var box = config.tagName ? config : _boxStructure(config, ok, cancel);
if (!config.hidden)
modality(true);
document.body.appendChild(box);
var x = config.left || Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));
var y = config.top || Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));
if (config.position == "top")
box.style.top = "-3px";
else
box.style.top = y + 'px';
box.style.left = x + 'px';
//necessary for IE only
box.onkeydown = modal_key;
box.focus();
if (config.hidden)
dhtmlx.modalbox.hide(box);
return box;
}
function alertPopup(config) {
return _createBox(config, true, false);
}
function confirmPopup(config) {
return _createBox(config, true, true);
}
function boxPopup(config) {
return _createBox(config);
}
function box_params(text, type, callback) {
if (typeof text != "object") {
if (typeof type == "function") {
callback = type;
type = "";
}
text = {
text: text,
type: type,
callback: callback
};
}
return text;
}
function params(text, type, expire, id) {
if (typeof text != "object")
text = {
text: text,
type: type,
expire: expire,
id: id
};
text.id = text.id || t.uid();
text.expire = text.expire || t.expire;
return text;
}
dhtmlx.alert = function() {
var text = box_params.apply(this, arguments);
text.type = text.type || "confirm";
return alertPopup(text);
};
dhtmlx.confirm = function() {
var text = box_params.apply(this, arguments);
text.type = text.type || "alert";
return confirmPopup(text);
};
dhtmlx.modalbox = function() {
var text = box_params.apply(this, arguments);
text.type = text.type || "alert";
return boxPopup(text);
};
dhtmlx.modalbox.hide = function(node) {
while (node && node.getAttribute && !node.getAttribute("dhxbox"))
node = node.parentNode;
if (node) {
node.parentNode.removeChild(node);
modality(false);
}
};
var t = dhtmlx.message = function(text, type, expire, id) {
text = params.apply(this, arguments);
text.type = text.type || "info";
var subtype = text.type.split("-")[0];
switch (subtype) {
case "alert":
return alertPopup(text);
case "confirm":
return confirmPopup(text);
case "modalbox":
return boxPopup(text);
default:
return info(text);
break;
}
};
t.seed = (new Date()).valueOf();
t.uid = function() {
return t.seed++;
};
t.expire = 4000;
t.keyboard = true;
t.position = "top";
t.pull = {};
t.timers = {};
t.hideAll = function() {
for (var key in t.pull)
t.hide(key);
};
t.hide = function(id) {
var obj = t.pull[id];
if (obj && obj.parentNode) {
window.setTimeout(function() {
obj.parentNode.removeChild(obj);
obj = null;
}, 2000);
obj.className += " hidden";
if (t.timers[id])
window.clearTimeout(t.timers[id]);
delete t.pull[id];
}
};
})();