Created
December 8, 2019 16:34
-
-
Save makew0rld/965280d46d07b74a96ef007e1164d944 to your computer and use it in GitHub Desktop.
Taken from my HP Envy 4520 printer's webpage, at <IP>/framework/Unified.js - then formatted
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! (C) Copyright 2010, Hewlett Packard. All Rights Reserved. */ ; | |
if (typeof frameWorkObj === "undefined") { | |
frameWorkObj = {} | |
} | |
frameWorkObj.loadCss = function(a) { | |
document.writeln("<link href='" + a + "' rel='stylesheet' type='text/css' />") | |
}; | |
frameWorkObj.loadScript = function(a) { | |
document.writeln("<script src='" + a + "' type='text/javascript'><\/script>") | |
}; | |
if (frameWorkObj.checkJsDependencies === undefined) { | |
frameWorkObj.checkJsDependencies = true | |
}(function() { | |
var b = navigator.userAgent.toLowerCase(); | |
var a = /msie/.test(b) && !(/opera/.test(b)); | |
if (a) { | |
document.writeln("<!--[if lt IE 10]>"); | |
frameWorkObj.loadCss("/styles/ie.css"); | |
document.writeln("<![endif]-->"); | |
document.writeln("<!--[if lt IE 8]>"); | |
frameWorkObj.loadCss("/styles/ie7.css"); | |
document.writeln("<![endif]-->") | |
} | |
})(); | |
frameWorkObj.theme = "theme-gray"; | |
if (frameWorkObj.theme == "theme-none") { | |
frameWorkObj.theme = "" | |
} | |
frameWorkObj.theatrePgName = "pgTheatre"; | |
frameWorkObj.debugFlag = "" != ""; | |
(function() { | |
/*! | |
* jQuery 1.2.6 - New Wave Javascript | |
* | |
* Copyright (c) 2008 John Resig (jquery.com) | |
* Dual licensed under the MIT (MIT-LICENSE.txt) | |
* and GPL (GPL-LICENSE.txt) licenses. | |
* | |
* $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ | |
* $Rev: 5685 $ | |
*/ | |
; | |
var _jQuery = window.jQuery, | |
_$ = window.$; | |
var jQuery = window.jQuery = window.$ = function(selector, context) { | |
return new jQuery.fn.init(selector, context) | |
}; | |
var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, | |
isSimple = /^.[^:#\[\.]*$/, | |
undefined; | |
jQuery.fn = jQuery.prototype = { | |
init: function(selector, context) { | |
selector = selector || document; | |
if (selector.nodeType) { | |
this[0] = selector; | |
this.length = 1; | |
return this | |
} | |
if (typeof selector == "string") { | |
var match = quickExpr.exec(selector); | |
if (match && (match[1] || !context)) { | |
if (match[1]) { | |
selector = jQuery.clean([match[1]], context) | |
} else { | |
var elem = document.getElementById(match[3]); | |
if (elem) { | |
if (elem.id != match[3]) { | |
return jQuery().find(selector) | |
} | |
return jQuery(elem) | |
} | |
selector = [] | |
} | |
} else { | |
return jQuery(context).find(selector) | |
} | |
} else { | |
if (jQuery.isFunction(selector)) { | |
return jQuery(document)[jQuery.fn.ready ? "ready" : "load"](selector) | |
} | |
} | |
return this.setArray(jQuery.makeArray(selector)) | |
}, | |
jquery: "1.2.6", | |
size: function() { | |
return this.length | |
}, | |
length: 0, | |
get: function(num) { | |
return num == undefined ? jQuery.makeArray(this) : this[num] | |
}, | |
pushStack: function(elems) { | |
var ret = jQuery(elems); | |
ret.prevObject = this; | |
return ret | |
}, | |
setArray: function(elems) { | |
this.length = 0; | |
Array.prototype.push.apply(this, elems); | |
return this | |
}, | |
each: function(callback, args) { | |
return jQuery.each(this, callback, args) | |
}, | |
index: function(elem) { | |
var ret = -1; | |
return jQuery.inArray(elem && elem.jquery ? elem[0] : elem, this) | |
}, | |
attr: function(name, value, type) { | |
var options = name; | |
if (name.constructor == String) { | |
if (value === undefined) { | |
return this[0] && jQuery[type || "attr"](this[0], name) | |
} else { | |
options = {}; | |
options[name] = value | |
} | |
} | |
return this.each(function(i) { | |
for (name in options) { | |
jQuery.attr(type ? this.style : this, name, jQuery.prop(this, options[name], type, i, name)) | |
} | |
}) | |
}, | |
css: function(key, value) { | |
if ((key == "width" || key == "height") && parseFloat(value) < 0) { | |
value = undefined | |
} | |
return this.attr(key, value, "curCSS") | |
}, | |
text: function(text) { | |
if (typeof text != "object" && text != null) { | |
return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text)) | |
} | |
var ret = ""; | |
jQuery.each(text || this, function() { | |
jQuery.each(this.childNodes, function() { | |
if (this.nodeType != 8) { | |
ret += this.nodeType != 1 ? this.nodeValue : jQuery.fn.text([this]) | |
} | |
}) | |
}); | |
return ret | |
}, | |
wrapAll: function(html) { | |
if (this[0]) { | |
jQuery(html, this[0].ownerDocument).clone().insertBefore(this[0]).map(function() { | |
var elem = this; | |
while (elem.firstChild) { | |
elem = elem.firstChild | |
} | |
return elem | |
}).append(this) | |
} | |
return this | |
}, | |
wrapInner: function(html) { | |
return this.each(function() { | |
jQuery(this).contents().wrapAll(html) | |
}) | |
}, | |
wrap: function(html) { | |
return this.each(function() { | |
jQuery(this).wrapAll(html) | |
}) | |
}, | |
append: function() { | |
return this.domManip(arguments, true, false, function(elem) { | |
if (this.nodeType == 1) { | |
this.appendChild(elem) | |
} | |
}) | |
}, | |
prepend: function() { | |
return this.domManip(arguments, true, true, function(elem) { | |
if (this.nodeType == 1) { | |
this.insertBefore(elem, this.firstChild) | |
} | |
}) | |
}, | |
before: function() { | |
return this.domManip(arguments, false, false, function(elem) { | |
this.parentNode.insertBefore(elem, this) | |
}) | |
}, | |
after: function() { | |
return this.domManip(arguments, false, true, function(elem) { | |
this.parentNode.insertBefore(elem, this.nextSibling) | |
}) | |
}, | |
end: function() { | |
return this.prevObject || jQuery([]) | |
}, | |
find: function(selector) { | |
var elems = jQuery.map(this, function(elem) { | |
return jQuery.find(selector, elem) | |
}); | |
return this.pushStack(/[^+>] [^+>]/.test(selector) || selector.indexOf("..") > -1 ? jQuery.unique(elems) : elems) | |
}, | |
clone: function(events) { | |
var ret = this.map(function() { | |
if (jQuery.browser.msie && !jQuery.isXMLDoc(this)) { | |
var clone = this.cloneNode(true), | |
container = document.createElement("div"); | |
container.appendChild(clone); | |
return jQuery.clean([container.innerHTML])[0] | |
} else { | |
return this.cloneNode(true) | |
} | |
}); | |
var clone = ret.find("*").andSelf().each(function() { | |
if (this[expando] != undefined) { | |
this[expando] = null | |
} | |
}); | |
if (events === true) { | |
this.find("*").andSelf().each(function(i) { | |
if (this.nodeType == 3) { | |
return | |
} | |
var events = jQuery.data(this, "events"); | |
for (var type in events) { | |
for (var handler in events[type]) { | |
jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data) | |
} | |
} | |
}) | |
} | |
return ret | |
}, | |
filter: function(selector) { | |
return this.pushStack(jQuery.isFunction(selector) && jQuery.grep(this, function(elem, i) { | |
return selector.call(elem, i) | |
}) || jQuery.multiFilter(selector, this)) | |
}, | |
not: function(selector) { | |
if (selector.constructor == String) { | |
if (isSimple.test(selector)) { | |
return this.pushStack(jQuery.multiFilter(selector, this, true)) | |
} else { | |
selector = jQuery.multiFilter(selector, this) | |
} | |
} | |
var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; | |
return this.filter(function() { | |
return isArrayLike ? jQuery.inArray(this, selector) < 0 : this != selector | |
}) | |
}, | |
add: function(selector) { | |
return this.pushStack(jQuery.unique(jQuery.merge(this.get(), typeof selector == "string" ? jQuery(selector) : jQuery.makeArray(selector)))) | |
}, | |
is: function(selector) { | |
return !!selector && jQuery.multiFilter(selector, this).length > 0 | |
}, | |
hasClass: function(selector) { | |
return this.is("." + selector) | |
}, | |
val: function(value) { | |
if (value == undefined) { | |
if (this.length) { | |
var elem = this[0]; | |
if (jQuery.nodeName(elem, "select")) { | |
var index = elem.selectedIndex, | |
values = [], | |
options = elem.options, | |
one = elem.type == "select-one"; | |
if (index < 0) { | |
return null | |
} | |
for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) { | |
var option = options[i]; | |
if (option.selected) { | |
value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; | |
if (one) { | |
return value | |
} | |
values.push(value) | |
} | |
} | |
return values | |
} else { | |
return (this[0].value || "").replace(/\r/g, "") | |
} | |
} | |
return undefined | |
} | |
if (value.constructor == Number) { | |
value += "" | |
} | |
return this.each(function() { | |
if (this.nodeType != 1) { | |
return | |
} | |
if (value.constructor == Array && /radio|checkbox/.test(this.type)) { | |
this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0) | |
} else { | |
if (jQuery.nodeName(this, "select")) { | |
var values = jQuery.makeArray(value); | |
jQuery("option", this).each(function() { | |
this.selected = (jQuery.inArray(this.value, values) >= 0 || jQuery.inArray(this.text, values) >= 0) | |
}); | |
if (!values.length) { | |
this.selectedIndex = -1 | |
} | |
} else { | |
this.value = value | |
} | |
} | |
}) | |
}, | |
html: function(value) { | |
return value == undefined ? (this[0] ? this[0].innerHTML : null) : this.empty().append(value) | |
}, | |
replaceWith: function(value) { | |
return this.after(value).remove() | |
}, | |
eq: function(i) { | |
return this.slice(i, i + 1) | |
}, | |
slice: function() { | |
return this.pushStack(Array.prototype.slice.apply(this, arguments)) | |
}, | |
map: function(callback) { | |
return this.pushStack(jQuery.map(this, function(elem, i) { | |
return callback.call(elem, i, elem) | |
})) | |
}, | |
andSelf: function() { | |
return this.add(this.prevObject) | |
}, | |
data: function(key, value) { | |
var parts = key.split("."); | |
parts[1] = parts[1] ? "." + parts[1] : ""; | |
if (value === undefined) { | |
var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); | |
if (data === undefined && this.length) { | |
data = jQuery.data(this[0], key) | |
} | |
return data === undefined && parts[1] ? this.data(parts[0]) : data | |
} else { | |
return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { | |
jQuery.data(this, key, value) | |
}) | |
} | |
}, | |
removeData: function(key) { | |
return this.each(function() { | |
jQuery.removeData(this, key) | |
}) | |
}, | |
domManip: function(args, table, reverse, callback) { | |
var clone = this.length > 1, | |
elems; | |
return this.each(function() { | |
if (!elems) { | |
elems = jQuery.clean(args, this.ownerDocument); | |
if (reverse) { | |
elems.reverse() | |
} | |
} | |
var obj = this; | |
if (table && jQuery.nodeName(this, "table") && jQuery.nodeName(elems[0], "tr")) { | |
obj = this.getElementsByTagName("tbody")[0] || this.appendChild(this.ownerDocument.createElement("tbody")) | |
} | |
var scripts = jQuery([]); | |
jQuery.each(elems, function() { | |
var elem = clone ? jQuery(this).clone(true)[0] : this; | |
if (jQuery.nodeName(elem, "script")) { | |
scripts = scripts.add(elem) | |
} else { | |
if (elem.nodeType == 1) { | |
scripts = scripts.add(jQuery("script", elem).remove()) | |
} | |
callback.call(obj, elem) | |
} | |
}); | |
scripts.each(evalScript) | |
}) | |
} | |
}; | |
jQuery.fn.init.prototype = jQuery.fn; | |
function evalScript(i, elem) { | |
if (elem.src) { | |
jQuery.ajax({ | |
url: elem.src, | |
async: false, | |
dataType: "script" | |
}) | |
} else { | |
jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || "") | |
} | |
if (elem.parentNode) { | |
elem.parentNode.removeChild(elem) | |
} | |
} | |
function now() { | |
return +new Date | |
} | |
jQuery.extend = jQuery.fn.extend = function() { | |
var target = arguments[0] || {}, | |
i = 1, | |
length = arguments.length, | |
deep = false, | |
options; | |
if (target.constructor == Boolean) { | |
deep = target; | |
target = arguments[1] || {}; | |
i = 2 | |
} | |
if (typeof target != "object" && typeof target != "function") { | |
target = {} | |
} | |
if (length == i) { | |
target = this; | |
--i | |
} | |
for (; i < length; i++) { | |
if ((options = arguments[i]) != null) { | |
for (var name in options) { | |
var src = target[name], | |
copy = options[name]; | |
if (target === copy) { | |
continue | |
} | |
if (deep && copy && typeof copy == "object" && !copy.nodeType) { | |
target[name] = jQuery.extend(deep, src || (copy.length != null ? [] : {}), copy) | |
} else { | |
if (copy !== undefined) { | |
target[name] = copy | |
} | |
} | |
} | |
} | |
} | |
return target | |
}; | |
var expando = "jQuery" + now(), | |
uuid = 0, | |
windowData = {}, | |
exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, | |
defaultView = document.defaultView || {}; | |
jQuery.extend({ | |
noConflict: function(deep) { | |
window.$ = _$; | |
if (deep) { | |
window.jQuery = _jQuery | |
} | |
return jQuery | |
}, | |
isFunction: function(fn) { | |
return !!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /^[\s[]?function/.test(fn + "") | |
}, | |
isXMLDoc: function(elem) { | |
return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body | |
}, | |
globalEval: function(data) { | |
data = jQuery.trim(data); | |
if (data) { | |
var head = document.getElementsByTagName("head")[0] || document.documentElement, | |
script = document.createElement("script"); | |
script.type = "text/javascript"; | |
if (jQuery.browser.msie) { | |
script.text = data | |
} else { | |
script.appendChild(document.createTextNode(data)) | |
} | |
head.insertBefore(script, head.firstChild); | |
head.removeChild(script) | |
} | |
}, | |
nodeName: function(elem, name) { | |
return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase() | |
}, | |
cache: {}, | |
data: function(elem, name, data) { | |
elem = elem == window ? windowData : elem; | |
var id = elem[expando]; | |
if (!id) { | |
id = elem[expando] = ++uuid | |
} | |
if (name && !jQuery.cache[id]) { | |
jQuery.cache[id] = {} | |
} | |
if (data !== undefined) { | |
jQuery.cache[id][name] = data | |
} | |
return name ? jQuery.cache[id][name] : id | |
}, | |
removeData: function(elem, name) { | |
elem = elem == window ? windowData : elem; | |
var id = elem[expando]; | |
if (name) { | |
if (jQuery.cache[id]) { | |
delete jQuery.cache[id][name]; | |
name = ""; | |
for (name in jQuery.cache[id]) { | |
break | |
} | |
if (!name) { | |
jQuery.removeData(elem) | |
} | |
} | |
} else { | |
try { | |
delete elem[expando] | |
} catch (e) { | |
if (elem.removeAttribute) { | |
elem.removeAttribute(expando) | |
} | |
} | |
delete jQuery.cache[id] | |
} | |
}, | |
each: function(object, callback, args) { | |
var name, i = 0, | |
length = object.length; | |
if (args) { | |
if (length == undefined) { | |
for (name in object) { | |
if (callback.apply(object[name], args) === false) { | |
break | |
} | |
} | |
} else { | |
for (; i < length;) { | |
if (callback.apply(object[i++], args) === false) { | |
break | |
} | |
} | |
} | |
} else { | |
if (length == undefined) { | |
for (name in object) { | |
if (callback.call(object[name], name, object[name]) === false) { | |
break | |
} | |
} | |
} else { | |
for (var value = object[0]; i < length && callback.call(value, i, value) !== false; value = object[++i]) {} | |
} | |
} | |
return object | |
}, | |
prop: function(elem, value, type, i, name) { | |
if (jQuery.isFunction(value)) { | |
value = value.call(elem, i) | |
} | |
return value && value.constructor == Number && type == "curCSS" && !exclude.test(name) ? value + "px" : value | |
}, | |
className: { | |
add: function(elem, classNames) { | |
jQuery.each((classNames || "").split(/\s+/), function(i, className) { | |
if (elem.nodeType == 1 && !jQuery.className.has(elem.className, className)) { | |
elem.className += (elem.className ? " " : "") + className | |
} | |
}) | |
}, | |
remove: function(elem, classNames) { | |
if (elem.nodeType == 1) { | |
elem.className = classNames != undefined ? jQuery.grep(elem.className.split(/\s+/), function(className) { | |
return !jQuery.className.has(classNames, className) | |
}).join(" ") : "" | |
} | |
}, | |
has: function(elem, className) { | |
return jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1 | |
} | |
}, | |
swap: function(elem, options, callback) { | |
var old = {}; | |
for (var name in options) { | |
old[name] = elem.style[name]; | |
elem.style[name] = options[name] | |
} | |
callback.call(elem); | |
for (var name in options) { | |
elem.style[name] = old[name] | |
} | |
}, | |
css: function(elem, name, force) { | |
if (name == "width" || name == "height") { | |
var val, props = { | |
position: "absolute", | |
visibility: "hidden", | |
display: "block" | |
}, | |
which = name == "width" ? ["Left", "Right"] : ["Top", "Bottom"]; | |
function getWH() { | |
val = name == "width" ? elem.offsetWidth : elem.offsetHeight; | |
var padding = 0, | |
border = 0; | |
jQuery.each(which, function() { | |
padding += parseFloat(jQuery.curCSS(elem, "padding" + this, true)) || 0; | |
border += parseFloat(jQuery.curCSS(elem, "border" + this + "Width", true)) || 0 | |
}); | |
val -= Math.round(padding + border) | |
} | |
if (jQuery(elem).is(":visible")) { | |
getWH() | |
} else { | |
jQuery.swap(elem, props, getWH) | |
} | |
return Math.max(0, val) | |
} | |
return jQuery.curCSS(elem, name, force) | |
}, | |
curCSS: function(elem, name, force) { | |
var ret, style = elem.style; | |
function color(elem) { | |
if (!jQuery.browser.webkit) { | |
return false | |
} | |
var ret = defaultView.getComputedStyle(elem, null); | |
return !ret || ret.getPropertyValue("color") == "" | |
} | |
if (name == "opacity" && jQuery.browser.msie) { | |
ret = jQuery.attr(style, "opacity"); | |
return ret == "" ? "1" : ret | |
} | |
if (jQuery.browser.opera && name == "display") { | |
var save = style.outline; | |
style.outline = "0 solid black"; | |
style.outline = save | |
} | |
if (name.match(/float/i)) { | |
name = styleFloat | |
} | |
if (!force && style && style[name]) { | |
ret = style[name] | |
} else { | |
if (defaultView.getComputedStyle) { | |
if (name.match(/float/i)) { | |
name = "float" | |
} | |
name = name.replace(/([A-Z])/g, "-$1").toLowerCase(); | |
var computedStyle = defaultView.getComputedStyle(elem, null); | |
if (computedStyle && !color(elem)) { | |
ret = computedStyle.getPropertyValue(name) | |
} else { | |
var swap = [], | |
stack = [], | |
a = elem, | |
i = 0; | |
for (; a && color(a); a = a.parentNode) { | |
stack.unshift(a) | |
} | |
for (; i < stack.length; i++) { | |
if (color(stack[i])) { | |
swap[i] = stack[i].style.display; | |
stack[i].style.display = "block" | |
} | |
} | |
ret = name == "display" && swap[stack.length - 1] != null ? "none" : (computedStyle && computedStyle.getPropertyValue(name)) || ""; | |
for (i = 0; i < swap.length; i++) { | |
if (swap[i] != null) { | |
stack[i].style.display = swap[i] | |
} | |
} | |
} | |
if (name == "opacity" && ret == "") { | |
ret = "1" | |
} | |
} else { | |
if (elem.currentStyle) { | |
var camelCase = name.replace(/\-(\w)/g, function(all, letter) { | |
return letter.toUpperCase() | |
}); | |
ret = elem.currentStyle[name] || elem.currentStyle[camelCase]; | |
if (!/^\d+(px)?$/i.test(ret) && /^\d/.test(ret)) { | |
var left = style.left, | |
rsLeft = elem.runtimeStyle.left; | |
elem.runtimeStyle.left = elem.currentStyle.left; | |
style.left = ret || 0; | |
ret = style.pixelLeft + "px"; | |
style.left = left; | |
elem.runtimeStyle.left = rsLeft | |
} | |
} | |
} | |
} | |
return ret | |
}, | |
clean: function(elems, context) { | |
var ret = []; | |
context = context || document; | |
if (typeof context.createElement == "undefined") { | |
context = context.ownerDocument || context[0] && context[0].ownerDocument || document | |
} | |
jQuery.each(elems, function(i, elem) { | |
if (!elem) { | |
return | |
} | |
if (elem.constructor == Number) { | |
elem += "" | |
} | |
if (typeof elem == "string") { | |
elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag) { | |
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">" | |
}); | |
var tags = jQuery.trim(elem).toLowerCase(), | |
div = context.createElement("div"); | |
var wrap = !tags.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !tags.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !tags.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!tags.indexOf("<td") || !tags.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !tags.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || jQuery.browser.msie && [1, "div<div>", "</div>"] || [0, "", ""]; | |
div.innerHTML = wrap[1] + elem + wrap[2]; | |
while (wrap[0]--) { | |
div = div.lastChild | |
} | |
if (jQuery.browser.msie) { | |
var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ? div.firstChild && div.firstChild.childNodes : wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ? div.childNodes : []; | |
for (var j = tbody.length - 1; j >= 0; --j) { | |
if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) { | |
tbody[j].parentNode.removeChild(tbody[j]) | |
} | |
} | |
if (/^\s/.test(elem)) { | |
div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]), div.firstChild) | |
} | |
} | |
elem = jQuery.makeArray(div.childNodes) | |
} | |
if (elem.length === 0 && (!jQuery.nodeName(elem, "form") && !jQuery.nodeName(elem, "select"))) { | |
return | |
} | |
if (elem[0] == undefined || jQuery.nodeName(elem, "form") || elem.options) { | |
ret.push(elem) | |
} else { | |
ret = jQuery.merge(ret, elem) | |
} | |
}); | |
return ret | |
}, | |
attr: function(elem, name, value) { | |
if (!elem || elem.nodeType == 3 || elem.nodeType == 8) { | |
return undefined | |
} | |
var notxml = !jQuery.isXMLDoc(elem), | |
set = value !== undefined, | |
msie = jQuery.browser.msie; | |
name = notxml && jQuery.props[name] || name; | |
if (elem.tagName) { | |
var special = /href|src|style/.test(name); | |
if (name == "selected" && jQuery.browser.webkit) { | |
elem.parentNode.selectedIndex | |
} | |
if (name in elem && notxml && !special) { | |
if (set) { | |
if (name == "type" && jQuery.nodeName(elem, "input") && elem.parentNode) { | |
throw "type property can't be changed" | |
} | |
elem[name] = value | |
} | |
if (jQuery.nodeName(elem, "form") && elem.getAttributeNode(name)) { | |
return elem.getAttributeNode(name).nodeValue | |
} | |
return elem[name] | |
} | |
if (msie && notxml && name == "style") { | |
return jQuery.attr(elem.style, "cssText", value) | |
} | |
if (set) { | |
elem.setAttribute(name, "" + value) | |
} | |
var attr = msie && notxml && special ? elem.getAttribute(name, 2) : elem.getAttribute(name); | |
return attr === null ? undefined : attr | |
} | |
if (msie && name == "opacity" && parseInt(jQuery.browser.version, 10) < 9) { | |
if (set) { | |
elem.zoom = 1; | |
elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(value) + "" == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")") | |
} | |
return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? (parseFloat(elem.filter.match(/opacity=([^)]*)/)[1]) / 100) + "" : "" | |
} | |
name = name.replace(/-([a-z])/ig, function(all, letter) { | |
return letter.toUpperCase() | |
}); | |
if (set) { | |
elem[name] = value | |
} | |
return elem[name] | |
}, | |
trim: function(text) { | |
return (text || "").replace(/^\s+|\s+$/g, "") | |
}, | |
makeArray: function(array) { | |
var ret = []; | |
if (array != null) { | |
var i = array.length; | |
if (i == null || array.split || array.setInterval || array.call) { | |
ret[0] = array | |
} else { | |
while (i) { | |
ret[--i] = array[i] | |
} | |
} | |
} | |
return ret | |
}, | |
inArray: function(elem, array) { | |
for (var i = 0, length = array.length; i < length; i++) { | |
if (array[i] === elem) { | |
return i | |
} | |
} | |
return -1 | |
}, | |
merge: function(first, second) { | |
var i = 0, | |
elem, pos = first.length; | |
if (jQuery.browser.msie) { | |
while (elem = second[i++]) { | |
if (elem.nodeType != 8) { | |
first[pos++] = elem | |
} | |
} | |
} else { | |
while (elem = second[i++]) { | |
first[pos++] = elem | |
} | |
} | |
return first | |
}, | |
unique: function(array) { | |
var ret = [], | |
done = {}; | |
try { | |
for (var i = 0, length = array.length; i < length; i++) { | |
var id = jQuery.data(array[i]); | |
if (!done[id]) { | |
done[id] = true; | |
ret.push(array[i]) | |
} | |
} | |
} catch (e) { | |
ret = array | |
} | |
return ret | |
}, | |
grep: function(elems, callback, inv) { | |
var ret = []; | |
for (var i = 0, length = elems.length; i < length; i++) { | |
if (!inv != !callback(elems[i], i)) { | |
ret.push(elems[i]) | |
} | |
} | |
return ret | |
}, | |
map: function(elems, callback) { | |
var ret = []; | |
for (var i = 0, length = elems.length; i < length; i++) { | |
var value = callback(elems[i], i); | |
if (value != null) { | |
ret[ret.length] = value | |
} | |
} | |
return ret.concat.apply([], ret) | |
} | |
}); | |
var userAgent = navigator.userAgent.toLowerCase(); | |
jQuery.browser = { | |
version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], | |
webkit: /webkit/.test(userAgent), | |
safari: /safari/.test(userAgent), | |
chrome: /chrome/.test(userAgent), | |
opera: /opera/.test(userAgent), | |
msie: /msie/.test(userAgent) && !/opera/.test(userAgent), | |
mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent) | |
}; | |
jQuery.browser.msie11 = / trident\//.test(userAgent) && jQuery.browser.version >= 11; | |
jQuery.browser.opera15 = jQuery.browser.webkit && /opr\//.test(userAgent) && jQuery.browser.version >= 15; | |
jQuery.useLegacyXhr = jQuery.browser.msie11; | |
if (jQuery.browser.chrome) { | |
jQuery.browser.safari = false | |
} | |
var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat"; | |
jQuery.extend({ | |
boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat", | |
props: { | |
"for": "htmlFor", | |
"class": "className", | |
"float": styleFloat, | |
cssFloat: styleFloat, | |
styleFloat: styleFloat, | |
readonly: "readOnly", | |
maxlength: "maxLength", | |
cellspacing: "cellSpacing" | |
} | |
}); | |
jQuery.each({ | |
parent: function(elem) { | |
return elem.parentNode | |
}, | |
parents: function(elem) { | |
return jQuery.dir(elem, "parentNode") | |
}, | |
next: function(elem) { | |
return jQuery.nth(elem, 2, "nextSibling") | |
}, | |
prev: function(elem) { | |
return jQuery.nth(elem, 2, "previousSibling") | |
}, | |
nextAll: function(elem) { | |
return jQuery.dir(elem, "nextSibling") | |
}, | |
prevAll: function(elem) { | |
return jQuery.dir(elem, "previousSibling") | |
}, | |
siblings: function(elem) { | |
return jQuery.sibling(elem.parentNode.firstChild, elem) | |
}, | |
children: function(elem) { | |
return jQuery.sibling(elem.firstChild) | |
}, | |
contents: function(elem) { | |
return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray(elem.childNodes) | |
} | |
}, function(name, fn) { | |
jQuery.fn[name] = function(selector) { | |
var ret = jQuery.map(this, fn); | |
if (selector && typeof selector == "string") { | |
ret = jQuery.multiFilter(selector, ret) | |
} | |
return this.pushStack(jQuery.unique(ret)) | |
} | |
}); | |
jQuery.each({ | |
appendTo: "append", | |
prependTo: "prepend", | |
insertBefore: "before", | |
insertAfter: "after", | |
replaceAll: "replaceWith" | |
}, function(name, original) { | |
jQuery.fn[name] = function() { | |
var args = arguments; | |
return this.each(function() { | |
for (var i = 0, length = args.length; i < length; i++) { | |
jQuery(args[i])[original](this) | |
} | |
}) | |
} | |
}); | |
jQuery.each({ | |
removeAttr: function(name) { | |
jQuery.attr(this, name, ""); | |
if (this.nodeType == 1) { | |
this.removeAttribute(name) | |
} | |
}, | |
addClass: function(classNames) { | |
jQuery.className.add(this, classNames) | |
}, | |
removeClass: function(classNames) { | |
jQuery.className.remove(this, classNames) | |
}, | |
toggleClass: function(classNames) { | |
jQuery.className[jQuery.className.has(this, classNames) ? "remove" : "add"](this, classNames) | |
}, | |
remove: function(selector) { | |
if (!selector || jQuery.filter(selector, [this]).r.length) { | |
jQuery("*", this).add(this).each(function() { | |
jQuery.event.remove(this); | |
jQuery.removeData(this) | |
}); | |
if (this.parentNode) { | |
this.parentNode.removeChild(this) | |
} | |
} | |
}, | |
empty: function() { | |
jQuery(">*", this).remove(); | |
while (this.firstChild) { | |
this.removeChild(this.firstChild) | |
} | |
} | |
}, function(name, fn) { | |
jQuery.fn[name] = function() { | |
return this.each(fn, arguments) | |
} | |
}); | |
jQuery.each(["Height", "Width"], function(i, name) { | |
var type = name.toLowerCase(); | |
jQuery.fn[type] = function(size) { | |
return this[0] == window ? jQuery.browser.opera && document.body["client" + name] || jQuery.browser.webkit && window["inner" + name] || document.compatMode == "CSS1Compat" && document.documentElement["client" + name] || document.body["client" + name] : this[0] == document ? Math.max(Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), Math.max(document.body["offset" + name], document.documentElement["offset" + name])) : size == undefined ? (this.length ? jQuery.css(this[0], type) : null) : this.css(type, size.constructor == String ? size : size + "px") | |
} | |
}); | |
function num(elem, prop) { | |
return elem[0] && parseInt(jQuery.curCSS(elem[0], prop, true), 10) || 0 | |
} | |
var chars = jQuery.browser.webkit && parseInt(jQuery.browser.version) < 417 ? "(?:[\\w*_-]|\\\\.)" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)", | |
quickChild = new RegExp("^>\\s*(" + chars + "+)"), | |
quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"), | |
quickClass = new RegExp("^([#.]?)(" + chars + "*)"); | |
jQuery.extend({ | |
expr: { | |
"": function(a, i, m) { | |
return m[2] == "*" || jQuery.nodeName(a, m[2]) | |
}, | |
"#": function(a, i, m) { | |
return a.getAttribute("id") == m[2] | |
}, | |
":": { | |
lt: function(a, i, m) { | |
return i < m[3] - 0 | |
}, | |
gt: function(a, i, m) { | |
return i > m[3] - 0 | |
}, | |
nth: function(a, i, m) { | |
return m[3] - 0 == i | |
}, | |
eq: function(a, i, m) { | |
return m[3] - 0 == i | |
}, | |
first: function(a, i) { | |
return i == 0 | |
}, | |
last: function(a, i, m, r) { | |
return i == r.length - 1 | |
}, | |
even: function(a, i) { | |
return i % 2 == 0 | |
}, | |
odd: function(a, i) { | |
return i % 2 | |
}, | |
"first-child": function(a) { | |
return a.parentNode.getElementsByTagName("*")[0] == a | |
}, | |
"last-child": function(a) { | |
return jQuery.nth(a.parentNode.lastChild, 1, "previousSibling") == a | |
}, | |
"only-child": function(a) { | |
return !jQuery.nth(a.parentNode.lastChild, 2, "previousSibling") | |
}, | |
parent: function(a) { | |
return a.firstChild | |
}, | |
empty: function(a) { | |
return !a.firstChild | |
}, | |
contains: function(a, i, m) { | |
return (a.textContent || a.innerText || jQuery(a).text() || "").indexOf(m[3]) >= 0 | |
}, | |
visible: function(a) { | |
return "hidden" != a.type && jQuery.css(a, "display") != "none" && jQuery.css(a, "visibility") != "hidden" | |
}, | |
hidden: function(a) { | |
return "hidden" == a.type || jQuery.css(a, "display") == "none" || jQuery.css(a, "visibility") == "hidden" | |
}, | |
enabled: function(a) { | |
return !a.disabled | |
}, | |
disabled: function(a) { | |
return a.disabled | |
}, | |
checked: function(a) { | |
return a.checked | |
}, | |
selected: function(a) { | |
return a.selected || jQuery.attr(a, "selected") | |
}, | |
text: function(a) { | |
return "text" == a.type | |
}, | |
radio: function(a) { | |
return "radio" == a.type | |
}, | |
checkbox: function(a) { | |
return "checkbox" == a.type | |
}, | |
file: function(a) { | |
return "file" == a.type | |
}, | |
password: function(a) { | |
return "password" == a.type | |
}, | |
submit: function(a) { | |
return "submit" == a.type | |
}, | |
image: function(a) { | |
return "image" == a.type | |
}, | |
reset: function(a) { | |
return "reset" == a.type | |
}, | |
button: function(a) { | |
return "button" == a.type || jQuery.nodeName(a, "button") | |
}, | |
input: function(a) { | |
return /input|select|textarea|button/i.test(a.nodeName) | |
}, | |
has: function(a, i, m) { | |
return jQuery.find(m[3], a).length | |
}, | |
header: function(a) { | |
return /h\d/i.test(a.nodeName) | |
}, | |
animated: function(a) { | |
return jQuery.grep(jQuery.timers, function(fn) { | |
return a == fn.elem | |
}).length | |
} | |
} | |
}, | |
parse: [/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, new RegExp("^([:.#]*)(" + chars + "+)")], | |
multiFilter: function(expr, elems, not) { | |
var old, cur = []; | |
while (expr && expr != old) { | |
old = expr; | |
var f = jQuery.filter(expr, elems, not); | |
expr = f.t.replace(/^\s*,\s*/, ""); | |
cur = not ? elems = f.r : jQuery.merge(cur, f.r) | |
} | |
return cur | |
}, | |
find: function(t, context) { | |
if (typeof t != "string") { | |
return [t] | |
} | |
if (context && context.nodeType != 1 && context.nodeType != 9) { | |
return [] | |
} | |
context = context || document; | |
var ret = [context], | |
done = [], | |
last, nodeName; | |
while (t && last != t) { | |
var r = []; | |
last = t; | |
t = jQuery.trim(t); | |
var foundToken = false, | |
re = quickChild, | |
m = re.exec(t); | |
if (m) { | |
nodeName = m[1].toUpperCase(); | |
for (var i = 0; ret[i]; i++) { | |
for (var c = ret[i].firstChild; c; c = c.nextSibling) { | |
if (c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName)) { | |
r.push(c) | |
} | |
} | |
} | |
ret = r; | |
t = t.replace(re, ""); | |
if (t.indexOf(" ") == 0) { | |
continue | |
} | |
foundToken = true | |
} else { | |
re = /^([>+~])\s*(\w*)/i; | |
if ((m = re.exec(t)) != null) { | |
r = []; | |
var merge = {}; | |
nodeName = m[2].toUpperCase(); | |
m = m[1]; | |
for (var j = 0, rl = ret.length; j < rl; j++) { | |
var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild; | |
for (; n; n = n.nextSibling) { | |
if (n.nodeType == 1) { | |
var id = jQuery.data(n); | |
if (m == "~" && merge[id]) { | |
break | |
} | |
if (!nodeName || n.nodeName.toUpperCase() == nodeName) { | |
if (m == "~") { | |
merge[id] = true | |
} | |
r.push(n) | |
} | |
if (m == "+") { | |
break | |
} | |
} | |
} | |
} | |
ret = r; | |
t = jQuery.trim(t.replace(re, "")); | |
foundToken = true | |
} | |
} | |
if (t && !foundToken) { | |
if (!t.indexOf(",")) { | |
if (context == ret[0]) { | |
ret.shift() | |
} | |
done = jQuery.merge(done, ret); | |
r = ret = [context]; | |
t = " " + t.substr(1, t.length) | |
} else { | |
var re2 = quickID; | |
var m = re2.exec(t); | |
if (m) { | |
m = [0, m[2], m[3], m[1]] | |
} else { | |
re2 = quickClass; | |
m = re2.exec(t) | |
} | |
m[2] = m[2].replace(/\\/g, ""); | |
var elem = ret[ret.length - 1]; | |
if (m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem)) { | |
var oid = elem.getElementById(m[2]); | |
if ((jQuery.browser.msie || jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2]) { | |
oid = jQuery('[@id="' + m[2] + '"]', elem)[0] | |
} | |
ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [] | |
} else { | |
for (var i = 0; ret[i]; i++) { | |
var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2]; | |
if (tag == "*" && ret[i].nodeName.toLowerCase() == "object") { | |
tag = "param" | |
} | |
r = jQuery.merge(r, ret[i].getElementsByTagName(tag)) | |
} | |
if (m[1] == ".") { | |
r = jQuery.classFilter(r, m[2]) | |
} | |
if (m[1] == "#") { | |
var tmp = []; | |
for (var i = 0; r[i]; i++) { | |
if (r[i].getAttribute("id") == m[2]) { | |
tmp = [r[i]]; | |
break | |
} | |
} | |
r = tmp | |
} | |
ret = r | |
} | |
t = t.replace(re2, "") | |
} | |
} | |
if (t) { | |
var val = jQuery.filter(t, r); | |
ret = r = val.r; | |
t = jQuery.trim(val.t) | |
} | |
} | |
if (t) { | |
ret = [] | |
} | |
if (ret && context == ret[0]) { | |
ret.shift() | |
} | |
done = jQuery.merge(done, ret); | |
return done | |
}, | |
classFilter: function(r, m, not) { | |
m = " " + m + " "; | |
var tmp = []; | |
for (var i = 0; r[i]; i++) { | |
var pass = (" " + r[i].className + " ").indexOf(m) >= 0; | |
if (!not && pass || not && !pass) { | |
tmp.push(r[i]) | |
} | |
} | |
return tmp | |
}, | |
filter: function(t, r, not) { | |
var last; | |
while (t && t != last) { | |
last = t; | |
var p = jQuery.parse, | |
m; | |
for (var i = 0; p[i]; i++) { | |
m = p[i].exec(t); | |
if (m) { | |
t = t.substring(m[0].length); | |
m[2] = m[2].replace(/\\/g, ""); | |
break | |
} | |
} | |
if (!m) { | |
break | |
} | |
if (m[1] == ":" && m[2] == "not") { | |
r = isSimple.test(m[3]) ? jQuery.filter(m[3], r, true).r : jQuery(r).not(m[3]) | |
} else { | |
if (m[1] == ".") { | |
r = jQuery.classFilter(r, m[2], not) | |
} else { | |
if (m[1] == "[") { | |
var tmp = [], | |
type = m[3]; | |
for (var i = 0, rl = r.length; i < rl; i++) { | |
var a = r[i], | |
z = a[jQuery.props[m[2]] || m[2]]; | |
if (z == null || /href|src|selected/.test(m[2])) { | |
z = jQuery.attr(a, m[2]) || "" | |
} | |
if ((type == "" && !!z || type == "=" && z == m[5] || type == "!=" && z != m[5] || type == "^=" && z && !z.indexOf(m[5]) || type == "$=" && z.substr(z.length - m[5].length) == m[5] || (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not) { | |
tmp.push(a) | |
} | |
} | |
r = tmp | |
} else { | |
if (m[1] == ":" && m[2] == "nth-child") { | |
var merge = {}, | |
tmp = [], | |
test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" || !/\D/.test(m[3]) && "0n+" + m[3] || m[3]), | |
first = (test[1] + (test[2] || 1)) - 0, | |
last = test[3] - 0; | |
for (var i = 0, rl = r.length; i < rl; i++) { | |
var node = r[i], | |
parentNode = node.parentNode, | |
id = jQuery.data(parentNode); | |
if (!merge[id]) { | |
var c = 1; | |
for (var n = parentNode.firstChild; n; n = n.nextSibling) { | |
if (n.nodeType == 1) { | |
n.nodeIndex = c++ | |
} | |
} | |
merge[id] = true | |
} | |
var add = false; | |
if (first == 0) { | |
if (node.nodeIndex == last) { | |
add = true | |
} | |
} else { | |
if ((node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0) { | |
add = true | |
} | |
} | |
if (add ^ not) { | |
tmp.push(node) | |
} | |
} | |
r = tmp | |
} else { | |
var fn = jQuery.expr[m[1]]; | |
if (typeof fn == "object") { | |
fn = fn[m[2]] | |
} | |
if (typeof fn == "string") { | |
fn = eval("false||function(a,i){return " + fn + ";}") | |
} | |
r = jQuery.grep(r, function(elem, i) { | |
return fn(elem, i, m, r) | |
}, not) | |
} | |
} | |
} | |
} | |
} | |
return { | |
r: r, | |
t: t | |
} | |
}, | |
dir: function(elem, dir) { | |
var matched = [], | |
cur = elem[dir]; | |
while (cur && cur != document) { | |
if (cur.nodeType == 1) { | |
matched.push(cur) | |
} | |
cur = cur[dir] | |
} | |
return matched | |
}, | |
nth: function(cur, result, dir, elem) { | |
result = result || 1; | |
var num = 0; | |
for (; cur; cur = cur[dir]) { | |
if (cur.nodeType == 1 && ++num == result) { | |
break | |
} | |
} | |
return cur | |
}, | |
sibling: function(n, elem) { | |
var r = []; | |
for (; n; n = n.nextSibling) { | |
if (n.nodeType == 1 && n != elem) { | |
r.push(n) | |
} | |
} | |
return r | |
} | |
}); | |
jQuery.event = { | |
add: function(elem, types, handler, data) { | |
if (elem.nodeType == 3 || elem.nodeType == 8) { | |
return | |
} | |
if (jQuery.browser.msie && elem.setInterval) { | |
elem = window | |
} | |
if (!handler.guid) { | |
handler.guid = this.guid++ | |
} | |
if (data != undefined) { | |
var fn = handler; | |
handler = this.proxy(fn, function() { | |
return fn.apply(this, arguments) | |
}); | |
handler.data = data | |
} | |
var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), | |
handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function() { | |
if (typeof jQuery != "undefined" && !jQuery.event.triggered) { | |
return jQuery.event.handle.apply(arguments.callee.elem, arguments) | |
} | |
}); | |
handle.elem = elem; | |
jQuery.each(types.split(/\s+/), function(index, type) { | |
var parts = type.split("."); | |
type = parts[0]; | |
handler.type = parts[1]; | |
var handlers = events[type]; | |
if (!handlers) { | |
handlers = events[type] = {}; | |
if (!jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false) { | |
if (elem.addEventListener) { | |
elem.addEventListener(type, handle, false) | |
} else { | |
if (elem.attachEvent) { | |
elem.attachEvent("on" + type, handle) | |
} | |
} | |
} | |
} | |
handlers[handler.guid] = handler; | |
jQuery.event.global[type] = true | |
}); | |
elem = null | |
}, | |
guid: 1, | |
global: {}, | |
remove: function(elem, types, handler) { | |
if (elem.nodeType == 3 || elem.nodeType == 8) { | |
return | |
} | |
var events = jQuery.data(elem, "events"), | |
ret, index; | |
if (events) { | |
if (types == undefined || (typeof types == "string" && types.charAt(0) == ".")) { | |
for (var type in events) { | |
this.remove(elem, type + (types || "")) | |
} | |
} else { | |
if (types.type) { | |
handler = types.handler; | |
types = types.type | |
} | |
jQuery.each(types.split(/\s+/), function(index, type) { | |
var parts = type.split("."); | |
type = parts[0]; | |
if (events[type]) { | |
if (handler) { | |
delete events[type][handler.guid] | |
} else { | |
for (handler in events[type]) { | |
if (!parts[1] || events[type][handler].type == parts[1]) { | |
delete events[type][handler] | |
} | |
} | |
} | |
for (ret in events[type]) { | |
break | |
} | |
if (!ret) { | |
if (!jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false) { | |
if (elem.removeEventListener) { | |
elem.removeEventListener(type, jQuery.data(elem, "handle"), false) | |
} else { | |
if (elem.detachEvent) { | |
elem.detachEvent("on" + type, jQuery.data(elem, "handle")) | |
} | |
} | |
} | |
ret = null; | |
delete events[type] | |
} | |
} | |
}) | |
} | |
for (ret in events) { | |
break | |
} | |
if (!ret) { | |
var handle = jQuery.data(elem, "handle"); | |
if (handle) { | |
handle.elem = null | |
} | |
jQuery.removeData(elem, "events"); | |
jQuery.removeData(elem, "handle") | |
} | |
} | |
}, | |
trigger: function(type, data, elem, donative, extra) { | |
data = jQuery.makeArray(data); | |
if (type.indexOf("!") >= 0) { | |
type = type.slice(0, -1); | |
var exclusive = true | |
} | |
if (!elem) { | |
if (this.global[type]) { | |
jQuery("*").add([window, document]).trigger(type, data) | |
} | |
} else { | |
if (elem.nodeType == 3 || elem.nodeType == 8) { | |
return undefined | |
} | |
var val, ret, fn = jQuery.isFunction(elem[type] || null), | |
event = !data[0] || !data[0].preventDefault; | |
if (event) { | |
data.unshift({ | |
type: type, | |
target: elem, | |
preventDefault: function() {}, | |
stopPropagation: function() {}, | |
timeStamp: now() | |
}); | |
data[0][expando] = true | |
} | |
data[0].type = type; | |
if (exclusive) { | |
data[0].exclusive = true | |
} | |
var handle = jQuery.data(elem, "handle"); | |
if (handle) { | |
val = handle.apply(elem, data) | |
} | |
if ((!fn || (jQuery.nodeName(elem, "a") && type == "click")) && elem["on" + type] && elem["on" + type].apply(elem, data) === false) { | |
val = false | |
} | |
if (event) { | |
data.shift() | |
} | |
if (extra && jQuery.isFunction(extra)) { | |
ret = extra.apply(elem, val == null ? data : data.concat(val)); | |
if (ret !== undefined) { | |
val = ret | |
} | |
} | |
if (fn && donative !== false && val !== false && !(jQuery.nodeName(elem, "a") && type == "click")) { | |
this.triggered = true; | |
try { | |
elem[type]() | |
} catch (e) {} | |
} | |
this.triggered = false | |
} | |
return val | |
}, | |
handle: function(event) { | |
var val, ret, namespace, all, handlers; | |
event = arguments[0] = jQuery.event.fix(event || window.event); | |
namespace = event.type.split("."); | |
event.type = namespace[0]; | |
namespace = namespace[1]; | |
all = !namespace && !event.exclusive; | |
handlers = (jQuery.data(this, "events") || {})[event.type]; | |
for (var j in handlers) { | |
var handler = handlers[j]; | |
if (all || handler.type == namespace) { | |
event.handler = handler; | |
event.data = handler.data; | |
ret = handler.apply(this, arguments); | |
if (val !== false) { | |
val = ret | |
} | |
if (ret === false) { | |
event.preventDefault(); | |
event.stopPropagation() | |
} | |
} | |
} | |
return val | |
}, | |
fix: function(event) { | |
if (event[expando] == true) { | |
return event | |
} | |
var originalEvent = event; | |
event = { | |
originalEvent: originalEvent | |
}; | |
var props = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "); | |
for (var i = props.length; i; i--) { | |
event[props[i]] = originalEvent[props[i]] | |
} | |
event[expando] = true; | |
event.preventDefault = function() { | |
if (originalEvent.preventDefault) { | |
originalEvent.preventDefault() | |
} | |
originalEvent.returnValue = false | |
}; | |
event.stopPropagation = function() { | |
if (originalEvent.stopPropagation) { | |
originalEvent.stopPropagation() | |
} | |
originalEvent.cancelBubble = true | |
}; | |
event.timeStamp = event.timeStamp || now(); | |
if (!event.target) { | |
event.target = event.srcElement || document | |
} | |
if (event.target.nodeType == 3) { | |
event.target = event.target.parentNode | |
} | |
if (!event.relatedTarget && event.fromElement) { | |
event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement | |
} | |
if (event.pageX == null && event.clientX != null) { | |
var doc = document.documentElement, | |
body = document.body; | |
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); | |
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0) | |
} | |
if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode)) { | |
event.which = event.charCode || event.keyCode | |
} | |
if (!event.metaKey && event.ctrlKey) { | |
event.metaKey = event.ctrlKey | |
} | |
if (!event.which && event.button) { | |
event.which = (event.button & 1 ? 1 : (event.button & 2 ? 3 : (event.button & 4 ? 2 : 0))) | |
} | |
return event | |
}, | |
proxy: function(fn, proxy) { | |
proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; | |
return proxy | |
}, | |
special: { | |
ready: { | |
setup: function() { | |
bindReady(); | |
return | |
}, | |
teardown: function() { | |
return | |
} | |
}, | |
mouseenter: { | |
setup: function() { | |
if (jQuery.browser.msie) { | |
return false | |
} | |
jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler); | |
return true | |
}, | |
teardown: function() { | |
if (jQuery.browser.msie) { | |
return false | |
} | |
jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler); | |
return true | |
}, | |
handler: function(event) { | |
if (withinElement(event, this)) { | |
return true | |
} | |
event.type = "mouseenter"; | |
return jQuery.event.handle.apply(this, arguments) | |
} | |
}, | |
mouseleave: { | |
setup: function() { | |
if (jQuery.browser.msie) { | |
return false | |
} | |
jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler); | |
return true | |
}, | |
teardown: function() { | |
if (jQuery.browser.msie) { | |
return false | |
} | |
jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler); | |
return true | |
}, | |
handler: function(event) { | |
if (withinElement(event, this)) { | |
return true | |
} | |
event.type = "mouseleave"; | |
return jQuery.event.handle.apply(this, arguments) | |
} | |
} | |
} | |
}; | |
jQuery.fn.extend({ | |
bind: function(type, data, fn) { | |
return type == "unload" ? this.one(type, data, fn) : this.each(function() { | |
jQuery.event.add(this, type, fn || data, fn && data) | |
}) | |
}, | |
one: function(type, data, fn) { | |
var one = jQuery.event.proxy(fn || data, function(event) { | |
jQuery(this).unbind(event, one); | |
return (fn || data).apply(this, arguments) | |
}); | |
return this.each(function() { | |
jQuery.event.add(this, type, one, fn && data) | |
}) | |
}, | |
unbind: function(type, fn) { | |
return this.each(function() { | |
jQuery.event.remove(this, type, fn) | |
}) | |
}, | |
trigger: function(type, data, fn) { | |
return this.each(function() { | |
jQuery.event.trigger(type, data, this, true, fn) | |
}) | |
}, | |
triggerHandler: function(type, data, fn) { | |
return this[0] && jQuery.event.trigger(type, data, this[0], false, fn) | |
}, | |
toggle: function(fn) { | |
var args = arguments, | |
i = 1; | |
while (i < args.length) { | |
jQuery.event.proxy(fn, args[i++]) | |
} | |
return this.click(jQuery.event.proxy(fn, function(event) { | |
this.lastToggle = (this.lastToggle || 0) % i; | |
event.preventDefault(); | |
return args[this.lastToggle++].apply(this, arguments) || false | |
})) | |
}, | |
hover: function(fnOver, fnOut) { | |
return this.bind("mouseenter", fnOver).bind("mouseleave", fnOut) | |
}, | |
ready: function(fn) { | |
bindReady(); | |
if (jQuery.isReady) { | |
fn.call(document, jQuery) | |
} else { | |
jQuery.readyList.push(function() { | |
return fn.call(this, jQuery) | |
}) | |
} | |
return this | |
} | |
}); | |
jQuery.extend({ | |
isReady: false, | |
readyList: [], | |
ready: function() { | |
if (!jQuery.isReady) { | |
jQuery.isReady = true; | |
if (jQuery.readyList) { | |
jQuery.each(jQuery.readyList, function() { | |
this.call(document) | |
}); | |
jQuery.readyList = null | |
} | |
jQuery(document).triggerHandler("ready") | |
} | |
} | |
}); | |
var readyBound = false; | |
function bindReady() { | |
if (readyBound) { | |
return | |
} | |
readyBound = true; | |
if (document.addEventListener && !jQuery.browser.opera) { | |
document.addEventListener("DOMContentLoaded", jQuery.ready, false) | |
} | |
if (jQuery.browser.msie && window == top) { | |
(function() { | |
if (jQuery.isReady) { | |
return | |
} | |
try { | |
document.documentElement.doScroll("left") | |
} catch (error) { | |
setTimeout(arguments.callee, 0); | |
return | |
} | |
jQuery.ready() | |
})() | |
} | |
if (jQuery.browser.opera) { | |
document.addEventListener("DOMContentLoaded", function() { | |
if (jQuery.isReady) { | |
return | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
if (document.styleSheets[i].disabled) { | |
setTimeout(arguments.callee, 0); | |
return | |
} | |
} | |
jQuery.ready() | |
}, false) | |
} | |
if (jQuery.browser.webkit) { | |
var numStyles; | |
(function() { | |
if (jQuery.isReady) { | |
return | |
} | |
if (document.readyState != "loaded" && document.readyState != "complete") { | |
setTimeout(arguments.callee, 0); | |
return | |
} | |
if (numStyles === undefined) { | |
numStyles = jQuery("style, link[rel=stylesheet]").length | |
} | |
if (document.styleSheets.length != numStyles) { | |
setTimeout(arguments.callee, 0); | |
return | |
} | |
jQuery.ready() | |
})() | |
} | |
jQuery.event.add(window, "load", jQuery.ready) | |
} | |
jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name) { | |
jQuery.fn[name] = function(fn) { | |
return fn ? this.bind(name, fn) : this.trigger(name) | |
} | |
}); | |
var withinElement = function(event, elem) { | |
var parent = event.relatedTarget; | |
while (parent && parent != elem) { | |
try { | |
parent = parent.parentNode | |
} catch (error) { | |
parent = elem | |
} | |
} | |
return parent == elem | |
}; | |
jQuery(window).bind("unload", function() { | |
jQuery("*").add(document).unbind() | |
}); | |
jQuery.fn.extend({ | |
_load: jQuery.fn.load, | |
load: function(url, params, callback) { | |
if (typeof url != "string") { | |
return this._load(url) | |
} | |
var off = url.indexOf(" "); | |
if (off >= 0) { | |
var selector = url.slice(off, url.length); | |
url = url.slice(0, off) | |
} | |
callback = callback || function() {}; | |
var type = "GET"; | |
if (params) { | |
if (jQuery.isFunction(params)) { | |
callback = params; | |
params = null | |
} else { | |
params = jQuery.param(params); | |
type = "POST" | |
} | |
} | |
var self = this; | |
jQuery.ajax({ | |
url: url, | |
type: type, | |
dataType: "html", | |
data: params, | |
complete: function(res, status) { | |
if (status == "success" || status == "notmodified") { | |
self.html(selector ? jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")).find(selector) : res.responseText) | |
} | |
self.each(callback, [res.responseText, status, res]) | |
} | |
}); | |
return this | |
}, | |
serialize: function() { | |
return jQuery.param(this.serializeArray()) | |
}, | |
serializeArray: function() { | |
return this.map(function() { | |
return jQuery.nodeName(this, "form") ? jQuery.makeArray(this.elements) : this | |
}).filter(function() { | |
return this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type)) | |
}).map(function(i, elem) { | |
var val = jQuery(this).val(); | |
return val == null ? null : val.constructor == Array ? jQuery.map(val, function(val, i) { | |
return { | |
name: elem.name, | |
value: val | |
} | |
}) : { | |
name: elem.name, | |
value: val | |
} | |
}).get() | |
} | |
}); | |
jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i, o) { | |
jQuery.fn[o] = function(f) { | |
return this.bind(o, f) | |
} | |
}); | |
var jsc = now(); | |
jQuery.extend({ | |
get: function(url, data, callback, type) { | |
if (jQuery.isFunction(data)) { | |
callback = data; | |
data = null | |
} | |
return jQuery.ajax({ | |
type: "GET", | |
url: url, | |
data: data, | |
success: callback, | |
dataType: type | |
}) | |
}, | |
getScript: function(url, callback) { | |
return jQuery.get(url, null, callback, "script") | |
}, | |
getJSON: function(url, data, callback) { | |
return jQuery.get(url, data, callback, "json") | |
}, | |
post: function(url, data, callback, type) { | |
if (jQuery.isFunction(data)) { | |
callback = data; | |
data = {} | |
} | |
return jQuery.ajax({ | |
type: "POST", | |
url: url, | |
data: data, | |
success: callback, | |
dataType: type | |
}) | |
}, | |
ajaxSetup: function(settings) { | |
jQuery.extend(jQuery.ajaxSettings, settings) | |
}, | |
ajaxSettings: { | |
url: location.href, | |
global: true, | |
type: "GET", | |
timeout: 0, | |
contentType: "application/x-www-form-urlencoded", | |
processData: true, | |
async: true, | |
data: null, | |
username: null, | |
password: null, | |
accepts: { | |
xml: "application/xml, text/xml", | |
html: "text/html", | |
script: "text/javascript, application/javascript", | |
json: "application/json, text/javascript", | |
text: "text/plain", | |
_default: "*/*" | |
} | |
}, | |
lastModified: {}, | |
ajax: function(s) { | |
s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); | |
var jsonp, jsre = /=\?(&|$)/g, | |
status, data, type = s.type.toUpperCase(); | |
if (s.data && s.processData && typeof s.data != "string") { | |
s.data = jQuery.param(s.data) | |
} | |
if (s.dataType == "jsonp") { | |
if (type == "GET") { | |
if (!s.url.match(jsre)) { | |
s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?" | |
} | |
} else { | |
if (!s.data || !s.data.match(jsre)) { | |
s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?" | |
} | |
} | |
s.dataType = "json" | |
} | |
if (s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre))) { | |
jsonp = "jsonp" + jsc++; | |
if (s.data) { | |
s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1") | |
} | |
s.url = s.url.replace(jsre, "=" + jsonp + "$1"); | |
s.dataType = "script"; | |
window[jsonp] = function(tmp) { | |
data = tmp; | |
success(); | |
complete(); | |
window[jsonp] = undefined; | |
try { | |
delete window[jsonp] | |
} catch (e) {} | |
if (head) { | |
head.removeChild(script) | |
} | |
} | |
} | |
if (s.dataType == "script" && s.cache == null) { | |
s.cache = false | |
} | |
if (s.cache === false && type == "GET") { | |
var ts = now(); | |
var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); | |
s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "") | |
} | |
if (s.data && type == "GET") { | |
s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; | |
s.data = null | |
} | |
if (s.global && !jQuery.active++) { | |
jQuery.event.trigger("ajaxStart") | |
} | |
var remote = /^(?:\w+:)?\/\/([^\/?#]+)/; | |
if (s.dataType == "script" && type == "GET" && remote.test(s.url) && remote.exec(s.url)[1] != location.host) { | |
var head = document.getElementsByTagName("head")[0]; | |
var script = document.createElement("script"); | |
script.src = s.url; | |
if (s.scriptCharset) { | |
script.charset = s.scriptCharset | |
} | |
if (!jsonp) { | |
var done = false; | |
script.onload = script.onreadystatechange = function() { | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; | |
success(); | |
complete(); | |
head.removeChild(script) | |
} | |
} | |
} | |
head.appendChild(script); | |
return undefined | |
} | |
var requestDone = false; | |
var xhr = window.ActiveXObject && !jQuery.useNativeXhr || jQuery.useLegacyXhr ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); | |
if (s.username) { | |
xhr.open(type, s.url, s.async, s.username, s.password) | |
} else { | |
xhr.open(type, s.url, s.async) | |
} | |
try { | |
if (s.data) { | |
xhr.setRequestHeader("Content-Type", s.contentType) | |
} | |
if (s.ifModified) { | |
xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT") | |
} | |
xhr.setRequestHeader("Accept", s.dataType && s.accepts[s.dataType] ? s.accepts[s.dataType] + ", */*" : s.accepts._default) | |
} catch (e) {} | |
if (s.beforeSend && s.beforeSend(xhr, s) === false) { | |
s.global && jQuery.active--; | |
xhr.abort(); | |
return false | |
} | |
if (s.global) { | |
jQuery.event.trigger("ajaxSend", [xhr, s]) | |
} | |
var onreadystatechange = function(isTimeout) { | |
if (!requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout")) { | |
requestDone = true; | |
if (ival) { | |
clearInterval(ival); | |
ival = null | |
} | |
status = isTimeout == "timeout" && "timeout" || !jQuery.httpSuccess(xhr) && "error" || s.ifModified && jQuery.httpNotModified(xhr, s.url) && "notmodified" || "success"; | |
if (status == "success") { | |
try { | |
data = jQuery.httpData(xhr, s.dataType, s.dataFilter) | |
} catch (e) { | |
status = "parsererror" | |
} | |
} | |
if (status == "success") { | |
var modRes; | |
try { | |
modRes = xhr.getResponseHeader("Last-Modified") | |
} catch (e) {} | |
if (s.ifModified && modRes) { | |
jQuery.lastModified[s.url] = modRes | |
} | |
if (!jsonp) { | |
success() | |
} | |
} else { | |
jQuery.handleError(s, xhr, status) | |
} | |
complete(); | |
if (s.async) { | |
xhr = null | |
} | |
} | |
}; | |
if (s.async) { | |
var ival = setInterval(onreadystatechange, 13); | |
if (s.timeout > 0) { | |
setTimeout(function() { | |
if (xhr) { | |
xhr.abort(); | |
if (!requestDone) { | |
onreadystatechange("timeout") | |
} | |
} | |
}, s.timeout) | |
} | |
} | |
try { | |
xhr.send(s.data) | |
} catch (e) { | |
jQuery.handleError(s, xhr, null, e) | |
} | |
if (!s.async) { | |
onreadystatechange() | |
} | |
function success() { | |
if (s.success) { | |
s.success(data, status, xhr) | |
} | |
if (s.global) { | |
jQuery.event.trigger("ajaxSuccess", [xhr, s]) | |
} | |
} | |
function complete() { | |
if (s.complete) { | |
s.complete(xhr, status) | |
} | |
if (s.global) { | |
jQuery.event.trigger("ajaxComplete", [xhr, s]) | |
} | |
if (s.global && !--jQuery.active) { | |
jQuery.event.trigger("ajaxStop") | |
} | |
} | |
return xhr | |
}, | |
handleError: function(s, xhr, status, e) { | |
if (s.error) { | |
s.error(xhr, status, e) | |
} | |
if (s.global) { | |
jQuery.event.trigger("ajaxError", [xhr, s, e]) | |
} | |
}, | |
active: 0, | |
httpSuccess: function(xhr) { | |
try { | |
return !xhr.status && location.protocol == "file:" || (xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || xhr.status == 1223 || jQuery.browser.webkit && xhr.status == undefined | |
} catch (e) {} | |
return false | |
}, | |
httpNotModified: function(xhr, url) { | |
try { | |
var xhrRes = xhr.getResponseHeader("Last-Modified"); | |
return xhr.status == 304 || xhrRes == jQuery.lastModified[url] || jQuery.browser.webkit && xhr.status == undefined | |
} catch (e) {} | |
return false | |
}, | |
httpData: function(xhr, type, filter) { | |
var ct = xhr.getResponseHeader("content-type"), | |
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, | |
data = xml ? xhr.responseXML : xhr.responseText; | |
if (xml && data.documentElement.tagName == "parsererror") { | |
throw "parsererror" | |
} | |
if (filter) { | |
data = filter(data, type) | |
} | |
if (type == "script") { | |
jQuery.globalEval(data) | |
} | |
if (type == "json") { | |
data = eval("(" + data + ")") | |
} | |
return data | |
}, | |
param: function(a) { | |
var s = []; | |
if (a.constructor == Array || a.jquery) { | |
jQuery.each(a, function() { | |
s.push(encodeURIComponent(this.name) + "=" + encodeURIComponent(this.value)) | |
}) | |
} else { | |
for (var j in a) { | |
if (a[j] && a[j].constructor == Array) { | |
jQuery.each(a[j], function() { | |
s.push(encodeURIComponent(j) + "=" + encodeURIComponent(this)) | |
}) | |
} else { | |
s.push(encodeURIComponent(j) + "=" + encodeURIComponent(jQuery.isFunction(a[j]) ? a[j]() : a[j])) | |
} | |
} | |
} | |
return s.join("&").replace(/%20/g, "+") | |
} | |
}); | |
jQuery.fn.extend({ | |
show: function(speed, callback) { | |
return speed ? this.animate({ | |
height: "show", | |
width: "show", | |
opacity: "show" | |
}, speed, callback) : this.filter(":hidden").each(function() { | |
this.style.display = this.oldblock || ""; | |
if (jQuery.css(this, "display") == "none") { | |
var elem = jQuery("<" + this.tagName + " />").appendTo("body"); | |
this.style.display = elem.css("display"); | |
if (this.style.display == "none") { | |
this.style.display = "block" | |
} | |
elem.remove() | |
} | |
}).end() | |
}, | |
hide: function(speed, callback) { | |
return speed ? this.animate({ | |
height: "hide", | |
width: "hide", | |
opacity: "hide" | |
}, speed, callback) : this.filter(":visible").each(function() { | |
this.oldblock = this.oldblock || jQuery.css(this, "display"); | |
this.style.display = "none" | |
}).end() | |
}, | |
_toggle: jQuery.fn.toggle, | |
toggle: function(fn, fn2) { | |
return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? this._toggle.apply(this, arguments) : fn ? this.animate({ | |
height: "toggle", | |
width: "toggle", | |
opacity: "toggle" | |
}, fn, fn2) : this.each(function() { | |
jQuery(this)[jQuery(this).is(":hidden") ? "show" : "hide"]() | |
}) | |
}, | |
slideDown: function(speed, callback) { | |
return this.animate({ | |
height: "show" | |
}, speed, callback) | |
}, | |
slideUp: function(speed, callback) { | |
return this.animate({ | |
height: "hide" | |
}, speed, callback) | |
}, | |
slideToggle: function(speed, callback) { | |
return this.animate({ | |
height: "toggle" | |
}, speed, callback) | |
}, | |
fadeIn: function(speed, callback) { | |
return this.animate({ | |
opacity: "show" | |
}, speed, callback) | |
}, | |
fadeOut: function(speed, callback) { | |
return this.animate({ | |
opacity: "hide" | |
}, speed, callback) | |
}, | |
fadeTo: function(speed, to, callback) { | |
return this.animate({ | |
opacity: to | |
}, speed, callback) | |
}, | |
animate: function(prop, speed, easing, callback) { | |
var optall = jQuery.speed(speed, easing, callback); | |
return this[optall.queue === false ? "each" : "queue"](function() { | |
if (this.nodeType != 1) { | |
return false | |
} | |
var opt = jQuery.extend({}, optall), | |
p, hidden = jQuery(this).is(":hidden"), | |
self = this; | |
for (p in prop) { | |
if (prop[p] == "hide" && hidden || prop[p] == "show" && !hidden) { | |
return opt.complete.call(this) | |
} | |
if (p == "height" || p == "width") { | |
opt.display = jQuery.css(this, "display"); | |
opt.overflow = this.style.overflow | |
} | |
} | |
if (opt.overflow != null) { | |
this.style.overflow = "hidden" | |
} | |
opt.curAnim = jQuery.extend({}, prop); | |
jQuery.each(prop, function(name, val) { | |
var e = new jQuery.fx(self, opt, name); | |
if (/toggle|show|hide/.test(val)) { | |
e[val == "toggle" ? hidden ? "show" : "hide" : val](prop) | |
} else { | |
var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), | |
start = e.cur(true) || 0; | |
if (parts) { | |
var end = parseFloat(parts[2]), | |
unit = parts[3] || "px"; | |
if (unit != "px") { | |
self.style[name] = (end || 1) + unit; | |
start = ((end || 1) / e.cur(true)) * start; | |
self.style[name] = start + unit | |
} | |
if (parts[1]) { | |
end = ((parts[1] == "-=" ? -1 : 1) * end) + start | |
} | |
e.custom(start, end, unit) | |
} else { | |
e.custom(start, val, "") | |
} | |
} | |
}); | |
return true | |
}) | |
}, | |
queue: function(type, fn) { | |
if (jQuery.isFunction(type) || (type && type.constructor == Array)) { | |
fn = type; | |
type = "fx" | |
} | |
if (!type || (typeof type == "string" && !fn)) { | |
return queue(this[0], type) | |
} | |
return this.each(function() { | |
if (fn.constructor == Array) { | |
queue(this, type, fn) | |
} else { | |
queue(this, type).push(fn); | |
if (queue(this, type).length == 1) { | |
fn.call(this) | |
} | |
} | |
}) | |
}, | |
stop: function(clearQueue, gotoEnd) { | |
var timers = jQuery.timers; | |
if (clearQueue) { | |
this.queue([]) | |
} | |
this.each(function() { | |
for (var i = timers.length - 1; i >= 0; i--) { | |
if (timers[i].elem == this) { | |
if (gotoEnd) { | |
timers[i](true) | |
} | |
timers.splice(i, 1) | |
} | |
} | |
}); | |
if (!gotoEnd) { | |
this.dequeue() | |
} | |
return this | |
} | |
}); | |
var queue = function(elem, type, array) { | |
if (elem) { | |
type = type || "fx"; | |
var q = jQuery.data(elem, type + "queue"); | |
if (!q || array) { | |
q = jQuery.data(elem, type + "queue", jQuery.makeArray(array)) | |
} | |
} | |
return q | |
}; | |
jQuery.fn.dequeue = function(type) { | |
type = type || "fx"; | |
return this.each(function() { | |
var q = queue(this, type); | |
q.shift(); | |
if (q.length) { | |
q[0].call(this) | |
} | |
}) | |
}; | |
jQuery.extend({ | |
speed: function(speed, easing, fn) { | |
var opt = speed && speed.constructor == Object ? speed : { | |
complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, | |
duration: speed, | |
easing: fn && easing || easing && easing.constructor != Function && easing | |
}; | |
opt.duration = (opt.duration && opt.duration.constructor == Number ? opt.duration : jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def; | |
opt.old = opt.complete; | |
opt.complete = function() { | |
if (opt.queue !== false) { | |
jQuery(this).dequeue() | |
} | |
if (jQuery.isFunction(opt.old)) { | |
opt.old.call(this) | |
} | |
}; | |
return opt | |
}, | |
easing: { | |
linear: function(p, n, firstNum, diff) { | |
return firstNum + diff * p | |
}, | |
swing: function(p, n, firstNum, diff) { | |
return ((-Math.cos(p * Math.PI) / 2) + 0.5) * diff + firstNum | |
} | |
}, | |
timers: [], | |
timerId: null, | |
fx: function(elem, options, prop) { | |
this.options = options; | |
this.elem = elem; | |
this.prop = prop; | |
if (!options.orig) { | |
options.orig = {} | |
} | |
} | |
}); | |
jQuery.fx.prototype = { | |
update: function() { | |
if (this.options.step) { | |
this.options.step.call(this.elem, this.now, this) | |
}(jQuery.fx.step[this.prop] || jQuery.fx.step._default)(this); | |
if (this.prop == "height" || this.prop == "width") { | |
this.elem.style.display = "block" | |
} | |
}, | |
cur: function(force) { | |
if (this.elem[this.prop] != null && this.elem.style[this.prop] == null) { | |
return this.elem[this.prop] | |
} | |
var r = parseFloat(jQuery.css(this.elem, this.prop, force)); | |
return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0 | |
}, | |
custom: function(from, to, unit) { | |
this.startTime = now(); | |
this.start = from; | |
this.end = to; | |
this.unit = unit || this.unit || "px"; | |
this.now = this.start; | |
this.pos = this.state = 0; | |
this.update(); | |
var self = this; | |
function t(gotoEnd) { | |
return self.step(gotoEnd) | |
} | |
t.elem = this.elem; | |
jQuery.timers.push(t); | |
if (jQuery.timerId == null) { | |
jQuery.timerId = setInterval(function() { | |
var timers = jQuery.timers; | |
for (var i = 0; i < timers.length; i++) { | |
if (!timers[i]()) { | |
timers.splice(i--, 1) | |
} | |
} | |
if (!timers.length) { | |
clearInterval(jQuery.timerId); | |
jQuery.timerId = null | |
} | |
}, 13) | |
} | |
}, | |
show: function() { | |
this.options.orig[this.prop] = jQuery.attr(this.elem.style, this.prop); | |
this.options.show = true; | |
this.custom(0, this.cur()); | |
if (this.prop == "width" || this.prop == "height") { | |
this.elem.style[this.prop] = "1px" | |
} | |
jQuery(this.elem).show() | |
}, | |
hide: function() { | |
this.options.orig[this.prop] = jQuery.attr(this.elem.style, this.prop); | |
this.options.hide = true; | |
this.custom(this.cur(), 0) | |
}, | |
step: function(gotoEnd) { | |
var t = now(); | |
if (gotoEnd || t > this.options.duration + this.startTime) { | |
this.now = this.end; | |
this.pos = this.state = 1; | |
this.update(); | |
this.options.curAnim[this.prop] = true; | |
var done = true; | |
for (var i in this.options.curAnim) { | |
if (this.options.curAnim[i] !== true) { | |
done = false | |
} | |
} | |
if (done) { | |
if (this.options.display != null) { | |
this.elem.style.overflow = this.options.overflow; | |
this.elem.style.display = this.options.display; | |
if (jQuery.css(this.elem, "display") == "none") { | |
this.elem.style.display = "block" | |
} | |
} | |
if (this.options.hide) { | |
this.elem.style.display = "none" | |
} | |
if (this.options.hide || this.options.show) { | |
for (var p in this.options.curAnim) { | |
jQuery.attr(this.elem.style, p, this.options.orig[p]) | |
} | |
} | |
} | |
if (done) { | |
this.options.complete.call(this.elem) | |
} | |
return false | |
} else { | |
var n = t - this.startTime; | |
this.state = n / this.options.duration; | |
this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); | |
this.now = this.start + ((this.end - this.start) * this.pos); | |
this.update() | |
} | |
return true | |
} | |
}; | |
jQuery.extend(jQuery.fx, { | |
speeds: { | |
slow: 600, | |
fast: 200, | |
def: 400 | |
}, | |
step: { | |
scrollLeft: function(fx) { | |
fx.elem.scrollLeft = fx.now | |
}, | |
scrollTop: function(fx) { | |
fx.elem.scrollTop = fx.now | |
}, | |
opacity: function(fx) { | |
jQuery.attr(fx.elem.style, "opacity", fx.now) | |
}, | |
_default: function(fx) { | |
fx.elem.style[fx.prop] = fx.now + fx.unit | |
} | |
} | |
}); | |
jQuery.fn.offset = function() { | |
var left = 0, | |
top = 0, | |
elem = this[0], | |
results; | |
if (elem) { | |
with(jQuery.browser) { | |
var parent = elem.parentNode, | |
offsetChild = elem, | |
offsetParent = elem.offsetParent, | |
doc = elem.ownerDocument, | |
safari2 = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent), | |
css = jQuery.curCSS, | |
fixed = css(elem, "position") == "fixed"; | |
if (elem.getBoundingClientRect) { | |
var box = elem.getBoundingClientRect(); | |
add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)); | |
add(-doc.documentElement.clientLeft, -doc.documentElement.clientTop) | |
} else { | |
add(elem.offsetLeft, elem.offsetTop); | |
while (offsetParent) { | |
add(offsetParent.offsetLeft, offsetParent.offsetTop); | |
if (mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2) { | |
border(offsetParent) | |
} | |
if (!fixed && css(offsetParent, "position") == "fixed") { | |
fixed = true | |
} | |
offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent; | |
offsetParent = offsetParent.offsetParent | |
} | |
while (parent && parent.tagName && !/^body|html$/i.test(parent.tagName)) { | |
if (!/^inline|table.*$/i.test(css(parent, "display"))) { | |
add(-parent.scrollLeft, -parent.scrollTop) | |
} | |
if (mozilla && css(parent, "overflow") != "visible") { | |
border(parent) | |
} | |
parent = parent.parentNode | |
} | |
if ((safari2 && (fixed || css(offsetChild, "position") == "absolute")) || (mozilla && css(offsetChild, "position") != "absolute")) { | |
add(-doc.body.offsetLeft, -doc.body.offsetTop) | |
} | |
if (fixed) { | |
add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)) | |
} | |
} | |
results = { | |
top: top, | |
left: left | |
} | |
} | |
} | |
function border(elem) { | |
add(jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true)) | |
} | |
function add(l, t) { | |
left += parseInt(l, 10) || 0; | |
top += parseInt(t, 10) || 0 | |
} | |
return results | |
}; | |
jQuery.fn.extend({ | |
position: function() { | |
var left = 0, | |
top = 0, | |
results; | |
if (this[0]) { | |
var offsetParent = this.offsetParent(), | |
offset = this.offset(), | |
parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { | |
top: 0, | |
left: 0 | |
} : offsetParent.offset(); | |
offset.top -= num(this, "marginTop"); | |
offset.left -= num(this, "marginLeft"); | |
parentOffset.top += num(offsetParent, "borderTopWidth"); | |
parentOffset.left += num(offsetParent, "borderLeftWidth"); | |
results = { | |
top: offset.top - parentOffset.top, | |
left: offset.left - parentOffset.left | |
} | |
} | |
return results | |
}, | |
offsetParent: function() { | |
var offsetParent = this[0].offsetParent; | |
while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, "position") == "static")) { | |
offsetParent = offsetParent.offsetParent | |
} | |
return jQuery(offsetParent) | |
} | |
}); | |
jQuery.each(["Left", "Top"], function(i, name) { | |
var method = "scroll" + name; | |
jQuery.fn[method] = function(val) { | |
if (!this[0]) { | |
return | |
} | |
return val != undefined ? this.each(function() { | |
this == window || this == document ? window.scrollTo(!i ? val : jQuery(window).scrollLeft(), i ? val : jQuery(window).scrollTop()) : this[method] = val | |
}) : this[0] == window || this[0] == document ? self[i ? "pageYOffset" : "pageXOffset"] || jQuery.boxModel && document.documentElement[method] || document.body[method] : this[0][method] | |
} | |
}); | |
jQuery.each(["Height", "Width"], function(i, name) { | |
var tl = i ? "Left" : "Top", | |
br = i ? "Right" : "Bottom"; | |
jQuery.fn["inner" + name] = function() { | |
return this[name.toLowerCase()]() + num(this, "padding" + tl) + num(this, "padding" + br) | |
}; | |
jQuery.fn["outer" + name] = function(margin) { | |
return this["inner" + name]() + num(this, "border" + tl + "Width") + num(this, "border" + br + "Width") + (margin ? num(this, "margin" + tl) + num(this, "margin" + br) : 0) | |
} | |
}) | |
})(); | |
/*! | |
* jQuery UI 1.5.3 | |
* | |
* Copyright (c) 2008 Paul Bakaus (ui.jquery.com) | |
* Dual licensed under the MIT (MIT-LICENSE.txt) | |
* and GPL (GPL-LICENSE.txt) licenses. | |
* | |
* http://docs.jquery.com/UI | |
*/ | |
; | |
(function(c) { | |
c.ui = { | |
plugin: { | |
add: function(e, f, h) { | |
var g = c.ui[e].prototype; | |
for (var d in h) { | |
g.plugins[d] = g.plugins[d] || []; | |
g.plugins[d].push([f, h[d]]) | |
} | |
}, | |
call: function(d, f, e) { | |
var h = d.plugins[f]; | |
if (!h) { | |
return | |
} | |
for (var g = 0; g < h.length; g++) { | |
if (d.options[h[g][0]]) { | |
h[g][1].apply(d.element, e) | |
} | |
} | |
} | |
}, | |
cssCache: {}, | |
css: function(d) { | |
if (c.ui.cssCache[d]) { | |
return c.ui.cssCache[d] | |
} | |
var f = c('<div class="ui-gen">').addClass(d).css({ | |
position: "absolute", | |
top: "-5000px", | |
left: "-5000px", | |
display: "block" | |
}).appendTo("body"); | |
c.ui.cssCache[d] = !!((!(/auto|default/).test(f.css("cursor")) || (/^[1-9]/).test(f.css("height")) || (/^[1-9]/).test(f.css("width")) || !(/none/).test(f.css("backgroundImage")) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(f.css("backgroundColor")))); | |
try { | |
c("body").get(0).removeChild(f.get(0)) | |
} catch (g) {} | |
return c.ui.cssCache[d] | |
}, | |
disableSelection: function(d) { | |
c(d).attr("unselectable", "on").css("MozUserSelect", "none") | |
}, | |
enableSelection: function(d) { | |
c(d).attr("unselectable", "off").css("MozUserSelect", "") | |
}, | |
hasScroll: function(h, f) { | |
var d = /top/.test(f || "top") ? "scrollTop" : "scrollLeft", | |
g = false; | |
if (h[d] > 0) { | |
return true | |
} | |
h[d] = 1; | |
g = h[d] > 0 ? true : false; | |
h[d] = 0; | |
return g | |
} | |
}; | |
var b = c.fn.remove; | |
c.fn.remove = function() { | |
c("*", this).add(this).triggerHandler("remove"); | |
return b.apply(this, arguments) | |
}; | |
function a(e, f, g) { | |
var d = c[e][f].getter || []; | |
d = (typeof d == "string" ? d.split(/,?\s+/) : d); | |
return (c.inArray(g, d) != -1) | |
} | |
c.widget = function(e, d) { | |
var f = e.split(".")[0]; | |
e = e.split(".")[1]; | |
c.fn[e] = function(k) { | |
var h = (typeof k == "string"), | |
j = Array.prototype.slice.call(arguments, 1); | |
if (h && a(f, e, k)) { | |
var g = c.data(this[0], e); | |
return (g ? g[k].apply(g, j) : undefined) | |
} | |
return this.each(function() { | |
var l = c.data(this, e); | |
if (h && l && c.isFunction(l[k])) { | |
l[k].apply(l, j) | |
} else { | |
if (!h) { | |
c.data(this, e, new c[f][e](this, k)) | |
} | |
} | |
}) | |
}; | |
c[f][e] = function(j, h) { | |
var g = this; | |
this.widgetName = e; | |
this.widgetBaseClass = f + "-" + e; | |
this.options = c.extend({}, c.widget.defaults, c[f][e].defaults, h); | |
this.element = c(j).bind("setData." + e, function(m, k, l) { | |
return g.setData(k, l) | |
}).bind("getData." + e, function(l, k) { | |
return g.getData(k) | |
}).bind("remove", function() { | |
return g.destroy() | |
}); | |
this.init() | |
}; | |
c[f][e].prototype = c.extend({}, c.widget.prototype, d) | |
}; | |
c.widget.prototype = { | |
init: function() {}, | |
destroy: function() { | |
this.element.removeData(this.widgetName) | |
}, | |
getData: function(d) { | |
return this.options[d] | |
}, | |
setData: function(d, e) { | |
this.options[d] = e; | |
if (d == "disabled") { | |
this.element[e ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled") | |
} | |
}, | |
enable: function() { | |
this.setData("disabled", false) | |
}, | |
disable: function() { | |
this.setData("disabled", true) | |
} | |
}; | |
c.widget.defaults = { | |
disabled: false | |
}; | |
c.ui.mouse = { | |
mouseInit: function() { | |
var d = this; | |
this.element.bind("mousedown." + this.widgetName, function(f) { | |
return d.mouseDown(f) | |
}); | |
if (c.browser.msie) { | |
this._mouseUnselectable = this.element.attr("unselectable"); | |
this.element.attr("unselectable", "on") | |
} | |
this.started = false | |
}, | |
mouseDestroy: function() { | |
this.element.unbind("." + this.widgetName); | |
(c.browser.msie && this.element.attr("unselectable", this._mouseUnselectable)) | |
}, | |
mouseDown: function(g) { | |
(this._mouseStarted && this.mouseUp(g)); | |
this._mouseDownEvent = g; | |
var f = this, | |
h = (g.which == 1), | |
d = (typeof this.options.cancel == "string" ? c(g.target).parents().add(g.target).filter(this.options.cancel).length : false); | |
if (!h || d || !this.mouseCapture(g)) { | |
return true | |
} | |
this._mouseDelayMet = !this.options.delay; | |
if (!this._mouseDelayMet) { | |
this._mouseDelayTimer = setTimeout(function() { | |
f._mouseDelayMet = true | |
}, this.options.delay) | |
} | |
if (this.mouseDistanceMet(g) && this.mouseDelayMet(g)) { | |
this._mouseStarted = (this.mouseStart(g) !== false); | |
if (!this._mouseStarted) { | |
g.preventDefault(); | |
return true | |
} | |
} | |
this._mouseMoveDelegate = function(j) { | |
return f.mouseMove(j) | |
}; | |
this._mouseUpDelegate = function(j) { | |
return f.mouseUp(j) | |
}; | |
c(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); | |
return false | |
}, | |
mouseMove: function(d) { | |
if (c.browser.msie && document.documentMode >= 9) { | |
d.button = 1 | |
} | |
if (c.browser.msie && !d.button) { | |
return this.mouseUp(d) | |
} | |
if (this._mouseStarted) { | |
this.mouseDrag(d); | |
return false | |
} | |
if (this.mouseDistanceMet(d) && this.mouseDelayMet(d)) { | |
this._mouseStarted = (this.mouseStart(this._mouseDownEvent, d) !== false); | |
(this._mouseStarted ? this.mouseDrag(d) : this.mouseUp(d)) | |
} | |
return !this._mouseStarted | |
}, | |
mouseUp: function(d) { | |
c(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); | |
if (this._mouseStarted) { | |
this._mouseStarted = false; | |
this.mouseStop(d) | |
} | |
return false | |
}, | |
mouseDistanceMet: function(d) { | |
return (Math.max(Math.abs(this._mouseDownEvent.pageX - d.pageX), Math.abs(this._mouseDownEvent.pageY - d.pageY)) >= this.options.distance) | |
}, | |
mouseDelayMet: function(d) { | |
return this._mouseDelayMet | |
}, | |
mouseStart: function(d) {}, | |
mouseDrag: function(d) {}, | |
mouseStop: function(d) {}, | |
mouseCapture: function(d) { | |
return true | |
} | |
}; | |
c.ui.mouse.defaults = { | |
cancel: null, | |
distance: 1, | |
delay: 0 | |
} | |
})(jQuery); | |
/*! | |
* jQuery UI Touch Punch 0.2.2 | |
* | |
* Copyright 2011, Dave Furfero | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* | |
* Depends: | |
* jquery.ui.widget.js | |
* jquery.ui.mouse.js | |
*/ | |
(function(b) { | |
if (!b.support) { | |
b.support = {} | |
} | |
if (!b.support.touch) { | |
return | |
} | |
var c = b.ui.mouse, | |
e = c.mouseInit, | |
a; | |
function d(g, h) { | |
if (g.originalEvent.touches.length > 1) { | |
return | |
} | |
g.preventDefault(); | |
var j = g.originalEvent.changedTouches[0], | |
f = document.createEvent("MouseEvents"); | |
f.initMouseEvent(h, true, true, window, 1, j.screenX, j.screenY, j.clientX, j.clientY, false, false, false, false, 0, null); | |
g.target.dispatchEvent(f) | |
} | |
c._touchStart = function(g) { | |
var f = this; | |
if (a || !f.mouseCapture(g.originalEvent.changedTouches[0])) { | |
return | |
} | |
a = true; | |
f._touchMoved = false; | |
d(g, "mouseover"); | |
d(g, "mousemove"); | |
d(g, "mousedown") | |
}; | |
c._touchMove = function(f) { | |
if (!a) { | |
return | |
} | |
this._touchMoved = true; | |
d(f, "mousemove") | |
}; | |
c._touchEnd = function(f) { | |
if (!a) { | |
return | |
} | |
d(f, "mouseup"); | |
d(f, "mouseout"); | |
if (!this._touchMoved) { | |
d(f, "click") | |
} | |
a = false | |
}; | |
c.mouseInit = function() { | |
var f = this; | |
f.element.bind("touchstart", function(g) { | |
f._touchStart.call(f, g) | |
}).bind("touchmove", function(g) { | |
f._touchMove.call(f, g) | |
}).bind("touchend", function(g) { | |
f._touchEnd.call(f, g) | |
}); | |
e.call(f) | |
} | |
})(jQuery); | |
(function(a) { | |
a.widget("ui.draggable", a.extend({}, a.ui.mouse, { | |
init: function() { | |
var b = this.options; | |
if (b.helper == "original" && !(/(relative|absolute|fixed)/).test(this.element.css("position"))) { | |
this.element.css("position", "relative") | |
} | |
this.element.addClass("ui-draggable"); | |
(b.disabled && this.element.addClass("ui-draggable-disabled")); | |
this.mouseInit() | |
}, | |
mouseStart: function(g) { | |
var j = this.options; | |
if (this.helper || j.disabled || a(g.target).is(".ui-resizable-handle")) { | |
return false | |
} | |
var c = !this.options.handle || !a(this.options.handle, this.element).length ? true : false; | |
a(this.options.handle, this.element).find("*").andSelf().each(function() { | |
if (this == g.target) { | |
c = true | |
} | |
}); | |
if (!c) { | |
return false | |
} | |
if (a.ui.ddmanager) { | |
a.ui.ddmanager.current = this | |
} | |
this.helper = a.isFunction(j.helper) ? a(j.helper.apply(this.element[0], [g])) : (j.helper == "clone" ? this.element.clone() : this.element); | |
if (!this.helper.parents("body").length) { | |
this.helper.appendTo((j.appendTo == "parent" ? this.element[0].parentNode : j.appendTo)) | |
} | |
if (this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) { | |
this.helper.css("position", "absolute") | |
} | |
this.margins = { | |
left: (parseInt(this.element.css("marginLeft"), 10) || 0), | |
top: (parseInt(this.element.css("marginTop"), 10) || 0) | |
}; | |
this.cssPosition = this.helper.css("position"); | |
this.offset = this.element.offset(); | |
this.offset = { | |
top: this.offset.top - this.margins.top, | |
left: this.offset.left - this.margins.left | |
}; | |
this.offset.click = { | |
left: g.pageX - this.offset.left, | |
top: g.pageY - this.offset.top | |
}; | |
this.offsetParent = this.helper.offsetParent(); | |
var b = this.offsetParent.offset(); | |
if (this.offsetParent[0] == document.body && a.browser.mozilla) { | |
b = { | |
top: 0, | |
left: 0 | |
} | |
} | |
this.offset.parent = { | |
top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), | |
left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) | |
}; | |
var f = this.element.position(); | |
this.offset.relative = this.cssPosition == "relative" ? { | |
top: f.top - (parseInt(this.helper.css("top"), 10) || 0) + this.offsetParent[0].scrollTop, | |
left: f.left - (parseInt(this.helper.css("left"), 10) || 0) + this.offsetParent[0].scrollLeft | |
} : { | |
top: 0, | |
left: 0 | |
}; | |
this.originalPosition = this.generatePosition(g); | |
this.helperProportions = { | |
width: this.helper.outerWidth(), | |
height: this.helper.outerHeight() | |
}; | |
if (j.cursorAt) { | |
if (j.cursorAt.left != undefined) { | |
this.offset.click.left = j.cursorAt.left + this.margins.left | |
} | |
if (j.cursorAt.right != undefined) { | |
this.offset.click.left = this.helperProportions.width - j.cursorAt.right + this.margins.left | |
} | |
if (j.cursorAt.top != undefined) { | |
this.offset.click.top = j.cursorAt.top + this.margins.top | |
} | |
if (j.cursorAt.bottom != undefined) { | |
this.offset.click.top = this.helperProportions.height - j.cursorAt.bottom + this.margins.top | |
} | |
} | |
if (j.containment) { | |
if (j.containment == "parent") { | |
j.containment = this.helper[0].parentNode | |
} | |
if (j.containment == "document" || j.containment == "window") { | |
this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(j.containment == "document" ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"), 10) || 0), (a(j.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"), 10) || 0)] | |
} | |
if (!(/^(document|window|parent)$/).test(j.containment)) { | |
var d = a(j.containment)[0]; | |
var h = a(j.containment).offset(); | |
this.containment = [h.left + (parseInt(a(d).css("borderLeftWidth"), 10) || 0) - this.offset.relative.left - this.offset.parent.left, h.top + (parseInt(a(d).css("borderTopWidth"), 10) || 0) - this.offset.relative.top - this.offset.parent.top, h.left + Math.max(d.scrollWidth, d.offsetWidth) - (parseInt(a(d).css("borderLeftWidth"), 10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"), 10) || 0), h.top + Math.max(d.scrollHeight, d.offsetHeight) - (parseInt(a(d).css("borderTopWidth"), 10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"), 10) || 0)] | |
} | |
} | |
this.propagate("start", g); | |
this.helperProportions = { | |
width: this.helper.outerWidth(), | |
height: this.helper.outerHeight() | |
}; | |
if (a.ui.ddmanager && !j.dropBehaviour) { | |
a.ui.ddmanager.prepareOffsets(this, g) | |
} | |
this.helper.addClass("ui-draggable-dragging"); | |
this.mouseDrag(g); | |
return true | |
}, | |
convertPositionTo: function(c, e) { | |
if (!e) { | |
e = this.position | |
} | |
var b = c == "absolute" ? 1 : -1; | |
return { | |
top: (e.top + this.offset.relative.top * b + this.offset.parent.top * b - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * b + (this.cssPosition == "fixed" ? a(document).scrollTop() : 0) * b + this.margins.top * b), | |
left: (e.left + this.offset.relative.left * b + this.offset.parent.left * b - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * b + (this.cssPosition == "fixed" ? a(document).scrollLeft() : 0) * b + this.margins.left * b) | |
} | |
}, | |
generatePosition: function(f) { | |
var g = this.options; | |
var b = { | |
top: (f.pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) - (this.cssPosition == "fixed" ? a(document).scrollTop() : 0)), | |
left: (f.pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) - (this.cssPosition == "fixed" ? a(document).scrollLeft() : 0)) | |
}; | |
if (!this.originalPosition) { | |
return b | |
} | |
if (this.containment) { | |
if (b.left < this.containment[0]) { | |
b.left = this.containment[0] | |
} | |
if (b.top < this.containment[1]) { | |
b.top = this.containment[1] | |
} | |
if (b.left > this.containment[2]) { | |
b.left = this.containment[2] | |
} | |
if (b.top > this.containment[3]) { | |
b.top = this.containment[3] | |
} | |
} | |
if (g.grid) { | |
var d = this.originalPosition.top + Math.round((b.top - this.originalPosition.top) / g.grid[1]) * g.grid[1]; | |
b.top = this.containment ? (!(d < this.containment[1] || d > this.containment[3]) ? d : (!(d < this.containment[1]) ? d - g.grid[1] : d + g.grid[1])) : d; | |
var c = this.originalPosition.left + Math.round((b.left - this.originalPosition.left) / g.grid[0]) * g.grid[0]; | |
b.left = this.containment ? (!(c < this.containment[0] || c > this.containment[2]) ? c : (!(c < this.containment[0]) ? c - g.grid[0] : c + g.grid[0])) : c | |
} | |
return b | |
}, | |
mouseDrag: function(b) { | |
this.position = this.generatePosition(b); | |
this.positionAbs = this.convertPositionTo("absolute"); | |
this.position = this.propagate("drag", b) || this.position; | |
if (!this.options.axis || this.options.axis != "y") { | |
this.helper[0].style.left = this.position.left + "px" | |
} | |
if (!this.options.axis || this.options.axis != "x") { | |
this.helper[0].style.top = this.position.top + "px" | |
} | |
if (a.ui.ddmanager) { | |
a.ui.ddmanager.drag(this, b) | |
} | |
return false | |
}, | |
mouseStop: function(c) { | |
var d = false; | |
if (a.ui.ddmanager && !this.options.dropBehaviour) { | |
var d = a.ui.ddmanager.drop(this, c) | |
} | |
if ((this.options.revert == "invalid" && !d) || (this.options.revert == "valid" && d) || this.options.revert === true) { | |
var b = this; | |
a(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() { | |
b.propagate("stop", c); | |
b.clear() | |
}) | |
} else { | |
this.propagate("stop", c); | |
this.clear() | |
} | |
return false | |
}, | |
clear: function() { | |
this.helper.removeClass("ui-draggable-dragging"); | |
if (this.options.helper != "original" && !this.cancelHelperRemoval) { | |
this.helper.remove() | |
} | |
this.helper = null; | |
this.cancelHelperRemoval = false | |
}, | |
plugins: {}, | |
uiHash: function(b) { | |
return { | |
helper: this.helper, | |
position: this.position, | |
absolutePosition: this.positionAbs, | |
options: this.options | |
} | |
}, | |
propagate: function(c, b) { | |
a.ui.plugin.call(this, c, [b, this.uiHash()]); | |
if (c == "drag") { | |
this.positionAbs = this.convertPositionTo("absolute") | |
} | |
return this.element.triggerHandler(c == "drag" ? c : "drag" + c, [b, this.uiHash()], this.options[c]) | |
}, | |
destroy: function() { | |
if (!this.element.data("draggable")) { | |
return | |
} | |
this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"); | |
this.mouseDestroy() | |
} | |
})); | |
a.extend(a.ui.draggable, { | |
defaults: { | |
appendTo: "parent", | |
axis: false, | |
cancel: ":input", | |
delay: 0, | |
distance: 1, | |
helper: "original" | |
} | |
}); | |
a.ui.plugin.add("draggable", "cursor", { | |
start: function(d, c) { | |
var b = a("body"); | |
if (b.css("cursor")) { | |
c.options._cursor = b.css("cursor") | |
} | |
b.css("cursor", c.options.cursor) | |
}, | |
stop: function(c, b) { | |
if (b.options._cursor) { | |
a("body").css("cursor", b.options._cursor) | |
} | |
} | |
}); | |
a.ui.plugin.add("draggable", "zIndex", { | |
start: function(d, c) { | |
var b = a(c.helper); | |
if (b.css("zIndex")) { | |
c.options._zIndex = b.css("zIndex") | |
} | |
b.css("zIndex", c.options.zIndex) | |
}, | |
stop: function(c, b) { | |
if (b.options._zIndex) { | |
a(b.helper).css("zIndex", b.options._zIndex) | |
} | |
} | |
}); | |
a.ui.plugin.add("draggable", "opacity", { | |
start: function(d, c) { | |
var b = a(c.helper); | |
if (b.css("opacity")) { | |
c.options._opacity = b.css("opacity") | |
} | |
b.css("opacity", c.options.opacity) | |
}, | |
stop: function(c, b) { | |
if (b.options._opacity) { | |
a(b.helper).css("opacity", b.options._opacity) | |
} | |
} | |
}); | |
a.ui.plugin.add("draggable", "iframeFix", { | |
start: function(c, b) { | |
a(b.options.iframeFix === true ? "iframe" : b.options.iframeFix).each(function() { | |
a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({ | |
width: this.offsetWidth + "px", | |
height: this.offsetHeight + "px", | |
position: "absolute", | |
opacity: "0.001", | |
zIndex: 1000 | |
}).css(a(this).offset()).appendTo("body") | |
}) | |
}, | |
stop: function(c, b) { | |
a("div.DragDropIframeFix").each(function() { | |
this.parentNode.removeChild(this) | |
}) | |
} | |
}); | |
a.ui.plugin.add("draggable", "scroll", { | |
start: function(d, c) { | |
var f = c.options; | |
var b = a(this).data("draggable"); | |
f.scrollSensitivity = f.scrollSensitivity || 20; | |
f.scrollSpeed = f.scrollSpeed || 20; | |
b.overflowY = function(e) { | |
do { | |
if (/auto|scroll/.test(e.css("overflow")) || (/auto|scroll/).test(e.css("overflow-y"))) { | |
return e | |
} | |
e = e.parent() | |
} while (e[0].parentNode); | |
return a(document) | |
}(this); | |
b.overflowX = function(e) { | |
do { | |
if (/auto|scroll/.test(e.css("overflow")) || (/auto|scroll/).test(e.css("overflow-x"))) { | |
return e | |
} | |
e = e.parent() | |
} while (e[0].parentNode); | |
return a(document) | |
}(this); | |
if (b.overflowY[0] != document && b.overflowY[0].tagName != "HTML") { | |
b.overflowYOffset = b.overflowY.offset() | |
} | |
if (b.overflowX[0] != document && b.overflowX[0].tagName != "HTML") { | |
b.overflowXOffset = b.overflowX.offset() | |
} | |
}, | |
drag: function(d, c) { | |
var f = c.options; | |
var b = a(this).data("draggable"); | |
if (b.overflowY[0] != document && b.overflowY[0].tagName != "HTML") { | |
if ((b.overflowYOffset.top + b.overflowY[0].offsetHeight) - d.pageY < f.scrollSensitivity) { | |
b.overflowY[0].scrollTop = b.overflowY[0].scrollTop + f.scrollSpeed | |
} | |
if (d.pageY - b.overflowYOffset.top < f.scrollSensitivity) { | |
b.overflowY[0].scrollTop = b.overflowY[0].scrollTop - f.scrollSpeed | |
} | |
} else { | |
if (d.pageY - a(document).scrollTop() < f.scrollSensitivity) { | |
a(document).scrollTop(a(document).scrollTop() - f.scrollSpeed) | |
} | |
if (a(window).height() - (d.pageY - a(document).scrollTop()) < f.scrollSensitivity) { | |
a(document).scrollTop(a(document).scrollTop() + f.scrollSpeed) | |
} | |
} | |
if (b.overflowX[0] != document && b.overflowX[0].tagName != "HTML") { | |
if ((b.overflowXOffset.left + b.overflowX[0].offsetWidth) - d.pageX < f.scrollSensitivity) { | |
b.overflowX[0].scrollLeft = b.overflowX[0].scrollLeft + f.scrollSpeed | |
} | |
if (d.pageX - b.overflowXOffset.left < f.scrollSensitivity) { | |
b.overflowX[0].scrollLeft = b.overflowX[0].scrollLeft - f.scrollSpeed | |
} | |
} else { | |
if (d.pageX - a(document).scrollLeft() < f.scrollSensitivity) { | |
a(document).scrollLeft(a(document).scrollLeft() - f.scrollSpeed) | |
} | |
if (a(window).width() - (d.pageX - a(document).scrollLeft()) < f.scrollSensitivity) { | |
a(document).scrollLeft(a(document).scrollLeft() + f.scrollSpeed) | |
} | |
} | |
} | |
}); | |
a.ui.plugin.add("draggable", "snap", { | |
start: function(d, c) { | |
var b = a(this).data("draggable"); | |
b.snapElements = []; | |
a(c.options.snap === true ? ".ui-draggable" : c.options.snap).each(function() { | |
var f = a(this); | |
var e = f.offset(); | |
if (this != b.element[0]) { | |
b.snapElements.push({ | |
item: this, | |
width: f.outerWidth(), | |
height: f.outerHeight(), | |
top: e.top, | |
left: e.left | |
}) | |
} | |
}) | |
}, | |
drag: function(o, u) { | |
var n = a(this).data("draggable"); | |
var q = u.options.snapTolerance || 20; | |
var g = u.absolutePosition.left, | |
f = g + n.helperProportions.width, | |
w = u.absolutePosition.top, | |
v = w + n.helperProportions.height; | |
for (var m = n.snapElements.length - 1; m >= 0; m--) { | |
var h = n.snapElements[m].left, | |
c = h + n.snapElements[m].width, | |
y = n.snapElements[m].top, | |
s = y + n.snapElements[m].height; | |
if (!((h - q < g && g < c + q && y - q < w && w < s + q) || (h - q < g && g < c + q && y - q < v && v < s + q) || (h - q < f && f < c + q && y - q < w && w < s + q) || (h - q < f && f < c + q && y - q < v && v < s + q))) { | |
continue | |
} | |
if (u.options.snapMode != "inner") { | |
var p = Math.abs(y - v) <= 20; | |
var x = Math.abs(s - w) <= 20; | |
var k = Math.abs(h - f) <= 20; | |
var j = Math.abs(c - g) <= 20; | |
if (p) { | |
u.position.top = n.convertPositionTo("relative", { | |
top: y - n.helperProportions.height, | |
left: 0 | |
}).top | |
} | |
if (x) { | |
u.position.top = n.convertPositionTo("relative", { | |
top: s, | |
left: 0 | |
}).top | |
} | |
if (k) { | |
u.position.left = n.convertPositionTo("relative", { | |
top: 0, | |
left: h - n.helperProportions.width | |
}).left | |
} | |
if (j) { | |
u.position.left = n.convertPositionTo("relative", { | |
top: 0, | |
left: c | |
}).left | |
} | |
} | |
if (u.options.snapMode != "outer") { | |
var p = Math.abs(y - w) <= 20; | |
var x = Math.abs(s - v) <= 20; | |
var k = Math.abs(h - g) <= 20; | |
var j = Math.abs(c - f) <= 20; | |
if (p) { | |
u.position.top = n.convertPositionTo("relative", { | |
top: y, | |
left: 0 | |
}).top | |
} | |
if (x) { | |
u.position.top = n.convertPositionTo("relative", { | |
top: s - n.helperProportions.height, | |
left: 0 | |
}).top | |
} | |
if (k) { | |
u.position.left = n.convertPositionTo("relative", { | |
top: 0, | |
left: h | |
}).left | |
} | |
if (j) { | |
u.position.left = n.convertPositionTo("relative", { | |
top: 0, | |
left: c - n.helperProportions.width | |
}).left | |
} | |
} | |
} | |
} | |
}); | |
a.ui.plugin.add("draggable", "connectToSortable", { | |
start: function(d, c) { | |
var b = a(this).data("draggable"); | |
b.sortables = []; | |
a(c.options.connectToSortable).each(function() { | |
if (a.data(this, "sortable")) { | |
var e = a.data(this, "sortable"); | |
b.sortables.push({ | |
instance: e, | |
shouldRevert: e.options.revert | |
}); | |
e.refreshItems(); | |
e.propagate("activate", d, b) | |
} | |
}) | |
}, | |
stop: function(d, c) { | |
var b = a(this).data("draggable"); | |
a.each(b.sortables, function() { | |
if (this.instance.isOver) { | |
this.instance.isOver = 0; | |
b.cancelHelperRemoval = true; | |
this.instance.cancelHelperRemoval = false; | |
if (this.shouldRevert) { | |
this.instance.options.revert = true | |
} | |
this.instance.mouseStop(d); | |
this.instance.element.triggerHandler("sortreceive", [d, a.extend(this.instance.ui(), { | |
sender: b.element | |
})], this.instance.options.receive); | |
this.instance.options.helper = this.instance.options._helper | |
} else { | |
this.instance.propagate("deactivate", d, b) | |
} | |
}) | |
}, | |
drag: function(g, f) { | |
var d = a(this).data("draggable"), | |
b = this; | |
var c = function(m) { | |
var h = m.left, | |
k = h + m.width, | |
j = m.top, | |
e = j + m.height; | |
return (h < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < k && j < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < e) | |
}; | |
a.each(d.sortables, function(e) { | |
if (c.call(d, this.instance.containerCache)) { | |
if (!this.instance.isOver) { | |
this.instance.isOver = 1; | |
this.instance.currentItem = a(b).clone().appendTo(this.instance.element).data("sortable-item", true); | |
this.instance.options._helper = this.instance.options.helper; | |
this.instance.options.helper = function() { | |
return f.helper[0] | |
}; | |
g.target = this.instance.currentItem[0]; | |
this.instance.mouseCapture(g, true); | |
this.instance.mouseStart(g, true, true); | |
this.instance.offset.click.top = d.offset.click.top; | |
this.instance.offset.click.left = d.offset.click.left; | |
this.instance.offset.parent.left -= d.offset.parent.left - this.instance.offset.parent.left; | |
this.instance.offset.parent.top -= d.offset.parent.top - this.instance.offset.parent.top; | |
d.propagate("toSortable", g) | |
} | |
if (this.instance.currentItem) { | |
this.instance.mouseDrag(g) | |
} | |
} else { | |
if (this.instance.isOver) { | |
this.instance.isOver = 0; | |
this.instance.cancelHelperRemoval = true; | |
this.instance.options.revert = false; | |
this.instance.mouseStop(g, true); | |
this.instance.options.helper = this.instance.options._helper; | |
this.instance.currentItem.remove(); | |
if (this.instance.placeholder) { | |
this.instance.placeholder.remove() | |
} | |
d.propagate("fromSortable", g) | |
} | |
} | |
}) | |
} | |
}); | |
a.ui.plugin.add("draggable", "stack", { | |
start: function(d, b) { | |
var c = a.makeArray(a(b.options.stack.group)).sort(function(f, e) { | |
return (parseInt(a(f).css("zIndex"), 10) || b.options.stack.min) - (parseInt(a(e).css("zIndex"), 10) || b.options.stack.min) | |
}); | |
a(c).each(function(e) { | |
this.style.zIndex = b.options.stack.min + e | |
}); | |
this[0].style.zIndex = b.options.stack.min + c.length | |
} | |
}) | |
})(jQuery); | |
(function(a) { | |
a.widget("ui.droppable", { | |
init: function() { | |
this.element.addClass("ui-droppable"); | |
this.isover = 0; | |
this.isout = 1; | |
var c = this.options, | |
b = c.accept; | |
c = a.extend(c, { | |
accept: c.accept && c.accept.constructor == Function ? c.accept : function(e) { | |
return a(e).is(b) | |
} | |
}); | |
this.proportions = { | |
width: this.element[0].offsetWidth, | |
height: this.element[0].offsetHeight | |
}; | |
a.ui.ddmanager.droppables.push(this) | |
}, | |
plugins: {}, | |
ui: function(b) { | |
return { | |
draggable: (b.currentItem || b.element), | |
helper: b.helper, | |
position: b.position, | |
absolutePosition: b.positionAbs, | |
options: this.options, | |
element: this.element | |
} | |
}, | |
destroy: function() { | |
var b = a.ui.ddmanager.droppables; | |
for (var c = 0; c < b.length; c++) { | |
if (b[c] == this) { | |
b.splice(c, 1) | |
} | |
} | |
this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable") | |
}, | |
over: function(c) { | |
var b = a.ui.ddmanager.current; | |
if (!b || (b.currentItem || b.element)[0] == this.element[0]) { | |
return | |
} | |
if (this.options.accept.call(this.element, (b.currentItem || b.element))) { | |
a.ui.plugin.call(this, "over", [c, this.ui(b)]); | |
this.element.triggerHandler("dropover", [c, this.ui(b)], this.options.over) | |
} | |
}, | |
out: function(c) { | |
var b = a.ui.ddmanager.current; | |
if (!b || (b.currentItem || b.element)[0] == this.element[0]) { | |
return | |
} | |
if (this.options.accept.call(this.element, (b.currentItem || b.element))) { | |
a.ui.plugin.call(this, "out", [c, this.ui(b)]); | |
this.element.triggerHandler("dropout", [c, this.ui(b)], this.options.out) | |
} | |
}, | |
drop: function(d, c) { | |
var b = c || a.ui.ddmanager.current; | |
if (!b || (b.currentItem || b.element)[0] == this.element[0]) { | |
return false | |
} | |
var f = false; | |
this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function() { | |
var e = a.data(this, "droppable"); | |
if (e.options.greedy && a.ui.intersect(b, a.extend(e, { | |
offset: e.element.offset() | |
}), e.options.tolerance)) { | |
f = true; | |
return false | |
} | |
}); | |
if (f) { | |
return false | |
} | |
if (this.options.accept.call(this.element, (b.currentItem || b.element))) { | |
a.ui.plugin.call(this, "drop", [d, this.ui(b)]); | |
this.element.triggerHandler("drop", [d, this.ui(b)], this.options.drop); | |
return true | |
} | |
return false | |
}, | |
activate: function(c) { | |
var b = a.ui.ddmanager.current; | |
a.ui.plugin.call(this, "activate", [c, this.ui(b)]); | |
if (b) { | |
this.element.triggerHandler("dropactivate", [c, this.ui(b)], this.options.activate) | |
} | |
}, | |
deactivate: function(c) { | |
var b = a.ui.ddmanager.current; | |
a.ui.plugin.call(this, "deactivate", [c, this.ui(b)]); | |
if (b) { | |
this.element.triggerHandler("dropdeactivate", [c, this.ui(b)], this.options.deactivate) | |
} | |
} | |
}); | |
a.extend(a.ui.droppable, { | |
defaults: { | |
disabled: false, | |
tolerance: "intersect" | |
} | |
}); | |
a.ui.intersect = function(o, g, m) { | |
if (!g.offset) { | |
return false | |
} | |
var e = (o.positionAbs || o.position.absolute).left, | |
d = e + o.helperProportions.width, | |
k = (o.positionAbs || o.position.absolute).top, | |
j = k + o.helperProportions.height; | |
var f = g.offset.left, | |
c = f + g.proportions.width, | |
n = g.offset.top, | |
h = n + g.proportions.height; | |
switch (m) { | |
case "fit": | |
return (f < e && d < c && n < k && j < h); | |
break; | |
case "intersect": | |
return (f < e + (o.helperProportions.width / 2) && d - (o.helperProportions.width / 2) < c && n < k + (o.helperProportions.height / 2) && j - (o.helperProportions.height / 2) < h); | |
break; | |
case "pointer": | |
return (f < ((o.positionAbs || o.position.absolute).left + (o.clickOffset || o.offset.click).left) && ((o.positionAbs || o.position.absolute).left + (o.clickOffset || o.offset.click).left) < c && n < ((o.positionAbs || o.position.absolute).top + (o.clickOffset || o.offset.click).top) && ((o.positionAbs || o.position.absolute).top + (o.clickOffset || o.offset.click).top) < h); | |
break; | |
case "touch": | |
return ((k >= n && k <= h) || (j >= n && j <= h) || (k < n && j > h)) && ((e >= f && e <= c) || (d >= f && d <= c) || (e < f && d > c)); | |
break; | |
default: | |
return false; | |
break | |
} | |
}; | |
a.ui.ddmanager = { | |
current: null, | |
droppables: [], | |
prepareOffsets: function(d, g) { | |
var b = a.ui.ddmanager.droppables; | |
var f = g ? g.type : null; | |
for (var c = 0; c < b.length; c++) { | |
if (b[c].options.disabled || (d && !b[c].options.accept.call(b[c].element, (d.currentItem || d.element)))) { | |
continue | |
} | |
b[c].visible = b[c].element.css("display") != "none"; | |
if (!b[c].visible) { | |
continue | |
} | |
b[c].offset = b[c].element.offset(); | |
b[c].proportions = { | |
width: b[c].element[0].offsetWidth, | |
height: b[c].element[0].offsetHeight | |
}; | |
if (f == "dragstart" || f == "sortactivate") { | |
b[c].activate.call(b[c], g) | |
} | |
} | |
}, | |
drop: function(b, c) { | |
var d = false; | |
a.each(a.ui.ddmanager.droppables, function() { | |
if (!this.options) { | |
return | |
} | |
if (!this.options.disabled && this.visible && a.ui.intersect(b, this, this.options.tolerance)) { | |
d = this.drop.call(this, c) | |
} | |
if (!this.options.disabled && this.visible && this.options.accept.call(this.element, (b.currentItem || b.element))) { | |
this.isout = 1; | |
this.isover = 0; | |
this.deactivate.call(this, c) | |
} | |
}); | |
return d | |
}, | |
drag: function(b, c) { | |
if (b.options.refreshPositions) { | |
a.ui.ddmanager.prepareOffsets(b, c) | |
} | |
a.each(a.ui.ddmanager.droppables, function() { | |
if (this.options.disabled || this.greedyChild || !this.visible) { | |
return | |
} | |
var e = a.ui.intersect(b, this, this.options.tolerance); | |
var g = !e && this.isover == 1 ? "isout" : (e && this.isover == 0 ? "isover" : null); | |
if (!g) { | |
return | |
} | |
var f; | |
if (this.options.greedy) { | |
var d = this.element.parents(".ui-droppable:eq(0)"); | |
if (d.length) { | |
f = a.data(d[0], "droppable"); | |
f.greedyChild = (g == "isover" ? 1 : 0) | |
} | |
} | |
if (f && g == "isover") { | |
f.isover = 0; | |
f.isout = 1; | |
f.out.call(f, c) | |
} | |
this[g] = 1; | |
this[g == "isout" ? "isover" : "isout"] = 0; | |
this[g == "isover" ? "over" : "out"].call(this, c); | |
if (f && g == "isout") { | |
f.isout = 0; | |
f.isover = 1; | |
f.over.call(f, c) | |
} | |
}) | |
} | |
}; | |
a.ui.plugin.add("droppable", "activeClass", { | |
activate: function(c, b) { | |
a(this).addClass(b.options.activeClass) | |
}, | |
deactivate: function(c, b) { | |
a(this).removeClass(b.options.activeClass) | |
}, | |
drop: function(c, b) { | |
a(this).removeClass(b.options.activeClass) | |
} | |
}); | |
a.ui.plugin.add("droppable", "hoverClass", { | |
over: function(c, b) { | |
a(this).addClass(b.options.hoverClass) | |
}, | |
out: function(c, b) { | |
a(this).removeClass(b.options.hoverClass) | |
}, | |
drop: function(c, b) { | |
a(this).removeClass(b.options.hoverClass) | |
} | |
}) | |
})(jQuery); | |
(function(a) { | |
a.widget("ui.resizable", a.extend({}, a.ui.mouse, { | |
init: function() { | |
var p = this, | |
q = this.options; | |
var t = this.element.css("position"); | |
this.originalElement = this.element; | |
this.element.addClass("ui-resizable").css({ | |
position: /static/.test(t) ? "relative" : t | |
}); | |
a.extend(q, { | |
_aspectRatio: !!(q.aspectRatio), | |
helper: q.helper || q.ghost || q.animate ? q.helper || "proxy" : null, | |
knobHandles: q.knobHandles === true ? "ui-resizable-knob-handle" : q.knobHandles | |
}); | |
var h = "1px solid #DEDEDE"; | |
q.defaultTheme = { | |
"ui-resizable": { | |
display: "block" | |
}, | |
"ui-resizable-handle": { | |
position: "absolute", | |
background: "#F2F2F2", | |
fontSize: "0.1px" | |
}, | |
"ui-resizable-n": { | |
cursor: "n-resize", | |
height: "4px", | |
left: "0px", | |
right: "0px", | |
borderTop: h | |
}, | |
"ui-resizable-s": { | |
cursor: "s-resize", | |
height: "4px", | |
left: "0px", | |
right: "0px", | |
borderBottom: h | |
}, | |
"ui-resizable-e": { | |
cursor: "e-resize", | |
width: "4px", | |
top: "0px", | |
bottom: "0px", | |
borderRight: h | |
}, | |
"ui-resizable-w": { | |
cursor: "w-resize", | |
width: "4px", | |
top: "0px", | |
bottom: "0px", | |
borderLeft: h | |
}, | |
"ui-resizable-se": { | |
cursor: "se-resize", | |
width: "4px", | |
height: "4px", | |
borderRight: h, | |
borderBottom: h | |
}, | |
"ui-resizable-sw": { | |
cursor: "sw-resize", | |
width: "4px", | |
height: "4px", | |
borderBottom: h, | |
borderLeft: h | |
}, | |
"ui-resizable-ne": { | |
cursor: "ne-resize", | |
width: "4px", | |
height: "4px", | |
borderRight: h, | |
borderTop: h | |
}, | |
"ui-resizable-nw": { | |
cursor: "nw-resize", | |
width: "4px", | |
height: "4px", | |
borderLeft: h, | |
borderTop: h | |
} | |
}; | |
q.knobTheme = { | |
"ui-resizable-handle": { | |
background: "#F2F2F2", | |
border: "1px solid #808080", | |
height: "8px", | |
width: "8px" | |
}, | |
"ui-resizable-n": { | |
cursor: "n-resize", | |
top: "0px", | |
left: "45%" | |
}, | |
"ui-resizable-s": { | |
cursor: "s-resize", | |
bottom: "0px", | |
left: "45%" | |
}, | |
"ui-resizable-e": { | |
cursor: "e-resize", | |
right: "0px", | |
top: "45%" | |
}, | |
"ui-resizable-w": { | |
cursor: "w-resize", | |
left: "0px", | |
top: "45%" | |
}, | |
"ui-resizable-se": { | |
cursor: "se-resize", | |
right: "0px", | |
bottom: "0px" | |
}, | |
"ui-resizable-sw": { | |
cursor: "sw-resize", | |
left: "0px", | |
bottom: "0px" | |
}, | |
"ui-resizable-nw": { | |
cursor: "nw-resize", | |
left: "0px", | |
top: "0px" | |
}, | |
"ui-resizable-ne": { | |
cursor: "ne-resize", | |
right: "0px", | |
top: "0px" | |
} | |
}; | |
q._nodeName = this.element[0].nodeName; | |
if (q._nodeName.match(/canvas|textarea|input|select|button|img/i)) { | |
var b = this.element; | |
if (/relative/.test(b.css("position")) && a.browser.opera) { | |
b.css({ | |
position: "relative", | |
top: "auto", | |
left: "auto" | |
}) | |
} | |
b.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ | |
position: b.css("position"), | |
width: b.outerWidth(), | |
height: b.outerHeight(), | |
top: b.css("top"), | |
left: b.css("left") | |
})); | |
var k = this.element; | |
this.element = this.element.parent(); | |
this.element.data("resizable", this); | |
this.element.css({ | |
marginLeft: k.css("marginLeft"), | |
marginTop: k.css("marginTop"), | |
marginRight: k.css("marginRight"), | |
marginBottom: k.css("marginBottom") | |
}); | |
k.css({ | |
marginLeft: 0, | |
marginTop: 0, | |
marginRight: 0, | |
marginBottom: 0 | |
}); | |
if (a.browser.safari && q.preventDefault) { | |
k.css("resize", "none") | |
} | |
q.proportionallyResize = k.css({ | |
position: "static", | |
zoom: 1, | |
display: "block" | |
}); | |
this.element.css({ | |
margin: k.css("margin") | |
}); | |
this._proportionallyResize() | |
} | |
if (!q.handles) { | |
q.handles = !a(".ui-resizable-handle", this.element).length ? "e,s,se" : { | |
n: ".ui-resizable-n", | |
e: ".ui-resizable-e", | |
s: ".ui-resizable-s", | |
w: ".ui-resizable-w", | |
se: ".ui-resizable-se", | |
sw: ".ui-resizable-sw", | |
ne: ".ui-resizable-ne", | |
nw: ".ui-resizable-nw" | |
} | |
} | |
if (q.handles.constructor == String) { | |
q.zIndex = q.zIndex || 1000; | |
if (q.handles == "all") { | |
q.handles = "n,e,s,w,se,sw,ne,nw" | |
} | |
var r = q.handles.split(","); | |
q.handles = {}; | |
var g = { | |
handle: "position: absolute; display: none; overflow:hidden;", | |
n: "top: 0pt; width:100%;", | |
e: "right: 0pt; height:100%;", | |
s: "bottom: 0pt; width:100%;", | |
w: "left: 0pt; height:100%;", | |
se: "bottom: 0pt; right: 0px;", | |
sw: "bottom: 0pt; left: 0px;", | |
ne: "top: 0pt; right: 0px;", | |
nw: "top: 0pt; left: 0px;" | |
}; | |
for (var u = 0; u < r.length; u++) { | |
var v = a.trim(r[u]), | |
m = q.defaultTheme, | |
f = "ui-resizable-" + v, | |
c = !a.ui.css(f) && !q.knobHandles, | |
s = a.ui.css("ui-resizable-knob-handle"), | |
w = a.extend(m[f], m["ui-resizable-handle"]), | |
d = a.extend(q.knobTheme[f], !s ? q.knobTheme["ui-resizable-handle"] : {}); | |
var l = /sw|se|ne|nw/.test(v) ? { | |
zIndex: ++q.zIndex | |
} : {}; | |
var j = (c ? g[v] : ""), | |
e = a(['<div class="ui-resizable-handle ', f, '" style="', j, g.handle, '"></div>'].join("")).css(l); | |
q.handles[v] = ".ui-resizable-" + v; | |
this.element.append(e.css(c ? w : {}).css(q.knobHandles ? d : {}).addClass(q.knobHandles ? "ui-resizable-knob-handle" : "").addClass(q.knobHandles)) | |
} | |
if (q.knobHandles) { | |
this.element.addClass("ui-resizable-knob").css(!a.ui.css("ui-resizable-knob") ? {} : {}) | |
} | |
} | |
this._renderAxis = function(z) { | |
z = z || this.element; | |
for (var o in q.handles) { | |
if (q.handles[o].constructor == String) { | |
q.handles[o] = a(q.handles[o], this.element).show() | |
} | |
if (q.transparent) { | |
q.handles[o].css({ | |
opacity: 0 | |
}) | |
} | |
if (this.element.is(".ui-wrapper") && q._nodeName.match(/textarea|input|select|button/i)) { | |
var x = a(q.handles[o], this.element), | |
y = 0; | |
y = /sw|ne|nw|se|n|s/.test(o) ? x.outerHeight() : x.outerWidth(); | |
var n = ["padding", /ne|nw|n/.test(o) ? "Top" : /se|sw|s/.test(o) ? "Bottom" : /^e$/.test(o) ? "Right" : "Left"].join(""); | |
if (!q.transparent) { | |
z.css(n, y) | |
} | |
this._proportionallyResize() | |
} | |
if (!a(q.handles[o]).length) { | |
continue | |
} | |
} | |
}; | |
this._renderAxis(this.element); | |
q._handles = a(".ui-resizable-handle", p.element); | |
if (q.disableSelection) { | |
q._handles.each(function(n, o) { | |
a.ui.disableSelection(o) | |
}) | |
} | |
q._handles.mouseover(function() { | |
if (!q.resizing) { | |
if (this.className) { | |
var n = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i) | |
} | |
p.axis = q.axis = n && n[1] ? n[1] : "se" | |
} | |
}); | |
if (q.autoHide) { | |
q._handles.hide(); | |
a(p.element).addClass("ui-resizable-autohide").hover(function() { | |
a(this).removeClass("ui-resizable-autohide"); | |
q._handles.show() | |
}, function() { | |
if (!q.resizing) { | |
a(this).addClass("ui-resizable-autohide"); | |
q._handles.hide() | |
} | |
}) | |
} | |
this.mouseInit() | |
}, | |
plugins: {}, | |
ui: function() { | |
return { | |
originalElement: this.originalElement, | |
element: this.element, | |
helper: this.helper, | |
position: this.position, | |
size: this.size, | |
options: this.options, | |
originalSize: this.originalSize, | |
originalPosition: this.originalPosition | |
} | |
}, | |
propagate: function(c, b) { | |
a.ui.plugin.call(this, c, [b, this.ui()]); | |
if (c != "resize") { | |
this.element.triggerHandler(["resize", c].join(""), [b, this.ui()], this.options[c]) | |
} | |
}, | |
destroy: function() { | |
var d = this.element, | |
c = d.children(".ui-resizable").get(0); | |
this.mouseDestroy(); | |
var b = function(e) { | |
a(e).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove() | |
}; | |
b(d); | |
if (d.is(".ui-wrapper") && c) { | |
d.parent().append(a(c).css({ | |
position: d.css("position"), | |
width: d.outerWidth(), | |
height: d.outerHeight(), | |
top: d.css("top"), | |
left: d.css("left") | |
})).end().remove(); | |
b(c) | |
} | |
}, | |
mouseStart: function(m) { | |
if (this.options.disabled) { | |
return false | |
} | |
var l = false; | |
for (var j in this.options.handles) { | |
if (a(this.options.handles[j])[0] == m.target) { | |
l = true | |
} | |
} | |
if (!l) { | |
return false | |
} | |
var c = this.options, | |
b = this.element.position(), | |
d = this.element, | |
k = function(e) { | |
return parseInt(e, 10) || 0 | |
}, | |
h = a.browser.msie && a.browser.version < 7; | |
c.resizing = true; | |
c.documentScroll = { | |
top: a(document).scrollTop(), | |
left: a(document).scrollLeft() | |
}; | |
if (d.is(".ui-draggable") || (/absolute/).test(d.css("position"))) { | |
var p = a.browser.msie && !c.containment && (/absolute/).test(d.css("position")) && !(/relative/).test(d.parent().css("position")); | |
var n = p ? c.documentScroll.top : 0, | |
g = p ? c.documentScroll.left : 0; | |
d.css({ | |
position: "absolute", | |
top: (b.top + n), | |
left: (b.left + g) | |
}) | |
} | |
if (a.browser.opera && /relative/.test(d.css("position"))) { | |
d.css({ | |
position: "relative", | |
top: "auto", | |
left: "auto" | |
}) | |
} | |
this._renderProxy(); | |
var q = k(this.helper.css("left")), | |
f = k(this.helper.css("top")); | |
if (c.containment) { | |
q += a(c.containment).scrollLeft() || 0; | |
f += a(c.containment).scrollTop() || 0 | |
} | |
this.offset = this.helper.offset(); | |
this.position = { | |
left: q, | |
top: f | |
}; | |
this.size = c.helper || h ? { | |
width: d.outerWidth(), | |
height: d.outerHeight() | |
} : { | |
width: d.width(), | |
height: d.height() | |
}; | |
this.originalSize = c.helper || h ? { | |
width: d.outerWidth(), | |
height: d.outerHeight() | |
} : { | |
width: d.width(), | |
height: d.height() | |
}; | |
this.originalPosition = { | |
left: q, | |
top: f | |
}; | |
this.sizeDiff = { | |
width: d.outerWidth() - d.width(), | |
height: d.outerHeight() - d.height() | |
}; | |
this.originalMousePosition = { | |
left: m.pageX, | |
top: m.pageY | |
}; | |
c.aspectRatio = (typeof c.aspectRatio == "number") ? c.aspectRatio : ((this.originalSize.height / this.originalSize.width) || 1); | |
if (c.preserveCursor) { | |
a("body").css("cursor", this.axis + "-resize") | |
} | |
this.propagate("start", m); | |
return true | |
}, | |
mouseDrag: function(k) { | |
var d = this.helper, | |
c = this.options, | |
l = {}, | |
p = this, | |
g = this.originalMousePosition, | |
m = this.axis; | |
var q = (k.pageX - g.left) || 0, | |
n = (k.pageY - g.top) || 0; | |
var f = this._change[m]; | |
if (!f) { | |
return false | |
} | |
var j = f.apply(this, [k, q, n]), | |
h = a.browser.msie && a.browser.version < 7, | |
b = this.sizeDiff; | |
if (c._aspectRatio || k.shiftKey) { | |
j = this._updateRatio(j, k) | |
} | |
j = this._respectSize(j, k); | |
this.propagate("resize", k); | |
d.css({ | |
top: this.position.top + "px", | |
left: this.position.left + "px", | |
width: this.size.width + "px", | |
height: this.size.height + "px" | |
}); | |
if (!c.helper && c.proportionallyResize) { | |
this._proportionallyResize() | |
} | |
this._updateCache(j); | |
this.element.triggerHandler("resize", [k, this.ui()], this.options.resize); | |
return false | |
}, | |
mouseStop: function(k) { | |
this.options.resizing = false; | |
var f = this.options, | |
j = function(e) { | |
return parseInt(e, 10) || 0 | |
}, | |
m = this; | |
if (f.helper) { | |
var d = f.proportionallyResize, | |
b = d && (/textarea/i).test(d.get(0).nodeName), | |
c = b && a.ui.hasScroll(d.get(0), "left") ? 0 : m.sizeDiff.height, | |
h = b ? 0 : m.sizeDiff.width; | |
var n = { | |
width: (m.size.width - h), | |
height: (m.size.height - c) | |
}, | |
g = (parseInt(m.element.css("left"), 10) + (m.position.left - m.originalPosition.left)) || null, | |
l = (parseInt(m.element.css("top"), 10) + (m.position.top - m.originalPosition.top)) || null; | |
if (!f.animate) { | |
this.element.css(a.extend(n, { | |
top: l, | |
left: g | |
})) | |
} | |
if (f.helper && !f.animate) { | |
this._proportionallyResize() | |
} | |
} | |
if (f.preserveCursor) { | |
a("body").css("cursor", "auto") | |
} | |
this.propagate("stop", k); | |
if (f.helper) { | |
this.helper.remove() | |
} | |
return false | |
}, | |
_updateCache: function(b) { | |
var c = this.options; | |
this.offset = this.helper.offset(); | |
if (b.left) { | |
this.position.left = b.left | |
} | |
if (b.top) { | |
this.position.top = b.top | |
} | |
if (b.height) { | |
this.size.height = b.height | |
} | |
if (b.width) { | |
this.size.width = b.width | |
} | |
}, | |
_updateRatio: function(d, f) { | |
var g = this.options, | |
h = this.position, | |
c = this.size, | |
b = this.axis; | |
if (d.height) { | |
d.width = (c.height / g.aspectRatio) | |
} else { | |
if (d.width) { | |
d.height = (c.width * g.aspectRatio) | |
} | |
} | |
if (b == "sw") { | |
d.left = h.left + (c.width - d.width); | |
d.top = null | |
} | |
if (b == "nw") { | |
d.top = h.top + (c.height - d.height); | |
d.left = h.left + (c.width - d.width) | |
} | |
return d | |
}, | |
_respectSize: function(j, k) { | |
var g = this.helper, | |
f = this.options, | |
q = f._aspectRatio || k.shiftKey, | |
p = this.axis, | |
s = j.width && f.maxWidth && f.maxWidth < j.width, | |
l = j.height && f.maxHeight && f.maxHeight < j.height, | |
d = j.width && f.minWidth && f.minWidth > j.width, | |
r = j.height && f.minHeight && f.minHeight > j.height; | |
if (d) { | |
j.width = f.minWidth | |
} | |
if (r) { | |
j.height = f.minHeight | |
} | |
if (s) { | |
j.width = f.maxWidth | |
} | |
if (l) { | |
j.height = f.maxHeight | |
} | |
var c = this.originalPosition.left + this.originalSize.width, | |
n = this.position.top + this.size.height; | |
var h = /sw|nw|w/.test(p), | |
b = /nw|ne|n/.test(p); | |
if (d && h) { | |
j.left = c - f.minWidth | |
} | |
if (s && h) { | |
j.left = c - f.maxWidth | |
} | |
if (r && b) { | |
j.top = n - f.minHeight | |
} | |
if (l && b) { | |
j.top = n - f.maxHeight | |
} | |
var m = !j.width && !j.height; | |
if (m && !j.left && j.top) { | |
j.top = null | |
} else { | |
if (m && !j.top && j.left) { | |
j.left = null | |
} | |
} | |
return j | |
}, | |
_proportionallyResize: function() { | |
var g = this.options; | |
if (!g.proportionallyResize) { | |
return | |
} | |
var e = g.proportionallyResize, | |
d = this.helper || this.element; | |
if (!g.borderDif) { | |
var c = [e.css("borderTopWidth"), e.css("borderRightWidth"), e.css("borderBottomWidth"), e.css("borderLeftWidth")], | |
f = [e.css("paddingTop"), e.css("paddingRight"), e.css("paddingBottom"), e.css("paddingLeft")]; | |
g.borderDif = a.map(c, function(b, j) { | |
var h = parseInt(b, 10) || 0, | |
k = parseInt(f[j], 10) || 0; | |
return h + k | |
}) | |
} | |
e.css({ | |
height: (d.height() - g.borderDif[0] - g.borderDif[2]) + "px", | |
width: (d.width() - g.borderDif[1] - g.borderDif[3]) + "px" | |
}) | |
}, | |
_renderProxy: function() { | |
var c = this.element, | |
f = this.options; | |
this.elementOffset = c.offset(); | |
if (f.helper) { | |
this.helper = this.helper || a('<div style="overflow:hidden;"></div>'); | |
var b = a.browser.msie && a.browser.version < 7, | |
d = (b ? 1 : 0), | |
e = (b ? 2 : -1); | |
this.helper.addClass(f.helper).css({ | |
width: c.outerWidth() + e, | |
height: c.outerHeight() + e, | |
position: "absolute", | |
left: this.elementOffset.left - d + "px", | |
top: this.elementOffset.top - d + "px", | |
zIndex: ++f.zIndex | |
}); | |
this.helper.appendTo("body"); | |
if (f.disableSelection) { | |
a.ui.disableSelection(this.helper.get(0)) | |
} | |
} else { | |
this.helper = c | |
} | |
}, | |
_change: { | |
e: function(d, c, b) { | |
return { | |
width: this.originalSize.width + c | |
} | |
}, | |
w: function(g, c, b) { | |
var h = this.options, | |
d = this.originalSize, | |
f = this.originalPosition; | |
return { | |
left: f.left + c, | |
width: d.width - c | |
} | |
}, | |
n: function(g, c, b) { | |
var h = this.options, | |
d = this.originalSize, | |
f = this.originalPosition; | |
return { | |
top: f.top + b, | |
height: d.height - b | |
} | |
}, | |
s: function(d, c, b) { | |
return { | |
height: this.originalSize.height + b | |
} | |
}, | |
se: function(d, c, b) { | |
return a.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [d, c, b])) | |
}, | |
sw: function(d, c, b) { | |
return a.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [d, c, b])) | |
}, | |
ne: function(d, c, b) { | |
return a.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [d, c, b])) | |
}, | |
nw: function(d, c, b) { | |
return a.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [d, c, b])) | |
} | |
} | |
})); | |
a.extend(a.ui.resizable, { | |
defaults: { | |
cancel: ":input", | |
distance: 1, | |
delay: 0, | |
preventDefault: true, | |
transparent: false, | |
minWidth: 10, | |
minHeight: 10, | |
aspectRatio: false, | |
disableSelection: true, | |
preserveCursor: true, | |
autoHide: false, | |
knobHandles: false | |
} | |
}); | |
a.ui.plugin.add("resizable", "containment", { | |
start: function(k, m) { | |
var f = m.options, | |
p = a(this).data("resizable"), | |
h = p.element; | |
var c = f.containment, | |
g = (c instanceof a) ? c.get(0) : (/parent/.test(c)) ? h.parent().get(0) : c; | |
if (!g) { | |
return | |
} | |
p.containerElement = a(g); | |
if (/document/.test(c) || c == document) { | |
p.containerOffset = { | |
left: 0, | |
top: 0 | |
}; | |
p.containerPosition = { | |
left: 0, | |
top: 0 | |
}; | |
p.parentData = { | |
element: a(document), | |
left: 0, | |
top: 0, | |
width: a(document).width(), | |
height: a(document).height() || document.body.parentNode.scrollHeight | |
} | |
} else { | |
p.containerOffset = a(g).offset(); | |
p.containerPosition = a(g).position(); | |
p.containerSize = { | |
height: a(g).innerHeight(), | |
width: a(g).innerWidth() | |
}; | |
var l = p.containerOffset, | |
b = p.containerSize.height, | |
j = p.containerSize.width, | |
d = (a.ui.hasScroll(g, "left") ? g.scrollWidth : j), | |
n = (a.ui.hasScroll(g) ? g.scrollHeight : b); | |
p.parentData = { | |
element: g, | |
left: l.left, | |
top: l.top, | |
width: d, | |
height: n | |
} | |
} | |
}, | |
resize: function(j, m) { | |
var f = m.options, | |
q = a(this).data("resizable"), | |
c = q.containerSize, | |
l = q.containerOffset, | |
h = q.size, | |
k = q.position, | |
n = f._aspectRatio || j.shiftKey, | |
b = { | |
top: 0, | |
left: 0 | |
}, | |
d = q.containerElement; | |
if (d[0] != document && /static/.test(d.css("position"))) { | |
b = q.containerPosition | |
} | |
if (k.left < (f.helper ? l.left : b.left)) { | |
q.size.width = q.size.width + (f.helper ? (q.position.left - l.left) : (q.position.left - b.left)); | |
if (n) { | |
q.size.height = q.size.width * f.aspectRatio | |
} | |
q.position.left = f.helper ? l.left : b.left | |
} | |
if (k.top < (f.helper ? l.top : 0)) { | |
q.size.height = q.size.height + (f.helper ? (q.position.top - l.top) : q.position.top); | |
if (n) { | |
q.size.width = q.size.height / f.aspectRatio | |
} | |
q.position.top = f.helper ? l.top : 0 | |
} | |
var g = (f.helper ? q.offset.left - l.left : (q.position.left - b.left)) + q.sizeDiff.width, | |
p = (f.helper ? q.offset.top - l.top : q.position.top) + q.sizeDiff.height; | |
if (g + q.size.width >= q.parentData.width) { | |
q.size.width = q.parentData.width - g; | |
if (n) { | |
q.size.height = q.size.width * f.aspectRatio | |
} | |
} | |
if (p + q.size.height >= q.parentData.height) { | |
q.size.height = q.parentData.height - p; | |
if (n) { | |
q.size.width = q.size.height / f.aspectRatio | |
} | |
} | |
}, | |
stop: function(j, m) { | |
var c = m.options, | |
p = a(this).data("resizable"), | |
k = p.position, | |
l = p.containerOffset, | |
b = p.containerPosition, | |
d = p.containerElement; | |
var f = a(p.helper), | |
q = f.offset(), | |
n = f.innerWidth(), | |
g = f.innerHeight(); | |
if (c.helper && !c.animate && /relative/.test(d.css("position"))) { | |
a(this).css({ | |
left: (q.left - l.left), | |
top: (q.top - l.top), | |
width: n, | |
height: g | |
}) | |
} | |
if (c.helper && !c.animate && /static/.test(d.css("position"))) { | |
a(this).css({ | |
left: b.left + (q.left - l.left), | |
top: b.top + (q.top - l.top), | |
width: n, | |
height: g | |
}) | |
} | |
} | |
}); | |
a.ui.plugin.add("resizable", "grid", { | |
resize: function(j, l) { | |
var d = l.options, | |
n = a(this).data("resizable"), | |
h = n.size, | |
f = n.originalSize, | |
g = n.originalPosition, | |
m = n.axis, | |
k = d._aspectRatio || j.shiftKey; | |
d.grid = typeof d.grid == "number" ? [d.grid, d.grid] : d.grid; | |
var c = Math.round((h.width - f.width) / (d.grid[0] || 1)) * (d.grid[0] || 1), | |
b = Math.round((h.height - f.height) / (d.grid[1] || 1)) * (d.grid[1] || 1); | |
if (/^(se|s|e)$/.test(m)) { | |
n.size.width = f.width + c; | |
n.size.height = f.height + b | |
} else { | |
if (/^(ne)$/.test(m)) { | |
n.size.width = f.width + c; | |
n.size.height = f.height + b; | |
n.position.top = g.top - b | |
} else { | |
if (/^(sw)$/.test(m)) { | |
n.size.width = f.width + c; | |
n.size.height = f.height + b; | |
n.position.left = g.left - c | |
} else { | |
n.size.width = f.width + c; | |
n.size.height = f.height + b; | |
n.position.top = g.top - b; | |
n.position.left = g.left - c | |
} | |
} | |
} | |
} | |
}); | |
a.ui.plugin.add("resizable", "animate", { | |
stop: function(k, m) { | |
var g = m.options, | |
n = a(this).data("resizable"); | |
var f = g.proportionallyResize, | |
b = f && (/textarea/i).test(f.get(0).nodeName), | |
c = b && a.ui.hasScroll(f.get(0), "left") ? 0 : n.sizeDiff.height, | |
j = b ? 0 : n.sizeDiff.width; | |
var d = { | |
width: (n.size.width - j), | |
height: (n.size.height - c) | |
}, | |
h = (parseInt(n.element.css("left"), 10) + (n.position.left - n.originalPosition.left)) || null, | |
l = (parseInt(n.element.css("top"), 10) + (n.position.top - n.originalPosition.top)) || null; | |
n.element.animate(a.extend(d, l && h ? { | |
top: l, | |
left: h | |
} : {}), { | |
duration: g.animateDuration || "slow", | |
easing: g.animateEasing || "swing", | |
step: function() { | |
var e = { | |
width: parseInt(n.element.css("width"), 10), | |
height: parseInt(n.element.css("height"), 10), | |
top: parseInt(n.element.css("top"), 10), | |
left: parseInt(n.element.css("left"), 10) | |
}; | |
if (f) { | |
f.css({ | |
width: e.width, | |
height: e.height | |
}) | |
} | |
n._updateCache(e); | |
n.propagate("animate", k) | |
} | |
}) | |
} | |
}); | |
a.ui.plugin.add("resizable", "ghost", { | |
start: function(f, d) { | |
var g = d.options, | |
b = a(this).data("resizable"), | |
h = g.proportionallyResize, | |
c = b.size; | |
if (!h) { | |
b.ghost = b.element.clone() | |
} else { | |
b.ghost = h.clone() | |
} | |
b.ghost.css({ | |
opacity: 0.25, | |
display: "block", | |
position: "relative", | |
height: c.height, | |
width: c.width, | |
margin: 0, | |
left: 0, | |
top: 0 | |
}).addClass("ui-resizable-ghost").addClass(typeof g.ghost == "string" ? g.ghost : ""); | |
b.ghost.appendTo(b.helper) | |
}, | |
resize: function(d, c) { | |
var f = c.options, | |
b = a(this).data("resizable"), | |
g = f.proportionallyResize; | |
if (b.ghost) { | |
b.ghost.css({ | |
position: "relative", | |
height: b.size.height, | |
width: b.size.width | |
}) | |
} | |
}, | |
stop: function(d, c) { | |
var f = c.options, | |
b = a(this).data("resizable"), | |
g = f.proportionallyResize; | |
if (b.ghost && b.helper) { | |
b.helper.get(0).removeChild(b.ghost.get(0)) | |
} | |
} | |
}); | |
a.ui.plugin.add("resizable", "alsoResize", { | |
start: function(f, c) { | |
var g = c.options, | |
b = a(this).data("resizable"), | |
d = function(e) { | |
a(e).each(function() { | |
a(this).data("resizable-alsoresize", { | |
width: parseInt(a(this).width(), 10), | |
height: parseInt(a(this).height(), 10), | |
left: parseInt(a(this).css("left"), 10), | |
top: parseInt(a(this).css("top"), 10) | |
}) | |
}) | |
}; | |
if (typeof(g.alsoResize) == "object") { | |
if (g.alsoResize.length) { | |
g.alsoResize = g.alsoResize[0]; | |
d(g.alsoResize) | |
} else { | |
a.each(g.alsoResize, function(e, h) { | |
d(e) | |
}) | |
} | |
} else { | |
d(g.alsoResize) | |
} | |
}, | |
resize: function(g, f) { | |
var h = f.options, | |
c = a(this).data("resizable"), | |
d = c.originalSize, | |
k = c.originalPosition; | |
var j = { | |
height: (c.size.height - d.height) || 0, | |
width: (c.size.width - d.width) || 0, | |
top: (c.position.top - k.top) || 0, | |
left: (c.position.left - k.left) || 0 | |
}, | |
b = function(e, l) { | |
a(e).each(function() { | |
var o = a(this).data("resizable-alsoresize"), | |
n = {}, | |
m = l && l.length ? l : ["width", "height", "top", "left"]; | |
a.each(m || ["width", "height", "top", "left"], function(p, r) { | |
var q = (o[r] || 0) + (j[r] || 0); | |
if (q && q >= 0) { | |
n[r] = q || null | |
} | |
}); | |
a(this).css(n) | |
}) | |
}; | |
if (typeof(h.alsoResize) == "object") { | |
a.each(h.alsoResize, function(e, l) { | |
b(e, l) | |
}) | |
} else { | |
b(h.alsoResize) | |
} | |
}, | |
stop: function(c, b) { | |
a(this).removeData("resizable-alsoresize-start") | |
} | |
}) | |
})(jQuery); | |
(function(a) { | |
a.widget("ui.selectable", a.extend({}, a.ui.mouse, { | |
init: function() { | |
var b = this; | |
this.element.addClass("ui-selectable"); | |
this.dragged = false; | |
var c; | |
this.refresh = function() { | |
c = a(b.options.filter, b.element[0]); | |
c.each(function() { | |
var d = a(this); | |
var e = d.offset(); | |
a.data(this, "selectable-item", { | |
element: this, | |
$element: d, | |
left: e.left, | |
top: e.top, | |
right: e.left + d.width(), | |
bottom: e.top + d.height(), | |
startselected: false, | |
selected: d.hasClass("ui-selected"), | |
selecting: d.hasClass("ui-selecting"), | |
unselecting: d.hasClass("ui-unselecting") | |
}) | |
}) | |
}; | |
this.refresh(); | |
this.selectees = c.addClass("ui-selectee"); | |
this.mouseInit(); | |
this.helper = a(document.createElement("div")).css({ | |
border: "1px dotted black" | |
}) | |
}, | |
toggle: function() { | |
if (this.options.disabled) { | |
this.enable() | |
} else { | |
this.disable() | |
} | |
}, | |
destroy: function() { | |
this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"); | |
this.mouseDestroy() | |
}, | |
mouseStart: function(f) { | |
var c = this; | |
this.opos = [f.pageX, f.pageY]; | |
if (this.options.disabled) { | |
return | |
} | |
var d = this.options; | |
this.selectees = a(d.filter, this.element[0]); | |
this.element.triggerHandler("selectablestart", [f, { | |
selectable: this.element[0], | |
options: d | |
}], d.start); | |
a("body").append(this.helper); | |
this.helper.css({ | |
"z-index": 100, | |
position: "absolute", | |
left: f.clientX, | |
top: f.clientY, | |
width: 0, | |
height: 0 | |
}); | |
if (d.autoRefresh) { | |
this.refresh() | |
} | |
this.selectees.filter(".ui-selected").each(function() { | |
var e = a.data(this, "selectable-item"); | |
e.startselected = true; | |
if (!f.ctrlKey) { | |
e.$element.removeClass("ui-selected"); | |
e.selected = false; | |
e.$element.addClass("ui-unselecting"); | |
e.unselecting = true; | |
c.element.triggerHandler("selectableunselecting", [f, { | |
selectable: c.element[0], | |
unselecting: e.element, | |
options: d | |
}], d.unselecting) | |
} | |
}); | |
var b = false; | |
a(f.target).parents().andSelf().each(function() { | |
if (a.data(this, "selectable-item")) { | |
b = true | |
} | |
}); | |
return this.options.keyboard ? !b : true | |
}, | |
mouseDrag: function(k) { | |
var c = this; | |
this.dragged = true; | |
if (this.options.disabled) { | |
return | |
} | |
var f = this.options; | |
var d = this.opos[0], | |
j = this.opos[1], | |
b = k.pageX, | |
h = k.pageY; | |
if (d > b) { | |
var g = b; | |
b = d; | |
d = g | |
} | |
if (j > h) { | |
var g = h; | |
h = j; | |
j = g | |
} | |
this.helper.css({ | |
left: d, | |
top: j, | |
width: b - d, | |
height: h - j | |
}); | |
this.selectees.each(function() { | |
var e = a.data(this, "selectable-item"); | |
if (!e || e.element == c.element[0]) { | |
return | |
} | |
var l = false; | |
if (f.tolerance == "touch") { | |
l = (!(e.left > b || e.right < d || e.top > h || e.bottom < j)) | |
} else { | |
if (f.tolerance == "fit") { | |
l = (e.left > d && e.right < b && e.top > j && e.bottom < h) | |
} | |
} | |
if (l) { | |
if (e.selected) { | |
e.$element.removeClass("ui-selected"); | |
e.selected = false | |
} | |
if (e.unselecting) { | |
e.$element.removeClass("ui-unselecting"); | |
e.unselecting = false | |
} | |
if (!e.selecting) { | |
e.$element.addClass("ui-selecting"); | |
e.selecting = true; | |
c.element.triggerHandler("selectableselecting", [k, { | |
selectable: c.element[0], | |
selecting: e.element, | |
options: f | |
}], f.selecting) | |
} | |
} else { | |
if (e.selecting) { | |
if (k.ctrlKey && e.startselected) { | |
e.$element.removeClass("ui-selecting"); | |
e.selecting = false; | |
e.$element.addClass("ui-selected"); | |
e.selected = true | |
} else { | |
e.$element.removeClass("ui-selecting"); | |
e.selecting = false; | |
if (e.startselected) { | |
e.$element.addClass("ui-unselecting"); | |
e.unselecting = true | |
} | |
c.element.triggerHandler("selectableunselecting", [k, { | |
selectable: c.element[0], | |
unselecting: e.element, | |
options: f | |
}], f.unselecting) | |
} | |
} | |
if (e.selected) { | |
if (!k.ctrlKey && !e.startselected) { | |
e.$element.removeClass("ui-selected"); | |
e.selected = false; | |
e.$element.addClass("ui-unselecting"); | |
e.unselecting = true; | |
c.element.triggerHandler("selectableunselecting", [k, { | |
selectable: c.element[0], | |
unselecting: e.element, | |
options: f | |
}], f.unselecting) | |
} | |
} | |
} | |
}); | |
return false | |
}, | |
mouseStop: function(d) { | |
var b = this; | |
this.dragged = false; | |
var c = this.options; | |
a(".ui-unselecting", this.element[0]).each(function() { | |
var e = a.data(this, "selectable-item"); | |
e.$element.removeClass("ui-unselecting"); | |
e.unselecting = false; | |
e.startselected = false; | |
b.element.triggerHandler("selectableunselected", [d, { | |
selectable: b.element[0], | |
unselected: e.element, | |
options: c | |
}], c.unselected) | |
}); | |
a(".ui-selecting", this.element[0]).each(function() { | |
var e = a.data(this, "selectable-item"); | |
e.$element.removeClass("ui-selecting").addClass("ui-selected"); | |
e.selecting = false; | |
e.selected = true; | |
e.startselected = true; | |
b.element.triggerHandler("selectableselected", [d, { | |
selectable: b.element[0], | |
selected: e.element, | |
options: c | |
}], c.selected) | |
}); | |
this.element.triggerHandler("selectablestop", [d, { | |
selectable: b.element[0], | |
options: this.options | |
}], this.options.stop); | |
this.helper.remove(); | |
return false | |
} | |
})); | |
a.extend(a.ui.selectable, { | |
defaults: { | |
distance: 1, | |
delay: 0, | |
cancel: ":input", | |
appendTo: "body", | |
autoRefresh: true, | |
filter: "*", | |
tolerance: "touch" | |
} | |
}) | |
})(jQuery); | |
(function(b) { | |
function a(e, d) { | |
var c = b.browser.safari && b.browser.version < 522; | |
if (e.contains && !c) { | |
return e.contains(d) | |
} | |
if (e.compareDocumentPosition) { | |
return !!(e.compareDocumentPosition(d) & 16) | |
} | |
while (d = d.parentNode) { | |
if (d == e) { | |
return true | |
} | |
} | |
return false | |
} | |
b.widget("ui.sortable", b.extend({}, b.ui.mouse, { | |
init: function() { | |
var c = this.options; | |
this.containerCache = {}; | |
this.element.addClass("ui-sortable"); | |
this.refresh(); | |
this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css("float")) : false; | |
if (!(/(relative|absolute|fixed)/).test(this.element.css("position"))) { | |
this.element.css("position", "relative") | |
} | |
this.offset = this.element.offset(); | |
this.mouseInit() | |
}, | |
plugins: {}, | |
ui: function(c) { | |
return { | |
helper: (c || this)["helper"], | |
placeholder: (c || this)["placeholder"] || b([]), | |
position: (c || this)["position"], | |
absolutePosition: (c || this)["positionAbs"], | |
options: this.options, | |
element: this.element, | |
item: (c || this)["currentItem"], | |
sender: c ? c.element : null | |
} | |
}, | |
propagate: function(g, f, c, d) { | |
b.ui.plugin.call(this, g, [f, this.ui(c)]); | |
if (!d) { | |
this.element.triggerHandler(g == "sort" ? g : "sort" + g, [f, this.ui(c)], this.options[g]) | |
} | |
}, | |
serialize: function(e) { | |
var c = (b.isFunction(this.options.items) ? this.options.items.call(this.element) : b(this.options.items, this.element)).not(".ui-sortable-helper"); | |
var d = []; | |
e = e || {}; | |
c.each(function() { | |
var f = (b(this).attr(e.attribute || "id") || "").match(e.expression || (/(.+)[-=_](.+)/)); | |
if (f) { | |
d.push((e.key || f[1]) + "[]=" + (e.key && e.expression ? f[1] : f[2])) | |
} | |
}); | |
return d.join("&") | |
}, | |
toArray: function(c) { | |
var d = (b.isFunction(this.options.items) ? this.options.items.call(this.element) : b(this.options.items, this.element)).not(".ui-sortable-helper"); | |
var e = []; | |
d.each(function() { | |
e.push(b(this).attr(c || "id")) | |
}); | |
return e | |
}, | |
intersectsWith: function(k) { | |
var e = this.positionAbs.left, | |
d = e + this.helperProportions.width, | |
j = this.positionAbs.top, | |
h = j + this.helperProportions.height; | |
var f = k.left, | |
c = f + k.width, | |
m = k.top, | |
g = m + k.height; | |
if (this.options.tolerance == "pointer" || this.options.forcePointerForContainers || (this.options.tolerance == "guess" && this.helperProportions[this.floating ? "width" : "height"] > k[this.floating ? "width" : "height"])) { | |
return (j + this.offset.click.top > m && j + this.offset.click.top < g && e + this.offset.click.left > f && e + this.offset.click.left < c) | |
} else { | |
return (f < e + (this.helperProportions.width / 2) && d - (this.helperProportions.width / 2) < c && m < j + (this.helperProportions.height / 2) && h - (this.helperProportions.height / 2) < g) | |
} | |
}, | |
intersectsWithEdge: function(k) { | |
var e = this.positionAbs.left, | |
d = e + this.helperProportions.width, | |
j = this.positionAbs.top, | |
h = j + this.helperProportions.height; | |
var f = k.left, | |
c = f + k.width, | |
m = k.top, | |
g = m + k.height; | |
if (this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.helperProportions[this.floating ? "width" : "height"] > k[this.floating ? "width" : "height"])) { | |
if (!(j + this.offset.click.top > m && j + this.offset.click.top < g && e + this.offset.click.left > f && e + this.offset.click.left < c)) { | |
return false | |
} | |
if (this.floating) { | |
if (e + this.offset.click.left > f && e + this.offset.click.left < f + k.width / 2) { | |
return 2 | |
} | |
if (e + this.offset.click.left > f + k.width / 2 && e + this.offset.click.left < c) { | |
return 1 | |
} | |
} else { | |
if (j + this.offset.click.top > m && j + this.offset.click.top < m + k.height / 2) { | |
return 2 | |
} | |
if (j + this.offset.click.top > m + k.height / 2 && j + this.offset.click.top < g) { | |
return 1 | |
} | |
} | |
} else { | |
if (!(f < e + (this.helperProportions.width / 2) && d - (this.helperProportions.width / 2) < c && m < j + (this.helperProportions.height / 2) && h - (this.helperProportions.height / 2) < g)) { | |
return false | |
} | |
if (this.floating) { | |
if (d > f && e < f) { | |
return 2 | |
} | |
if (e < c && d > c) { | |
return 1 | |
} | |
} else { | |
if (h > m && j < m) { | |
return 1 | |
} | |
if (j < g && h > g) { | |
return 2 | |
} | |
} | |
} | |
return false | |
}, | |
refresh: function() { | |
this.refreshItems(); | |
this.refreshPositions() | |
}, | |
refreshItems: function() { | |
this.items = []; | |
this.containers = [this]; | |
var d = this.items; | |
var c = this; | |
var f = [ | |
[b.isFunction(this.options.items) ? this.options.items.call(this.element, null, { | |
options: this.options, | |
item: this.currentItem | |
}) : b(this.options.items, this.element), this] | |
]; | |
if (this.options.connectWith) { | |
for (var g = this.options.connectWith.length - 1; g >= 0; g--) { | |
var k = b(this.options.connectWith[g]); | |
for (var e = k.length - 1; e >= 0; e--) { | |
var h = b.data(k[e], "sortable"); | |
if (h && !h.options.disabled) { | |
f.push([b.isFunction(h.options.items) ? h.options.items.call(h.element) : b(h.options.items, h.element), h]); | |
this.containers.push(h) | |
} | |
} | |
} | |
} | |
for (var g = f.length - 1; g >= 0; g--) { | |
f[g][0].each(function() { | |
b.data(this, "sortable-item", f[g][1]); | |
d.push({ | |
item: b(this), | |
instance: f[g][1], | |
width: 0, | |
height: 0, | |
left: 0, | |
top: 0 | |
}) | |
}) | |
} | |
}, | |
refreshPositions: function(d) { | |
if (this.offsetParent) { | |
var c = this.offsetParent.offset(); | |
this.offset.parent = { | |
top: c.top + this.offsetParentBorders.top, | |
left: c.left + this.offsetParentBorders.left | |
} | |
} | |
for (var f = this.items.length - 1; f >= 0; f--) { | |
if (this.items[f].instance != this.currentContainer && this.currentContainer && this.items[f].item[0] != this.currentItem[0]) { | |
continue | |
} | |
var e = this.options.toleranceElement ? b(this.options.toleranceElement, this.items[f].item) : this.items[f].item; | |
if (!d) { | |
this.items[f].width = e[0].offsetWidth; | |
this.items[f].height = e[0].offsetHeight | |
} | |
var g = e.offset(); | |
this.items[f].left = g.left; | |
this.items[f].top = g.top | |
} | |
if (this.options.custom && this.options.custom.refreshContainers) { | |
this.options.custom.refreshContainers.call(this) | |
} else { | |
for (var f = this.containers.length - 1; f >= 0; f--) { | |
var g = this.containers[f].element.offset(); | |
this.containers[f].containerCache.left = g.left; | |
this.containers[f].containerCache.top = g.top; | |
this.containers[f].containerCache.width = this.containers[f].element.outerWidth(); | |
this.containers[f].containerCache.height = this.containers[f].element.outerHeight() | |
} | |
} | |
}, | |
destroy: function() { | |
this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable"); | |
this.mouseDestroy(); | |
for (var c = this.items.length - 1; c >= 0; c--) { | |
this.items[c].item.removeData("sortable-item") | |
} | |
}, | |
createPlaceholder: function(e) { | |
var c = e || this, | |
f = c.options; | |
if (f.placeholder.constructor == String) { | |
var d = f.placeholder; | |
f.placeholder = { | |
element: function() { | |
return b("<div></div>").addClass(d)[0] | |
}, | |
update: function(g, h) { | |
h.css(g.offset()).css({ | |
width: g.outerWidth(), | |
height: g.outerHeight() | |
}) | |
} | |
} | |
} | |
c.placeholder = b(f.placeholder.element.call(c.element, c.currentItem)).appendTo("body").css({ | |
position: "absolute" | |
}); | |
f.placeholder.update.call(c.element, c.currentItem, c.placeholder) | |
}, | |
contactContainers: function(g) { | |
for (var d = this.containers.length - 1; d >= 0; d--) { | |
if (this.intersectsWith(this.containers[d].containerCache)) { | |
if (!this.containers[d].containerCache.over) { | |
if (this.currentContainer != this.containers[d]) { | |
var l = 10000; | |
var k = null; | |
var f = this.positionAbs[this.containers[d].floating ? "left" : "top"]; | |
for (var c = this.items.length - 1; c >= 0; c--) { | |
if (!a(this.containers[d].element[0], this.items[c].item[0])) { | |
continue | |
} | |
var h = this.items[c][this.containers[d].floating ? "left" : "top"]; | |
if (Math.abs(h - f) < l) { | |
l = Math.abs(h - f); | |
k = this.items[c] | |
} | |
} | |
if (!k && !this.options.dropOnEmpty) { | |
continue | |
} | |
if (this.placeholder) { | |
this.placeholder.remove() | |
} | |
if (this.containers[d].options.placeholder) { | |
this.containers[d].createPlaceholder(this) | |
} else { | |
this.placeholder = null | |
} | |
this.currentContainer = this.containers[d]; | |
k ? this.rearrange(g, k, null, true) : this.rearrange(g, null, this.containers[d].element, true); | |
this.propagate("change", g); | |
this.containers[d].propagate("change", g, this) | |
} | |
this.containers[d].propagate("over", g, this); | |
this.containers[d].containerCache.over = 1 | |
} | |
} else { | |
if (this.containers[d].containerCache.over) { | |
this.containers[d].propagate("out", g, this); | |
this.containers[d].containerCache.over = 0 | |
} | |
} | |
} | |
}, | |
mouseCapture: function(h, g) { | |
if (this.options.disabled || this.options.type == "static") { | |
return false | |
} | |
this.refreshItems(); | |
var f = null, | |
d = this, | |
c = b(h.target).parents().each(function() { | |
if (b.data(this, "sortable-item") == d) { | |
f = b(this); | |
return false | |
} | |
}); | |
if (b.data(h.target, "sortable-item") == d) { | |
f = b(h.target) | |
} | |
if (!f) { | |
return false | |
} | |
if (this.options.handle && !g) { | |
var j = false; | |
b(this.options.handle, f).find("*").andSelf().each(function() { | |
if (this == h.target) { | |
j = true | |
} | |
}); | |
if (!j) { | |
return false | |
} | |
} | |
this.currentItem = f; | |
return true | |
}, | |
mouseStart: function(j, g, c) { | |
var l = this.options; | |
this.currentContainer = this; | |
this.refreshPositions(); | |
this.helper = typeof l.helper == "function" ? b(l.helper.apply(this.element[0], [j, this.currentItem])) : this.currentItem.clone(); | |
if (!this.helper.parents("body").length) { | |
b(l.appendTo != "parent" ? l.appendTo : this.currentItem[0].parentNode)[0].appendChild(this.helper[0]) | |
} | |
this.helper.css({ | |
position: "absolute", | |
clear: "both" | |
}).addClass("ui-sortable-helper"); | |
this.margins = { | |
left: (parseInt(this.currentItem.css("marginLeft"), 10) || 0), | |
top: (parseInt(this.currentItem.css("marginTop"), 10) || 0) | |
}; | |
this.offset = this.currentItem.offset(); | |
this.offset = { | |
top: this.offset.top - this.margins.top, | |
left: this.offset.left - this.margins.left | |
}; | |
this.offset.click = { | |
left: j.pageX - this.offset.left, | |
top: j.pageY - this.offset.top | |
}; | |
this.offsetParent = this.helper.offsetParent(); | |
var d = this.offsetParent.offset(); | |
this.offsetParentBorders = { | |
top: (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), | |
left: (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) | |
}; | |
this.offset.parent = { | |
top: d.top + this.offsetParentBorders.top, | |
left: d.left + this.offsetParentBorders.left | |
}; | |
this.originalPosition = this.generatePosition(j); | |
this.domPosition = { | |
prev: this.currentItem.prev()[0], | |
parent: this.currentItem.parent()[0] | |
}; | |
this.helperProportions = { | |
width: this.helper.outerWidth(), | |
height: this.helper.outerHeight() | |
}; | |
if (l.placeholder) { | |
this.createPlaceholder() | |
} | |
this.propagate("start", j); | |
this.helperProportions = { | |
width: this.helper.outerWidth(), | |
height: this.helper.outerHeight() | |
}; | |
if (l.cursorAt) { | |
if (l.cursorAt.left != undefined) { | |
this.offset.click.left = l.cursorAt.left | |
} | |
if (l.cursorAt.right != undefined) { | |
this.offset.click.left = this.helperProportions.width - l.cursorAt.right | |
} | |
if (l.cursorAt.top != undefined) { | |
this.offset.click.top = l.cursorAt.top | |
} | |
if (l.cursorAt.bottom != undefined) { | |
this.offset.click.top = this.helperProportions.height - l.cursorAt.bottom | |
} | |
} | |
if (l.containment) { | |
if (l.containment == "parent") { | |
l.containment = this.helper[0].parentNode | |
} | |
if (l.containment == "document" || l.containment == "window") { | |
this.containment = [0 - this.offset.parent.left, 0 - this.offset.parent.top, b(l.containment == "document" ? document : window).width() - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"), 10) || 0), (b(l.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"), 10) || 0)] | |
} | |
if (!(/^(document|window|parent)$/).test(l.containment)) { | |
var h = b(l.containment)[0]; | |
var k = b(l.containment).offset(); | |
this.containment = [k.left + (parseInt(b(h).css("borderLeftWidth"), 10) || 0) - this.offset.parent.left, k.top + (parseInt(b(h).css("borderTopWidth"), 10) || 0) - this.offset.parent.top, k.left + Math.max(h.scrollWidth, h.offsetWidth) - (parseInt(b(h).css("borderLeftWidth"), 10) || 0) - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"), 10) || 0), k.top + Math.max(h.scrollHeight, h.offsetHeight) - (parseInt(b(h).css("borderTopWidth"), 10) || 0) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"), 10) || 0)] | |
} | |
} | |
if (this.options.placeholder != "clone") { | |
this.currentItem.css("visibility", "hidden") | |
} | |
if (!c) { | |
for (var f = this.containers.length - 1; f >= 0; f--) { | |
this.containers[f].propagate("activate", j, this) | |
} | |
} | |
if (b.ui.ddmanager) { | |
b.ui.ddmanager.current = this | |
} | |
if (b.ui.ddmanager && !l.dropBehaviour) { | |
b.ui.ddmanager.prepareOffsets(this, j) | |
} | |
this.dragging = true; | |
this.mouseDrag(j); | |
return true | |
}, | |
convertPositionTo: function(e, f) { | |
if (!f) { | |
f = this.position | |
} | |
var c = e == "absolute" ? 1 : -1; | |
return { | |
top: (f.top + this.offset.parent.top * c - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * c + this.margins.top * c), | |
left: (f.left + this.offset.parent.left * c - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * c + this.margins.left * c) | |
} | |
}, | |
generatePosition: function(g) { | |
var h = this.options; | |
var c = { | |
top: (g.pageY - this.offset.click.top - this.offset.parent.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)), | |
left: (g.pageX - this.offset.click.left - this.offset.parent.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)) | |
}; | |
if (!this.originalPosition) { | |
return c | |
} | |
if (this.containment) { | |
if (c.left < this.containment[0]) { | |
c.left = this.containment[0] | |
} | |
if (c.top < this.containment[1]) { | |
c.top = this.containment[1] | |
} | |
if (c.left > this.containment[2]) { | |
c.left = this.containment[2] | |
} | |
if (c.top > this.containment[3]) { | |
c.top = this.containment[3] | |
} | |
} | |
if (h.grid) { | |
var f = this.originalPosition.top + Math.round((c.top - this.originalPosition.top) / h.grid[1]) * h.grid[1]; | |
c.top = this.containment ? (!(f < this.containment[1] || f > this.containment[3]) ? f : (!(f < this.containment[1]) ? f - h.grid[1] : f + h.grid[1])) : f; | |
var d = this.originalPosition.left + Math.round((c.left - this.originalPosition.left) / h.grid[0]) * h.grid[0]; | |
c.left = this.containment ? (!(d < this.containment[0] || d > this.containment[2]) ? d : (!(d < this.containment[0]) ? d - h.grid[0] : d + h.grid[0])) : d | |
} | |
return c | |
}, | |
mouseDrag: function(d) { | |
this.position = this.generatePosition(d); | |
this.positionAbs = this.convertPositionTo("absolute"); | |
b.ui.plugin.call(this, "sort", [d, this.ui()]); | |
this.positionAbs = this.convertPositionTo("absolute"); | |
this.helper[0].style.left = this.position.left + "px"; | |
this.helper[0].style.top = this.position.top + "px"; | |
for (var c = this.items.length - 1; c >= 0; c--) { | |
var f = this.intersectsWithEdge(this.items[c]); | |
if (!f) { | |
continue | |
} | |
if (this.items[c].item[0] != this.currentItem[0] && this.currentItem[f == 1 ? "next" : "prev"]()[0] != this.items[c].item[0] && !a(this.currentItem[0], this.items[c].item[0]) && (this.options.type == "semi-dynamic" ? !a(this.element[0], this.items[c].item[0]) : true)) { | |
this.direction = f == 1 ? "down" : "up"; | |
this.rearrange(d, this.items[c]); | |
this.propagate("change", d); | |
break | |
} | |
} | |
this.contactContainers(d); | |
if (b.ui.ddmanager) { | |
b.ui.ddmanager.drag(this, d) | |
} | |
this.element.triggerHandler("sort", [d, this.ui()], this.options.sort); | |
return false | |
}, | |
rearrange: function(j, h, d, g) { | |
d ? d[0].appendChild(this.currentItem[0]) : h.item[0].parentNode.insertBefore(this.currentItem[0], (this.direction == "down" ? h.item[0] : h.item[0].nextSibling)); | |
this.counter = this.counter ? ++this.counter : 1; | |
var f = this, | |
c = this.counter; | |
window.setTimeout(function() { | |
if (c == f.counter) { | |
f.refreshPositions(!g) | |
} | |
}, 0); | |
if (this.options.placeholder) { | |
this.options.placeholder.update.call(this.element, this.currentItem, this.placeholder) | |
} | |
}, | |
mouseStop: function(f, d) { | |
if (b.ui.ddmanager && !this.options.dropBehaviour) { | |
b.ui.ddmanager.drop(this, f) | |
} | |
if (this.options.revert) { | |
var c = this; | |
var g = c.currentItem.offset(); | |
if (c.placeholder) { | |
c.placeholder.animate({ | |
opacity: "hide" | |
}, (parseInt(this.options.revert, 10) || 500) - 50) | |
} | |
b(this.helper).animate({ | |
left: g.left - this.offset.parent.left - c.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), | |
top: g.top - this.offset.parent.top - c.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) | |
}, parseInt(this.options.revert, 10) || 500, function() { | |
c.clear(f) | |
}) | |
} else { | |
this.clear(f, d) | |
} | |
return false | |
}, | |
clear: function(f, d) { | |
if (this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) { | |
this.propagate("update", f, null, d) | |
} | |
if (!a(this.element[0], this.currentItem[0])) { | |
this.propagate("remove", f, null, d); | |
for (var c = this.containers.length - 1; c >= 0; c--) { | |
if (a(this.containers[c].element[0], this.currentItem[0])) { | |
this.containers[c].propagate("update", f, this, d); | |
this.containers[c].propagate("receive", f, this, d) | |
} | |
} | |
} | |
for (var c = this.containers.length - 1; c >= 0; c--) { | |
this.containers[c].propagate("deactivate", f, this, d); | |
if (this.containers[c].containerCache.over) { | |
this.containers[c].propagate("out", f, this); | |
this.containers[c].containerCache.over = 0 | |
} | |
} | |
this.dragging = false; | |
if (this.cancelHelperRemoval) { | |
this.propagate("stop", f, null, d); | |
return false | |
} | |
b(this.currentItem).css("visibility", ""); | |
if (this.placeholder) { | |
this.placeholder.remove() | |
} | |
this.helper.remove(); | |
this.helper = null; | |
this.propagate("stop", f, null, d); | |
return true | |
} | |
})); | |
b.extend(b.ui.sortable, { | |
getter: "serialize toArray", | |
defaults: { | |
helper: "clone", | |
tolerance: "guess", | |
distance: 1, | |
delay: 0, | |
scroll: true, | |
scrollSensitivity: 20, | |
scrollSpeed: 20, | |
cancel: ":input", | |
items: "> *", | |
zIndex: 1000, | |
dropOnEmpty: true, | |
appendTo: "parent" | |
} | |
}); | |
b.ui.plugin.add("sortable", "cursor", { | |
start: function(f, d) { | |
var c = b("body"); | |
if (c.css("cursor")) { | |
d.options._cursor = c.css("cursor") | |
} | |
c.css("cursor", d.options.cursor) | |
}, | |
stop: function(d, c) { | |
if (c.options._cursor) { | |
b("body").css("cursor", c.options._cursor) | |
} | |
} | |
}); | |
b.ui.plugin.add("sortable", "zIndex", { | |
start: function(f, d) { | |
var c = d.helper; | |
if (c.css("zIndex")) { | |
d.options._zIndex = c.css("zIndex") | |
} | |
c.css("zIndex", d.options.zIndex) | |
}, | |
stop: function(d, c) { | |
if (c.options._zIndex) { | |
b(c.helper).css("zIndex", c.options._zIndex) | |
} | |
} | |
}); | |
b.ui.plugin.add("sortable", "opacity", { | |
start: function(f, d) { | |
var c = d.helper; | |
if (c.css("opacity")) { | |
d.options._opacity = c.css("opacity") | |
} | |
c.css("opacity", d.options.opacity) | |
}, | |
stop: function(d, c) { | |
if (c.options._opacity) { | |
b(c.helper).css("opacity", c.options._opacity) | |
} | |
} | |
}); | |
b.ui.plugin.add("sortable", "scroll", { | |
start: function(f, d) { | |
var g = d.options; | |
var c = b(this).data("sortable"); | |
c.overflowY = function(e) { | |
do { | |
if (/auto|scroll/.test(e.css("overflow")) || (/auto|scroll/).test(e.css("overflow-y"))) { | |
return e | |
} | |
e = e.parent() | |
} while (e[0].parentNode); | |
return b(document) | |
}(c.currentItem); | |
c.overflowX = function(e) { | |
do { | |
if (/auto|scroll/.test(e.css("overflow")) || (/auto|scroll/).test(e.css("overflow-x"))) { | |
return e | |
} | |
e = e.parent() | |
} while (e[0].parentNode); | |
return b(document) | |
}(c.currentItem); | |
if (c.overflowY[0] != document && c.overflowY[0].tagName != "HTML") { | |
c.overflowYOffset = c.overflowY.offset() | |
} | |
if (c.overflowX[0] != document && c.overflowX[0].tagName != "HTML") { | |
c.overflowXOffset = c.overflowX.offset() | |
} | |
}, | |
sort: function(f, d) { | |
var g = d.options; | |
var c = b(this).data("sortable"); | |
if (c.overflowY[0] != document && c.overflowY[0].tagName != "HTML") { | |
if ((c.overflowYOffset.top + c.overflowY[0].offsetHeight) - f.pageY < g.scrollSensitivity) { | |
c.overflowY[0].scrollTop = c.overflowY[0].scrollTop + g.scrollSpeed | |
} | |
if (f.pageY - c.overflowYOffset.top < g.scrollSensitivity) { | |
c.overflowY[0].scrollTop = c.overflowY[0].scrollTop - g.scrollSpeed | |
} | |
} else { | |
if (f.pageY - b(document).scrollTop() < g.scrollSensitivity) { | |
b(document).scrollTop(b(document).scrollTop() - g.scrollSpeed) | |
} | |
if (b(window).height() - (f.pageY - b(document).scrollTop()) < g.scrollSensitivity) { | |
b(document).scrollTop(b(document).scrollTop() + g.scrollSpeed) | |
} | |
} | |
if (c.overflowX[0] != document && c.overflowX[0].tagName != "HTML") { | |
if ((c.overflowXOffset.left + c.overflowX[0].offsetWidth) - f.pageX < g.scrollSensitivity) { | |
c.overflowX[0].scrollLeft = c.overflowX[0].scrollLeft + g.scrollSpeed | |
} | |
if (f.pageX - c.overflowXOffset.left < g.scrollSensitivity) { | |
c.overflowX[0].scrollLeft = c.overflowX[0].scrollLeft - g.scrollSpeed | |
} | |
} else { | |
if (f.pageX - b(document).scrollLeft() < g.scrollSensitivity) { | |
b(document).scrollLeft(b(document).scrollLeft() - g.scrollSpeed) | |
} | |
if (b(window).width() - (f.pageX - b(document).scrollLeft()) < g.scrollSensitivity) { | |
b(document).scrollLeft(b(document).scrollLeft() + g.scrollSpeed) | |
} | |
} | |
} | |
}); | |
b.ui.plugin.add("sortable", "axis", { | |
sort: function(f, d) { | |
var c = b(this).data("sortable"); | |
if (d.options.axis == "y") { | |
c.position.left = c.originalPosition.left | |
} | |
if (d.options.axis == "x") { | |
c.position.top = c.originalPosition.top | |
} | |
} | |
}) | |
})(jQuery); | |
(function(e) { | |
e.widget("ui.accordion", { | |
init: function() { | |
var g = this.options; | |
if (g.navigation) { | |
var k = this.element.find("a").filter(g.navigationFilter); | |
if (k.length) { | |
if (k.filter(g.header).length) { | |
g.active = k | |
} else { | |
g.active = k.parent().parent().prev(); | |
k.addClass("current") | |
} | |
} | |
} | |
g.headers = this.element.find(g.header); | |
g.active = c(g.headers, g.active); | |
if (e.browser.msie) { | |
this.element.find("a").css("zoom", "1") | |
} | |
if (!this.element.hasClass("ui-accordion")) { | |
this.element.addClass("ui-accordion"); | |
e("<span class='ui-accordion-left'/>").insertBefore(g.headers); | |
e("<span class='ui-accordion-right'/>").appendTo(g.headers); | |
g.headers.addClass("ui-accordion-header").attr("tabindex", "0") | |
} | |
var j; | |
if (g.fillSpace) { | |
j = this.element.parent().height(); | |
g.headers.each(function() { | |
j -= e(this).outerHeight() | |
}); | |
var h = 0; | |
g.headers.next().each(function() { | |
h = Math.max(h, e(this).innerHeight() - e(this).height()) | |
}).height(j - h) | |
} else { | |
if (g.autoHeight) { | |
j = 0; | |
g.headers.next().each(function() { | |
j = Math.max(j, e(this).outerHeight()) | |
}).height(j) | |
} | |
} | |
g.headers.not(g.active || "").next().hide(); | |
g.active.parent().andSelf().addClass(g.selectedClass); | |
if (g.event) { | |
this.element.bind((g.event) + ".accordion", f) | |
} | |
}, | |
activate: function(g) { | |
f.call(this.element[0], { | |
target: c(this.options.headers, g)[0] | |
}) | |
}, | |
destroy: function() { | |
this.options.headers.next().css("display", ""); | |
if (this.options.fillSpace || this.options.autoHeight) { | |
this.options.headers.next().css("height", "") | |
} | |
e.removeData(this.element[0], "accordion"); | |
this.element.removeClass("ui-accordion").unbind(".accordion") | |
} | |
}); | |
function b(h, g) { | |
return function() { | |
return h.apply(g, arguments) | |
} | |
} | |
function d(j) { | |
if (!e.data(this, "accordion")) { | |
return | |
} | |
var g = e.data(this, "accordion"); | |
var h = g.options; | |
h.running = j ? 0 : --h.running; | |
if (h.running) { | |
return | |
} | |
if (h.clearStyle) { | |
h.toShow.add(h.toHide).css({ | |
height: "", | |
overflow: "" | |
}) | |
} | |
e(this).triggerHandler("accordionchange", [e.event.fix({ | |
type: "accordionchange", | |
target: g.element[0] | |
}), h.data], h.change) | |
} | |
function a(g, l, m, k, n) { | |
var j = e.data(this, "accordion").options; | |
j.toShow = g; | |
j.toHide = l; | |
j.data = m; | |
var h = b(d, this); | |
j.running = l.size() === 0 ? g.size() : l.size(); | |
if (j.animated) { | |
if (!j.alwaysOpen && k) { | |
e.ui.accordion.animations[j.animated]({ | |
toShow: jQuery([]), | |
toHide: l, | |
complete: h, | |
down: n, | |
autoHeight: j.autoHeight | |
}) | |
} else { | |
e.ui.accordion.animations[j.animated]({ | |
toShow: g, | |
toHide: l, | |
complete: h, | |
down: n, | |
autoHeight: j.autoHeight | |
}) | |
} | |
} else { | |
if (!j.alwaysOpen && k) { | |
g.toggle() | |
} else { | |
l.hide(); | |
g.show() | |
} | |
h(true) | |
} | |
} | |
function f(m) { | |
var k = e.data(this, "accordion").options; | |
if (k.disabled) { | |
return false | |
} | |
if (!m.target && !k.alwaysOpen) { | |
k.active.parent().andSelf().toggleClass(k.selectedClass); | |
var j = k.active.next(), | |
n = { | |
options: k, | |
newHeader: jQuery([]), | |
oldHeader: k.active, | |
newContent: jQuery([]), | |
oldContent: j | |
}, | |
g = (k.active = e([])); | |
a.call(this, g, j, n); | |
return false | |
} | |
var l = e(m.target); | |
l = e(l.parents(k.header)[0] || l); | |
var h = l[0] == k.active[0]; | |
if (k.running || (k.alwaysOpen && h)) { | |
return false | |
} | |
if (!l.is(k.header)) { | |
return | |
} | |
k.active.parent().andSelf().toggleClass(k.selectedClass); | |
if (!h) { | |
l.parent().andSelf().addClass(k.selectedClass) | |
} | |
var g = l.next(), | |
j = k.active.next(), | |
n = { | |
options: k, | |
newHeader: l, | |
oldHeader: k.active, | |
newContent: g, | |
oldContent: j | |
}, | |
o = k.headers.index(k.active[0]) > k.headers.index(l[0]); | |
k.active = h ? e([]) : l; | |
a.call(this, g, j, n, h, o); | |
return false | |
} | |
function c(h, g) { | |
return g != undefined ? typeof g == "number" ? h.filter(":eq(" + g + ")") : h.not(h.not(g)) : g === false ? e([]) : h.filter(":eq(0)") | |
} | |
e.extend(e.ui.accordion, { | |
defaults: { | |
selectedClass: "selected", | |
alwaysOpen: true, | |
animated: "slide", | |
event: "click", | |
header: "a", | |
autoHeight: true, | |
running: 0, | |
navigationFilter: function() { | |
return this.href.toLowerCase() == location.href.toLowerCase() | |
} | |
}, | |
animations: { | |
slide: function(g, j) { | |
g = e.extend({ | |
easing: "swing", | |
duration: 300 | |
}, g, j); | |
if (!g.toHide.size()) { | |
g.toShow.animate({ | |
height: "show" | |
}, g); | |
return | |
} | |
var h = g.toHide.height(), | |
k = g.toShow.height(), | |
l = k / h; | |
g.toShow.css({ | |
height: 0, | |
overflow: "hidden" | |
}).show(); | |
g.toHide.filter(":hidden").each(g.complete).end().filter(":visible").animate({ | |
height: "hide" | |
}, { | |
step: function(m) { | |
var n = (h - m) * l; | |
if (e.browser.msie || e.browser.opera) { | |
n = Math.ceil(n) | |
} | |
g.toShow.height(n) | |
}, | |
duration: g.duration, | |
easing: g.easing, | |
complete: function() { | |
if (!g.autoHeight) { | |
g.toShow.css("height", "auto") | |
} | |
g.complete() | |
} | |
}) | |
}, | |
bounceslide: function(g) { | |
this.slide(g, { | |
easing: g.down ? "bounceout" : "swing", | |
duration: g.down ? 1000 : 200 | |
}) | |
}, | |
easeslide: function(g) { | |
this.slide(g, { | |
easing: "easeinout", | |
duration: 700 | |
}) | |
} | |
} | |
}); | |
e.fn.activate = function(g) { | |
return this.accordion("activate", g) | |
} | |
})(jQuery); | |
(function(b) { | |
var a = { | |
dragStart: "start.draggable", | |
drag: "drag.draggable", | |
dragStop: "stop.draggable", | |
maxHeight: "maxHeight.resizable", | |
minHeight: "minHeight.resizable", | |
maxWidth: "maxWidth.resizable", | |
minWidth: "minWidth.resizable", | |
resizeStart: "start.resizable", | |
resize: "drag.resizable", | |
resizeStop: "stop.resizable" | |
}; | |
b.widget("ui.dialog", { | |
init: function() { | |
var k = this, | |
l = this.options, | |
d = typeof l.resizable == "string" ? l.resizable : "n,e,s,w,se,sw,ne,nw", | |
e = this.element.addClass("ui-dialog-content").wrap("<div/>").wrap("<div/>"), | |
g = (this.uiDialogContainer = e.parent().addClass("ui-dialog-container").css({ | |
position: "relative", | |
width: "100%", | |
height: "100%" | |
})), | |
h = l.title || e.attr("title") || "", | |
c = (this.uiDialogTitlebar = b('<div class="ui-dialog-titlebar"/>')).append('<span class="ui-dialog-title">' + h + "</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(g), | |
j = (this.uiDialog = g.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(l.dialogClass).addClass(e.attr("className")).removeClass("ui-dialog-content").css({ | |
position: "absolute", | |
width: l.width, | |
height: l.height, | |
overflow: "hidden", | |
zIndex: l.zIndex | |
}).attr("tabIndex", -1).css("outline", 0).keydown(function(m) { | |
if (l.closeOnEscape) { | |
var n = 27; | |
(m.keyCode && m.keyCode == n && k.close()) | |
} | |
}).mousedown(function() { | |
k.moveToTop() | |
}), | |
f = (this.uiDialogButtonPane = b("<div/>")).addClass("ui-dialog-buttonpane").css({ | |
position: "absolute", | |
bottom: 0 | |
}).appendTo(j); | |
this.uiDialogTitlebarClose = b(".ui-dialog-titlebar-close", c).hover(function() { | |
b(this).addClass("ui-dialog-titlebar-close-hover") | |
}, function() { | |
b(this).removeClass("ui-dialog-titlebar-close-hover") | |
}).mousedown(function(m) { | |
m.stopPropagation() | |
}).click(function() { | |
k.close(); | |
return false | |
}); | |
this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function() { | |
b.ui.disableSelection(this) | |
}); | |
if (b.fn.draggable) { | |
j.draggable({ | |
cancel: ".ui-dialog-content", | |
helper: l.dragHelper, | |
handle: ".ui-dialog-titlebar", | |
start: function(n, m) { | |
k.moveToTop(); | |
(l.dragStart && l.dragStart.apply(k.element[0], arguments)) | |
}, | |
drag: function(n, m) { | |
(l.drag && l.drag.apply(k.element[0], arguments)) | |
}, | |
stop: function(n, m) { | |
(l.dragStop && l.dragStop.apply(k.element[0], arguments)); | |
b.ui.dialog.overlay.resize() | |
} | |
}); | |
(l.draggable || j.draggable("disable")) | |
} | |
if (b.fn.resizable) { | |
j.resizable({ | |
cancel: ".ui-dialog-content", | |
helper: l.resizeHelper, | |
maxWidth: l.maxWidth, | |
maxHeight: l.maxHeight, | |
minWidth: l.minWidth, | |
minHeight: l.minHeight, | |
start: function() { | |
(l.resizeStart && l.resizeStart.apply(k.element[0], arguments)) | |
}, | |
resize: function(n, m) { | |
(l.autoResize && k.size.apply(k)); | |
(l.resize && l.resize.apply(k.element[0], arguments)) | |
}, | |
handles: d, | |
stop: function(n, m) { | |
(l.autoResize && k.size.apply(k)); | |
(l.resizeStop && l.resizeStop.apply(k.element[0], arguments)); | |
b.ui.dialog.overlay.resize() | |
} | |
}); | |
(l.resizable || j.resizable("disable")) | |
} | |
this.createButtons(l.buttons); | |
this.isOpen = false; | |
(l.bgiframe && b.fn.bgiframe && j.bgiframe()); | |
(l.autoOpen && this.open()) | |
}, | |
setData: function(c, d) { | |
(a[c] && this.uiDialog.data(a[c], d)); | |
switch (c) { | |
case "buttons": | |
this.createButtons(d); | |
break; | |
case "draggable": | |
this.uiDialog.draggable(d ? "enable" : "disable"); | |
break; | |
case "height": | |
this.uiDialog.height(d); | |
break; | |
case "position": | |
this.position(d); | |
break; | |
case "resizable": | |
(typeof d == "string" && this.uiDialog.data("handles.resizable", d)); | |
this.uiDialog.resizable(d ? "enable" : "disable"); | |
break; | |
case "title": | |
b(".ui-dialog-title", this.uiDialogTitlebar).text(d); | |
break; | |
case "width": | |
this.uiDialog.width(d); | |
break | |
} | |
b.widget.prototype.setData.apply(this, arguments) | |
}, | |
position: function(h) { | |
var d = b(window), | |
e = b(document), | |
f = e.scrollTop(), | |
c = e.scrollLeft(), | |
g = f; | |
if (b.inArray(h, ["center", "top", "right", "bottom", "left"]) >= 0) { | |
h = [h == "right" || h == "left" ? h : "center", h == "top" || h == "bottom" ? h : "middle"] | |
} | |
if (h.constructor != Array) { | |
h = ["center", "middle"] | |
} | |
if (h[0].constructor == Number) { | |
c += h[0] | |
} else { | |
switch (h[0]) { | |
case "left": | |
c += 0; | |
break; | |
case "right": | |
c += d.width() - this.uiDialog.width(); | |
break; | |
default: | |
case "center": | |
c += (d.width() - this.uiDialog.width()) / 2 | |
} | |
} | |
if (h[1].constructor == Number) { | |
f += h[1] | |
} else { | |
switch (h[1]) { | |
case "top": | |
f += 0; | |
break; | |
case "bottom": | |
f += d.height() - this.uiDialog.height(); | |
break; | |
default: | |
case "middle": | |
f += (d.height() - this.uiDialog.height()) / 2 | |
} | |
} | |
f = Math.max(f, g); | |
this.uiDialog.css({ | |
top: f, | |
left: c | |
}) | |
}, | |
size: function() { | |
var d = this.uiDialogContainer, | |
g = this.uiDialogTitlebar, | |
e = this.element, | |
f = parseInt(e.css("margin-top"), 10) + parseInt(e.css("margin-bottom"), 10), | |
c = parseInt(e.css("margin-left"), 10) + parseInt(e.css("margin-right"), 10) | |
}, | |
open: function() { | |
if (this.isOpen) { | |
return | |
} | |
this.overlay = this.options.modal ? new b.ui.dialog.overlay(this) : null; | |
(this.uiDialog.next().length > 0) && this.uiDialog.appendTo("body"); | |
this.position(this.options.position); | |
this.uiDialog.show(this.options.show); | |
this.options.autoResize && this.size(); | |
this.moveToTop(true); | |
var c = null; | |
var d = { | |
options: this.options | |
}; | |
this.uiDialogTitlebarClose.focus(); | |
this.element.triggerHandler("dialogopen", [c, d], this.options.open); | |
this.isOpen = true | |
}, | |
moveToTop: function(e) { | |
if ((this.options.modal && !e) || (!this.options.stack && !this.options.modal)) { | |
return this.element.triggerHandler("dialogfocus", [null, { | |
options: this.options | |
}], this.options.focus) | |
} | |
var d = this.options.zIndex, | |
c = this.options; | |
b(".ui-dialog:visible").each(function() { | |
d = Math.max(d, parseInt(b(this).css("z-index"), 10) || c.zIndex) | |
}); | |
(this.overlay && this.overlay.$el.css("z-index", ++d)); | |
this.uiDialog.css("z-index", ++d); | |
this.element.triggerHandler("dialogfocus", [null, { | |
options: this.options | |
}], this.options.focus) | |
}, | |
close: function() { | |
(this.overlay && this.overlay.destroy()); | |
this.uiDialog.hide(this.options.hide); | |
var d = null; | |
var c = { | |
options: this.options | |
}; | |
this.element.triggerHandler("dialogclose", [d, c], this.options.close); | |
b.ui.dialog.overlay.resize(); | |
this.isOpen = false | |
}, | |
destroy: function() { | |
(this.overlay && this.overlay.destroy()); | |
this.uiDialog.hide(); | |
this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body"); | |
this.uiDialog.remove() | |
}, | |
createButtons: function(f) { | |
var e = this, | |
c = false, | |
d = this.uiDialogButtonPane; | |
d.empty().hide(); | |
b.each(f, function() { | |
return !(c = true) | |
}); | |
if (c) { | |
d.show(); | |
b.each(f, function(g, h) { | |
b("<button/>").text(g).click(function() { | |
h.apply(e.element[0], arguments) | |
}).appendTo(d) | |
}) | |
} | |
} | |
}); | |
b.extend(b.ui.dialog, { | |
defaults: { | |
autoOpen: true, | |
autoResize: true, | |
bgiframe: false, | |
buttons: {}, | |
closeOnEscape: true, | |
draggable: true, | |
height: 200, | |
minHeight: 150, | |
minWidth: 150, | |
modal: false, | |
overlay: {}, | |
position: "center", | |
resizable: true, | |
stack: true, | |
width: 300, | |
zIndex: 1000 | |
}, | |
overlay: function(c) { | |
this.$el = b.ui.dialog.overlay.create(c) | |
} | |
}); | |
b.extend(b.ui.dialog.overlay, { | |
instances: [], | |
events: b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function(c) { | |
return c + ".dialog-overlay" | |
}).join(" "), | |
create: function(d) { | |
if (this.instances.length === 0) { | |
setTimeout(function() { | |
b("a, :input").bind(b.ui.dialog.overlay.events, function() { | |
var f = false; | |
var h = b(this).parents(".ui-dialog"); | |
if (h.length) { | |
var e = b(".ui-dialog-overlay"); | |
if (e.length) { | |
var g = parseInt(e.css("z-index"), 10); | |
e.each(function() { | |
g = Math.max(g, parseInt(b(this).css("z-index"), 10)) | |
}); | |
f = parseInt(h.css("z-index"), 10) > g | |
} else { | |
f = true | |
} | |
} | |
return f | |
}) | |
}, 1); | |
b(window).bind("resize.dialog-overlay", b.ui.dialog.overlay.resize) | |
} | |
var c = b("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(b.extend({ | |
borderWidth: 0, | |
margin: 0, | |
padding: 0, | |
position: "absolute", | |
top: 0, | |
left: 0, | |
width: this.width(), | |
height: this.height() | |
}, d.options.overlay)); | |
(d.options.bgiframe && b.fn.bgiframe && c.bgiframe()); | |
this.instances.push(c); | |
return c | |
}, | |
destroy: function(c) { | |
this.instances.splice(b.inArray(this.instances, c), 1); | |
if (this.instances.length === 0) { | |
b("a, :input").add([document, window]).unbind(".dialog-overlay") | |
} | |
c.remove() | |
}, | |
height: function() { | |
if (b.browser.msie && b.browser.version < 7) { | |
var d = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); | |
var c = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight); | |
if (d < c) { | |
return b(window).height() + "px" | |
} else { | |
return d + "px" | |
} | |
} else { | |
return b(document).height() + "px" | |
} | |
}, | |
width: function() { | |
if (b.browser.msie && b.browser.version < 7) { | |
var c = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); | |
var d = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); | |
if (c < d) { | |
return b(window).width() + "px" | |
} else { | |
return c + "px" | |
} | |
} else { | |
return b(document).width() + "px" | |
} | |
}, | |
resize: function() { | |
var c = b([]); | |
b.each(b.ui.dialog.overlay.instances, function() { | |
c = c.add(this) | |
}); | |
c.css({ | |
width: 0, | |
height: 0 | |
}).css({ | |
width: b.ui.dialog.overlay.width(), | |
height: b.ui.dialog.overlay.height() | |
}) | |
} | |
}); | |
b.extend(b.ui.dialog.overlay.prototype, { | |
destroy: function() { | |
b.ui.dialog.overlay.destroy(this.$el) | |
} | |
}) | |
})(jQuery); | |
(function(a) { | |
a.fn.unwrap = a.fn.unwrap || function(b) { | |
return this.each(function() { | |
a(this).parents(b).eq(0).after(this).remove() | |
}) | |
}; | |
a.widget("ui.slider", { | |
plugins: {}, | |
ui: function(b) { | |
return { | |
options: this.options, | |
handle: this.currentHandle, | |
value: this.options.axis != "both" || !this.options.axis ? Math.round(this.value(null, this.options.axis == "vertical" ? "y" : "x")) : { | |
x: Math.round(this.value(null, "x")), | |
y: Math.round(this.value(null, "y")) | |
}, | |
range: this.getRange() | |
} | |
}, | |
propagate: function(c, b) { | |
a.ui.plugin.call(this, c, [b, this.ui()]); | |
this.element.triggerHandler(c == "slide" ? c : "slide" + c, [b, this.ui()], this.options[c]) | |
}, | |
destroy: function() { | |
this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider"); | |
if (this.handle && this.handle.length) { | |
this.handle.unwrap("a"); | |
this.handle.each(function() { | |
a(this).data("mouse").mouseDestroy() | |
}) | |
} | |
this.generated && this.generated.remove() | |
}, | |
setData: function(b, c) { | |
a.widget.prototype.setData.apply(this, arguments); | |
if (/min|max|steps/.test(b)) { | |
this.initBoundaries() | |
} | |
if (b == "range") { | |
c ? this.handle.length == 2 && this.createRange() : this.removeRange() | |
} | |
}, | |
init: function() { | |
var b = this; | |
this.element.addClass("ui-slider"); | |
this.initBoundaries(); | |
this.handle = a(this.options.handle, this.element); | |
if (!this.handle.length) { | |
b.handle = b.generated = a(b.options.handles || [0]).map(function() { | |
var d = a("<div/>").addClass("ui-slider-handle").appendTo(b.element); | |
if (this.id) { | |
d.attr("id", this.id) | |
} | |
return d[0] | |
}) | |
} | |
var c = function(d) { | |
this.element = a(d); | |
this.element.data("mouse", this); | |
this.options = b.options; | |
this.element.bind("mousedown", function() { | |
if (b.currentHandle) { | |
this.blur(b.currentHandle) | |
} | |
b.focus(this, 1) | |
}); | |
this.mouseInit() | |
}; | |
a.extend(c.prototype, a.ui.mouse, { | |
mouseStart: function(d) { | |
return b.start.call(b, d, this.element[0]) | |
}, | |
mouseStop: function(d) { | |
return b.stop.call(b, d, this.element[0]) | |
}, | |
mouseDrag: function(d) { | |
return b.drag.call(b, d, this.element[0]) | |
}, | |
mouseCapture: function() { | |
return true | |
}, | |
trigger: function(d) { | |
this.mouseDown(d) | |
} | |
}); | |
a(this.handle).each(function() { | |
new c(this) | |
}).wrap('<a href="javascript:void(0)" style="outline:none;border:none;" role="slider"></a>').parent().bind("focus", function(d) { | |
b.focus(this.firstChild) | |
}).bind("blur", function(d) { | |
b.blur(this.firstChild) | |
}).bind("keydown", function(d) { | |
if (!b.options.noKeyboard) { | |
b.keydown(d.keyCode, this.firstChild) | |
} | |
}); | |
this.element.bind("mousedown.slider", function(d) { | |
b.click.apply(b, [d]); | |
b.currentHandle.data("mouse").trigger(d); | |
b.firstValue = b.firstValue + 1 | |
}); | |
a.each(this.options.handles || [], function(d, e) { | |
b.moveTo(e.start, d, true) | |
}); | |
if (!isNaN(this.options.startValue)) { | |
this.moveTo(this.options.startValue, 0, true) | |
} | |
this.previousHandle = a(this.handle[0]); | |
if (this.handle.length == 2 && this.options.range) { | |
this.createRange() | |
} | |
a(".ui-slider-inside").css({ | |
width: a(".ui-slider-handle").css("left") | |
}) | |
}, | |
initBoundaries: function() { | |
var b = this.element[0], | |
c = this.options; | |
this.actualSize = { | |
width: this.element.outerWidth(), | |
height: this.element.outerHeight() | |
}; | |
a.extend(c, { | |
axis: c.axis || (b.offsetWidth < b.offsetHeight ? "vertical" : "horizontal"), | |
max: !isNaN(parseInt(c.max, 10)) ? { | |
x: parseInt(c.max, 10), | |
y: parseInt(c.max, 10) | |
} : ({ | |
x: c.max && c.max.x || 100, | |
y: c.max && c.max.y || 100 | |
}), | |
min: !isNaN(parseInt(c.min, 10)) ? { | |
x: parseInt(c.min, 10), | |
y: parseInt(c.min, 10) | |
} : ({ | |
x: c.min && c.min.x || 0, | |
y: c.min && c.min.y || 0 | |
}) | |
}); | |
c.realMax = { | |
x: c.max.x - c.min.x, | |
y: c.max.y - c.min.y | |
}; | |
c.stepping = { | |
x: c.stepping && c.stepping.x || parseInt(c.stepping, 10) || (c.steps ? c.realMax.x / (c.steps.x || parseInt(c.steps, 10) || c.realMax.x) : 0), | |
y: c.stepping && c.stepping.y || parseInt(c.stepping, 10) || (c.steps ? c.realMax.y / (c.steps.y || parseInt(c.steps, 10) || c.realMax.y) : 0) | |
} | |
}, | |
keydown: function(c, b) { | |
if (/(37|38|39|40)/.test(c)) { | |
this.moveTo({ | |
x: /(37|39)/.test(c) ? (c == 37 ? "-" : "+") + "=" + this.oneStep("x") : 0, | |
y: /(38|40)/.test(c) ? (c == 38 ? "-" : "+") + "=" + this.oneStep("y") : 0 | |
}, b) | |
} | |
}, | |
focus: function(b, c) { | |
this.currentHandle = a(b).addClass("ui-slider-handle-active"); | |
if (c) { | |
this.currentHandle.parent()[0].focus() | |
} | |
}, | |
blur: function(b) { | |
a(b).removeClass("ui-slider-handle-active"); | |
if (this.currentHandle && this.currentHandle[0] == b) { | |
this.previousHandle = this.currentHandle; | |
this.currentHandle = null | |
} | |
}, | |
click: function(c) { | |
var d = [c.pageX, c.pageY]; | |
var b = false; | |
this.handle.each(function() { | |
if (this == c.target) { | |
b = true | |
} | |
}); | |
if (b || this.options.disabled || !(this.currentHandle || this.previousHandle)) { | |
return | |
} | |
if (!this.currentHandle && this.previousHandle) { | |
this.focus(this.previousHandle, true) | |
} | |
this.offset = this.element.offset(); | |
this.moveTo({ | |
y: this.convertValue(c.pageY - this.offset.top - this.currentHandle[0].offsetHeight / 2, "y"), | |
x: this.convertValue(c.pageX - this.offset.left - this.currentHandle[0].offsetWidth / 2, "x") | |
}, null, !this.options.distance) | |
}, | |
createRange: function() { | |
if (this.rangeElement) { | |
return | |
} | |
this.rangeElement = a("<div></div>").addClass("ui-slider-range").css({ | |
position: "absolute" | |
}).appendTo(this.element); | |
this.updateRange() | |
}, | |
removeRange: function() { | |
this.rangeElement.remove(); | |
this.rangeElement = null | |
}, | |
updateRange: function() { | |
var c = this.options.axis == "vertical" ? "top" : "left"; | |
var b = this.options.axis == "vertical" ? "height" : "width"; | |
this.rangeElement.css(c, (parseInt(a(this.handle[0]).css(c), 10) || 0) + this.handleSize(0, this.options.axis == "vertical" ? "y" : "x") / 2); | |
this.rangeElement.css(b, (parseInt(a(this.handle[1]).css(c), 10) || 0) - (parseInt(a(this.handle[0]).css(c), 10) || 0)) | |
}, | |
getRange: function() { | |
return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.options.axis == "vertical" ? "height" : "width"), 10), this.options.axis == "vertical" ? "y" : "x") : null | |
}, | |
handleIndex: function() { | |
return this.handle.index(this.currentHandle[0]) | |
}, | |
value: function(d, b) { | |
if (this.handle.length == 1) { | |
this.currentHandle = this.handle | |
} | |
if (!b) { | |
b = this.options.axis == "vertical" ? "y" : "x" | |
} | |
var c = a(d != undefined && d !== null ? this.handle[d] || d : this.currentHandle); | |
if (c.data("mouse").sliderValue) { | |
return parseInt(c.data("mouse").sliderValue[b], 10) | |
} else { | |
return parseInt(((parseInt(c.css(b == "x" ? "left" : "top"), 10) / (this.actualSize[b == "x" ? "width" : "height"] - this.handleSize(d, b))) * this.options.realMax[b]) + this.options.min[b], 10) | |
} | |
}, | |
convertValue: function(c, b) { | |
return this.options.min[b] + (c / (this.actualSize[b == "x" ? "width" : "height"] - this.handleSize(null, b))) * this.options.realMax[b] | |
}, | |
translateValue: function(c, b) { | |
return ((c - this.options.min[b]) / this.options.realMax[b]) * (this.actualSize[b == "x" ? "width" : "height"] - this.handleSize(null, b)) | |
}, | |
translateRange: function(d, b) { | |
if (this.rangeElement) { | |
if (this.currentHandle[0] == this.handle[0] && d >= this.translateValue(this.value(1), b)) { | |
d = this.translateValue(this.value(1, b) - this.oneStep(b), b) | |
} | |
if (this.currentHandle[0] == this.handle[1] && d <= this.translateValue(this.value(0), b)) { | |
d = this.translateValue(this.value(0, b) + this.oneStep(b), b) | |
} | |
} | |
if (this.options.handles) { | |
var c = this.options.handles[this.handleIndex()]; | |
if (d < this.translateValue(c.min, b)) { | |
d = this.translateValue(c.min, b) | |
} else { | |
if (d > this.translateValue(c.max, b)) { | |
d = this.translateValue(c.max, b) | |
} | |
} | |
} | |
return d | |
}, | |
translateLimits: function(c, b) { | |
if (c >= this.actualSize[b == "x" ? "width" : "height"] - this.handleSize(null, b)) { | |
c = this.actualSize[b == "x" ? "width" : "height"] - this.handleSize(null, b) | |
} | |
if (c <= 0) { | |
c = 0 | |
} | |
return c | |
}, | |
handleSize: function(c, b) { | |
return a(c != undefined && c !== null ? this.handle[c] : this.currentHandle)[0]["offset" + (b == "x" ? "Width" : "Height")] | |
}, | |
oneStep: function(b) { | |
return this.options.stepping[b] || 1 | |
}, | |
start: function(c, b) { | |
var d = this.options; | |
if (d.disabled) { | |
return false | |
} | |
this.actualSize = { | |
width: this.element.outerWidth(), | |
height: this.element.outerHeight() | |
}; | |
if (!this.currentHandle) { | |
this.focus(this.previousHandle, true) | |
} | |
this.offset = this.element.offset(); | |
this.handleOffset = this.currentHandle.offset(); | |
this.clickOffset = { | |
top: c.pageY - this.handleOffset.top, | |
left: c.pageX - this.handleOffset.left | |
}; | |
this.firstValue = this.value(); | |
this.propagate("start", c); | |
this.drag(c, b); | |
return true | |
}, | |
stop: function(b) { | |
this.propagate("stop", b); | |
if (this.firstValue != this.value()) { | |
this.propagate("change", b) | |
} | |
this.focus(this.currentHandle, true); | |
return false | |
}, | |
drag: function(f, d) { | |
var g = this.options; | |
var b = { | |
top: f.pageY - this.offset.top - this.clickOffset.top, | |
left: f.pageX - this.offset.left - this.clickOffset.left | |
}; | |
if (!this.currentHandle) { | |
this.focus(this.previousHandle, true) | |
} | |
b.left = this.translateLimits(b.left, "x"); | |
b.top = this.translateLimits(b.top, "y"); | |
if (g.stepping.x) { | |
var c = this.convertValue(b.left, "x"); | |
c = Math.round(c / g.stepping.x) * g.stepping.x; | |
b.left = this.translateValue(c, "x") | |
} | |
if (g.stepping.y) { | |
var c = this.convertValue(b.top, "y"); | |
c = Math.round(c / g.stepping.y) * g.stepping.y; | |
b.top = this.translateValue(c, "y") | |
} | |
b.left = this.translateRange(b.left, "x"); | |
b.top = this.translateRange(b.top, "y"); | |
if (g.axis != "vertical") { | |
this.currentHandle.css({ | |
left: b.left | |
}) | |
} | |
if (g.axis != "horizontal") { | |
this.currentHandle.css({ | |
top: b.top | |
}) | |
} | |
this.currentHandle.data("mouse").sliderValue = { | |
x: Math.round(this.convertValue(b.left, "x")) || 0, | |
y: Math.round(this.convertValue(b.top, "y")) || 0 | |
}; | |
if (this.rangeElement) { | |
this.updateRange() | |
} | |
this.propagate("slide", f); | |
return false | |
}, | |
moveTo: function(f, e, g) { | |
var h = this.options; | |
this.actualSize = { | |
width: this.element.outerWidth(), | |
height: this.element.outerHeight() | |
}; | |
if (e == undefined && !this.currentHandle && this.handle.length != 1) { | |
return false | |
} | |
if (e == undefined && !this.currentHandle) { | |
e = 0 | |
} | |
if (e != undefined) { | |
this.currentHandle = this.previousHandle = a(this.handle[e] || e) | |
} | |
if (f.x !== undefined && f.y !== undefined) { | |
var b = f.x, | |
j = f.y | |
} else { | |
var b = f, | |
j = f | |
} | |
if (b !== undefined && b.constructor != Number) { | |
var d = /^\-\=/.test(b), | |
c = /^\+\=/.test(b); | |
if (d || c) { | |
b = this.value(null, "x") + parseInt(b.replace(d ? "=" : "+=", ""), 10) | |
} else { | |
b = isNaN(parseInt(b, 10)) ? undefined : parseInt(b, 10) | |
} | |
} | |
if (j !== undefined && j.constructor != Number) { | |
var d = /^\-\=/.test(j), | |
c = /^\+\=/.test(j); | |
if (d || c) { | |
j = this.value(null, "y") + parseInt(j.replace(d ? "=" : "+=", ""), 10) | |
} else { | |
j = isNaN(parseInt(j, 10)) ? undefined : parseInt(j, 10) | |
} | |
} | |
if (h.axis != "vertical" && b !== undefined) { | |
if (h.stepping.x) { | |
b = Math.round(b / h.stepping.x) * h.stepping.x | |
} | |
b = this.translateValue(b, "x"); | |
b = this.translateLimits(b, "x"); | |
b = this.translateRange(b, "x"); | |
h.animate ? this.currentHandle.stop().animate({ | |
left: b | |
}, (Math.abs(parseInt(this.currentHandle.css("left")) - b)) * (!isNaN(parseInt(h.animate)) ? h.animate : 5)) : this.currentHandle.css({ | |
left: b | |
}) | |
} | |
if (h.axis != "horizontal" && j !== undefined) { | |
if (h.stepping.y) { | |
j = Math.round(j / h.stepping.y) * h.stepping.y | |
} | |
j = this.translateValue(j, "y"); | |
j = this.translateLimits(j, "y"); | |
j = this.translateRange(j, "y"); | |
h.animate ? this.currentHandle.stop().animate({ | |
top: j | |
}, (Math.abs(parseInt(this.currentHandle.css("top")) - j)) * (!isNaN(parseInt(h.animate)) ? h.animate : 5)) : this.currentHandle.css({ | |
top: j | |
}) | |
} | |
if (this.rangeElement) { | |
this.updateRange() | |
} | |
this.currentHandle.data("mouse").sliderValue = { | |
x: Math.round(this.convertValue(b, "x")) || 0, | |
y: Math.round(this.convertValue(j, "y")) || 0 | |
}; | |
if (!g) { | |
this.propagate("start", null); | |
this.propagate("stop", null); | |
this.propagate("change", null); | |
this.propagate("slide", null) | |
} | |
} | |
}); | |
a.ui.slider.getter = "value"; | |
a.ui.slider.defaults = { | |
handle: ".ui-slider-handle", | |
distance: 1, | |
animate: false | |
} | |
})(jQuery); | |
(function(a) { | |
a.widget("ui.tabs", { | |
init: function() { | |
this.options.event += ".tabs"; | |
this.tabify(true) | |
}, | |
setData: function(b, c) { | |
if ((/^selected/).test(b)) { | |
this.select(c) | |
} else { | |
this.options[b] = c; | |
this.tabify() | |
} | |
}, | |
length: function() { | |
return this.$tabs.length | |
}, | |
tabId: function(b) { | |
return b.title && b.title.replace(/\s/g, "_").replace(/[^A-Za-z0-9\-_:\.]/g, "") || this.options.idPrefix + a.data(b) | |
}, | |
ui: function(c, b) { | |
return { | |
options: this.options, | |
tab: c, | |
panel: b, | |
index: this.$tabs.index(c) | |
} | |
}, | |
tabify: function(q) { | |
this.$lis = a("li:has(a[href])", this.element); | |
this.$tabs = this.$lis.map(function() { | |
return a("a", this)[0] | |
}); | |
this.$panels = a([]); | |
var r = this, | |
d = this.options; | |
this.$tabs.each(function(s, o) { | |
if (o.hash && o.hash.replace("#", "")) { | |
r.$panels = r.$panels.add(o.hash) | |
} else { | |
if (a(o).attr("href") != "#") { | |
a.data(o, "href.tabs", o.href); | |
a.data(o, "load.tabs", o.href); | |
var u = r.tabId(o); | |
o.href = "#" + u; | |
var t = a("#" + u); | |
if (!t.length) { | |
t = a(d.panelTemplate).attr("id", u).addClass(d.panelClass).insertAfter(r.$panels[s - 1] || r.element); | |
t.data("destroy.tabs", true) | |
} | |
r.$panels = r.$panels.add(t) | |
} else { | |
d.disabled.push(s + 1) | |
} | |
} | |
}); | |
if (q) { | |
this.element.addClass(d.navClass); | |
this.$panels.each(function() { | |
var o = a(this); | |
o.addClass(d.panelClass) | |
}); | |
if (d.selected === undefined) { | |
if (location.hash) { | |
this.$tabs.each(function(t, o) { | |
if (o.hash == location.hash) { | |
d.selected = t; | |
if (a.browser.msie || a.browser.opera) { | |
var s = a(location.hash), | |
u = s.attr("id"); | |
s.attr("id", ""); | |
setTimeout(function() { | |
s.attr("id", u) | |
}, 500) | |
} | |
scrollTo(0, 0); | |
return false | |
} | |
}) | |
} else { | |
if (d.cookie) { | |
var k = parseInt(a.cookie("ui-tabs" + a.data(r.element)), 10); | |
if (k && r.$tabs[k]) { | |
d.selected = k | |
} | |
} else { | |
if (r.$lis.filter("." + d.selectedClass).length) { | |
d.selected = r.$lis.index(r.$lis.filter("." + d.selectedClass)[0]) | |
} | |
} | |
} | |
} | |
d.selected = d.selected === null || d.selected !== undefined ? d.selected : 0; | |
d.disabled = a.unique(d.disabled.concat(a.map(this.$lis.filter("." + d.disabledClass), function(s, o) { | |
return r.$lis.index(s) | |
}))).sort(); | |
if (a.inArray(d.selected, d.disabled) != -1) { | |
d.disabled.splice(a.inArray(d.selected, d.disabled), 1) | |
} | |
this.$panels.addClass(d.hideClass); | |
this.$lis.removeClass(d.selectedClass); | |
if (d.selected !== null) { | |
this.$panels.eq(d.selected).show().removeClass(d.hideClass); | |
this.$lis.eq(d.selected).addClass(d.selectedClass); | |
var l = function() { | |
a(r.element).triggerHandler("tabsshow", [r.fakeEvent("tabsshow"), r.ui(r.$tabs[d.selected], r.$panels[d.selected])], d.show) | |
}; | |
if (a.data(this.$tabs[d.selected], "load.tabs")) { | |
this.load(d.selected, l) | |
} else { | |
l() | |
} | |
} | |
a(window).bind("unload", function() { | |
r.$tabs.unbind(".tabs"); | |
r.$lis = r.$tabs = r.$panels = null | |
}) | |
} | |
for (var g = 0, p; p = this.$lis[g]; g++) { | |
a(p)[a.inArray(g, d.disabled) != -1 && !a(p).hasClass(d.selectedClass) ? "addClass" : "removeClass"](d.disabledClass) | |
} | |
if (d.cache === false) { | |
this.$tabs.removeData("cache.tabs") | |
} | |
var c, j, b = { | |
"min-width": 0, | |
duration: 1 | |
}, | |
e = "normal"; | |
if (d.fx && d.fx.constructor == Array) { | |
c = d.fx[0] || b, j = d.fx[1] || b | |
} else { | |
c = j = d.fx || b | |
} | |
var h = { | |
display: "", | |
overflow: "", | |
height: "" | |
}; | |
if (!a.browser.msie) { | |
h.opacity = "" | |
} | |
function n(s, o, t) { | |
o.animate(c, c.duration || e, function() { | |
o.addClass(d.hideClass).css(h); | |
if (a.browser.msie && c.opacity) { | |
o[0].style.filter = "" | |
} | |
if (t) { | |
m(s, t, o) | |
} | |
}) | |
} | |
function m(s, t, o) { | |
if (j === b) { | |
t.css("display", "block") | |
} | |
t.animate(j, j.duration || e, function() { | |
t.removeClass(d.hideClass).css(h); | |
if (a.browser.msie && j.opacity) { | |
t[0].style.filter = "" | |
} | |
a(r.element).triggerHandler("tabsshow", [r.fakeEvent("tabsshow"), r.ui(s, t[0])], d.show) | |
}) | |
} | |
function f(s, u, o, t) { | |
u.addClass(d.selectedClass).siblings().removeClass(d.selectedClass); | |
n(s, o, t) | |
} | |
this.$tabs.unbind(".tabs").bind(d.event, function() { | |
var u = a(this).parents("li:eq(0)"), | |
o = r.$panels.filter(":visible"), | |
t = a(this.hash); | |
if ((u.hasClass(d.selectedClass) && !d.unselect) || u.hasClass(d.disabledClass) || a(this).hasClass(d.loadingClass) || a(r.element).triggerHandler("tabsselect", [r.fakeEvent("tabsselect"), r.ui(this, t[0])], d.select) === false) { | |
this.blur(); | |
return false | |
} | |
r.options.selected = r.$tabs.index(this); | |
if (d.unselect) { | |
if (u.hasClass(d.selectedClass)) { | |
r.options.selected = null; | |
u.removeClass(d.selectedClass); | |
r.$panels.stop(); | |
n(this, o); | |
this.blur(); | |
return false | |
} else { | |
if (!o.length) { | |
r.$panels.stop(); | |
var s = this; | |
r.load(r.$tabs.index(this), function() { | |
u.addClass(d.selectedClass).addClass(d.unselectClass); | |
m(s, t) | |
}); | |
this.blur(); | |
return false | |
} | |
} | |
} | |
if (d.cookie) { | |
a.cookie("ui-tabs" + a.data(r.element), r.options.selected, d.cookie) | |
} | |
r.$panels.stop(); | |
if (t.length) { | |
var s = this; | |
r.load(r.$tabs.index(this), o.length ? function() { | |
f(s, u, o, t) | |
} : function() { | |
u.addClass(d.selectedClass); | |
m(s, t) | |
}) | |
} else { | |
throw "jQuery UI Tabs: Mismatching fragment identifier." | |
} | |
if (a.browser.msie) { | |
this.blur() | |
} | |
return false | |
}); | |
if (!(/^click/).test(d.event)) { | |
this.$tabs.bind("click.tabs", function() { | |
return false | |
}) | |
} | |
}, | |
add: function(e, d, c) { | |
if (c == undefined) { | |
c = this.$tabs.length | |
} | |
var g = this.options; | |
var j = a(g.tabTemplate.replace(/#\{href\}/g, e).replace(/#\{label\}/g, d)); | |
j.data("destroy.tabs", true); | |
var h = e.indexOf("#") == 0 ? e.replace("#", "") : this.tabId(a("a:first-child", j)[0]); | |
var f = a("#" + h); | |
if (!f.length) { | |
f = a(g.panelTemplate).attr("id", h).addClass(g.hideClass).data("destroy.tabs", true) | |
} | |
f.addClass(g.panelClass); | |
if (c >= this.$lis.length) { | |
j.appendTo(this.element); | |
f.appendTo(this.element[0].parentNode) | |
} else { | |
j.insertBefore(this.$lis[c]); | |
f.insertBefore(this.$panels[c]) | |
} | |
g.disabled = a.map(g.disabled, function(l, k) { | |
return l >= c ? ++l : l | |
}); | |
this.tabify(); | |
if (this.$tabs.length == 1) { | |
j.addClass(g.selectedClass); | |
f.removeClass(g.hideClass); | |
var b = a.data(this.$tabs[0], "load.tabs"); | |
if (b) { | |
this.load(c, b) | |
} | |
} | |
this.element.triggerHandler("tabsadd", [this.fakeEvent("tabsadd"), this.ui(this.$tabs[c], this.$panels[c])], g.add) | |
}, | |
remove: function(b) { | |
var d = this.options, | |
e = this.$lis.eq(b).remove(), | |
c = this.$panels.eq(b).remove(); | |
if (e.hasClass(d.selectedClass) && this.$tabs.length > 1) { | |
this.select(b + (b + 1 < this.$tabs.length ? 1 : -1)) | |
} | |
d.disabled = a.map(a.grep(d.disabled, function(g, f) { | |
return g != b | |
}), function(g, f) { | |
return g >= b ? --g : g | |
}); | |
this.tabify(); | |
this.element.triggerHandler("tabsremove", [this.fakeEvent("tabsremove"), this.ui(e.find("a")[0], c[0])], d.remove) | |
}, | |
enable: function(b) { | |
var c = this.options; | |
if (a.inArray(b, c.disabled) == -1) { | |
return | |
} | |
var d = this.$lis.eq(b).removeClass(c.disabledClass); | |
if (a.browser.safari) { | |
d.css("display", "inline-block"); | |
setTimeout(function() { | |
d.css("display", "block") | |
}, 0) | |
} | |
c.disabled = a.grep(c.disabled, function(f, e) { | |
return f != b | |
}); | |
this.element.triggerHandler("tabsenable", [this.fakeEvent("tabsenable"), this.ui(this.$tabs[b], this.$panels[b])], c.enable) | |
}, | |
disable: function(c) { | |
var b = this, | |
d = this.options; | |
if (c != d.selected) { | |
this.$lis.eq(c).addClass(d.disabledClass); | |
d.disabled.push(c); | |
d.disabled.sort(); | |
this.element.triggerHandler("tabsdisable", [this.fakeEvent("tabsdisable"), this.ui(this.$tabs[c], this.$panels[c])], d.disable) | |
} | |
}, | |
select: function(b) { | |
if (typeof b == "string") { | |
b = this.$tabs.index(this.$tabs.filter("[href$=" + b + "]")[0]) | |
} | |
this.$tabs.eq(b).trigger(this.options.event) | |
}, | |
load: function(g, l) { | |
var m = this, | |
d = this.options, | |
e = this.$tabs.eq(g), | |
k = e[0], | |
h = l == undefined || l === false, | |
b = e.data("load.tabs"); | |
l = l || function() {}; | |
if (!b || !h && a.data(k, "cache.tabs")) { | |
l(); | |
return | |
} | |
var n = function(o) { | |
var p = a(o), | |
q = p.find("*:last"); | |
return q.length && q.is(":not(img)") && q || p | |
}; | |
var c = function() { | |
m.$tabs.filter("." + d.loadingClass).removeClass(d.loadingClass).each(function() { | |
if (d.spinner) { | |
n(this).parent().html(n(this).data("label.tabs")) | |
} | |
}); | |
m.xhr = null | |
}; | |
if (d.spinner) { | |
var j = n(k).html(); | |
n(k).wrapInner("<em></em>").find("em").data("label.tabs", j).html(d.spinner) | |
} | |
var f = a.extend({}, d.ajaxOptions, { | |
url: b, | |
success: function(p, o) { | |
a(k.hash).html(p); | |
c(); | |
if (d.cache) { | |
a.data(k, "cache.tabs", true) | |
} | |
a(m.element).triggerHandler("tabsload", [m.fakeEvent("tabsload"), m.ui(m.$tabs[g], m.$panels[g])], d.load); | |
d.ajaxOptions.success && d.ajaxOptions.success(p, o); | |
l() | |
} | |
}); | |
if (this.xhr) { | |
this.xhr.abort(); | |
c() | |
} | |
e.addClass(d.loadingClass); | |
setTimeout(function() { | |
m.xhr = a.ajax(f) | |
}, 0) | |
}, | |
url: function(c, b) { | |
this.$tabs.eq(c).removeData("cache.tabs").data("load.tabs", b) | |
}, | |
destroy: function() { | |
var b = this.options; | |
this.element.unbind(".tabs").removeClass(b.navClass).removeData("tabs"); | |
this.$tabs.each(function() { | |
var c = a.data(this, "href.tabs"); | |
if (c) { | |
this.href = c | |
} | |
var d = a(this).unbind(".tabs"); | |
a.each(["href", "load", "cache"], function(e, f) { | |
d.removeData(f + ".tabs") | |
}) | |
}); | |
this.$lis.add(this.$panels).each(function() { | |
if (a.data(this, "destroy.tabs")) { | |
a(this).remove() | |
} else { | |
a(this).removeClass([b.selectedClass, b.unselectClass, b.disabledClass, b.panelClass, b.hideClass].join(" ")) | |
} | |
}) | |
}, | |
fakeEvent: function(b) { | |
return a.event.fix({ | |
type: b, | |
target: this.element[0] | |
}) | |
} | |
}); | |
a.ui.tabs.defaults = { | |
unselect: false, | |
event: "click", | |
disabled: [], | |
cookie: null, | |
spinner: "Loading…", | |
cache: false, | |
idPrefix: "ui-tabs-", | |
ajaxOptions: {}, | |
fx: null, | |
tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>', | |
panelTemplate: "<div></div>", | |
navClass: "ui-tabs-nav", | |
selectedClass: "ui-tabs-selected", | |
unselectClass: "ui-tabs-unselect", | |
disabledClass: "ui-tabs-disabled", | |
panelClass: "ui-tabs-panel", | |
hideClass: "ui-tabs-hide", | |
loadingClass: "ui-tabs-loading" | |
}; | |
a.ui.tabs.getter = "length"; | |
a.extend(a.ui.tabs.prototype, { | |
rotation: null, | |
rotate: function(c, f) { | |
f = f || false; | |
var b = this, | |
e = this.options.selected; | |
function g() { | |
b.rotation = setInterval(function() { | |
e = ++e < b.$tabs.length ? e : 0; | |
b.select(e) | |
}, c) | |
} | |
function d(h) { | |
if (!h || h.clientX) { | |
clearInterval(b.rotation) | |
} | |
} | |
if (c) { | |
g(); | |
if (!f) { | |
this.$tabs.bind(this.options.event, d) | |
} else { | |
this.$tabs.bind(this.options.event, function() { | |
d(); | |
e = b.options.selected; | |
g() | |
}) | |
} | |
} else { | |
d(); | |
this.$tabs.unbind(this.options.event, d) | |
} | |
} | |
}) | |
})(jQuery); | |
(function($) { | |
var PROP_NAME = "datepicker"; | |
function Datepicker() { | |
this.debug = false; | |
this._curInst = null; | |
this._disabledInputs = []; | |
this._datepickerShowing = false; | |
this._inDialog = false; | |
this._mainDivId = "ui-datepicker-div"; | |
this._appendClass = "ui-datepicker-append"; | |
this._triggerClass = "ui-datepicker-trigger"; | |
this._dialogClass = "ui-datepicker-dialog"; | |
this._promptClass = "ui-datepicker-prompt"; | |
this._unselectableClass = "ui-datepicker-unselectable"; | |
this._currentClass = "ui-datepicker-current-day"; | |
this.regional = []; | |
this.regional[""] = { | |
clearText: "Clear", | |
clearStatus: "Erase the current date", | |
closeText: "Close", | |
closeStatus: "Close without change", | |
prevText: "<Prev", | |
prevStatus: "Show the previous month", | |
nextText: "Next>", | |
nextStatus: "Show the next month", | |
currentText: "Today", | |
currentStatus: "Show the current month", | |
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], | |
monthStatus: "Show a different month", | |
yearStatus: "Show a different year", | |
weekHeader: "Wk", | |
weekStatus: "Week of the year", | |
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], | |
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], | |
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], | |
dayStatus: "Set DD as first week day", | |
dateStatus: "Select DD, M d", | |
dateFormat: "mm/dd/yy", | |
firstDay: 0, | |
initStatus: "Select a date", | |
isRTL: false | |
}; | |
this._defaults = { | |
showOn: "focus", | |
showAnim: "show", | |
showOptions: {}, | |
defaultDate: null, | |
appendText: "", | |
buttonText: "...", | |
buttonImage: "", | |
buttonImageOnly: false, | |
closeAtTop: true, | |
mandatory: false, | |
hideIfNoPrevNext: false, | |
navigationAsDateFormat: false, | |
gotoCurrent: false, | |
changeMonth: true, | |
changeYear: true, | |
yearRange: "2000:2037", | |
changeFirstDay: true, | |
highlightWeek: false, | |
showOtherMonths: false, | |
showWeeks: false, | |
calculateWeek: this.iso8601Week, | |
shortYearCutoff: "+10", | |
showStatus: false, | |
statusForDate: this.dateStatus, | |
minDate: null, | |
maxDate: null, | |
duration: "normal", | |
beforeShowDay: null, | |
beforeShow: null, | |
onSelect: null, | |
onChangeMonthYear: null, | |
onClose: null, | |
numberOfMonths: 1, | |
stepMonths: 1, | |
rangeSelect: false, | |
rangeSeparator: " - ", | |
altField: "", | |
altFormat: "" | |
}; | |
$.extend(this._defaults, this.regional[""]); | |
this.dpDiv = $('<div id="' + this._mainDivId + '" style="display: none;" tabindex="0"></div>') | |
} | |
$.extend(Datepicker.prototype, { | |
markerClassName: "hasDatepicker", | |
log: function() { | |
if (this.debug) { | |
console.log.apply("", arguments) | |
} | |
}, | |
setDefaults: function(settings) { | |
extendRemove(this._defaults, settings || {}); | |
return this | |
}, | |
_attachDatepicker: function(target, settings) { | |
var inlineSettings = null; | |
for (attrName in this._defaults) { | |
var attrValue = target.getAttribute("date:" + attrName); | |
if (attrValue) { | |
inlineSettings = inlineSettings || {}; | |
try { | |
inlineSettings[attrName] = eval(attrValue) | |
} catch (err) { | |
inlineSettings[attrName] = attrValue | |
} | |
} | |
} | |
var nodeName = target.nodeName.toLowerCase(); | |
var inline = (nodeName == "div" || nodeName == "span"); | |
if (!target.id) { | |
target.id = "dp" + new Date().getTime() | |
} | |
var inst = this._newInst($(target), inline); | |
inst.settings = $.extend({}, settings || {}, inlineSettings || {}); | |
if (nodeName == "input") { | |
this._connectDatepicker(target, inst) | |
} else { | |
if (inline) { | |
this._inlineDatepicker(target, inst) | |
} | |
} | |
}, | |
_newInst: function(target, inline) { | |
return { | |
id: target[0].id, | |
input: target, | |
selectedDay: 0, | |
selectedMonth: 0, | |
selectedYear: 0, | |
drawMonth: 0, | |
drawYear: 0, | |
inline: inline, | |
dpDiv: (!inline ? this.dpDiv : $('<div class="ui-datepicker-inline"></div>')) | |
} | |
}, | |
_connectDatepicker: function(target, inst) { | |
var input = $(target); | |
if (input.hasClass(this.markerClassName)) { | |
return | |
} | |
var appendText = this._get(inst, "appendText"); | |
var isRTL = this._get(inst, "isRTL"); | |
if (appendText) { | |
input[isRTL ? "before" : "after"]('<span class="' + this._appendClass + '">' + appendText + "</span>") | |
} | |
var showOn = this._get(inst, "showOn"); | |
if (showOn == "focus" || showOn == "both") { | |
input.focus(this._showDatepicker) | |
} | |
if (showOn == "button" || showOn == "both") { | |
var buttonText = this._get(inst, "buttonText"); | |
var buttonImage = this._get(inst, "buttonImage"); | |
var trigger = $(this._get(inst, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass).attr({ | |
src: buttonImage, | |
alt: buttonText, | |
title: buttonText | |
}) : $('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage == "" ? buttonText : $("<img/>").attr({ | |
src: buttonImage, | |
alt: buttonText, | |
title: buttonText | |
}))); | |
input[isRTL ? "before" : "after"](trigger); | |
trigger.click(function() { | |
if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target) { | |
$.datepicker._hideDatepicker() | |
} else { | |
$.datepicker._showDatepicker(target) | |
} | |
return false | |
}) | |
} | |
input.attr("aria-haspopup", true); | |
input.keydown(function(e) { | |
if (e.shiftKey && e.keyCode == 9) { | |
$.datepicker._hideDatepicker() | |
} | |
}); | |
input.addClass(this.markerClassName).bind("setData.datepicker", function(event, key, value) { | |
inst.settings[key] = value | |
}).bind("getData.datepicker", function(event, key) { | |
return this._get(inst, key) | |
}); | |
$.data(target, PROP_NAME, inst) | |
}, | |
_inlineDatepicker: function(target, inst) { | |
var input = $(target); | |
if (input.hasClass(this.markerClassName)) { | |
return | |
} | |
input.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker", function(event, key, value) { | |
inst.settings[key] = value | |
}).bind("getData.datepicker", function(event, key) { | |
return this._get(inst, key) | |
}); | |
$.data(target, PROP_NAME, inst); | |
this._setDate(inst, this._getDefaultDate(inst)); | |
this._updateDatepicker(inst) | |
}, | |
_dialogDatepicker: function(input, dateText, onSelect, settings, pos) { | |
var inst = this._dialogInst; | |
if (!inst) { | |
var id = "dp" + new Date().getTime(); | |
this._dialogInput = $('<input type="text" id="' + id + '" size="1" style="position: absolute; top: -100px;"/>'); | |
this._dialogInput.keydown(this._doKeyDown); | |
$("body").append(this._dialogInput); | |
inst = this._dialogInst = this._newInst(this._dialogInput, false); | |
inst.settings = {}; | |
$.data(this._dialogInput[0], PROP_NAME, inst) | |
} | |
extendRemove(inst.settings, settings || {}); | |
this._dialogInput.val(dateText); | |
this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); | |
if (!this._pos) { | |
var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | |
var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; | |
var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; | |
var scrollY = document.documentElement.scrollTop || document.body.scrollTop; | |
this._pos = [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY] | |
} | |
inst.settings.onSelect = onSelect; | |
this._inDialog = true; | |
this.dpDiv.addClass(this._dialogClass); | |
this._showDatepicker(this._dialogInput[0]); | |
if ($.blockUI) { | |
$.blockUI(this.dpDiv) | |
} | |
$.data(this._dialogInput[0], PROP_NAME, inst); | |
return this | |
}, | |
_destroyDatepicker: function(target) { | |
var nodeName = target.nodeName.toLowerCase(); | |
var $target = $(target); | |
$.removeData(target, PROP_NAME); | |
if (nodeName == "input") { | |
$target.siblings("." + this._appendClass).remove().end().siblings("." + this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress) | |
} else { | |
if (nodeName == "div" || nodeName == "span") { | |
$target.removeClass(this.markerClassName).empty() | |
} | |
} | |
}, | |
_enableDatepicker: function(target) { | |
target.disabled = false; | |
$(target).siblings("button." + this._triggerClass).each(function() { | |
this.disabled = false | |
}).end().siblings("img." + this._triggerClass).css({ | |
opacity: "1.0", | |
cursor: "" | |
}); | |
this._disabledInputs = $.map(this._disabledInputs, function(value) { | |
return (value == target ? null : value) | |
}) | |
}, | |
_disableDatepicker: function(target) { | |
target.disabled = true; | |
$(target).siblings("button." + this._triggerClass).each(function() { | |
this.disabled = true | |
}).end().siblings("img." + this._triggerClass).css({ | |
opacity: "0.5", | |
cursor: "default" | |
}); | |
this._disabledInputs = $.map(this._disabledInputs, function(value) { | |
return (value == target ? null : value) | |
}); | |
this._disabledInputs[this._disabledInputs.length] = target | |
}, | |
_isDisabledDatepicker: function(target) { | |
if (!target) { | |
return false | |
} | |
for (var i = 0; i < this._disabledInputs.length; i++) { | |
if (this._disabledInputs[i] == target) { | |
return true | |
} | |
} | |
return false | |
}, | |
_changeDatepicker: function(target, name, value) { | |
var settings = name || {}; | |
if (typeof name == "string") { | |
settings = {}; | |
settings[name] = value | |
} | |
if (inst = $.data(target, PROP_NAME)) { | |
extendRemove(inst.settings, settings); | |
this._updateDatepicker(inst) | |
} | |
}, | |
_setDateDatepicker: function(target, date, endDate) { | |
var inst = $.data(target, PROP_NAME); | |
if (inst) { | |
this._setDate(inst, date, endDate); | |
this._updateDatepicker(inst) | |
} | |
}, | |
_getDateDatepicker: function(target) { | |
var inst = $.data(target, PROP_NAME); | |
if (inst) { | |
this._setDateFromField(inst) | |
} | |
return (inst ? this._getDate(inst) : null) | |
}, | |
_doDatepickerKeyDown: function(e) { | |
if (e.keyCode == 13) { | |
e.preventDefault(); | |
$(this).click() | |
} else { | |
if (e.keyCode == 27) { | |
$.datepicker._hideDatepicker(null, null) | |
} | |
} | |
}, | |
_doKeyDown: function(e) { | |
var inst = $.data(e.target, PROP_NAME); | |
var handled = true; | |
if ($.datepicker._datepickerShowing) { | |
switch (e.keyCode) { | |
case 9: | |
$.datepicker._hideDatepicker(null, ""); | |
break; | |
case 13: | |
$.datepicker._selectDay(e.target, inst.selectedMonth, inst.selectedYear, $("td.ui-datepicker-days-cell-over", inst.dpDiv)[0]); | |
return false; | |
break; | |
case 27: | |
$.datepicker._hideDatepicker(null, $.datepicker._get(inst, "duration")); | |
break; | |
case 33: | |
$.datepicker._adjustDate(e.target, (e.ctrlKey ? -1 : -$.datepicker._get(inst, "stepMonths")), (e.ctrlKey ? "Y" : "M")); | |
break; | |
case 34: | |
$.datepicker._adjustDate(e.target, (e.ctrlKey ? +1 : +$.datepicker._get(inst, "stepMonths")), (e.ctrlKey ? "Y" : "M")); | |
break; | |
case 35: | |
if (e.ctrlKey) { | |
$.datepicker._clearDate(e.target) | |
} | |
break; | |
case 36: | |
if (e.ctrlKey) { | |
$.datepicker._gotoToday(e.target) | |
} | |
break; | |
case 37: | |
if (e.ctrlKey) { | |
$.datepicker._adjustDate(e.target, -1, "D") | |
} | |
break; | |
case 38: | |
if (e.ctrlKey) { | |
$.datepicker._adjustDate(e.target, -7, "D") | |
} | |
break; | |
case 39: | |
if (e.ctrlKey) { | |
$.datepicker._adjustDate(e.target, +1, "D") | |
} | |
break; | |
case 40: | |
if (e.ctrlKey) { | |
$.datepicker._adjustDate(e.target, +7, "D") | |
} | |
break; | |
default: | |
handled = false | |
} | |
} else { | |
if (e.keyCode == 36 && e.ctrlKey) { | |
$.datepicker._showDatepicker(this) | |
} else { | |
handled = false | |
} | |
} | |
if (handled) { | |
e.preventDefault(); | |
e.stopPropagation() | |
} | |
}, | |
_doKeyPress: function(e) { | |
var inst = $.data(e.target, PROP_NAME); | |
var chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); | |
var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode); | |
return e.ctrlKey || (chr < " " || !chars || chars.indexOf(chr) > -1) | |
}, | |
_showDatepicker: function(input) { | |
input = input.target || input; | |
if (input.nodeName.toLowerCase() != "input") { | |
input = $("input", input.parentNode)[0] | |
} | |
if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) { | |
return | |
} | |
$(input).after($("#" + $.datepicker._mainDivId)); | |
$(input).parent().css("position", "relative"); | |
$(input).attr("aria-owns", $.datepicker._mainDivId); | |
var inst = $.data(input, PROP_NAME); | |
var beforeShow = $.datepicker._get(inst, "beforeShow"); | |
var isRTL = $.datepicker._get(inst, "isRTL"); | |
extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); | |
$.datepicker._hideDatepicker(null, ""); | |
$.datepicker._lastInput = input; | |
$.datepicker._setDateFromField(inst); | |
if ($.datepicker._inDialog) { | |
input.value = "" | |
} | |
if (!$.datepicker._pos) { | |
$.datepicker._pos = $.datepicker._findPos(input); | |
$.datepicker._pos[1] += input.offsetHeight | |
} | |
var isFixed = false; | |
$(input).parents().each(function() { | |
isFixed |= $(this).css("position") == "fixed"; | |
return !isFixed | |
}); | |
if (isFixed && $.browser.opera) { | |
$.datepicker._pos[0] -= document.documentElement.scrollLeft; | |
$.datepicker._pos[1] -= document.documentElement.scrollTop | |
} | |
var offset = { | |
left: $.datepicker._pos[0], | |
top: $.datepicker._pos[1] | |
}; | |
$.datepicker._pos = null; | |
inst.rangeStart = null; | |
inst.dpDiv.css({ | |
position: "absolute", | |
display: "block", | |
top: "-1000px" | |
}); | |
$.datepicker._updateDatepicker(inst); | |
inst.dpDiv.width($.datepicker._getNumberOfMonths(inst)[1] * $(".ui-datepicker", inst.dpDiv[0])[0].offsetWidth); | |
var horzPos = isRTL ? "right" : "left"; | |
inst.dpDiv.css({ | |
position: ($.datepicker._inDialog && $.blockUI ? "static" : (isFixed ? "fixed" : "absolute")), | |
display: "none", | |
top: input.offsetHeight + "px" | |
}); | |
inst.dpDiv.css(horzPos, $(input).parent().css("padding-" + horzPos)); | |
if (!inst.inline) { | |
var showAnim = $.datepicker._get(inst, "showAnim") || "show"; | |
var duration = $.datepicker._get(inst, "duration"); | |
var postProcess = function() { | |
$.datepicker._datepickerShowing = true; | |
if ($.browser.msie && parseInt($.browser.version) < 7) { | |
$("iframe.ui-datepicker-cover").css({ | |
width: inst.dpDiv.width() + 4, | |
height: inst.dpDiv.height() + 4 | |
}) | |
} | |
}; | |
if ($.effects && $.effects[showAnim]) { | |
inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess) | |
} else { | |
inst.dpDiv[showAnim](duration, postProcess) | |
} | |
if (duration == "") { | |
postProcess() | |
} | |
if (inst.input[0].type != "hidden") { | |
inst.input[0].focus() | |
} | |
$.datepicker._curInst = inst | |
} | |
}, | |
_updateDatepicker: function(inst) { | |
var dims = { | |
width: inst.dpDiv.width() + 4, | |
height: inst.dpDiv.height() + 4 | |
}; | |
inst.dpDiv.empty().append(this._generateDatepicker(inst)).find("iframe.ui-datepicker-cover").css({ | |
width: dims.width, | |
height: dims.height | |
}); | |
this._setAccessibleDatepicker(inst); | |
var numMonths = this._getNumberOfMonths(inst); | |
inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi"); | |
inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"); | |
te.prependOffScreenText(inst.dpDiv, "Select date then press enter or press escape to exit. Beginning of Datepicker.") | |
}, | |
_checkOffset: function(inst, offset, isFixed) { | |
var pos = inst.input ? this._findPos(inst.input[0]) : null; | |
var browserWidth = window.innerWidth || document.documentElement.clientWidth; | |
var browserHeight = window.innerHeight || document.documentElement.clientHeight; | |
var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; | |
var scrollY = document.documentElement.scrollTop || document.body.scrollTop; | |
if (this._get(inst, "isRTL") || (offset.left + inst.dpDiv.width() - scrollX) > browserWidth) { | |
offset.left = Math.max((isFixed ? 0 : scrollX), pos[0] + (inst.input ? inst.input.width() : 0) - (isFixed ? scrollX : 0) - inst.dpDiv.width() - (isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0)) | |
} else { | |
offset.left -= (isFixed ? scrollX : 0) | |
} | |
if ((offset.top + inst.dpDiv.height() - scrollY) > browserHeight) { | |
offset.top = Math.max((isFixed ? 0 : scrollY), pos[1] - (isFixed ? scrollY : 0) - (this._inDialog ? 0 : inst.dpDiv.height()) - (isFixed && $.browser.opera ? document.documentElement.scrollTop : 0)) | |
} else { | |
offset.top -= (isFixed ? scrollY : 0) | |
} | |
return offset | |
}, | |
_findPos: function(obj) { | |
while (obj && (obj.type == "hidden" || obj.nodeType != 1)) { | |
obj = obj.nextSibling | |
} | |
var position = $(obj).offset(); | |
return [position.left, position.top] | |
}, | |
_hideDatepicker: function(input, duration) { | |
var inst = this._curInst; | |
if (!inst) { | |
return | |
} | |
var rangeSelect = this._get(inst, "rangeSelect"); | |
if (rangeSelect && this._stayOpen) { | |
this._selectDate("#" + inst.id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear)) | |
} | |
this._stayOpen = false; | |
if (this._datepickerShowing) { | |
duration = (duration != null ? duration : this._get(inst, "duration")); | |
var showAnim = this._get(inst, "showAnim"); | |
var postProcess = function() { | |
$.datepicker._tidyDialog(inst) | |
}; | |
if (duration != "" && $.effects && $.effects[showAnim]) { | |
inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess) | |
} else { | |
inst.dpDiv[(duration == "" ? "hide" : (showAnim == "slideDown" ? "slideUp" : (showAnim == "fadeIn" ? "fadeOut" : "hide")))](duration, postProcess) | |
} | |
if (duration == "") { | |
this._tidyDialog(inst) | |
} | |
var onClose = this._get(inst, "onClose"); | |
if (onClose) { | |
onClose.apply((inst.input ? inst.input[0] : null), [this._getDate(inst), inst]) | |
} | |
this._datepickerShowing = false; | |
this._lastInput = null; | |
inst.settings.prompt = null; | |
if (this._inDialog) { | |
this._dialogInput.css({ | |
position: "absolute", | |
left: "0", | |
top: "-100px" | |
}); | |
if ($.blockUI) { | |
$.unblockUI(); | |
$("body").append(this.dpDiv) | |
} | |
} | |
this._inDialog = false | |
} | |
this._curInst = null | |
}, | |
_tidyDialog: function(inst) { | |
inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker"); | |
$("." + this._promptClass, inst.dpDiv).remove() | |
}, | |
_checkExternalClick: function(event) { | |
if (!$.datepicker._curInst) { | |
return | |
} | |
var $target = $(event.target); | |
if (($target.parents("#" + $.datepicker._mainDivId).length == 0) && !$target.hasClass($.datepicker.markerClassName) && !$target.hasClass($.datepicker._triggerClass) && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) { | |
$.datepicker._hideDatepicker(null, "") | |
} | |
}, | |
_adjustDate: function(id, offset, period) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
this._adjustInstDate(inst, offset, period); | |
this._updateDatepicker(inst) | |
}, | |
_gotoToday: function(id) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
if (this._get(inst, "gotoCurrent") && inst.currentDay) { | |
inst.selectedDay = inst.currentDay; | |
inst.drawMonth = inst.selectedMonth = inst.currentMonth; | |
inst.drawYear = inst.selectedYear = inst.currentYear | |
} else { | |
var date = new Date(); | |
inst.selectedDay = date.getDate(); | |
inst.drawMonth = inst.selectedMonth = date.getMonth(); | |
inst.drawYear = inst.selectedYear = date.getFullYear() | |
} | |
this._adjustDate(target); | |
this._notifyChange(inst) | |
}, | |
_selectMonthYear: function(id, select, period) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
inst._selectingMonthYear = false; | |
inst[period == "M" ? "drawMonth" : "drawYear"] = select.options[select.selectedIndex].value - 0; | |
this._adjustDate(target); | |
this._notifyChange(inst) | |
}, | |
_clickMonthYear: function(id) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
if (inst.input && inst._selectingMonthYear && !$.browser.msie) { | |
inst.input[0].focus() | |
} | |
inst._selectingMonthYear = !inst._selectingMonthYear | |
}, | |
_changeFirstDay: function(id, day) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
inst.settings.firstDay = day; | |
this._updateDatepicker(inst) | |
}, | |
_selectDay: function(id, month, year, td) { | |
if ($(td).hasClass(this._unselectableClass)) { | |
return | |
} | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
var rangeSelect = this._get(inst, "rangeSelect"); | |
if (rangeSelect) { | |
this._stayOpen = !this._stayOpen; | |
if (this._stayOpen) { | |
$(".ui-datepicker td").removeClass(this._currentClass); | |
$(td).addClass(this._currentClass) | |
} | |
} | |
inst.selectedDay = inst.currentDay = $("a", td).html(); | |
inst.selectedMonth = inst.currentMonth = month; | |
inst.selectedYear = inst.currentYear = year; | |
if (this._stayOpen) { | |
inst.endDay = inst.endMonth = inst.endYear = null | |
} else { | |
if (rangeSelect) { | |
inst.endDay = inst.currentDay; | |
inst.endMonth = inst.currentMonth; | |
inst.endYear = inst.currentYear | |
} | |
} | |
this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear)); | |
if (this._stayOpen) { | |
inst.rangeStart = this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)); | |
this._updateDatepicker(inst) | |
} else { | |
if (rangeSelect) { | |
inst.selectedDay = inst.currentDay = inst.rangeStart.getDate(); | |
inst.selectedMonth = inst.currentMonth = inst.rangeStart.getMonth(); | |
inst.selectedYear = inst.currentYear = inst.rangeStart.getFullYear(); | |
inst.rangeStart = null; | |
if (inst.inline) { | |
this._updateDatepicker(inst) | |
} | |
} | |
} | |
}, | |
_clearDate: function(id) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
if (this._get(inst, "mandatory")) { | |
return | |
} | |
this._stayOpen = false; | |
inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null; | |
this._selectDate(target, "") | |
}, | |
_selectDate: function(id, dateStr) { | |
var target = $(id); | |
var inst = $.data(target[0], PROP_NAME); | |
dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); | |
if (this._get(inst, "rangeSelect") && dateStr) { | |
dateStr = (inst.rangeStart ? this._formatDate(inst, inst.rangeStart) : dateStr) + this._get(inst, "rangeSeparator") + dateStr | |
} | |
if (inst.input) { | |
inst.input.val(dateStr) | |
} | |
this._updateAlternate(inst); | |
var onSelect = this._get(inst, "onSelect"); | |
if (onSelect) { | |
onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]) | |
} else { | |
if (inst.input) { | |
inst.input.trigger("change") | |
} | |
} | |
if (inst.inline) { | |
this._updateDatepicker(inst) | |
} else { | |
if (!this._stayOpen) { | |
this._hideDatepicker(null, this._get(inst, "duration")); | |
this._lastInput = inst.input[0]; | |
if (typeof(inst.input[0]) != "object") { | |
inst.input[0].focus() | |
} | |
this._lastInput = null | |
} | |
} | |
}, | |
_updateAlternate: function(inst) { | |
var altField = this._get(inst, "altField"); | |
if (altField) { | |
var altFormat = this._get(inst, "altFormat"); | |
var date = this._getDate(inst); | |
dateStr = (isArray(date) ? (!date[0] && !date[1] ? "" : this.formatDate(altFormat, date[0], this._getFormatConfig(inst)) + this._get(inst, "rangeSeparator") + this.formatDate(altFormat, date[1] || date[0], this._getFormatConfig(inst))) : this.formatDate(altFormat, date, this._getFormatConfig(inst))); | |
$(altField).each(function() { | |
$(this).val(dateStr) | |
}) | |
} | |
}, | |
noWeekends: function(date) { | |
var day = date.getDay(); | |
return [(day > 0 && day < 6), ""] | |
}, | |
iso8601Week: function(date) { | |
var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); | |
var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); | |
var firstDay = firstMon.getDay() || 7; | |
firstMon.setDate(firstMon.getDate() + 1 - firstDay); | |
if (firstDay < 4 && checkDate < firstMon) { | |
checkDate.setDate(checkDate.getDate() - 3); | |
return $.datepicker.iso8601Week(checkDate) | |
} else { | |
if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { | |
firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7; | |
if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { | |
checkDate.setDate(checkDate.getDate() + 3); | |
return $.datepicker.iso8601Week(checkDate) | |
} | |
} | |
} | |
return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1 | |
}, | |
dateStatus: function(date, inst) { | |
return $.datepicker.formatDate($.datepicker._get(inst, "dateStatus"), date, $.datepicker._getFormatConfig(inst)) | |
}, | |
parseDate: function(format, value, settings) { | |
if (format == null || value == null) { | |
throw "Invalid arguments" | |
} | |
value = (typeof value == "object" ? value.toString() : value + ""); | |
if (value == "") { | |
return null | |
} | |
var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; | |
var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; | |
var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; | |
var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; | |
var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; | |
var year = -1; | |
var month = -1; | |
var day = -1; | |
var literal = false; | |
var lookAhead = function(match) { | |
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); | |
if (matches) { | |
iFormat++ | |
} | |
return matches | |
}; | |
var getNumber = function(match) { | |
lookAhead(match); | |
var origSize = (match == "@" ? 14 : (match == "y" ? 4 : 2)); | |
var size = origSize; | |
var num = 0; | |
while (size > 0 && iValue < value.length && value.charAt(iValue) >= "0" && value.charAt(iValue) <= "9") { | |
num = num * 10 + (value.charAt(iValue++) - 0); | |
size-- | |
} | |
if (size == origSize) { | |
throw "Missing number at position " + iValue | |
} | |
return num | |
}; | |
var getName = function(match, shortNames, longNames) { | |
var names = (lookAhead(match) ? longNames : shortNames); | |
var size = 0; | |
for (var j = 0; j < names.length; j++) { | |
size = Math.max(size, names[j].length) | |
} | |
var name = ""; | |
var iInit = iValue; | |
while (size > 0 && iValue < value.length) { | |
name += value.charAt(iValue++); | |
for (var i = 0; i < names.length; i++) { | |
if (name == names[i]) { | |
return i + 1 | |
} | |
} | |
size-- | |
} | |
throw "Unknown name at position " + iInit | |
}; | |
var checkLiteral = function() { | |
if (value.charAt(iValue) != format.charAt(iFormat)) { | |
throw "Unexpected literal at position " + iValue | |
} | |
iValue++ | |
}; | |
var iValue = 0; | |
for (var iFormat = 0; iFormat < format.length; iFormat++) { | |
if (literal) { | |
if (format.charAt(iFormat) == "'" && !lookAhead("'")) { | |
literal = false | |
} else { | |
checkLiteral() | |
} | |
} else { | |
switch (format.charAt(iFormat)) { | |
case "d": | |
day = getNumber("d"); | |
break; | |
case "D": | |
getName("D", dayNamesShort, dayNames); | |
break; | |
case "m": | |
month = getNumber("m"); | |
break; | |
case "M": | |
month = getName("M", monthNamesShort, monthNames); | |
break; | |
case "y": | |
year = getNumber("y"); | |
break; | |
case "@": | |
var date = new Date(getNumber("@")); | |
year = date.getFullYear(); | |
month = date.getMonth() + 1; | |
day = date.getDate(); | |
break; | |
case "'": | |
if (lookAhead("'")) { | |
checkLiteral() | |
} else { | |
literal = true | |
} | |
break; | |
default: | |
checkLiteral() | |
} | |
} | |
} | |
if (year < 100) { | |
year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100) | |
} | |
var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); | |
if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) { | |
throw "Invalid date" | |
} | |
return date | |
}, | |
ATOM: "yy-mm-dd", | |
COOKIE: "D, dd M yy", | |
ISO_8601: "yy-mm-dd", | |
RFC_822: "D, d M y", | |
RFC_850: "DD, dd-M-y", | |
RFC_1036: "D, d M y", | |
RFC_1123: "D, d M yy", | |
RFC_2822: "D, d M yy", | |
RSS: "D, d M y", | |
TIMESTAMP: "@", | |
W3C: "yy-mm-dd", | |
formatDate: function(format, date, settings) { | |
if (!date) { | |
return "" | |
} | |
var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; | |
var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; | |
var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; | |
var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; | |
var lookAhead = function(match) { | |
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); | |
if (matches) { | |
iFormat++ | |
} | |
return matches | |
}; | |
var formatNumber = function(match, value) { | |
return (lookAhead(match) && value < 10 ? "0" : "") + value | |
}; | |
var formatName = function(match, value, shortNames, longNames) { | |
return (lookAhead(match) ? longNames[value] : shortNames[value]) | |
}; | |
var output = ""; | |
var literal = false; | |
if (date) { | |
for (var iFormat = 0; iFormat < format.length; iFormat++) { | |
if (literal) { | |
if (format.charAt(iFormat) == "'" && !lookAhead("'")) { | |
literal = false | |
} else { | |
output += format.charAt(iFormat) | |
} | |
} else { | |
switch (format.charAt(iFormat)) { | |
case "d": | |
output += formatNumber("d", date.getDate()); | |
break; | |
case "D": | |
output += formatName("D", date.getDay(), dayNamesShort, dayNames); | |
break; | |
case "m": | |
output += formatNumber("m", date.getMonth() + 1); | |
break; | |
case "M": | |
output += formatName("M", date.getMonth(), monthNamesShort, monthNames); | |
break; | |
case "y": | |
output += (lookAhead("y") ? date.getFullYear() : (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100); | |
break; | |
case "@": | |
output += date.getTime(); | |
break; | |
case "'": | |
if (lookAhead("'")) { | |
output += "'" | |
} else { | |
literal = true | |
} | |
break; | |
default: | |
output += format.charAt(iFormat) | |
} | |
} | |
} | |
} | |
return output | |
}, | |
_possibleChars: function(format) { | |
var chars = ""; | |
var literal = false; | |
for (var iFormat = 0; iFormat < format.length; iFormat++) { | |
if (literal) { | |
if (format.charAt(iFormat) == "'" && !lookAhead("'")) { | |
literal = false | |
} else { | |
chars += format.charAt(iFormat) | |
} | |
} else { | |
switch (format.charAt(iFormat)) { | |
case "d": | |
case "m": | |
case "y": | |
case "@": | |
chars += "0123456789"; | |
break; | |
case "D": | |
case "M": | |
return null; | |
case "'": | |
if (lookAhead("'")) { | |
chars += "'" | |
} else { | |
literal = true | |
} | |
break; | |
default: | |
chars += format.charAt(iFormat) | |
} | |
} | |
} | |
return chars | |
}, | |
_get: function(inst, name) { | |
return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name] | |
}, | |
_setDateFromField: function(inst) { | |
var dateFormat = this._get(inst, "dateFormat"); | |
var dates = inst.input ? inst.input.val().split(this._get(inst, "rangeSeparator")) : null; | |
inst.endDay = inst.endMonth = inst.endYear = null; | |
var date = defaultDate = this._getDefaultDate(inst); | |
if (dates.length > 0) { | |
var settings = this._getFormatConfig(inst); | |
if (dates.length > 1) { | |
date = this.parseDate(dateFormat, dates[1], settings) || defaultDate; | |
inst.endDay = date.getDate(); | |
inst.endMonth = date.getMonth(); | |
inst.endYear = date.getFullYear() | |
} | |
try { | |
date = this.parseDate(dateFormat, dates[0], settings) || defaultDate | |
} catch (e) { | |
this.log(e); | |
date = defaultDate | |
} | |
} | |
inst.selectedDay = date.getDate(); | |
inst.drawMonth = inst.selectedMonth = date.getMonth(); | |
inst.drawYear = inst.selectedYear = date.getFullYear(); | |
inst.currentDay = (dates[0] ? date.getDate() : 0); | |
inst.currentMonth = (dates[0] ? date.getMonth() : 0); | |
inst.currentYear = (dates[0] ? date.getFullYear() : 0); | |
this._adjustInstDate(inst) | |
}, | |
_getDefaultDate: function(inst) { | |
var date = this._determineDate(this._get(inst, "defaultDate"), new Date()); | |
var minDate = this._getMinMaxDate(inst, "min", true); | |
var maxDate = this._getMinMaxDate(inst, "max"); | |
date = (minDate && date < minDate ? minDate : date); | |
date = (maxDate && date > maxDate ? maxDate : date); | |
return date | |
}, | |
_determineDate: function(date, defaultDate) { | |
var offsetNumeric = function(offset) { | |
var date = new Date(); | |
date.setDate(date.getDate() + offset); | |
return date | |
}; | |
var offsetString = function(offset, getDaysInMonth) { | |
var date = new Date(); | |
var year = date.getFullYear(); | |
var month = date.getMonth(); | |
var day = date.getDate(); | |
var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; | |
var matches = pattern.exec(offset); | |
while (matches) { | |
switch (matches[2] || "d") { | |
case "d": | |
case "D": | |
day += (matches[1] - 0); | |
break; | |
case "w": | |
case "W": | |
day += (matches[1] * 7); | |
break; | |
case "m": | |
case "M": | |
month += (matches[1] - 0); | |
day = Math.min(day, getDaysInMonth(year, month)); | |
break; | |
case "y": | |
case "Y": | |
year += (matches[1] - 0); | |
day = Math.min(day, getDaysInMonth(year, month)); | |
break | |
} | |
matches = pattern.exec(offset) | |
} | |
return new Date(year, month, day) | |
}; | |
date = (date == null ? defaultDate : (typeof date == "string" ? offsetString(date, this._getDaysInMonth) : (typeof date == "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); | |
date = (date && date.toString() == "Invalid Date" ? defaultDate : date); | |
if (date) { | |
date.setHours(0); | |
date.setMinutes(0); | |
date.setSeconds(0); | |
date.setMilliseconds(0) | |
} | |
return this._daylightSavingAdjust(date) | |
}, | |
_daylightSavingAdjust: function(date) { | |
if (!date) { | |
return null | |
} | |
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); | |
return date | |
}, | |
_setDate: function(inst, date, endDate) { | |
var clear = !(date); | |
date = this._determineDate(date, new Date()); | |
inst.selectedDay = inst.currentDay = date.getDate(); | |
inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); | |
inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); | |
if (this._get(inst, "rangeSelect")) { | |
if (endDate) { | |
endDate = this._determineDate(endDate, null); | |
inst.endDay = endDate.getDate(); | |
inst.endMonth = endDate.getMonth(); | |
inst.endYear = endDate.getFullYear() | |
} else { | |
inst.endDay = inst.currentDay; | |
inst.endMonth = inst.currentMonth; | |
inst.endYear = inst.currentYear | |
} | |
} | |
this._adjustInstDate(inst); | |
if (inst.input) { | |
inst.input.val(clear ? "" : this._formatDate(inst) + (!this._get(inst, "rangeSelect") ? "" : this._get(inst, "rangeSeparator") + this._formatDate(inst, inst.endDay, inst.endMonth, inst.endYear))) | |
} | |
}, | |
_getDate: function(inst) { | |
var startDate = (!inst.currentYear || (inst.input && inst.input.val() == "") ? null : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); | |
if (this._get(inst, "rangeSelect")) { | |
return [inst.rangeStart || startDate, (!inst.endYear ? inst.rangeStart || startDate : this._daylightSavingAdjust(new Date(inst.endYear, inst.endMonth, inst.endDay)))] | |
} else { | |
return startDate | |
} | |
}, | |
_generateDatepicker: function(inst) { | |
var today = new Date(); | |
today = this._daylightSavingAdjust(new Date(today.getFullYear(), today.getMonth(), today.getDate())); | |
var showStatus = this._get(inst, "showStatus"); | |
var isRTL = this._get(inst, "isRTL"); | |
var clear = (this._get(inst, "mandatory") ? "" : '<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(\'#' + inst.id + "');\"" + (showStatus ? this._addStatus(inst, this._get(inst, "clearStatus") || " ") : "") + ">" + this._get(inst, "clearText") + "</a></div>"); | |
var controls = '<div class="ui-datepicker-control">' + (isRTL ? "" : clear) + '<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"' + (showStatus ? this._addStatus(inst, this._get(inst, "closeStatus") || " ") : "") + ">" + this._get(inst, "closeText") + "</a></div>" + (isRTL ? clear : "") + "</div>"; | |
var prompt = this._get(inst, "prompt"); | |
var closeAtTop = this._get(inst, "closeAtTop"); | |
var hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"); | |
var navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"); | |
var numMonths = this._getNumberOfMonths(inst); | |
var stepMonths = this._get(inst, "stepMonths"); | |
var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); | |
var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); | |
var minDate = this._getMinMaxDate(inst, "min", true); | |
var maxDate = this._getMinMaxDate(inst, "max"); | |
var drawMonth = inst.drawMonth; | |
var drawYear = inst.drawYear; | |
if (maxDate) { | |
var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate())); | |
maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); | |
while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { | |
drawMonth--; | |
if (drawMonth < 0) { | |
drawMonth = 11; | |
drawYear-- | |
} | |
} | |
} | |
var prevText = this._get(inst, "prevText"); | |
prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst))); | |
var prev = '<div class="ui-datepicker-prev">' + (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? '<a href="#"' + (showStatus ? this._addStatus(inst, this._get(inst, "prevStatus") || " ") : "") + ">" + prevText + "</a>" : (hideIfNoPrevNext ? "" : "<label>" + prevText + "</label>")) + "</div>"; | |
var nextText = this._get(inst, "nextText"); | |
nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst))); | |
var next = '<div class="ui-datepicker-next">' + (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? '<a href="#"' + (showStatus ? this._addStatus(inst, this._get(inst, "nextStatus") || " ") : "") + ">" + nextText + "</a>" : (hideIfNoPrevNext ? "" : "<label>" + nextText + "</label>")) + "</div>"; | |
var currentText = this._get(inst, "currentText"); | |
currentText = (!navigationAsDateFormat ? currentText : this.formatDate(currentText, today, this._getFormatConfig(inst))); | |
var html = (prompt ? '<div class="' + this._promptClass + '">' + prompt + "</div>" : "") + (closeAtTop && !inst.inline ? controls : "") + '<div class="ui-datepicker-links">' + (isRTL ? next : prev) + (this._isInRange(inst, (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today)) ? '<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday(\'#' + inst.id + "');\"" + (showStatus ? this._addStatus(inst, this._get(inst, "currentStatus") || " ") : "") + ">" + currentText + "</a></div>" : "") + (isRTL ? prev : next) + "</div>"; | |
var firstDay = this._get(inst, "firstDay"); | |
var changeFirstDay = this._get(inst, "changeFirstDay"); | |
var dayNames = this._get(inst, "dayNames"); | |
var dayNamesShort = this._get(inst, "dayNamesShort"); | |
var dayNamesMin = this._get(inst, "dayNamesMin"); | |
var monthNames = this._get(inst, "monthNames"); | |
var beforeShowDay = this._get(inst, "beforeShowDay"); | |
var highlightWeek = this._get(inst, "highlightWeek"); | |
var showOtherMonths = this._get(inst, "showOtherMonths"); | |
var showWeeks = this._get(inst, "showWeeks"); | |
var calculateWeek = this._get(inst, "calculateWeek") || this.iso8601Week; | |
var status = (showStatus ? this._get(inst, "dayStatus") || " " : ""); | |
var dateStatus = this._get(inst, "statusForDate") || this.dateStatus; | |
var endDate = inst.endDay ? this._daylightSavingAdjust(new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate; | |
for (var row = 0; row < numMonths[0]; row++) { | |
for (var col = 0; col < numMonths[1]; col++) { | |
var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); | |
html += '<div class="ui-datepicker-one-month' + (col == 0 ? " ui-datepicker-new-row" : "") + '">' + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, selectedDate, row > 0 || col > 0, showStatus, monthNames) + '<table class="ui-datepicker" cellpadding="0" cellspacing="0" role="grid" tabindex="0"><thead><tr class="ui-datepicker-title-row">' + (showWeeks ? "<td>" + this._get(inst, "weekHeader") + "</td>" : ""); | |
for (var dow = 0; dow < 7; dow++) { | |
var day = (dow + firstDay) % 7; | |
var dayStatus = (status.indexOf("DD") > -1 ? status.replace(/DD/, dayNames[day]) : status.replace(/D/, dayNamesShort[day])); | |
html += "<td" + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end-cell"' : "") + ">" + (!changeFirstDay ? "<span" : '<a href="#"') + (showStatus ? this._addStatus(inst, dayStatus) : "") + ' title="' + dayNames[day] + '">' + dayNamesMin[day] + (changeFirstDay ? "</a>" : "</span>") + "</td>" | |
} | |
html += "</tr></thead><tbody>"; | |
var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); | |
if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) { | |
inst.selectedDay = Math.min(inst.selectedDay, daysInMonth) | |
} | |
var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; | |
var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); | |
var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); | |
for (var dRow = 0; dRow < numRows; dRow++) { | |
html += '<tr class="ui-datepicker-days-row">' + (showWeeks ? '<td class="ui-datepicker-week-col">' + calculateWeek(printDate) + "</td>" : ""); | |
for (var dow = 0; dow < 7; dow++) { | |
var daySettings = (beforeShowDay ? beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]); | |
var otherMonth = (printDate.getMonth() != drawMonth); | |
var unselectable = otherMonth || !daySettings[0] || (minDate && printDate < minDate) || (maxDate && printDate > maxDate); | |
html += '<td class="ui-datepicker-days-cell' + ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end-cell" : "") + (otherMonth ? " ui-datepicker-otherMonth" : "") + (printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth ? " ui-datepicker-days-cell-over" : "") + (unselectable ? " " + this._unselectableClass : "") + (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? " " + this._currentClass : "") + (printDate.getTime() == today.getTime() ? " ui-datepicker-today" : "")) + '"' + ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : "") + (unselectable ? (highlightWeek ? " onmouseover=\"jQuery(this).parent().addClass('ui-datepicker-week-over');\" onmouseout=\"jQuery(this).parent().removeClass('ui-datepicker-week-over');\"" : "") : " onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over')" + (highlightWeek ? ".parent().addClass('ui-datepicker-week-over')" : "") + ";" + (!showStatus || (otherMonth && !showOtherMonths) ? "" : "jQuery('#ui-datepicker-status-" + inst.id + "').html('" + (dateStatus.apply((inst.input ? inst.input[0] : null), [printDate, inst]) || " ") + "');") + "\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over')" + (highlightWeek ? ".parent().removeClass('ui-datepicker-week-over')" : "") + ";" + (!showStatus || (otherMonth && !showOtherMonths) ? "" : "jQuery('#ui-datepicker-status-" + inst.id + "').html(' ');") + '"') + ">" + (otherMonth ? (showOtherMonths ? printDate.getDate() : " ") : (unselectable ? printDate.getDate() : "<a>" + printDate.getDate() + "</a>")) + "</td>"; | |
printDate.setDate(printDate.getDate() + 1); | |
printDate = this._daylightSavingAdjust(printDate) | |
} | |
html += "</tr>" | |
} | |
drawMonth++; | |
if (drawMonth > 11) { | |
drawMonth = 0; | |
drawYear++ | |
} | |
html += "</tbody></table></div>" | |
} | |
} | |
html += (showStatus ? '<div style="clear: both;"></div><div id="ui-datepicker-status-' + inst.id + '" class="ui-datepicker-status">' + (this._get(inst, "initStatus") || " ") + "</div>" : "") + (!closeAtTop && !inst.inline ? controls : "") + '<div style="clear: both;"></div>' + ($.browser.msie && parseInt($.browser.version) < 7 && !inst.inline ? '<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>' : ""); | |
return html | |
}, | |
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, selectedDate, secondary, showStatus, monthNames) { | |
minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate); | |
var html = '<div class="ui-datepicker-header">'; | |
if (secondary || !this._get(inst, "changeMonth")) { | |
html += monthNames[drawMonth] + " " | |
} else { | |
var inMinYear = (minDate && minDate.getFullYear() == drawYear); | |
var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); | |
html += '<label class="off-screen-text-cls" for="ui-datepicker-select-new-month">Month</label><select id="ui-datepicker-select-new-month" class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear(\'#' + inst.id + "', this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear('#" + inst.id + "');\"" + (showStatus ? this._addStatus(inst, this._get(inst, "monthStatus") || " ") : "") + ">"; | |
for (var month = 0; month < 12; month++) { | |
if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) { | |
html += '<option value="' + month + '"' + (month == drawMonth ? ' selected="selected"' : "") + ">" + monthNames[month] + "</option>" | |
} | |
} | |
html += "</select>" | |
} | |
if (secondary || !this._get(inst, "changeYear")) { | |
html += drawYear | |
} else { | |
var years = this._get(inst, "yearRange").split(":"); | |
var year = 0; | |
var endYear = 0; | |
if (years.length != 2) { | |
year = drawYear - 10; | |
endYear = drawYear + 10 | |
} else { | |
if (years[0].charAt(0) == "+" || years[0].charAt(0) == "-") { | |
year = endYear = new Date().getFullYear(); | |
year += parseInt(years[0], 10); | |
endYear += parseInt(years[1], 10) | |
} else { | |
year = parseInt(years[0], 10); | |
endYear = parseInt(years[1], 10) | |
} | |
} | |
year = (minDate ? Math.max(year, minDate.getFullYear()) : year); | |
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); | |
html += '<label class="off-screen-text-cls" for="ui-datepicker-select-new-year">Year</label><select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear(\'#' + inst.id + "', this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear('#" + inst.id + "');\"" + (showStatus ? this._addStatus(inst, this._get(inst, "yearStatus") || " ") : "") + ">"; | |
for (; year <= endYear; year++) { | |
html += '<option value="' + year + '"' + (year == drawYear ? ' selected="selected"' : "") + ">" + year + "</option>" | |
} | |
html += "</select>" | |
} | |
html += "</div>"; | |
return html | |
}, | |
_addStatus: function(inst, text) { | |
return " onmouseover=\"jQuery('#ui-datepicker-status-" + inst.id + "').html('" + text + "');\" onmouseout=\"jQuery('#ui-datepicker-status-" + inst.id + "').html(' ');\"" | |
}, | |
_adjustInstDate: function(inst, offset, period) { | |
var year = inst.drawYear + (period == "Y" ? offset : 0); | |
var month = inst.drawMonth + (period == "M" ? offset : 0); | |
var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period == "D" ? offset : 0); | |
var date = this._daylightSavingAdjust(new Date(year, month, day)); | |
var minDate = this._getMinMaxDate(inst, "min", true); | |
var maxDate = this._getMinMaxDate(inst, "max"); | |
date = (minDate && date < minDate ? minDate : date); | |
date = (maxDate && date > maxDate ? maxDate : date); | |
inst.selectedDay = date.getDate(); | |
inst.drawMonth = inst.selectedMonth = date.getMonth(); | |
inst.drawYear = inst.selectedYear = date.getFullYear(); | |
if (period == "M" || period == "Y") { | |
this._notifyChange(inst) | |
} | |
}, | |
_notifyChange: function(inst) { | |
var onChange = this._get(inst, "onChangeMonthYear"); | |
if (onChange) { | |
onChange.apply((inst.input ? inst.input[0] : null), [new Date(inst.selectedYear, inst.selectedMonth, 1), inst]) | |
} | |
}, | |
_getNumberOfMonths: function(inst) { | |
var numMonths = this._get(inst, "numberOfMonths"); | |
return (numMonths == null ? [1, 1] : (typeof numMonths == "number" ? [1, numMonths] : numMonths)) | |
}, | |
_getMinMaxDate: function(inst, minMax, checkRange) { | |
var date = this._determineDate(this._get(inst, minMax + "Date"), null); | |
return (!checkRange || !inst.rangeStart ? date : (!date || inst.rangeStart > date ? inst.rangeStart : date)) | |
}, | |
_getDaysInMonth: function(year, month) { | |
return 32 - new Date(year, month, 32).getDate() | |
}, | |
_getFirstDayOfMonth: function(year, month) { | |
return new Date(year, month, 1).getDay() | |
}, | |
_canAdjustMonth: function(inst, offset, curYear, curMonth) { | |
var numMonths = this._getNumberOfMonths(inst); | |
var date = this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1)); | |
if (offset < 0) { | |
date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())) | |
} | |
return this._isInRange(inst, date) | |
}, | |
_isInRange: function(inst, date) { | |
var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust(new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay))); | |
newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate); | |
var minDate = newMinDate || this._getMinMaxDate(inst, "min"); | |
var maxDate = this._getMinMaxDate(inst, "max"); | |
return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate)) | |
}, | |
_getFormatConfig: function(inst) { | |
var shortYearCutoff = this._get(inst, "shortYearCutoff"); | |
shortYearCutoff = (typeof shortYearCutoff != "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); | |
return { | |
shortYearCutoff: shortYearCutoff, | |
dayNamesShort: this._get(inst, "dayNamesShort"), | |
dayNames: this._get(inst, "dayNames"), | |
monthNamesShort: this._get(inst, "monthNamesShort"), | |
monthNames: this._get(inst, "monthNames") | |
} | |
}, | |
_formatDate: function(inst, day, month, year) { | |
if (!day) { | |
inst.currentDay = inst.selectedDay; | |
inst.currentMonth = inst.selectedMonth; | |
inst.currentYear = inst.selectedYear | |
} | |
var date = (day ? (typeof day == "object" ? day : this._daylightSavingAdjust(new Date(year, month, day))) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); | |
return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)) | |
}, | |
_setAccessibleDatepicker: function(inst) { | |
var self = this; | |
function setAccessiblePrevNextBtn(stepMonths) { | |
var prevBtn = inst.dpDiv.find(".ui-datepicker-prev a"); | |
if (prevBtn.length > 0) { | |
prevBtn.attr("role", "link"); | |
prevBtn.click(function(e) { | |
e.preventDefault(); | |
jQuery.datepicker._adjustDate("#" + inst.id, -stepMonths, "M") | |
}).keydown(self._doDatepickerKeyDown).css("outline", 0) | |
} | |
var nextBtn = inst.dpDiv.find(".ui-datepicker-next a"); | |
if (nextBtn.length > 0) { | |
nextBtn.attr("role", "link"); | |
nextBtn.click(function(e) { | |
e.preventDefault(); | |
jQuery.datepicker._adjustDate("#" + inst.id, +stepMonths, "M") | |
}).keydown(self._doDatepickerKeyDown).css("outline", 0) | |
} | |
} | |
function setAccessibleWeekendCell(firstDay) { | |
var dowList = inst.dpDiv.find("thead tr.ui-datepicker-title-row a"); | |
$.each(dowList, function(idx, elm) { | |
var day = (idx + firstDay) % 7; | |
$(elm).attr("role", "link"); | |
$(elm).click(function(e) { | |
jQuery.datepicker._changeFirstDay("#" + inst.id, day); | |
return false | |
}).keydown(self._doDatepickerKeyDown) | |
}) | |
} | |
function setAccessibleDayCell() { | |
var drawMonth = inst.drawMonth; | |
var drawYear = inst.drawYear; | |
var tdList = inst.dpDiv.find(".ui-datepicker-days-row td a"); | |
$.each(tdList, function(idx, elm) { | |
var tdElm = $(elm).parent(); | |
var i = idx; | |
$(tdElm).attr("role", "button"); | |
$(tdElm).attr("aria-label", $(tdElm).text()); | |
$(tdElm).attr("tabindex", "0"); | |
if (idx == tdList.length - 1) { | |
$(tdElm).addClass("ui-datepicker-days-row-last"); | |
$(tdElm).attr("aria-label", $(tdElm).text() + " End of Datepicker") | |
} | |
$(tdElm).click(function(e) { | |
jQuery.datepicker._selectDay("#" + inst.id, drawMonth, drawYear, this) | |
}).keydown(function(e) { | |
if (!e.shiftKey && e.keyCode == 9 && $(this).hasClass("ui-datepicker-days-row-last")) { | |
$.datepicker._hideDatepicker() | |
} else { | |
if (e.keyCode == 13) { | |
$(this).click() | |
} else { | |
if (e.keyCode == 27) { | |
$.datepicker._hideDatepicker() | |
} | |
} | |
} | |
}) | |
}) | |
} | |
setAccessiblePrevNextBtn(this._get(inst, "stepMonths")); | |
setAccessibleWeekendCell(this._get(inst, "firstDay")); | |
setAccessibleDayCell(); | |
inst.dpDiv.keydown(function(e) { | |
if (e.keyCode == 27) { | |
$.datepicker._hideDatepicker() | |
} | |
}) | |
} | |
}); | |
function extendRemove(target, props) { | |
$.extend(target, props); | |
for (var name in props) { | |
if (props[name] == null || props[name] == undefined) { | |
target[name] = props[name] | |
} | |
} | |
return target | |
} | |
function isArray(a) { | |
return (a && (($.browser.safari && typeof a == "object" && a.length) || (a.constructor && a.constructor.toString().match(/\Array\(\)/)))) | |
} | |
$.fn.datepicker = function(options) { | |
var otherArgs = Array.prototype.slice.call(arguments, 1); | |
if (typeof options == "string" && (options == "isDisabled" || options == "getDate")) { | |
return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs)) | |
} | |
return this.each(function() { | |
typeof options == "string" ? $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options) | |
}) | |
}; | |
$.datepicker = new Datepicker(); | |
$(document).ready(function() { | |
$(document.body).append($.datepicker.dpDiv).mousedown($.datepicker._checkExternalClick) | |
}) | |
})(jQuery); | |
(function(c) { | |
c.effects = c.effects || {}; | |
c.extend(c.effects, { | |
save: function(f, g) { | |
for (var e = 0; e < g.length; e++) { | |
if (g[e] !== null) { | |
c.data(f[0], "ec.storage." + g[e], f[0].style[g[e]]) | |
} | |
} | |
}, | |
restore: function(f, g) { | |
for (var e = 0; e < g.length; e++) { | |
if (g[e] !== null) { | |
f.css(g[e], c.data(f[0], "ec.storage." + g[e])) | |
} | |
} | |
}, | |
setMode: function(e, f) { | |
if (f == "toggle") { | |
f = e.is(":hidden") ? "show" : "hide" | |
} | |
return f | |
}, | |
getBaseline: function(f, g) { | |
var h, e; | |
switch (f[0]) { | |
case "top": | |
h = 0; | |
break; | |
case "middle": | |
h = 0.5; | |
break; | |
case "bottom": | |
h = 1; | |
break; | |
default: | |
h = f[0] / g.height | |
} | |
switch (f[1]) { | |
case "left": | |
e = 0; | |
break; | |
case "center": | |
e = 0.5; | |
break; | |
case "right": | |
e = 1; | |
break; | |
default: | |
e = f[1] / g.width | |
} | |
return { | |
x: e, | |
y: h | |
} | |
}, | |
createWrapper: function(f) { | |
if (f.parent().attr("id") == "fxWrapper") { | |
return f | |
} | |
var e = { | |
width: f.outerWidth({ | |
margin: true | |
}), | |
height: f.outerHeight({ | |
margin: true | |
}), | |
"float": f.css("float") | |
}; | |
f.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>'); | |
var j = f.parent(); | |
if (f.css("position") == "static") { | |
j.css({ | |
position: "relative" | |
}); | |
f.css({ | |
position: "relative" | |
}) | |
} else { | |
var h = f.css("top"); | |
if (isNaN(parseInt(h))) { | |
h = "auto" | |
} | |
var g = f.css("left"); | |
if (isNaN(parseInt(g))) { | |
g = "auto" | |
} | |
j.css({ | |
position: f.css("position"), | |
top: h, | |
left: g, | |
zIndex: f.css("z-index") | |
}).show(); | |
f.css({ | |
position: "relative", | |
top: 0, | |
left: 0 | |
}) | |
} | |
j.css(e); | |
return j | |
}, | |
removeWrapper: function(e) { | |
if (e.parent().attr("id") == "fxWrapper") { | |
return e.parent().replaceWith(e) | |
} | |
return e | |
}, | |
setTransition: function(f, g, e, h) { | |
h = h || {}; | |
c.each(g, function(k, j) { | |
unit = f.cssUnit(j); | |
if (unit[0] > 0) { | |
h[j] = unit[0] * e + unit[1] | |
} | |
}); | |
return h | |
}, | |
animateClass: function(g, h, k, j) { | |
var e = (typeof k == "function" ? k : (j ? j : null)); | |
var f = (typeof k == "object" ? k : null); | |
return this.each(function() { | |
var q = {}; | |
var o = c(this); | |
var p = o.attr("style") || ""; | |
if (typeof p == "object") { | |
p = p.cssText | |
} | |
if (g.toggle) { | |
o.hasClass(g.toggle) ? g.remove = g.toggle : g.add = g.toggle | |
} | |
var l = c.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle)); | |
if (g.add) { | |
o.addClass(g.add) | |
} | |
if (g.remove) { | |
o.removeClass(g.remove) | |
} | |
var m = c.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle)); | |
if (g.add) { | |
o.removeClass(g.add) | |
} | |
if (g.remove) { | |
o.addClass(g.remove) | |
} | |
for (var r in m) { | |
if (typeof m[r] != "function" && m[r] && r.indexOf("Moz") == -1 && r.indexOf("length") == -1 && m[r] != l[r] && (r.match(/color/i) || (!r.match(/color/i) && !isNaN(parseInt(m[r], 10)))) && (l.position != "static" || (l.position == "static" && !r.match(/left|top|bottom|right/)))) { | |
q[r] = m[r] | |
} | |
} | |
o.animate(q, h, f, function() { | |
if (typeof c(this).attr("style") == "object") { | |
c(this).attr("style")["cssText"] = ""; | |
c(this).attr("style")["cssText"] = p | |
} else { | |
c(this).attr("style", p) | |
} | |
if (g.add) { | |
c(this).addClass(g.add) | |
} | |
if (g.remove) { | |
c(this).removeClass(g.remove) | |
} | |
if (e) { | |
e.apply(this, arguments) | |
} | |
}) | |
}) | |
} | |
}); | |
c.fn.extend({ | |
_show: c.fn.show, | |
_hide: c.fn.hide, | |
__toggle: c.fn.toggle, | |
_addClass: c.fn.addClass, | |
_removeClass: c.fn.removeClass, | |
_toggleClass: c.fn.toggleClass, | |
effect: function(e, g, f, h) { | |
return c.effects[e] ? c.effects[e].call(this, { | |
method: e, | |
options: g || {}, | |
duration: f, | |
callback: h | |
}) : null | |
}, | |
show: function() { | |
if (!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0]))) { | |
return this._show.apply(this, arguments) | |
} else { | |
var e = arguments[1] || {}; | |
e.mode = "show"; | |
return this.effect.apply(this, [arguments[0], e, arguments[2] || e.duration, arguments[3] || e.callback]) | |
} | |
}, | |
hide: function() { | |
if (!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0]))) { | |
return this._hide.apply(this, arguments) | |
} else { | |
var e = arguments[1] || {}; | |
e.mode = "hide"; | |
return this.effect.apply(this, [arguments[0], e, arguments[2] || e.duration, arguments[3] || e.callback]) | |
} | |
}, | |
toggle: function() { | |
if (!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function)) { | |
return this.__toggle.apply(this, arguments) | |
} else { | |
var e = arguments[1] || {}; | |
e.mode = "toggle"; | |
return this.effect.apply(this, [arguments[0], e, arguments[2] || e.duration, arguments[3] || e.callback]) | |
} | |
}, | |
addClass: function(f, e, h, g) { | |
return e ? c.effects.animateClass.apply(this, [{ | |
add: f | |
}, e, h, g]) : this._addClass(f) | |
}, | |
removeClass: function(f, e, h, g) { | |
return e ? c.effects.animateClass.apply(this, [{ | |
remove: f | |
}, e, h, g]) : this._removeClass(f) | |
}, | |
toggleClass: function(f, e, h, g) { | |
return e ? c.effects.animateClass.apply(this, [{ | |
toggle: f | |
}, e, h, g]) : this._toggleClass(f) | |
}, | |
morph: function(e, g, f, j, h) { | |
return c.effects.animateClass.apply(this, [{ | |
add: g, | |
remove: e | |
}, f, j, h]) | |
}, | |
switchClass: function() { | |
return this.morph.apply(this, arguments) | |
}, | |
cssUnit: function(e) { | |
var f = this.css(e), | |
g = []; | |
c.each(["em", "px", "%", "pt"], function(h, j) { | |
if (f.indexOf(j) > 0) { | |
g = [parseFloat(f), j] | |
} | |
}); | |
return g | |
} | |
}); | |
jQuery.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "color", "outlineColor"], function(f, e) { | |
jQuery.fx.step[e] = function(g) { | |
if (g.state == 0) { | |
g.start = d(g.elem, e); | |
g.end = b(g.end) | |
} | |
g.elem.style[e] = "rgb(" + [Math.max(Math.min(parseInt((g.pos * (g.end[0] - g.start[0])) + g.start[0]), 255), 0), Math.max(Math.min(parseInt((g.pos * (g.end[1] - g.start[1])) + g.start[1]), 255), 0), Math.max(Math.min(parseInt((g.pos * (g.end[2] - g.start[2])) + g.start[2]), 255), 0)].join(",") + ")" | |
} | |
}); | |
function b(f) { | |
var e; | |
if (f && f.constructor == Array && f.length == 3) { | |
return f | |
} | |
if (e = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)) { | |
return [parseInt(e[1]), parseInt(e[2]), parseInt(e[3])] | |
} | |
if (e = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)) { | |
return [parseFloat(e[1]) * 2.55, parseFloat(e[2]) * 2.55, parseFloat(e[3]) * 2.55] | |
} | |
if (e = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)) { | |
return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)] | |
} | |
if (e = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)) { | |
return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)] | |
} | |
if (e = /rgba\(0, 0, 0, 0\)/.exec(f)) { | |
return a.transparent | |
} | |
return a[jQuery.trim(f).toLowerCase()] | |
} | |
function d(g, e) { | |
var f; | |
do { | |
f = jQuery.curCSS(g, e); | |
if (f != "" && f != "transparent" || jQuery.nodeName(g, "body")) { | |
break | |
} | |
e = "backgroundColor" | |
} while (g = g.parentNode); | |
return b(f) | |
} | |
var a = { | |
aqua: [0, 255, 255], | |
azure: [240, 255, 255], | |
beige: [245, 245, 220], | |
black: [0, 0, 0], | |
blue: [0, 0, 255], | |
brown: [165, 42, 42], | |
cyan: [0, 255, 255], | |
darkblue: [0, 0, 139], | |
darkcyan: [0, 139, 139], | |
darkgrey: [169, 169, 169], | |
darkgreen: [0, 100, 0], | |
darkkhaki: [189, 183, 107], | |
darkmagenta: [139, 0, 139], | |
darkolivegreen: [85, 107, 47], | |
darkorange: [255, 140, 0], | |
darkorchid: [153, 50, 204], | |
darkred: [139, 0, 0], | |
darksalmon: [233, 150, 122], | |
darkviolet: [148, 0, 211], | |
fuchsia: [255, 0, 255], | |
gold: [255, 215, 0], | |
green: [0, 128, 0], | |
indigo: [75, 0, 130], | |
khaki: [240, 230, 140], | |
lightblue: [173, 216, 230], | |
lightcyan: [224, 255, 255], | |
lightgreen: [144, 238, 144], | |
lightgrey: [211, 211, 211], | |
lightpink: [255, 182, 193], | |
lightyellow: [255, 255, 224], | |
lime: [0, 255, 0], | |
magenta: [255, 0, 255], | |
maroon: [128, 0, 0], | |
navy: [0, 0, 128], | |
olive: [128, 128, 0], | |
orange: [255, 165, 0], | |
pink: [255, 192, 203], | |
purple: [128, 0, 128], | |
violet: [128, 0, 128], | |
red: [255, 0, 0], | |
silver: [192, 192, 192], | |
white: [255, 255, 255], | |
yellow: [255, 255, 0], | |
transparent: [255, 255, 255] | |
}; | |
jQuery.easing.jswing = jQuery.easing.swing; | |
jQuery.extend(jQuery.easing, { | |
def: "easeOutQuad", | |
swing: function(f, g, e, j, h) { | |
return jQuery.easing[jQuery.easing.def](f, g, e, j, h) | |
}, | |
easeInQuad: function(f, g, e, j, h) { | |
return j * (g /= h) * g + e | |
}, | |
easeOutQuad: function(f, g, e, j, h) { | |
return -j * (g /= h) * (g - 2) + e | |
}, | |
easeInOutQuad: function(f, g, e, j, h) { | |
if ((g /= h / 2) < 1) { | |
return j / 2 * g * g + e | |
} | |
return -j / 2 * ((--g) * (g - 2) - 1) + e | |
}, | |
easeInCubic: function(f, g, e, j, h) { | |
return j * (g /= h) * g * g + e | |
}, | |
easeOutCubic: function(f, g, e, j, h) { | |
return j * ((g = g / h - 1) * g * g + 1) + e | |
}, | |
easeInOutCubic: function(f, g, e, j, h) { | |
if ((g /= h / 2) < 1) { | |
return j / 2 * g * g * g + e | |
} | |
return j / 2 * ((g -= 2) * g * g + 2) + e | |
}, | |
easeInQuart: function(f, g, e, j, h) { | |
return j * (g /= h) * g * g * g + e | |
}, | |
easeOutQuart: function(f, g, e, j, h) { | |
return -j * ((g = g / h - 1) * g * g * g - 1) + e | |
}, | |
easeInOutQuart: function(f, g, e, j, h) { | |
if ((g /= h / 2) < 1) { | |
return j / 2 * g * g * g * g + e | |
} | |
return -j / 2 * ((g -= 2) * g * g * g - 2) + e | |
}, | |
easeInQuint: function(f, g, e, j, h) { | |
return j * (g /= h) * g * g * g * g + e | |
}, | |
easeOutQuint: function(f, g, e, j, h) { | |
return j * ((g = g / h - 1) * g * g * g * g + 1) + e | |
}, | |
easeInOutQuint: function(f, g, e, j, h) { | |
if ((g /= h / 2) < 1) { | |
return j / 2 * g * g * g * g * g + e | |
} | |
return j / 2 * ((g -= 2) * g * g * g * g + 2) + e | |
}, | |
easeInSine: function(f, g, e, j, h) { | |
return -j * Math.cos(g / h * (Math.PI / 2)) + j + e | |
}, | |
easeOutSine: function(f, g, e, j, h) { | |
return j * Math.sin(g / h * (Math.PI / 2)) + e | |
}, | |
easeInOutSine: function(f, g, e, j, h) { | |
return -j / 2 * (Math.cos(Math.PI * g / h) - 1) + e | |
}, | |
easeInExpo: function(f, g, e, j, h) { | |
return (g == 0) ? e : j * Math.pow(2, 10 * (g / h - 1)) + e | |
}, | |
easeOutExpo: function(f, g, e, j, h) { | |
return (g == h) ? e + j : j * (-Math.pow(2, -10 * g / h) + 1) + e | |
}, | |
easeInOutExpo: function(f, g, e, j, h) { | |
if (g == 0) { | |
return e | |
} | |
if (g == h) { | |
return e + j | |
} | |
if ((g /= h / 2) < 1) { | |
return j / 2 * Math.pow(2, 10 * (g - 1)) + e | |
} | |
return j / 2 * (-Math.pow(2, -10 * --g) + 2) + e | |
}, | |
easeInCirc: function(f, g, e, j, h) { | |
return -j * (Math.sqrt(1 - (g /= h) * g) - 1) + e | |
}, | |
easeOutCirc: function(f, g, e, j, h) { | |
return j * Math.sqrt(1 - (g = g / h - 1) * g) + e | |
}, | |
easeInOutCirc: function(f, g, e, j, h) { | |
if ((g /= h / 2) < 1) { | |
return -j / 2 * (Math.sqrt(1 - g * g) - 1) + e | |
} | |
return j / 2 * (Math.sqrt(1 - (g -= 2) * g) + 1) + e | |
}, | |
easeInElastic: function(f, h, e, m, l) { | |
var j = 1.70158; | |
var k = 0; | |
var g = m; | |
if (h == 0) { | |
return e | |
} | |
if ((h /= l) == 1) { | |
return e + m | |
} | |
if (!k) { | |
k = l * 0.3 | |
} | |
if (g < Math.abs(m)) { | |
g = m; | |
var j = k / 4 | |
} else { | |
var j = k / (2 * Math.PI) * Math.asin(m / g) | |
} | |
return -(g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * l - j) * (2 * Math.PI) / k)) + e | |
}, | |
easeOutElastic: function(f, h, e, m, l) { | |
var j = 1.70158; | |
var k = 0; | |
var g = m; | |
if (h == 0) { | |
return e | |
} | |
if ((h /= l) == 1) { | |
return e + m | |
} | |
if (!k) { | |
k = l * 0.3 | |
} | |
if (g < Math.abs(m)) { | |
g = m; | |
var j = k / 4 | |
} else { | |
var j = k / (2 * Math.PI) * Math.asin(m / g) | |
} | |
return g * Math.pow(2, -10 * h) * Math.sin((h * l - j) * (2 * Math.PI) / k) + m + e | |
}, | |
easeInOutElastic: function(f, h, e, m, l) { | |
var j = 1.70158; | |
var k = 0; | |
var g = m; | |
if (h == 0) { | |
return e | |
} | |
if ((h /= l / 2) == 2) { | |
return e + m | |
} | |
if (!k) { | |
k = l * (0.3 * 1.5) | |
} | |
if (g < Math.abs(m)) { | |
g = m; | |
var j = k / 4 | |
} else { | |
var j = k / (2 * Math.PI) * Math.asin(m / g) | |
} | |
if (h < 1) { | |
return -0.5 * (g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * l - j) * (2 * Math.PI) / k)) + e | |
} | |
return g * Math.pow(2, -10 * (h -= 1)) * Math.sin((h * l - j) * (2 * Math.PI) / k) * 0.5 + m + e | |
}, | |
easeInBack: function(f, g, e, k, j, h) { | |
if (h == undefined) { | |
h = 1.70158 | |
} | |
return k * (g /= j) * g * ((h + 1) * g - h) + e | |
}, | |
easeOutBack: function(f, g, e, k, j, h) { | |
if (h == undefined) { | |
h = 1.70158 | |
} | |
return k * ((g = g / j - 1) * g * ((h + 1) * g + h) + 1) + e | |
}, | |
easeInOutBack: function(f, g, e, k, j, h) { | |
if (h == undefined) { | |
h = 1.70158 | |
} | |
if ((g /= j / 2) < 1) { | |
return k / 2 * (g * g * (((h *= (1.525)) + 1) * g - h)) + e | |
} | |
return k / 2 * ((g -= 2) * g * (((h *= (1.525)) + 1) * g + h) + 2) + e | |
}, | |
easeInBounce: function(f, g, e, j, h) { | |
return j - jQuery.easing.easeOutBounce(f, h - g, 0, j, h) + e | |
}, | |
easeOutBounce: function(f, g, e, j, h) { | |
if ((g /= h) < (1 / 2.75)) { | |
return j * (7.5625 * g * g) + e | |
} else { | |
if (g < (2 / 2.75)) { | |
return j * (7.5625 * (g -= (1.5 / 2.75)) * g + 0.75) + e | |
} else { | |
if (g < (2.5 / 2.75)) { | |
return j * (7.5625 * (g -= (2.25 / 2.75)) * g + 0.9375) + e | |
} else { | |
return j * (7.5625 * (g -= (2.625 / 2.75)) * g + 0.984375) + e | |
} | |
} | |
} | |
}, | |
easeInOutBounce: function(f, g, e, j, h) { | |
if (g < h / 2) { | |
return jQuery.easing.easeInBounce(f, g * 2, 0, j, h) * 0.5 + e | |
} | |
return jQuery.easing.easeOutBounce(f, g * 2 - h, 0, j, h) * 0.5 + j * 0.5 + e | |
} | |
}) | |
})(jQuery); | |
(function(a) { | |
a.effects.blind = function(b) { | |
return this.queue(function() { | |
var d = a(this), | |
c = ["position", "top", "left"]; | |
var h = a.effects.setMode(d, b.options.mode || "hide"); | |
var g = b.options.direction || "vertical"; | |
a.effects.save(d, c); | |
d.show(); | |
var k = a.effects.createWrapper(d).css({ | |
overflow: "hidden" | |
}); | |
var e = (g == "vertical") ? "height" : "width"; | |
var j = (g == "vertical") ? k.height() : k.width(); | |
if (h == "show") { | |
k.css(e, 0) | |
} | |
var f = {}; | |
f[e] = h == "show" ? j : 0; | |
k.animate(f, b.duration, b.options.easing, function() { | |
if (h == "hide") { | |
d.hide() | |
} | |
a.effects.restore(d, c); | |
a.effects.removeWrapper(d); | |
if (b.callback) { | |
b.callback.apply(d[0], arguments) | |
} | |
d.dequeue() | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.bounce = function(b) { | |
return this.queue(function() { | |
var e = a(this), | |
l = ["position", "top", "left"]; | |
var k = a.effects.setMode(e, b.options.mode || "effect"); | |
var n = b.options.direction || "up"; | |
var c = b.options.distance || 20; | |
var d = b.options.times || 5; | |
var g = b.duration || 250; | |
if (/show|hide/.test(k)) { | |
l.push("opacity") | |
} | |
a.effects.save(e, l); | |
e.show(); | |
a.effects.createWrapper(e); | |
var f = (n == "up" || n == "down") ? "top" : "left"; | |
var p = (n == "up" || n == "left") ? "pos" : "neg"; | |
var c = b.options.distance || (f == "top" ? e.outerHeight({ | |
margin: true | |
}) / 3 : e.outerWidth({ | |
margin: true | |
}) / 3); | |
if (k == "show") { | |
e.css("opacity", 0).css(f, p == "pos" ? -c : c) | |
} | |
if (k == "hide") { | |
c = c / (d * 2) | |
} | |
if (k != "hide") { | |
d-- | |
} | |
if (k == "show") { | |
var h = { | |
opacity: 1 | |
}; | |
h[f] = (p == "pos" ? "+=" : "-=") + c; | |
e.animate(h, g / 2, b.options.easing); | |
c = c / 2; | |
d-- | |
} | |
for (var j = 0; j < d; j++) { | |
var o = {}, | |
m = {}; | |
o[f] = (p == "pos" ? "-=" : "+=") + c; | |
m[f] = (p == "pos" ? "+=" : "-=") + c; | |
e.animate(o, g / 2, b.options.easing).animate(m, g / 2, b.options.easing); | |
c = (k == "hide") ? c * 2 : c / 2 | |
} | |
if (k == "hide") { | |
var h = { | |
opacity: 0 | |
}; | |
h[f] = (p == "pos" ? "-=" : "+=") + c; | |
e.animate(h, g / 2, b.options.easing, function() { | |
e.hide(); | |
a.effects.restore(e, l); | |
a.effects.removeWrapper(e); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
}) | |
} else { | |
var o = {}, | |
m = {}; | |
o[f] = (p == "pos" ? "-=" : "+=") + c; | |
m[f] = (p == "pos" ? "+=" : "-=") + c; | |
e.animate(o, g / 2, b.options.easing).animate(m, g / 2, b.options.easing, function() { | |
a.effects.restore(e, l); | |
a.effects.removeWrapper(e); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
}) | |
} | |
e.queue("fx", function() { | |
e.dequeue() | |
}); | |
e.dequeue() | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.clip = function(b) { | |
return this.queue(function() { | |
var f = a(this), | |
k = ["position", "top", "left", "height", "width"]; | |
var j = a.effects.setMode(f, b.options.mode || "hide"); | |
var l = b.options.direction || "vertical"; | |
a.effects.save(f, k); | |
f.show(); | |
var c = a.effects.createWrapper(f).css({ | |
overflow: "hidden" | |
}); | |
var e = f[0].tagName == "IMG" ? c : f; | |
var g = { | |
size: (l == "vertical") ? "height" : "width", | |
position: (l == "vertical") ? "top" : "left" | |
}; | |
var d = (l == "vertical") ? e.height() : e.width(); | |
if (j == "show") { | |
e.css(g.size, 0); | |
e.css(g.position, d / 2) | |
} | |
var h = {}; | |
h[g.size] = j == "show" ? d : 0; | |
h[g.position] = j == "show" ? 0 : d / 2; | |
e.animate(h, { | |
queue: false, | |
duration: b.duration, | |
easing: b.options.easing, | |
complete: function() { | |
if (j == "hide") { | |
f.hide() | |
} | |
a.effects.restore(f, k); | |
a.effects.removeWrapper(f); | |
if (b.callback) { | |
b.callback.apply(f[0], arguments) | |
} | |
f.dequeue() | |
} | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.drop = function(b) { | |
return this.queue(function() { | |
var e = a(this), | |
d = ["position", "top", "left", "opacity"]; | |
var j = a.effects.setMode(e, b.options.mode || "hide"); | |
var h = b.options.direction || "left"; | |
a.effects.save(e, d); | |
e.show(); | |
a.effects.createWrapper(e); | |
var f = (h == "up" || h == "down") ? "top" : "left"; | |
var c = (h == "up" || h == "left") ? "pos" : "neg"; | |
var k = b.options.distance || (f == "top" ? e.outerHeight({ | |
margin: true | |
}) / 2 : e.outerWidth({ | |
margin: true | |
}) / 2); | |
if (j == "show") { | |
e.css("opacity", 0).css(f, c == "pos" ? -k : k) | |
} | |
var g = { | |
opacity: j == "show" ? 1 : 0 | |
}; | |
g[f] = (j == "show" ? (c == "pos" ? "+=" : "-=") : (c == "pos" ? "-=" : "+=")) + k; | |
e.animate(g, { | |
queue: false, | |
duration: b.duration, | |
easing: b.options.easing, | |
complete: function() { | |
if (j == "hide") { | |
e.hide() | |
} | |
a.effects.restore(e, d); | |
a.effects.removeWrapper(e); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
e.dequeue() | |
} | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.explode = function(b) { | |
return this.queue(function() { | |
var k = b.options.pieces ? Math.round(Math.sqrt(b.options.pieces)) : 3; | |
var e = b.options.pieces ? Math.round(Math.sqrt(b.options.pieces)) : 3; | |
b.options.mode = b.options.mode == "toggle" ? (a(this).is(":visible") ? "hide" : "show") : b.options.mode; | |
var h = a(this).show().css("visibility", "hidden"); | |
var l = h.offset(); | |
l.top -= parseInt(h.css("marginTop")) || 0; | |
l.left -= parseInt(h.css("marginLeft")) || 0; | |
var g = h.outerWidth(true); | |
var c = h.outerHeight(true); | |
for (var f = 0; f < k; f++) { | |
for (var d = 0; d < e; d++) { | |
h.clone().appendTo("body").wrap("<div></div>").css({ | |
position: "absolute", | |
visibility: "visible", | |
left: -d * (g / e), | |
top: -f * (c / k) | |
}).parent().addClass("effects-explode").css({ | |
position: "absolute", | |
overflow: "hidden", | |
width: g / e, | |
height: c / k, | |
left: l.left + d * (g / e) + (b.options.mode == "show" ? (d - Math.floor(e / 2)) * (g / e) : 0), | |
top: l.top + f * (c / k) + (b.options.mode == "show" ? (f - Math.floor(k / 2)) * (c / k) : 0), | |
opacity: b.options.mode == "show" ? 0 : 1 | |
}).animate({ | |
left: l.left + d * (g / e) + (b.options.mode == "show" ? 0 : (d - Math.floor(e / 2)) * (g / e)), | |
top: l.top + f * (c / k) + (b.options.mode == "show" ? 0 : (f - Math.floor(k / 2)) * (c / k)), | |
opacity: b.options.mode == "show" ? 1 : 0 | |
}, b.duration || 500) | |
} | |
} | |
setTimeout(function() { | |
b.options.mode == "show" ? h.css({ | |
visibility: "visible" | |
}) : h.css({ | |
visibility: "visible" | |
}).hide(); | |
if (b.callback) { | |
b.callback.apply(h[0]) | |
} | |
h.dequeue(); | |
a(".effects-explode").remove() | |
}, b.duration || 500) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.fold = function(b) { | |
return this.queue(function() { | |
var e = a(this), | |
k = ["position", "top", "left"]; | |
var g = a.effects.setMode(e, b.options.mode || "hide"); | |
var o = b.options.size || 15; | |
var n = !(!b.options.horizFirst); | |
a.effects.save(e, k); | |
e.show(); | |
var d = a.effects.createWrapper(e).css({ | |
overflow: "hidden" | |
}); | |
var h = ((g == "show") != n); | |
var f = h ? ["width", "height"] : ["height", "width"]; | |
var c = h ? [d.width(), d.height()] : [d.height(), d.width()]; | |
var j = /([0-9]+)%/.exec(o); | |
if (j) { | |
o = parseInt(j[1]) / 100 * c[g == "hide" ? 0 : 1] | |
} | |
if (g == "show") { | |
d.css(n ? { | |
height: 0, | |
width: o | |
} : { | |
height: o, | |
width: 0 | |
}) | |
} | |
var m = {}, | |
l = {}; | |
m[f[0]] = g == "show" ? c[0] : o; | |
l[f[1]] = g == "show" ? c[1] : 0; | |
d.animate(m, b.duration / 2, b.options.easing).animate(l, b.duration / 2, b.options.easing, function() { | |
if (g == "hide") { | |
e.hide() | |
} | |
a.effects.restore(e, k); | |
a.effects.removeWrapper(e); | |
if (b.callback) { | |
b.callback.apply(e[0], arguments) | |
} | |
e.dequeue() | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.highlight = function(b) { | |
return this.queue(function() { | |
var e = a(this), | |
d = ["backgroundImage", "backgroundColor", "opacity"]; | |
var h = a.effects.setMode(e, b.options.mode || "show"); | |
var c = b.options.color || "#ffff99"; | |
var g = e.css("backgroundColor"); | |
a.effects.save(e, d); | |
e.show(); | |
e.css({ | |
backgroundImage: "none", | |
backgroundColor: c | |
}); | |
var f = { | |
backgroundColor: g | |
}; | |
if (h == "hide") { | |
f.opacity = 0 | |
} | |
e.animate(f, { | |
queue: false, | |
duration: b.duration, | |
easing: b.options.easing, | |
complete: function() { | |
if (h == "hide") { | |
e.hide() | |
} | |
a.effects.restore(e, d); | |
if (h == "show" && jQuery.browser.msie) { | |
this.style.removeAttribute("filter") | |
} | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
e.dequeue() | |
} | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.pulsate = function(b) { | |
return this.queue(function() { | |
var d = a(this); | |
var f = a.effects.setMode(d, b.options.mode || "show"); | |
var e = b.options.times || 5; | |
if (f == "hide") { | |
e-- | |
} | |
if (d.is(":hidden")) { | |
d.css("opacity", 0); | |
d.show(); | |
d.animate({ | |
opacity: 1 | |
}, b.duration / 2, b.options.easing); | |
e = e - 2 | |
} | |
for (var c = 0; c < e; c++) { | |
d.animate({ | |
opacity: 0 | |
}, b.duration / 2, b.options.easing).animate({ | |
opacity: 1 | |
}, b.duration / 2, b.options.easing) | |
} | |
if (f == "hide") { | |
d.animate({ | |
opacity: 0 | |
}, b.duration / 2, b.options.easing, function() { | |
d.hide(); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
}) | |
} else { | |
d.animate({ | |
opacity: 0 | |
}, b.duration / 2, b.options.easing).animate({ | |
opacity: 1 | |
}, b.duration / 2, b.options.easing, function() { | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
}) | |
} | |
d.queue("fx", function() { | |
d.dequeue() | |
}); | |
d.dequeue() | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.puff = function(b) { | |
return this.queue(function() { | |
var f = a(this); | |
var c = a.extend(true, {}, b.options); | |
var h = a.effects.setMode(f, b.options.mode || "hide"); | |
var g = parseInt(b.options.percent) || 150; | |
c.fade = true; | |
var e = { | |
height: f.height(), | |
width: f.width() | |
}; | |
var d = g / 100; | |
f.from = (h == "hide") ? e : { | |
height: e.height * d, | |
width: e.width * d | |
}; | |
c.from = f.from; | |
c.percent = (h == "hide") ? g : 100; | |
c.mode = h; | |
f.effect("scale", c, b.duration, b.callback); | |
f.dequeue() | |
}) | |
}; | |
a.effects.scale = function(b) { | |
return this.queue(function() { | |
var g = a(this); | |
var d = a.extend(true, {}, b.options); | |
var k = a.effects.setMode(g, b.options.mode || "effect"); | |
var h = parseInt(b.options.percent) || (parseInt(b.options.percent) == 0 ? 0 : (k == "hide" ? 0 : 100)); | |
var j = b.options.direction || "both"; | |
var c = b.options.origin; | |
if (k != "effect") { | |
d.origin = c || ["middle", "center"]; | |
d.restore = true | |
} | |
var f = { | |
height: g.height(), | |
width: g.width() | |
}; | |
g.from = b.options.from || (k == "show" ? { | |
height: 0, | |
width: 0 | |
} : f); | |
var e = { | |
y: j != "horizontal" ? (h / 100) : 1, | |
x: j != "vertical" ? (h / 100) : 1 | |
}; | |
g.to = { | |
height: f.height * e.y, | |
width: f.width * e.x | |
}; | |
if (b.options.fade) { | |
if (k == "show") { | |
g.from.opacity = 0; | |
g.to.opacity = 1 | |
} | |
if (k == "hide") { | |
g.from.opacity = 1; | |
g.to.opacity = 0 | |
} | |
} | |
d.from = g.from; | |
d.to = g.to; | |
d.mode = k; | |
g.effect("size", d, b.duration, b.callback); | |
g.dequeue() | |
}) | |
}; | |
a.effects.size = function(b) { | |
return this.queue(function() { | |
var c = a(this), | |
o = ["position", "top", "left", "width", "height", "overflow", "opacity"]; | |
var n = ["position", "top", "left", "overflow", "opacity"]; | |
var k = ["width", "height", "overflow"]; | |
var q = ["fontSize"]; | |
var l = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"]; | |
var f = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"]; | |
var g = a.effects.setMode(c, b.options.mode || "effect"); | |
var j = b.options.restore || false; | |
var e = b.options.scale || "both"; | |
var p = b.options.origin; | |
var d = { | |
height: c.height(), | |
width: c.width() | |
}; | |
c.from = b.options.from || d; | |
c.to = b.options.to || d; | |
if (p) { | |
var h = a.effects.getBaseline(p, d); | |
c.from.top = (d.height - c.from.height) * h.y; | |
c.from.left = (d.width - c.from.width) * h.x; | |
c.to.top = (d.height - c.to.height) * h.y; | |
c.to.left = (d.width - c.to.width) * h.x | |
} | |
var m = { | |
from: { | |
y: c.from.height / d.height, | |
x: c.from.width / d.width | |
}, | |
to: { | |
y: c.to.height / d.height, | |
x: c.to.width / d.width | |
} | |
}; | |
if (e == "box" || e == "both") { | |
if (m.from.y != m.to.y) { | |
o = o.concat(l); | |
c.from = a.effects.setTransition(c, l, m.from.y, c.from); | |
c.to = a.effects.setTransition(c, l, m.to.y, c.to) | |
} | |
if (m.from.x != m.to.x) { | |
o = o.concat(f); | |
c.from = a.effects.setTransition(c, f, m.from.x, c.from); | |
c.to = a.effects.setTransition(c, f, m.to.x, c.to) | |
} | |
} | |
if (e == "content" || e == "both") { | |
if (m.from.y != m.to.y) { | |
o = o.concat(q); | |
c.from = a.effects.setTransition(c, q, m.from.y, c.from); | |
c.to = a.effects.setTransition(c, q, m.to.y, c.to) | |
} | |
} | |
a.effects.save(c, j ? o : n); | |
c.show(); | |
a.effects.createWrapper(c); | |
c.css("overflow", "hidden").css(c.from); | |
if (e == "content" || e == "both") { | |
l = l.concat(["marginTop", "marginBottom"]).concat(q); | |
f = f.concat(["marginLeft", "marginRight"]); | |
k = o.concat(l).concat(f); | |
c.find("*[width]").each(function() { | |
child = a(this); | |
if (j) { | |
a.effects.save(child, k) | |
} | |
var r = { | |
height: child.height(), | |
width: child.width() | |
}; | |
child.from = { | |
height: r.height * m.from.y, | |
width: r.width * m.from.x | |
}; | |
child.to = { | |
height: r.height * m.to.y, | |
width: r.width * m.to.x | |
}; | |
if (m.from.y != m.to.y) { | |
child.from = a.effects.setTransition(child, l, m.from.y, child.from); | |
child.to = a.effects.setTransition(child, l, m.to.y, child.to) | |
} | |
if (m.from.x != m.to.x) { | |
child.from = a.effects.setTransition(child, f, m.from.x, child.from); | |
child.to = a.effects.setTransition(child, f, m.to.x, child.to) | |
} | |
child.css(child.from); | |
child.animate(child.to, b.duration, b.options.easing, function() { | |
if (j) { | |
a.effects.restore(child, k) | |
} | |
}) | |
}) | |
} | |
c.animate(c.to, { | |
queue: false, | |
duration: b.duration, | |
easing: b.options.easing, | |
complete: function() { | |
if (g == "hide") { | |
c.hide() | |
} | |
a.effects.restore(c, j ? o : n); | |
a.effects.removeWrapper(c); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
c.dequeue() | |
} | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.shake = function(b) { | |
return this.queue(function() { | |
var e = a(this), | |
l = ["position", "top", "left"]; | |
var k = a.effects.setMode(e, b.options.mode || "effect"); | |
var n = b.options.direction || "left"; | |
var c = b.options.distance || 20; | |
var d = b.options.times || 3; | |
var g = b.duration || b.options.duration || 140; | |
a.effects.save(e, l); | |
e.show(); | |
a.effects.createWrapper(e); | |
var f = (n == "up" || n == "down") ? "top" : "left"; | |
var p = (n == "up" || n == "left") ? "pos" : "neg"; | |
var h = {}, | |
o = {}, | |
m = {}; | |
h[f] = (p == "pos" ? "-=" : "+=") + c; | |
o[f] = (p == "pos" ? "+=" : "-=") + c * 2; | |
m[f] = (p == "pos" ? "-=" : "+=") + c * 2; | |
e.animate(h, g, b.options.easing); | |
for (var j = 1; j < d; j++) { | |
e.animate(o, g, b.options.easing).animate(m, g, b.options.easing) | |
} | |
e.animate(o, g, b.options.easing).animate(h, g / 2, b.options.easing, function() { | |
a.effects.restore(e, l); | |
a.effects.removeWrapper(e); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
}); | |
e.queue("fx", function() { | |
e.dequeue() | |
}); | |
e.dequeue() | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.slide = function(b) { | |
return this.queue(function() { | |
var e = a(this), | |
d = ["position", "top", "left"]; | |
var j = a.effects.setMode(e, b.options.mode || "show"); | |
var h = b.options.direction || "left"; | |
a.effects.save(e, d); | |
e.show(); | |
a.effects.createWrapper(e).css({ | |
overflow: "hidden" | |
}); | |
var f = (h == "up" || h == "down") ? "top" : "left"; | |
var c = (h == "up" || h == "left") ? "pos" : "neg"; | |
var k = b.options.distance || (f == "top" ? e.outerHeight({ | |
margin: true | |
}) : e.outerWidth({ | |
margin: true | |
})); | |
if (j == "show") { | |
e.css(f, c == "pos" ? -k : k) | |
} | |
var g = {}; | |
g[f] = (j == "show" ? (c == "pos" ? "+=" : "-=") : (c == "pos" ? "-=" : "+=")) + k; | |
e.animate(g, { | |
queue: false, | |
duration: b.duration, | |
easing: b.options.easing, | |
complete: function() { | |
if (j == "hide") { | |
e.hide() | |
} | |
a.effects.restore(e, d); | |
a.effects.removeWrapper(e); | |
if (b.callback) { | |
b.callback.apply(this, arguments) | |
} | |
e.dequeue() | |
} | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
a.effects.transfer = function(b) { | |
return this.queue(function() { | |
var e = a(this); | |
var g = a.effects.setMode(e, b.options.mode || "effect"); | |
var f = a(b.options.to); | |
var c = e.offset(); | |
var d = a('<div class="ui-effects-transfer"></div>').appendTo(document.body); | |
if (b.options.className) { | |
d.addClass(b.options.className) | |
} | |
d.addClass(b.options.className); | |
d.css({ | |
top: c.top, | |
left: c.left, | |
height: e.outerHeight() - parseInt(d.css("borderTopWidth")) - parseInt(d.css("borderBottomWidth")), | |
width: e.outerWidth() - parseInt(d.css("borderLeftWidth")) - parseInt(d.css("borderRightWidth")), | |
position: "absolute" | |
}); | |
c = f.offset(); | |
animation = { | |
top: c.top, | |
left: c.left, | |
height: f.outerHeight() - parseInt(d.css("borderTopWidth")) - parseInt(d.css("borderBottomWidth")), | |
width: f.outerWidth() - parseInt(d.css("borderLeftWidth")) - parseInt(d.css("borderRightWidth")) | |
}; | |
d.animate(animation, b.duration, b.options.easing, function() { | |
d.remove(); | |
if (b.callback) { | |
b.callback.apply(e[0], arguments) | |
} | |
e.dequeue() | |
}) | |
}) | |
} | |
})(jQuery); | |
jQuery(function(a) { | |
a.datepicker.regional.ar = { | |
closeText: "إغلاق", | |
prevText: "<السابق", | |
nextText: "التالي>", | |
currentText: "اليوم", | |
monthNames: ["كانون الثاني", "شباط", "آذار", "نيسان", "آذار", "Øزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], | |
monthNamesShort: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], | |
dayNames: ["السبت", "الأØد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة"], | |
dayNamesShort: ["سبت", "Ø£Øد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة"], | |
dayNamesMin: ["سبت", "Ø£Øد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: true | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ar) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.bg = { | |
closeText: "затвори", | |
prevText: "<назад", | |
nextText: "напред>", | |
nextBigText: ">>", | |
currentText: "днеÑ", | |
monthNames: ["Януари", "Февруари", "Март", "Ðприл", "Май", "Юни", "Юли", "ÐвгуÑÑ‚", "Септември", "Октомври", "Ðоември", "Декември"], | |
monthNamesShort: ["Яну", "Фев", "Мар", "Ðпр", "Май", "Юни", "Юли", "Ðвг", "Сеп", "Окт", "Ðов", "Дек"], | |
dayNames: ["ÐеделÑ", "Понеделник", "Вторник", "СрÑда", "Четвъртък", "Петък", "Събота"], | |
dayNamesShort: ["Ðед", "Пон", "Вто", "СрÑ", "Чет", "Пет", "Съб"], | |
dayNamesMin: ["Ðе", "По", "Ð’Ñ‚", "Ср", "Че", "Пе", "Съ"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.bg) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.ca = { | |
closeText: "Tancar", | |
prevText: "<Ant", | |
nextText: "Seg>", | |
currentText: "Avui", | |
monthNames: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], | |
monthNamesShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], | |
dayNames: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], | |
dayNamesShort: ["Dug", "Dln", "Dmt", "Dmc", "Djs", "Dvn", "Dsb"], | |
dayNamesMin: ["Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"], | |
dateFormat: "mm/dd/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ca) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.cs = { | |
closeText: "ZavÅ™Ãt", | |
prevText: "<DÅ™Ãve", | |
nextText: "Později>", | |
currentText: "NynÃ", | |
monthNames: ["leden", "únor", "bÅ™ezen", "duben", "kvÄ›ten", "Äerven", "Äervenec", "srpen", "zářÃ", "Å™Ãjen", "listopad", "prosinec"], | |
monthNamesShort: ["led", "úno", "bÅ™e", "dub", "kvÄ›", "Äer", "Ävc", "srp", "zář", "Å™Ãj", "lis", "pro"], | |
dayNames: ["nedÄ›le", "pondÄ›lÃ", "úterý", "stÅ™eda", "Ätvrtek", "pátek", "sobota"], | |
dayNamesShort: ["ne", "po", "út", "st", "Ät", "pá", "so"], | |
dayNamesMin: ["ne", "po", "út", "st", "Ät", "pá", "so"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.cs) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.da = { | |
closeText: "Luk", | |
prevText: "<Forrige", | |
nextText: "Næste>", | |
currentText: "Idag", | |
monthNames: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], | |
dayNames: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], | |
dayNamesShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"], | |
dayNamesMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"], | |
dateFormat: "dd-mm-yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.da) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.de = { | |
closeText: "schließen", | |
prevText: "<zurück", | |
nextText: "Vor>", | |
currentText: "heute", | |
monthNames: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], | |
monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], | |
dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], | |
dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], | |
dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.de) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.el = { | |
closeText: "Κλείσιμο", | |
prevText: "Î ÏοηγοÏμενος", | |
nextText: "Επόμενος", | |
currentText: "ΤÏÎχων Μήνας", | |
monthNames: ["ΙανουάÏιος", "ΦεβÏουάÏιος", "ΜάÏτιος", "ΑπÏίλιος", "Μάιος", "ΙοÏνιος", "ΙοÏλιος", "ΑÏγουστος", "ΣεπτÎμβÏιος", "ΟκτώβÏιος", "ÎοÎμβÏιος", "ΔεκÎμβÏιος"], | |
monthNamesShort: ["Ιαν", "Φεβ", "ΜαÏ", "ΑπÏ", "Μαι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Îοε", "Δεκ"], | |
dayNames: ["ΚυÏιακή", "ΔευτÎÏα", "ΤÏίτη", "ΤετάÏτη", "Î Îμπτη", "ΠαÏασκευή", "Σάββατο"], | |
dayNamesShort: ["ΚυÏ", "Δευ", "ΤÏι", "Τετ", "Πεμ", "ΠαÏ", "Σαβ"], | |
dayNamesMin: ["Κυ", "Δε", "ΤÏ", "Τε", "Πε", "Πα", "Σα"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.el) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.eo = { | |
closeText: "Fermi", | |
prevText: "<Anta", | |
nextText: "Sekv>", | |
currentText: "Nuna", | |
monthNames: ["Januaro", "Februaro", "Marto", "Aprilo", "Majo", "Junio", "Julio", "AÅgusto", "Septembro", "Oktobro", "Novembro", "Decembro"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "AÅg", "Sep", "Okt", "Nov", "Dec"], | |
dayNames: ["Dimanĉo", "Lundo", "Mardo", "Merkredo", "Ä´aÅdo", "Vendredo", "Sabato"], | |
dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Ä´aÅ", "Ven", "Sab"], | |
dayNamesMin: ["Di", "Lu", "Ma", "Me", "Ä´a", "Ve", "Sa"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.eo) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.es = { | |
closeText: "Cerrar", | |
prevText: "<Ant", | |
nextText: "Sig>", | |
currentText: "Hoy", | |
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], | |
monthNamesShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], | |
dayNames: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], | |
dayNamesShort: ["Dom", "Lun", "Mar", "Mié", "Juv", "Vie", "Sáb"], | |
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sá"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.es) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.fa = { | |
closeText: "بستن", | |
prevText: "<قبلي", | |
nextText: "بعدي>", | |
currentText: "امروز", | |
monthNames: ["Ùروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دي", "بهمن", "اسÙند"], | |
monthNamesShort: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], | |
dayNames: ["يکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"], | |
dayNamesShort: ["ي", "د", "س", "چ", "پ", "ج", "ش"], | |
dayNamesMin: ["ي", "د", "س", "چ", "پ", "ج", "ش"], | |
dateFormat: "yy/mm/dd", | |
firstDay: 6, | |
isRTL: true | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.fa) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.fi = { | |
closeText: "Sulje", | |
prevText: "«Edellinen", | |
nextText: "Seuraava»", | |
currentText: "Tänään", | |
monthNames: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], | |
monthNamesShort: ["Tammi", "Helmi", "Maalis", "Huhti", "Touko", "Kesä", "Heinä", "Elo", "Syys", "Loka", "Marras", "Joulu"], | |
dayNamesShort: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "Su"], | |
dayNames: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], | |
dayNamesMin: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.fi) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.fr = { | |
closeText: "Fermer", | |
prevText: "<Préc", | |
nextText: "Suiv>", | |
currentText: "Courant", | |
monthNames: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], | |
monthNamesShort: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jun", "Jul", "Aoû", "Sep", "Oct", "Nov", "Déc"], | |
dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], | |
dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"], | |
dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.fr) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.he = { | |
closeText: "סגור", | |
prevText: "<הקוד×", | |
nextText: "הב×>", | |
currentText: "היו×", | |
monthNames: ["×™× ×•×ר", "פברו×ר", "מרץ", "×פריל", "מ××™", "×™×•× ×™", "יולי", "×וגוסט", "ספטמבר", "×וקטובר", "× ×•×‘×ž×‘×¨", "דצמבר"], | |
monthNamesShort: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], | |
dayNames: ["ר×שון", "×©× ×™", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], | |
dayNamesShort: ["×'", "ב'", "×’'", "ד'", "×”'", "ו'", "שבת"], | |
dayNamesMin: ["×'", "ב'", "×’'", "ד'", "×”'", "ו'", "שבת"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: true | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.he) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.hr = { | |
closeText: "Zatvori", | |
prevText: "<", | |
nextText: ">", | |
currentText: "Danas", | |
monthNames: ["SijeÄanj", "VeljaÄa", "Ožujak", "Travanj", "Svibanj", "Lipani", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"], | |
monthNamesShort: ["Sij", "Velj", "Ožu", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro"], | |
dayNames: ["Nedjalja", "Ponedjeljak", "Utorak", "Srijeda", "ÄŒetvrtak", "Petak", "Subota"], | |
dayNamesShort: ["Ned", "Pon", "Uto", "Sri", "ÄŒet", "Pet", "Sub"], | |
dayNamesMin: ["Ne", "Po", "Ut", "Sr", "ÄŒe", "Pe", "Su"], | |
dateFormat: "dd.mm.yy.", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.hr) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.hu = { | |
closeText: "bezárás", | |
prevText: "« vissza", | |
nextText: "elÅ‘re »", | |
currentText: "ma", | |
monthNames: ["Január", "Február", "Március", "Ãprilis", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], | |
monthNamesShort: ["Jan", "Feb", "Már", "Ãpr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec"], | |
dayNames: ["Vasámap", "Hétfö", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"], | |
dayNamesShort: ["Vas", "Hét", "Ked", "Sze", "Csü", "Pén", "Szo"], | |
dayNamesMin: ["V", "H", "K", "Sze", "Cs", "P", "Szo"], | |
dateFormat: "yy-mm-dd", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.hu) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.hy = { | |
closeText: "Õ“Õ¡Õ¯Õ¥Õ¬", | |
prevText: "<Õ†Õ¡Õ.", | |
nextText: "Õ€Õ¡Õ».>", | |
currentText: "Ô±ÕµÕ½Ö…Ö€", | |
monthNames: ["Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€", "Õ“Õ¥Õ¿Ö€Õ¾Õ¡Ö€", "Õ„Õ¡Ö€Õ¿", "Ô±ÕºÖ€Õ«Õ¬", "Õ„Õ¡ÕµÕ«Õ½", "Õ€Õ¸Ö‚Õ¶Õ«Õ½", "Õ€Õ¸Ö‚Õ¬Õ«Õ½", "Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½", "ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€", "Õ€Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€", "Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€", "Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€"], | |
monthNamesShort: ["Õ€Õ¸Ö‚Õ¶Õ¾", "Õ“Õ¥Õ¿Ö€", "Õ„Õ¡Ö€Õ¿", "Ô±ÕºÖ€", "Õ„Õ¡ÕµÕ«Õ½", "Õ€Õ¸Ö‚Õ¶Õ«Õ½", "Õ€Õ¸Ö‚Õ¬", "Õ•Õ£Õ½", "ÕÕ¥Õº", "Õ€Õ¸Õ¯", "Õ†Õ¸Õµ", "Ô´Õ¥Õ¯"], | |
dayNames: ["Õ¯Õ«Ö€Õ¡Õ¯Õ«", "Õ¥Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«", "Õ¥Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«", "Õ¹Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«", "Õ°Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«", "Õ¸Ö‚Ö€Õ¢Õ¡Õ©", "Õ·Õ¡Õ¢Õ¡Õ©"], | |
dayNamesShort: ["Õ¯Õ«Ö€", "Õ¥Ö€Õ¯", "Õ¥Ö€Ö„", "Õ¹Ö€Ö„", "Õ°Õ¶Õ£", "Õ¸Ö‚Ö€Õ¢", "Õ·Õ¢Õ©"], | |
dayNamesMin: ["Õ¯Õ«Ö€", "Õ¥Ö€Õ¯", "Õ¥Ö€Ö„", "Õ¹Ö€Ö„", "Õ°Õ¶Õ£", "Õ¸Ö‚Ö€Õ¢", "Õ·Õ¢Õ©"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.hy) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.id = { | |
closeText: "Tutup", | |
prevText: "<mundur", | |
nextText: "maju>", | |
currentText: "hari ini", | |
monthNames: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "Nopember", "Desember"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agus", "Sep", "Okt", "Nop", "Des"], | |
dayNames: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], | |
dayNamesShort: ["Min", "Sen", "Sel", "Rab", "kam", "Jum", "Sab"], | |
dayNamesMin: ["Mg", "Sn", "Sl", "Rb", "Km", "jm", "Sb"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.id) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.is = { | |
closeText: "Loka", | |
prevText: "< Fyrri", | |
nextText: "Næsti >", | |
currentText: "Í dag", | |
monthNames: ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maí", "Jún", "Júl", "Ágú", "Sep", "Okt", "Nóv", "Des"], | |
dayNames: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"], | |
dayNamesShort: ["Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau"], | |
dayNamesMin: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.is) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.it = { | |
closeText: "Chiudi", | |
prevText: "<Prec", | |
nextText: "Succ>", | |
currentText: "Oggi", | |
monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], | |
monthNamesShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], | |
dayNames: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], | |
dayNamesShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], | |
dayNamesMin: ["Do", "Lu", "Ma", "Me", "Gio", "Ve", "Sa"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.it) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.ja = { | |
closeText: "é–‰ã˜ã‚‹", | |
prevText: "<å‰", | |
nextText: "次>", | |
currentText: "今日", | |
monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], | |
monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], | |
dayNames: ["日曜日", "月曜日", "ç«æ›œæ—¥", "水曜日", "木曜日", "金曜日", "土曜日"], | |
dayNamesShort: ["æ—¥", "月", "ç«", "æ°´", "木", "金", "土"], | |
dayNamesMin: ["æ—¥", "月", "ç«", "æ°´", "木", "金", "土"], | |
dateFormat: "yy/mm/dd", | |
firstDay: 0, | |
isRTL: false, | |
showMonthAfterYear: true | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ja) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.ko = { | |
closeText: "닫기", | |
prevText: "ì´ì „달", | |
nextText: "다ìŒë‹¬", | |
currentText: "오늘", | |
monthNames: ["1ì›”(JAN)", "2ì›”(FEB)", "3ì›”(MAR)", "4ì›”(APR)", "5ì›”(MAY)", "6ì›”(JUN)", "7ì›”(JUL)", "8ì›”(AUG)", "9ì›”(SEP)", "10ì›”(OCT)", "11ì›”(NOV)", "12ì›”(DEC)"], | |
monthNamesShort: ["1ì›”(JAN)", "2ì›”(FEB)", "3ì›”(MAR)", "4ì›”(APR)", "5ì›”(MAY)", "6ì›”(JUN)", "7ì›”(JUL)", "8ì›”(AUG)", "9ì›”(SEP)", "10ì›”(OCT)", "11ì›”(NOV)", "12ì›”(DEC)"], | |
dayNames: ["ì¼", "ì›”", "í™”", "수", "목", "금", "í† "], | |
dayNamesShort: ["ì¼", "ì›”", "í™”", "수", "목", "금", "í† "], | |
dayNamesMin: ["ì¼", "ì›”", "í™”", "수", "목", "금", "í† "], | |
dateFormat: "yy-mm-dd", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ko) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.lt = { | |
closeText: "Uždaryti", | |
prevText: "<Atgal", | |
nextText: "Pirmyn>", | |
currentText: "Å iandien", | |
monthNames: ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"], | |
monthNamesShort: ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugp", "Rugs", "Spa", "Lap", "Gru"], | |
dayNames: ["sekmadienis", "pirmadienis", "antradienis", "treÄiadienis", "ketvirtadienis", "penktadienis", "Å¡eÅ¡tadienis"], | |
dayNamesShort: ["sek", "pir", "ant", "tre", "ket", "pen", "šeš"], | |
dayNamesMin: ["Se", "Pr", "An", "Tr", "Ke", "Pe", "Å e"], | |
dateFormat: "yy-mm-dd", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.lt) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.lv = { | |
closeText: "Aizvērt", | |
prevText: "Iepr", | |
nextText: "NÄka", | |
currentText: "Å odien", | |
monthNames: ["JanvÄris", "FebruÄris", "Marts", "AprÄ«lis", "Maijs", "JÅ«nijs", "JÅ«lijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "JÅ«n", "JÅ«l", "Aug", "Sep", "Okt", "Nov", "Dec"], | |
dayNames: ["svētdiena", "pirmdiena", "otrdiena", "trešdiena", "ceturtdiena", "piektdiena", "sestdiena"], | |
dayNamesShort: ["svt", "prm", "otr", "tre", "ctr", "pkt", "sst"], | |
dayNamesMin: ["Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "Ss"], | |
dateFormat: "dd-mm-yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.lv) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.ms = { | |
closeText: "Tutup", | |
prevText: "<Sebelum", | |
nextText: "Selepas>", | |
currentText: "hari ini", | |
monthNames: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"], | |
monthNamesShort: ["Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"], | |
dayNames: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu"], | |
dayNamesShort: ["Aha", "Isn", "Sel", "Rab", "kha", "Jum", "Sab"], | |
dayNamesMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ms) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.nl = { | |
closeText: "Sluiten", | |
prevText: "â†", | |
nextText: "→", | |
currentText: "Vandaag", | |
monthNames: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], | |
monthNamesShort: ["jan", "feb", "maa", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], | |
dayNames: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], | |
dayNamesShort: ["zon", "maa", "din", "woe", "don", "vri", "zat"], | |
dayNamesMin: ["zo", "ma", "di", "wo", "do", "vr", "za"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.nl) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.no = { | |
closeText: "Lukk", | |
prevText: "«Forrige", | |
nextText: "Neste»", | |
currentText: "I dag", | |
monthNames: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], | |
dayNamesShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"], | |
dayNames: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], | |
dayNamesMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"], | |
dateFormat: "yy-mm-dd", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.no) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.pl = { | |
closeText: "Zamknij", | |
prevText: "<Poprzedni", | |
nextText: "Następny>", | |
currentText: "DziÅ›", | |
monthNames: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], | |
monthNamesShort: ["Sty", "Lu", "Mar", "Kw", "Maj", "Cze", "Lip", "Sie", "Wrz", "Pa", "Lis", "Gru"], | |
dayNames: ["Niedziela", "Poniedzialek", "Wtorek", "Åšroda", "Czwartek", "PiÄ…tek", "Sobota"], | |
dayNamesShort: ["Nie", "Pn", "Wt", "Åšr", "Czw", "Pt", "So"], | |
dayNamesMin: ["N", "Pn", "Wt", "Åšr", "Cz", "Pt", "So"], | |
dateFormat: "yy-mm-dd", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.pl) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional["pt-BR"] = { | |
closeText: "Fechar", | |
prevText: "<Anterior", | |
nextText: "Próximo>", | |
currentText: "Hoje", | |
monthNames: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], | |
monthNamesShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], | |
dayNames: ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sabado"], | |
dayNamesShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"], | |
dayNamesMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional["pt-BR"]) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.ro = { | |
closeText: "Inchide", | |
prevText: "<Anterior", | |
nextText: "Urmator>", | |
currentText: "Azi", | |
monthNames: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Junie", "Julie", "August", "Septembrie", "Octobrie", "Noiembrie", "Decembrie"], | |
monthNamesShort: ["Ian", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Oct", "Noi", "Dec"], | |
dayNames: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], | |
dayNamesShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sam"], | |
dayNamesMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"], | |
dateFormat: "mm/dd/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ro) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.ru = { | |
closeText: "Закрыть", | |
prevText: "<Пред", | |
nextText: "След>", | |
currentText: "СегоднÑ", | |
monthNames: ["Январь", "Февраль", "Март", "Ðпрель", "Май", "Июнь", "Июль", "ÐвгуÑÑ‚", "СентÑбрь", "ОктÑбрь", "ÐоÑбрь", "Декабрь"], | |
monthNamesShort: ["Янв", "Фев", "Мар", "Ðпр", "Май", "Июн", "Июл", "Ðвг", "Сен", "Окт", "ÐоÑ", "Дек"], | |
dayNames: ["воÑкреÑенье", "понедельник", "вторник", "Ñреда", "четверг", "пÑтница", "Ñуббота"], | |
dayNamesShort: ["вÑк", "пнд", "втр", "Ñрд", "чтв", "птн", "Ñбт"], | |
dayNamesMin: ["Ð’Ñ", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.ru) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.sk = { | |
closeText: "Zavrieť", | |
prevText: "<Predchádzajúci", | |
nextText: "Nasledujúci>", | |
currentText: "Dnes", | |
monthNames: ["Január", "Február", "Marec", "AprÃl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], | |
dayNames: ["Nedel'a", "Pondelok", "Utorok", "Streda", "Å tvrtok", "Piatok", "Sobota"], | |
dayNamesShort: ["Ned", "Pon", "Uto", "Str", "Å tv", "Pia", "Sob"], | |
dayNamesMin: ["Ne", "Po", "Ut", "St", "Å t", "Pia", "So"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.sk) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.sl = { | |
closeText: "Zapri", | |
prevText: "<Prejšnji", | |
nextText: "Naslednji>", | |
currentText: "Trenutni", | |
monthNames: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"], | |
dayNames: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], | |
dayNamesShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"], | |
dayNamesMin: ["Ne", "Po", "To", "Sr", "Če", "Pe", "So"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.sl) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.sq = { | |
closeText: "mbylle", | |
prevText: "<mbrapa", | |
nextText: "Përpara>", | |
currentText: "sot", | |
monthNames: ["Janar", "Shkurt", "Mars", "Pril", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"], | |
monthNamesShort: ["Jan", "Shk", "Mar", "Pri", "Maj", "Qer", "Kor", "Gus", "Sht", "Tet", "Nën", "Dhj"], | |
dayNames: ["E Diel", "E Hënë", "E Martë", "E Mërkurë", "E Enjte", "E Premte", "E Shtune"], | |
dayNamesShort: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sh"], | |
dayNamesMin: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sh"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.sq) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional["sr-SR"] = { | |
closeText: "Zatvori", | |
prevText: "<", | |
nextText: ">", | |
currentText: "Danas", | |
monthNames: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"], | |
dayNames: ["Nedelja", "Ponedeljak", "Utorak", "Sreda", "ÄŒetvrtak", "Petak", "Subota"], | |
dayNamesShort: ["Ned", "Pon", "Uto", "Sre", "ÄŒet", "Pet", "Sub"], | |
dayNamesMin: ["Ne", "Po", "Ut", "Sr", "ÄŒe", "Pe", "Su"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional["sr-SR"]) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.sr = { | |
closeText: "Затвори", | |
prevText: "<", | |
nextText: ">", | |
currentText: "ДанаÑ", | |
monthNames: ["Јануар", "Фебруар", "Март", "Ðприл", "Мај", "Јун", "Јул", "ÐвгуÑÑ‚", "Септембар", "Октобар", "Ðовембар", "Децембар"], | |
monthNamesShort: ["Јан", "Феб", "Мар", "Ðпр", "Мај", "Јун", "Јул", "Ðвг", "Сеп", "Окт", "Ðов", "Дец"], | |
dayNames: ["Ðедеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"], | |
dayNamesShort: ["Ðед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб"], | |
dayNamesMin: ["Ðе", "По", "Ут", "Ср", "Че", "Пе", "Су"], | |
dateFormat: "dd/mm/yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.sr) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.sv = { | |
closeText: "Stäng", | |
prevText: "«Förra", | |
nextText: "Nästa»", | |
currentText: "Idag", | |
monthNames: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], | |
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], | |
dayNamesShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"], | |
dayNames: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], | |
dayNamesMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö"], | |
dateFormat: "yy-mm-dd", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.sv) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.th = { | |
closeText: "ปิด", | |
prevText: "« ย้à¸à¸™", | |
nextText: "ถัดไป »", | |
currentText: "วันนี้", | |
monthNames: ["มà¸à¸£à¸²à¸„ม", "à¸à¸¸à¸¡à¸ าพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "à¸à¸£à¸à¸à¸²à¸„ม", "สิงหาคม", "à¸à¸±à¸™à¸¢à¸²à¸¢à¸™", "ตุลาคม", "พฤศจิà¸à¸²à¸¢à¸™", "ธันวาคม"], | |
monthNamesShort: ["ม.ค.", "à¸.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "à¸.ค.", "ส.ค.", "à¸.ย.", "ต.ค.", "พ.ย.", "ธ.ค."], | |
dayNames: ["à¸à¸²à¸—ิตย์", "จันทร์", "à¸à¸±à¸‡à¸„าร", "พุธ", "พฤหัสบดี", "ศุà¸à¸£à¹Œ", "เสาร์"], | |
dayNamesShort: ["à¸à¸².", "จ.", "à¸.", "พ.", "พฤ.", "ศ.", "ส."], | |
dayNamesMin: ["à¸à¸².", "จ.", "à¸.", "พ.", "พฤ.", "ศ.", "ส."], | |
dateFormat: "dd/mm/yy", | |
firstDay: 0, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.th) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.tr = { | |
closeText: "kapat", | |
prevText: "<geri", | |
nextText: "ileri>", | |
currentText: "bugün", | |
monthNames: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], | |
monthNamesShort: ["Oca", "Åžub", "Mar", "Nis", "May", "Haz", "Tem", "AÄŸu", "Eyl", "Eki", "Kas", "Ara"], | |
dayNames: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], | |
dayNamesShort: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"], | |
dayNamesMin: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.tr) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional.uk = { | |
closeText: "Закрити", | |
prevText: "<", | |
nextText: ">", | |
currentText: "Сьогодні", | |
monthNames: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "ВереÑень", "Жовтень", "ЛиÑтопад", "Грудень"], | |
monthNamesShort: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "ЛиÑ", "Гру"], | |
dayNames: ["неділÑ", "понеділок", "вівторок", "Ñереда", "четвер", "пÑтницÑ", "Ñуббота"], | |
dayNamesShort: ["нед", "пнд", "вів", "Ñрд", "чтв", "птн", "Ñбт"], | |
dayNamesMin: ["Ðд", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб"], | |
dateFormat: "dd.mm.yy", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional.uk) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional["zh-CN"] = { | |
closeText: "å…³é—", | |
prevText: "<上月", | |
nextText: "下月>", | |
currentText: "今天", | |
monthNames: ["一月", "二月", "三月", "四月", "五月", "å…月", "七月", "八月", "ä¹æœˆ", "å月", "å一月", "å二月"], | |
monthNamesShort: ["一", "二", "三", "å››", "五", "å…", "七", "å…«", "ä¹", "å", "å一", "å二"], | |
dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期å…"], | |
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周å…"], | |
dayNamesMin: ["æ—¥", "一", "二", "三", "å››", "五", "å…"], | |
dateFormat: "yy-mm-dd", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional["zh-CN"]) | |
}); | |
jQuery(function(a) { | |
a.datepicker.regional["zh-TW"] = { | |
closeText: "關閉", | |
prevText: "<上月", | |
nextText: "下月>", | |
currentText: "今天", | |
monthNames: ["一月", "二月", "三月", "四月", "五月", "å…月", "七月", "八月", "ä¹æœˆ", "å月", "å一月", "å二月"], | |
monthNamesShort: ["一", "二", "三", "å››", "五", "å…", "七", "å…«", "ä¹", "å", "å一", "å二"], | |
dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期å…"], | |
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周å…"], | |
dayNamesMin: ["æ—¥", "一", "二", "三", "å››", "五", "å…"], | |
dateFormat: "yy/mm/dd", | |
firstDay: 1, | |
isRTL: false | |
}; | |
a.datepicker.setDefaults(a.datepicker.regional["zh-TW"]) | |
}); | |
/*! | |
* jQuery Tooltip plugin 1.3 | |
* | |
* http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ | |
* http://docs.jquery.com/Plugins/Tooltip | |
* | |
* Copyright (c) 2006 - 2008 Jörn Zaefferer | |
* | |
* $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $ | |
* | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
*/ | |
; | |
(function(f) { | |
function o() { | |
if (!f.browser.msie7) { | |
return 1 | |
} | |
if (!document.body.getBoundingClientRect) { | |
return 1 | |
} | |
var t = document.body.getBoundingClientRect(); | |
var u = t.right - t.left; | |
var s = document.body.offsetWidth; | |
return Math.round((u / s) * 100) / 100 | |
} | |
function d(s) { | |
return Math.round(s / o()) | |
} | |
var b = {}, | |
m, p, r, l = f.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent), | |
a = false; | |
f.tooltip = { | |
enabled: false, | |
blocked: false, | |
defaults: { | |
delay: 200, | |
fade: false, | |
showURL: false, | |
extraClass: "", | |
top: 15, | |
left: 15, | |
id: "tooltip" | |
}, | |
block: function() { | |
f.tooltip.blocked = !f.tooltip.blocked | |
}, | |
enable: function(s) { | |
if (s == null) { | |
s = true | |
} | |
f.tooltip.enabled = s | |
} | |
}; | |
f.fn.extend({ | |
tooltip: function(s) { | |
s = f.extend({}, f.tooltip.defaults, s); | |
if (!f.tooltip.enabled) { | |
return | |
} | |
j(s); | |
f("#" + s.id).hide(); | |
return this.each(function() { | |
f.data(this, "tooltip", s); | |
this.tOpacity = b.parent.css("opacity"); | |
this.tooltipText = this.title; | |
f(this).removeAttr("title"); | |
if (this.alt) { | |
this.alt = "" | |
} | |
}).mouseover(n).mouseout(g).click(g) | |
}, | |
fixPNG: l ? function() { | |
return this.each(function() { | |
var s = f(this).css("backgroundImage"); | |
if (s.match(/^url\(["']?(.*\.png)["']?\)$/i)) { | |
s = RegExp.$1; | |
f(this).css({ | |
backgroundImage: "none", | |
filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + s + "')" | |
}).each(function() { | |
var t = f(this).css("position"); | |
if (t != "absolute" && t != "relative") { | |
f(this).css("position", "relative") | |
} | |
}) | |
} | |
}) | |
} : function() { | |
return this | |
}, | |
unfixPNG: l ? function() { | |
return this.each(function() { | |
f(this).css({ | |
filter: "", | |
backgroundImage: "" | |
}) | |
}) | |
} : function() { | |
return this | |
}, | |
hideWhenEmpty: function() { | |
return this.each(function() { | |
f(this)[f(this).html() ? "show" : "hide"]() | |
}) | |
}, | |
url: function() { | |
return this.attr("href") || this.attr("src") | |
} | |
}); | |
function j(s) { | |
if (b.parent) { | |
return | |
} | |
b.parent = f('<div id="' + s.id + '"><div><div id="background"><img src="/images/framework/tooltip_bg.png"></div><div id="content"><h3></h3><div class="body"></div><div class="url"></div></div></div></div>').appendTo(document.body).hide(); | |
if (f.fn.bgiframe) { | |
b.parent.bgiframe() | |
} | |
b.title = f("h3", b.parent); | |
b.body = f("div.body", b.parent); | |
b.url = f("div.url", b.parent) | |
} | |
function c(s) { | |
return f.data(s, "tooltip") || {} | |
} | |
function h(s) { | |
if (c(this).delay) { | |
r = setTimeout(q, c(this).delay) | |
} else { | |
q() | |
} | |
a = !!c(this).track; | |
f(document.body).bind("mousemove", e); | |
e(s) | |
} | |
function n() { | |
if (f.tooltip.blocked || this == m || (!this.tooltipText && !c(this).bodyHandler)) { | |
return | |
} | |
m = this; | |
p = this.tooltipText; | |
if (c(this).bodyHandler) { | |
b.title.hide(); | |
var v = c(this).bodyHandler.call(this); | |
if (v.nodeType || v.jquery) { | |
b.body.empty().append(v) | |
} else { | |
b.body.html(v) | |
} | |
b.body.show() | |
} else { | |
if (c(this).showBody) { | |
var u = p.split(c(this).showBody); | |
b.title.html(u.shift()).show(); | |
b.body.empty(); | |
for (var t = 0, s; | |
(s = u[t]); t++) { | |
if (t > 0) { | |
b.body.append("<br/>") | |
} | |
b.body.append(s) | |
} | |
b.body.hideWhenEmpty() | |
} else { | |
b.title.html(p).show(); | |
b.body.hide() | |
} | |
} | |
if (c(this).showURL && f(this).url()) { | |
b.url.html(f(this).url().replace("http://", "")).show() | |
} else { | |
b.url.hide() | |
} | |
b.parent.addClass(c(this).extraClass); | |
if (c(this).fixPNG) { | |
b.parent.fixPNG() | |
} | |
h.apply(this, arguments) | |
} | |
function q() { | |
r = null; | |
if ((!l || !f.fn.bgiframe) && c(m).fade) { | |
if (b.parent.is(":animated")) { | |
b.parent.stop().show().fadeTo(c(m).fade, m.tOpacity) | |
} else { | |
b.parent.is(":visible") ? b.parent.fadeTo(c(m).fade, m.tOpacity) : b.parent.fadeIn(c(m).fade) | |
} | |
} else { | |
b.parent.show() | |
} | |
e() | |
} | |
function e(w) { | |
if (f.tooltip.blocked) { | |
return | |
} | |
if (w && w.target.tagName == "OPTION") { | |
return | |
} | |
if (!a && b.parent.is(":visible")) { | |
f(document.body).unbind("mousemove", e) | |
} | |
if (m == null) { | |
f(document.body).unbind("mousemove", e); | |
return | |
} | |
b.parent.removeClass("viewport-right").removeClass("viewport-bottom"); | |
var y = d(b.parent[0].offsetLeft); | |
var x = d(b.parent[0].offsetTop); | |
if (w) { | |
y = d(w.pageX) + c(m).left; | |
x = d(w.pageY) + c(m).top; | |
var t = "auto"; | |
if (c(m).positionLeft || f("body").hasClass("rtl")) { | |
t = f(window).width() - y; | |
if (f.browser.msie7) { | |
y = f(window).width() - t - 250 | |
} else { | |
y = "auto" | |
} | |
} | |
if (f.browser.msie && document.documentMode >= 9 && w.pageX == 0 && w.pageY == 0) { | |
return | |
} | |
b.parent.css({ | |
left: y, | |
right: t, | |
top: x | |
}) | |
} | |
var s = k(), | |
u = b.parent[0]; | |
if (s.x + s.cx < d(u.offsetLeft) + d(u.offsetWidth)) { | |
y -= d(u.offsetWidth) + 20 + c(m).left; | |
if (f.browser.msie7 && y < s.x) { | |
y = s.x | |
} | |
b.parent.css({ | |
left: y + "px" | |
}).addClass("viewport-right") | |
} | |
if (s.y + s.cy < d(u.offsetTop) + d(u.offsetHeight)) { | |
x -= d(u.offsetHeight) + 20 + c(m).top; | |
b.parent.css({ | |
top: x + "px" | |
}).addClass("viewport-bottom") | |
} | |
if (f.browser.msie7) { | |
if (f("#tooltip-fudge-div").length == 0) { | |
f("body").append("<div id='tooltip-fudge-div' style='display: none;'></div>") | |
} | |
f("#tooltip-fudge-div").html(" ") | |
} | |
} | |
function k() { | |
return { | |
x: f(window).scrollLeft(), | |
y: f(window).scrollTop(), | |
cx: f(window).width(), | |
cy: f(window).height() | |
} | |
} | |
function g(u) { | |
if (f.tooltip.blocked) { | |
return | |
} | |
if (r) { | |
clearTimeout(r) | |
} | |
m = null; | |
var t = c(this); | |
function s() { | |
b.parent.removeClass(t.extraClass).hide().css("opacity", "") | |
} | |
if ((!l || !f.fn.bgiframe) && t.fade) { | |
if (b.parent.is(":animated")) { | |
b.parent.stop().fadeTo(t.fade, 0, s) | |
} else { | |
b.parent.stop().fadeOut(t.fade, s) | |
} | |
} else { | |
s() | |
} | |
if (c(this).fixPNG) { | |
b.parent.unfixPNG() | |
} | |
} | |
})(jQuery); | |
/*! | |
* | |
* TableSorter 2.0 - Client-side table sorting with ease! | |
* Version 2.0.3 | |
* @requires jQuery v1.2.3 | |
* | |
* Copyright (c) 2007 Christian Bach | |
* Examples and docs at: http://tablesorter.com | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
* | |
*/ | |
(function($) { | |
$.extend({ | |
tablesorter: new function() { | |
var parsers = [], | |
widgets = []; | |
this.defaults = { | |
cssHeader: "header", | |
cssAsc: "headerSortUp", | |
cssDesc: "headerSortDown", | |
sortInitialOrder: "asc", | |
sortMultiSortKey: "shiftKey", | |
sortForce: null, | |
sortAppend: null, | |
textExtraction: "simple", | |
parsers: {}, | |
widgets: [], | |
widgetZebra: { | |
css: ["gui-list-tbl-even-row", "gui-list-tbl-odd-row"] | |
}, | |
headers: {}, | |
widthFixed: false, | |
cancelSelection: true, | |
sortList: [], | |
headerList: [], | |
dateFormat: "us", | |
decimal: ".", | |
debug: false | |
}; | |
function benchmark(s, d) { | |
log(s + "," + (new Date().getTime() - d.getTime()) + "ms") | |
} | |
this.benchmark = benchmark; | |
function log(s) { | |
if (typeof console != "undefined" && typeof console.debug != "undefined") { | |
console.log(s) | |
} else { | |
alert(s) | |
} | |
} | |
function buildParserCache(table, $headers) { | |
if (table.config.debug) { | |
var parsersDebug = "" | |
} | |
var rows = table.tBodies[0].rows; | |
if (table.tBodies[0].rows[0]) { | |
var list = [], | |
cells = rows[0].cells, | |
l = cells.length; | |
for (var i = 0; i < l; i++) { | |
var p = false; | |
if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) { | |
p = getParserById($($headers[i]).metadata().sorter) | |
} else { | |
if ((table.config.headers[i] && table.config.headers[i].sorter)) { | |
p = getParserById(table.config.headers[i].sorter) | |
} | |
} | |
if (!p) { | |
p = detectParserForColumn(table, i) | |
} | |
if (table.config.debug) { | |
parsersDebug += "column:" + i + " parser:" + p.id + "\n" | |
} | |
list.push(p) | |
} | |
} | |
if (table.config.debug) { | |
log(parsersDebug) | |
} | |
return list | |
} | |
function detectParserForColumn(table, col) { | |
var l = parsers.length; | |
var colParser; | |
for (var row = 0; row < table.tBodies[0].rows.length; row++) { | |
var cellParser = null; | |
for (var i = 1; i < l; i++) { | |
if (parsers[i].is($.trim(getElementText(table.config, table.tBodies[0].rows[row].cells[col])), table, table.tBodies[0].rows[row].cells[col])) { | |
cellParser = parsers[i]; | |
break | |
} | |
} | |
if (!cellParser) { | |
return parsers[0] | |
} else { | |
if (!colParser) { | |
colParser = cellParser | |
} else { | |
if (colParser != cellParser) { | |
return parsers[0] | |
} | |
} | |
} | |
} | |
return colParser | |
} | |
function getParserById(name) { | |
var l = parsers.length; | |
for (var i = 0; i < l; i++) { | |
if (parsers[i].id.toLowerCase() == name.toLowerCase()) { | |
return parsers[i] | |
} | |
} | |
return false | |
} | |
function buildCache(table) { | |
if (table.config.debug) { | |
var cacheTime = new Date() | |
} | |
var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0, | |
totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0, | |
parsers = table.config.parsers, | |
cache = { | |
row: [], | |
normalized: [] | |
}; | |
for (var i = 0; i < totalRows; ++i) { | |
var c = table.tBodies[0].rows[i], | |
cols = []; | |
cache.row.push($(c)); | |
for (var j = 0; j < totalCells; ++j) { | |
cols.push(parsers[j].format(getElementText(table.config, c.cells[j]), table, c.cells[j])) | |
} | |
cols.push(i); | |
cache.normalized.push(cols); | |
cols = null | |
} | |
if (table.config.debug) { | |
benchmark("Building cache for " + totalRows + " rows:", cacheTime) | |
} | |
return cache | |
} | |
function getElementText(config, node) { | |
if (!node) { | |
return "" | |
} | |
var t = ""; | |
if (config.textExtraction == "simple") { | |
if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) { | |
t = node.childNodes[0].innerHTML | |
} else { | |
t = node.innerHTML | |
} | |
} else { | |
if (typeof(config.textExtraction) == "function") { | |
t = config.textExtraction(node) | |
} else { | |
t = $(node).text() | |
} | |
} | |
return t | |
} | |
function appendToTable(table, cache) { | |
if (table.config.debug) { | |
var appendTime = new Date() | |
} | |
var c = cache, | |
r = c.row, | |
n = c.normalized, | |
totalRows = n.length, | |
checkCell = (n[0].length - 1), | |
tableBody = $(table.tBodies[0]), | |
rows = []; | |
for (var i = 0; i < totalRows; i++) { | |
rows.push(r[n[i][checkCell]]); | |
if (!table.config.appender) { | |
var o = r[n[i][checkCell]]; | |
var l = o.length; | |
for (var j = 0; j < l; j++) { | |
tableBody[0].appendChild(o[j]) | |
} | |
} | |
} | |
if (table.config.appender) { | |
table.config.appender(table, rows) | |
} | |
rows = null; | |
if (table.config.debug) { | |
benchmark("Rebuilt table:", appendTime) | |
} | |
applyWidget(table); | |
setTimeout(function() { | |
$(table).trigger("sortEnd") | |
}, 0) | |
} | |
function buildHeaders(table) { | |
if (table.config.debug) { | |
var time = new Date() | |
} | |
var meta = ($.metadata) ? true : false, | |
tableHeadersRows = []; | |
for (var i = 0; i < table.tHead.rows.length; i++) { | |
tableHeadersRows[i] = 0 | |
} | |
$tableHeaders = $("thead th", table); | |
$tableHeaders.each(function(index) { | |
this.count = 0; | |
this.column = index; | |
this.order = formatSortingOrder(table.config.sortInitialOrder); | |
if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) { | |
this.sortDisabled = true | |
} | |
if (!this.sortDisabled) { | |
$(this).addClass(table.config.cssHeader) | |
} | |
table.config.headerList[index] = this | |
}); | |
if (table.config.debug) { | |
benchmark("Built headers:", time); | |
log($tableHeaders) | |
} | |
return $tableHeaders | |
} | |
function checkCellColSpan(table, rows, row) { | |
var arr = [], | |
r = table.tHead.rows, | |
c = r[row].cells; | |
for (var i = 0; i < c.length; i++) { | |
var cell = c[i]; | |
if (cell.colSpan > 1) { | |
arr = arr.concat(checkCellColSpan(table, headerArr, row++)) | |
} else { | |
if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) { | |
arr.push(cell) | |
} | |
} | |
} | |
return arr | |
} | |
function checkHeaderMetadata(cell) { | |
if (($.metadata) && ($(cell).metadata().sorter === false)) { | |
return true | |
} | |
return false | |
} | |
function checkHeaderOptions(table, i) { | |
if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { | |
return true | |
} | |
return false | |
} | |
function applyWidget(table) { | |
var c = table.config.widgets; | |
var l = c.length; | |
for (var i = 0; i < l; i++) { | |
getWidgetById(c[i]).format(table) | |
} | |
} | |
function getWidgetById(name) { | |
var l = widgets.length; | |
for (var i = 0; i < l; i++) { | |
if (widgets[i].id.toLowerCase() == name.toLowerCase()) { | |
return widgets[i] | |
} | |
} | |
} | |
function formatSortingOrder(v) { | |
if (typeof(v) != "Number") { | |
i = (v.toLowerCase() == "desc") ? 1 : 0 | |
} else { | |
i = (v == (0 || 1)) ? v : 0 | |
} | |
return i | |
} | |
function isValueInArray(v, a) { | |
var l = a.length; | |
for (var i = 0; i < l; i++) { | |
if (a[i][0] == v) { | |
return true | |
} | |
} | |
return false | |
} | |
function setHeadersCss(table, $headers, list, css) { | |
$headers.removeClass(css[0]).removeClass(css[1]); | |
var h = []; | |
$headers.each(function(offset) { | |
if (!this.sortDisabled) { | |
h[this.column] = $(this) | |
} | |
}); | |
var l = list.length; | |
for (var i = 0; i < l; i++) { | |
h[list[i][0]].addClass(css[list[i][1]]) | |
} | |
} | |
function fixColumnWidth(table, $headers) { | |
var c = table.config; | |
if (c.widthFixed) { | |
var colgroup = $("<colgroup>"); | |
$("tr:first td", table.tBodies[0]).each(function() { | |
colgroup.append($("<col>").css("width", $(this).width())) | |
}); | |
$(table).prepend(colgroup) | |
} | |
} | |
function updateHeaderSortCount(table, sortList) { | |
var c = table.config, | |
l = sortList.length; | |
for (var i = 0; i < l; i++) { | |
var s = sortList[i], | |
o = c.headerList[s[0]]; | |
o.count = s[1]; | |
o.count++ | |
} | |
} | |
function multisort(table, sortList, cache) { | |
if (table.config.debug) { | |
var sortTime = new Date() | |
} | |
var dynamicExp = "var sortWrapper = function(a,b) {", | |
l = sortList.length; | |
for (var i = 0; i < l; i++) { | |
var c = sortList[i][0]; | |
var order = sortList[i][1]; | |
var s = (getCachedSortType(table.config.parsers, c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc"); | |
var e = "e" + i; | |
dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); "; | |
dynamicExp += "if(" + e + ") { return " + e + "; } "; | |
dynamicExp += "else { " | |
} | |
var orgOrderCol = cache.normalized[0].length - 1; | |
dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];"; | |
for (var i = 0; i < l; i++) { | |
dynamicExp += "}; " | |
} | |
dynamicExp += "return 0; "; | |
dynamicExp += "}; "; | |
eval(dynamicExp); | |
cache.normalized.sort(sortWrapper); | |
if (table.config.debug) { | |
benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime) | |
} | |
return cache | |
} | |
function sortText(a, b) { | |
if (a == null || a == " ") { | |
return (1) | |
} else { | |
if (b == null || b == " ") { | |
return (-1) | |
} else { | |
return ((a < b) ? -1 : ((a > b) ? 1 : 0)) | |
} | |
} | |
} | |
function sortTextDesc(a, b) { | |
if (a == null || a == " ") { | |
return (1) | |
} else { | |
if (b == null || b == " ") { | |
return (-1) | |
} else { | |
return ((b < a) ? -1 : ((b > a) ? 1 : 0)) | |
} | |
} | |
} | |
function sortNumeric(a, b) { | |
if (a == null || a == " " || a == 0) { | |
return (1) | |
} else { | |
if (b == null || b == " " || b == 0) { | |
return (-1) | |
} else { | |
return a - b | |
} | |
} | |
} | |
function sortNumericDesc(a, b) { | |
if (a == null || a == " " || a == 0) { | |
return (1) | |
} else { | |
if (b == null || b == " " || b == 0) { | |
return (-1) | |
} else { | |
return b - a | |
} | |
} | |
} | |
function getCachedSortType(parsers, i) { | |
return parsers[i].type | |
} | |
this.construct = function(settings) { | |
return this.each(function() { | |
if (!this.tHead || !this.tBodies) { | |
return | |
} | |
var $this, $document, $headers, cache, config, shiftDown = 0, | |
sortOrder; | |
this.config = {}; | |
config = $.extend(this.config, $.tablesorter.defaults, settings); | |
$this = $(this); | |
$this.addClass("gui-sortable"); | |
$headers = buildHeaders(this); | |
this.config.parsers = buildParserCache(this, $headers); | |
cache = buildCache(this); | |
var sortCSS = [config.cssDesc, config.cssAsc]; | |
fixColumnWidth(this); | |
$headers.click(function(e) { | |
$this.trigger("sortStart"); | |
var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; | |
if (!this.sortDisabled && totalRows > 0) { | |
var $cell = $(this); | |
var i = this.column; | |
this.order = this.count++ % 2; | |
if (!e[config.sortMultiSortKey]) { | |
config.sortList = []; | |
if (config.sortForce != null) { | |
var a = config.sortForce; | |
for (var j = 0; j < a.length; j++) { | |
if (a[j][0] != i) { | |
config.sortList.push(a[j]) | |
} | |
} | |
} | |
config.sortList.push([i, this.order]) | |
} else { | |
if (isValueInArray(i, config.sortList)) { | |
for (var j = 0; j < config.sortList.length; j++) { | |
var s = config.sortList[j], | |
o = config.headerList[s[0]]; | |
if (s[0] == i) { | |
o.count = s[1]; | |
o.count++; | |
s[1] = o.count % 2 | |
} | |
} | |
} else { | |
config.sortList.push([i, this.order]) | |
} | |
} | |
setTimeout(function() { | |
setHeadersCss($this[0], $headers, config.sortList, sortCSS); | |
appendToTable($this[0], multisort($this[0], config.sortList, cache)) | |
}, 1); | |
return false | |
} | |
}).mousedown(function() { | |
if (config.cancelSelection) { | |
this.onselectstart = function() { | |
return false | |
}; | |
return false | |
} | |
}); | |
$this.bind("update", function() { | |
this.config.parsers = buildParserCache(this, $headers); | |
cache = buildCache(this) | |
}).bind("sorton", function(e, list) { | |
$(this).trigger("sortStart"); | |
config.sortList = list; | |
var sortList = config.sortList; | |
updateHeaderSortCount(this, sortList); | |
setHeadersCss(this, $headers, sortList, sortCSS); | |
appendToTable(this, multisort(this, sortList, cache)) | |
}).bind("appendCache", function() { | |
appendToTable(this, cache) | |
}).bind("applyWidgetId", function(e, id) { | |
getWidgetById(id).format(this) | |
}).bind("applyWidgets", function() { | |
applyWidget(this) | |
}); | |
if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) { | |
config.sortList = $(this).metadata().sortlist | |
} | |
if (config.sortList.length > 0) { | |
$this.trigger("sorton", [config.sortList]) | |
} | |
applyWidget(this) | |
}) | |
}; | |
this.addParser = function(parser) { | |
var l = parsers.length, | |
a = true; | |
for (var i = 0; i < l; i++) { | |
if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) { | |
a = false | |
} | |
} | |
if (a) { | |
parsers.push(parser) | |
} | |
}; | |
this.addWidget = function(widget) { | |
widgets.push(widget) | |
}; | |
this.formatFloat = function(s) { | |
var i = parseFloat(s); | |
return (isNaN(i)) ? 0 : i | |
}; | |
this.formatInt = function(s) { | |
var i = parseInt(s); | |
return (isNaN(i)) ? 0 : i | |
}; | |
this.isDigit = function(s, config) { | |
var DECIMAL = "\\" + config.decimal; | |
var exp = "/(^[+]?0(" + DECIMAL + "0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)" + DECIMAL + "(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*" + DECIMAL + "0+$)/"; | |
return RegExp(exp).test($.trim(s)) | |
}; | |
this.clearTableBody = function(table) { | |
if ($.browser.msie || $.browser.msie11) { | |
function empty() { | |
while (this.firstChild) { | |
this.removeChild(this.firstChild) | |
} | |
} | |
empty.apply(table.tBodies[0]) | |
} else { | |
table.tBodies[0].innerHTML = "" | |
} | |
} | |
} | |
}); | |
$.fn.extend({ | |
tablesorter: $.tablesorter.construct | |
}); | |
var ts = $.tablesorter; | |
ts.addParser({ | |
id: "text", | |
is: function(s) { | |
return true | |
}, | |
format: function(s) { | |
return $.trim(s.toLowerCase()) | |
}, | |
type: "text" | |
}); | |
ts.addParser({ | |
id: "digit", | |
is: function(s, table) { | |
var c = table.config; | |
return $.tablesorter.isDigit(s, c) | |
}, | |
format: function(s) { | |
return $.tablesorter.formatFloat(s) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "currency", | |
is: function(s) { | |
return /^[£$€?.]/.test(s) | |
}, | |
format: function(s) { | |
return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g), "")) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "ipAddress", | |
is: function(s) { | |
return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s) | |
}, | |
format: function(s) { | |
var a = s.split("."), | |
r = "", | |
l = a.length; | |
for (var i = 0; i < l; i++) { | |
var item = a[i]; | |
if (item.length == 2) { | |
r += "0" + item | |
} else { | |
r += item | |
} | |
} | |
return $.tablesorter.formatFloat(r) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "url", | |
is: function(s) { | |
return /^(https?|ftp|file):\/\//.test(s) | |
}, | |
format: function(s) { | |
return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), "")) | |
}, | |
type: "text" | |
}); | |
ts.addParser({ | |
id: "isoDate", | |
is: function(s) { | |
return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s) | |
}, | |
format: function(s) { | |
return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g), "/")).getTime() : "0") | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "percent", | |
is: function(s) { | |
return /\%$/.test($.trim(s)) | |
}, | |
format: function(s) { | |
return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), "")) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "usLongDate", | |
is: function(s) { | |
return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)) | |
}, | |
format: function(s) { | |
return $.tablesorter.formatFloat(new Date(s).getTime()) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "shortDate", | |
is: function(s) { | |
return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s) | |
}, | |
format: function(s, table) { | |
var c = table.config; | |
s = s.replace(/\-/g, "/"); | |
if (c.dateFormat == "us") { | |
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2") | |
} else { | |
if (c.dateFormat == "uk") { | |
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1") | |
} else { | |
if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") { | |
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3") | |
} | |
} | |
} | |
return $.tablesorter.formatFloat(new Date(s).getTime()) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "time", | |
is: function(s) { | |
return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s) | |
}, | |
format: function(s) { | |
return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime()) | |
}, | |
type: "numeric" | |
}); | |
ts.addParser({ | |
id: "metadata", | |
is: function(s) { | |
return false | |
}, | |
format: function(s, table, cell) { | |
var c = table.config, | |
p = (!c.parserMetadataName) ? "sortValue" : c.parserMetadataName; | |
return $(cell).metadata()[p] | |
}, | |
type: "numeric" | |
}); | |
ts.addWidget({ | |
id: "zebra", | |
format: function(table) { | |
if (table.config.debug) { | |
var time = new Date() | |
} | |
$("tr:visible", table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]); | |
if (table.config.debug) { | |
$.tablesorter.benchmark("Applying Zebra widget", time) | |
} | |
} | |
}) | |
})(jQuery); | |
(function(a) { | |
a.extend({ | |
tablesorterPager: new function() { | |
function b(k, j) { | |
var l = k.config; | |
l.size = j; | |
l.totalPages = Math.ceil(l.totalRows / l.size); | |
l.pagerPositionSet = false | |
} | |
function g(j, k) { | |
var l = j.config; | |
l.page = k - 1; | |
c(j) | |
} | |
function h(j) { | |
var k = j.config; | |
k.page = 0; | |
c(j) | |
} | |
function d(j) { | |
var k = j.config; | |
k.page++; | |
if (k.page >= (k.totalPages - 1)) { | |
k.page = (k.totalPages - 1) | |
} | |
c(j) | |
} | |
function f(j) { | |
var k = j.config; | |
k.page--; | |
if (k.page <= 0) { | |
k.page = 0 | |
} | |
c(j) | |
} | |
function c(j) { | |
var k = j.config; | |
if (k.page < 0 || k.page > (k.totalPages - 1)) { | |
k.page = 0 | |
} | |
if (k.preShowPageCb) { | |
k.preShowPageCb() | |
} | |
e(j, k.rowsCopy); | |
a(k.container).find("a").each(function() { | |
a(this).removeClass("front") | |
}); | |
if (k.totalRows == k.size) { | |
a("." + k.classAll, k.container).addClass("front") | |
} else { | |
a("." + k.classPageArray[k.page], k.container).addClass("front") | |
} | |
if (k.showPageCb) { | |
k.showPageCb(k.page) | |
} | |
} | |
function e(u, v) { | |
var t = u.config; | |
var n = v.length; | |
var w = (t.page * t.size); | |
var r = (w + t.size); | |
if (r > v.length) { | |
r = v.length | |
} | |
var m = a(u.tBodies[0]); | |
a.tablesorter.clearTableBody(u); | |
for (var q = w; q < r; q++) { | |
var k = v[q]; | |
var n = k.length; | |
for (var p = 0; p < n; p++) { | |
m[0].appendChild(k[p]) | |
} | |
} | |
a(u).trigger("applyWidgets"); | |
if (t.page >= t.totalPages) { | |
moveToLastPage(u) | |
} | |
} | |
this.appender = function(j, k) { | |
var l = j.config; | |
l.rowsCopy = k; | |
l.totalRows = k.length; | |
l.totalPages = Math.ceil(l.totalRows / l.size); | |
e(j, k) | |
}; | |
this.defaults = { | |
size: 25, | |
rowsPerPage: 0, | |
offset: 0, | |
page: 0, | |
maxRows: 5, | |
totalRows: 5, | |
totalPages: 1, | |
maxPages: 1, | |
container: null, | |
classPageArray: [], | |
titlePageArray: [], | |
classNext: "next_page", | |
titleNext: "L@S#4462", | |
classPrev: "prev_page", | |
titlePrev: "L@S#0881", | |
classAll: "all_pages", | |
titleAll: "L@S#0888", | |
classPageDisplay: ".pagedisplay", | |
seperator: "/", | |
positionFixed: true, | |
appender: this.appender | |
}; | |
this.construct = function(j) { | |
return this.each(function() { | |
var n = a.extend(this.config, a.tablesorterPager.defaults, j); | |
var u = this, | |
o = n.container; | |
var v = ""; | |
a(this).trigger("appendCache"); | |
n.size = n.rowsPerPage; | |
n.maxRows = n.totalRows < n.maxRows ? n.totalRows : n.maxRows; | |
n.maxPages = Math.ceil(n.maxRows / n.size); | |
n.classPageArray = []; | |
for (var p = 0; p < n.maxPages; p++) { | |
var t = p + 1; | |
n.classPageArray[p] = "page_" + t | |
} | |
var m = " "; | |
var q = "<<"; | |
var l = ">>"; | |
v = gui.emitHtml("a", { | |
"class": n.classPrev, | |
href: "#" | |
}, q + te.loc(n.titlePrev)); | |
v += m; | |
for (var r = 0; r < n.classPageArray.length; ++r) { | |
v += gui.emitHtml("a", { | |
"class": n.classPageArray[r], | |
title: n.titlePageArray[r], | |
href: "#" | |
}, r + 1); | |
v += m | |
} | |
v += gui.emitHtml("a", { | |
"class": n.classAll, | |
href: "#" | |
}, te.loc(n.titleAll)); | |
v += m; | |
v += gui.emitHtml("a", { | |
"class": n.classNext, | |
href: "#" | |
}, te.loc(n.titleNext) + l); | |
a(o).html(v); | |
a(o).find("a").each(function() { | |
a(this).removeAttr("href"); | |
a(this).unbind("click"); | |
a(this).removeClass("front") | |
}); | |
n.totalPages = Math.ceil(n.totalRows / n.size); | |
for (var p = 0; p < n.totalPages; p++) { | |
a("." + n.classPageArray[p], o).attr("href", "#"); | |
a("." + n.classPageArray[p], o).click(function() { | |
b(u, n.rowsPerPage); | |
g(u, a(this).text()); | |
return false | |
}) | |
} | |
a("." + n.classAll, o).attr("href", "#"); | |
a("." + n.classAll, o).click(function() { | |
b(u, n.totalRows); | |
h(u); | |
return false | |
}); | |
a("." + n.classNext, o).attr("href", "#"); | |
a("." + n.classNext, o).click(function() { | |
b(u, n.rowsPerPage); | |
d(u); | |
return false | |
}); | |
a("." + n.classPrev, o).attr("href", "#"); | |
a("." + n.classPrev, o).click(function() { | |
b(u, n.rowsPerPage); | |
f(u); | |
return false | |
}); | |
a("." + n.classPageArray[0], o).addClass("front") | |
}) | |
} | |
} | |
}); | |
a.fn.extend({ | |
tablesorterPager: a.tablesorterPager.construct | |
}) | |
})(jQuery); | |
/*! | |
* Ajax Pages v0.5 | |
* | |
* This software is licensed under the MIT License. | |
* | |
* The MIT License | |
* | |
* Copyright (c) 2005 Gustavo Ribeiro Amigo | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of | |
* this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to use, | |
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
* the Software, and to permit persons to whom the Software is furnished to do so, | |
* subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in all | |
* copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | |
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | |
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | |
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
*/ | |
(function() { | |
var AjaxPages = function() {}; | |
AjaxPages.prototype.getTemplateStr = function(templateText) { | |
this.template = templateText; | |
var mainView = this.getProcessor(); | |
return te.subLiteralLocStrings(mainView()) | |
}; | |
AjaxPages.prototype.processTemplate = function(templateText, mainArea) { | |
$(mainArea).html(this.getTemplateStr(templateText)) | |
}; | |
AjaxPages.prototype.parse = function(value) { | |
if (value == undefined) { | |
value = this.template | |
} | |
var out = ""; | |
var lineNumber = 1; | |
try { | |
var betweenPerc = false; | |
out = "function(context) { \n"; | |
out += "var __ajp = new $.AjaxPages();\n"; | |
out += "var __include;\n"; | |
out += "try {\n"; | |
out += " if ( context == undefined ) { \n"; | |
out += " context = '';\n"; | |
out += " }\n"; | |
out += "var out= unescape('"; | |
var line = ""; | |
for (var i = 0; i < value.length; i++) { | |
var nextTwo = ""; | |
if (i <= value.length - 2) { | |
nextTwo = value.charAt(i) + value.charAt(i + 1) | |
} | |
var nextFour = ""; | |
if (i <= value.length - 4) { | |
nextFour = value.charAt(i) + value.charAt(i + 1) + value.charAt(i + 2) + value.charAt(i + 3) | |
} | |
if (nextTwo == "<?" && nextFour == "<?hp") { | |
out += escape(line) + "');\n"; | |
line = ""; | |
out += " out+= "; | |
betweenPerc = true; | |
i += 4 | |
} else { | |
if (nextTwo == "?>") { | |
out += ";\n out+= unescape('"; | |
betweenPerc = false; | |
i += 1 | |
} else { | |
if (value.charAt(i) == String.fromCharCode(10)) { | |
if (!betweenPerc) { | |
out += escape(line) + "\\n');\n out+= unescape('"; | |
line = ""; | |
lineNumber++ | |
} | |
} else { | |
if (value.charAt(i) != String.fromCharCode(13)) { | |
if (betweenPerc) { | |
out += value.charAt(i) | |
} else { | |
line += value.charAt(i) | |
} | |
} | |
} | |
} | |
} | |
} | |
out += escape(line) + "');\n"; | |
out += "} catch (e) {"; | |
out += "return 'An exception occurred while executing template. Error type: ' + e.name+ '. Error message: ' + e.message;"; | |
out += "}"; | |
out += " return out;\n"; | |
out += "}\n" | |
} catch (e) { | |
out = "function(context) { \n"; | |
out += "return 'An exception occurred while parsing on line " + lineNumber + ". Error type: " + e.name + ". Error message: " + e.message + "';"; | |
out += "}" | |
} | |
return out | |
}; | |
AjaxPages.prototype._processDirective = function(directive) { | |
var i = 0; | |
var tolkenIndex = 0; | |
var tolken = new Array(); | |
while (directive.charAt(i) == " ") { | |
i++ | |
} | |
tolken[tolkenIndex] = ""; | |
while (directive.charAt(i) != " " && i <= directive.length) { | |
tolken[tolkenIndex] += directive.charAt(i); | |
i++ | |
} | |
tolkenIndex++; | |
while (directive.charAt(i) == " ") { | |
i++ | |
} | |
tolken[tolkenIndex] = ""; | |
while (directive.charAt(i) != " " && directive.charAt(i) != "=" && i <= directive.length) { | |
tolken[tolkenIndex] += directive.charAt(i); | |
i++ | |
} | |
tolkenIndex++; | |
while (directive.charAt(i) == " ") { | |
i++ | |
} | |
if (directive.charAt(i) != "=") { | |
throw new AjaxPagesException("Syntax error", "Token = expected attribute") | |
} | |
i++; | |
while (directive.charAt(i) == " ") { | |
i++ | |
} | |
tolken[tolkenIndex] = ""; | |
while (directive.charAt(i) != " " && i <= directive.length) { | |
tolken[tolkenIndex] += directive.charAt(i); | |
i++ | |
} | |
tolkenIndex++; | |
while (directive.charAt(i) == " " && i <= directive.length) { | |
i++ | |
} | |
tolken[tolkenIndex] = ""; | |
while (directive.charAt(i) != " " && directive.charAt(i) != "=" && i <= directive.length && i <= directive.length) { | |
tolken[tolkenIndex] += directive.charAt(i); | |
i++ | |
} | |
tolkenIndex++; | |
if (directive.charAt(i) != "=" && i <= directive.length) { | |
throw new AjaxPagesException("Syntax error", "Token = expected after attribute") | |
} | |
i++; | |
tolken[tolkenIndex] = ""; | |
while (directive.charAt(i) != " " && i <= directive.length && i <= directive.length) { | |
tolken[tolkenIndex] += directive.charAt(i); | |
i++ | |
} | |
var file = ""; | |
var context = ""; | |
if (tolken[0] != "include") { | |
throw new AjaxPagesException("Syntax error", "Directive " + tolken[0] + " unknown.") | |
} | |
if (tolken[1] != "file") { | |
throw new AjaxPagesException("Syntax error", "Attribute file expected after include.") | |
} else { | |
file = tolken[2] | |
} | |
if (tolken[3] != "context" && tolken[3] != "") { | |
throw new AjaxPagesException("Syntax error", "Attribute context expected after file.") | |
} else { | |
if (tolken[3] == "context") { | |
context = tolken[4] | |
} else { | |
context = "context" | |
} | |
} | |
var out = " __ajp.load(" + file + ");\n"; | |
out += " __include = __ajp.getProcessor();\n"; | |
out += " out+= __include(" + context + ");\n"; | |
return out | |
}; | |
AjaxPages.prototype.process = function(value) { | |
eval("var processor =" + this.parse(value)); | |
return processor() | |
}; | |
AjaxPages.prototype.getProcessor = function(value) { | |
eval("var processor =" + this.parse(value)); | |
return processor | |
}; | |
var AjaxPagesException = function(name, message) { | |
this.name = name; | |
this.message = message | |
}; | |
$.AjaxPages = AjaxPages; | |
$.AjaxPagesException = AjaxPagesException | |
})(); | |
/*! (C) Copyright 2012, Hewlett Packard. All Rights Reserved. */ | |
(function(a) { | |
function b() { | |
var c = parseFloat(a.browser.version); | |
a.browser.msie6 = a.browser.msie && c < 7; | |
a.browser.msie7 = a.browser.msie && c < 8 | |
} | |
a.fn.reverse = [].reverse; | |
if (!a.isArray) { | |
a.isArray = Array.isArray || function(c) { | |
return a.typeOf(c) == "array" | |
} | |
} | |
if (!a.noop) { | |
a.noop = function() {} | |
} | |
if (!a.now) { | |
a.now = function() { | |
return (new Date).getTime() | |
} | |
} | |
if (!a.parseJSON) { | |
a.parseJSON = function(g) { | |
g = a.trim(g); | |
if (window.JSON && window.JSON.parse) { | |
return window.JSON.parse(g) | |
} | |
var c = /^[\],:{}\s]*$/; | |
var f = /(?:^|:|,)(?:\s*\[)+/g; | |
var d = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g; | |
var e = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g; | |
if (c.test(g.replace(d, "@").replace(e, "]").replace(f, ""))) { | |
return (new Function("return " + g))() | |
} | |
return null | |
} | |
} | |
if (!a.parseXML) { | |
a.parseXML = function(d) { | |
var c; | |
if (window.ActiveXObject && !jQuery.useNativeXhr || jQuery.useLegacyXhr) { | |
c = new ActiveXObject("Microsoft.XMLDOM"); | |
c.async = false; | |
c.loadXML(d); | |
if (c.documentElement == null) { | |
return null | |
} | |
} else { | |
if (window.DOMParser) { | |
var e = new DOMParser(); | |
c = e.parseFromString(d, "text/xml"); | |
if (c.documentElement.tagName == "parsererror") { | |
return null | |
} | |
if (c.documentElement.childNodes.length > 0 && c.documentElement.childNodes[0].tagName == "parsererror") { | |
return null | |
} | |
} | |
} | |
return c | |
} | |
} | |
a.on = function() { | |
if (arguments.length == 2 || arguments.length == 3) { | |
a.bind.apply(this, arguments) | |
} | |
}; | |
a.off = function(c, d) { | |
if (arguments.length >= 0 && arguments.length <= 2) { | |
a.unbind.apply(this, arguments) | |
} | |
}; | |
a.runLater = function(d, c) { | |
if (c == null) { | |
c = 0 | |
} | |
return setTimeout(d, c) | |
}; | |
b() | |
})(jQuery); | |
(function(f) { | |
var e = 1000; | |
var a = 200; | |
var b = 0; | |
var k; | |
function h() { | |
b = 0; | |
k = null; | |
gui.fixTooltips() | |
} | |
function c(m) { | |
var o; | |
for (var n = 0; n < m.length; ++n) { | |
if (f.typeOf(m[n]) === "string" && m[n].match(/\stitle\s*=/i)) { | |
o = true; | |
break | |
} | |
} | |
if (!o) { | |
return | |
} | |
var l = f.now(); | |
if (b != 0 && l - b >= e) { | |
h() | |
} | |
if (k) { | |
clearTimeout(k) | |
} else { | |
b = l | |
} | |
k = f.runLater(h, a) | |
} | |
function d(l) { | |
while (l.match(/<script[^>]*>/i)) { | |
l = l.replace(/<(script[^>]*)>/i, "<$1>").replace(/<(\/script[^>]*)>/i, "<$1>") | |
} | |
return l | |
} | |
function g(l) { | |
for (var m = 0; m < l.length; ++m) { | |
if (f.typeOf(l[m]) === "string") { | |
l[m] = d(l[m]) | |
} | |
} | |
return l | |
} | |
var j = { | |
append: f.fn.append, | |
html: f.fn.html, | |
prepend: f.fn.prepend | |
}; | |
f.fn.append = function() { | |
c.call(this, arguments); | |
return j.append.apply(this, g(arguments)) | |
}; | |
f.fn.html = function() { | |
c.call(this, arguments); | |
return j.html.apply(this, g(arguments)) | |
}; | |
f.fn.prepend = function() { | |
c.call(this, arguments); | |
return j.prepend.apply(this, g(arguments)) | |
} | |
})(jQuery); | |
(function(b) { | |
var d; | |
var a; | |
var c = { | |
status: 200, | |
statusText: "Ok", | |
getAllResponseHeaders: function() { | |
return "" | |
}, | |
getResponseHeader: function(f) { | |
return null | |
} | |
}; | |
var e = b.ajax; | |
b.ajax = function(h) { | |
function l(q, p) { | |
b.each(p.headers || {}, function(s, r) { | |
q.setRequestHeader(s, r) | |
}); | |
return j.call(this, q, p) | |
} | |
function m(q, p, r) { | |
if (r.status == 1223) { | |
r = b.getFakeXhr(204, r.statusText) | |
} | |
n.call(this, q, p, r) | |
} | |
function k(r, p, q) { | |
if (p == "timeout" || r.status >= 12000) { | |
r = b.getFakeTimeoutXhr() | |
} | |
o.call(this, r, p, q) | |
} | |
function f(q, p) { | |
if (p == "timeout" || q.status >= 12000) { | |
q = b.getFakeTimeoutXhr() | |
} | |
g.call(this, q, p) | |
} | |
var j = h.beforeSend || b.noop; | |
var n = h.success || b.noop; | |
var o = h.error || b.noop; | |
var g = h.complete || b.noop; | |
h.beforeSend = l; | |
h.success = m; | |
h.error = k; | |
h.complete = f; | |
if (h.username != null && d) { | |
h.username = d | |
} | |
if (h.password != null && a) { | |
h.password = a | |
} | |
return e(h) | |
}; | |
b.getFakeXhr = function(f, g) { | |
var h = b.extend({}, c); | |
if (f != null) { | |
h.status = f | |
} | |
if (g != null) { | |
h.statusText = g | |
} | |
return h | |
}; | |
b.getFakeTimeoutXhr = function() { | |
return b.getFakeXhr(408, "Timeout") | |
}; | |
b.hasAjaxAuthUserIdPw = function() { | |
return d != null | |
}; | |
b.setAjaxAuthUserIdPw = function(g, f) { | |
d = g; | |
if (g != null) { | |
a = f | |
} else { | |
a = null | |
} | |
} | |
})(jQuery); | |
(function(c) { | |
var a = 35000; | |
var b = 500; | |
var d = c.ajax; | |
c.ajax = function(k) { | |
function e(s) { | |
return f.isManifest && s && s.url.indexOf("Manifest") >= 0 | |
} | |
function r(w, t, x, s) { | |
if (j) { | |
return | |
} | |
if (e(s)) { | |
return | |
} | |
var v = s.type && s.type.toLowerCase(); | |
var u; | |
if (f.xmlData && (v == "get" || v == "local-get")) { | |
if (c.isArray(f.xmlData)) { | |
u = f.xmlData[f.xmlData.length - 1] | |
} else { | |
u = f.xmlData | |
} | |
} else { | |
u = f.xmlData | |
} | |
if (k.success) { | |
k.success(u, t, x) | |
} | |
if (v == "local-get") { | |
h(x, t, s) | |
} | |
} | |
function p(v, t, u, s) { | |
if (j) { | |
return | |
} | |
if (k.error) { | |
k.error(v, t, u) | |
} | |
if (e(s)) { | |
h(v, t, s) | |
} | |
} | |
function h(u, t, s) { | |
if (j) { | |
return | |
} | |
if (m) { | |
clearTimeout(m); | |
m = null | |
} | |
if (k.complete) { | |
k.complete(u, t) | |
} | |
} | |
if (k.dataType != "ledm" && k.dataType != "manifest") { | |
return d(k) | |
} | |
var g = k.url; | |
var f; | |
var m; | |
var j; | |
var o = (k.type || "get").toLowerCase(); | |
if (o == "get") { | |
var q; | |
if (k.timeout != null) { | |
q = k.timeout | |
} else { | |
q = a | |
} | |
m = setTimeout(function() { | |
var s = c.getFakeTimeoutXhr(); | |
p(s, "timeout", "Timeout"); | |
h(s, "timeout"); | |
j = true | |
}, q + b); | |
if (k.linkUrl != null) { | |
f = new k.data.ResourceLink(k.linkUrl, { | |
success: r, | |
error: p, | |
complete: h, | |
cache: k.cache, | |
timeout: k.timeout | |
}); | |
f.isManifest = true | |
} else { | |
f = new c.hlp.ledm.SmartObj(g, { | |
success: r, | |
error: p, | |
complete: h, | |
cache: k.cache, | |
data: k.data, | |
timeout: k.timeout | |
}); | |
f.isManifest = c.hlp.ledm.isManifest(g) | |
} | |
} else { | |
f = k.data; | |
if (f == null) { | |
return | |
} | |
var n = k.data.callbacks; | |
n.success = r; | |
n.error = p; | |
n.complete = h; | |
n.timeout = k.timeout; | |
if (k.putDiff != null) { | |
n.noDiff = !k.putDiff | |
} | |
var l; | |
switch (o) { | |
case "put": | |
l = f.put(k.linkUrl); | |
break; | |
case "post": | |
l = f.post(); | |
break; | |
case "delete": | |
l = f.del(k.linkUrl); | |
break; | |
default: | |
console.error(k.url + ": unknown type " + k.type); | |
l = 0; | |
break | |
} | |
if (l == 0) { | |
c.runLater(function() { | |
var s = c.getFakeXhr(); | |
k.success && k.success({}, "success", s); | |
k.complete && k.complete(s, "success") | |
}) | |
} | |
} | |
return f | |
}; | |
c.getAjaxLedmTimeoutMs = function() { | |
return a | |
} | |
})(jQuery); | |
(function(a) { | |
var b = a.ajax; | |
a.ajax = function(e) { | |
if (e.dataType != "ledm" && e.dataType != "manifest") { | |
return b(e) | |
} | |
var d = (e.type || "get").toLowerCase(); | |
if (d == "get" || e.data != "placeholder") { | |
return b(e) | |
} | |
var c = b({ | |
url: e.url, | |
dataType: e.dataType, | |
success: function(g, f, h) { | |
if (e.getSuccess) { | |
e.getSuccess(g, f, h) | |
} | |
e.data = c; | |
b(e) | |
} | |
}) | |
} | |
})(jQuery); | |
(function(j) { | |
var g = {}; | |
var h = j.ajax; | |
j.ajax = function(q) { | |
function s(t, u) { | |
if (l(u)) { | |
return | |
} | |
switch (q.dataType) { | |
case "css": | |
k(u); | |
return; | |
case "html": | |
a(t, u); | |
return; | |
case "script": | |
b(u); | |
return; | |
default: | |
return | |
} | |
} | |
function r(u, t, v) { | |
g[n] = true; | |
s(n, u); | |
q.success({}, t, v) | |
} | |
function o(v, t, u) { | |
q.error(v, t, u) | |
} | |
function m(u, t) { | |
q.complete(u, t) | |
} | |
var p = q.type || "get"; | |
if (!q.applyDirectly || p.toLowerCase() != "get") { | |
return h(q) | |
} | |
var n = q.url; | |
q.success = q.success || j.noop; | |
q.error = q.error || j.noop; | |
q.complete = q.complete || j.noop; | |
if (g[n]) { | |
j.runLater(function() { | |
var t = j.getFakeXhr(); | |
q.success({}, "success", t); | |
q.complete(t, "success") | |
}); | |
return | |
} | |
return h(j.extend({}, q, { | |
dataType: "text", | |
success: r, | |
error: o, | |
complete: m | |
})) | |
}; | |
function l(m) { | |
m = m.replace(/\r/, ""); | |
var o = m.match(/^--([0-9a-zA-Z]+)\n/); | |
if (o == null) { | |
return false | |
} | |
var n = m.split("--" + o[1] + "\n"); | |
j.each(n, function(p, q) { | |
if (q == "") { | |
return | |
} | |
var r; | |
var u; | |
var s; | |
r = q.indexOf("\n\n"); | |
if (r >= 0) { | |
u = q.substr(0, r); | |
s = q.substr(r + 2) | |
} else { | |
u = q.replace(/\n$/, ""); | |
s = "" | |
} | |
var t = {}; | |
if (u != "") { | |
j.each(u.split("\n"), function(v, x) { | |
var w = x.split(":"); | |
t[w[0].toLowerCase()] = j.trim(w[1]) | |
}) | |
} | |
switch (t["content-type"]) { | |
case "application/javascript": | |
b(s); | |
break; | |
case "text/htf": | |
a(t.filename, s); | |
break; | |
case "text/css": | |
k(s); | |
break; | |
default: | |
break | |
} | |
}); | |
return true | |
} | |
var c = {}; | |
j.ajaxExecGetHtfData = function(m) { | |
return c[m] | |
}; | |
j.ajaxExecSetHtfData = function(n, o) { | |
c[n] = o; | |
var m = n.lastIndexOf("/"); | |
if (m >= 0) { | |
n = n.substr(m + 1); | |
c[n] = o | |
} | |
}; | |
j.ajaxExecClearHtfData = function(n) { | |
delete c[n]; | |
var m = n.lastIndexOf("/"); | |
if (m >= 0) { | |
n = n.substr(m + 1); | |
delete c[n] | |
} | |
}; | |
function k(m) { | |
gui.newGblStyle(null, m) | |
} | |
function a(m, n) { | |
j.ajaxExecSetHtfData(m, n) | |
} | |
function b(m) { | |
d(m); | |
j.globalEval(m) | |
} | |
var f = "/\\*!!?INLINE_TEMPLATE_START (.*)\n"; | |
var e = "INLINE_TEMPLATE_END\\*/"; | |
function d(p) { | |
var r = p; | |
while (true) { | |
var q = r.match(new RegExp(f)); | |
var o = r.match(new RegExp(e)); | |
if (q == null || o == null) { | |
break | |
} | |
var n = q[1]; | |
var m = r.substring(q.index + q[0].length, o.index); | |
j.ajaxExecSetHtfData(n, m); | |
r = r.substring(o.index + o[0].length) | |
} | |
} | |
})(jQuery); | |
(function(a) { | |
var b = a.ajax; | |
a.ajax = function(g) { | |
function f() { | |
var k = false; | |
a.each(h, function(l, m) { | |
if (m.err) { | |
k = true; | |
return false | |
} | |
}); | |
return k | |
} | |
function j() { | |
var k = true; | |
a.each(h, function(l, m) { | |
if (!m.loaded) { | |
k = false; | |
return false | |
} | |
}); | |
return k | |
} | |
function c(l, k) { | |
if (!j()) { | |
return | |
} | |
if (f()) { | |
if (g.error) { | |
g.error(l, "error", "Not found") | |
} | |
if (g.complete) { | |
g.complete(l, "error") | |
} | |
return | |
} | |
a.ajax({ | |
url: d, | |
dataType: "script", | |
applyDirectly: true, | |
success: g.success, | |
error: g.error, | |
complete: g.complete | |
}) | |
} | |
var e = g.type || "get"; | |
if (!g.loadRequired || e.toLowerCase() != "get") { | |
return b(g) | |
} | |
var d = g.url; | |
var h = a.resLoader.getJsDependencies(d); | |
h = a.map(h.concat(a.resLoader.getCondJsDependencies(d)), function(m, k) { | |
var l = a.resLoader.splitDependsName(m); | |
if (a.resLoader.isJsFile(l.file)) { | |
return { | |
url: l.file | |
} | |
} | |
}); | |
if (h.length == 0) { | |
c({}, ""); | |
return | |
} | |
a.each(h, function(k, l) { | |
a.ajax({ | |
url: l.url, | |
dataType: "script", | |
loadRequired: true, | |
success: function(n, m, o) { | |
l.loaded = true | |
}, | |
error: function(o, m, n) { | |
l.loaded = true; | |
l.err = true | |
}, | |
complete: function(n, m) { | |
c(n, m) | |
} | |
}) | |
}) | |
} | |
})(jQuery); | |
(function(g) { | |
var b = {}; | |
var h = g.ajax; | |
g.ajax = function(n) { | |
function q(r) { | |
switch (n.dataType) { | |
case "json": | |
return g.parseJSON(r); | |
case "xml": | |
return g.parseXML(r); | |
default: | |
return r | |
} | |
} | |
function p(s, r, t) { | |
b[k] = { | |
tag: n.cacheLocally, | |
timestamp: g.now(), | |
data: s | |
}; | |
s = q(s); | |
if (s == null) { | |
n.error(g.getFakeXhr(), "parsererror", "error"); | |
return | |
} | |
n.success(s, r, t) | |
} | |
function l(t, r, s) { | |
n.error(t, r, s) | |
} | |
function j(s, r) { | |
n.complete(s, r) | |
} | |
var m = n.type || "get"; | |
if (!n.cacheLocally || m.toLowerCase() != "get") { | |
return h(n) | |
} | |
var k = n.url; | |
n.success = n.success || g.noop; | |
n.error = n.error || g.noop; | |
n.complete = n.complete || g.noop; | |
if (b[k] == null) { | |
c(k) | |
} | |
var o = b[k]; | |
if (o) { | |
o.timestamp = g.now(); | |
g.runLater(function() { | |
var r = g.getFakeXhr(); | |
n.success(q(o.data), "success", r); | |
n.complete(r, "success") | |
}); | |
return | |
} | |
return h(g.extend({}, n, { | |
dataType: "text", | |
success: p, | |
error: l, | |
complete: j | |
})) | |
}; | |
g.invalidateAjaxLocalCache = function(j) { | |
if (j == null) { | |
b = {}; | |
return | |
} | |
b = g.map(b, function(l, k) { | |
if (l.tag != j) { | |
return l | |
} | |
}) | |
}; | |
var d = { | |
"/DevMgmt/Authentication/NetworkAuthentication.xml/test": "sec:AuthenticationSettings" | |
}; | |
var f = [{ | |
type: "ns", | |
name: "sec", | |
uri: "http://www.hp.com/schemas/imaging/con/security/2009/02/11", | |
file: "/DevMgmt/Authentication/AuthenticationManifest.xml" | |
}]; | |
g.ajaxLocalCacheProcessPrefetch = function(l) { | |
function m() { | |
g.each(l, function(n, o) { | |
if (o.type == "resource" && d[o.uri]) { | |
o.xmlElement = d[o.uri] | |
} | |
}); | |
g.each(f, function(n, o) { | |
l.push(o) | |
}) | |
} | |
function k() { | |
var o = []; | |
var n = {}; | |
g.each(l, function(q, r) { | |
switch (r.type) { | |
case "feature": | |
o.push("<ledm:SupportedFeature><dd:ResourceType>" + r.res + "</dd:ResourceType><dd:ResourceURI>" + r.uri + "</dd:ResourceURI></ledm:SupportedFeature>"); | |
break; | |
case "ledm": | |
o.push("<ledm:SupportedTree><dd:ResourceType>" + r.res + "</dd:ResourceType><dd:ResourceURI>" + r.uri + "</dd:ResourceURI></ledm:SupportedTree>"); | |
break; | |
case "manifest": | |
o.push("<ledm:SupportedIfc><dd:ResourceType>" + r.res + "</dd:ResourceType><ledm:ManifestURI>" + r.uri + "</ledm:ManifestURI></ledm:SupportedIfc>"); | |
break; | |
case "ns": | |
n[r.file + ":" + r.name] = r.uri; | |
break; | |
default: | |
break | |
} | |
}); | |
var p = "<ledm:DiscoveryTree xmlns:dd='/dd' xmlns:ledm='/ledm'>" + o.join("") + "</ledm:DiscoveryTree>"; | |
g.hlp.ledm.setDiscoveryTree(g.parseXML(p)); | |
g.ajaxLocalCacheSetParsedNamespace(n) | |
} | |
function j() { | |
var n = {}; | |
g.each(l, function(o, u) { | |
if (u.file == null) { | |
return | |
} | |
if (n[u.file] == null) { | |
n[u.file] = { | |
nodes: {} | |
} | |
} | |
var s = u.uri.substr(1).split("/"); | |
var r = n[u.file]; | |
var p; | |
for (var q = 0; q < s.length; ++q) { | |
p = "/" + s[q]; | |
if (r.nodes[p] == null) { | |
r.nodes[p] = { | |
nodes: {} | |
} | |
} | |
if (q == s.length - 1) { | |
var t = r.nodes[p]; | |
t.res = u.res; | |
t.xmlElement = u.xmlElement; | |
t.methods = u.methods | |
} | |
r = r.nodes[p] | |
} | |
}); | |
g.ajaxLocalCacheSetParsedManifests(n) | |
} | |
m(); | |
k(); | |
j() | |
}; | |
var a; | |
var e; | |
function c(l) { | |
function j(r, u, q, w) { | |
var v = []; | |
var x; | |
if (r != null) { | |
x = "<map:ResourceLink><dd:ResourceURI>" + r + "</dd:ResourceURI>"; | |
if (q == 0) { | |
x += "<map:Base>Root</map:Base>" | |
} | |
x += "</map:ResourceLink>"; | |
v.push(x) | |
} | |
if (u.res != null) { | |
v.push("<map:ResourceType><map:privType>" + u.res + "</map:privType></map:ResourceType>") | |
} | |
if (u.xmlElement != null && u.xmlElement != "") { | |
v.push("<map:XmlElement><" + u.xmlElement + "></" + u.xmlElement + "></map:XmlElement>"); | |
var y = u.xmlElement.split(":"); | |
if (y[0] != "") { | |
w[y[0]] = true | |
} | |
} | |
if (u.methods != null) { | |
var t = []; | |
g.each(u.methods, function(s, A) { | |
var z = A.substr(0, 1).toUpperCase() + A.substr(1); | |
t.push("<map:Method><map:Verb>" + z + "</map:Verb></map:Method>") | |
}); | |
v.push("<map:Methods>" + t.join("") + "</map:Methods>") | |
} | |
var p = []; | |
g.each(u.nodes, function(A, z) { | |
var B = j(A, z, q + 1, w); | |
if (q >= 0) { | |
p.push("<map:ResourceNode>" + B + "</map:ResourceNode>") | |
} else { | |
p.push(B) | |
} | |
}); | |
if (p.length > 0) { | |
if (q != 0) { | |
v.push("<map:ResourceMap>" + p.join("") + "</map:ResourceMap>") | |
} else { | |
v.push(p.join("")) | |
} | |
} | |
return v.join("") | |
} | |
if (a == null || a[l] == null) { | |
return | |
} | |
var k = { | |
dd: true, | |
man: true, | |
map: true | |
}; | |
var o = j(null, a[l], -1, k); | |
var m = []; | |
g.each(k, function(q, p) { | |
m.push(" xmlns:" + q + "='" + e[l + ":" + q] + "'") | |
}); | |
var n = "<man:Manifest" + m.join("") + ">" + o + "</man:Manifest>"; | |
b[l] = { | |
tag: "manifest", | |
timestamp: g.now(), | |
data: n | |
} | |
} | |
g.ajaxLocalCacheGetManifest = function(j) { | |
if (b[j] == null) { | |
c(j) | |
} | |
return g.parseXML(b[j].data) | |
}; | |
g.ajaxLocalCacheSetParsedManifests = function(j) { | |
a = j | |
}; | |
g.ajaxLocalCacheSetParsedNamespace = function(j) { | |
e = j | |
} | |
})(jQuery); | |
(function(b) { | |
var a = {}; | |
var c = b.ajax; | |
b.ajax = function(j) { | |
function k(m, l, n) { | |
f = a[e]; | |
delete a[e]; | |
b.each(f, function(o, p) { | |
p.success(m, l, n) | |
}) | |
} | |
function g(n, l, m) { | |
f = a[e]; | |
delete a[e]; | |
b.each(f, function(o, p) { | |
p.error(n, l, m) | |
}) | |
} | |
function d(m, l) { | |
b.each(f, function(n, o) { | |
o.complete(m, l) | |
}) | |
} | |
var f; | |
var h = j.type || "get"; | |
if (!j.pooledLoading || h.toLowerCase() != "get") { | |
return c(j) | |
} | |
var e = j.url; | |
j.success = j.success || b.noop; | |
j.error = j.error || b.noop; | |
j.complete = j.complete || b.noop; | |
if (a[e]) { | |
a[e].push(j); | |
return | |
} | |
a[e] = [j]; | |
return c(b.extend({}, j, { | |
success: k, | |
error: g, | |
complete: d | |
})) | |
} | |
})(jQuery); | |
(function(a) { | |
var b = a.ajax; | |
a.ajax = function(f) { | |
function d(h) { | |
var j = a.getFakeXhr(); | |
var g; | |
if (h) { | |
g = "success"; | |
if (f.success) { | |
f.success({}, g, j) | |
} | |
} else { | |
g = "error"; | |
if (f.error) { | |
f.error(j, g, "Error") | |
} | |
} | |
if (f.complete) { | |
f.complete(j, g) | |
} | |
} | |
if (!f.batch) { | |
return b(f) | |
} | |
if (f.batch.length == 0) { | |
d(true); | |
return | |
} | |
var c = true; | |
var e = 0; | |
a.each(f.batch, function(j, k) { | |
var h = a.extend({}, k, { | |
success: function(m, l, n) { | |
if (k.success) { | |
k.success(m, l, n) | |
} | |
}, | |
error: function(n, l, m) { | |
if (k.error) { | |
k.error(n, l, m) | |
} | |
c = false | |
}, | |
complete: function(m, l) { | |
if (k.complete) { | |
k.complete(m, l) | |
}++e; | |
if (e >= f.batch.length) { | |
d(c) | |
} | |
} | |
}); | |
var g = a.ajax(h); | |
if (k.getAjaxObj) { | |
k.getAjaxObj(g) | |
} | |
}) | |
} | |
})(jQuery); | |
(function(a) { | |
var b = a.ajax; | |
a.ajax = function(d) { | |
var c = d.type || "get"; | |
if (d.applyDirectly && c.toLowerCase() == "get") { | |
d.pooledLoading = true | |
} | |
if (d.applyDirectly || d.loadRequired) { | |
if (apps.replacedFiles[d.url] != null) { | |
d.url = apps.replacedFiles[d.url] | |
} | |
} | |
return b(d) | |
} | |
})(jQuery); | |
function _NS(a) { | |
if ($.hlp.supXmlNs) { | |
return a | |
} else { | |
return a.replace(/\w*\\:/g, "") | |
} | |
}(function(e) { | |
e.typeOf = function(g) { | |
var f = typeof g; | |
if (f !== "object") { | |
return f | |
} | |
if (!g) { | |
return "null" | |
} | |
if ({}.toString.apply(g) === "[object Array]") { | |
return "array" | |
} | |
return f | |
}; | |
e.isEmpty = function(h) { | |
var g, f; | |
if (e.typeOf(h) !== "object") { | |
return true | |
} | |
for (g in h) { | |
f = h[g]; | |
if (f !== undefined && e.typeOf(f) !== "function") { | |
return false | |
} | |
} | |
return true | |
}; | |
e.fillIn = function(j, g) { | |
function k(n, q, p) { | |
var l = q[p]; | |
switch (e.typeOf(l)) { | |
case "object": | |
n[p] = {}; | |
e.fillIn(n[p], l); | |
break; | |
case "array": | |
var m = n[p] = []; | |
for (var o = 0; o < l.length; ++o) { | |
k(m, l, o) | |
} | |
break; | |
default: | |
n[p] = l; | |
break | |
} | |
} | |
if (j == null) { | |
j = {} | |
} | |
for (var h in g) { | |
if (!g.propertyIsEnumerable(h)) { | |
continue | |
} | |
if (g[h] == null) { | |
continue | |
} | |
var f = j[h]; | |
switch (e.typeOf(f)) { | |
case "object": | |
e.fillIn(f, g[h]); | |
break; | |
case "array": | |
break; | |
case "undefined": | |
case "null": | |
k(j, g, h); | |
break; | |
default: | |
break | |
} | |
} | |
return j | |
}; | |
e.escHtmlEntities = function(f) { | |
return String(f).replace(/[<>&]/g, function(g) { | |
switch (g) { | |
case "<": | |
return "<"; | |
case ">": | |
return ">"; | |
case "&": | |
return "&"; | |
default: | |
return "&" + g.charCodeAt(0) + ";" | |
} | |
}) | |
}; | |
e.unescHtmlEntities = function(f) { | |
return String(f).replace(/&(lt|gt|amp|#\d+);/g, function(g) { | |
switch (g) { | |
case "<": | |
return "<"; | |
case ">": | |
return ">"; | |
case "&": | |
return "&"; | |
default: | |
return g | |
} | |
}) | |
}; | |
String.prototype.quote = function() { | |
var j, g, f = this.length, | |
h = '"'; | |
for (g = 0; g < f; ++g) { | |
j = this.charAt(g); | |
if (j >= " ") { | |
if (j === "\\" || j === '"') { | |
h += "\\" | |
} | |
h += j; | |
continue | |
} | |
switch (j) { | |
case "\b": | |
h += "\\b"; | |
break; | |
case "\f": | |
h += "\\f"; | |
break; | |
case "\n": | |
h += "\\n"; | |
break; | |
case "\r": | |
h += "\\r"; | |
break; | |
case "\t": | |
h += "\\t"; | |
break; | |
default: | |
j = j.charCodeAt(); | |
h += "\\u00" + Math.floor(j / 16).toString(16) + (j % 16).toString(16); | |
break | |
} | |
} | |
return h + '"' | |
}; | |
String.prototype.supplant = function(f) { | |
return this.replace(/{([^{}]*)}/g, function(h, g) { | |
var j = f[g]; | |
return typeof j === "string" || typeof j === "number" ? j : h | |
}) | |
}; | |
var c = true; | |
var b = 0; | |
e.hlp = {}; | |
e.hlp.trueFn = function() { | |
return true | |
}; | |
e.hlp.falseFn = function() { | |
return false | |
}; | |
e.hlp.sprintf = function() { | |
var g = arguments; | |
if (g.length == 1) { | |
return g[0] | |
} else { | |
if (g.length < 1) { | |
return "" | |
} | |
} | |
var f = 1; | |
return String(g[0]).replace(/%(d|s|%)/g, function(h) { | |
switch (h) { | |
case "%d": | |
case "%s": | |
return g[f++]; | |
case "%%": | |
return "%"; | |
default: | |
return h | |
} | |
}) | |
}; | |
e.hlp.mElem = function(h) { | |
var j = h.split(" "); | |
h = ""; | |
for (var f = 0; f < j.length; ++f) { | |
if (f > 0) { | |
h += " " | |
} | |
var g = j[f].replace(/\./g, "\\."); | |
if (e.hlp.supXmlNs) { | |
h += g.replace(/:/, "\\:") | |
} else { | |
h += g.replace(/[^:]*:/, "") | |
} | |
} | |
return h | |
}; | |
e.hlp.getTmpDivId = function() { | |
while (true) { | |
var f = "tmpId" + b++; | |
if (e("#" + f).length > 0) { | |
continue | |
} | |
if (e("[name='" + f + "']").length > 0) { | |
continue | |
} | |
return f | |
} | |
}; | |
e.hlp.getNestedFieldValue = function(j, h) { | |
if (arguments.length == 1) { | |
h = arguments[0]; | |
j = window | |
} | |
var f = h.split("."); | |
for (var g = 0; g < f.length && j !== undefined; ++g) { | |
j = j[f[g]] | |
} | |
return j | |
}; | |
e.hlp.setNestedFieldValue = function(k, j, h) { | |
if (arguments.length == 2) { | |
h = arguments[1]; | |
j = arguments[0]; | |
k = window | |
} | |
var f = j.split("."); | |
for (var g = 0; g < f.length - 1; ++g) { | |
var l = f[g]; | |
if (k[l] === undefined) { | |
k[l] = {} | |
} | |
k = k[l] | |
} | |
k[f[f.length - 1]] = h | |
}; | |
e.hlp.saveRadioValues = function(f) { | |
if (!e.browser.msie || parseFloat(e.browser.version) >= 8) { | |
return null | |
} | |
var h = f.find("input[type=radio]"); | |
var g = []; | |
h.each(function() { | |
g.push(e(this).attr("checked")) | |
}); | |
return { | |
list: h, | |
values: g | |
} | |
}; | |
e.hlp.restoreRadioValues = function(f) { | |
if (!e.browser.msie || parseFloat(e.browser.version) >= 8) { | |
return | |
} | |
f.list.each(function(g) { | |
e(this).attr("checked", f.values[g]) | |
}) | |
}; | |
e.hlp.emitHtml = function(l, j, g) { | |
function f(p) { | |
var o = ""; | |
for (var n in p) { | |
if (!p.propertyIsEnumerable(n)) { | |
continue | |
} | |
var m = p[n]; | |
if (m == null) { | |
continue | |
} | |
if (typeof(m) != "boolean") { | |
if (typeof(m) == "string") { | |
m = m.replace(/'/g, "'") | |
} | |
o += " " + n + "='" + m + "'" | |
} else { | |
if (m) { | |
if (c) { | |
o += " " + n + "='" + n + "'" | |
} else { | |
o += " " + n | |
} | |
} | |
} | |
} | |
return o | |
} | |
l = l.toLowerCase(); | |
if (j == null) { | |
j = {} | |
} | |
var k = g != null; | |
var h = "<" + l + f(j); | |
if (c && !k) { | |
h += " />" | |
} else { | |
h += ">" | |
} | |
if (g != null) { | |
h += g | |
} | |
if (k) { | |
h += "</" + l + ">" | |
} | |
return h | |
}; | |
e.hlp.emitClearFloat = function() { | |
return e.hlp.emitHtml("div", { | |
"class": "clear" | |
}, "") | |
}; | |
e.hlp.decodeHtmlEntities = function(f) { | |
return e("<div/>").html(f).text() | |
}; | |
var d = /^https:\/\//; | |
e.hlp.hasHttpsPrefix = function(f) { | |
return f.match(d) != null | |
}; | |
e.hlp.isOverHttps = function() { | |
return e.hlp.hasHttpsPrefix(String(window.location)) | |
}; | |
e.hlp.switchToHttps = function() { | |
window.location = String(window.location).replace(/^http:\/\//, "https://") | |
}; | |
e.hlp.getCssPath = function(h) { | |
var g = e(h).eq(0); | |
var f = g.add(g.parents()); | |
var j = []; | |
f.each(function(s, q) { | |
var n = e(q); | |
var k = n.attr("id"); | |
var r = n.attr("class").split(/\s+/); | |
var m = q.tagName.toLowerCase(); | |
if (m == "body" || m == "html") { | |
return false | |
} | |
if (k != "") { | |
j.push("#" + k); | |
return false | |
} | |
var o; | |
var l; | |
e.each(r, function(t, u) { | |
if (u == "") { | |
return | |
} | |
if (e.inArray(u, ["ellipsis", "gui-mouseover", "min-ht", "off-screen-text-cls", "ui-selected", "ui-selecting"]) >= 0) { | |
return | |
} | |
var v = e("." + u).index(q); | |
if (l == null || l > v) { | |
o = "." + u; | |
l = v | |
} | |
}); | |
if (o) { | |
var p = e(o).index(q); | |
if (p > 0) { | |
o += ":eq(" + p + ")" | |
} | |
j.push(o); | |
return false | |
} | |
var p = n.parent().children(m).index(q); | |
if (p > 0) { | |
m += ":eq(" + p + ")" | |
} | |
j.push(m) | |
}); | |
if (j.length == 0) { | |
return "body" | |
} else { | |
return j.reverse().join(" ") | |
} | |
}; | |
e.hlp.xmlToStr = function(h) { | |
var f; | |
try { | |
f = (new XMLSerializer()).serializeToString(h) | |
} catch (g) { | |
f = h.xml | |
} | |
return f | |
}; | |
function a() { | |
if (e.hlp.supXmlNs === undefined) { | |
var f = parseFloat(e.browser.version); | |
if (e.browser.msie || e.browser.mozilla && f >= 1.9) { | |
e.hlp.supXmlNs = true | |
} else { | |
var g = e.parseXML("<ns:root xmlns:ns='!empty'><ns:elm></ns:elm></ns:root>"); | |
e.hlp.supXmlNs = e("ns\\:elm", g).length > 0 | |
} | |
} | |
return e.hlp.supXmlNs | |
} | |
a() | |
})(jQuery); | |
(function() { | |
var l = "."; | |
var n = {}; | |
$.hlp.autoLedmParser = n; | |
function e(q) { | |
if (q.indexOf(":") >= 0) { | |
return q.split(":")[1] | |
} else { | |
return q | |
} | |
} | |
function a(q) { | |
q = e(q).replace(/(Cap|Caps|Dyn)$/, ""); | |
return q | |
} | |
function m(s) { | |
var r = s.split(l); | |
var u = []; | |
var t; | |
var q; | |
$.each(r, function(v, x) { | |
var w = x.match(/Support(\[[0-9]+\])?$/); | |
x = x.replace(/(.*)Support(\[[0-9]+\])?$/, "$1$2"); | |
if (q && !w && t == x) { | |
q = false; | |
return | |
} | |
u.push(x); | |
if (w) { | |
t = x | |
} | |
q = w | |
}); | |
return u.join(l) | |
} | |
function b(s, q) { | |
var r; | |
if (s.length > 0) { | |
r = s.join(l) + l | |
} else { | |
r = "" | |
} | |
return m(r + q) | |
} | |
function h(q) { | |
var r = { | |
readOnly: "ro", | |
readWrite: "rw", | |
writeOnly: "wo" | |
}; | |
if (r[q]) { | |
return r[q] | |
} else { | |
return q | |
} | |
} | |
function k(q) { | |
var r = { | |
"boolean": "bool", | |
"double": "number", | |
"float": "number", | |
integer: "int", | |
valuefloat: "number" | |
}; | |
q = e(q).toLowerCase(); | |
if (r[q]) { | |
return r[q] | |
} else { | |
return q | |
} | |
} | |
function o(q) { | |
if (q === "true") { | |
return true | |
} | |
if (q === "false") { | |
return false | |
} | |
if (q.match(/^[+-]?[0-9]+(.[0-9]+)?$/)) { | |
return +q | |
} | |
return q | |
} | |
function f(q) { | |
if (q.type != null || q.value == null) { | |
return | |
} | |
if (q.value.length == 2 && $.inArray(true, q.value) >= 0 && $.inArray(false, q.value) >= 0) { | |
q.type = "bool"; | |
delete q.value | |
} else { | |
if (q.value.length == 2 && $.inArray("enabled", q.value) >= 0 && $.inArray("disabled", q.value) >= 0) { | |
q.type = "tEnableEnum"; | |
delete q.value | |
} else { | |
if (q.value.length == 2 && $.inArray("on", q.value) >= 0 && $.inArray("off", q.value) >= 0) { | |
q.type = "tOnEnum"; | |
delete q.value | |
} | |
} | |
} | |
} | |
function d(r, q) { | |
var t = r.split("/"); | |
$.each(t, function(s, u) { | |
t[s] = e(u) | |
}); | |
if (a(t[0]) == a(q)) { | |
t.shift() | |
} | |
return t.join(l) | |
} | |
function g(t, s, q) { | |
var r = {}; | |
$.each(t.attributes, function(u, y) { | |
var x = y.name; | |
var w = y.value; | |
switch (x) { | |
case "access": | |
w = h(w); | |
break; | |
case "elementXPath": | |
x = "xpath"; | |
w = d(w, q); | |
if (w == s) { | |
x = null | |
} | |
break; | |
case "length": | |
x = "len"; | |
break; | |
case "typeof": | |
x = "type"; | |
w = k(w); | |
break; | |
default: | |
break | |
} | |
if (x == null) { | |
return | |
} | |
r[x] = o(w) | |
}); | |
if (r.type == "number") { | |
if (r.min != null) { | |
r.min = +r.min | |
} | |
if (r.max != null) { | |
r.max = +r.max | |
} | |
if (r.step != null) { | |
r.step = +r.step | |
} | |
} | |
return r | |
} | |
n.parse = function(t, v) { | |
function s(y, z) { | |
$(y).each(function(J, G) { | |
var I = $(G).children(); | |
if (I.length == 0) { | |
var E = b(w, a(G.tagName)); | |
var L = g(G, E, r); | |
if (L.access == null && q[E] != null) { | |
L.access = q[E] | |
} | |
var F = {}; | |
var N = 0; | |
$.each(L, function(P, O) { | |
F[P] = O; | |
++N | |
}); | |
var M = $(G).text(); | |
if (M != "") { | |
F.value = o(M) | |
} | |
if (M == "" && N == 1 && F.access != null) { | |
q[E] = F.access; | |
return | |
} | |
v(E, F, "single"); | |
return | |
} | |
var H = true; | |
var B = I[0].tagName; | |
I.each(function(O, P) { | |
if (P.tagName != B || P.attributes.length > 0 || $(P).children().length > 0) { | |
H = false; | |
return false | |
} | |
}); | |
if (H) { | |
var E = b(w, a(G.tagName)); | |
var L = g(G, E, r); | |
if (L.access == null && q[E] != null) { | |
L.access = q[E] | |
} | |
var F = {}; | |
$.each(L, function(P, O) { | |
F[P] = O | |
}); | |
var K = []; | |
var A = []; | |
var C = true; | |
I.each(function(O, R) { | |
var P = $(R).text(); | |
var Q = o(P); | |
C &= $.typeOf(Q) != "string"; | |
K.push(P); | |
A.push(Q) | |
}); | |
if (C) { | |
F.value = A | |
} else { | |
F.value = K | |
} | |
f(F); | |
v(E, F, "list"); | |
return | |
} | |
var D = a(G.tagName); | |
var E = b(w, D); | |
if (x[E]) { | |
if (u[E] == null) { | |
u[E] = 0 | |
} | |
D += "[" + u[E] + "]"; | |
++u[E]; | |
E = b(w, D) | |
} | |
var L = g(G, E, r); | |
var F = {}; | |
var N = 0; | |
$.each(L, function(P, O) { | |
F[P] = O; | |
++N | |
}); | |
if (N == 1 && F.access != null) { | |
q[E] = F.access | |
} else { | |
if (N > 0) { | |
v(E, F, "struct") | |
} | |
} | |
if (z > 0) { | |
w.push(D) | |
} | |
I.each(function(O, P) { | |
s(P, z + 1) | |
}); | |
if (z > 0) { | |
w.pop() | |
} | |
}) | |
} | |
var r = e(t.tagName); | |
var x = j[r] || []; | |
var u = {}; | |
var w = []; | |
var q = {}; | |
s(t, 0); | |
$.each(u, function(z, y) { | |
v(z + ".len", y, "single") | |
}); | |
return r | |
}; | |
n.cnv2JsObj = function(w, t) { | |
function q() { | |
if (r[s] == null) { | |
r[s] = [] | |
} | |
r[s].push(v) | |
} | |
function x(C, B, A) { | |
var E; | |
$.each(t, function(F, G) { | |
if (G.path + l == C.substring(0, G.path.length + 1)) { | |
E = G; | |
return false | |
} | |
}); | |
if (E) { | |
var D = C.substring(E.path.length + 1); | |
var z = $.inArray(D, E.fields); | |
if (z < 0) { | |
return | |
} | |
if (s != null && s != E.path) { | |
if (u != null) { | |
q() | |
} | |
u = null | |
} | |
s = E.path; | |
if (u == null) { | |
v = {} | |
} else { | |
if (u >= z) { | |
q(); | |
v = {} | |
} | |
} | |
v[D] = B; | |
u = z; | |
return | |
} | |
if (u != null) { | |
q(); | |
s = null; | |
u = null | |
} | |
r[C] = B; | |
if (B.xpath) { | |
y[B.xpath] = B; | |
delete B.xpath | |
} | |
} | |
var r = {}; | |
var y = {}; | |
var s; | |
var v; | |
var u; | |
r.root = e(w.tagName); | |
t = t || c[r.root] || []; | |
n.parse(w, x); | |
return { | |
jsObj: r, | |
xpath: y | |
} | |
}; | |
var c = {}; | |
c.ConsumableConfigCap = [{ | |
path: "ConsumableInfo.ConsumableIcon.FillColor", | |
fields: ["Red", "Green", "Blue"] | |
}, { | |
path: "ConsumableInfo.ConsumableIcon.OutlineColor", | |
fields: ["Red", "Green", "Blue"] | |
}, { | |
path: "ConsumableInfo.ConsumableIcon.BackGroundColor", | |
fields: ["Red", "Green", "Blue"] | |
}, { | |
path: "ConsumableInfo.ConsumableIcon.RGBTextColor", | |
fields: ["Red", "Green", "Blue"] | |
}]; | |
c.MassStorageConfigCap = [{ | |
path: "DevicesSupported.DeviceSupported", | |
fields: ["DigitalStorageTypeEnum", "EnableDisable"] | |
}]; | |
c.ProductConfigCap = [{ | |
path: "ProductInformation.Personality.Interpreter", | |
fields: ["DocumentFormat", "Description", "Version.Revision"] | |
}]; | |
var j = {}; | |
j.IoCapabilities = { | |
"UsbConfigs.UsbConfig": true | |
}; | |
j.MediaCap = { | |
"BasicPrintModeSettings.BasicPrintModeSettings": true | |
}; | |
j.MediaHandlingCap = { | |
InputTray: true, | |
OutputBin: true, | |
"InputTray[0].MediaSettingsBySizeCategory.MediaSettingBySizeCategory": true | |
}; | |
j.ConsumableConfigCap = { | |
"ProductConsumableInfo.FrontPanelAlertsConfig": true | |
}; | |
j.ScanCaps = { | |
"Adf.InputSource.SupportedResolutions.Resolution": true, | |
"ColorEntries.ColorEntry": true, | |
"Platen.InputSource.SupportedResolutions.Resolution": true | |
}; | |
var p = {}; | |
n.reg = function(r, q) { | |
if (p[r] == null) { | |
p[r] = n.cnv2JsObj(q) | |
} | |
}; | |
n.invalidate = function() { | |
p = {} | |
}; | |
n.getField = function(q, r) { | |
if (p[q] == null) { | |
return null | |
} | |
if (p[q].xpath[r] != null) { | |
return p[q].xpath[r] | |
} | |
return p[q].jsObj[r] | |
}; | |
n.setField = function(q, s, r) { | |
if (p[q] == null) { | |
p[s] = {} | |
} | |
if (p[q].xpath[s] != null) { | |
p[q].xpath[s] = r | |
} | |
p[q].jsObj[s] = r | |
} | |
})(); | |
(function(g) { | |
var d = "browserAlert"; | |
var b = "msie"; | |
var h = "firefox"; | |
var f = "chrome"; | |
var c = "safari"; | |
var a = "unsupported"; | |
g.hlp.detectUnsupportedBrowser = function() { | |
var j = navigator.platform; | |
if (gui.isMobileView() || gui.isTabletDevice() || te.cookie.getVal(d) || j.indexOf("iPhone") >= 0 || j.indexOf("iPod") >= 0) { | |
return false | |
} | |
var k = navigator.userAgent.toLowerCase(); | |
if (g.browser.msie) { | |
if (parseFloat(g.browser.version) < 7) { | |
return e(b) | |
} | |
} else { | |
if (g.browser.msie11) { | |
return false | |
} else { | |
if (g.browser.mozilla && k.indexOf("firefox/") >= 0) { | |
if (k.indexOf("navigator/") >= 0) { | |
return e(a) | |
} else { | |
if (parseFloat(g.browser.version) < 3) { | |
return e(h) | |
} | |
} | |
} else { | |
if (g.browser.opera15) { | |
return e(a) | |
} else { | |
if (g.browser.chrome) { | |
k = k.substring(k.indexOf("chrome/") + 7); | |
if (parseFloat(k) < 5) { | |
return e(f) | |
} | |
} else { | |
if (g.browser.safari) { | |
k = k.substring(k.indexOf("version/") + 8); | |
if (parseFloat(k) < 3) { | |
return e(c) | |
} | |
} else { | |
if (k.indexOf("opera mobi") != -1) { | |
return false | |
} else { | |
return e(a) | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
return false | |
}; | |
function e(s) { | |
var p = ""; | |
var j = ""; | |
var m = ""; | |
var r = ""; | |
var o = ""; | |
var q = ""; | |
var l = ""; | |
function k(u) { | |
var t = ""; | |
t += gui.emitHtml("p", { | |
"class": "gui-indent-ctl" | |
}, "» " + gui.emitHtml("a", { | |
target: "_blank", | |
href: u.link | |
}, u.text)); | |
return t | |
} | |
m = k({ | |
link: "http://www.google.com", | |
text: "Chrome" | |
}); | |
r = k({ | |
link: "http://www.mozilla.org", | |
text: "Firefox" | |
}); | |
o = k({ | |
link: "http://www.microsoft.com", | |
text: "Internet Explorer" | |
}); | |
q = k({ | |
link: "http://www.apple.com", | |
text: "Safari" | |
}); | |
if (s != a) { | |
j = te.loc("L@S#3926"); | |
if (s == f) { | |
p = m | |
} else { | |
if (s == h) { | |
p = r | |
} else { | |
if (s == b) { | |
p = o | |
} else { | |
if (s == c) { | |
p = q | |
} | |
} | |
} | |
} | |
} else { | |
j = te.loc("L@S#3925"); | |
p = m + r + o + q | |
} | |
l = g.hlp.getTmpDivId(); | |
p = j + gui.emitHtml("div", { | |
"class": "gui-input-standalone" | |
}, p) + gui.emitHtml("div", { | |
"class": "gui-input-standalone" | |
}, gui.emitHtml("label", {}, gui.emitHtml("input", { | |
type: "checkbox", | |
id: l | |
}, te.loc("L@S#2736")))); | |
gui.YNDialogBox.show({ | |
title: te.loc("L@S#3924"), | |
contents: p, | |
customBtnText: ["L@S#2303"] | |
}, n); | |
function n() { | |
var u = 4 / 24; | |
var t = g("#" + l).attr("checked"); | |
if (t) { | |
te.cookie.set(d, t, te.LONG_STORED_DURATION_DAYS) | |
} else { | |
te.cookie.set(d, false, u) | |
} | |
window.location.reload() | |
} | |
return true | |
} | |
})(jQuery); | |
(function(a) { | |
a.hlp.countryMap = {}; | |
a.hlp.countryMap.nameMap = { | |
africa: "L@S#1419", | |
angola: "L@S#3812", | |
northAfrica: "L@S#1419", | |
argentina: "L@S#0613", | |
asiaPacific: "L@S#1417", | |
australia: "L@S#0619", | |
austria: "L@S#0625", | |
belarus: "L@S#0649", | |
belgium: "L@S#0634", | |
brazil: "L@S#0609", | |
bulgaria: "L@S#0653", | |
canada: "L@S#0611", | |
chile: "L@S#0614", | |
china: "L@S#0605", | |
colombia: "L@S#0615", | |
costaRica: "L@S#0748", | |
croatia: "L@S#0652", | |
czechRepublic: "L@S#3940", | |
denmark: "L@S#0629", | |
ecuador: "L@S#0749", | |
egypt: "L@S#0650", | |
estonia: "L@S#1104", | |
europe: "L@S#1415", | |
finland: "L@S#0635", | |
france: "L@S#0636", | |
germany: "L@S#0628", | |
greece: "L@S#0638", | |
guatemala: "L@S#0750", | |
hongKongSAR: "L@S#0622", | |
hungary: "L@S#0645", | |
iceland: "L@S#3048", | |
india: "L@S#0620", | |
indonesia: "L@S#0751", | |
ireland: "L@S#0633", | |
israel: "L@S#0618", | |
italy: "L@S#0640", | |
japan: "L@S#0608", | |
jordan: "L@S#1105", | |
kazakhstan: "L@S#1106", | |
korea: "L@S#0604", | |
kuwait: "L@S#1107", | |
latinAmerica: "L@S#1421", | |
latvia: "L@S#1108", | |
lebanon: "L@S#1109", | |
lithuania: "L@S#1110", | |
malaysia: "L@S#0752", | |
mexico: "L@S#0610", | |
middleEast: "L@S#1418", | |
morocco: "L@S#0648", | |
mozambique: "L@S#3813", | |
netherlandsThe: "L@S#0626", | |
newZealand: "L@S#0616", | |
norway: "L@S#0632", | |
pakistan: "L@S#1111", | |
panama: "L@S#0753", | |
paraguay: "L@S#0754", | |
peru: "L@S#0755", | |
philippines: "L@S#0646", | |
poland: "L@S#0642", | |
portugal: "L@S#0639", | |
qatar: "L@S#1112", | |
romania: "L@S#0756", | |
russia: "L@S#0647", | |
saudiArabia: "L@S#0621", | |
singapore: "L@S#0623", | |
slovakia: "L@S#0643", | |
slovenia: "L@S#0651", | |
southAfrica: "L@S#0631", | |
spain: "L@S#0641", | |
sweden: "L@S#0630", | |
switzerland: "L@S#0627", | |
taiwan: "L@S#0606", | |
thailand: "L@S#0607", | |
tunisia: "L@S#1113", | |
turkey: "L@S#0637", | |
unitedArabEmirates: "L@S#1114", | |
unitedKingdom: "L@S#0624", | |
ukraine: "L@S#1115", | |
uruguay: "L@S#0757", | |
unitedStates: "L@S#0612", | |
northAmericaUSACanada: "L@S#1420", | |
venezuela: "L@S#0617", | |
vietnam: "L@S#0758", | |
serbiaMontenegro: "L@S#0654", | |
yemen: "L@S#3259" | |
}; | |
a.hlp.countryMap.sipMap = { | |
unitedStates: "US", | |
canada: "CA", | |
northAmericaUSACanada: "WW", | |
NALAAP: "WW", | |
notSupported: "WW", | |
universal: "WW", | |
austria: "AT", | |
belarus: "BY", | |
belgium: "BE", | |
bulgaria: "BG", | |
croatia: "HR", | |
cyprus: "WW", | |
czechRepublic: "CZ", | |
denmark: "DK", | |
egypt: "EG", | |
estonia: "EE", | |
finland: "FI", | |
france: "FR", | |
germany: "DE", | |
greece: "GR", | |
hungary: "HU", | |
iceland: "IS", | |
ireland: "IE", | |
israel: "IL", | |
italy: "IT", | |
jordan: "JO", | |
kazakhstan: "KZ", | |
kuwait: "KW", | |
latvia: "LV", | |
lebanon: "LB", | |
liechtenstein: "WW", | |
lithuania: "LT", | |
luxembourg: "WW", | |
malta: "WW", | |
morocco: "MA", | |
netherlandsThe: "NL", | |
norway: "NO", | |
pakistan: "PK", | |
poland: "PL", | |
portugal: "PT", | |
qatar: "QA", | |
romania: "RO", | |
russia: "RU", | |
saudiArabia: "SA", | |
slovakia: "SK", | |
slovenia: "SI", | |
southAfrica: "ZA", | |
spain: "ES", | |
sweden: "SE", | |
switzerland: "CH", | |
tunisia: "TN", | |
turkey: "TR", | |
unitedArabEmirates: "AE", | |
ukraine: "UA", | |
unitedKingdom: "GB", | |
japanCISMEA: "WW", | |
europe: "WW", | |
middleEast: "WW", | |
nordic: "WW", | |
northAfrica: "WW", | |
northWestAfrica: "WW", | |
southernAfrica: "WW", | |
africa: "WW", | |
australia: "AU", | |
brunei: "WW", | |
cambodia: "WW", | |
china: "CN", | |
hongKongSAR: "HK", | |
india: "IN", | |
indonesia: "ID", | |
japan: "JP", | |
korea: "KR", | |
malaysia: "MY", | |
newZealand: "NZ", | |
philippines: "PH", | |
singapore: "SG", | |
sriLanka: "WW", | |
taiwan: "TW", | |
thailand: "TH", | |
vietnam: "VN", | |
asiaPacific: "WW", | |
indiaChina: "WW", | |
argentina: "AR", | |
brazil: "BR", | |
chile: "CL", | |
columbia: "CO", | |
costaRica: "CR", | |
ecuador: "EC", | |
guatemala: "GT", | |
mexico: "MX", | |
panama: "PA", | |
paraguay: "PY", | |
peru: "PE", | |
uruguay: "UY", | |
venezuela: "VE", | |
caribbean: "WW", | |
latinAmerica: "WW", | |
unknown: "WW" | |
}; | |
a.hlp.countryMap.HPCOM = { | |
africa: "emea_africa", | |
angola: "emea_africa", | |
argentina: "ar", | |
australia: "au", | |
austria: "at", | |
belarus: "by", | |
belgium: "be", | |
bolivia: "bo", | |
brazil: "br", | |
bulgaria: "bg", | |
canada: "ca", | |
caribbean: "lamerica_nsc", | |
chile: "cl", | |
china: "cn", | |
colombia: "co", | |
costaRica: "lamerica_nsc_cnt_amer", | |
croatia: "hr", | |
czechRepublic: "cz", | |
denmark: "dk", | |
ecuador: "ec", | |
egypt: "emea_middle_east", | |
estonia: "ee", | |
finland: "fi", | |
france: "fr", | |
germany: "de", | |
greece: "gr", | |
guatemala: "lamerica_nsc_cnt_amer", | |
hongKongSAR: "hk", | |
hungary: "hu", | |
iceland: "is", | |
india: "in", | |
indonesia: "id", | |
iran: "emea_middle_east", | |
ireland: "ie", | |
israel: "il", | |
italy: "it", | |
japan: "jp", | |
jordan: "emea_middle_east", | |
kazakhstan: "kz", | |
korea: "kr", | |
kuwait: "emea_middle_east", | |
latvia: "lv", | |
lebanon: "emea_middle_east", | |
lithuania: "lt", | |
malaysia: "my", | |
mexico: "mx", | |
middleEast: "emea_middle_east", | |
morocco: "emea_africa", | |
mozambique: "emea_africa", | |
netherlandsThe: "nl", | |
newZealand: "nz", | |
norway: "no", | |
pakistan: "pk", | |
panama: "lamerica_nsc_cnt_amer", | |
paraguay: "py", | |
peru: "pe", | |
philippines: "ph", | |
poland: "pl", | |
portugal: "pt", | |
qatar: "emea_middle_east", | |
romania: "ro", | |
russia: "ru", | |
saudiArabia: "sa", | |
serbiaMontenegro: "rs", | |
singapore: "sg", | |
slovakia: "sk", | |
slovenia: "si", | |
southAfrica: "za", | |
spain: "es", | |
switzerland: "ch", | |
sweden: "se", | |
taiwan: "tw", | |
thailand: "th", | |
turkey: "tr", | |
tunisia: "tn", | |
ukraine: "ua", | |
unitedArabEmirates: "emea_middle_east", | |
unitedKingdom: "uk", | |
unitedStates: "us", | |
uruguay: "uy", | |
venezuela: "ve", | |
vietnam: "vn" | |
}; | |
a.hlp.countryMap.autoOffList = ["austria", "belarus", "belgium", "bulgaria", "croatia", "czechRepublic", "denmark", "estonia", "europe", "finland", "france", "germany", "greece", "hungary", "iceland", "ireland", "italy", "lithuania", "luxembourg", "netherlandsThe", "norway", "poland", "portugal", "romania", "russia", "slovakia", "slovenia", "spain", "sweden", "switzerland", "unitedKingdom"]; | |
a.hlp.countryMap.letterList = ["argentina", "canada", "colombia", "costaRica", "guatemala", "mexico", "northAmericaUSACanada", "panama", "paraguay", "peru", "unitedStates", "uruguay", "venezuela"]; | |
a.hlp.countryMap.asiaList = ["china", "hongKongSAR", "india", "indonesia", "korea", "malaysia", "newZealand", "pakistan", "philippines", "singapore", "taiwan", "thailand", "vietnam"]; | |
a.hlp.countryMap.northAmericaList = ["canada", "northAmericaUSACanada", "unitedStates"]; | |
a.hlp.countryMap.southAmericaList = ["argentina", "chile", "colombia", "costaRica", "ecuador", "guatemala", "mexico", "panama", "paraguay", "peru", "uruguay", "venezuela"] | |
})(jQuery); | |
(function(b) { | |
function a(c) { | |
b("body").append(b.hlp.emitHtml("iframe", { | |
id: c.iFrameId, | |
name: c.iFrameId, | |
src: "about:blank", | |
"class": c.cls, | |
scrolling: "auto", | |
border: 0, | |
width: 0, | |
height: 0 | |
}, "<p>Your browser does not support iframes.")) | |
} | |
b.hlp.dnldFile = function(d) { | |
d = b.extend({ | |
cls: "", | |
iFrameId: "app-dnld-iframe", | |
complete: b.noop | |
}, d); | |
if (d.src == null) { | |
console.error("No src"); | |
return | |
} | |
var c = "#" + d.iFrameId; | |
if (b(c).length == 0) { | |
a(d) | |
} | |
b(c).unbind("load"); | |
b(c).load(function() { | |
b(c).unbind("load"); | |
d.complete.call(this) | |
}); | |
b(c).attr("src", "about:blank"); | |
b(c).attr("src", d.src) | |
}; | |
b.hlp.uploadFile = function(e) { | |
e = b.extend({ | |
cls: "", | |
formId: "app-upload-form", | |
iFrameId: "app-upload-iframe", | |
complete: b.noop | |
}, e); | |
var c = "#" + e.formId; | |
if (b(c).length == 0) { | |
console.error("Upload form " + e.formId + " does not exist"); | |
return | |
} | |
if (e.url == null) { | |
console.error("No upload URL"); | |
return | |
} | |
var d = "#" + e.iFrameId; | |
if (b(d).length == 0) { | |
a(e) | |
} | |
b(d).unbind("load"); | |
b(d).load(function() { | |
b(d).unbind("load"); | |
e.complete.call(this) | |
}); | |
b(c).attr("target", e.iFrameId); | |
b(c).attr("action", e.url); | |
b(c).submit() | |
} | |
})(jQuery); | |
(function() { | |
$.browseHistory = {}; | |
$.browseHistory.forcePageLoad = function() { | |
e = true | |
}; | |
$.browseHistory.mkALink = function(l) { | |
if ($.typeOf(l) == "object") { | |
l = l.pgmName | |
} | |
return j + l | |
}; | |
$.browseHistory.clickALink = function(l) { | |
if ($.typeOf(l) == "string") { | |
l = pageMgr.getPageByName(l) | |
} | |
$.browseHistory.forcePageLoad(); | |
return b($.browseHistory.mkALink(l)) | |
}; | |
$.browseHistory.startMonitorHref = function() { | |
setTimeout(d, h) | |
}; | |
$.browseHistory.setDefaultPage = function(l) { | |
c = l | |
}; | |
var h = 100; | |
var g = "pgm-history-iframe"; | |
var j = "hId-"; | |
var e; | |
var k; | |
var c = "pgHome"; | |
var f = { | |
netProtoPage: "pgNetProto" | |
}; | |
function b(l) { | |
$("body").trigger("hrefClicked", l.substring(j.length)); | |
window.location.hash = l; | |
if (!$.browser.msie || parseInt($.browser.version, 10) >= 8) { | |
return true | |
} | |
var m = document.getElementById(g).contentWindow.document; | |
m.open("javascript:'<html></html>'"); | |
m.write("<html><head><script type='text/javascript'>parent.onFrameLoaded('" + l + "');<\/script></head><body></body></html>"); | |
m.close(); | |
return false | |
} | |
function d() { | |
if ((k != window.location.hash && window.location.hash != "#contentPane") || e) { | |
k = window.location.hash; | |
e = false; | |
var l = te.getWinLocHashPageName(); | |
$("body").trigger("hrefChanged", f[l] || l) | |
} | |
setTimeout(d, h) | |
} | |
var a = $.browser.msie && parseInt($.browser.version, 10) < 8; | |
$.browseHistory.iniHash = location.hash.substring(1); | |
if (a) { | |
window.onFrameLoaded = function(l) { | |
if (l === undefined) { | |
l = $.browseHistory.iniHash | |
} | |
window.location.hash = l | |
} | |
} | |
$(document).ready(function() { | |
if (a) { | |
$("body").append($.hlp.emitHtml("iframe", { | |
id: g, | |
src: "/framework/HistoryFrame.html", | |
style: "display: none" | |
}, "")) | |
} | |
}) | |
})(); | |
(function(a) { | |
a.hlp.langCodeMap = { | |
arb: { | |
code2d: "ar", | |
hubLangCode: "en", | |
isRTL: true, | |
text: "‭(Arabic) ‮العربية" | |
}, | |
bul: { | |
code2d: "bg", | |
text: "БългарÑки (Bulgarian)‎" | |
}, | |
cat: { | |
code2d: "ca", | |
text: "Català (Catalan)‎" | |
}, | |
zhi: { | |
code2d: "zh-cn", | |
ledmCode: "zh-CN", | |
jqCode: "zh-CN", | |
hubLangCode: "zh-hans", | |
hpCom: "zh", | |
text: "简体ä¸æ–‡ (Simplified Chinese)‎" | |
}, | |
zho: { | |
code2d: "zh-tw", | |
ledmCode: "zh-TW", | |
jqCode: "zh-TW", | |
hubLangCode: "zh-hant", | |
hpCom: "zh", | |
text: "ç¹é«”ä¸æ–‡ (Traditional Chinese)‎" | |
}, | |
hrv: { | |
code2d: "hr", | |
text: "Hrvatski (Croatian)‎" | |
}, | |
cze: { | |
code2d: "cs", | |
text: "Cesky (Czech)‎" | |
}, | |
dan: { | |
code2d: "da", | |
text: "Dansk (Danish)‎" | |
}, | |
nla: { | |
code2d: "nl", | |
text: "Nederlands (Dutch)‎" | |
}, | |
eng: { | |
code2d: "en", | |
jqCode: "", | |
text: "English" | |
}, | |
fin: { | |
code2d: "fi", | |
text: "Suomi (Finnish)‎" | |
}, | |
fre: { | |
code2d: "fr", | |
text: "Français (French)‎" | |
}, | |
ger: { | |
code2d: "de", | |
text: "Deutsch (German)‎" | |
}, | |
gre: { | |
code2d: "el", | |
text: "Ελληνικά (Greek)‎" | |
}, | |
heb: { | |
code2d: "he", | |
isRTL: true, | |
text: "‭(Hebrew) ‮עברית" | |
}, | |
hun: { | |
code2d: "hu", | |
text: "Magyar (Hungarian)‎" | |
}, | |
ita: { | |
code2d: "it", | |
text: "Italiano (Italian)‎" | |
}, | |
jpn: { | |
code2d: "ja", | |
text: "日本語 (Japanese)‎" | |
}, | |
kor: { | |
code2d: "ko", | |
text: "í•œêµì–´ (Korean)‎" | |
}, | |
nor: { | |
code2d: "no", | |
text: "Norsk (Norwegian)‎" | |
}, | |
pol: { | |
code2d: "pl", | |
text: "Polski (Polish)‎" | |
}, | |
por: { | |
code2d: "pt", | |
jqCode: "pt-BR", | |
text: "Português (Portuguese)‎" | |
}, | |
rum: { | |
code2d: "ro", | |
text: "Româna (Romanian)‎" | |
}, | |
rus: { | |
code2d: "ru", | |
text: "РуÑÑкий (Russian)‎" | |
}, | |
slo: { | |
code2d: "sk", | |
text: "Slovencina (Slovak)‎" | |
}, | |
slv: { | |
code2d: "sl", | |
text: "SlovenÅ¡cina (Slovenian)‎" | |
}, | |
spa: { | |
code2d: "es", | |
text: "Español (Spanish)‎" | |
}, | |
swe: { | |
code2d: "sv", | |
text: "Svenska (Swedish)‎" | |
}, | |
tha: { | |
code2d: "th", | |
text: "(Thai)‎" | |
}, | |
tur: { | |
code2d: "tr", | |
text: "Türkçe (Turkish)‎" | |
}, | |
ukr: { | |
code2d: "ua", | |
text: "(Ukrainian)‎" | |
} | |
} | |
})(jQuery); | |
(function(f) { | |
var d = 200; | |
f.ajaxSetup({ | |
timeout: f.getAjaxLedmTimeoutMs() | |
}); | |
var a = null; | |
var c = null; | |
var h = null; | |
var e = null; | |
f.resLoader = {}; | |
f.resLoader.loadResources = function(q, p) { | |
function j(v) { | |
function u(x, w, y) { | |
v.pgmLoaded = true; | |
v.pgmStatus = d; | |
if (v.pgmData == null) { | |
v.pgmData = x | |
} | |
if (v.dataType == "ledm" || v.dataType == "manifest") { | |
v.pgmXmlData = x | |
} | |
v.success(x, w, y) | |
} | |
function s(D, x, C) { | |
console.warn("error: " + v.file + ", err " + x); | |
v.pgmLoaded = true; | |
v.pgmErr = true; | |
if (x == "error") { | |
var w = D.getResponseHeader("Content-Type"); | |
var A = f.trim(D.responseText); | |
if ((v.dataType == "ledm" || v.dataType == "manifest") && w == "text/xml" && A != "" && D.status == d) { | |
var z, B, y; | |
if ((y = A.indexOf("<err:ErrorInfo")) >= 0) { | |
B = A.substr(y) | |
} | |
z = B && f.parseXML(B); | |
if (z) { | |
v.pgmStatus = f(z).find("err\\:HttpCode, HttpCode").text() | |
} | |
} else { | |
if (D.status == d) { | |
v.pgmStatus = x | |
} else { | |
v.pgmStatus = +D.status | |
} | |
} | |
} else { | |
v.pgmStatus = x | |
} | |
v.error(D, x, C) | |
} | |
function r(x, w) { | |
v.pgmComplete = true; | |
v.pgmHttpResponseData = {}; | |
f.each(v.pgmHttpResponseHdr || [], function(y, z) { | |
v.pgmHttpResponseData[z] = x.getResponseHeader(z) | |
}); | |
v.complete(x, w) | |
} | |
v.pgmLoaded = false; | |
v.pgmComplete = false; | |
v.pgmErr = false; | |
switch (v.dataType) { | |
case "ledm": | |
case "manifest": | |
if (v.op != "get" && v.pgmData == null) { | |
console.error("loadResources() " + v.op + ": null pgmData for " + v.file); | |
return false | |
} | |
var t = { | |
url: v.file, | |
linkUrl: v.arg, | |
type: v.op, | |
dataType: v.dataType, | |
data: v.pgmData, | |
cache: v.cache, | |
timeout: v.timeout, | |
success: u, | |
error: s, | |
complete: r, | |
getAjaxObj: function(w) { | |
if (v.op == "get") { | |
v.pgmData = w | |
} | |
} | |
}; | |
if (v.op != "get") { | |
t.putDiff = v.noDiff != null ? !v.noDiff : true | |
} | |
return t; | |
case "css": | |
return { | |
url: v.file, dataType: "css", applyDirectly: true, success: u, error: s, complete: r | |
}; | |
case "script": | |
return { | |
url: v.file, dataType: "script", loadRequired: true, success: u, error: s, complete: r | |
}; | |
default: | |
if (v.op == "get") { | |
v.pgmData = null | |
} | |
var t = { | |
type: v.op, | |
url: v.file, | |
contentType: v.contentType, | |
data: v.arg, | |
dataType: v.dataType, | |
cache: v.cache, | |
headers: v.headers, | |
beforeSend: v.beforeSend, | |
success: u, | |
error: s, | |
complete: r | |
}; | |
if (v.timeout != null) { | |
t.timeout = v.timeout | |
} | |
return t | |
} | |
} | |
function o(s, r, t) { | |
q.hasErr = false | |
} | |
function k(t, r, s) { | |
q.hasErr = true | |
} | |
function m(s, r) { | |
p.complete(q) | |
} | |
var n = this; | |
p = f.resLoader.fillInLoadOpts(p, "get"); | |
q = f.resLoader.fillInResList(q, p.op); | |
f.ajaxSetup({ | |
timeout: p.timeout | |
}); | |
var l = []; | |
f.each(q, function(r, s) { | |
l.push(j(s)) | |
}); | |
f.ajax({ | |
batch: l, | |
success: o, | |
error: k, | |
complete: m | |
}) | |
}; | |
f.resLoader.fillInLoadOpts = function(j, k) { | |
if (f.typeOf(j) == "function") { | |
j = { | |
complete: j | |
} | |
} | |
j = f.fillIn(j, { | |
op: k, | |
timeout: f.getAjaxLedmTimeoutMs(), | |
complete: f.noop | |
}); | |
return j | |
}; | |
f.resLoader.fillInResList = function(k, n, m) { | |
if (!f.isArray(k)) { | |
k = [k] | |
} | |
for (var j = 0; j < k.length; ++j) { | |
var l = k[j]; | |
if (f.typeOf(l) == "string") { | |
l = k[j] = { | |
file: l | |
} | |
} | |
f.fillIn(l, { | |
op: n, | |
success: f.noop, | |
error: f.noop, | |
complete: f.noop | |
}); | |
if (l.op == "del") { | |
l.op = "delete" | |
} | |
if (l.dataType === undefined) { | |
l.dataType = g(l) | |
} | |
if (l.cache === undefined) { | |
l.cache = b(l.dataType) | |
} | |
if (m !== undefined) { | |
m(l) | |
} | |
} | |
return k | |
}; | |
function g(l) { | |
if (l.file.match("^.*Manifest.*/")) { | |
return "manifest" | |
} | |
if (l.file.match("^.*(Cap|Dyn).xml$")) { | |
return "ledm" | |
} | |
var k = l.file.lastIndexOf("."); | |
var j = ""; | |
if (k >= 0) { | |
j = l.file.substr(k + 1) | |
} | |
switch (j) { | |
case "css": | |
case "xml": | |
case "json": | |
return j; | |
case "js": | |
return "script"; | |
default: | |
return "text" | |
} | |
} | |
function b(j) { | |
switch (j) { | |
case "xml": | |
return a; | |
case "json": | |
return c; | |
case "js": | |
return h; | |
default: | |
return e | |
} | |
} | |
})(jQuery); | |
(function(a) { | |
a.resLoader.isSysFile = function(b) { | |
return b.search(/\.(js|css|htf)$/) >= 0 | |
}; | |
a.resLoader.isHtfFile = function(b) { | |
return b.search(/\.htf$/) >= 0 | |
}; | |
a.resLoader.isJsFile = function(b) { | |
return b.search(/\.js$/) >= 0 | |
}; | |
a.resLoader.isCssFile = function(b) { | |
return b.search(/\.css$/) >= 0 | |
}; | |
a.resLoader.isXmlFile = function(b) { | |
return b.search(/\.xml$/) >= 0 | |
}; | |
a.resLoader.isAbsPath = function(b) { | |
return b.charAt(0) == "/" | |
}; | |
a.resLoader.mkAbsPathFromRefFile = function(c, b) { | |
var d = b.lastIndexOf("/"); | |
var e = b.substr(0, d); | |
if (c.charAt(0) != "/") { | |
c = e + "/" + c | |
} | |
return c | |
}; | |
a.resLoader.splitDependsName = function(b) { | |
var c; | |
var d = b.indexOf(":"); | |
if (d >= 0) { | |
c = b.substring(0, d); | |
b = b.substring(d + 1) | |
} | |
return { | |
file: b, | |
type: c | |
} | |
}; | |
a.resLoader.init = function() { | |
a.each(apps.fileDependencies, function(c, b) { | |
if (b.list == null) { | |
b.list = [] | |
} | |
a.each(b.list, function(d, g) { | |
var f = a.resLoader.splitDependsName(g); | |
var e = a.resLoader.mkAbsPathFromRefFile(f.file, c); | |
if (a.resLoader.isSysFile(f.file) && !a.resLoader.isAbsPath(f.file)) { | |
if (f.type != null) { | |
b.list[d] = f.type + ":" + e | |
} else { | |
b.list[d] = e | |
} | |
} | |
if (!a.resLoader.isJsFile(e)) { | |
return | |
} | |
if (!a.resLoader.fileExists(e)) { | |
apps.fileDependencies[e] = { | |
list: [], | |
optList: [] | |
} | |
} | |
}); | |
if (b.optList == null) { | |
b.optList = [] | |
} | |
}); | |
apps.replacedFiles = {}; | |
a.each(apps.combinedFiles || {}, function(c, b) { | |
a.each(b || [], function(d, e) { | |
apps.replacedFiles[e] = c | |
}) | |
}); | |
delete apps.combinedFiles | |
}; | |
a.resLoader.fileExists = function(b) { | |
return apps.fileDependencies[b] != null | |
}; | |
a.resLoader.getJsDependencies = function(b) { | |
if (apps.replacedFiles[b] != null) { | |
b = apps.replacedFiles[b] | |
} | |
if (apps.fileDependencies[b]) { | |
return apps.fileDependencies[b].list | |
} else { | |
return [] | |
} | |
}; | |
a.resLoader.getCondJsDependencies = function(b) { | |
if (apps.replacedFiles[b] != null) { | |
b = apps.replacedFiles[b] | |
} | |
if (apps.fileDependencies[b]) { | |
return apps.fileDependencies[b].optList | |
} else { | |
return [] | |
} | |
}; | |
a.resLoader.getLedmResourceList = function(d) { | |
function c(h, g) { | |
if (a.inArray(g, h) < 0) { | |
h.push(g) | |
} | |
} | |
if (apps.replacedFiles[d] != null) { | |
d = apps.replacedFiles[d] | |
} | |
var e = apps.fileDependencies[d]; | |
if (e == null) { | |
return null | |
} | |
var b = []; | |
a.each(e.list, function(f, j) { | |
var h = a.resLoader.splitDependsName(j); | |
if (a.resLoader.isJsFile(h.file)) { | |
var g = a.resLoader.mkAbsPathFromRefFile(h.file, d); | |
a.each(a.resLoader.getLedmResourceList(g), function(k, l) { | |
c(b, l) | |
}); | |
return | |
} | |
if (h.type == "ledm") { | |
c(b, h.file) | |
} | |
}); | |
a.each(e.optList, function(f, j) { | |
var h = a.resLoader.splitDependsName(j); | |
if (a.resLoader.isJsFile(h.file)) { | |
var g = a.resLoader.mkAbsPathFromRefFile(h.file, d); | |
a.each(a.resLoader.getLedmResourceList(g), function(k, l) { | |
c(b, l) | |
}); | |
return | |
} | |
if (h.type == "ledm" && a.resLoader.hasLedmResource(h.file)) { | |
c(b, h.file) | |
} | |
}); | |
return b | |
}; | |
a.resLoader.hasLedmResource = function(d) { | |
var e = a.hlp.ledm.getManifestCpnt(d); | |
if (e == null) { | |
return a.hlp.ledm.hasTree(d) | |
} | |
if (!a.hlp.ledm.hasTree(e)) { | |
return false | |
} | |
var b = a.hlp.ledm.SmartObj(d); | |
var g = a.hlp.ledm.toURI(e); | |
var c = b.reqfiles[1]; | |
return a.hlp.ledm.toURI(c, a.ajaxLocalCacheGetManifest(g)) | |
}; | |
a.resLoader.isLedmResourcePresent = function(d) { | |
var c = a.resLoader.getLedmResourceList(d); | |
if (c == null) { | |
return false | |
} | |
var b = true; | |
a.each(c, function(e, f) { | |
if (!a.resLoader.hasLedmResource(f)) { | |
b = false; | |
return false | |
} | |
}); | |
return b | |
} | |
})(jQuery); | |
(function(b) { | |
var a = {}; | |
b.locMap = {}; | |
b.locMap.get = function(c) { | |
return a[c] | |
}; | |
b.locMap.register = function(d, c) { | |
if (a[d]) { | |
console.warn("locMap: " + d + " is already registered") | |
} | |
a[d] = c | |
} | |
})(jQuery); | |
(function(b) { | |
var a = {}; | |
var c = {}; | |
b.locStr = {}; | |
b.locStr.add = function(d) { | |
a[d.id] = d | |
}; | |
b.locStr.has = function(d) { | |
return !!a[d] | |
}; | |
b.locStr.subLiteral = function(e, d) { | |
return e.replace(/"(EWS_STRING_[a-zA-Z0-9_]+|L@S#[0-9]+)"/g, function(f, g) { | |
return d(g) | |
}) | |
}; | |
b.locStr.get = function(f, e) { | |
var d = a[f]; | |
if (!d) { | |
return null | |
} | |
switch (d.mode || "sub") { | |
case "append": | |
return e(d.baseId) + d.arg; | |
case "concat": | |
var m = []; | |
b.each(d.arg, function(n, o) { | |
m.push(e(o)) | |
}); | |
return m.join(" "); | |
case "link": | |
var m; | |
var l; | |
if (d.baseId) { | |
m = e(d.baseId); | |
if (!m.match(/<a>(.*?)<\/a>|%s/)) { | |
return m | |
} | |
l = RegExp.$1; | |
if (l == "%s") { | |
l = "" | |
} | |
} | |
var k = b.hlp.getTmpDivId(); | |
var l = e(d.text || l || d.url); | |
var j = d.title != null ? e(d.title) : null; | |
c[k] = d.id; | |
var h = gui.emitHtml("a", { | |
id: k, | |
href: "http://" + d.url, | |
title: j | |
}, l); | |
if (d.baseId) { | |
return m.replace(/<a>.*?<\/a>|%s/, h) | |
} else { | |
return h | |
} | |
case "markup": | |
return b.locStr.subLiteral(d.arg, e); | |
case "page": | |
var m; | |
var l; | |
if (d.baseId) { | |
m = e(d.baseId); | |
if (!m.match(/<a>(.*?)<\/a>|%s/)) { | |
return m | |
} | |
l = RegExp.$1; | |
if (l == "%s") { | |
l = "" | |
} | |
} | |
var k = b.hlp.getTmpDivId(); | |
l = e(d.text || l || d.url); | |
var j = d.title != null ? e(d.title) : null; | |
c[k] = d.id; | |
var h = gui.emitHtml("a", { | |
id: k, | |
href: "#" + b.browseHistory.mkALink(d.url), | |
title: j | |
}, l); | |
if (d.baseId) { | |
return m.replace(/<a>.*?<\/a>|%s/, h) | |
} else { | |
return h | |
} | |
case "sub": | |
default: | |
if (!b.isArray(d.arg)) { | |
d.arg = [d.arg] | |
} | |
var g = b.map(d.arg, function(o, n) { | |
return e(o) | |
}); | |
g.unshift(d.baseId); | |
return e.apply(this, g) | |
} | |
}; | |
b.locStr.patchLinks = function() { | |
b.each(c, function(d, f) { | |
var e = a[f]; | |
switch (e.mode) { | |
case "link": | |
b("#" + d).click(function(g) { | |
g.preventDefault(); | |
window.open(this.href) | |
}); | |
break; | |
default: | |
break | |
} | |
}); | |
c = {} | |
} | |
})(jQuery); | |
(function() { | |
var d = $.debugLog = {}; | |
d._logDivId = "#pgm-debug-log-msg"; | |
d.VERBOSE_LEVEL = 20; | |
d.INFO_LEVEL = 10; | |
d.DEPRECATED_LEVEL = -10; | |
d.WARN_LEVEL = -20; | |
d.ERROR_LEVEL = -30; | |
d.MIN_LEVEL = -(1 << 30); | |
d.MAX_LEVEL = 1 << 30; | |
var b = 8; | |
var c = window.console != null; | |
d._logStartTime = $.now(); | |
d._minLogLevel = -1; | |
d.setMinlogLevel = function(e) { | |
d._minLogLevel = e | |
}; | |
d.logMsg = function(h, k, j) { | |
if (k > d._minLogLevel) { | |
return | |
} | |
var g = $.now() - d._logStartTime; | |
var f; | |
if (h == null) { | |
h = "" | |
} | |
j = $.hlp.sprintf.apply($.hlp, Array.prototype.slice.call(arguments, 2)); | |
if (c) { | |
while (h.length < b) { | |
h += " " | |
} | |
f = a(g) + " " + h + " " + j; | |
if (k <= this.ERROR_LEVEL) { | |
console.error(f) | |
} else { | |
if (k <= this.WARN_LEVEL) { | |
console.warn(f) | |
} else { | |
if (k >= this.INFO_LEVEL) { | |
console.info(f) | |
} else { | |
console.log(f) | |
} | |
} | |
} | |
} else { | |
var e; | |
if (k <= this.ERROR_LEVEL) { | |
e = "error" | |
} else { | |
if (k <= this.WARN_LEVEL) { | |
e = "warn" | |
} else { | |
if (k <= this.DEPRECATED_LEVEL) { | |
e = "depre" | |
} else { | |
if (k <= this.INFO_LEVEL) { | |
e = "msg" | |
} else { | |
e = "info" | |
} | |
} | |
} | |
} | |
f = "<div class='line'><div class='time'>" + a(g) + "</div><div class='cpnt'>" + h + "</div><div class='" + e + "'>" + $.escHtmlEntities(j) + "</div></div>"; | |
$(d._logDivId).append(f) | |
} | |
}; | |
function a(g) { | |
var h = Math.floor(Math.floor(g / 1000) / 60); | |
var f = Math.floor(g / 1000) % 60; | |
var e = Math.floor(g % 1000); | |
if (e < 10) { | |
e = "00" + e | |
} else { | |
if (e < 100) { | |
e = "0" + e | |
} | |
} | |
if (f < 10) { | |
f = "0" + f | |
} | |
if (h < 10) { | |
h = " " + h | |
} | |
return h + ":" + f + "." + e | |
} | |
if (typeof(window.console) == "undefined") { | |
console = {}; | |
console.log = function() { | |
var e = ["", 0]; | |
for (var f = 0; f < arguments.length; ++f) { | |
e.push(arguments[f]) | |
} | |
d.logMsg.apply(d, e) | |
}; | |
console.info = function() { | |
var e = ["", d.INFO_LEVEL]; | |
for (var f = 0; f < arguments.length; ++f) { | |
e.push(arguments[f]) | |
} | |
d.logMsg.apply(d, e) | |
}; | |
console.warn = function() { | |
var e = ["", d.WARN_LEVEL]; | |
for (var f = 0; f < arguments.length; ++f) { | |
e.push(arguments[f]) | |
} | |
d.logMsg.apply(d, e) | |
}; | |
console.error = function() { | |
var e = ["", d.ERROR_LEVEL]; | |
for (var f = 0; f < arguments.length; ++f) { | |
e.push(arguments[f]) | |
} | |
d.logMsg.apply(d, e) | |
} | |
} | |
})(); | |
(function(a) { | |
a.hlp.mediaSizeMap = { | |
custom: "L@S#1389", | |
"custom_hp-greeting-card-env_4.4x6in": "L@S#3759", | |
"custom_photo-2l-size-card_127x178mm": "L@S#3760", | |
"custom_photo-cabinet_120x165mm": "L@S#4298", | |
iso_a3_297x420mm: "L@S#2542", | |
iso_a4_210x297mm: "L@S#2939", | |
iso_a5_148x210mm: "L@S#2940", | |
iso_a6_105x148mm: "L@S#2941", | |
iso_b5_176x250mm: "L@S#3768", | |
iso_b5_envelope_176x250mm: "L@S#2942", | |
iso_c5_162x229mm: "L@S#2943", | |
iso_c6_114x162mm: "L@S#2944", | |
iso_dl_110x220mm: "L@S#2945", | |
jis_b4_257x364mm: "L@S#4300", | |
jis_b5_182x257mm: "L@S#2946", | |
jis_b6_128x182mm: "L@S#3416", | |
jpn_chou3_120x235mm: "L@S#2947", | |
jpn_chou4_90x205mm: "L@S#2948", | |
jpn_hagaki_100x148mm: "L@S#2949", | |
jpn_oufuku_148x200mm: "L@S#2950", | |
"jpn_oufuku-rot_148x200mm": "L@S#4158", | |
na_5x7_5x7in: "L@S#2961", | |
na_12x12_12x12in: "L@S#4301", | |
"na_index-5x7_5x7in": "L@S#2961", | |
"na_a2_4.375x5.75in": "L@S#3761", | |
na_edp_11x14in: "L@S#4295", | |
"na_executive_7.25x10.5in": "L@S#2951", | |
"na_foolscap_8.5x13in": "L@S#3973", | |
"na_govt-letter_8x10in": "L@S#4233", | |
"na_index-3x5_3x5in": "L@S#2953", | |
"na_index-4x6_4x6in": "L@S#5629", | |
"na_index-5x8_5x8in": "L@S#2955", | |
"na_invoice_5.5x8.5in": "L@S#2956", | |
na_legal_216x340mm: "L@S#3972", | |
"na_legal_8.5x14in": "L@S#2957", | |
"na_letter_8.5x11in": "L@S#2958", | |
"na_monarch_3.875x7.5in": "L@S#2959", | |
"na_number-10_4.125x9.5in": "L@S#2960", | |
"na_personal_3.625x6.5in": "L@S#4299", | |
"na_super-b_13x19in": "L@S#4296", | |
om_photo_89x127mm: "L@S#3762", | |
"om_small-photo_100x150mm": "L@S#3853", | |
prc_16k_184x260mm: "L@S#2936", | |
prc_16k_195x270mm: "L@S#2937", | |
prc_16k_197x273mm: "L@S#2938", | |
"tabloid-plus_wide_11x17in": "L@S#4297", | |
custom_photo_4x8in: "L@S#4586", | |
custom_photo_4x5in: "L@S#5744", | |
custom_photo_4x12in: "L@S#4585" | |
}; | |
a.hlp.mediaTypeMap = { | |
plain: "L@S#0747", | |
HPEcoSMARTLite: "L@S#4088", | |
light: "L@S#4089", | |
intermediate: "L@S#4090", | |
midweight: "L@S#4091", | |
heavy: "L@S#4092", | |
HPPremiumPresentationMatte: "L@S#4093", | |
extraHeavy: "L@S#4094", | |
HPBrochureMatte: "L@S#2899", | |
matteBrochure: "L@S#2899", | |
HPBrochureGlossy: "L@S#2898", | |
cardstock: "L@S#4095", | |
HPCover: "L@S#4096", | |
HPAdvancedPhoto: "L@S#2897", | |
envelope: "L@S#1634", | |
heavyEnvelope: "L@S#4097", | |
labels: "L@S#4098", | |
HPBrightWhite: "L@S#4171", | |
HPUniversalBond: "L@S#4172", | |
HPRecycledBond: "L@S#4173", | |
HPCoated: "L@S#4174", | |
HPHeavyweightCoated: "L@S#4175", | |
coated: "L@S#4176", | |
heavyweightCoated: "L@S#4177", | |
HPNaturalTracing: "L@S#4178", | |
genericNaturalTracing: "L@S#4179", | |
genericNaturalTracing65gsm: "L@S#4180", | |
vellum: "L@S#4181", | |
universalGloss: "L@S#4182", | |
universalSatin: "L@S#4183", | |
premiumGloss: "L@S#4184", | |
premiumSatin: "L@S#4185", | |
lightGlossy: "L@S#4186", | |
photoSatin: "L@S#4187", | |
polySatin: "L@S#4188", | |
transparency: "L@S#4189", | |
matteFilm: "L@S#4190", | |
adhesivePaper: "L@S#4191", | |
adhesivePolypropyleneSatin: "L@S#4192", | |
glossy: "L@S#2881", | |
lightGlossy: "L@S#2885", | |
specialty: "L@S#2883", | |
photoStandard: "L@S#0505", | |
transparencyInkjet: "L@S#2884", | |
glossyBrochure: "L@S#2898", | |
"stationery-letterhead": "L@S#5090", | |
"stationery-preprinted": "L@S#5091", | |
"stationery-prepunched": "L@S#5092", | |
specialtyGlossy: "L@S#5296", | |
specialtyMatte: "L@S#5297" | |
}; | |
a.hlp.reducedMediaTypeMap = { | |
plain: "L@S#0747", | |
HPBrochureMatte: "L@S#2899", | |
matteBrochure: "L@S#2899", | |
specialty: "L@S#2899", | |
HPBrochureGlossy: "L@S#2898", | |
glossyBrochure: "L@S#2898", | |
photoStandard: "L@S#0505", | |
lightGlossy: "L@S#0505", | |
"stationery-letterhead": "L@S#5090", | |
"stationery-preprinted": "L@S#5091", | |
"stationery-prepunched": "L@S#5092", | |
specialtyGlossy: "L@S#5296", | |
specialtyMatte: "L@S#5297" | |
} | |
})(jQuery); | |
(function() { | |
var b = false; | |
var a = []; | |
$.isSeqAjaxInProgress = function() { | |
return b | |
}; | |
$.queuedAjax = function(j) { | |
var d; | |
function f() { | |
var k; | |
if (a.length > 0) { | |
k = a[0]; | |
a.splice(0, 1) | |
} | |
if (!k) { | |
b = false | |
} | |
return k | |
} | |
function h(k) { | |
if (!k) { | |
return | |
} | |
d = k.complete || $.noop; | |
k = $.extend({}, k, { | |
complete: c | |
}); | |
$.runLater(function() { | |
e(k) | |
}) | |
} | |
function e(l) { | |
if (l.op == "callback") { | |
var k = f(); | |
d(); | |
h(k) | |
} else { | |
$.ajax(l) | |
} | |
} | |
function c(l, m) { | |
var k = f(); | |
d.call(this, l, m); | |
h(k) | |
} | |
if (b) { | |
a.push(j); | |
return | |
} | |
b = true; | |
d = j.complete || $.noop; | |
var g = $.extend({}, j, { | |
complete: c | |
}); | |
e(g) | |
} | |
})(); | |
(function() { | |
function a() { | |
this.path = "/framework/cookie/client" | |
} | |
a.prototype.getVal = function(e) { | |
if ((typeof e != "string") || e == "") { | |
return "" | |
} | |
var c; | |
if ($.typeOf(window.getPrivCookie) == "undefined") { | |
console.log("getPrivCookie() is not ready when reading '" + e + "'"); | |
c = document.cookie.split("; ") | |
} else { | |
c = window.getPrivCookie().split("; ") | |
} | |
if (c.length < 0) { | |
return "" | |
} | |
var d = null; | |
for (var b = 0; b < c.length; ++b) { | |
d = c[b].split("=", 2); | |
if (d[0] == e) { | |
if (d.length > 1) { | |
return decodeURIComponent(d[1]) | |
} else { | |
return "" | |
} | |
} | |
} | |
return "" | |
}; | |
a.prototype.set = function(c, e, g, k) { | |
var d = ""; | |
var h = ""; | |
if (typeof e == "boolean") { | |
e *= 1 | |
} | |
if (typeof e == "number") { | |
e = String(e) | |
} | |
if ((typeof c != "string") || (typeof e != "string")) { | |
return | |
} | |
if (!isNaN(g)) { | |
var f = new Date(); | |
var b = f.getTime() + (g * 24 * 60 * 60 * 1000); | |
f.setTime(b); | |
d = "; expires=" + f.toUTCString(); | |
h = "; max-age=" + (g * 24 * 60 * 60) | |
} | |
var j = k == null ? "; path=" + this.path : "; path=" + k; | |
document.cookie = c + "=" + encodeURIComponent(e) + d + h + j | |
}; | |
a.prototype.setShared = function(d, c, b) { | |
this.set(d, c, b, "/framework/cookie") | |
}; | |
a.prototype.del = function(b) { | |
this.set(b, "", 0) | |
}; | |
a.prototype.isEnabled = function(b) { | |
if (b !== true) { | |
if (navigator.cookieEnabled != undefined) { | |
return navigator.cookieEnabled | |
} | |
} | |
if (this.isEnable != undefined) { | |
return this.isEnable | |
} | |
this.set("test", "Hello", 7); | |
if (this.getVal("test") == "Hello") { | |
this.isEnable = true; | |
this.del("test"); | |
return true | |
} else { | |
return false | |
} | |
}; | |
$.hlp.Cookie = a | |
})(); | |
(function() { | |
var w = "/DevMgmt/DiscoveryTree.xml"; | |
var g = false; | |
var n = {}; | |
var s = {}; | |
var y = /Dyn\.xml$/; | |
var e = /Cap\.xml$/; | |
var v = /Manifest\.xml$/; | |
var o = /^((\/)*.*\/)*[\(|{(].*[)\)|}]$/; | |
var m = /^\s*(FaxPhoneBookDyn.xml|EmailContactsDyn.xml|ScanToEmailAccountsDyn.xml|PredefinedJobsDyn.xml)\s*$/; | |
var q = "fpbdyn\\:FaxPhoneBookEntry,emaildyn\\:EmailContact,emaildyn\\:EmailAccount,folderdyn\\:PredefinedJob"; | |
var p = {}; | |
function a(D, F) { | |
var E = "", | |
G = false; | |
var C = []; | |
if (D == w) { | |
return D | |
} | |
if (F) { | |
$(_NS("dd\\:ResourceURI"), F).each(function() { | |
if ($(this).text().replace(/^\//, "") == D) { | |
$(this).parents().map(function() { | |
if (this.tagName == "map:ResourceNode" || this.tagName == "map:ResourceMap") { | |
var H = $(this).children().get(0); | |
if (H.tagName == "map:ResourceLink") { | |
C.push($($(H).children().get(0)).text()) | |
} | |
} | |
}); | |
G = true; | |
return false | |
} | |
}); | |
while (C.length) { | |
E += C.pop() | |
} | |
} else { | |
var B = new RegExp("/" + D + "$"); | |
var A = $(_NS("dd\\:ResourceURI"), $.hlp.ledm.DiscoveryTree).add($(_NS("ledm\\:ManifestURI"), $.hlp.ledm.DiscoveryTree)); | |
A.each(function(H) { | |
E = $(this).text(); | |
G = false; | |
if (B.exec(E)) { | |
G = true; | |
return false | |
} | |
}) | |
} | |
return (G == true ? E : null) | |
} | |
function l(F, A) { | |
var D = 0; | |
if (typeof(F) == "undefined") { | |
if (typeof(A) != "undefined") { | |
D = $(A).children().length | |
} | |
} else { | |
var E = $(A).children(); | |
var B = $(F).children(); | |
if (E.length > 0) { | |
for (var C = 0; C < E.length; C++) { | |
if (typeof(B[C]) != "undefined") { | |
D += l(B[C], E[C]) | |
} else { | |
D++ | |
} | |
} | |
E = $(A).children(); | |
if (E.length == 0 && A.parentNode) { | |
A.parentNode.removeChild(A) | |
} | |
} else { | |
if ($(A).text() == $(F).text() && A.parentNode) { | |
A.parentNode.removeChild(A) | |
} else { | |
D = 1 | |
} | |
} | |
} | |
return D | |
} | |
function h(B, C) { | |
var A = 0; | |
for (A = 0; A < B.length; A++) { | |
if (B[A] == C[0]) { | |
return A | |
} | |
} | |
return A | |
} | |
var f = function() {}; | |
f.prototype = { | |
toURI: function() { | |
return null | |
}, | |
callbacks: { | |
success: function(A, B) {}, | |
error: function(B, C, A) {}, | |
complete: function(B, A) {} | |
}, | |
get: function(C) { | |
var G = null; | |
if (typeof(this.reqfiles[0]) != "undefined") { | |
G = this.reqfiles[0] | |
} else { | |
console.log("[ledm] get method is called before reqfiles[] is initialized"); | |
return | |
} | |
var B = this; | |
var D = h(B.parent.reqfiles, B.reqfiles); | |
var F = null; | |
if (typeof(B.parent) != "undefined" && typeof(B.namedRes) != "undefined") { | |
F = B.parent.toURI() | |
} | |
if (F != null) { | |
B.toURI = function() { | |
return (F + "/" + G) | |
} | |
} else { | |
B.toURI = function() { | |
return a(G, this.Manifest) | |
} | |
} | |
var A = B.toURI(); | |
var E = /(Cap|Manifest)\.xml$/; | |
if (A != null) { | |
$.ajax({ | |
type: "GET", | |
url: A, | |
cache: v.exec(B.toURI()) ? true : B.callbacks.cache, | |
timeout: B.callbacks.timeout, | |
async: (g == true ? false : true), | |
dataType: "xml", | |
data: B.callbacks.data, | |
pooledLoading: true, | |
cacheLocally: E.test(A) ? "ledm" : false, | |
success: function(H, J, I) { | |
if (this.type == "GET") { | |
if (B.toURI() == w) { | |
$.hlp.ledm.setDiscoveryTree(H) | |
} else { | |
n[G] = $(H.documentElement).clone()[0]; | |
B.xmlData[0] = H; | |
if (B.parent && (B.parent instanceof k)) { | |
B.parent.xmlData[D] = B.xmlData[0] | |
} | |
} | |
} | |
if (C && C.success) { | |
C.success(H, J, I, this) | |
} else { | |
B.callbacks.success(H, J, I, this) | |
} | |
}, | |
complete: function(I, H) { | |
B.status[0] = H != "timeout" ? I.status : 408; | |
if (B.parent && (B.parent instanceof k)) { | |
B.parent.status[D] = B.status[0]; | |
if (D == (B.parent.reqfiles.length - 1)) { | |
B.parent.callbacks.complete(I, H, this) | |
} | |
} else { | |
if (C && C.complete) { | |
C.complete(I, H, this) | |
} else { | |
B.callbacks.complete(I, H, this) | |
} | |
} | |
}, | |
error: function(J, I, H) { | |
if (C && C.error) { | |
C.error(J, I, H, this) | |
} else { | |
B.callbacks.error(J, I, H, this) | |
} | |
} | |
}) | |
} else { | |
console.log("[ledm] requested file '" + G + "' has to be supported/defined in discoveryTree.xml or Manifest"); | |
j.call(B) | |
} | |
} | |
}; | |
var x = function(C, D, B) { | |
if (arguments.length == 0) { | |
return | |
} | |
this.reqfiles = [C]; | |
this.parent = B; | |
this.status = []; | |
this.xmlData = []; | |
if (typeof(D) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(D[A]) == "undefined") { | |
D[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = D | |
} | |
this.get() | |
}; | |
x.prototype = new f(); | |
var d = function(C, D, B) { | |
if (arguments.length == 0) { | |
return | |
} | |
this.reqfiles = [C]; | |
this.parent = B; | |
this.status = []; | |
this.xmlData = []; | |
if (typeof(D) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(D[A]) == "undefined") { | |
D[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = D | |
} | |
this.get() | |
}; | |
d.prototype = new f(); | |
d.prototype.put = function() { | |
function G(M, H) { | |
var K = 0; | |
var L = $(H).children(); | |
var I = $(M).children(); | |
if (L.length != I.length && H.tagName == "dd:EnabledFeatures") { | |
K = Math.abs(L.length - I.length) | |
} else { | |
if (L.length > 0) { | |
for (var J = 0; J < L.length; J++) { | |
K += G(I[J], L[J]) | |
} | |
L = $(H).children(); | |
if (L.length == 0) { | |
if (H.parentNode) { | |
H.parentNode.removeChild(H) | |
} | |
} | |
} else { | |
if ($(H).text() == $(M).text()) { | |
H.parentNode.removeChild(H) | |
} else { | |
K = 1 | |
} | |
} | |
} | |
return K | |
} | |
var F; | |
if ($.browser.webkit) { | |
F = document.implementation.createDocument("", "", null); | |
var E = F.importNode(this.xmlData[0].documentElement, true); | |
F.appendChild(E) | |
} else { | |
F = $(this.xmlData[0]).clone()[0] | |
} | |
var B = this.reqfiles[0]; | |
var D = n[B]; | |
var A = 0; | |
var C = this; | |
if (C.callbacks.noDiff) { | |
A = 1 | |
} else { | |
A = G(D, F.documentElement) | |
} | |
console.log("[ledm] _DynClass.put: " + B + " " + A); | |
if (A > 0) { | |
$.ajax({ | |
type: "PUT", | |
contentType: "text/xml", | |
url: C.toURI(), | |
async: (g == true ? false : true), | |
timeout: C.callbacks.timeout, | |
beforeSend: function(H) { | |
C.status[0] = undefined | |
}, | |
processData: false, | |
data: F, | |
success: function(H, J, I) { | |
if (typeof(C.callbacks.success) != "undefined") { | |
C.callbacks.success(H, J, I, this) | |
} | |
}, | |
error: function(J, I, H) { | |
if (typeof(C.callbacks.error) != "undefined") { | |
C.callbacks.error(J, I, H, this) | |
} | |
}, | |
complete: function(J, I) { | |
C.status[0] = I != "timeout" ? J.status : 408; | |
if (C.parent && (C.parent instanceof k)) { | |
var H = h(C.parent.reqfiles, C.reqfiles); | |
C.parent.status[H] = C.status[0]; | |
if (H == (C.parent.reqfiles.length - 1)) { | |
C.parent.callbacks.complete(J, I, this) | |
} | |
} else { | |
C.callbacks.complete(J, I, this) | |
} | |
} | |
}) | |
} | |
return A | |
}; | |
d.prototype.post = function() { | |
var F; | |
if ($.browser.webkit) { | |
F = document.implementation.createDocument("", "", null); | |
var E = F.importNode(this.xmlData[0].documentElement, true); | |
F.appendChild(E) | |
} else { | |
F = $(this.xmlData[0]).clone()[0] | |
} | |
var A = this.reqfiles[0]; | |
var C = n[A]; | |
var D = 0; | |
var B = this; | |
if (B.callbacks.noDiff) { | |
D = 1 | |
} else { | |
D = l(C, F.documentElement) | |
} | |
console.log("[ledm] _DynClass.post: " + A + " " + D); | |
if (D > 0) { | |
$.ajax({ | |
type: "POST", | |
contentType: "text/xml", | |
url: B.toURI(), | |
async: (g == true ? false : true), | |
timeout: B.callbacks.timeout, | |
beforeSend: function(G) { | |
B.status[0] = undefined | |
}, | |
processData: false, | |
data: F, | |
success: function(G, I, H) { | |
if (typeof(B.callbacks.success) != "undefined") { | |
B.callbacks.success(G, I, H, this) | |
} | |
}, | |
error: function(I, H, G) { | |
if (typeof(B.callbacks.error) != "undefined") { | |
B.callbacks.error(I, H, G, this) | |
} | |
}, | |
complete: function(I, H) { | |
B.status[0] = H != "timeout" ? I.status : 408; | |
if (B.parent && (B.parent instanceof k)) { | |
var G = h(B.parent.reqfiles, B.reqfiles); | |
B.parent.status[G] = B.status[0]; | |
if (G == (B.parent.reqfiles.length - 1)) { | |
B.parent.callbacks.complete(I, H, this) | |
} | |
} else { | |
B.callbacks.complete(I, H, this) | |
} | |
} | |
}) | |
} | |
return D | |
}; | |
d.prototype.del = function(B) { | |
if (typeof(B) == "undefined") { | |
return 0 | |
} | |
var A = this; | |
$.ajax({ | |
type: "DELETE", | |
url: A.toURI() + "/" + B, | |
contentType: "text/xml", | |
beforeSend: function(C) { | |
A.status[0] = undefined | |
}, | |
success: function(C, E, D) { | |
if (typeof(A.callbacks.success) != "undefined") { | |
A.callbacks.success(C, E, D, this) | |
} | |
}, | |
error: function(E, D, C) { | |
if (typeof(A.callbacks.error) != "undefined") { | |
A.callbacks.error(E, D, C, this) | |
} | |
}, | |
complete: function(E, D) { | |
A.status[0] = D != "timeout" ? E.status : 408; | |
if (A.parent && (A.parent instanceof k)) { | |
var C = h(A.parent.reqfiles, A.reqfiles); | |
A.parent.status[C] = A.status[0]; | |
if (C == (A.parent.reqfiles.length - 1)) { | |
A.parent.callbacks.complete(E, D, this) | |
} | |
} else { | |
A.callbacks.complete(E, D, this) | |
} | |
} | |
}); | |
return 1 | |
}; | |
var u = function(C, D, B) { | |
if (arguments.length == 0) { | |
return | |
} | |
this.reqfiles = [C]; | |
this.parent = B; | |
this.status = []; | |
this.xmlData = []; | |
if (typeof(D) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(D[A]) == "undefined") { | |
D[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = D | |
} | |
this.get() | |
}; | |
u.prototype = new d(); | |
u.prototype.put = function(D) { | |
function G(I, H) { | |
var J = null; | |
$(_NS(q), H).each(function(L) { | |
var K = $($(this).children().get(0)).text(); | |
if (K == I) { | |
J = $.hlp.xmlToStr(this); | |
return false | |
} | |
}); | |
return J | |
} | |
var E = false; | |
var B = this.toURI(); | |
var F = this.xmlData[0]; | |
var A = null; | |
if (D) { | |
A = G(D, F); | |
if (typeof D == "string") { | |
B = D | |
} else { | |
B += "/" + D | |
} | |
if (A != null) { | |
E = true | |
} | |
} else { | |
E = true | |
} | |
console.log("[ledm] _FaxPhoneBookDynClass.put: " + B + " " + A); | |
if (E) { | |
var C = this; | |
$.ajax({ | |
type: "PUT", | |
url: B, | |
async: (g == true ? false : true), | |
timeout: C.callbacks.timeout, | |
contentType: "text/xml", | |
beforeSend: function(H) { | |
C.status[0] = undefined | |
}, | |
processData: false, | |
data: (D != undefined ? A : F), | |
success: function(H, J, I) { | |
if (typeof(C.callbacks.success) != "undefined") { | |
C.callbacks.success(H, J, I, this) | |
} | |
}, | |
error: function(J, I, H) { | |
if (typeof(C.callbacks.error) != "undefined") { | |
C.callbacks.error(J, I, H, this) | |
} | |
}, | |
complete: function(J, I) { | |
C.status[0] = I != "timeout" ? J.status : 408; | |
if (C.parent && (C.parent instanceof k)) { | |
var H = h(C.parent.reqfiles, C.reqfiles); | |
C.parent.status[H] = C.status[0]; | |
if (H == (C.parent.reqfiles.length - 1)) { | |
C.parent.callbacks.complete(J, I, this) | |
} | |
} else { | |
C.callbacks.complete(J, I, this) | |
} | |
} | |
}); | |
return 1 | |
} else { | |
return 0 | |
} | |
}; | |
u.prototype.post = function() { | |
function A(L, G) { | |
var K = null; | |
var J = _NS(q); | |
var H = $(J, G); | |
var I = $(J, L); | |
if (H.length - I.length == 1) { | |
K = $.hlp.xmlToStr(H[H.length - 1]); | |
return K | |
} | |
return null | |
} | |
var E = this.xmlData[0]; | |
var B = this.reqfiles[0]; | |
var D = n[B]; | |
var F = null; | |
var C = this; | |
F = A(D, E); | |
if (F != null) { | |
$.ajax({ | |
type: "POST", | |
url: C.toURI(), | |
async: (g == true ? false : true), | |
contentType: "text/xml", | |
beforeSend: function(G) { | |
C.status[0] = undefined | |
}, | |
processData: false, | |
data: F, | |
success: function(G, I, H) { | |
if (typeof(C.callbacks.success) != "undefined") { | |
C.callbacks.success(G, I, H, this) | |
} | |
}, | |
error: function(I, H, G) { | |
if (typeof(C.callbacks.error) != "undefined") { | |
C.callbacks.error(I, H, G, this) | |
} | |
}, | |
complete: function(I, H) { | |
C.status[0] = H != "timeout" ? I.status : 408; | |
if (C.parent && (C.parent instanceof k)) { | |
var G = h(C.parent.reqfiles, C.reqfiles); | |
C.parent.status[G] = C.status[0]; | |
if (G == (C.parent.reqfiles.length - 1)) { | |
C.parent.callbacks.complete(I, H, this) | |
} | |
} else { | |
C.callbacks.complete(I, H, this) | |
} | |
} | |
}); | |
return 1 | |
} else { | |
return 0 | |
} | |
}; | |
u.prototype.del = function(D) { | |
function B(G, F) { | |
var H = false; | |
$(_NS(q), F).each(function(J) { | |
var I = $($(this).children().get(0)).text(); | |
if (I == G) { | |
H = true; | |
return false | |
} | |
}); | |
return H | |
} | |
var E = false; | |
var A = this.toURI(); | |
if (typeof D == "string") { | |
A = D; | |
E = true | |
} else { | |
if (D) { | |
A += "/" + D; | |
E = true | |
} else { | |
if (typeof(this.xmlData[0]) != "undefined") { | |
E = true | |
} | |
} | |
} | |
if (E) { | |
var C = this; | |
$.ajax({ | |
type: "DELETE", | |
url: A, | |
async: (g == true ? false : true), | |
contentType: "text/xml", | |
beforeSend: function(F) { | |
C.status[0] = undefined | |
}, | |
processData: false, | |
success: function(F, H, G) { | |
if (typeof(C.callbacks.success) != "undefined") { | |
C.callbacks.success(F, H, G, this) | |
} | |
}, | |
error: function(H, G, F) { | |
if (typeof(C.callbacks.error) != "undefined") { | |
C.callbacks.error(H, G, F, this) | |
} | |
}, | |
complete: function(H, G) { | |
C.status[0] = G != "timeout" ? H.status : 408; | |
if (C.parent && (C.parent instanceof k)) { | |
var F = h(C.parent.reqfiles, C.reqfiles); | |
C.parent.status[F] = C.status[0]; | |
if (F == (C.parent.reqfiles.length - 1)) { | |
C.parent.callbacks.complete(H, G, this) | |
} | |
} else { | |
C.callbacks.complete(H, G, this) | |
} | |
} | |
}); | |
return 1 | |
} else { | |
return 0 | |
} | |
}; | |
var t = function(C, D, B) { | |
if (!v.exec(C)) { | |
return | |
} | |
this.reqfiles = [C]; | |
this.parent = B; | |
this.status = []; | |
this.xmlData = []; | |
if (typeof(D) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(D[A]) == "undefined") { | |
D[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = D | |
} | |
this.get() | |
}; | |
t.prototype = new f(); | |
function c(B, C) { | |
var A = C.Manifest; | |
$(_NS("dd\\:ResourceURI"), C.Manifest).each(function() { | |
if ($(this).text() == "/" + B) { | |
A = $(this).parent().parent(); | |
return false | |
} | |
}); | |
return A | |
} | |
var r = function(P, I, O) { | |
if (arguments.length == 0) { | |
return | |
} | |
var E = null; | |
var F = null; | |
var D; | |
if (typeof P == "object") { | |
for (D in P) { | |
E = D; | |
E = E.replace(/^\//, ""); | |
E = E.replace(/\/$/, ""); | |
F = P[D]; | |
break | |
} | |
} else { | |
E = P; | |
F = P | |
} | |
if (E != F) { | |
this.namedRes = E | |
} | |
this.reqfiles = [F]; | |
this.parent = O; | |
this.status = []; | |
this.xmlData = []; | |
this.Manifest = c(E, O); | |
this.callbacks = {}; | |
$.extend(this.callbacks, f.prototype.callbacks); | |
if (typeof(I) != "undefined") { | |
for (D in this.callbacks) { | |
if (typeof(I[D]) == "undefined") { | |
I[D] = this.callbacks[D] | |
} | |
} | |
this.callbacks = I | |
} | |
var G = this; | |
var B; | |
var C; | |
var K; | |
function M(R, Q) { | |
$(R).find(_NS("map\\:ResourceNode")).each(function() { | |
if ($(_NS("map\\:ResourceMap"), this).length > 0) { | |
B = true; | |
C = $($(_NS("dd\\:ResourceURI"), this)[0]).text() | |
} else { | |
C = $(_NS("map\\:ResourceLink"), this).find(_NS("dd\\:ResourceURI")).text() | |
} | |
if (C == "/" + Q) { | |
K = this; | |
return false | |
} | |
var S = Q.split("/"); | |
if (S.length > 1 && C == "/" + S[0]) { | |
S.splice(0, 1); | |
M(this, S.join("/")); | |
return false | |
} | |
}) | |
} | |
M($(_NS("map\\:ResourceMap"), O.Manifest), E); | |
if (K) { | |
var J = true; | |
var H = $(_NS("map\\:Methods"), K)[0]; | |
$(_NS("map\\:Method"), H).find(_NS("map\\:Verb")).each(function() { | |
var Q = $(this).text(); | |
switch (Q) { | |
case "Get": | |
if (E != "InternalPrintDyn.xml") { | |
J = false | |
} | |
break; | |
case "Put": | |
if (o.exec(E) != null) { | |
G.put = u.prototype.put | |
} else { | |
G.put = d.prototype.put | |
} | |
break; | |
case "Post": | |
if (E == "Contacts" || E == "Accounts" || E == "PredefinedJobs" || o.exec(E) != null) { | |
G.post = u.prototype.post | |
} else { | |
G.post = d.prototype.post | |
} | |
break; | |
case "Delete": | |
if (o.exec(E) != null) { | |
G.del = u.prototype.del | |
} else { | |
G.del = d.prototype.del | |
} | |
break; | |
default: | |
break | |
} | |
}); | |
if (J) { | |
G.get = undefined; | |
if (typeof(G.put) != "undefined" || typeof(G.post) != "undefined") { | |
var L = $(_NS("map\\:XmlElement"), K).children(); | |
var A = L[0].tagName.split(":"); | |
var N = "<" + L[0].tagName; | |
N += " xmlns:" + A[0] + '="' + L[0].namespaceURI + '"'; | |
$.each(p, function(Q, R) { | |
N += " xmlns:" + Q + '="' + R + '"' | |
}); | |
N += "/>"; | |
G.xmlData[0] = $.parseXML(N); | |
if (G.xmlData[0]) { | |
G.status = [200]; | |
n[F] = $(G.xmlData[0].documentElement).clone()[0] | |
} else { | |
G.status = [404] | |
} | |
G.toURI = function() { | |
return a(F, G.Manifest) | |
} | |
} | |
} | |
} | |
if (B) { | |
if (G.parent instanceof z.prototype.Resource) { | |
G.parent.ResourceLink = function(R, Q) { | |
var S; | |
if (typeof R == "string") { | |
R = R.replace(/^\//, ""); | |
R = R.replace(/\/$/, ""); | |
S = R.split("/")[0] | |
} else { | |
S = R | |
} | |
return r.call(this, S, Q, G) | |
}; | |
G.parent.ResourceLink.prototype = new r() | |
} | |
G.ResourceLink = function(R, Q) { | |
var S; | |
if (typeof R == "string") { | |
R = R.replace(/^\//, ""); | |
R = R.replace(/\/$/, ""); | |
S = R.split("/")[0] | |
} else { | |
S = R | |
} | |
return r.call(this, S, Q, G) | |
}; | |
G.ResourceLink.prototype = new r() | |
} | |
if (typeof(this.get) != "undefined") { | |
this.get() | |
} | |
}; | |
r.prototype = new f(); | |
var k = function(B, A) { | |
this.reqfiles = []; | |
this.status = []; | |
this.xmlData = []; | |
this.callbacks = {}; | |
$.extend(this.callbacks, f.prototype.callbacks); | |
if (typeof(B) == "undefined" || B == null) { | |
return | |
} | |
this.init(B, A) | |
}; | |
k.prototype = new f(); | |
k.prototype.init = function(F, E) { | |
if (typeof(E) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(E[A]) == "undefined") { | |
E[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = E | |
} | |
F.replace(/^\s*/, ""); | |
F.replace(/\s*$/, ""); | |
var D = F.split(/\s*,\s*/); | |
this.reqfiles = D; | |
for (var C = 0; C < D.length; C++) { | |
var B = D[C].split(".xml")[0]; | |
if (B == null || B == "") { | |
continue | |
} | |
if (m.exec(D[C])) { | |
this[B] = new u(D[C], E, this) | |
} else { | |
if (e.exec(D[C])) { | |
this[B] = new x(D[C], E, this) | |
} else { | |
if (y.exec(D[C])) { | |
this[B] = new d(D[C], E, this) | |
} else { | |
if (v.exec(D[C])) { | |
this[B] = new t(D[C], E, this) | |
} else { | |
if (D[C] != w) { | |
console.log("file without *Cap.xml/*Dyn.xml/*Manifest.xml, assign " + D[C] + " to CapClass") | |
} | |
this[B] = new x(D[C], E, this) | |
} | |
} | |
} | |
} | |
} | |
}; | |
k.prototype.get = function(D, C) { | |
if (this.reqfiles.length > 0) { | |
for (var B = 0; B < this.reqfiles.length; B++) { | |
var A = this.reqfiles[B].split(".xml")[0]; | |
if (A == null || A == "") { | |
continue | |
} | |
this[A].get(C) | |
} | |
} else { | |
this.init(D, C) | |
} | |
}; | |
k.prototype.put = function(C) { | |
var A = 0; | |
for (var D = 0; D < this.reqfiles.length; D++) { | |
var B = this.reqfiles[D].split(".xml")[0]; | |
if (B == null || B == "") { | |
continue | |
} | |
if (typeof(this[B].put) == "function") { | |
A += this[B].put(C) | |
} | |
} | |
return A | |
}; | |
k.prototype.post = function() { | |
var A = 0; | |
for (var C = 0; C < this.reqfiles.length; C++) { | |
var B = this.reqfiles[C].split(".xml")[0]; | |
if (B == null || B == "") { | |
continue | |
} | |
if (typeof(this[B].post) == "function") { | |
A += this[B].post() | |
} | |
} | |
return A | |
}; | |
k.prototype.del = function(C) { | |
var A = 0; | |
for (var D = 0; D < this.reqfiles.length; D++) { | |
var B = this.reqfiles[D].split(".xml")[0]; | |
if (B == null || B == "") { | |
continue | |
} | |
if (typeof(this[B].del) == "function") { | |
A += this[B].del(C) | |
} | |
} | |
return A | |
}; | |
var z = function() {}; | |
z.prototype = { | |
Host: null, | |
Port: null, | |
DiscoveryTree: null, | |
setDiscoveryTree: function(A) { | |
z.prototype.DiscoveryTree = A | |
}, | |
hasTree: function(A, B) { | |
return typeof a(A, B) == "string" | |
}, | |
hasManifestTree: function(B) { | |
var C = false; | |
var A = new RegExp("/" + B + "$"); | |
$(_NS("ledm\\:ManifestURI"), $.hlp.ledm.DiscoveryTree).each(function() { | |
var D = $(this).text(); | |
if (A.exec(D)) { | |
C = true; | |
return false | |
} | |
}); | |
return C | |
}, | |
isManifest: function(B) { | |
var C = B.replace(/^\//, "").replace(/\/$/, ""); | |
var A = C.split("/"); | |
return A.length >= 2 && v.exec(A[0]) != null | |
}, | |
getManifestCpnt: function(B) { | |
var C = B.replace(/^\//, "").replace(/\/$/, ""); | |
var A = C.split("/"); | |
if (A.length >= 2 && v.exec(A[0]) != null) { | |
return A[0] | |
} else { | |
return null | |
} | |
}, | |
toURI: function(A, B) { | |
return a(A, B) | |
}, | |
setDebugMode: function(A) { | |
g = A | |
}, | |
datalogger: function(A, B) { | |
s[A] = B | |
}, | |
getdatalog: function() { | |
return s | |
}, | |
extend_class: function(A, B) { | |
z.prototype[A] = B | |
} | |
}; | |
z.prototype.SmartObj = function(A, B) { | |
if ($.hlp.ledm.isManifest(A)) { | |
return new $.hlp.ledm.Resource(A, B) | |
} else { | |
return new $.hlp.ledm.Obj(A, B) | |
} | |
}; | |
z.prototype.Obj = function(B, A) { | |
return k.call(this, B, A) | |
}; | |
z.prototype.Obj.prototype = new k(); | |
z.prototype.FaxPhoneBook = function(A) { | |
return k.call(this, "FaxPhoneBookCap.xml, FaxPhoneBookDyn.xml", A) | |
}; | |
z.prototype.FaxPhoneBook.prototype = new k(); | |
z.prototype.Event = function(B) { | |
this.reqfiles = ["EventTable.xml"]; | |
this.status = []; | |
this.xmlData = []; | |
this.callbacks = {}; | |
$.extend(this.callbacks, f.prototype.callbacks); | |
if (typeof(B) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(B[A]) == "undefined") { | |
B[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = B | |
} | |
this.get() | |
}; | |
z.prototype.Event.prototype = { | |
callbacks: { | |
success: function(A, B) { | |
console.log("Event default success handler") | |
}, | |
error: function(B, C, A) { | |
console.log("Event default error handler") | |
}, | |
complete: function(B, A) { | |
console.log("Event default complete handler" + A) | |
} | |
} | |
}; | |
z.prototype.Event.prototype = new f(); | |
z.prototype.Resource = function(E, F) { | |
E = E.replace(/^\//, ""); | |
E = E.replace(/\/$/, ""); | |
var D = E.split("/"); | |
if (!v.exec(D[0])) { | |
return | |
} | |
this.reqfiles = D; | |
this.status = []; | |
this.xmlData = []; | |
this.callbacks = {}; | |
$.extend(this.callbacks, f.prototype.callbacks); | |
if (typeof(F) != "undefined") { | |
for (var A in this.callbacks) { | |
if (typeof(F[A]) == "undefined") { | |
F[A] = this.callbacks[A] | |
} | |
} | |
this.callbacks = F | |
} | |
var C = this; | |
var G = { | |
success: function(I, M, L, K) { | |
if ((K.type == "GET") && (v.exec(K.url) != null)) { | |
C.Manifest = I; | |
for (var J = 1; J < D.length; J++) { | |
var H = D[J].replace(/\.xml$/, ""); | |
C[H] = new r(D[J], F, C); | |
if (typeof(C[H].get) == "undefined") { | |
if (C instanceof k) { | |
C.status[J] = C[H].status[0]; | |
C.xmlData[J] = C[H].xmlData[0]; | |
if (C.status[J] == 200) { | |
C.callbacks.success(C.xmlData[J], "success", L, { | |
type: "LOCAL-GET", | |
url: "resource (with no GET method) created without ajax call" | |
}) | |
} else { | |
C.callbacks.error({ | |
statusText: "Document creation fail" | |
}, "FAIL", { | |
type: "LOCAL-GET", | |
url: "resource (with no GET method) created without ajax call" | |
}) | |
} | |
} | |
} | |
} | |
} | |
if (F && F.success) { | |
F.success(I, M, L, K) | |
} else { | |
C.callbacks.success(I, M, L, K) | |
} | |
}, | |
error: function(K, J, H, I) { | |
C.callbacks.error(K, J, H, I) | |
}, | |
complete: function(J, I, H) { | |
C.callbacks.complete(J, I, H) | |
}, | |
timeout: C.callbacks.timeout | |
}; | |
var B = D[0].replace(/\.xml$/, ""); | |
this[B] = new t(D[0], G, this) | |
}; | |
z.prototype.Resource.prototype = new k(); | |
z.prototype.Resource.prototype.get = function(C) { | |
if (this.reqfiles.length > 0) { | |
for (var B = 1; B < this.reqfiles.length; B++) { | |
var A = this.reqfiles[B].split(".xml")[0]; | |
if (A == null || A == "") { | |
continue | |
} | |
this[A].get(C) | |
} | |
} | |
}; | |
z.prototype.addXmlNamespaces = function(A, B) { | |
p[A] = B | |
}; | |
z.prototype.rmXmlNamespaces = function(A) { | |
delete p[A] | |
}; | |
function j() { | |
var A = this; | |
$.runLater(function() { | |
var B = $.getFakeXhr(404, "Not Found"); | |
A.callbacks.error.call(A, B, "error", A); | |
A.callbacks.complete.call(A, B, "error", null, A) | |
}) | |
} | |
$.hlp.ledm = new z(); | |
var b = { | |
dd: "http://www.hp.com/schemas/imaging/con/dictionaries/1.0/", | |
dd3: "http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06", | |
fw: "http://www.hp.com/schemas/imaging/con/firewall/2011/01/05" | |
}; | |
$.each(b, function(B, A) { | |
$.hlp.ledm.addXmlNamespaces(B, A) | |
}) | |
})(); | |
(function() { | |
var g = {}; | |
$.hlp.sXmlParser = g; | |
g.parse = function(o, m, l) { | |
function k(s, q) { | |
var p = []; | |
for (var r = 0; r < s.length; ++r) { | |
p.push(s[r][q]) | |
} | |
return p | |
} | |
function j(s, x) { | |
var p; | |
var r; | |
switch (x.type) { | |
case "string": | |
p = $(this).text(); | |
if (x.trim) { | |
var w = /^(\n)+/; | |
var t = /(\n)+$/; | |
p = $.trim(p.replace(w, "").replace(t, "")) | |
} | |
break; | |
case "number": | |
case "int": | |
p = +$(this).text(); | |
break; | |
case "bool": | |
p = te.isBoolStr($(this).text()); | |
break; | |
case "tEnableEnum": | |
p = $.trim($(this).text()).toLowerCase() == "enabled"; | |
break; | |
case "tOnEnum": | |
p = $.trim($(this).text()).toLowerCase() == "on"; | |
break; | |
case "tYesEnum": | |
p = $.trim($(this).text()).toLowerCase() == "yes"; | |
break; | |
case "array": | |
var q; | |
var u; | |
if (x.elmType == "struct") { | |
q = x.schema; | |
u = false | |
} else { | |
q = { | |
name: x.elmName, | |
type: x.elmType, | |
hasAttr: x.elmHasAttr | |
}; | |
u = true | |
} | |
p = []; | |
$(this).children().each(function(v) { | |
var y = g.parse(this, q, $.extend({}, l, { | |
parseThisLevel: u | |
})); | |
if (l.genXmlLink) { | |
y._xmlLink = this | |
} | |
p.push(y) | |
}); | |
if (x.elmType != "struct") { | |
p = k(p, q.jsName) | |
} | |
break; | |
case "anon-array": | |
if (x.elmType == "struct") { | |
p = g.parse(this, x.schema, l); | |
if (l.genXmlLink) { | |
p._xmlLink = this | |
} | |
} else { | |
p = {}; | |
j.call(this, p, { | |
jsName: x.jsName, | |
type: x.elmType, | |
hasAttr: x.hasAttr | |
}); | |
p = p[x.jsName] | |
} | |
if (s[x.jsName] == null) { | |
s[x.jsName] = [] | |
} | |
if (x.hasAttr) { | |
r = p; | |
p = e(this); | |
p.data = r | |
} | |
s[x.jsName].push(p); | |
return; | |
case "array-string": | |
j.call(this, s, { | |
jsName: x.jsName, | |
type: "anon-array", | |
elmType: "string", | |
hasAttr: x.hasAttr | |
}); | |
return; | |
case "array-struct": | |
j.call(this, s, { | |
jsName: x.jsName, | |
type: "anon-array", | |
elmType: "struct", | |
schema: x.schema, | |
hasAttr: x.hasAttr | |
}); | |
return; | |
case "struct": | |
p = g.parse(this, x.schema, l); | |
break; | |
default: | |
console.error("Unknown type " + x.type + " for " + x.name); | |
return | |
} | |
if (x.hasAttr) { | |
r = p; | |
p = e(this); | |
p.data = r | |
} | |
s[x.jsName] = p | |
} | |
m = c(m); | |
if ($.typeOf(l) == "boolean") { | |
l = { | |
parseThisLevel: l | |
} | |
} | |
l = $.fillIn(l, { | |
parseThisLevel: false, | |
emitUnknownTags: false, | |
genXmlLink: false | |
}); | |
if (!l.parseThisLevel) { | |
o = $(o).children() | |
} | |
var n = {}; | |
$(o).each(function(q) { | |
var t = a(m, this.tagName); | |
if (t != null) { | |
j.call(this, n, t) | |
} else { | |
if (l.emitUnknownTags) { | |
var p = h(this.tagName); | |
var r; | |
var s = $(this).children(); | |
if (s.length != 0) { | |
r = g.parse(s, null, $.extend({}, l, { | |
parseThisLevel: true | |
})) | |
} else { | |
r = $(this).text() | |
} | |
switch ($.typeOf(n[p])) { | |
case "array": | |
n[p].push(r); | |
break; | |
case "null": | |
case "undefined": | |
n[p] = r; | |
break; | |
default: | |
n[p] = [n[p], r]; | |
break | |
} | |
} else { | |
if (m.isComplete || l.warnUnknownTag) { | |
console.warn("Unknown tag " + this.tagName) | |
} | |
} | |
} | |
}); | |
if (l.genXmlLink) { | |
n._xmlLink = $(o) | |
} | |
return n | |
}; | |
g.createJsObj = function(l) { | |
function j(o) { | |
var n; | |
switch (o.type) { | |
case "string": | |
n = ""; | |
break; | |
case "number": | |
case "int": | |
n = 0; | |
break; | |
case "bool": | |
case "tEnableEnum": | |
case "tOnEnum": | |
case "tYesEnum": | |
n = false; | |
break; | |
case "array": | |
case "anon-array": | |
case "array-string": | |
case "array-struct": | |
n = []; | |
break; | |
case "struct": | |
n = g.createJsObj(o.schema); | |
break; | |
default: | |
console.error("Unknown type " + o.type + " for " + o.name); | |
return | |
} | |
if (o.hasAttr) { | |
m[o.jsName] = {}; | |
m[o.jsName].data = n | |
} else { | |
m[o.jsName] = n | |
} | |
} | |
l = c(l); | |
var m = {}; | |
for (var k = 0; k < l.length; ++k) { | |
j(l[k]) | |
} | |
return m | |
}; | |
g.toXml = function(l, n, p, m) { | |
if (l == null) { | |
console.error("toXml: " + l + " is null"); | |
return | |
} | |
if ($("> html", l).length > 0) { | |
console.warn("toXml: writing to HTML node") | |
} | |
m = $.fillIn(m, { | |
overwrite: false | |
}); | |
if (m.overwrite) { | |
te.removeChildren(l) | |
} else { | |
f($(l).children(), n) | |
} | |
if (m.isSingleElem) { | |
if ($.typeOf(p) == "object") { | |
for (var k in p) { | |
break | |
} | |
p = p[k] | |
} | |
l.childNodes[0].nodeValue = p; | |
return | |
} | |
var j = $(l); | |
var o = j.clone().get(0); | |
te.removeChildren(o); | |
b(o, n, p, m.attrs || {}); | |
d(j.get(0), o) | |
}; | |
function a(l, k) { | |
for (var j = 0; j < l.length; ++j) { | |
var m = l[j]; | |
if (m.name == k) { | |
return m | |
} | |
} | |
return null | |
} | |
function h(j) { | |
if (j.indexOf(":") >= 0) { | |
return j.split(":")[1] | |
} else { | |
return j | |
} | |
} | |
function c(l) { | |
var k = $.typeOf(l); | |
if (k == "null" || k == "undefined") { | |
l = [] | |
} else { | |
if (k != "array") { | |
l = [l] | |
} | |
} | |
for (var j = 0; j < l.length; ++j) { | |
var m = l[j]; | |
if (m == null) { | |
console.error("Null entry in schema!"); | |
continue | |
} | |
if ($.typeOf(m) == "string") { | |
m = { | |
name: m, | |
type: "string" | |
} | |
} | |
if (m.elmName != null && m.type == null) { | |
m.type = "array" | |
} | |
if ((m.type == "array" || m.type == "anon-array") && m.elmType == null) { | |
if (m.schema != null) { | |
m.elmType = "struct" | |
} else { | |
m.elmType = "string" | |
} | |
} | |
if (m.type == null) { | |
if (m.schema != null) { | |
m.type = "struct" | |
} else { | |
m.type = "string" | |
} | |
} | |
if (m.jsName == null && m.name != null) { | |
m.jsName = h(m.name) | |
} | |
if (m.schema != null && !$.isArray(m.schema)) { | |
m.schema = [m.schema] | |
} | |
} | |
return l | |
} | |
function e(l) { | |
var m = {}; | |
for (var k = 0; k < l.attributes.length; ++k) { | |
var n = l.attributes[k]; | |
var j; | |
switch (n.name) { | |
case "length": | |
case "min": | |
case "max": | |
case "step": | |
j = +n.value; | |
break; | |
default: | |
j = n.value; | |
break | |
} | |
m[n.name] = j | |
} | |
return m | |
} | |
function f(k, j) { | |
j = c(j); | |
$(k).each(function() { | |
var l = a(j, this.tagName); | |
if (l == null) { | |
return | |
} | |
switch (l.type) { | |
case "array": | |
if (l.isComplete) { | |
te.removeChildren(this); | |
break | |
} | |
if (l.elmType != "struct") { | |
break | |
} | |
$(this).children().each(function() { | |
f(this, l.schema) | |
}); | |
break; | |
case "anon-array": | |
if (l.isComplete) { | |
te.removeElem(this); | |
break | |
} | |
if (l.elmType == "struct") { | |
f(this, l.schema) | |
} | |
break; | |
case "array-string": | |
f(this, { | |
type: "anon-array", | |
elmType: "string", | |
isComplete: l.isComplete | |
}); | |
break; | |
case "array-struct": | |
f(this, { | |
type: "anon-array", | |
elmType: "struct", | |
schema: l.schema, | |
isComplete: l.isComplete | |
}); | |
break; | |
case "struct": | |
if (l.isComplete) { | |
te.removeChildren(this) | |
} else { | |
f($(this).children(), l.schema) | |
} | |
break; | |
default: | |
break | |
} | |
}) | |
} | |
function b(l, n, p, k) { | |
function o(t, r, q) { | |
var s = te.createNode(t, r, q); | |
$.each(k[r] || {}, function(w, u) { | |
te.setAttrNs(s.get(0), w, u) | |
}); | |
return s | |
} | |
function j(z, x, t, q) { | |
var A = q ? t : t[x.jsName]; | |
var u; | |
if (A == null) { | |
return | |
} | |
if (x.hasAttr) { | |
A = A.data | |
} | |
switch (x.type) { | |
case "string": | |
break; | |
case "number": | |
case "int": | |
break; | |
case "bool": | |
A = A ? "true" : "false"; | |
break; | |
case "tEnableEnum": | |
A = A ? "enabled" : "disabled"; | |
break; | |
case "tOnEnum": | |
A = A ? "on" : "off"; | |
break; | |
case "tYesEnum": | |
A = A ? "Yes" : "No"; | |
break; | |
case "array": | |
var w = o(z, x.name); | |
if (x.elmType == "struct") { | |
var s = w; | |
for (var r = 0; r < A.length; ++r) { | |
if (x.elmName) { | |
s = o(w, x.elmName) | |
} | |
m(s, x.schema, A[r]) | |
} | |
} else { | |
var y = { | |
name: x.elmName, | |
type: x.elmType, | |
hasAttr: x.elmHasAttr | |
}; | |
for (u = 0; u < A.length; ++u) { | |
m(w, y, A[u], true) | |
} | |
} | |
return; | |
case "anon-array": | |
for (u = 0; u < A.length; ++u) { | |
if (x.elmType == "struct") { | |
m(o(z, x.name), x.schema, A[u]) | |
} else { | |
o(z, x.name, A[u]) | |
} | |
} | |
return; | |
case "array-string": | |
j(z, { | |
jsName: x.jsName, | |
name: x.name, | |
type: "anon-array", | |
elmType: "string" | |
}, t, q); | |
return; | |
case "array-struct": | |
j(z, { | |
jsName: x.jsName, | |
name: x.name, | |
type: "anon-array", | |
elmType: "struct", | |
schema: x.schema | |
}, t, q); | |
return; | |
case "struct": | |
m(o(z, x.name), x.schema, A); | |
return; | |
default: | |
console.error("Unknown type " + A.type + " for " + x.name); | |
return | |
} | |
o(z, x.name, A) | |
} | |
function m(r, s, u, t) { | |
s = c(s); | |
for (var q = 0; q < s.length; ++q) { | |
j(r, s[q], u, t) | |
} | |
} | |
m(l, n, p) | |
} | |
function d(o, k) { | |
function l(t, j, u) { | |
while (j < t.length) { | |
if (t[j].tagName == u.tagName) { | |
return j | |
}++j | |
} | |
return -1 | |
} | |
var s = o.childNodes; | |
var r = k.childNodes; | |
var p = 0; | |
var n = 0; | |
while (p < s.length && n < r.length) { | |
if (s[p].tagName == r[n].tagName) { | |
if ($(s[p]).children().length > 0 || $(r[n]).children().length > 0) { | |
d(s[p], r[n]) | |
} else { | |
$(s[p]).text($(r[n]).text()) | |
}++p; | |
++n; | |
continue | |
} | |
var m = l(r, n + 1, s[p]); | |
if (m >= 0) { | |
for (var q = n; q < m; ++q) { | |
o.insertBefore(r[q].cloneNode(true), s[p]) | |
} | |
n = m; | |
continue | |
}++p | |
} | |
for (; n < r.length; ++n) { | |
o.appendChild(r[n].cloneNode(true)) | |
} | |
} | |
})(); | |
var te = {}; | |
(function() { | |
te.sXmlParser = $.hlp.sXmlParser; | |
te.Cookie = $.hlp.Cookie; | |
te.cookie = new te.Cookie(); | |
te.trueFn = $.hlp.trueFn; | |
te.falseFn = $.hlp.falseFn; | |
te.isBoolStr = function(a) { | |
return $.trim(a).toLowerCase() == "true" | |
}; | |
te.condAppendStr = function(a) { | |
if (a != null && a != "") { | |
return " " + a | |
} else { | |
return "" | |
} | |
}; | |
te.concatStr = function() { | |
var a = $.map(arguments, function(c, b) { | |
c = $.trim(c); | |
if (c != "") { | |
return c | |
} else { | |
return null | |
} | |
}); | |
return a.join(" ") | |
}; | |
te.condAppendToArray = function(c, a) { | |
for (var b = 0; b < c.length; ++b) { | |
if (c[b] == a) { | |
return | |
} | |
} | |
c.push(a) | |
}; | |
te.strCmp = function(b, a) { | |
return b == a ? 0 : b < a ? -1 : 1 | |
}; | |
te.chooseSingMulStr = function(b, c, a) { | |
return b > -2 && b < 2 ? c : a | |
}; | |
te.getObjKeys = function(c) { | |
var a = []; | |
for (var b in c) { | |
a.push(b) | |
} | |
return a | |
}; | |
te.escUserInput = function(a, b) { | |
a = $.escHtmlEntities(a); | |
if (b) { | |
var c = / /g; | |
a = a.replace(c, " ") | |
} | |
return a | |
}; | |
te.encodeUtf8 = function(a) { | |
return unescape(encodeURIComponent(a)) | |
}; | |
te.decodeUtf8 = function(a) { | |
return decodeURIComponent(escape(a)) | |
}; | |
te._xmlToStr = function(a) { | |
return $.hlp.xmlToStr($(a).get(0)) | |
}; | |
te.hasHttpsPrefix = $.hlp.hasHttpsPrefix; | |
te.isOverHttps = $.hlp.isOverHttps; | |
te.switchToHttps = $.hlp.switchToHttps; | |
te.logMsg = $.debugLog.logMsg; | |
te.VERBOSE_DEBUG_LEVEL = $.debugLog.VERBOSE_LEVEL; | |
te.INFO_DEBUG_LEVEL = $.debugLog.INFO_LEVEL; | |
te.DEPRECATED_DEBUG_LEVEL = $.debugLog.DEPRECATED_LEVEL; | |
te.WARN_DEBUG_LEVEL = $.debugLog.WARN_LEVEL; | |
te.ERROR_DEBUG_LEVEL = $.debugLog.ERROR_LEVEL; | |
te.isDebugMode = function() { | |
return frameWorkObj.debugFlag | |
}; | |
te.mElem = $.hlp.mElem; | |
te.WIN_OPTIONS = "left=20,top=20,width=1000,height=600,toolbar=1,resizable=1,status=1,location=1,menubar=1,scrollbars=1"; | |
te.STARTUP_LEDM_POLL_MS = 100; | |
te.SHORT_STORED_DURATION_DAYS = 3; | |
te.MED_STORED_DURATION_DAYS = 14; | |
te.LONG_STORED_DURATION_DAYS = 365; | |
te.locInfoMsg = function(a, b) { | |
return te.loc("<b>%s:</b> %s", te.loc(a), te.loc(b)) | |
}; | |
te.checkAuthStatus = function(b, a) { | |
pageMgr.checkAuth(b, { | |
headers: { | |
"X-Auth-Quiet-Fail": "true" | |
} | |
}, a) | |
}; | |
te.getWinLocHost = function() { | |
var a = window.location.hostname; | |
var b = window.location.host; | |
if (te.isIPv6(a)) { | |
b = "[" + a + "]"; | |
if (window.location.port) { | |
b += ":" + window.location.port | |
} | |
} | |
return b | |
}; | |
te.getWinLocHashPageName = function() { | |
var c = "hId-"; | |
var b = "pgHome"; | |
var a = b; | |
if (window.location.hash.length > 0) { | |
a = window.location.hash.substring(1); | |
if (a.indexOf(c) == 0) { | |
a = a.substring(c.length) | |
} | |
if (a == "") { | |
a = b | |
} | |
} | |
return a | |
} | |
})(); | |
(function() { | |
(function() { | |
var a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
te.encodeBase64Str = function(d) { | |
var b = ""; | |
var l, j, g; | |
var k, h, f, e; | |
var c = 0; | |
do { | |
l = d.charCodeAt(c++); | |
j = d.charCodeAt(c++); | |
g = d.charCodeAt(c++); | |
k = l >> 2; | |
h = ((l & 3) << 4) | (j >> 4); | |
f = ((j & 15) << 2) | (g >> 6); | |
e = g & 63; | |
if (isNaN(j)) { | |
f = e = 64 | |
} else { | |
if (isNaN(g)) { | |
e = 64 | |
} | |
} | |
b += a.charAt(k) + a.charAt(h) + a.charAt(f) + a.charAt(e) | |
} while (c < d.length); | |
return b | |
}; | |
te.decodeBase64Str = function(d) { | |
var b = ""; | |
var l, j, g; | |
var k, h, f, e; | |
var c = 0; | |
d = d.replace(/[^A-Za-z0-9\+\/\=]/g, ""); | |
do { | |
k = a.indexOf(d.charAt(c++)); | |
h = a.indexOf(d.charAt(c++)); | |
f = a.indexOf(d.charAt(c++)); | |
e = a.indexOf(d.charAt(c++)); | |
l = (k << 2) | (h >> 4); | |
j = ((h & 15) << 4) | (f >> 2); | |
g = ((f & 3) << 6) | e; | |
b += String.fromCharCode(l); | |
if (f != 64) { | |
b += String.fromCharCode(j) | |
} | |
if (e != 64) { | |
b += String.fromCharCode(g) | |
} | |
} while (c < d.length); | |
return b | |
} | |
})(); | |
(function() { | |
te.cnvAsc2Hex = function(d) { | |
var c = ""; | |
for (var b = 0; b < d.length; ++b) { | |
c += d.charCodeAt(b).toString(16) | |
} | |
return c | |
}; | |
te.cnvHex2Asc = function(c) { | |
var d = ""; | |
for (var b = 0; b < c.length; b += 2) { | |
d += String.fromCharCode(parseInt(c.substr(b, 2), 16)) | |
} | |
return d | |
}; | |
te.formatDateStr = function(b, d) { | |
var c; | |
if ("YYYYMMMDD" == d) { | |
c = b.year + "-" + b.mon + "-" + b.day | |
} else { | |
if ("MMMDDYYYY" == d) { | |
c = b.mon + "-" + b.day + "-" + b.year | |
} else { | |
if ("DDMMMYYYY" == d) { | |
c = b.day + "-" + b.mon + "-" + b.year | |
} | |
} | |
} | |
return c | |
}; | |
te.formatTimeStr = function(g, c) { | |
var e = +g.hour; | |
var b = +g.min; | |
var d = +g.sec; | |
if (e < 10) { | |
e = "0" + e | |
} | |
if (b < 10) { | |
b = "0" + b | |
} | |
if (d < 10) { | |
d = "0" + d | |
} | |
if (c == "HR24") { | |
return e + ":" + b + ":" + d | |
} | |
var f; | |
if (e < 12) { | |
f = "AM" | |
} else { | |
f = "PM" | |
} | |
if (e == 0) { | |
e = 12 | |
} else { | |
if (e <= 12) { | |
e = +e | |
} else { | |
e = e - 12 | |
} | |
} | |
return e + ":" + b + ":" + d + " " + f | |
}; | |
function a(b) { | |
if (b >= 0) { | |
b = Math.floor(b) | |
} else { | |
b = Math.ceil(b) | |
} | |
return b | |
} | |
te.fillInGeoLocationObj = function(b) { | |
b = $.fillIn(b, { | |
direction: "", | |
degrees: "", | |
minutes: "", | |
seconds: "" | |
}) | |
}; | |
te.convertDMSToDecimalDegrees = function(c) { | |
var b; | |
te.fillInGeoLocationObj(c); | |
if (c.degrees === "" && c.minutes === "" && c.seconds === "") { | |
return "" | |
} | |
b = c.degrees + c.minutes / 60 + c.seconds / 3600; | |
switch (c.direction) { | |
case "N": | |
case "E": | |
b = +b; | |
break; | |
case "S": | |
case "W": | |
b = -b; | |
break; | |
default: | |
break | |
} | |
return b.toFixed(6) | |
}; | |
te.convertDecimalToDMS = function(d) { | |
var b, h, c, g; | |
var f = {}; | |
if (d.value == "") { | |
return te.fillInGeoLocationObj(f) | |
} | |
switch (d.type) { | |
case "Latitude": | |
if (d.value >= 0) { | |
f.direction = "N" | |
} else { | |
f.direction = "S"; | |
d.value = -d.value | |
} | |
break; | |
case "Longitude": | |
if (d.value >= 0) { | |
f.direction = "E" | |
} else { | |
f.direction = "W"; | |
d.value = -d.value | |
} | |
break; | |
default: | |
break | |
} | |
var e = Math.round(d.value * 3600); | |
h = a(e / 3600); | |
e = e - h * 3600; | |
c = a(e / 60); | |
g = e - c * 60; | |
f.degrees = h; | |
f.minutes = c; | |
f.seconds = g; | |
return f | |
} | |
})(); | |
(function() { | |
te.startTestFaxJobAndWait = function(e, c) { | |
function a(k) { | |
var g = d.getJobXml(); | |
var j = $("FaxTestStatus", g); | |
var f = {}; | |
if (k) { | |
f.jobPassedFlag = $("FaxOverallTestStatus", j).text() == "passed" | |
} else { | |
f.jobPassedFlag = false | |
} | |
var h = ["FaxSelfTestStatus", "FaxPortTestStatus", "FaxJackTestStatus", "FaxWireTestStatus", "FaxLineTestStatus", "FaxDialToneTestStatus"]; | |
$.each(h, function(l, m) { | |
f[m] = k ? $(m, j).text() : "notperformed" | |
}); | |
return f | |
} | |
c = $.extend({ | |
getPassMsg: function() { | |
return gui.emitHtml("p", null, te.loc("L@S#2416")) | |
}, | |
getFailMsg: function() { | |
return gui.emitHtml("p", null, te.loc("L@S#2415")) | |
}, | |
getErrMsg: function() { | |
return gui.emitHtml("p", null, te.loc("L@S#2415")) | |
}, | |
onShow: $.noop | |
}, c); | |
var b = { | |
completed: false, | |
err: false, | |
errCode: 0 | |
}; | |
var d = new te.Job2.TestFax({ | |
start: true, | |
status: function(f, g) {}, | |
success: function(g, h) { | |
var f = a(true); | |
b.completed = true; | |
b.err = !f.jobPassedFlag; | |
b.errCode = g; | |
if (f.jobPassedFlag) { | |
b.resultMsg = c.getPassMsg(f) | |
} else { | |
b.resultMsg = c.getFailMsg(f) | |
} | |
}, | |
error: function(f, g) { | |
b.completed = true; | |
b.err = true; | |
b.errCode = f; | |
b.resultMsg = c.getErrMsg(a(false)) | |
} | |
}); | |
gui.showProgressScrn(e, { | |
msg: "L@S#3729", | |
isDone: function() { | |
return b.completed | |
}, | |
complete: function() { | |
var f = [{ | |
pgmErr: b.err, | |
pgmStatus: b.errCode | |
}]; | |
f.hasErr = b.err; | |
gui.showResultScrn(e, f, { | |
header: c.header || "L@S#2321", | |
prependMsg: b.resultMsg, | |
msg: te.loc("L@S#3289"), | |
errMsg: te.loc("L@S#4085"), | |
showErrCode: false, | |
showErrContMsg: false, | |
errMsgs: { | |
412: "L@S#4694", | |
503: "L@S#1861" | |
}, | |
btnList: b.err ? c.failedBtnList : c.successBtnList, | |
complete: c.btnHandler, | |
onShow: c.onShow | |
}) | |
} | |
}) | |
} | |
})(); | |
(function() { | |
te.getProductFlags = function() { | |
return pageMgr.getPageByName("pgProductFlags") || {} | |
}; | |
te.isAio = function() { | |
return $.hlp.ledm.hasTree("ScanJobManifest.xml") | |
}; | |
te.hasAccessListFeature = function() { | |
return $.hlp.ledm.hasTree("AccessListManifest.xml") | |
}; | |
te.hasDigitalSendFeature = function() { | |
return te.scanToEmailFeature() || te.scanToFolderFeature() || te.hasFaxArchiveFeature() | |
}; | |
te.scanToEmailFeature = function() { | |
return $.hlp.ledm.hasTree("EmailServiceManifest.xml") | |
}; | |
te.hasEmailAlertFeature = function() { | |
return $.hlp.ledm.hasTree("EmailAlertManifest.xml") | |
}; | |
te.scanToFolderFeature = function() { | |
return $.hlp.ledm.hasTree("FolderServiceManifest.xml") | |
}; | |
te.scanToSharePointFeature = function() { | |
return $.hlp.ledm.hasTree("SharePointServiceManifest.xml") | |
}; | |
te.hasFaxFeature = function() { | |
return $.hlp.ledm.hasTree("FaxConfigDyn.xml") | |
}; | |
te.hasFaxLogFeature = function() { | |
return $.hlp.ledm.hasTree("FaxActivityLogDyn.xml") | |
}; | |
te.hasFaxArchiveFeature = function() { | |
return $.hlp.ledm.hasTree("DeviceFaxArchiveDyn.xml") | |
}; | |
te.hasWebServicesFeature = function() { | |
return $.hlp.ledm.hasTree("ePrintManifest.xml") | |
}; | |
te.isAdminRevamp = function() {}; | |
var a; | |
te.setHasFaxBlockListFeature = function(b) { | |
a = b | |
}; | |
te.getHasFaxBlockListFeature = function() { | |
return a | |
}; | |
te.notifyCopyMediaHasChanged = function() { | |
$.hlp.autoLedmParser.invalidate(); | |
$.invalidateAjaxLocalCache("ledm") | |
}; | |
te.notifyCountryRegionHasChanged = function() { | |
$.hlp.autoLedmParser.invalidate(); | |
$.invalidateAjaxLocalCache("ledm"); | |
$("body").trigger("countryRegionHasChanged") | |
} | |
})(); | |
(function() { | |
var a = {}; | |
a.dyn = [{ | |
name: "j:Job", | |
type: "anon-array", | |
schema: [{ | |
name: "j:JobUrl" | |
}, { | |
name: "j:JobCategory" | |
}, { | |
name: "j:JobState" | |
}, { | |
name: "j:JobStateUpdate" | |
}, { | |
name: "InternalPrintDyn", | |
schema: [{ | |
name: "JobType" | |
}] | |
}, { | |
name: "CalibrationStateAccess", | |
schema: [{ | |
name: "CalibrationState" | |
}, { | |
name: "map:ResourceLink", | |
schema: [{ | |
name: "dd:ResourceURI" | |
}, { | |
name: "map:Base" | |
}] | |
}] | |
}, { | |
name: "ScanJob", | |
schema: [{ | |
name: "PreScanPage", | |
schema: [{ | |
name: "PageNumber", | |
type: "int" | |
}, { | |
name: "PageState" | |
}, { | |
name: "BinaryURL" | |
}, { | |
name: "ImageOrientation" | |
}] | |
}, { | |
name: "PostScanPage", | |
schema: [{ | |
name: "PageNumber", | |
type: "int" | |
}, { | |
name: "PageState" | |
}, { | |
name: "TotalLines", | |
type: "int" | |
}] | |
}] | |
}, { | |
name: "FaxTestStatus", | |
schema: [{ | |
name: "FaxOverallTestStatus" | |
}, { | |
name: "FaxSelfTestStatus" | |
}, { | |
name: "FaxPortTestStatus" | |
}, { | |
name: "FaxJackTestStatus" | |
}, { | |
name: "FaxWireTestStatus" | |
}, { | |
name: "FaxLineTestStatus" | |
}, { | |
name: "FaxDialToneTestStatus" | |
}] | |
}] | |
}]; | |
te.jobSchema = a | |
})(); | |
(function() { | |
te.hubLangMap = {}; | |
$.each($.hlp.langCodeMap, function(a, b) { | |
te.hubLangMap[a] = b.hubLangCode || b.code2d | |
}); | |
te.getDisplayLang = function() { | |
var a = te.cookie.getVal("lang"); | |
if (a != "") { | |
return a | |
} | |
a = te.loc("CUR_LANG"); | |
if (a != "" && a != "CUR_LANG") { | |
return a | |
} | |
return "eng" | |
}; | |
te.isLangSupported = function(b) { | |
var a = te.loc("LANG_LIST"); | |
if (a != "LANG_LIST") { | |
return $.inArray(b, a) >= 0 | |
} | |
return false | |
}; | |
te.isLangRTL = function(a) { | |
return a == "arb" || a == "heb" | |
} | |
})(); | |
(function() { | |
te.pollXmlFile = function(f, d) { | |
function c(h) { | |
if (h.hasErr) { | |
if (!d.onStartError(h)) { | |
b.hasErr = true; | |
b.pgmStatus = h[0].pgmStatus; | |
d.error(h); | |
return | |
} | |
} | |
if (d.startCallback(h[0]) === false) { | |
return | |
} | |
setTimeout(g, d.pollDelayMs) | |
} | |
function g() { | |
if (b.stopFlag) { | |
a([{ | |
file: d.pollXmlFile | |
}]); | |
return | |
} | |
f.get({ | |
file: d.pollXmlFile, | |
dataType: d.dataType | |
}, a) | |
} | |
function a(h) { | |
b.pgmStatus = h[0].pgmStatus; | |
if (d.treat503asContinue && h.hasErr && h[0].pgmStatus == 503) { | |
h.hasErr = false; | |
h[0].pgmStatus == 200 | |
} | |
if (h.hasErr) { | |
b.hasErr = true; | |
if (!d.contOnErr) { | |
d.error(h[0]); | |
return | |
} | |
} else { | |
if (!b.stopFlag && d.process(h[0].pgmData, b) === false) { | |
b.isDone = true; | |
return | |
} | |
} | |
if (b.stopFlag || $.now() >= e + d.timeoutMs) { | |
b.isDone = true; | |
b.hasErr = true; | |
b.errCode = "timeout"; | |
h[0].pgmErr = true; | |
h[0].pgmStatus = 409; | |
d.error(h[0]); | |
return | |
} | |
setTimeout(g, d.pollDelayMs) | |
} | |
d = $.fillIn(d, { | |
dataType: "xml", | |
startCallback: $.noop, | |
onStartError: $.noop, | |
error: $.noop, | |
pollDelayMs: 500, | |
timeoutMs: 20000, | |
contOnErr: false | |
}); | |
var e = $.now(); | |
var b = { | |
isDone: false, | |
hasErr: false | |
}; | |
if (d.startXmlFile) { | |
f.put({ | |
op: "post", | |
arg: d.data, | |
dataType: d.postDataType, | |
contentType: "text/xml", | |
file: d.startXmlFile, | |
headers: d.postHeaders, | |
beforeSend: d.postBeforeSend, | |
pgmHttpResponseHdr: d.pgmHttpResponseHdr | |
}, c) | |
} else { | |
setTimeout(g, d.pollDelayMs) | |
} | |
return b | |
}; | |
te.stopPollXmlFile = function(a) { | |
a.stopFlag = true | |
} | |
})(); | |
(function() { | |
te.getLiveProp = function(c, a) { | |
var b = {}; | |
a = a || {}; | |
if (a.range != null) { | |
a.min = a.range + ".min"; | |
a.max = a.range + ".max"; | |
a.step = a.range + ".step" | |
} | |
$.each(a, function(d, e) { | |
switch (d) { | |
case "_valRange": | |
b[d] = []; | |
$.each(e, function(f, g) { | |
b[d].push($.hlp.getNestedFieldValue(c, g)) | |
}); | |
break; | |
case "max": | |
case "maxLength": | |
case "minLength": | |
case "min": | |
case "optionArray": | |
case "step": | |
b[d] = $.hlp.getNestedFieldValue(c, e); | |
break; | |
default: | |
b[d] = e; | |
break | |
} | |
}); | |
return b | |
}; | |
te.fillInCapsProp = function(b, a, e) { | |
var d = { | |
access: "access", | |
len: "maxLength", | |
minLen: "minLength", | |
max: "max", | |
min: "min", | |
step: "step", | |
type: "valType", | |
value: "value" | |
}; | |
var c = $.hlp.autoLedmParser.getField(a, e); | |
if (c == null) { | |
console.warn("te.fillInCapsProp: " + e + " - not found in " + a); | |
c = {} | |
} | |
if ($.isArray(c)) { | |
b.optionArray = c; | |
return b | |
} | |
$.each(d, function(g, f) { | |
if (g == "value" && $.isArray(c[g])) { | |
f = "optionArray" | |
} | |
if (c[g] != null) { | |
b[f] = c[g] | |
} | |
}); | |
return b | |
}; | |
te.isBoolValType = function(a) { | |
return $.inArray(a, ["bool", "tEnableEnum", "tOnEnum"]) >= 0 | |
} | |
})(); | |
(function() { | |
te.QueryString = function() { | |
this.hash = []; | |
this.arg = []; | |
this.get = function(a) { | |
return this.hash[a] | |
}; | |
this.getAll = function() { | |
return this.arg | |
}; | |
this.read = function(c) { | |
var e; | |
if (c) { | |
e = c.substr(c.lastIndexOf("?") + 1, c.length) | |
} else { | |
e = window.location.search.substr(1, window.location.search.length) | |
} | |
if (e.length == 0) { | |
return | |
} | |
var d = e.split("&"); | |
for (var a = 0; a < d.length; ++a) { | |
var b = d[a].split("="); | |
if (b[1] == null) { | |
b[1] = true | |
} | |
this.hash[b[0]] = b[1]; | |
this.arg.push(b[1]) | |
} | |
} | |
} | |
})(); | |
(function() { | |
var a = 10; | |
te.loopIdx = function(b) { | |
return te._tmpStore.loopIdx[b] | |
}; | |
te.setLoopIdx = function(b, c) { | |
te._tmpStore.loopIdx[b] = c | |
}; | |
te.includeSubPage = function(d) { | |
if ($.typeOf(d) == "string") { | |
d = { | |
subPageId: d | |
} | |
} | |
d = $.fillIn(d, { | |
subPageId: 0, | |
loopIdx: 0, | |
idx: 0 | |
}); | |
te.setLoopIdx(d.loopIdx, d.idx); | |
var b = pageMgr.setInHtfFlag(true); | |
var c = new $.AjaxPages().getTemplateStr(te.getSubPage(d.subPageId)); | |
pageMgr.setInHtfFlag(b); | |
return c | |
}; | |
te.repeatSubPage = function(c) { | |
if ($.typeOf(c) == "string") { | |
c = { | |
subPageId: c | |
} | |
} | |
c = $.fillIn(c, { | |
subPageId: 0, | |
loopIdx: 0, | |
num: 1 | |
}); | |
var b = ""; | |
for (c.idx = 0; c.idx < c.num; ++c.idx) { | |
b += te.includeSubPage(c) | |
} | |
return b | |
}; | |
te.subLiteralLocStrings = function(b) { | |
return $.locStr.subLiteral(b, te.loc) | |
}; | |
te.processTemplate = function(e, b, d) { | |
te.opts = d; | |
te._thisPageFrag = d.thisPageFrag; | |
te._getLedmElem = d.getLedmElem; | |
te.getSubPage = d.getSubPage; | |
if (b == null) { | |
return | |
} | |
var c = te.loc; | |
te.loc = d.localize; | |
te._tmpStore = {}; | |
te._tmpStore.loopIdx = new Array(a); | |
if (d.skipTe) { | |
$(e).html(te.subLiteralLocStrings(b)) | |
} else { | |
new $.AjaxPages().processTemplate(b, e) | |
} | |
te.loc = c | |
} | |
})(); | |
(function() { | |
te.simplePrintJobErrMsgs = { | |
409: "L@S#1097", | |
500: "L@S#3249", | |
503: "L@S#1097" | |
}; | |
te.startPrintJob = function(a) { | |
var b = { | |
completed: false, | |
err: false, | |
errCode: 0 | |
}; | |
new te.Job2.InternalPrint({ | |
start: true, | |
job: a, | |
status: function(c, d, e) {}, | |
success: function(c, d) { | |
b.completed = true | |
}, | |
error: function(c, d) { | |
b.completed = true; | |
b.err = true; | |
b.errCode = c | |
} | |
}); | |
return b | |
}; | |
te.startPrintJobAndWait = function(c, b) { | |
var a = te.startPrintJob(b.jobId); | |
gui.showProgressScrn(c, { | |
header: b.header, | |
msg: b.progressText, | |
isDone: function() { | |
return a.completed | |
}, | |
complete: function() { | |
b.completed = a.completed; | |
b.err = a.err; | |
b.errCode = a.errCode; | |
var d = [{ | |
pgmErr: a.err, | |
pgmStatus: a.errCode | |
}]; | |
d.hasErr = a.err; | |
if (b.complete) { | |
if (b.complete(d) !== false) { | |
return | |
} | |
} | |
gui.showResultScrn(c, d, { | |
header: b.header, | |
msg: b.resultMsg || "L@S#2399", | |
errMsgs: te.simplePrintJobErrMsgs | |
}) | |
} | |
}) | |
}; | |
te.createSimplePrintJob = function(d, c) { | |
function a() { | |
b.isInProgress(false); | |
if (e) { | |
return e.call(this) | |
} | |
return false | |
} | |
if (c.dataObj && !c.dataObj.hasJob(c.jobId)) { | |
return false | |
} | |
var e = c.complete; | |
c.complete = a; | |
if (c.isActionBtn === undefined) { | |
c.isActionBtn = true | |
} | |
var b = new gui.Button({ | |
isActionBtn: c.isActionBtn, | |
isSingleClick: true, | |
text: c.btnText, | |
onClick: function() { | |
te.startPrintJobAndWait(d, c) | |
} | |
}); | |
b.create(c.divId); | |
return b | |
}; | |
te.addPageCmdPrintBtn = function(d, a, b) { | |
if (b.dataObj && !b.dataObj.hasJob(b.jobId)) { | |
return a | |
} | |
var c = "print-" + b.jobId; | |
a.list.push({ | |
text: b.btnText, | |
cmd: c | |
}); | |
a[c] = function(f, e) { | |
te.startPrintJobAndWait(d, { | |
jobId: b.jobId, | |
header: b.btnText | |
}) | |
}; | |
return a | |
}; | |
te.createPageCmdPrintBtn = function(b, a) { | |
return te.addPageCmdPrintBtn(b, { | |
list: [] | |
}, a) | |
} | |
})(); | |
(function() { | |
te.chainShowResultScrn = function(b) { | |
var d = 500; | |
var h = 1000; | |
var f; | |
var j; | |
var c; | |
var m; | |
function k() { | |
var p; | |
if (b.progressIntf && b.progressIntf.isInProgress) { | |
b.progressIntf.isInProgress(false) | |
} | |
if (b.complete != null) { | |
p = b.complete(c) | |
} | |
if (p !== false) { | |
gui.showResultScrn(b.pageFrag, c, b.resultScrnOpts) | |
} | |
} | |
function e() { | |
f = null; | |
var p = $.now() + n; | |
gui.showProgressScrn(b.pageFrag, { | |
minTimeout: 0, | |
msg: a, | |
notes: l, | |
isDone: function() { | |
return j && ($.now() >= p || m) | |
}, | |
complete: function() { | |
k() | |
} | |
}) | |
} | |
function o(p) { | |
c = p; | |
m = p.hasErr; | |
if (f == null) { | |
j = true; | |
return | |
} | |
clearTimeout(f); | |
k() | |
} | |
var g = d; | |
var n = h; | |
var a = ""; | |
var l = "L@S#2286"; | |
if (b.progScrnOpts) { | |
if (b.progScrnOpts.timeBeforeShowMs != null) { | |
g = b.progScrnOpts.timeBeforeShowMs | |
} else { | |
g = d | |
} | |
if (b.progScrnOpts.minTime != null) { | |
n = b.progScrnOpts.minTime | |
} else { | |
n = h | |
} | |
a = b.progScrnOpts.msg || a; | |
l = b.progScrnOpts.notes || l | |
} | |
f = setTimeout(e, g); | |
if (b.progressIntf && b.progressIntf.isInProgress) { | |
b.progressIntf.isInProgress(true) | |
} | |
if (b.applyObj) { | |
b.applyObj.complete = o; | |
return b.applyObj | |
} | |
return o | |
}; | |
te.updateDataObjs = function(a) { | |
function g() { | |
if (j >= a.updateObjs.length) { | |
c = a.resultScrnOpts; | |
d(e); | |
return | |
} | |
var k = a.updateObjs[j]; | |
k.dataObj.updateSettings({ | |
jsObj: k.jsObj, | |
timeout: k.timeout, | |
complete: f | |
}) | |
} | |
function f(k) { | |
e = k; | |
c = a.updateObjs[j].resultScrnOpts || a.resultScrnOpts; | |
if (e.hasErr) { | |
d(e); | |
return | |
}++j; | |
g() | |
} | |
function b(k) { | |
var l; | |
if (a.complete != null) { | |
l = a.complete(k) | |
} | |
if (l !== false) { | |
gui.showResultScrn(a.pageFrag, k, c) | |
} | |
return false | |
} | |
var e = []; | |
var c; | |
var j = 0; | |
var h = { | |
pageFrag: a.pageFrag, | |
progressIntf: a.progressIntf, | |
progScrnOpts: a.progScrnOpts, | |
complete: b | |
}; | |
var d = te.chainShowResultScrn(h); | |
g() | |
} | |
})(); | |
(function() { | |
te.isAutoIPv4 = function(a) { | |
return te.isIPv4(a) && a.match(/^169\.254\./) != null | |
}; | |
te.isIPv4 = function(a) { | |
if (a.match(/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/) == null) { | |
return false | |
} | |
return true | |
}; | |
te.isIPv6 = function(e) { | |
function b(h) { | |
var f = /^[0-9A-Fa-f]{1,4}$/; | |
var g = false; | |
$.each(h, function(j, k) { | |
if (k.match(f) == null) { | |
g = true; | |
return false | |
} | |
}); | |
return !g | |
} | |
function d(g) { | |
var f = 0; | |
if (g.length >= 2 && g[0] == "" && g[1] == "") { | |
g.splice(0, 1) | |
} | |
if (g.length >= 2 && g[g.length - 1] == "" && g[g.length - 2] == "") { | |
g.splice(g.length - 1, 1) | |
} | |
$.each(g, function(h, j) { | |
if (j == "") { | |
g[h] = "0"; | |
f++ | |
} | |
}); | |
if (f > 1) { | |
return false | |
} | |
return b(g) | |
} | |
function c(f) { | |
if (f.indexOf("::") < 0) { | |
f = f.split(":"); | |
if (f.length == 8) { | |
return b(f) | |
} | |
} else { | |
f = f.split(":"); | |
return d(f) | |
} | |
} | |
if (e.indexOf(".") > 0) { | |
var a = e.lastIndexOf(":"); | |
if (a && te.isIPv4(e.substr(a + 1)) != false) { | |
e = e.substr(0, a) + ":0:0" | |
} else { | |
return false | |
} | |
} | |
if (!c(e)) { | |
return false | |
} | |
return true | |
}; | |
te.isValidNetMask = function(a) { | |
var c = { | |
255: true, | |
254: true, | |
252: true, | |
248: true, | |
240: true, | |
224: true, | |
192: true, | |
128: true, | |
0: true | |
}; | |
var b; | |
if (a.length != 4 || a[0] == 0) { | |
return false | |
} | |
for (b = 0; b < 4; ++b) { | |
if (a[b] == 0) { | |
a[b] = 0 | |
} | |
if (!c[a[b]]) { | |
return false | |
} | |
if (a[b] != 255) { | |
++b; | |
break | |
} | |
} | |
for (; b < 4; ++b) { | |
if (a[b] != 0) { | |
return false | |
} | |
} | |
return true | |
}; | |
te.networkRangeCheck = function(a) { | |
var b = true; | |
$.each(a.netMask, function(c, d) { | |
b &= (a.refIpAddr[c] & d) == (a.hostIpAddr[c] & d) | |
}); | |
return b | |
} | |
})(); | |
(function() { | |
te.findNamespaceURI = function(e, h) { | |
if (!e.documentElement) { | |
console.error("ownerDoc.documentElement: " + e.documentElement); | |
return "" | |
} | |
if (!e.documentElement.attributes) { | |
console.error(", ownerDoc.documentElement.attributes: " + e.documentElement.attributes); | |
return "" | |
} | |
var a = h.indexOf(":"); | |
if (a < 0) { | |
console.warn("elem: " + h + ", ':' not found"); | |
return "" | |
} | |
var g = h.substr(0, a); | |
var d = e.documentElement.attributes; | |
for (var f = 0; f < d.length; ++f) { | |
var c = d[f].name; | |
a = c.indexOf(":"); | |
if (a < 0) { | |
continue | |
} | |
var b = c.substr(a + 1); | |
if (b == g) { | |
return d[f].value | |
} | |
} | |
return "" | |
}; | |
te.createNodeNs = function(b, e) { | |
var d; | |
var a; | |
if (b.ownerDocument) { | |
a = b.ownerDocument | |
} else { | |
a = b | |
} | |
var c = te.findNamespaceURI(a, e); | |
if (a.createElementNS) { | |
d = a.createElementNS(c, e) | |
} else { | |
d = a.createNode(1, e, c) | |
} | |
return d | |
}; | |
te.appendChild = function(b, a) { | |
if (b.ownerDocument) { | |
b.appendChild(a) | |
} else { | |
b.firstChild.appendChild(a) | |
} | |
return b | |
}; | |
te.condCreateNode = function(e, g, a) { | |
var c = te.mElem(g); | |
var f = $(c + ":last", e); | |
if (f.length == 0) { | |
var b = $(e).get(0); | |
var d = te.createNodeNs(b, g); | |
te.appendChild(b, d); | |
f = $(c, e) | |
} | |
if (a != null) { | |
f.text(a) | |
} | |
return f | |
}; | |
te.createNode = function(e, g, a) { | |
var c = te.mElem(g); | |
var b = $(e).get(0); | |
var d = te.createNodeNs(b, g); | |
te.appendChild(b, d); | |
var f = $(c + ":last", e); | |
if (a != null) { | |
f.text(a) | |
} | |
return f | |
}; | |
te.setAttrNs = function(d, a, b) { | |
var c; | |
if (d.ownerDocument) { | |
c = d.ownerDocument | |
} else { | |
c = d | |
} | |
var e = te.findNamespaceURI(c, a); | |
if (d.setAttributeNS) { | |
d.setAttributeNS(e, a, b) | |
} else { | |
d.setAttribute(a, b) | |
} | |
}; | |
te.removeElem = function(a) { | |
var b = $(a).get(0); | |
if (b != null) { | |
b.parentNode.removeChild(b) | |
} | |
}; | |
te.removeChildren = function(a) { | |
var b = $(a).get(0); | |
if (b == null) { | |
return | |
} | |
while (b.lastChild) { | |
b.removeChild(b.lastChild) | |
} | |
} | |
})(); | |
te.createAddToHomeBtn = function(b, d) { | |
function a(h) { | |
var g = te.cookie.getVal("theatreHome"); | |
var j = g.substr(g.indexOf(h)); | |
var l = g.indexOf(h); | |
var k = j.indexOf("#"); | |
j = g.substr(l, k); | |
var e = j.substr(j.indexOf("show:") + 5); | |
if (e == "false") { | |
var f = j.replace(/show:false/, "show:true"); | |
g = g.replace(j, f); | |
te.cookie.set("theatreHome", g, te.LONG_STORED_DURATION_DAYS) | |
} | |
gui.YNDialogBox.show({ | |
title: te.loc("EWS_STRING_THEATRE_ADD_TO_HOME"), | |
contents: gui.emitHtml("div", {}, "Successfully added " + h + " to home dashboard.") + gui.emitHtml("p", {}, "Go to " + gui.emitHtml("a", { | |
href: "#" | |
}, "Home") + " page."), | |
customBtnText: ["L@S#2303"] | |
}, null) | |
} | |
var c = ""; | |
c += gui.emitHtml("div", { | |
id: "add-to-home-btn" | |
}, gui.emitHtml("div", { | |
"class": "add-to-home-btn-icon" | |
}, " ") + gui.emitHtml("div", { | |
"class": "add-to-home-btn-text" | |
}, te.loc("EWS_STRING_THEATRE_ADD_TO_HOME"))); | |
$(gui.mkQId(b)).html(c); | |
$("#add-to-home-btn").click(function() { | |
a(d) | |
}) | |
}; | |
te.processHeaderExpandCollapse = function(g) { | |
if ($.browser.msie && $.browser.version < 10) { | |
return | |
} | |
function c(j) { | |
var h = []; | |
$.each($(j).nextAll(), function(k, l) { | |
if ($(l).is("h2")) { | |
return false | |
} else { | |
h.push($(l)) | |
} | |
}); | |
return h | |
} | |
function e(h) { | |
$.each($(h).nextAll(), function(j, k) { | |
if ($(k).hasClass("subitem-div")) { | |
return | |
} else { | |
$(h).siblings(".subitem-div").append($(k)) | |
} | |
}) | |
} | |
function b(h) { | |
$.each(h, function(j, k) { | |
k.hide() | |
}) | |
} | |
function f(h) { | |
$.each(h, function(j, k) { | |
k.show() | |
}) | |
} | |
g = $.extend({ | |
expandFirstHeader: true | |
}, g); | |
var d = $("#contentPane").find("h2:visible"); | |
var a = []; | |
if (d.length != 0) { | |
$.each(d, function(h, j) { | |
$(j).parent().append(gui.emitHtml("div", { | |
"class": "subitem-div gui-hidden" | |
})); | |
e($(j)); | |
if (g.expandFirstHeader && h == 0) { | |
$(j).addClass("collapseIconCls"); | |
$(j).siblings(".subitem-div").toggleClass("gui-hidden").toggleClass("gui-visible") | |
} else { | |
$(j).addClass("expandIconCls") | |
} | |
$(j).click(function() { | |
if (!gui.isMobileView()) { | |
$("#contentPane").find(".subitem-div:hidden").show(); | |
return | |
} | |
$(this).toggleClass("expandIconCls").toggleClass("collapseIconCls"); | |
if ($(this).hasClass("collapseIconCls")) { | |
$(this).siblings(".subitem-div").toggleClass("gui-hidden").toggleClass("gui-visible") | |
} else { | |
$(this).siblings(".subitem-div").toggleClass("gui-visible").toggleClass("gui-hidden") | |
} | |
}) | |
}) | |
} | |
}; | |
te.emitOffScreenText = function(a, b) { | |
a.after(gui.emitHtml("span", { | |
"class": "off-screen-text-cls" | |
}, b)) | |
}; | |
te.appendOffScreenText = function(a, b) { | |
a.append(gui.emitHtml("span", { | |
"class": "off-screen-text-cls" | |
}, b)) | |
}; | |
te.prependOffScreenText = function(a, b) { | |
a.prepend(gui.emitHtml("span", { | |
"class": "off-screen-text-cls" | |
}, b)) | |
}; | |
te.emitOffScreenLabel = function(a, b) { | |
$(gui.mkQId(a)).before(gui.emitHtml("label", { | |
"class": "off-screen-text-cls", | |
"for": a.charAt(0) == "#" ? a.substr(1) : a | |
}, b)) | |
}; | |
te.setTabbable = function(a, b) { | |
if (b == null) { | |
b = true | |
} | |
a.attr("tabindex", "0"); | |
if (b) { | |
a.keydown(function(d) { | |
var c = d.keyCode || d.which; | |
if (c == 13) { | |
$(this).click() | |
} | |
}) | |
} | |
} | |
})(); | |
var gui = {}; | |
(function() { | |
var K = "/images/icon_delete"; | |
var M = "/images/icon_status_unknown"; | |
var F = " *"; | |
var q = { | |
tile_loading_animation: "/images/tile_loading_animation", | |
dg_icon_tile_refresh: "/images/dg_icon_tile_refresh", | |
glyph_add_new_contact: "/images/glyph_add_new_contact", | |
glyph_add_new_group_contact: "/images/glyph_add_new_group_contact", | |
glyph_delete: "/images/glyph_delete", | |
glyph_add: "/images/glyph_add", | |
glyph_copy: "/images/glyph_copy", | |
icon_tray_empty: "/images/icon_tray_empty", | |
icon_tray_ok: "/images/icon_tray_ok" | |
}; | |
gui.imageMapping = { | |
action: "/images/icon_action", | |
alert_result: "/images/dg_icon_alert", | |
"delete": "/images/icon_delete", | |
disable: "/images/icon_disable", | |
enable: "/images/icon_enable", | |
err_result: "/images/dg_icon_error", | |
newdocument: "/images/icon_newdocument", | |
ok_result: "/images/dg_icon_success", | |
pw_protected_result: "/images/icon_pw_protected", | |
print: "/images/icon_print", | |
ruledelete: "/images/icon_ruledelete", | |
status_critical: "/images/icon_status_critical09", | |
status_informational: "/images/icon_status_informational09", | |
status_minor: "/images/icon_status_minor09", | |
status_unknown: "/images/icon_status_unknown09", | |
test: "/images/icon_refresh", | |
warn_result: "/images/dg_icon_warning" | |
}; | |
gui.getColorLokDiv = function(Y) { | |
var Z; | |
var X; | |
Y = $.extend({ | |
isLimitedSpace: false | |
}, Y); | |
if (Y.isLimitedSpace) { | |
Z = "gui-txt-colorlok-minimal-space" | |
} else { | |
Z = "gui-txt-colorlok" | |
} | |
X = gui.emitHtml("img", { | |
src: "/images/ColorLok", | |
"class": "gui-img-colorlok", | |
alt: "", | |
title: te.loc("L@S#3049") | |
}); | |
X += gui.emitHtml("span", { | |
"class": Z | |
}, gui.emitHtml("b", null, te.loc("L@S#3050"))); | |
return gui.emitHtml("div", null, X) | |
}; | |
gui.emitHtml = $.hlp.emitHtml; | |
gui.emitClearFloat = $.hlp.emitClearFloat; | |
gui.fixUpInputPair = function(Z) { | |
var Y = [G, A]; | |
for (var X = 0; X < Y.length; X++) { | |
$("." + Y[X], Z).each(function(aa) { | |
var ab = $("label:eq(0)", this); | |
var ad = ab.siblings(".gui-field").find("[id*='-Inp']") || ab.siblings(".gui-field").children(":eq(0)").find("[id*='-Inp']"); | |
var ac = ad.attr("id"); | |
if (ac != "") { | |
ab.attr("for", ac) | |
} | |
}) | |
} | |
gui.fixTooltips(Z) | |
}; | |
gui.fixTooltips = function(Y) { | |
$.locStr.patchLinks(); | |
if (!Y) { | |
$("[title]").tooltip(); | |
return | |
} | |
var X = $(Y); | |
if (X.attr("title")) { | |
X.tooltip() | |
} | |
$("[title]", X).tooltip() | |
}; | |
$.fn.mkAltDataRows = function() { | |
$("tbody tr:visible", this).each(function(X) { | |
var Y = X % 2 == 0 ? gui.ListTbl.prototype._EVEN_ROW_CLS : gui.ListTbl.prototype._ODD_ROW_CLS; | |
$(this).removeClass(gui.ListTbl.prototype._ODD_ROW_CLS); | |
$(this).removeClass(gui.ListTbl.prototype._EVEN_ROW_CLS); | |
$(this).addClass(Y) | |
}) | |
}; | |
$.fn.mkListTbl = function() { | |
$(this).addClass(gui.ListTbl.prototype._CLS); | |
$(this).addClass("gui-list-div"); | |
$(this).mkAltDataRows() | |
}; | |
gui.mkListTbl = function(X) { | |
$(Q(X)).mkListTbl() | |
}; | |
gui.isNumericKey = function(X) { | |
return X >= 48 && X <= 57 | |
}; | |
gui.isMovementKey = function(X) { | |
return X == u || X == 9 || (X >= 33 && X <= 40) || X == 45 || X == j | |
}; | |
gui.hidePwStr = function(Y, X) { | |
if (Y == null) { | |
return "" | |
} | |
if (X == null) { | |
X = h | |
} | |
return Y.replace(/./g, X) | |
}; | |
gui.setHtmlDir = function() { | |
var X = te.isLangRTL(te.getDisplayLang()); | |
var Y = (navigator.userAgent.match(/Android|iPad/) && !gui.isMobileView()) ? $("#pgm-overall-container") : $("html"); | |
if (X) { | |
Y.attr("dir", "rtl"); | |
$("body").addClass("rtl") | |
} else { | |
Y.removeAttr("dir"); | |
$("body").removeClass("rtl") | |
} | |
$.tooltip.enable(true) | |
}; | |
var J = "contentPane"; | |
var G = "gui-input-pair"; | |
var A = "gui-input-pair-vert"; | |
var a = "gui-ie-set-layout"; | |
var C = 50; | |
var D = 100; | |
var x = 250; | |
var P = "GUI"; | |
var h = "*"; | |
var R = 250; | |
var V = $.hlp.trueFn; | |
var n = $.hlp.falseFn; | |
var p = false; | |
var u = 8; | |
var I = 9; | |
var j = 46; | |
$.extend($.expr[":"], { | |
data: function(aa, ab, Z) { | |
var ac = $(aa).get(0), | |
Y; | |
if (!Z[3]) { | |
for (var X in ac) { | |
if ((/jQuery\d+/).test(X)) { | |
return true | |
} | |
} | |
} else { | |
Y = Z[3].split("="); | |
if (Y[1]) { | |
if ((/^\/.+\/([mig]+)?$/).test(Y[1])) { | |
return (new RegExp(Y[1].substr(1, Y[1].lastIndexOf("/") - 1), Y[1].substr(Y[1].lastIndexOf("/") + 1))).test($(aa).data(Y[0])) | |
} else { | |
return $(aa).data(Y[0]) == Y[1] | |
} | |
} else { | |
if ($(aa).data(Y[0])) { | |
return true | |
} else { | |
$(aa).removeData(Y[0]); | |
return false | |
} | |
} | |
} | |
return false | |
} | |
}); | |
function e(X) { | |
return gui.imageMapping[X] || "/images/" + X | |
} | |
function r(X) { | |
te.logMsg(P, te.WARN_DEBUG_LEVEL, X) | |
} | |
function v(X) { | |
te.logMsg(P, te.ERROR_DEBUG_LEVEL, X) | |
} | |
function d(X) { | |
return X ? "disabled" : null | |
} | |
function L(X) { | |
return X ? "readonly" : null | |
} | |
function b(Y, X) { | |
if (X != null) { | |
return Y | |
} else { | |
return "" | |
} | |
} | |
function E(Y, X) { | |
if (X != null) { | |
return " " + Y + "='" + X + "'" | |
} else { | |
return "" | |
} | |
} | |
function Q(Z, Y) { | |
if (Y == null) { | |
Y = "#" | |
} | |
var X = Z.charAt(0); | |
if (X != "#" && X != ".") { | |
Z = Y + Z | |
} | |
return Z | |
} | |
function z(Y) { | |
var X = Y.charAt(0); | |
if (X == "#" || X == ".") { | |
Y = Y.substring(1) | |
} | |
return Y | |
} | |
gui.mkQId = Q; | |
gui.stripQId = z; | |
function O(Y, X) { | |
var Z = $(X).parent(); | |
if (!Z.hasClass(G) && !Z.hasClass(A)) { | |
Z = Z.parent() | |
} | |
if (Z.hasClass(G) || Z.hasClass(A)) { | |
Y._labelObj = Z.children("label:eq(0)") | |
} | |
} | |
function W(Z) { | |
var aa = !Z.isReqField(); | |
if (Z._labelObj == null) { | |
return | |
} | |
var Y = $(Z._labelObj).text(); | |
if (Y.charAt(Y.length - 1) == ":") { | |
r(Z.opts.divId + " has trailing ':'") | |
} | |
if (Y.substring(Y.length - F.length) == F) { | |
Y = Y.substring(0, Y.length - F.length) | |
} | |
if (gui.isTheatreLNF()) { | |
var X = ""; | |
if (!aa) { | |
X = gui.emitHtml("span", {}, F); | |
if (Z.opts.example) { | |
$(Z._hashDivId_eg).addClass("gui-input-field-err") | |
} | |
} | |
$(Z._labelObj).html(Y + X) | |
} else { | |
if (!aa) { | |
Y += F | |
} | |
$(Z._labelObj).text(Y) | |
} | |
} | |
function y(aa, ab, X) { | |
var Z = te.loc(aa.opts.errLabel) || $(aa._labelObj).text(); | |
var Y = {}; | |
if (X == "disallowEmptyLinkedField" || X == "ipV4V6LinkFieldCheck" || X == "ipV4V6NetworkPrefixCheck") { | |
if (aa.opts.appShowLabelonError && aa.opts._valLinkedField.opts.appShowLabelonError) { | |
Y.appShowLabelonError = true; | |
Y.errFieldLabel = Z; | |
Y.errvalLinkedFieldLabel = $(aa.opts._valLinkedField._labelObj).text() | |
} else { | |
Y.appShowLabelonError = false; | |
Y.errFieldLabel = ""; | |
Y.errvalLinkedFieldLabel = "" | |
} | |
if (aa.opts._valLinkedField.isFakeFilled()) { | |
$(aa.opts._valLinkedField._labelObj).addClass(aa._LABEL_ERR_CLS); | |
$(aa.opts._valLinkedField._hashDivId).addClass(aa._ERR_CLS) | |
} | |
Y.displayText = te.loc(ab); | |
Y.checkOp = X; | |
return Y | |
} | |
if (aa.opts.errLabel == null && Z.substring(Z.length - F.length) == F) { | |
Z = Z.substring(0, Z.length - F.length) | |
} | |
if (Z.charAt(Z.length - 1) == ":") { | |
Z = Z.substring(0, Z.length - 1) | |
} | |
return Z + ": " + te.loc(ab) | |
} | |
function w(Z) { | |
var aa; | |
var X; | |
if (Z.exampleStr != null) { | |
aa = gui.emitHtml("div", { | |
id: Z.inputId | |
}, te.loc(Z.inputStr)); | |
aa += gui.emitHtml("div", { | |
"class": "gui-example" | |
}, te.loc(Z.exampleStr)) | |
} else { | |
X = Z.inputId; | |
aa = te.loc(Z.inputStr) | |
} | |
var Y = gui.emitHtml("label", { | |
"class": Z.labelCls | |
}, te.loc(Z.labelStr)); | |
return Y + gui.emitHtml("div", { | |
id: X, | |
"class": te.concatStr("gui-field", Z.inputCls) | |
}, aa) | |
} | |
function t(Y, Z) { | |
$(Y).html(""); | |
for (var X = 0; X < Z.length; ++X) { | |
var aa = Z[X]; | |
$(Y).append(gui.emitHtml("option", { | |
value: aa.value | |
}, aa.dispStr)) | |
} | |
} | |
function N(Y, X) { | |
return te.strCmp(Y.dispStr, X.dispStr) | |
} | |
function c(ag, Y) { | |
Y = $.extend({ | |
padding: false, | |
ctrX: false, | |
ctrY: false | |
}, Y); | |
if (!(Y.ctrX || Y.ctrY)) { | |
return | |
} | |
var X = $(Q(ag, ".")); | |
if (!X.is(":visible")) { | |
return | |
} | |
var aj = X.parent(); | |
var ad = aj.width(); | |
var af = aj.height(); | |
var ac = X.width(); | |
var ae = X.height(); | |
if ((ad == 0 || ac == 0) && Y.ctrX) { | |
return | |
} | |
if ((af == 0 || ae == 0) && Y.ctrY) { | |
return | |
} | |
var ab = (ad * 0.5 - ac * 0.5).toFixed(); | |
var Z = (af * 0.5 - ae * 0.5).toFixed(); | |
var ai = Y.ctrX; | |
var ah = Y.ctrY; | |
var aa = function(al, ak) { | |
return (al ? "" + ak + "px" : "") | |
}; | |
if (Y.padding) { | |
X.css({ | |
position: "relative", | |
"padding-left": aa(ai, ab), | |
"padding-right": aa(ai, ab), | |
"padding-top": aa(ah, Z), | |
"padding-bottom": aa(ah, Z) | |
}) | |
} else { | |
X.css({ | |
position: "relative", | |
"margin-left": aa(ai, ab), | |
"margin-right": aa(ai, ab), | |
"margin-top": aa(ah, Z), | |
"margin-bottom": aa(ah, Z) | |
}) | |
} | |
} | |
gui.centerXY = c; | |
gui.mkShowDetails = function(Z) { | |
function X() { | |
var ab; | |
var ad; | |
var aa; | |
var ac = Z.useLightIcon ? "gui-desc-icon" : "gui-dark-desc-icon"; | |
var ae = Z.useLightIcon ? "gui-asc-icon" : "gui-dark-asc-icon"; | |
if ($(Z.detailsId).hasClass("gui-hidden")) { | |
ab = Z.moreDetailLinkText; | |
ad = Z.moreDetailLinkTooltip || Z.moreDetailLinkText; | |
aa = te.concatStr(ac, "gui-inline-block gui-ie-set-layout") | |
} else { | |
ab = Z.lessDetailLinkText; | |
ad = Z.lessDetailLinkTooltip || Z.lessDetailLinkText; | |
aa = te.concatStr(ae, "gui-inline-block gui-ie-set-layout") | |
} | |
$(Z.linkId).html(te.loc(ab)); | |
$(Z.linkId).attr("title", $.hlp.decodeHtmlEntities(te.loc(ad))); | |
gui.fixTooltips(Z.linkId); | |
$(Z.linkImgId).html(gui.emitHtml("div", { | |
"class": aa | |
}, " ")) | |
} | |
function Y() { | |
if (!$(Z.detailsId).hasClass("gui-hidden") && $(Z.detailsId).find(".gui-hide-details").length == 0) { | |
var aa = gui.emitHtml("a", { | |
href: "#", | |
"class": "gui-hide-details" | |
}, te.loc("L@S#4348")); | |
var ab = $(Z.detailsId).children(); | |
if (ab.length > 1) { | |
$.each($(Z.detailsId).children().reverse(), function(ac, ad) { | |
if (ad.innerHTML != "" && (ad.style.display != "" || ad.className.search("gui-hidden") != 0)) { | |
ad.innerHTML += aa; | |
return false | |
} | |
}) | |
} else { | |
ab.append(aa) | |
} | |
} | |
$(Z.detailsId + " .gui-hide-details").click(function(ac) { | |
ac.preventDefault(); | |
$(Z.detailsId).addClass("gui-hidden"); | |
$(Z.linkId).removeClass("gui-hidden") | |
}) | |
} | |
if (gui.isTheatreLNF()) { | |
$(Z.linkId).addClass("gui-show-details").text(te.loc("L@S#4347")) | |
} else { | |
X() | |
} | |
$(Z.linkImgId).click(function(aa) { | |
aa.preventDefault(); | |
$(Z.linkId).click() | |
}); | |
$(Z.linkId).click(function(aa) { | |
aa.preventDefault(); | |
$(Z.detailsId).toggleClass("gui-hidden"); | |
if (gui.isTheatreLNF()) { | |
$(this).toggleClass("gui-hidden"); | |
Y() | |
} else { | |
X() | |
} | |
}) | |
}; | |
gui.showVeil = function(Y) { | |
function X() { | |
if (Y === undefined) { | |
Y = true | |
} | |
if (!Y) { | |
$("#gui-gbl-veil").remove(); | |
return | |
} | |
if ($("#gui-gbl-veil").length == 0) { | |
$("body").append(gui.emitHtml("div", { | |
id: "gui-gbl-veil" | |
}, "")) | |
} | |
$("#gui-gbl-veil").css({ | |
position: "absolute", | |
top: "0", | |
left: "0", | |
"border-width": "0", | |
width: $.ui.dialog.overlay.width(), | |
height: $.ui.dialog.overlay.height(), | |
"z-index": "100", | |
"background-color": "#000000", | |
opacity: "0.2" | |
}) | |
} | |
X() | |
}; | |
(function() { | |
gui.CommandBtns = function(Z) { | |
Z = $.fillIn(Z, { | |
enableFloatingToolbar: true, | |
useStdStyle: true, | |
onClick: $.noop | |
}); | |
this.opts = Z | |
}; | |
var Y = "gui-cmd-btn-"; | |
var X = " ." + Y; | |
gui.CommandBtns.prototype._MOUSE_OVER_CLS = "gui-mouseover"; | |
gui.CommandBtns.prototype._DISABLED_CLS = "disabled"; | |
gui.CommandBtns.prototype._HIDDEN_CLS = "gui-hidden"; | |
gui.CommandBtns.prototype._ACTION_BTN_CLS = "gui-action-btn"; | |
gui.CommandBtns.prototype._emitSingleHtml = function(ad, ab, Z) { | |
var ac = ""; | |
var aa = ["L@S#0670", "L@S#0438", "L@S#2303", "L@S#0002", "L@S#0009", "L@S#0072", "L@S#1127", "L@S#0577", "L@S#3990", "L@S#3074", "L@S#3211", "L@S#3117", "L@S#3936", "L@S#3933", "L@S#1712"]; | |
if (ab == null) { | |
ab = te.loc(ad.text) | |
} | |
if (ad.isActionBtn || (ad.isActionBtn == undefined && $.inArray(ad.text, aa) < 0)) { | |
ac = this._ACTION_BTN_CLS | |
} | |
return gui.emitHtml("input", { | |
type: "button", | |
"class": te.concatStr(Y + Z, ad.cls, ac, b(this._DISABLED_CLS, ad.disabled), b(this._HIDDEN_CLS, ad.hidden)), | |
value: ab, | |
title: te.loc(ad.title) | |
}) | |
}; | |
gui.CommandBtns.prototype.create = function(ah) { | |
if (this.opts.mainCls == null) { | |
this.opts.mainCls = z(ah) + "-mainCls" | |
} | |
ah = Q(ah); | |
this._dotMainCls = "." + this.opts.mainCls; | |
var af = this; | |
var ad = this.opts.list; | |
var al = ""; | |
var ab = false; | |
var ac; | |
var ae; | |
if (this.opts.type == "button") { | |
for (ac = 0; ac < ad.length; ++ac) { | |
ae = ad[ac]; | |
var aj = te.loc(ae.text); | |
al += this._emitSingleHtml(ae, aj, ae.cmd) | |
} | |
if (this.opts.innerCls) { | |
al = gui.emitHtml("div", { | |
"class": this.opts.innerCls | |
}, al) | |
} | |
al += gui.emitClearFloat(); | |
if (gui.isTheatreLNF() && !this.opts.enableFloatingToolbar) { | |
this.opts.styleCls = te.concatStr(this.opts.styleCls, "gui-disable-floating-toolbar") | |
} | |
if (af.opts.inPlace) { | |
$(ah).addClass(te.concatStr("gui-cmd-btns", this.opts.mainCls, this.opts.styleCls)) | |
} else { | |
al = gui.emitHtml("div", { | |
"class": te.concatStr("gui-cmd-btns", this.opts.mainCls, this.opts.styleCls) | |
}, al) | |
} | |
af._type = " input" | |
} else { | |
for (ac = 0; ac < ad.length; ++ac) { | |
ae = ad[ac]; | |
var ak = ""; | |
if (ae.img) { | |
ae.title = ae.title || ae.text; | |
ak += gui.emitHtml("img", { | |
src: e(ae.img), | |
alt: te.loc(ae.title), | |
title: "" | |
}) | |
} | |
if (ae.text && !ae.img) { | |
ak += te.loc(ae.text); | |
ae.title = (ae.title != ae.text) ? ae.title : "" | |
} | |
var aa; | |
var ag; | |
if (ae.cmd != null) { | |
aa = Y + ae.cmd; | |
ag = gui.emitHtml("a", { | |
href: "#" | |
}, ak) | |
} else { | |
aa = ""; | |
ag = ak | |
} | |
al += gui.emitHtml("li", { | |
"class": te.concatStr(aa, ae.cls, b(this._DISABLED_CLS, ae.disabled), b(this._HIDDEN_CLS, ae.hidden)), | |
title: te.loc(ae.title) | |
}, ag) | |
} | |
al = gui.emitHtml("ul", { | |
"class": te.concatStr("gui-cmd-btns-list", this.opts.mainCls) | |
}, al); | |
al += gui.emitClearFloat(); | |
af._type = " li"; | |
ab = true | |
} | |
$(ah).addClass(a).html(al); | |
gui.fixTooltips(ah); | |
if (ab) { | |
var Z = $(ah).prev(); | |
$("table.gui-list-tbl", Z).addClass("gui-no-btm-margin"); | |
var ai = $(ah).next(); | |
$("table.gui-list-tbl", ai).addClass("gui-no-top-margin") | |
} | |
$(ah + af._type).each(function(am) { | |
$(this).hover(function(ao) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass(af._MOUSE_OVER_CLS) | |
} | |
}, function(ao) { | |
$(this).removeClass(af._MOUSE_OVER_CLS) | |
}).click(an); | |
$("a", this).click(function(ao) { | |
ao.preventDefault() | |
}); | |
function an() { | |
$(this).blur().removeClass(af._MOUSE_OVER_CLS); | |
if (ad[am].cmd == null) { | |
return | |
} | |
af._cmd = ad[am].cmd; | |
if (!$(this).hasClass(af._DISABLED_CLS)) { | |
var ao; | |
if (af.isInProgress()) { | |
console.warn(af._cmd + ": update in progress!"); | |
return | |
} | |
try { | |
if ($.typeOf(af.opts[af._cmd]) == "function") { | |
ao = af.opts[af._cmd].call(af, this, af._cmd) | |
} else { | |
ao = af.opts.onClick.call(af, this, af._cmd) | |
} | |
if (ao === false) { | |
v("Unknown cmd " + af._cmd) | |
} | |
} catch (ap) { | |
v("CommandBtns: " + af._cmd + " err"); | |
console.log(ap); | |
gui.showLoadPageFailedScrn({ | |
jsErr: true | |
}) | |
} | |
} | |
} | |
}) | |
}; | |
gui.CommandBtns.prototype.show = function(Z) { | |
if (Z == null) { | |
Z = true | |
} | |
if (Z) { | |
$(this._dotMainCls).show() | |
} else { | |
$(this._dotMainCls).hide() | |
} | |
}; | |
gui.CommandBtns.prototype.disableBtns = function(Z) { | |
if (Z == null) { | |
Z = true | |
} | |
var aa = $(this._dotMainCls + this._type); | |
if (Z) { | |
aa.addClass(this._DISABLED_CLS) | |
} else { | |
aa.removeClass(this._DISABLED_CLS) | |
} | |
}; | |
gui.CommandBtns.prototype.enableBtn = function(Z, aa) { | |
if (aa == null) { | |
aa = true | |
} | |
if (!$.isArray(Z)) { | |
Z = [Z] | |
} | |
for (var ab = 0; ab < Z.length; ++ab) { | |
var ac = $(this._dotMainCls + X + Z[ab]); | |
if (aa) { | |
ac.removeClass(this._DISABLED_CLS) | |
} else { | |
ac.addClass(this._DISABLED_CLS) | |
} | |
} | |
}; | |
gui.CommandBtns.prototype.showBtns = function(Z) { | |
if (Z == null) { | |
Z = true | |
} | |
var aa = $(this._dotMainCls + this._type); | |
if (Z) { | |
aa.removeClass(this._HIDDEN_CLS) | |
} else { | |
aa.addClass(this._HIDDEN_CLS) | |
} | |
}; | |
gui.CommandBtns.prototype.showBtn = function(Z, aa) { | |
if (aa == null) { | |
aa = true | |
} | |
if (!$.isArray(Z)) { | |
Z = [Z] | |
} | |
for (var ab = 0; ab < Z.length; ++ab) { | |
var ac = $(this._dotMainCls + X + Z[ab]); | |
if (aa) { | |
ac.removeClass(this._HIDDEN_CLS) | |
} else { | |
ac.addClass(this._HIDDEN_CLS) | |
} | |
} | |
}; | |
gui.CommandBtns.prototype.click = function(Z) { | |
$(this._dotMainCls + X + Z).click() | |
}; | |
gui.CommandBtns.prototype.isInProgress = function(Z) { | |
if (arguments.length == 0) { | |
return this._inProgressFlag | |
} | |
this._inProgressFlag = !!Z | |
}; | |
gui.CommandBtns.prototype.setActionBtn = function(Z) { | |
var aa = $(this._dotMainCls + X + Z); | |
aa.addClass(this._ACTION_BTN_CLS) | |
}; | |
gui.CommandBtns.prototype.removeActionBtn = function(Z) { | |
var aa = $(this._dotMainCls + X + Z); | |
aa.removeClass(this._ACTION_BTN_CLS) | |
}; | |
gui.CommandBtns.prototype.getCmd = function() { | |
return this._cmd | |
}; | |
gui.CommandBtns.prototype.updateApplyMultiple = function(aa, Z) { | |
if (this.opts.multipleChar == null) { | |
return | |
} | |
var ab = $(this._dotMainCls + ":eq(0)" + X + aa).text(); | |
if (ab.charAt(ab.length - 1) == this.opts.multipleChar) { | |
ab = ab.substring(0, ab.length - 1) | |
} | |
if (Z) { | |
ab += this.opts.multipleChar | |
} | |
$(this._dotMainCls + X + aa).text(ab) | |
} | |
})(); | |
gui.confirmBeforeSwitchPage = function(X) { | |
if (X == null) { | |
return p | |
} | |
p = !!X | |
}; | |
gui.showConfirmCancelScrn = function(X, Y) { | |
X = $.fillIn(X, { | |
title: "L@S#3696", | |
contents: te.loc("L@S#2284") + gui.emitHtml("p", null, te.loc("L@S#3357")) | |
}); | |
gui.YNDialogBox.show(X, Y) | |
}; | |
gui.showDelConfirmScrn = function(Z, aa) { | |
Z = $.fillIn(Z, { | |
title: "L@S#0935", | |
moreThreshold: 5 | |
}); | |
if (Z.delAllMsg == null) { | |
Z.delAllMsg = Z.delMsg | |
} | |
Z.contents = ""; | |
if (Z.list.length < Z.numEntries) { | |
if (Z.delMsg) { | |
Z.contents += te.loc(Z.delMsg) | |
} | |
var Y = ""; | |
var X; | |
for (X = 0; X < Z.list.length && X < Z.moreThreshold; ++X) { | |
Y += gui.emitHtml("li", null, Z.list[X]) | |
} | |
if (Z.list.length > Z.moreThreshold) { | |
Y += gui.emitHtml("li", null, "...") | |
} | |
Z.contents += gui.emitHtml("ul", null, Y); | |
if (Z.list2) { | |
if (Z.delMsg2) { | |
Z.contents += te.loc(Z.delMsg2) | |
} | |
Y = ""; | |
for (X = 0; X < Z.list2.length; ++X) { | |
Y += gui.emitHtml("li", null, Z.list2[X]) | |
} | |
Z.contents += gui.emitHtml("ul", null, Y); | |
Z.autoSize = Z.moreThreshold + Z.list2.length >= 10 | |
} | |
} else { | |
Z.contents += te.loc(Z.delAllMsg) | |
} | |
gui.YNDialogBox.show(Z, aa) | |
}; | |
(function() {})(); | |
gui._formMgrLastErrList = []; | |
gui.Form = function(Z) { | |
Z = $.extend({ | |
divId: J, | |
useStdStyle: true | |
}, Z); | |
gui._formMgrLastErrList = []; | |
this.opts = Z; | |
this._hashDivId = Q(Z.divId); | |
this._infoDivId = this._hashDivId + " ." + this._INFO_DIV_CLS; | |
this._list = []; | |
this._isErrDivEnabled = false; | |
if ($(this._infoDivId).length == 0) { | |
var X = $(this._hashDivId).find("h1:eq(0)"); | |
var Y = gui.emitHtml("div", { | |
"class": this._INFO_DIV_CLS | |
}, ""); | |
if (X.length > 0) { | |
X.after(Y) | |
} else { | |
$(this._hashDivId).prepend(Y) | |
} | |
$(this._infoDivId).hide() | |
} | |
}; | |
gui.Form.prototype._INFO_DIV_CLS = "gui-form-mgr-err-div"; | |
gui.Form.prototype._ERR_CLS = "gui-form-mgr-err-text"; | |
gui.Form.prototype.createAdd = function(X, Y) { | |
if ($(Q(X)).siblings("label").text() == te.loc(Y.opts.title)) { | |
Y.opts.title = "" | |
} | |
Y.create(X); | |
this.add(Y); | |
return Y | |
}; | |
gui.Form.prototype.add = function(X) { | |
X = $.fillIn(X, { | |
clearInfo: $.noop, | |
validate: V | |
}); | |
if (X.opts.isConfirmField && X.opts.jsField && !X.opts._valLinkedField) { | |
$.each(this._list, function(Y, Z) { | |
if (X.opts.jsField == Z.opts.jsField) { | |
console.log("Form: auto-link " + X.opts.jsField); | |
X.opts._valLinkedField = Z; | |
Z.setLinkedField(X); | |
return false | |
} | |
}) | |
} | |
this._list.push(X); | |
return X | |
}; | |
gui.Form.prototype.getValues = function(Z) { | |
if (Z == null) { | |
Z = {} | |
} | |
for (var Y = 0; Y < this._list.length; ++Y) { | |
var aa = this._list[Y]; | |
if (!aa.opts.jsField) { | |
continue | |
} | |
if (aa.opts.isConfirmField) { | |
continue | |
} | |
if (!aa.isVisible()) { | |
continue | |
} | |
var X; | |
if (aa.isEnabled()) { | |
X = aa.val() | |
} else { | |
X = null | |
} | |
$.hlp.setNestedFieldValue(Z, aa.opts.jsField, X) | |
} | |
return Z | |
}; | |
gui.Form.prototype.setValues = function(X) { | |
$.each(this._list, function(Y, aa) { | |
if (!aa.opts.jsField) { | |
return | |
} | |
var Z = $.hlp.getNestedFieldValue(X, aa.opts.jsField); | |
if (Z !== undefined) { | |
aa.val(Z) | |
} | |
}); | |
if (this.onSetVal) { | |
this.onSetVal(X) | |
} | |
this.clearInfo() | |
}; | |
gui.Form.prototype.val = function(Z) { | |
if (Z === undefined) { | |
Z = this.getValues() | |
} else { | |
for (var Y = 0; Y < this._list.length; ++Y) { | |
var aa = this._list[Y]; | |
if (!aa.opts.jsField) { | |
continue | |
} | |
var X = $.hlp.getNestedFieldValue(Z, aa.opts.jsField); | |
if (X === undefined) { | |
X = null | |
} | |
aa.val(X) | |
} | |
if (this.onSetVal) { | |
this.onSetVal(Z) | |
} | |
this.clearInfo() | |
} | |
return Z | |
}; | |
gui.Form.prototype.clearInfo = function() { | |
var Y = te.loc("L@S#2298"); | |
var Z = false; | |
for (var X = 0; X < this._list.length; ++X) { | |
Z |= this._list[X].isReqField(); | |
this._list[X].clearInfo() | |
} | |
if (Z && this._isErrDivEnabled) { | |
$(this._infoDivId).removeClass(this._ERR_CLS).html(Y).show() | |
} else { | |
$(this._infoDivId).hide() | |
} | |
}; | |
gui.Form.prototype.validate = function(ad) { | |
ad = $.extend({}, ad); | |
this.clearInfo(); | |
var X = true; | |
var ab = ad.appendErr ? gui._formMgrLastErrList : []; | |
var aa; | |
var Y; | |
var ac; | |
for (aa = 0; aa < this._list.length; ++aa) { | |
var ae = this._list[aa]; | |
if (!ae.isVisible()) { | |
continue | |
} | |
if (!ae.isEnabled()) { | |
continue | |
} | |
var Z = ae.validate(); | |
if ($.typeOf(Z) == "string") { | |
ab.push(Z); | |
Z = false | |
} else { | |
if ($.typeOf(Z) == "object") { | |
if (Z.checkOp == "disallowEmptyLinkedField" || Z.checkOp == "ipV4V6LinkFieldCheck" || Z.checkOp == "ipV4V6NetworkPrefixCheck") { | |
if (Y == Z.displayText) { | |
continue | |
} | |
Y = Z.displayText; | |
if (!Z.appShowLabelonError) { | |
ac = Z.displayText | |
} else { | |
ac = Z.errFieldLabel + "/" + Z.errvalLinkedFieldLabel + ": " + Z.displayText | |
} | |
ab.push(ac); | |
Z = false | |
} | |
} | |
} | |
X &= Z | |
} | |
gui._formMgrLastErrList = ab; | |
if (ad.appendErr) { | |
gui.YNDialogBox.close() | |
} | |
this.showValidateErrors(ab, ad.applyBtnText); | |
return X | |
}; | |
gui.Form.prototype.getLastErrList = function() { | |
return gui._formMgrLastErrList | |
}; | |
gui.Form.prototype.widgetVal = function(X, Y) { | |
var Z = arguments.length == 1; | |
var aa; | |
$.each(this._list, function(ab, ac) { | |
if (ac.opts.jsField == X) { | |
if (Z) { | |
aa = ac.val() | |
} else { | |
ac.val(Y) | |
} | |
return false | |
} | |
}); | |
return aa | |
}; | |
gui.Form.prototype.setCmdBtns = function(X) { | |
this._cmdBtns = X; | |
return X | |
}; | |
gui.Form.prototype.selCmdBtn = function(X) { | |
this._cmdBtns.click(X) | |
}; | |
gui.Form.prototype.showValidateErrors = function(Y, ab) { | |
if (Y.length == 0) { | |
$(this._infoDivId).hide(); | |
return | |
} | |
if (ab == null) { | |
ab = "L@S#0004" | |
} | |
var Z = te.loc("L@S#2289", te.loc(ab)); | |
var aa = ""; | |
for (var X = 0; X < Y.length; ++X) { | |
aa += gui.emitHtml("li", null, Y[X]) | |
} | |
Z += gui.emitHtml("ul", null, aa); | |
if (gui.isTheatreLNF() && gui.isMobileView()) { | |
$(this._infoDivId).addClass(this._ERR_CLS).html(te.loc("L@S#2289", te.loc(ab))).show() | |
} else { | |
gui.OKDialogBox.show({ | |
contents: Z, | |
title: "L@S#0561" | |
}, null) | |
} | |
}; | |
gui.Form.prototype.onShowTouchup = function() { | |
for (var X = 0; X < this._list.length; ++X) { | |
this._list[X].onShowTouchup() | |
} | |
}; | |
gui.ListTbl = function(X) { | |
X = $.fillIn(X, { | |
useStdStyle: true, | |
enableAltDataRows: true, | |
minRows: 5, | |
isSelectable: n, | |
onSelect: $.noop, | |
onTick: $.noop, | |
onTickAll: $.noop | |
}); | |
this.opts = X | |
}; | |
gui.ListTbl.prototype._DIV_CLS = "gui-list-div"; | |
gui.ListTbl.prototype._CLS = "gui-list-tbl"; | |
gui.ListTbl.prototype._LIST_TBL_MOBILE_CLS = "gui-list-tbl-mobile"; | |
gui.ListTbl.prototype._ODD_ROW_CLS = "gui-list-tbl-odd-row"; | |
gui.ListTbl.prototype._EVEN_ROW_CLS = "gui-list-tbl-even-row"; | |
gui.ListTbl.prototype._MOUSEOVER_ROW_CLS = "gui-list-tbl-mouseover-row"; | |
gui.ListTbl.prototype._SELECTED_ROW_CLS = "gui-list-tbl-selected-row"; | |
gui.ListTbl.prototype._CHECKED_ROW_CLS = "gui-list-tbl-checked-row"; | |
gui.ListTbl.prototype.create = function(aa) { | |
this._tblDivId = Q(aa); | |
this._tickName = z(this._tblDivId) + "-Tick"; | |
var ad; | |
var ap = ""; | |
var af = ""; | |
var ai = ""; | |
var ao = ""; | |
var an; | |
var Y; | |
var ah = false; | |
var ab = false; | |
var ak = false; | |
var aq = {}; | |
if (this.opts.getHdr) { | |
ad = this.opts.getHdr.call(this); | |
var al = []; | |
for (an = 0; an < ad.length; ++an) { | |
var Z = ad[an]; | |
ah |= Z.colCls != "" && Z.colCls != null; | |
ab |= !!Z.text || !!Z.html || !!Z.type; | |
if (Z.widthCls) { | |
al.push(Z.widthCls) | |
} else { | |
al.push(null) | |
} | |
if (ad[an].sortable) { | |
ak = true | |
} | |
aq[an] = { | |
sorter: !!ad[an].sortable | |
} | |
} | |
if (ah) { | |
ai = ""; | |
for (an = 0; an < ad.length; ++an) { | |
ai += gui.emitHtml("col", { | |
"class": ad[an].colCls | |
}, "") | |
} | |
ap += gui.emitHtml("colgroup", {}, ai) | |
} | |
if (ab) { | |
ap += gui.emitHtml("thead", null, o(ad, { | |
isHeader: true, | |
tickName: this._tickName, | |
widthClsList: al | |
})) | |
} | |
} | |
var aj = 0; | |
while (true) { | |
this.skip = false; | |
var ae = this.opts.getData.call(this, aj); | |
if (this.skip) { | |
++aj; | |
continue | |
} | |
if (ae == null) { | |
break | |
} | |
af += o(ae, { | |
tickName: this._tickName, | |
name: this.opts.name, | |
dataTitleList: ad | |
}); | |
++aj | |
} | |
var ac; | |
if (this.opts.getEmptyRow) { | |
ac = this.opts.getEmptyRow.call(this) | |
} else { | |
if (ad) { | |
ac = []; | |
for (an = 0; an < ad.length; ++an) { | |
ac.push({ | |
html: " " | |
}) | |
} | |
} | |
} | |
if (ac) { | |
for (; aj < this.opts.minRows; ++aj) { | |
af += o(ac, { | |
tickName: this._tickName, | |
name: this.opts.name, | |
dataTitleList: ad | |
}) | |
} | |
} | |
af = gui.emitHtml("tbody", {}, af); | |
var X = ""; | |
var ar = ""; | |
var ag = ""; | |
if (this.opts.useStdStyle) { | |
X = this._DIV_CLS; | |
ar = this._CLS | |
} | |
if (this.opts.fixedLayout) { | |
ag = "fixed-layout-tbl" | |
} | |
if (this.opts.inPlace) { | |
$(this._tblDivId).addClass(te.concatStr(ar, ag, this.opts.mainCls)); | |
ai = ap + af | |
} else { | |
ai = gui.emitHtml("table", { | |
id: z(this._tblDivId) + "-Tbl", | |
"class": te.concatStr(ar, ag, this.opts.mainCls) | |
}, ap + af); | |
ai = gui.emitHtml("div", { | |
"class": X | |
}, ai) | |
} | |
$(this._tblDivId).html(ai); | |
gui.fixTooltips(this._tblDivId); | |
if (this.opts.enableAltDataRows) { | |
$(this._tblDivId).mkAltDataRows() | |
} | |
if (this.opts.enableSelectableDataRows) { | |
this._enableSelectableDataRows() | |
} | |
$(this._tblDivId + " tbody tr").each(function(at) { | |
$(this).data("rowIdx", at) | |
}); | |
if (this.opts.enableTick) { | |
this._enableTick(); | |
this._enableTickAll() | |
} | |
if (ak || this.opts.forceSort) { | |
for (var am in aq) { | |
if (aq[am].sorter) { | |
delete aq[am] | |
} | |
} | |
this.sort({ | |
widgets: ["zebra"], | |
headers: aq | |
}) | |
} | |
s(this); | |
m(this) | |
}; | |
function g() { | |
var X = $(this._tblDivId + " thead input[name=" + this._tickName + "]"); | |
this.deselectPrevRow(); | |
this._updateAndDrawTick(X.attr("checked")); | |
this.opts.onTickAll.call(this) | |
} | |
gui.ListTbl.prototype.getSelectedRow = function() { | |
return this._selectedIdx | |
}; | |
gui.ListTbl.prototype.deselectPrevRow = function() { | |
delete this._selectedIdx; | |
if (this._curRowJq) { | |
$(this._curRowJq).removeClass(this._SELECTED_ROW_CLS) | |
} | |
}; | |
gui.ListTbl.prototype.selectRow = function(X) { | |
var Z = this; | |
Z.deselectPrevRow(); | |
var Y = $(":data(rowIdx=" + X + ")"); | |
Y.addClass(Z._SELECTED_ROW_CLS); | |
Z._curRowJq = Y; | |
Z._selectedIdx = X | |
}; | |
gui.ListTbl.prototype.getNumTicked = function() { | |
return $(this._tblDivId + " tbody input[name=" + this._tickName + "]:checked").length | |
}; | |
gui.ListTbl.prototype.getTickedRowsIdx = function() { | |
var X = this.opts.name != null ? this.opts.name : this._tickName; | |
var Y = []; | |
$(this._tblDivId + " tbody input[name=" + X + "]:checked").each(function(Z) { | |
if ($(this).attr("type") == "checkbox") { | |
Y.push($(this).parent().parent().parent().data("rowIdx")) | |
} else { | |
Y.push($(this).parent().parent().data("rowIdx")) | |
} | |
}); | |
return Y | |
}; | |
gui.ListTbl.prototype.tickRow = function(X, aa) { | |
if (aa == null) { | |
aa = true | |
} | |
var Z = this.opts.name != null ? this.opts.name : this._tickName; | |
$(this._tblDivId + " tbody input[name=" + Z + "]:eq(" + X + ")").attr("checked", !!aa); | |
var Y = $(this._tblDivId + " tbody input[name=" + this._tickName + "]").length; | |
var ab = $(this._tblDivId + " tbody input[name=" + this._tickName + "]:checked").length; | |
this._updateTickAll(ab >= Y) | |
}; | |
gui.ListTbl.prototype.tickAllRows = function(Z) { | |
if (Z == null) { | |
Z = true | |
} | |
var Y = this.opts.name != null ? this.opts.name : this._tickName; | |
$(this._tblDivId + " tbody input[name=" + Y + "]").attr("checked", !!Z); | |
var X = $(this._tblDivId + " tbody input[name=" + this._tickName + "]:enabled").length; | |
var aa = $(this._tblDivId + " tbody input[name=" + this._tickName + "]:enabled:checked").length; | |
this._updateTickAll(X > 0 && aa >= X); | |
g.call(this) | |
}; | |
gui.ListTbl.prototype.sort = function(X) { | |
$(this._tblDivId + "-Tbl").tablesorter(X) | |
}; | |
gui.ListTbl.prototype.paginate = function(Y) { | |
var X = this; | |
Y = $.extend({ | |
preShowPageCb: function() { | |
X.tickAllRows(false) | |
} | |
}, Y); | |
$(X._tblDivId + "-Tbl").tablesorterPager(Y) | |
}; | |
gui.ListTbl.prototype._updateTickAll = function(X) { | |
$(this._tblDivId + " thead input[name=" + this._tickName + "]:enabled").attr("checked", X) | |
}; | |
gui.ListTbl.prototype._updateAndDrawTick = function(X) { | |
$(this._tblDivId + " tbody input[name=" + this._tickName + "]:enabled").attr("checked", X); | |
var Y = $(this._tblDivId + " tbody input[name=" + this._tickName + "]").parent("label"); | |
if (X) { | |
$(this._tblDivId + " tbody input[name=" + this._tickName + "]:checked").parent().parent().addClass(this._CHECKED_ROW_CLS).find("td").addClass(this._CHECKED_ROW_CLS); | |
Y.addClass("checked") | |
} else { | |
$(this._tblDivId + " tbody tr").removeClass(this._CHECKED_ROW_CLS).find("td").removeClass(this._CHECKED_ROW_CLS); | |
Y.removeClass("checked") | |
} | |
}; | |
gui.ListTbl.prototype._enableSelectableDataRows = function(X) { | |
if (X == null) { | |
X = true | |
} | |
var Y = this; | |
if (!X) { | |
$(this._tblDivId + " tbody tr").unbind(); | |
return | |
} | |
$(this._tblDivId + " tbody tr").each(function(Z) { | |
$(this).hover(function(aa) { | |
if (!Y.opts.isSelectable.call(Y, this, Z)) { | |
return | |
} | |
$("td", this).addClass(Y._MOUSEOVER_ROW_CLS) | |
}, function(aa) { | |
$("td", this).removeClass(Y._MOUSEOVER_ROW_CLS) | |
}).click(function() { | |
if (!Y.opts.isSelectable.call(Y, this, Z)) { | |
return | |
} | |
Y.selectRow(Z); | |
Y.opts.onSelect.call(Y, this, Z) | |
}) | |
}) | |
}; | |
gui.ListTbl.prototype._enableTickAll = function() { | |
var X = this; | |
$(X._tblDivId + " thead input[name=" + X._tickName + "]").click(function() { | |
$(this).parent("label").toggleClass("checked"); | |
g.call(X) | |
}) | |
}; | |
gui.ListTbl.prototype._enableTick = function() { | |
var X = this; | |
$(X._tblDivId + " tbody input[name=" + X._tickName + "]").click(function() { | |
X.deselectPrevRow(); | |
var aa; | |
if ($(this).attr("type") == "checkbox") { | |
aa = $(this).parent().parent().parent() | |
} else { | |
aa = $(this).parent().parent() | |
} | |
var ac = $(this).parent("label"); | |
if ($(this).attr("checked")) { | |
aa.find("td").addClass(X._CHECKED_ROW_CLS); | |
ac.addClass("checked") | |
} else { | |
aa.find("td").removeClass(X._CHECKED_ROW_CLS); | |
ac.removeClass("checked") | |
} | |
var Z = $(X._tblDivId + " tbody input[name=" + X._tickName + "]:enabled").length; | |
var ab = $(X._tblDivId + " tbody input[name=" + X._tickName + "]:enabled:checked").length; | |
X._updateTickAll(ab >= Z); | |
var Y = aa.data("rowIdx"); | |
X.opts.onTick.call(X, this, Y) | |
}) | |
}; | |
function s(X) { | |
$(".gui-list-tbl-expand-collapse").click(function() { | |
$(this).toggleClass("gui-list-tbl-rowExpand").toggleClass("gui-list-tbl-rowCollapse"); | |
$.each($(this).nextAll(), function(Z, Y) { | |
if ($(Y).hasClass("gui-list-tbl-expand-collapse")) { | |
return false | |
} | |
$(Y).toggleClass("gui-hidden") | |
}); | |
if (X.opts.enableAltDataRows) { | |
$(X._tblDivId).mkAltDataRows() | |
} | |
}) | |
} | |
function m(Z) { | |
function ab(ad) { | |
var ac = $("#" + Z._CLS + "-show-more", $(Z._tblDivId)); | |
if (ad == 0) { | |
ac.removeClass("gui-show-more-visible").addClass("gui-show-more-hidden") | |
} else { | |
ac.removeClass("gui-show-more-hidden").addClass("gui-show-more-visible") | |
} | |
} | |
function aa(ac) { | |
var ad = $("." + Z._CLS + "-row-hidden", $(Z._tblDivId + "-Tbl")); | |
$(Z._tblDivId).append(gui.emitHtml("div", { | |
id: Z._CLS + "-show-more" | |
}, gui.emitHtml("a", { | |
href: "#" | |
}, te.loc("L@S#4347")))); | |
ab(ad.length); | |
$("#" + Z._CLS + "-show-more a", $(Z._tblDivId)).click(function(af) { | |
af.preventDefault(); | |
var ae = ad.length >= Y ? Y : ad.length; | |
ad.slice(0, ae).removeClass(Z._CLS + "-row-hidden"); | |
ad = $("." + Z._CLS + "-row-hidden", $(Z._tblDivId + "-Tbl")); | |
ab(ad.length) | |
}) | |
} | |
if (Z.opts.enableMobileView && !($.browser.msie && $.browser.version < 10)) { | |
var Y = 5; | |
var X = $(Z._tblDivId + "-Tbl tbody tr"); | |
$(Z._tblDivId + "-Tbl").addClass(Z._LIST_TBL_MOBILE_CLS); | |
$(Z._tblDivId + "-Tbl tbody tr:first").addClass("first_tr_cls"); | |
X.addClass(Z._CLS + "-row-hidden"); | |
X.slice(0, Y).removeClass(Z._CLS + "-row-hidden"); | |
aa() | |
} else { | |
$(Z._tblDivId + "-Tbl tbody td").removeAttr("data-title") | |
} | |
} | |
function o(ac, ae) { | |
function X(aq) { | |
var ap = ""; | |
if (aq.text != null) { | |
ap = aq.text; | |
if (aq.localize) { | |
ap = te.loc(ap) | |
} | |
ap = te.escUserInput(ap, aq.preserveSpace) | |
} else { | |
if (aq.html != null) { | |
ap = aq.html; | |
if (aq.localize) { | |
ap = te.loc(ap) | |
} | |
} | |
} | |
return ap | |
} | |
var ab = false; | |
if (ac == null) { | |
return null | |
} | |
if (ae == null) { | |
ae = {} | |
} | |
var ag = ae.widthClsList || []; | |
var al = ""; | |
var an = ae.isHeader ? "th" : "td"; | |
var af = ""; | |
for (var ak = 0; ak < ac.length; ++ak) { | |
var Z = ac[ak]; | |
var ad = ""; | |
var ai = ""; | |
var ah = (ae.dataTitleList && ae.dataTitleList[ak]) ? ae.dataTitleList[ak].text : ""; | |
if (Z.localize == null) { | |
Z.localize = true | |
} | |
if (an == "th") { | |
if (ak == 0) { | |
ai = "first_th_cls" | |
} else { | |
if (ak == (ac.length - 1)) { | |
ai = "last_th_cls" | |
} | |
} | |
} else { | |
if (ak == 0) { | |
ai = "first_td_cls" | |
} | |
} | |
if (Z.text != null && Z.preserveSpace == null) { | |
Z.preserveSpace = true | |
} | |
if (Z.type) { | |
var Y = Z.type; | |
var ao = Z.name || ae.name; | |
var aa = X(Z); | |
if (Y == "tick") { | |
ao = ae.tickName; | |
var aj; | |
if (Z.customImg) { | |
Z.customImg = gui._CUSTOM_CHECK_IMG_CLS + Z.customImg | |
} | |
if (aa) { | |
aj = { | |
cls: "gui-list-tbl-checkbox-span w750pc", | |
text: aa | |
} | |
} | |
var am; | |
if (Z.title != null) { | |
am = Z.title | |
} else { | |
am = ae.isHeader ? "L@S#1590" : "L@S#0894" | |
} | |
ad = gui.emitCheckboxHtml({ | |
tickOpts: { | |
name: ao, | |
cls: Z.inpcls, | |
checked: Z.checked, | |
disabled: Z.disabled, | |
title: te.loc(am), | |
value: Z.value | |
}, | |
spanOpts: aj, | |
labelOpts: { | |
cls: Z.customImg | |
} | |
}) | |
} else { | |
ad = gui.emitHtml("input", { | |
name: ao, | |
type: Y, | |
"class": Z.inpcls, | |
title: te.loc(Z.title), | |
value: Z.value, | |
size: Z.size, | |
maxlength: Z.maxlength, | |
checked: Z.checked, | |
disabled: Z.disabled, | |
readonly: Z.readonly | |
}); | |
if (aa) { | |
ad = gui.emitHtml("div", { | |
"class": "w200pc left cbLeft" | |
}, ad); | |
ad += gui.emitHtml("div", { | |
"class": "w750pc left" | |
}, aa) | |
} | |
} | |
} else { | |
if (Z.text != null || Z.html != null) { | |
ad = X(Z) | |
} else { | |
v("Unknown type " + Z.type) | |
} | |
} | |
if (Z.isExpandCollapse) { | |
ab = true; | |
ad = gui.emitHtml("div", { | |
"class": "gui-list-tbl-rowExpand" | |
}, gui.emitHtml("span", { | |
"class": "expandCollapseIcon" | |
}) + ad) | |
} | |
if (ae.isHeader && Z.sortable) { | |
ad = gui.emitHtml("div", { | |
"class": "gui-asc-desc-icon" | |
}, " ") + gui.emitHtml("span", null, ad) | |
} | |
af += gui.emitHtml(an, { | |
"class": te.concatStr(ag[ak], Z.cls, ai), | |
"data-title": ah, | |
title: te.loc(Z.tdTitle), | |
rowspan: Z.rowspan | |
}, ad) | |
} | |
if (ab) { | |
al = te.concatStr(al, "gui-list-tbl-expand-collapse") | |
} | |
af = gui.emitHtml("tr", { | |
"class": al | |
}, af); | |
return af | |
} | |
gui.MultiScrn = function(X) { | |
X = $.fillIn(X, { | |
baseWizScrn: 0, | |
getStepXY: function() { | |
return [this._curActiveIdx + 1 - this.opts.baseWizScrn, this.opts.scrnList.length - this.opts.baseWizScrn] | |
}, | |
onEnter: $.noop, | |
onExit: $.noop | |
}); | |
this.opts = X | |
}; | |
gui.MultiScrn.prototype._HDR_CLS = "gui-multiscrn-hdr"; | |
gui.MultiScrn.prototype.init = function(Z) { | |
if (Z == null) { | |
Z = 0 | |
} | |
for (var Y in this.opts.scrnList) { | |
var aa = gui.mkQId(this.opts.scrnList[Y]); | |
$(aa).hide(); | |
if ($(aa).hasClass("gui-wiz")) { | |
var X = $(aa).find("h2:visible:eq(0)"); | |
if ($("." + this._HDR_CLS, X).length == 0) { | |
X.prepend(gui.emitHtml("span", { | |
"class": this._HDR_CLS | |
}, "")); | |
if (!gui.isContentOnly() && this.opts.showStepXY) { | |
X.addClass("gui-wiz-double-line-header") | |
} | |
} | |
} | |
} | |
this.show(Z) | |
}; | |
gui.MultiScrn.prototype.show = function(ab) { | |
var Y = this._curActiveIdx; | |
if (Y != null) { | |
if (this.opts.onExit.call(this, Y) === false) { | |
return | |
} | |
$(gui.mkQId(this.opts.scrnList[Y])).hide() | |
} | |
var X; | |
if (typeof(ab) == "string") { | |
X = this._findIdx(ab) | |
} else { | |
X = ab | |
} | |
var ac = gui.mkQId(this.opts.scrnList[X]); | |
if (Y != null) { | |
$(ac).attr("tabindex", "-1").css("outline", 0); | |
$(ac).show(); | |
$(ac).focus() | |
} else { | |
$(ac).show() | |
} | |
this._curActiveIdx = X; | |
if (this.opts.showStepXY) { | |
var aa = this.opts.getStepXY.call(this); | |
var Z; | |
if (aa[1] != null) { | |
Z = te.loc("L@S#2283", aa[0], aa[1]) | |
} else { | |
Z = te.loc("L@S#2282", aa[0]) | |
} | |
Z += ": "; | |
$(ac).find("h2:eq(0)").children("span." + this._HDR_CLS).html(Z); | |
ews.setTitlePane(this.opts.appWizTitle) | |
} | |
setTimeout(function() { | |
$(window).scroll() | |
}, 100); | |
this.opts.onEnter.call(this, X, Y) | |
}; | |
gui.MultiScrn.prototype.getNumScrns = function() { | |
return this.opts.scrnList.length | |
}; | |
gui.MultiScrn.prototype.getCurScrnIdx = function() { | |
return this._curActiveIdx | |
}; | |
gui.MultiScrn.prototype.getCurScrn = function() { | |
return this.opts.scrnList[this._curActiveIdx] | |
}; | |
gui.MultiScrn.prototype._findIdx = function(Y) { | |
for (var X = 0; X < this.opts.scrnList.length; ++X) { | |
if (this.opts.scrnList[X] == Y) { | |
return X | |
} | |
} | |
return -1 | |
}; | |
(function() { | |
var X = function(Y) { | |
this._opts = $.extend({ | |
hdr: "L@S#3224", | |
notes: [] | |
}, Y); | |
this._numVisibleNotes = this._opts.notes.length; | |
this._hdrId = $.hlp.getTmpDivId(); | |
this._olId = $.hlp.getTmpDivId(); | |
this._noteIdPrefix = $.hlp.getTmpDivId() | |
}; | |
X.prototype.create = function(Y) { | |
var ab = this; | |
if (ab._opts.notes.length > 0) { | |
var Z = ""; | |
var aa = ""; | |
$.each(ab._opts.notes, function(ac, ae) { | |
var ad = {}; | |
if (ae.id) { | |
ad.id = ab._noteIdPrefix + ae.id | |
} | |
if (ae.visible == false) { | |
ad["class"] = "gui-hidden"; | |
ab._numVisibleNotes-- | |
} | |
Z += gui.emitHtml("li", ad, te.loc(ae.content)) | |
}); | |
aa = gui.emitHtml("div", { | |
id: ab._hdrId, | |
"class": (!ab._numVisibleNotes ? "gui-hidden" : "") | |
}, te.loc(ab._opts.hdr) + ":"); | |
aa += gui.emitHtml("ol", { | |
id: ab._olId, | |
"class": ((ab._numVisibleNotes == 1) ? "gui-no-list-style" : "gui-left-margin-130") | |
}, Z); | |
$(Q(Y)).append(aa) | |
} | |
}; | |
X.prototype.hide = function(Z) { | |
var Y = this; | |
if (Z.length > 0) { | |
$.each(Z, function(aa, ab) { | |
if ($(Q(Y._noteIdPrefix + ab)).is(":visible")) { | |
$(Q(Y._noteIdPrefix + ab)).hide(); | |
Y._numVisibleNotes-- | |
} | |
}); | |
if (Y._numVisibleNotes <= 1) { | |
$(Q(Y._olId)).addClass("gui-no-list-style"); | |
$(Q(Y._olId)).removeClass("gui-left-margin-130"); | |
if (Y._numVisibleNotes == 0) { | |
$(Q(Y._hdrId)).hide() | |
} | |
} | |
} | |
}; | |
X.prototype.show = function(Z) { | |
var Y = this; | |
if (Z.length > 0) { | |
$.each(Z, function(aa, ab) { | |
if (!$(Q(Y._noteIdPrefix + ab)).is(":visible")) { | |
$(Q(Y._noteIdPrefix + ab)).show(); | |
Y._numVisibleNotes++ | |
} | |
}); | |
if (Y._numVisibleNotes >= 1) { | |
$(Q(Y._hdrId)).show(); | |
if (Y._numVisibleNotes > 1) { | |
$(Q(Y._olId)).addClass("gui-left-margin-130"); | |
$(Q(Y._olId)).removeClass("gui-no-list-style") | |
} | |
} | |
} | |
}; | |
X.prototype.modify = function(Z) { | |
var Y = this; | |
$.each(Z, function(ab, aa) { | |
$(Q(Y._noteIdPrefix + ab)).html(te.loc(aa)) | |
}) | |
}; | |
gui.NoteList = X; | |
gui.createNoteList = function(Y, ab) { | |
var Z = $.hlp.getTmpDivId(); | |
$(Q(Y)).append(gui.emitHtml("div", { | |
id: Z | |
})); | |
var aa = new gui.NoteList(ab); | |
aa.create(Z); | |
return aa | |
} | |
})(); | |
gui.resultScrnApplyCancelBtns = null; | |
$.locStr.add({ | |
id: "EWS_STRING_DVAR_PWD_PROTECTED_PAGE_MSG", | |
baseId: "L@S#5711", | |
arg: "L@S#5222" | |
}); | |
function l(Y, Z) { | |
var X = pageMgr.getPageByDivId(Y.pgmDivId); | |
if (X != null && Y.pgmName != null && X.pgmName != Y.pgmName) { | |
r(Z + ": page " + Y.pgmName + " has lost focus"); | |
return true | |
} | |
return false | |
} | |
function f(ak, ah, at) { | |
if (l(ak, "resultScrn")) { | |
return | |
} | |
var ac = "gui-result-scrn"; | |
var ax = ac + "-wrap"; | |
var ao = "." + ax; | |
var af = "." + ac; | |
var aF = "wrapper"; | |
var ai = "." + aF; | |
var ae = ac + "-btn-ph"; | |
var Y = false; | |
var aa = "res-tbl"; | |
if (ah == null) { | |
ah = [] | |
} | |
if (!$.isArray(ah)) { | |
ah = [ah]; | |
ah.hasErr = ah[0].pgmErr | |
} | |
ak.pgmReloadAfterPut = false; | |
var ay; | |
var aB; | |
if (ah.hasErr) { | |
ay = at.errMsg; | |
var aj = true; | |
for (var aC = 0; aC < ah.length; ++aC) { | |
var aD = ah[aC]; | |
if (!aD.pgmErr) { | |
continue | |
} | |
aB = aD.pgmStatus; | |
if (at.errMsgs[aD.pgmStatus] != null) { | |
ay = at.errMsgs[aD.pgmStatus]; | |
aj = false | |
} | |
break | |
} | |
ay = te.loc(ay); | |
if (aj && aB && at.showErrCode !== false) { | |
ay += " (" + ak.pgmName + "-" + aB + ")" | |
} | |
} else { | |
ay = te.loc(at.msg) | |
} | |
var Z; | |
if (at.showSuccessOnTimeout && aB == "timeout") { | |
Z = false | |
} else { | |
Z = ah.hasErr | |
} | |
var aw = $("#" + ak.pgmDivId); | |
var ar = $(af, aw); | |
if (ar.length == 0) { | |
ad() | |
} else { | |
aG() | |
} | |
X(); | |
var az = ""; | |
var aA = at.prependMsg || false; | |
var ag = ""; | |
var ap = ""; | |
var aE = ""; | |
var an = at.prependImg ? "" : "left"; | |
if (Y) { | |
az += ab(ah) | |
} | |
if (aA) { | |
ag = "statusMsg" | |
} | |
ap = te.concatStr(an, "statusLeft"); | |
aE = te.concatStr(an, "statusRight"); | |
var aI = ""; | |
if (at.showStatusImg) { | |
var aI = gui.emitHtml("img", { | |
src: e(Z ? at.errImg : at.okImg) | |
}); | |
aI = gui.emitHtml("div", { | |
"class": ap | |
}, aI) | |
} | |
var am = ay; | |
if (ah.hasErr && at.showErrContMsg) { | |
am += gui.emitHtml("p", null, te.loc("L@S#2013")) | |
} | |
am = gui.emitHtml("div", { | |
"class": aE | |
}, am); | |
if (aA) { | |
az = gui.emitHtml("div", { | |
"class": "prepend" | |
}, at.prependMsg || "") | |
} | |
az += gui.emitHtml("div", { | |
"class": ag | |
}, aI + am); | |
az += gui.emitClearFloat(); | |
var aH = $(ai, aw); | |
ar = $(af, aw); | |
$(".contents", ar).html(az); | |
if (at.prependImg) { | |
var aJ = $("." + ac + " h2:eq(0)"); | |
$(".statusLeft").after(gui.emitHtml("h2", { | |
"class": "statusHdr" | |
}, aJ.text())); | |
aJ.remove() | |
} | |
if (Y) { | |
$("." + aa, ar).mkListTbl() | |
} | |
ar = $(ao, aw); | |
if (gui.resultScrnApplyCancelBtns) { | |
gui.resultScrnApplyCancelBtns.opts.onClick = au | |
} | |
if (at.authErr) { | |
aH.remove() | |
} else { | |
aH.hide() | |
} | |
ar.attr("tabindex", "-1").css("outline", 0); | |
ar.show(); | |
ar.focus(); | |
at.onShow(); | |
if (at.useDefaultHeader) { | |
ews.setTitlePane() | |
} | |
function au(aL, aK) { | |
if (at.complete(aK) === true) { | |
return | |
} | |
al() | |
} | |
function al() { | |
if (ah.hasErr && !at.errReloadPage) { | |
if (!at.authErr) { | |
aq() | |
} | |
return | |
} | |
ak.reload({ | |
success: function() { | |
aq() | |
} | |
}) | |
} | |
function aq() { | |
$("#app-title-page-subheader").show(); | |
ar.hide(); | |
aH.show(); | |
if (at.useDefaultHeader) { | |
ews.setTitlePane() | |
} | |
setTimeout(function() { | |
$(window).scroll() | |
}, 100) | |
} | |
function ab(aL) { | |
if (aL.length == 0) { | |
return "" | |
} | |
var aM = ""; | |
var aN = ""; | |
aN += gui.emitHtml("th", null, "Op"); | |
aN += gui.emitHtml("th", null, "File"); | |
aN += gui.emitHtml("th", null, "Arg"); | |
aN += gui.emitHtml("th", null, "Put?"); | |
aN += gui.emitHtml("th", null, "Err?"); | |
aM += gui.emitHtml("tr", null, aN); | |
for (var aK = 0; aK < aL.length; ++aK) { | |
var aO = aL[aK]; | |
aN = ""; | |
aN += gui.emitHtml("td", null, aO.op); | |
aN += gui.emitHtml("td", null, aO.file); | |
aN += gui.emitHtml("td", null, aO.arg || ""); | |
aN += gui.emitHtml("td", null, aO.pgmLoaded); | |
aN += gui.emitHtml("td", null, aO.pgmErr ? aO.pgmStatus : false); | |
aM += gui.emitHtml("tr", null, aN) | |
} | |
return gui.emitHtml("table", { | |
"class": aa | |
}, aM) | |
} | |
function av() { | |
return te.loc(at.header) || "" | |
} | |
function ad() { | |
var aN = ""; | |
aN = gui.emitHtml("h2", {}); | |
aN += gui.emitHtml("div", { | |
"class": "contents" | |
}, ""); | |
aN = gui.emitHtml("div", { | |
"class": ac | |
}, aN); | |
var aM = gui.emitHtml("div", { | |
"class": "min-ht" | |
}, aN); | |
aM += gui.emitHtml("div", { | |
id: ae | |
}, ""); | |
aM = gui.emitHtml("div", { | |
"class": ax | |
}, aM); | |
if (aw.children().length == 0) { | |
aw.append("<div class='" + aF + "'></div>") | |
} | |
var aK = $(ai, aw); | |
if (aK.length == 0) { | |
aK = $("h1:eq(0)", aw); | |
if (aK.length > 0) { | |
aK = aK.nextAll() | |
} else { | |
aK = aw.children() | |
} | |
var aL = $.hlp.saveRadioValues(aK); | |
aK.wrapAll("<div class='" + aF + "'></div>"); | |
$.hlp.restoreRadioValues(aL); | |
aK = aK.parent() | |
} | |
aK.after(aM); | |
aG() | |
} | |
function X() { | |
if (at.btnList == null || at.btnList.length == 0) { | |
$(gui.mkQId(ae)).html(""); | |
gui.resultScrnApplyCancelBtns = null; | |
return | |
} | |
gui.resultScrnApplyCancelBtns = new gui.PageCmdBtns({ | |
list: at.btnList, | |
onClick: au | |
}); | |
gui.resultScrnApplyCancelBtns.create(ae) | |
} | |
function aG() { | |
var aL = av(); | |
var aK = $("." + ac + " h2:eq(0)"); | |
if (at.useDefaultHeader) { | |
aK.addClass("gui-result-scrn-hdr-use-default") | |
} | |
if (aL == "") { | |
aK.hide() | |
} else { | |
if (aL != $("#app-title-page-subheader").text()) { | |
if (!at.useDefaultHeader) { | |
$("#app-title-page-subheader").hide(); | |
aK.addClass("app-title-result-scrn-header") | |
} | |
aK.html(aL) | |
} else { | |
aK.hide() | |
} | |
} | |
} | |
} | |
gui.showResultScrn = function(aa, Y, Z) { | |
Z = $.extend({ | |
msg: "L@S#0185", | |
errMsg: "L@S#2288", | |
errMsgs: {}, | |
showErrContMsg: true, | |
waitForReconnProgressMsg: null, | |
showStatusImg: true, | |
okImg: "ok_result", | |
errImg: "err_result", | |
waitForReconnection: false, | |
btnList: [{ | |
text: "L@S#0005", | |
cmd: "ok_btn" | |
}], | |
complete: $.noop, | |
onShow: $.noop | |
}, Z); | |
var X = H("connErrResult"); | |
Z.errMsgs = $.extend({ | |
0: X, | |
400: "L@S#0369", | |
408: X, | |
abort: X, | |
connectTimeout: X, | |
requestTimeout: "Request Timeout error", | |
timeout: X, | |
wizConnErrTimeout: H("wizErrResult") | |
}, Z.errMsgs); | |
if (Z.waitForReconnection) { | |
if (Y == null) { | |
Y = [{ | |
pgmStatus: 200 | |
}] | |
} else { | |
Y[0].pgmStatus = 200 | |
} | |
Y.hasErr = false; | |
if (Z.waitForReconnProgressMsg) { | |
Z.reconnectOpts = { | |
msg: Z.waitForReconnProgressMsg, | |
notes: Z.waitForReconnProgressNotes | |
} | |
} | |
gui.showWaitForReconnectionScrn($.extend({ | |
pageFrag: aa, | |
complete: function(ab) { | |
if (ab == "rebooting" || ab == "alive") { | |
Y.hasErr = true; | |
Y[0].pgmErr = true; | |
if (ab == "alive") { | |
Y[0].pgmStatus = "requestTimeout" | |
} else { | |
Y[0].pgmStatus = "connectTimeout" | |
} | |
} | |
if (ab == "rebooted" && Z.onRebootComplete) { | |
Z.onRebootComplete() | |
} else { | |
f(aa, Y, Z) | |
} | |
} | |
}, Z.reconnectOpts)); | |
return | |
} | |
f(aa, Y, Z) | |
}; | |
gui.showDisabledScrn = function(Z, Y) { | |
Z = $.extend({ | |
pgmDivId: J | |
}, Z); | |
Y = $.extend({ | |
errMsg: "L@S#2299", | |
btnList: [], | |
showErrContMsg: false, | |
errReloadPage: true | |
}, Y); | |
var X = []; | |
X.hasErr = true; | |
gui.showResultScrn(Z, X, Y) | |
}; | |
gui.showAuthFailedScrn = function(Z, Y) { | |
Z = $.extend({ | |
pgmDivId: J | |
}, Z); | |
Y = $.extend({ | |
authErr: true, | |
errMsg: "EWS_STRING_DVAR_PWD_PROTECTED_PAGE_MSG", | |
errImg: "pw_protected_result", | |
header: "L@S#5710", | |
prependImg: true, | |
btnList: [{ | |
text: "L@S#5222", | |
cmd: "login" | |
}], | |
complete: function(aa) { | |
$.ajax({ | |
url: "/AuthChk", | |
success: function(ac, ab, ad) { | |
window.location.reload() | |
} | |
}) | |
}, | |
showErrContMsg: false, | |
useDefaultHeader: true | |
}, Y); | |
var X = []; | |
X.hasErr = true; | |
gui.showResultScrn(Z, X, Y) | |
}; | |
gui.showLoadPageFailedScrn = function(X) { | |
X = $.extend({ | |
page: { | |
pgmDivId: J | |
} | |
}, X); | |
var ab = X.page; | |
var af = X.list || []; | |
var ad; | |
$.each(af, function(ag, ah) { | |
if (ah.pgmStatus == "parsererror") { | |
ad = true; | |
return false | |
} | |
}); | |
var Z = "L@S#2300"; | |
var ac = ""; | |
var ae = pageMgr.getPageByDivId(ab.pgmDivId) || ab; | |
if (ad) { | |
ac = te.loc("L@S#2288", ab.pgmName) | |
} else { | |
if (X.jsErr) { | |
ac = te.loc("L@S#2302", ab.pgmName) | |
} else { | |
if (X.authErr) { | |
if (te.isAdminRevamp()) { | |
$("body").trigger("authChecked", { | |
hasPwd: ab.hasPwd, | |
isAuthenticated: false | |
}); | |
gui.showAuthFailedScrn(ae); | |
return | |
} else { | |
Z = ""; | |
ac = te.loc("L@S#0277") | |
} | |
} else { | |
if (X.showFriendlyError) { | |
ac = te.loc("L@S#2061") | |
} else { | |
for (var Y = 0; Y < af.length; ++Y) { | |
var aa = af[Y]; | |
if (aa.pgmErr) { | |
ac += gui.emitHtml("li", null, aa.file + " (" + aa.pgmStatus + ")") | |
} | |
} | |
ac = gui.emitHtml("ul", { | |
"class": "gui-std-list-no-space" | |
}, ac); | |
ac = gui.emitHtml("p", null, te.loc("L@S#2301")) + ac | |
} | |
} | |
} | |
} | |
gui.showDisabledScrn(ae, { | |
header: Z, | |
errMsg: ac | |
}) | |
}; | |
gui.formatInfoNotes = function(X) { | |
X = $.extend({ | |
addClass: "gui-format-infoNotes" | |
}, X); | |
return U(X) | |
}; | |
gui.formatResultScrn = function(X) { | |
X = $.extend({ | |
title: "", | |
addClass: "statusMsg mv25px", | |
useWizErrResultScrn: false | |
}, X); | |
if (X.useWizErrResultScrn) { | |
X.msg = H("wizErrResult"); | |
X.img = "err_result" | |
} | |
return gui.emitHtml("div", { | |
"class": "gui-format-resultScrn" | |
}, U(X)) | |
}; | |
var H = function(Z) { | |
var Y, X, aa; | |
if (Z == "wizErrResult") { | |
Y = te.loc("L@S#3425") | |
} else { | |
Y = te.loc("L@S#3402") | |
} | |
X = gui.emitHtml("p", null, te.loc("L@S#3403")); | |
X += "- " + te.loc("L@S#3404") + "<br>"; | |
X += "- " + te.loc("L@S#3405") + " " + te.loc("L@S#3406"); | |
aa = te.loc("L@S#3410", te.loc("L@S#3411"), te.loc("L@S#3407") + " " + te.loc("L@S#3408") + " " + te.loc("L@S#3409")); | |
aa = gui.emitHtml("p", null, aa); | |
return (Y + X + aa) | |
}; | |
var U = function(ab) { | |
ab = $.extend({ | |
cls: "", | |
msg: "", | |
img: "", | |
title: "" | |
}, ab); | |
var Z = (ab.addClass || "") + " clear-fix"; | |
var Y = te.concatStr("left statusLeft", ab.cls); | |
var X = te.concatStr("left statusRight", ab.cls); | |
var ac = ""; | |
if (ab.img) { | |
ac = gui.emitHtml("div", { | |
"class": Y | |
}, gui.emitHtml("img", { | |
src: e(ab.img), | |
title: te.loc(ab.title) | |
})) | |
} | |
var aa = gui.emitHtml("div", { | |
"class": X | |
}, te.loc(ab.msg)); | |
return gui.emitHtml("div", { | |
"class": Z | |
}, ac + aa) | |
}; | |
gui.showProgressScrn = function(Z, Y) { | |
var X = false; | |
if (Y.version == "FY11") { | |
gui.showProgressScrnFY11(Z, Y); | |
return | |
} | |
Y = $.extend({ | |
enableBars: false, | |
minTimeout: 3000, | |
numBars: 12, | |
numHlBars: 11, | |
msg: "L@S#2286", | |
notes: "L@S#3344", | |
divId: gui.YNDialogBox.divId, | |
complete: $.noop | |
}, Y); | |
gui.YNDialogBox.show({ | |
divId: "progressDialogBox", | |
hasBtns: false, | |
hasTitleBar: false | |
}); | |
Y._usrComplete = Y.complete; | |
Y._isDone = Y.isDone; | |
Y.complete = function() { | |
gui.YNDialogBox.close(); | |
Y._usrComplete() | |
}; | |
Y.isDone = function() { | |
if (l(Z, "progressScrn") || Y._isDone()) { | |
return X | |
} | |
return false | |
}; | |
gui.showProgressBar(Y); | |
setTimeout(function() { | |
X = true | |
}, Y.minTimeout) | |
}; | |
gui.showProgressScrnFY11 = function(ae, Y) { | |
var ak = "gui-progress-scrn"; | |
var an = "." + ak; | |
var ah = "wrapper"; | |
var ad = "." + ah; | |
var Z = ak + "-btn-ph"; | |
Y = $.extend({ | |
enableBars: true, | |
numBars: 11, | |
numHlBars: 3, | |
msg: "L@S#2286", | |
complete: $.noop | |
}, Y); | |
var ag; | |
var af = $("#" + ae.pgmDivId); | |
var aj = $(an, af); | |
if (aj.length == 0) { | |
ac() | |
} else { | |
ai() | |
} | |
if (Y.onCancel) { | |
ag = new gui.PageCmdBtns({ | |
list: [{ | |
text: "L@S#0438", | |
cmd: "cancel_btn" | |
}], | |
onClick: aa | |
}); | |
ag.create(Z) | |
} | |
var am = $(ad, af); | |
aj = $(an, af); | |
var al = S(Y); | |
$(".contents", aj).html(al); | |
am.hide(); | |
aj.show(); | |
Y._usrComplete = Y.complete; | |
Y.complete = function() { | |
ab(); | |
Y._usrComplete() | |
}; | |
k(aj, Y); | |
function ab() { | |
aj.hide(); | |
am.show() | |
} | |
function aa(ap, ao) { | |
Y._stopFlag = true; | |
Y.onCancel() | |
} | |
function X(ao) { | |
var aq = Y.header; | |
if (aq != null) { | |
aq = te.loc(aq) | |
} else { | |
var ap = $("h2:eq(0)", ao); | |
if (ap.length > 0) { | |
aq = ap.text() | |
} else { | |
aq = "" | |
} | |
} | |
return aq | |
} | |
function ac() { | |
var ar = ""; | |
var at = X(af); | |
if (at != "") { | |
ar = gui.emitHtml("h2", null, at) | |
} | |
ar += gui.emitHtml("div", { | |
"class": "contents" | |
}, ""); | |
ar += gui.emitHtml("div", { | |
id: Z | |
}, ""); | |
var aq = gui.emitHtml("div", { | |
"class": ak | |
}, ar); | |
if (af.children().length == 0) { | |
af.append("<div class='" + ah + "'></div>") | |
} | |
var ao = $(ad, af); | |
if (ao.length == 0) { | |
ao = $("h1:eq(0)", af); | |
if (ao.length > 0) { | |
ao = ao.nextAll() | |
} else { | |
ao = af.children() | |
} | |
var ap = $.hlp.saveRadioValues(ao); | |
ao.wrapAll("<div class='" + ah + "'></div>"); | |
$.hlp.restoreRadioValues(ap); | |
ao = ao.parent() | |
} | |
ao.after(aq) | |
} | |
function ai() { | |
$("." + ak + " h2:eq(0)").html(X(af)) | |
} | |
}; | |
gui.showProgressScreenCancelBtn = function(Y) { | |
var X = "gui-progress-scrn"; | |
var Z = X + "-btn-ph"; | |
if (Y) { | |
$("#" + Z).show() | |
} else { | |
$("#" + Z).hide() | |
} | |
}; | |
gui.progressScrnComplete = function(Y, X) {}; | |
gui.showWaitForReconnectionScrn = function(Y) { | |
var af = false; | |
var ac; | |
var aa = false; | |
var ae = 0; | |
var ab = 0; | |
var Z = 2000; | |
var ag = "alive"; | |
function ad() { | |
if (af) { | |
return | |
} | |
Y.pageFrag.get({ | |
file: Y.url, | |
dataType: Y.dataType, | |
timeout: Y.pollTimeoutMs | |
}, X) | |
} | |
function X(ah) { | |
if (ag == "rebooting") { | |
if (ah.hasErr && ah[0].pgmStatus == "timeout") { | |
ab = 0; | |
ae = 0 | |
} else { | |
if (ab) { | |
ae += $.now() - ab | |
} else { | |
ab = $.now() | |
} | |
if (ae > Z) { | |
ag = "rebooted"; | |
return | |
} | |
} | |
} | |
if (ag == "alive" && ah.hasErr) { | |
ag = "rebooting"; | |
ac = $.now() + Y.maxCheckTimeOffToOnMs | |
} | |
if (($.now() < ac) || (ab > 0)) { | |
setTimeout(ad, (ag == "alive" ? Y.pollIntervalOnToOffMs : Y.pollIntervalOffToOnMs)) | |
} else { | |
aa = $.now() >= ac | |
} | |
} | |
Y = $.extend({ | |
complete: $.noop, | |
minTimeBeforeCheckMs: 3000, | |
maxCheckTimeOnToOffMs: 60000, | |
pollIntervalOnToOffMs: 1000, | |
maxCheckTimeOffToOnMs: 300000, | |
pollIntervalOffToOnMs: 3000, | |
pollTimeoutMs: 1000, | |
url: "/DevMgmt/DiscoveryTree.xml" | |
}, Y); | |
ac = $.now() + Y.maxCheckTimeOnToOffMs; | |
if (Y.msg) { | |
Y.progressOpts = { | |
msg: Y.msg, | |
notes: Y.notes | |
} | |
} | |
gui.showProgressScrn(Y.pageFrag, $.extend({ | |
isDone: function() { | |
return (aa || ag == "rebooted") | |
}, | |
complete: function() { | |
af = true; | |
Y.complete(ag) | |
} | |
}, Y.progressOpts)); | |
setTimeout(ad, Y.minTimeBeforeCheckMs) | |
}; | |
gui.showProgressBar = function(Z) { | |
Z = $.extend({ | |
enableBars: false, | |
numBars: 7, | |
numHlBars: 3, | |
msg: "", | |
complete: $.noop | |
}, Z); | |
if (Z.version == "FY11") { | |
Z.enableBars = true | |
} | |
var X = $("#" + Z.divId); | |
var Y = S(Z); | |
X.html(Y); | |
X.addClass("gui-progress-scrn"); | |
if (Z.isFull) { | |
$(".gui-progress-bar div", X).addClass("hl"); | |
return | |
} | |
Z._usrComplete = Z.complete; | |
Z.complete = function() { | |
X.removeClass("gui-progress-scrn"); | |
Z._usrComplete() | |
}; | |
k(X, Z) | |
}; | |
function S(aa) { | |
var Z = gui.emitHtml("div", { | |
id: "gui-progress-msg" | |
}, te.loc(aa.msg)); | |
var ab = ""; | |
var Y = ""; | |
var ac = ""; | |
if (aa.version == "FY11") { | |
Z += gui.emitHtml("p", null, "") | |
} | |
if (aa.getPercentDone) { | |
ab += gui.emitHtml("div", { | |
"class": "meter" | |
}, gui.emitHtml("div", { | |
"class": "filled" | |
}, "")); | |
Y = gui.emitHtml("div", { | |
"class": "percent", | |
id: "gui-progress-notes" | |
}, ""); | |
Z += gui.emitHtml("div", { | |
"class": "gui-progress-bar", | |
id: "gui-progress-bar-percent" | |
}, ab) | |
} else { | |
Y = gui.emitHtml("div", { | |
id: "gui-progress-notes" | |
}, te.loc(aa.notes)); | |
if (aa.enableBars) { | |
for (var X = 0; X < aa.numBars; ++X) { | |
ab += gui.emitHtml("div", { | |
"class": "bar" | |
}, "") | |
} | |
} | |
ac = "gui-progress-infinite"; | |
Z += gui.emitHtml("div", { | |
"class": "gui-progress-bar clear-fix", | |
id: "gui-progress-bar-infinite" | |
}, ab) | |
} | |
return gui.emitHtml("div", { | |
id: "gui-progress-scrn", | |
"class": ac | |
}, Z + Y) | |
} | |
function k(ab, Y) { | |
var aa = -1; | |
var X; | |
Y._stopFlag = false; | |
Z(); | |
function Z() { | |
if (Y.isDone() || Y._stopFlag) { | |
if (X != null) { | |
clearTimeout(X) | |
} | |
Y.complete(); | |
return | |
} | |
if (Y.getPercentDone) { | |
var ad = Math.round(Y.getPercentDone()); | |
if (ad > 100) { | |
ad = 100 | |
} | |
$(".gui-progress-bar .filled", ab).css("width", ad + "%"); | |
$("#gui-progress-notes", ab).html(te.loc("L@S#2285", ad)) | |
} | |
if (Y.enableBars) { | |
var ac = $(".gui-progress-bar div", ab); | |
if (ac.length == 0) { | |
r("pollProgressBar: not stopped properly"); | |
return | |
} | |
ac.eq(aa - Y.numHlBars + 1).removeClass("hl"); | |
++aa; | |
if (aa >= Y.numBars + Y.numHlBars) { | |
aa = 0 | |
} | |
ac.eq(aa).addClass("hl") | |
} | |
X = setTimeout(Z, R) | |
} | |
} | |
gui.showWaitForConnectionToFail = function(ab) { | |
var Y; | |
var Z = false; | |
var aa = [{ | |
pgmErr: true, | |
pgmStatus: "wizConnErrTimeout" | |
}]; | |
function ac() { | |
if (Z) { | |
return | |
} | |
ab.pageFrag.get({ | |
file: ab.url, | |
dataType: ab.dataType, | |
timeout: ab.pollTimeoutMs | |
}, X) | |
} | |
function X(ad) { | |
if (ad.hasErr) { | |
Z = true; | |
return | |
} | |
setTimeout(ac, ab.pollIntervalMs) | |
} | |
ab = $.extend({ | |
complete: $.noop, | |
minTimeToShowMs: 5000, | |
maxTimeOutMs: 90000, | |
pollIntervalMs: 3000, | |
pollTimeoutMs: 1000, | |
url: "/DevMgmt/DiscoveryTree.xml" | |
}, ab); | |
aa.hasErr = true; | |
Y = $.now() + ab.maxTimeOutMs; | |
if (ab.msg) { | |
ab.progressOpts = { | |
msg: ab.msg, | |
notes: ab.notes | |
} | |
} | |
gui.showProgressScrn(ab.pageFrag, $.extend({ | |
isDone: function() { | |
if (Z) { | |
return true | |
} else { | |
if ($.now() < Y) { | |
return false | |
} else { | |
Z = true; | |
return true | |
} | |
} | |
}, | |
complete: function() { | |
ab.complete(aa) | |
} | |
}, ab.progressOpts)); | |
setTimeout(ac, ab.minTimeToShowMs) | |
}; | |
(function() { | |
gui.findStyleSheet = function(Y) { | |
for (var X = 0; X < document.styleSheets.length; ++X) { | |
if (document.styleSheets[X].title == Y) { | |
return document.styleSheets[X] | |
} | |
} | |
return null | |
}; | |
gui.addToStyleSheet = function(X, Z, Y) { | |
if (X.addRule) { | |
X.addRule(Z, Y) | |
} else { | |
X.insertRule(Z + " {" + Y + "}", X.cssRules.length) | |
} | |
}; | |
gui.newGblStyle = function(Z, Y) { | |
var X = document.createElement("style"); | |
X.type = "text/css"; | |
X.title = Z; | |
$("head").append(X); | |
if (Y != null) { | |
gui.addGblStyle(X, Y) | |
} | |
return X | |
}; | |
gui.addGblStyle = function(X, Y) { | |
if (X.styleSheet) { | |
X.styleSheet.cssText = Y | |
} else { | |
X.appendChild(document.createTextNode(Y)) | |
} | |
} | |
})(); | |
(function() { | |
gui.APP_SMALL_MATCH_MEDIA = "app-small-media"; | |
gui.APP_MEDIUM_MATCH_MEDIA = "app-med-media"; | |
gui.APP_LARGE_MATCH_MEDIA = "app-large-media"; | |
gui.isConsumerTheme = function() { | |
return true | |
}; | |
gui.isTheatreLNF = function() { | |
return frameWorkObj.theme == "theme-gray" | |
}; | |
gui.hasMobileViewCookie = function() { | |
var Z = te.cookie.getVal("mobileView"); | |
if (Z == "") { | |
return null | |
} else { | |
return Z == "1" | |
} | |
}; | |
gui.isMobileView = function() { | |
return $("body").hasClass("mobile-view") | |
}; | |
gui.setMobileView = function() { | |
te.cookie.set("mobileView", 1) | |
}; | |
gui.clearMobileView = function() { | |
te.cookie.del("mobileView") | |
}; | |
var X = false; | |
var Y = false; | |
gui.isMobileBrowser = function(Z) { | |
if (Z !== undefined) { | |
X = !!Z | |
} | |
return X | |
}; | |
gui.setTabletDevice = function(Z) { | |
Y = !!Z | |
}; | |
gui.isTabletDevice = function() { | |
return Y | |
}; | |
gui.isWebAppOnly = function() { | |
return $("body").hasClass("webapp-only") | |
}; | |
gui.isContentOnly = function() { | |
return $("body").hasClass("content-only") | |
}; | |
gui.getWindowMatchMedia = function() { | |
if (gui.isContentOnly() || ($.browser.msie && $.browser.version < 10)) { | |
return | |
} | |
var aa; | |
var Z = window.matchMedia("screen and (min-width: 530px) and (min-device-height: 650px), screen and (min-width: 650px) and (min-device-height: 430px) and (orientation: landscape)").matches; | |
var ab = window.matchMedia("(min-width: 1000px) and (orientation: landscape)").matches; | |
if (ab) { | |
aa = gui.APP_LARGE_MATCH_MEDIA | |
} else { | |
if (Z) { | |
aa = gui.APP_MEDIUM_MATCH_MEDIA | |
} else { | |
aa = gui.APP_SMALL_MATCH_MEDIA | |
} | |
} | |
return aa | |
} | |
})(); | |
gui.YNDialogBox = {}; | |
gui.YNDialogBox.divId = "YNDialogBox"; | |
gui.YNDialogBox.show = function(aj, af) { | |
aj = $.extend({ | |
customActionBtnText: "L@S#0071" | |
}, aj); | |
var ah = "#" + gui.YNDialogBox.divId; | |
var ad = "." + gui.YNDialogBox.divId; | |
$(ad).remove(); | |
if ($(ah).length == 0) { | |
$("body").append(gui.emitHtml("div", { | |
id: gui.YNDialogBox.divId | |
}, "")) | |
} | |
var ae = function(au) { | |
return au.toString() + "px" | |
}; | |
var aq = false; | |
var an = ab() || ["center", 227]; | |
var ag = gui.isMobileView() ? 60 : 162; | |
var Z = aj.customBtnText || ["L@S#0071", "L@S#0072"]; | |
var am = {}; | |
if (aj.hasBtns == undefined) { | |
aj.hasBtns = true | |
} | |
if (aj.hasBtns) { | |
am[te.loc(Z[0])] = function() { | |
X.call(this, true) | |
}; | |
if (Z.length >= 2) { | |
am[te.loc(Z[1])] = function() { | |
X.call(this, false) | |
} | |
} | |
} | |
if (aj.hasTitleBar == undefined) { | |
aj.hasTitleBar = true | |
} | |
if (aj.hasTitleBar) { | |
aj.title = te.loc(aj.title) || " " | |
} | |
if (aj.isFullScrn || aj.isFullDoc) { | |
aq = false; | |
an = [0, 0] | |
} else { | |
aq = true; | |
$("body").addClass("gui-pos-relative") | |
} | |
$(ah).html(te.loc(aj.contents)); | |
var ap = ac(); | |
$(ah).dialog({ | |
autoOpen: false, | |
draggable: aq, | |
resizable: aq, | |
modal: true, | |
closeOnEscape: false, | |
dialogClass: te.concatStr(gui.YNDialogBox.divId, aj.divId), | |
width: ap.wd, | |
height: ap.ht, | |
maxWidth: "100%", | |
minHeight: "auto", | |
position: an, | |
title: aj.title, | |
buttons: am | |
}); | |
if (te.isLangRTL(te.getDisplayLang()) && navigator.userAgent.match(/Android/) && !gui.isMobileView()) { | |
$(".ui-dialog").attr("dir", "rtl") | |
} | |
$(".ui-dialog-buttonpane button").each(function() { | |
if ($(this).text() == te.loc(aj.customActionBtnText) || $(this).text() == te.loc("L@S#0005")) { | |
$(this).addClass("gui-action-btn") | |
} | |
$(this).hover(function(au) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass("gui-mouseover") | |
} | |
}, function(au) { | |
$(this).removeClass("gui-mouseover") | |
}); | |
te.setTabbable($(this)) | |
}); | |
te.prependOffScreenText($(".ui-dialog-content"), "Beginning of dialog content"); | |
te.appendOffScreenText($(".ui-dialog-content"), "End of dialog content"); | |
var aa = $(window).width(); | |
var at = $(window).height(); | |
var Y; | |
$(window).resize(ai); | |
if (gui.isMobileView()) { | |
$(window).scrollTop(0); | |
$(window).resize() | |
} | |
setTimeout(function() { | |
Y = $(document).height(); | |
ao(); | |
if (!gui.isMobileView()) { | |
$(window).resize() | |
} | |
}, 100); | |
function ak() { | |
if (aj.isFullScrn) { | |
return { | |
wd: $(window).width() + "px", | |
ht: $(window).height() + "px" | |
} | |
} else { | |
if (aj.isFullDoc) { | |
var au = $(document).height(); | |
if (!Y) { | |
Y = ag | |
} else { | |
if (au > Y) { | |
Y = au | |
} | |
} | |
return { | |
wd: $(document).width() + "px", | |
ht: Y + "px" | |
} | |
} else { | |
return null | |
} | |
} | |
} | |
function ao() { | |
if (aj.isFullScrn || aj.isFullDoc) { | |
$(ah).dialog("setData", "overlay", { | |
width: "100%" | |
}); | |
$(ah).addClass("ui-dialog-full-scrn-doc"); | |
$(".YNDialogBox.ui-dialog").css("margin", "0"); | |
$(".ui-dialog-buttonpane").css({ | |
position: "absolute" | |
}); | |
$("#pgm-overall-container").hide() | |
} | |
$(ah).dialog("open"); | |
if (aj.isFullDoc || gui.isMobileView()) { | |
$(ad).css({ | |
left: 0, | |
top: 0 | |
}) | |
} | |
$(".ui-dialog").focus(); | |
$(".ui-dialog-content").attr("tabindex", "-1") | |
} | |
function ai() { | |
var au = $(window).width(); | |
var av = $(window).height(); | |
al(); | |
if (aa >= au && at >= av) { | |
return | |
} | |
aa = au; | |
at = av; | |
if (gui.YNDialogBox.timer != null) { | |
clearTimeout(gui.YNDialogBox.timer) | |
} | |
gui.YNDialogBox.timer = setTimeout(ar, D) | |
} | |
function ar() { | |
delete gui.YNDialogBox.timer; | |
$(ah).dialog("close"); | |
ao() | |
} | |
function X(av) { | |
var au = true; | |
B(); | |
if (af) { | |
if (af(av) === false) { | |
au = false | |
} | |
} | |
if (au) { | |
if ($("body").hasClass("gui-pos-relative")) { | |
$("body").removeClass("gui-pos-relative") | |
} | |
$("#pgm-overall-container").show(); | |
$(this).dialog("close") | |
} | |
} | |
function ac() { | |
if (aj.isFullScrn || aj.isFullDoc) { | |
return ak() | |
} else { | |
if (gui.isMobileView()) { | |
return { | |
wd: "100%", | |
ht: "auto" | |
} | |
} else { | |
var ax = 460; | |
var av = gui.isMobileView() ? 60 : 162; | |
var aA = av; | |
var az = 666; | |
var ay = 485; | |
var au = aj.hasBtns ? 126 : 70; | |
var aw = ($(ah).css("font-size")).slice(0, -2); | |
aw = (+aw).toFixed(); | |
av = $(ah).height() + au; | |
if (av % aw) { | |
av += +aw | |
} | |
if (aA > av) { | |
av = aA | |
} else { | |
if (av > ay && !aj.autoSize) { | |
av = ay; | |
ax = az | |
} | |
} | |
ax = aj.autoSize ? "auto" : ae(ax); | |
av = ae(av) | |
} | |
} | |
return { | |
wd: ax, | |
ht: av | |
} | |
} | |
function al() { | |
var av = ab(); | |
var au = ac(); | |
if (gui.isMobileView() && aj.hasBtns && !(aj.isFullDoc || aj.isFullScrn)) { | |
$(".ui-dialog-buttonpane").css("position", "relative") | |
} else { | |
$(".ui-dialog-buttonpane").css("position", "absolute") | |
} | |
$(ah).dialog("setData", "width", au.wd); | |
$(ah).dialog("setData", "height", au.ht); | |
if (!aj.isFullDoc && av != undefined) { | |
$(ah).dialog("setData", "position", av) | |
} | |
} | |
function ab() { | |
if ($.browser.msie && $.browser.version < 10) { | |
return | |
} | |
var au = aj.autoSize ? "auto" : 227; | |
var av = gui.isMobileView() ? [0, 0] : ["center", au]; | |
return av | |
} | |
}; | |
gui.YNDialogBox.close = function() { | |
if (gui.YNDialogBox.timer != null) { | |
clearTimeout(gui.YNDialogBox.timer); | |
delete gui.YNDialogBox.timer | |
} | |
if ($("body").hasClass("gui-pos-relative")) { | |
$("body").removeClass("gui-pos-relative") | |
} | |
setTimeout(function() { | |
$(window).scroll() | |
}, 100); | |
$("#pgm-overall-container").show(); | |
B(); | |
$("#" + gui.YNDialogBox.divId).dialog("close") | |
}; | |
function B() { | |
$(window).unbind("resize"); | |
ews.handleWindowResize() | |
} | |
gui.BaseWidget = function(Y) { | |
if (!Y) { | |
return | |
} | |
var X = Y.type || Y.name.toLowerCase(); | |
gui.regInpCtl(X, Y.name) | |
}; | |
gui.BaseWidget.prototype.getDivId = function() { | |
v("getDivId() not overridden"); | |
return null | |
}; | |
gui.BaseWidget.prototype.getShowDivId = function() { | |
return this.getDivId() | |
}; | |
gui.BaseWidget.prototype.getEnableDivId = function() { | |
return this.getDivId() | |
}; | |
gui.BaseWidget.prototype.getRawVal = function() { | |
return null | |
}; | |
gui.BaseWidget.prototype.setRawVal = function() {}; | |
gui.BaseWidget.prototype.isVisible = function() { | |
return $(this.getShowDivId()).is(":visible") | |
}; | |
gui.BaseWidget.prototype.show = function(Y) { | |
if (Y == null) { | |
Y = true | |
} | |
var X = $(this.getShowDivId()); | |
if (Y) { | |
X.show() | |
} else { | |
X.hide() | |
} | |
}; | |
gui.BaseWidget.prototype.isEnabled = function() { | |
return $(this.getEnableDivId()).is(":enabled") | |
}; | |
gui.BaseWidget.prototype.enable = function(Y) { | |
var Z = this; | |
if (Y == null) { | |
Y = true | |
} | |
var X = $(Z.getEnableDivId()); | |
X.attr("disabled", !Y); | |
if (Y) { | |
X.removeClass("disabled") | |
} else { | |
X.addClass("disabled"); | |
if (Z._MOUSE_OVER_CLS) { | |
X.removeClass(Z._MOUSE_OVER_CLS) | |
} | |
} | |
}; | |
gui.BaseWidget.prototype.isReqField = function() { | |
return false | |
}; | |
gui.BaseWidget.prototype.onShowTouchup = function() {}; | |
(function() { | |
gui.PageCmdBtns = function(Y) { | |
return new gui.CommandBtns($.extend({ | |
type: "button", | |
styleCls: "gui-page-cmd-bar", | |
innerCls: "btn-list", | |
inPlace: true | |
}, Y)) | |
}; | |
gui.createApplyCancelCmdBtns = function(Y, ab) { | |
function ac(ae, ad) { | |
switch (ad) { | |
case "cancel": | |
ab.pageFrag.reload(); | |
return; | |
default: | |
return Z.call(this, ae, ad) | |
} | |
} | |
if ($.typeOf(ab) == "function") { | |
ab = { | |
onClick: ab | |
} | |
} | |
var aa = ab.list == null && ab.pageFrag != null; | |
var Z; | |
ab = $.extend({ | |
list: [{ | |
text: "L@S#0004", | |
cmd: "apply" | |
}, { | |
text: "L@S#0438", | |
cmd: "cancel" | |
}] | |
}, ab); | |
if (aa) { | |
Z = ab.onClick; | |
ab.onClick = ac | |
} | |
return gui.createWidget(Y, gui.PageCmdBtns(ab)) | |
}; | |
gui.OKDialogBox = {}; | |
gui.OKDialogBox.show = function(Y, Z) { | |
Y.customBtnText = ["L@S#0005"]; | |
gui.YNDialogBox.show(Y, Z) | |
}; | |
var X = {}; | |
gui.createInputPair = function(Y, aa) { | |
var Z; | |
aa = $.extend({ | |
vertical: false, | |
inputStr: "", | |
cls: "", | |
labelCls: "", | |
inputCls: "", | |
exampleCls: "" | |
}, aa); | |
if (aa.inputId == null) { | |
aa.inputId = $.hlp.getTmpDivId() | |
} | |
if (aa.vertical) { | |
Z = A | |
} else { | |
Z = G | |
} | |
$(Q(Y)).addClass(te.concatStr(Z, aa.cls)).html(w(aa)); | |
return aa.inputId | |
}; | |
gui.regInpCtl = function(Z, Y) { | |
X[Z] = Y | |
}; | |
gui.createInpCtl = function(ai, Y) { | |
function ae(an) { | |
var am = String(an); | |
var al = am.match(/^([-+]?\d*)\.?(\d*)$/); | |
var ao = al[2].length; | |
return { | |
beforeDec: al[1].length, | |
afterDec: ao != 0 ? ao + 1 : ao | |
} | |
} | |
var aj = $.hlp.getTmpDivId(); | |
var ag; | |
$(Q(ai)).append(gui.emitHtml("div", { | |
id: aj, | |
"class": Y.rowCls | |
}, "")); | |
if (Y.label != null) { | |
aj = gui.createInputPair(Q(aj), { | |
cls: Y.cls || "", | |
labelStr: Y.label, | |
vertical: Y.vertical || false | |
}); | |
ag = $(Q(aj)) | |
} else { | |
if ($(Q(ai)).siblings("label").text() == te.loc(Y.title)) { | |
Y.title = "" | |
} | |
ag = $(Q(aj)); | |
if (Y.isNested) { | |
ag.addClass("gui-nested-field") | |
} else { | |
ag.addClass("gui-input-standalone") | |
} | |
} | |
if (Y.inputCls != null) { | |
ag.addClass(Y.inputCls) | |
} | |
if (Y.inputCls == null && (af == "text" || af == "textarea")) { | |
var ak; | |
if (Y.maxLength < 5) { | |
ak = "shorter" | |
} else { | |
if (Y.maxLength < 10) { | |
ak = "short" | |
} else { | |
if (Y.maxLength > 20) { | |
ak = "long" | |
} | |
} | |
} | |
if (ak != null) { | |
ag.addClass(ak) | |
} | |
} | |
if (Y.dataObj && Y.dataObj.getProp) { | |
Y = $.extend({}, Y.dataObj.getProp(Y.jsField), Y); | |
if (Y.isConfirmField) { | |
if (Y.onValidateActions) { | |
Y.onValidateActions = Y.onValidateActions.slice(0) | |
} else { | |
Y.onValidateActions = [] | |
} | |
Y.onValidateActions.push("checkLinked") | |
} | |
} | |
var af; | |
if (Y.type != null) { | |
af = Y.type | |
} else { | |
if (Y.maxLength != null) { | |
af = "text" | |
} else { | |
if (Y.optionArray != null) { | |
af = "select" | |
} else { | |
if (Y.min != null && Y.max != null && Y.step != null && Y.step == Math.floor(Y.step)) { | |
var ah = (Y.max - Y.min) / Y.step; | |
if (ah <= 10) { | |
af = "slider" | |
} else { | |
af = "text" | |
} | |
} else { | |
if (Y.type == null && te.isBoolValType(Y.valType)) { | |
af = "select" | |
} else { | |
af = "text" | |
} | |
} | |
} | |
} | |
} | |
if (af == "text") { | |
if (Y.min != null && Y.max != null && Y._valRange == null) { | |
Y._valRange = [Y.min, Y.max] | |
} | |
if (Y.maxLength == null && Y.min != null && Y.max != null && Y.step != null) { | |
var Z = ae(Y.min); | |
var aa = ae(Y.max); | |
var ad = ae(Y.step); | |
Y.maxLength = Math.max(Z.beforeDec, aa.beforeDec, ad.beforeDec) + Math.max(Z.afterDec, aa.afterDec, ad.afterDec) | |
} | |
if (Y.maxLength == null && Y._valRange != null) { | |
Y.maxLength = Math.max(String(Y._valRange[0]).length, String(Y._valRange[1]).length) | |
} | |
} | |
if (af == "ipv4" && gui.isMobileBrowser()) { | |
af = "text" | |
} | |
if (af == "ipv4" && Y.onValidateActions) { | |
if (Y.allowEmpty === undefined && $.inArray("allowEmptyCheck", Y.onValidateActions) >= 0) { | |
Y.allowEmpty = true | |
} | |
if (Y.allowZero === undefined && $.inArray("ipV4allowZeroOrEmptyCheck", Y.onValidateActions) >= 0) { | |
Y.allowZero = true | |
} | |
if (Y.isNetMask === undefined && $.inArray("netMaskCheck", Y.onValidateActions) >= 0) { | |
Y.isNetMask = true | |
} | |
if (Y.isNetworkRange === undefined && $.inArray("networkRangeCheck", Y.onValidateActions) >= 0) { | |
Y.isNetworkRange = true | |
} | |
} | |
var ac = X[af]; | |
var ab; | |
if (ac) { | |
Y.title = (Y.title != Y.label) ? Y.title : ""; | |
if (shared.gui[ac]) { | |
ab = new shared.gui[ac](Y) | |
} else { | |
if (gui[ac]) { | |
ab = new gui[ac](Y) | |
} else { | |
console.error("Unregistered widget " + ac) | |
} | |
} | |
} else { | |
if (af != "none") { | |
console.error("Unknown widget " + af) | |
} | |
} | |
if (!ab) { | |
return ag | |
} | |
ab.create(aj); | |
return ab | |
}; | |
gui.insertWidget = function(Y, ab, Z) { | |
Z = $.extend({}, Z); | |
var aa = $.hlp.getTmpDivId(); | |
$(Q(Y)).append(gui.emitHtml("div", { | |
id: aa, | |
"class": Z.rowCls | |
}, "")); | |
return gui.createWidget(Q(aa), ab) | |
}; | |
gui.createWidget = function(Y, Z) { | |
Z.create(Y); | |
return Z | |
} | |
})(); | |
gui.Button = function(X) { | |
X = $.fillIn(X, { | |
onBlur: $.noop, | |
onClick: $.noop, | |
onFocus: $.noop, | |
onClearInfo: $.noop, | |
onValidate: V | |
}); | |
this.opts = X | |
}; | |
gui.Button.prototype = new gui.BaseWidget(); | |
gui.Button.prototype._CLS = "gui-button-cls"; | |
gui.Button.prototype._MOUSE_OVER_CLS = "gui-mouseover"; | |
gui.Button.prototype._STANDALONE_BTN_CLS = "gui-standalone-btn"; | |
gui.Button.prototype._ACTION_BTN_CLS = "gui-action-btn"; | |
gui.Button.prototype.getDivId = function() { | |
return this._hashInputId | |
}; | |
gui.Button.prototype._emitHtml = function() { | |
var Y = this; | |
var aa = ""; | |
var Z = (Y.opts.title != Y.opts.text) ? Y.opts.title : ""; | |
var X = Y.opts.noTopAndBottomMargin ? "gui-button-no-top-bottom-margin-cls" : ""; | |
if (Y.opts.isActionBtn || $.inArray(Y.opts.text, ["L@S#0004", "L@S#0010", "L@S#3935", "L@S#0005"]) > -1) { | |
if (!$(Y._hashDivId).hasClass(this._STANDALONE_BTN_CLS)) { | |
$(Y._hashDivId).addClass(this._STANDALONE_BTN_CLS) | |
} | |
aa = this._ACTION_BTN_CLS | |
} | |
return gui.emitHtml("input", { | |
id: Y.opts.inputId, | |
name: Y.opts.inputId, | |
type: "button", | |
value: te.loc(Y.opts.text), | |
"class": te.concatStr(Y._CLS, Y.opts.mainCls, aa, X), | |
title: te.loc(Z) | |
}) | |
}; | |
gui.Button.prototype.create = function(X) { | |
var Z = this; | |
if (Z.opts.divId == null) { | |
Z.opts.divId = X | |
} | |
if (Z.opts.inputId == null) { | |
Z.opts.inputId = z(X) + "-Inp" | |
} | |
Z._hashDivId = Q(Z.opts.divId); | |
Z._hashInputId = Q(Z.opts.inputId); | |
var Y = Z._emitHtml(); | |
$(Z._hashDivId).html(Y); | |
gui.fixTooltips(Z._hashDivId); | |
$(Z._hashInputId).blur(function() { | |
return Z.opts.onBlur.call(Z, this) | |
}).click(function() { | |
$(this).blur(); | |
if (Z.opts.isSingleClick && Z.isInProgress()) { | |
console.warn("gui.Button in progress!"); | |
return | |
} | |
Z.isInProgress(true); | |
try { | |
return Z.opts.onClick.call(Z, this) | |
} catch (aa) { | |
console.log(aa); | |
gui.showLoadPageFailedScrn({ | |
jsErr: true | |
}) | |
} | |
}).focus(function() { | |
return Z.opts.onFocus.call(Z, this) | |
}).hover(function(aa) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass(Z._MOUSE_OVER_CLS) | |
} | |
}, function(aa) { | |
$(this).removeClass(Z._MOUSE_OVER_CLS) | |
}); | |
if (Z.opts.disabled) { | |
Z.enable(false) | |
} | |
}; | |
gui.Button.prototype.isInProgress = function(X) { | |
if (arguments.length == 0) { | |
return this._inProgressFlag | |
} | |
this._inProgressFlag = !!X | |
}; | |
gui.Button.prototype.clearInfo = function() { | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.Button.prototype.validate = function() { | |
return this.opts.onValidate.call(this) | |
}; | |
gui.Button.prototype.updateText = function(Y, X) { | |
this.opts.text = Y; | |
this.opts.title = X; | |
X = (this.opts.title != this.opts.text) ? this.opts.title : ""; | |
$(this._hashInputId).val(te.loc(Y)).attr("title", te.loc(X)); | |
gui.fixTooltips(this._hashInputId) | |
}; | |
gui.CheckBox = function(X) { | |
X = $.fillIn(X, { | |
isBlock: true, | |
onBlur: $.noop, | |
onClick: $.noop, | |
onFocus: $.noop, | |
onClearInfo: $.noop, | |
onValidate: V | |
}); | |
this.opts = X | |
}; | |
gui.CheckBox.prototype = new gui.BaseWidget({ | |
name: "CheckBox" | |
}); | |
gui.CheckBox.prototype._LABEL_CLS = "gui-checkbox-label"; | |
gui.CheckBox.prototype._INPUT_CLS = "gui-checkbox-input"; | |
gui.CheckBox.prototype._SPAN_CLS = "gui-checkbox-span"; | |
gui.CheckBox.prototype.getDivId = function() { | |
return this._hashInputId | |
}; | |
gui.CheckBox.prototype.create = function(Z) { | |
var ac = this; | |
if (this.opts.text == null) { | |
this.opts.text = "" | |
} | |
this._hashDivId = Q(Z); | |
this._inputDivId = z(Z) + "-Inp"; | |
this._hashInputId = "#" + this._inputDivId; | |
if (this.opts.customImg) { | |
this.opts.customImg = gui._CUSTOM_CHECK_IMG_CLS + this.opts.customImg | |
} | |
var ad = (this.opts.title != this.opts.text) ? te.loc(this.opts.title) : ""; | |
var Y = te.loc(this.opts.text); | |
var X = te.concatStr(this._INPUT_CLS, this.opts.inputCls); | |
var aa = te.concatStr(this._SPAN_CLS, this.opts.spanCls, this._inputDivId); | |
if (this.opts.descMsg) { | |
this._descMsgDivId = z(Z) + "-Desc"; | |
X = te.concatStr(X, "left"); | |
aa = te.concatStr(aa, "gui-inline-block w900pc"); | |
Y = gui.emitHtml("div", {}, Y) + gui.emitHtml("div", { | |
id: this._descMsgDivId | |
}, te.loc(this.opts.descMsg)) | |
} | |
var ab = gui.emitCheckboxHtml({ | |
tickOpts: { | |
id: this._inputDivId, | |
cls: X, | |
disabled: d(this.opts.disabled) | |
}, | |
spanOpts: { | |
id: this.opts.spanId, | |
cls: aa, | |
text: Y | |
}, | |
labelOpts: { | |
id: this.opts.lblId, | |
cls: te.concatStr(this._LABEL_CLS, this.opts.lblCls, this.opts.customImg), | |
title: ad | |
} | |
}); | |
$(this._hashDivId).html(ab); | |
gui.fixTooltips(this._hashDivId); | |
$(this._hashInputId).blur(function() { | |
return ac.opts.onBlur.call(ac, this) | |
}).click(function() { | |
var ae = $(ac._hashDivId).children("label"); | |
if (this.checked) { | |
ae.addClass("checked") | |
} else { | |
ae.removeClass("checked") | |
} | |
return ac.opts.onClick.call(ac, this) | |
}).focus(function() { | |
return ac.opts.onFocus.call(ac, this) | |
}) | |
}; | |
gui.CheckBox.prototype.isVisible = function() { | |
return $(this._hashInputId).is(":visible") | |
}; | |
gui.CheckBox.prototype.show = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashDivId).show() | |
} else { | |
$(this._hashDivId).hide() | |
} | |
}; | |
gui.CheckBox.prototype.isEnabled = function() { | |
return $(this._hashInputId).is(":enabled") | |
}; | |
gui.CheckBox.prototype.enable = function(X) { | |
if (X == null) { | |
X = true | |
} | |
$(this._hashInputId).attr("disabled", !X); | |
var Y = $(this._hashDivId).children("label"); | |
if (X) { | |
Y.removeClass("disabled") | |
} else { | |
Y.addClass("disabled") | |
} | |
}; | |
gui.CheckBox.prototype.val = function(X) { | |
if (X === null) { | |
X = false | |
} | |
if (X != null) { | |
if (this.opts.optionArray) { | |
X = X == this.opts.optionArray[1] | |
} | |
var Y = $(this._hashDivId).children("label"); | |
if (X) { | |
$(this._hashInputId).attr("checked", "checked"); | |
Y.addClass("checked") | |
} else { | |
$(this._hashInputId).removeAttr("checked"); | |
Y.removeClass("checked") | |
} | |
} | |
X = $(this._hashInputId).attr("checked"); | |
if (this.opts.optionArray) { | |
X = this.opts.optionArray[X ? 1 : 0] | |
} | |
return X | |
}; | |
gui.CheckBox.prototype.clearInfo = function() { | |
var X = this; | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.CheckBox.prototype.validate = function() { | |
return this.opts.onValidate.call(this) | |
}; | |
gui.CheckBox.prototype.getLabelCls = function() { | |
return this._inputDivId | |
}; | |
gui._CUSTOM_CHECK_IMG_CLS = "gui-checkbox-img-"; | |
gui.emitCheckboxHtml = function(ab) { | |
var aa = ""; | |
var ae = ""; | |
var X = ""; | |
var ad = ab.tickOpts; | |
var Z = ab.spanOpts; | |
var Y = ab.labelOpts; | |
var ac = ""; | |
if (ad) { | |
ae = gui.emitHtml("input", { | |
type: "checkbox", | |
name: ad.name, | |
id: ad.id, | |
"class": ad.cls, | |
checked: ad.checked, | |
disabled: ad.disabled, | |
title: ad.title, | |
value: ad.value | |
}) | |
} | |
if (Z && Z.text) { | |
X = gui.emitHtml("span", { | |
id: Z.id, | |
"class": Z.cls | |
}, Z.text) | |
} else { | |
ac = "no-text" | |
} | |
aa = gui.emitHtml("label", { | |
id: Y.id, | |
"class": te.concatStr(Y.cls, ac), | |
title: Y.title | |
}, ae + X); | |
return aa | |
}; | |
gui.DatePicker = function(X) { | |
X = $.fillIn(X, { | |
useStdStyle: true, | |
onBlur: $.noop, | |
onFocus: $.noop, | |
onKeyPress: $.noop, | |
onClearInfo: $.noop, | |
onValidate: $.noop, | |
onValidateActions: [], | |
userActions: {}, | |
userMsgs: {} | |
}); | |
this.opts = X | |
}; | |
gui.DatePicker.prototype = new gui.BaseWidget({ | |
name: "DatePicker", | |
type: "date" | |
}); | |
gui.DatePicker.prototype._CLS = "gui-datepicker"; | |
gui.DatePicker.prototype._INPUT_CLS = "gui-datepicker-input text"; | |
gui.DatePicker.prototype._INFO_CLS = "gui-datepicker-info"; | |
gui.DatePicker.prototype._LABEL_ERR_CLS = "gui-input-field-label-err"; | |
gui.DatePicker.prototype._ERR_CLS = "gui-datepicker-err"; | |
gui.DatePicker.prototype._LANG_MAP = {}; | |
$.each($.hlp.langCodeMap, function(X, Z) { | |
var Y = Z.jqCode; | |
if (Y == null) { | |
Y = Z.code2d | |
} | |
gui.DatePicker.prototype._LANG_MAP[X] = Y | |
}); | |
gui.DatePicker.prototype._DATE_FORMAT_MAP = { | |
DDMMMYYYY: "dd-mm-yy", | |
MMMDDYYYY: "mm-dd-yy", | |
YYYYMMMDD: "yy-mm-dd" | |
}; | |
gui.DatePicker.prototype._DISP_DATE_FORMAT_MAP = { | |
"dd-mm-yy": "L@S#4587", | |
"mm-dd-yy": "L@S#4588", | |
"yy-mm-dd": "L@S#4589" | |
}; | |
gui.DatePicker.prototype.getDivId = function() { | |
return this._hashInputId | |
}; | |
gui.DatePicker.prototype.create = function(Y) { | |
var ab = this; | |
if (this.opts.divId == null) { | |
this.opts.divId = Y | |
} | |
this._isRTL = false; | |
this._dateFormat = "mm-dd-yy"; | |
this._inputDivId = Y + "-Inp"; | |
this._infoDivId = Y + "-Info"; | |
this._hashInputId = "#" + this._inputDivId; | |
this._hashDivId = "#" + this.opts.divId; | |
var aa = gui.emitHtml("input", { | |
id: this._inputDivId, | |
type: "text", | |
title: te.loc(this.opts.title), | |
readonly: true, | |
"class": te.concatStr(this._INPUT_CLS, this.opts.inputCls) | |
}); | |
if (this.opts.createInfoDiv) { | |
aa += gui.emitHtml("span", { | |
id: this._infoDivId, | |
"class": this._INFO_CLS | |
}, "") | |
} | |
$("#" + Y).html(aa); | |
gui.fixTooltips("#" + Y); | |
if (ab.opts.useStdStyle) { | |
O(ab, "#" + Y) | |
} | |
$(this._hashInputId).blur(function() { | |
return ab.opts.onBlur.call(ab, this) | |
}).focus(function() { | |
return ab.opts.onFocus.call(ab, this) | |
}).keypress(function(ac) { | |
return ab.opts.onKeyPress.call(ab, this, ac) | |
}); | |
if (gui.isTabletDevice() && $.browser.safari) { | |
$("#pgm-overall-container").click($.noop) | |
} | |
if (this.opts.region && te.isLangRTL(this.opts.region)) { | |
this._isRTL = true | |
} | |
if (this.opts.dateFormat) { | |
this._dateFormat = this._DATE_FORMAT_MAP[this.opts.dateFormat] | |
} | |
var Z = this._DISP_DATE_FORMAT_MAP[this._dateFormat]; | |
if (this.opts.useStdStyle) { | |
var X = $("#" + Y); | |
if (X.parent().hasClass("gui-field")) { | |
X = X.parent() | |
} | |
X = X.parent().children("label"); | |
X.html(X.text() + " (" + te.loc(Z) + ")") | |
} | |
if ($.datepicker) { | |
$.datepicker.setDefaults($.datepicker.regional[this._LANG_MAP[this.opts.region]]); | |
$(ab._hashInputId).datepicker({ | |
changeMonth: true, | |
changeYear: true, | |
minDate: ab.opts.minDate, | |
maxDate: ab.opts.maxDate, | |
hideIfNoPrevNext: true, | |
dateFormat: this._dateFormat | |
}) | |
} | |
}; | |
gui.DatePicker.prototype.show = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashDivId).show(); | |
if ($(this._hashInputId).datepicker) { | |
$(this._hashInputId).datepicker("show") | |
} | |
} else { | |
$(this._hashDivId).hide(); | |
if ($(this._hashInputId).datepicker) { | |
$(this._hashInputId).datepicker("hide", [200]) | |
} | |
} | |
}; | |
gui.DatePicker.prototype.enable = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashInputId).removeAttr("disabled"); | |
if ($(this._hashInputId).datepicker) { | |
$(this._hashInputId).datepicker("enable"); | |
$(this._hashInputId).removeClass("disabled") | |
} | |
} else { | |
$(this._hashInputId).attr("disabled", "disabled"); | |
if ($(this._hashInputId).datepicker) { | |
$(this._hashInputId).datepicker("disable"); | |
$(this._hashInputId).addClass("disabled") | |
} | |
} | |
}; | |
gui.DatePicker.prototype.val = function(Y) { | |
if (Y === null) { | |
Y = "" | |
} | |
if (Y != null) { | |
if ($(this._hashInputId).datepicker) { | |
$(this._hashInputId).datepicker("disable"); | |
$(this._hashInputId).datepicker("setDate", Y); | |
$(this._hashInputId).datepicker("enable") | |
} else { | |
var aa = this._dateToStr(Y); | |
$(this._hashInputId).val(aa) | |
} | |
} | |
var Z = $(this._hashInputId).val(); | |
if (Z == "" || this.opts.outDateFormat == null || this.opts.dateFormat == this.opts.outDateFormat) { | |
return Z | |
} | |
var X = Z.split("-"); | |
switch (this.opts.dateFormat) { | |
case "DDMMMYYYY": | |
Z = X[2] + "-" + X[1] + "-" + X[0]; | |
break; | |
case "MMMDDYYYY": | |
Z = X[2] + "-" + X[0] + "-" + X[1]; | |
break; | |
default: | |
break | |
} | |
X = Z.split("-"); | |
switch (this.opts.outDateFormat) { | |
case "DDMMMYYYY": | |
Z = X[2] + "-" + X[1] + "-" + X[0]; | |
break; | |
case "MMMDDYYYY": | |
Z = X[1] + "-" + X[2] + "-" + X[0]; | |
break; | |
default: | |
break | |
} | |
return Z | |
}; | |
gui.DatePicker.prototype.clearInfo = function() { | |
$(this._labelObj).removeClass(this._LABEL_ERR_CLS); | |
$(this._hashDivId).removeClass(this._ERR_CLS); | |
$(this._hashDivId + " .text").removeClass("gui-input-field-err"); | |
$("#" + this._infoDivId).hide(); | |
if (this.opts.useStdStyle) { | |
W(this) | |
} | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.DatePicker.prototype.validate = function() { | |
var Y = this._execActions(this.opts.onValidateActions); | |
var Z = Y[0] == null; | |
var aa; | |
if (!Z) { | |
var X = Y[1]; | |
if (this.opts.userMsgs[X]) { | |
aa = this.opts.userMsgs[X] | |
} else { | |
if (this._builtInMsgs[X]) { | |
aa = this._builtInMsgs[X] | |
} else { | |
v("Err " + X + " is undefined.") | |
} | |
} | |
} | |
Y = this.opts.onValidate.call(this, Y[0] == null, Y[0]); | |
if (Y !== undefined) { | |
if ($.typeOf(Y) == "string") { | |
aa = Y | |
} | |
Z &= Y | |
} | |
if (!Z) { | |
$(this._labelObj).addClass(this._LABEL_ERR_CLS); | |
$(this._hashDivId).addClass(this._ERR_CLS); | |
$(this._hashDivId + " .text").addClass("gui-input-field-err"); | |
if (this.opts.useStdStyle) { | |
W(this) | |
} | |
return y(this, aa) | |
} | |
return Z | |
}; | |
gui.DatePicker.prototype._execActions = function(Z) { | |
var ab = true; | |
var X; | |
var aa; | |
for (var Y = 0; Y < Z.length; ++Y) { | |
X = Z[Y]; | |
if (this.opts.userActions[X]) { | |
aa = this.opts.userActions[X].call(this) | |
} else { | |
if (this._builtInActions[X]) { | |
aa = this._builtInActions[X].call(this) | |
} else { | |
v("Action " + X + " is undefined.") | |
} | |
} | |
if (aa === true) { | |
return [null, undefined] | |
} | |
if (aa !== undefined) { | |
break | |
} | |
} | |
if (aa === undefined) { | |
X = null | |
} | |
return [X, aa] | |
}; | |
gui.DatePicker.prototype._builtInActions = { | |
allowEmptyCheck: function() { | |
if (this.val().length == 0) { | |
return true | |
} | |
}, | |
emptyCheck: function() { | |
if (this.val().length == 0) { | |
return "empty" | |
} | |
}, | |
formatCheck: function() { | |
switch (this._dateFormat) { | |
case "dd-mm-yy": | |
case "mm-dd-yy": | |
this.opts._valRegExprFormat = /^([0-9]?[0-9])-([0-9]?[0-9])-([0-9]{4}|[0-9]{2})$/; | |
break; | |
default: | |
case "yy-mm-dd": | |
this.opts._valRegExprFormat = /^([0-9]{4}|[0-9]{2})-([0-9]?[0-9])-([0-9]?[0-9])$/; | |
break | |
} | |
if (!(this.val().match(this.opts._valRegExprFormat))) { | |
return "format" | |
} | |
}, | |
dateCheck: function() { | |
switch (this._dateFormat) { | |
case "dd-mm-yy": | |
this.opts._valRegExprDate = /^([0]?[1-9]|[1-2][0-9]|3[0-1])-([0]?[1-9]|1[0-2])-([0-9]{4}|[0-9]{2})$/; | |
break; | |
case "mm-dd-yy": | |
this.opts._valRegExprDate = /^([0]?[1-9]|1[0-2])-([0]?[1-9]|[1-2][0-9]|3[0-1])-([0-9]{4}|[0-9]{2})$/; | |
break; | |
default: | |
case "yy-mm-dd": | |
this.opts._valRegExprDate = /^([0-9]{4}|[0-9]{2})-([0]?[1-9]|1[0-2])-([0]?[1-9]|[1-2][0-9]|3[0-1])$/; | |
break | |
} | |
if (!(this.val().match(this.opts._valRegExpr))) { | |
return "date" | |
} | |
} | |
}; | |
gui.DatePicker.prototype._builtInMsgs = { | |
empty: "L@S#2292" | |
}; | |
gui.DatePicker.prototype.isReqField = function() { | |
var X = this; | |
if (!X.isVisible() || !X.isEnabled()) { | |
return false | |
} | |
if ($(X._hashDivId).hasClass(X._ERR_CLS)) { | |
return $.inArray("emptyCheck", X.opts.onValidateActions) >= 0 | |
} | |
return false | |
}; | |
gui.DatePicker.prototype._dateToStr = function(Y) { | |
var X = ""; | |
switch (this._dateFormat) { | |
case "dd-mm-yy": | |
X = Y.getDate() + "-" + (+Y.getMonth() + 1) + "-" + Y.getFullYear(); | |
break; | |
case "mm-dd-yy": | |
X = (+Y.getMonth() + 1) + "-" + Y.getDate() + "-" + Y.getFullYear(); | |
break; | |
default: | |
case "yy-mm-dd": | |
X = Y.getFullYear() + "-" + (+Y.getMonth() + 1) + "-" + Y.getDate(); | |
break | |
} | |
return X | |
}; | |
gui.DatePicker.prototype._strToDate = function(Y) { | |
var Z, X; | |
switch (this._dateFormat) { | |
case "dd-mm-yy": | |
Z = Y.split("-"); | |
if (+Z[2] < 100) { | |
Z[2] += 2000 | |
} | |
X = new Date(+Z[2], +Z[1] - 1, +Z[0]); | |
break; | |
case "mm-dd-yy": | |
Z = Y.split("-"); | |
if (+Z[2] < 100) { | |
Z[2] += 2000 | |
} | |
X = new Date(+Z[2], +Z[0] - 1, +Z[1]); | |
break; | |
default: | |
case "yy-mm-dd": | |
Z = Y.split("-"); | |
if (+Z[0] < 100) { | |
Z[0] += 2000 | |
} | |
X = new Date(+Z[0], +Z[1] - 1, +Z[2]); | |
break | |
} | |
return X | |
}; | |
(function() { | |
var X = function(aa) { | |
aa = $.extend({ | |
onBlur: $.noop, | |
onChange: $.noop, | |
onFocus: $.noop | |
}, aa); | |
if (aa.optionArray == null && te.isBoolValType(aa.valType)) { | |
aa.optionArray = [true, false] | |
} | |
if (aa.optionArray == null && aa.min != null && aa.max != null && aa.step != null) { | |
aa.optionArray = []; | |
for (var Z = aa.min; Z <= aa.max; Z += aa.step) { | |
aa.optionArray.push(Z) | |
} | |
} | |
this.opts = aa | |
}; | |
X.prototype = new gui.BaseWidget({ | |
name: "DropDownBoxButtonLike" | |
}); | |
X.prototype._CLS = "gui-dropdownboxbuttonlike-cls"; | |
X.prototype._MOUSE_OVER_CLS = "gui-mouseover"; | |
X.prototype._FOCUS_CLS = "gui-focus"; | |
X.prototype.create = function(ag) { | |
function Z(ak) { | |
if ($.typeOf(ak) == "string") { | |
return ak | |
} else { | |
return ak.text | |
} | |
} | |
var ad = this; | |
ad._divId = ag; | |
if (this.opts.inputId == null) { | |
this.opts.inputId = z(ag) + "-Inp" | |
} | |
this._hashInputId = Q(this.opts.inputId); | |
var aj = ""; | |
var aa; | |
var ac = ""; | |
var af = ""; | |
var ai; | |
var ah = this.opts.listWidthCls ? "" : "w1000pc"; | |
var ae = this.opts.locMap || $.locMap.get(this.opts.jsField); | |
if (ae) { | |
for (var ab in ae) { | |
for (aa = 0; aa < this.opts.optionArray.length; ++aa) { | |
if (ab == "" + this.opts.optionArray[aa]) { | |
break | |
} | |
} | |
if (aa < this.opts.optionArray.length) { | |
aj += gui.emitHtml("li", { | |
id: "gui-dd-list-item-" + ab | |
}, te.loc(ae[Z(ab)])) | |
} | |
} | |
} else { | |
for (aa = 0; aa < this.opts.optionArray.length; ++aa) { | |
aj += gui.emitHtml("li", { | |
id: "gui-dd-list-item-" + this.opts.optionArray[aa] | |
}, this.opts.optionArray[aa]) | |
} | |
} | |
ac = gui.emitHtml("div", { | |
"class": "gui-dd-header" | |
}, gui.emitHtml("div", { | |
"class": "gui-dd-header-label left" | |
}, te.loc(this.opts.labelStr)) + gui.emitHtml("div", { | |
"class": "gui-dd-header-icon left" | |
})); | |
af = gui.emitHtml("div", { | |
"class": te.concatStr("gui-dd-list", ah) | |
}, gui.emitHtml("ul", { | |
"class": this.opts.listWidthCls | |
}, aj)); | |
aj = gui.emitHtml("div", { | |
id: this.opts.inputId, | |
disabled: d(this.opts.disabled), | |
"class": te.concatStr(this.opts.mainCls, this._CLS, "gui-dd-list-hidden gui-inline-block"), | |
title: te.loc(this.opts.title) | |
}, ac + af); | |
$(Q(ag)).html(aj); | |
gui.fixTooltips(Q(ag)); | |
$(this._hashInputId).blur(function(ak) { | |
if (!($(this).hasClass(ad._MOUSE_OVER_CLS) || $(this).hasClass(ad._FOCUS_CLS))) { | |
$(ad._hashInputId).removeClass("gui-dd-list-visible").addClass("gui-dd-list-hidden") | |
} | |
return ad.opts.onBlur.call(ad, this) | |
}).click(function() { | |
if ($(ad._hashInputId).hasClass("gui-dd-list-hidden")) { | |
$(ad._hashInputId).removeClass("gui-dd-list-hidden").addClass("gui-dd-list-visible") | |
} else { | |
$(ad._hashInputId).removeClass("gui-dd-list-visible").addClass("gui-dd-list-hidden") | |
} | |
}).change(function() { | |
return ad.opts.onChange.call(ad, this) | |
}).keypress(function(al) { | |
var ak = al.keyCode || al.which; | |
if (ak == 13) { | |
$(this).addClass(ad._FOCUS_CLS) | |
} | |
}).focus(function() { | |
return ad.opts.onFocus.call(ad, this) | |
}).hover(function(ak) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass(ad._MOUSE_OVER_CLS) | |
} | |
}, function(ak) { | |
$(this).removeClass(ad._MOUSE_OVER_CLS) | |
}); | |
ai = $(ad._hashInputId + "." + ad._CLS + " .gui-dd-list ul li"); | |
te.setTabbable($(ad._hashInputId)); | |
te.setTabbable(ai); | |
ai.click(function() { | |
var ak = Y($(this).attr("id")); | |
$(ad._hashInputId).val(ak); | |
return ad.opts.onChange.call(ad, this) | |
}) | |
}; | |
X.prototype.val = function(Z) { | |
return $(this._hashInputId).val() | |
}; | |
function Y(Z) { | |
var aa = Z.split("-"); | |
return aa[aa.length - 1] | |
} | |
gui.DropDownBoxButtonLike = X | |
})(); | |
gui.DropDownBoxSelect = function(Y) { | |
Y = $.extend({ | |
onBlur: $.noop, | |
onChange: $.noop, | |
onFocus: $.noop, | |
onClearInfo: $.noop, | |
onValidate: V | |
}, Y); | |
if (Y.optionArray == null && te.isBoolValType(Y.valType)) { | |
Y.optionArray = [true, false] | |
} | |
if (Y.optionArray == null && Y.min != null && Y.max != null && Y.step != null) { | |
Y.optionArray = []; | |
for (var X = Y.min; X <= Y.max; X += Y.step) { | |
Y.optionArray.push(X) | |
} | |
} | |
this.opts = Y | |
}; | |
gui.DropDownBoxSelect.prototype = new gui.BaseWidget({ | |
name: "DropDownBoxSelect", | |
type: "select" | |
}); | |
gui.DropDownBoxSelect.prototype._CLS = "gui-dropdownboxselect-cls"; | |
gui.DropDownBoxSelect.prototype.getDivId = function() { | |
return this._hashInputId | |
}; | |
gui.DropDownBoxSelect.prototype.create = function(X) { | |
function ac(ae) { | |
if ($.typeOf(ae) == "string") { | |
return ae | |
} else { | |
return ae.text | |
} | |
} | |
var ab = this; | |
ab._divId = X; | |
if (this.opts.inputId == null) { | |
this.opts.inputId = z(X) + "-Inp" | |
} | |
this._hashInputId = Q(this.opts.inputId); | |
if (ab.opts.extLabelCls) { | |
ab._labelObj = Q(ab.opts.extLabelCls, ".") | |
} | |
var aa = ""; | |
var Z; | |
var Y = this.opts.locMap || $.locMap.get(this.opts.jsField); | |
if (Y) { | |
for (var ad in Y) { | |
for (Z = 0; Z < this.opts.optionArray.length; ++Z) { | |
if (ad == "" + this.opts.optionArray[Z]) { | |
break | |
} | |
} | |
if (Z < this.opts.optionArray.length) { | |
aa += gui.emitHtml("option", { | |
value: ad | |
}, te.loc(Y[ac(ad)])) | |
} | |
} | |
} else { | |
for (Z = 0; Z < this.opts.optionArray.length; ++Z) { | |
aa += gui.emitHtml("option", { | |
value: this.opts.optionArray[Z] | |
}, this.opts.optionArray[Z]) | |
} | |
} | |
aa = gui.emitHtml("select", { | |
id: this.opts.inputId, | |
disabled: d(this.opts.disabled), | |
"class": this.opts.mainCls, | |
title: te.loc(this.opts.title) | |
}, aa); | |
$(Q(X)).html(aa); | |
gui.fixTooltips(Q(X)); | |
$(this._hashInputId).blur(function() { | |
return ab.opts.onBlur.call(ab, this) | |
}).change(function() { | |
return ab.opts.onChange.call(ab, this) | |
}).focus(function() { | |
return ab.opts.onFocus.call(ab, this) | |
}) | |
}; | |
gui.DropDownBoxSelect.prototype.val = function(X) { | |
var Y = te.isBoolValType(this.opts.valType); | |
if (X != null && X !== "") { | |
if (Y) { | |
X = "" + X | |
} | |
$(this._hashInputId).val(X) | |
} | |
X = $(this._hashInputId).val(); | |
if (Y) { | |
return X == "true" | |
} else { | |
return X | |
} | |
}; | |
gui.DropDownBoxSelect.prototype.clearInfo = function() { | |
var X = this; | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.DropDownBoxSelect.prototype.validate = function() { | |
return this.opts.onValidate.call(this) | |
}; | |
gui.DropDownBoxSelect.prototype.setOptionArray = function(X) { | |
this.opts.optionArray = X; | |
this.create(this._divId) | |
}; | |
gui.DualSelectBox = function(X) { | |
X = $.fillIn(X, { | |
errText: te.loc("L@S#2287") | |
}); | |
this.opts = X | |
}; | |
gui.DualSelectBox.prototype = new gui.BaseWidget({ | |
name: "DualSelectBox" | |
}); | |
gui.DualSelectBox.prototype._CONTAINER_CLS = "gui-dual-select-box"; | |
gui.DualSelectBox.prototype._BTNS_CLS = "gui-dual-select-box-btns"; | |
gui.DualSelectBox.prototype._BTNS_CLS_WRAP = "gui-dual-select-box-btns-wrap"; | |
gui.DualSelectBox.prototype._ADD_BTN_CLS = "gui-dual-select-box-add-btn"; | |
gui.DualSelectBox.prototype._REMOVE_BTN_CLS = "gui-dual-select-box-remove-btn"; | |
gui.DualSelectBox.prototype._FROM_SEL_CLS = "gui-dual-select-box-from-sel"; | |
gui.DualSelectBox.prototype._TO_SEL_CLS = "gui-dual-select-box-to-sel"; | |
gui.DualSelectBox.prototype._SEL_ERR_CLS = "gui-dual-select-box-sel-err"; | |
gui.DualSelectBox.prototype.create = function(Y) { | |
this._hashDivId = "#" + Y; | |
this._addBtnDivId = Y + "-AddBtn"; | |
this._removeBtnDivId = Y + "-RemoveBtn"; | |
var Z = ""; | |
var X = ""; | |
var ab; | |
ab = ""; | |
if (this.opts.fromSelHdrText != null) { | |
ab += this.opts.fromSelHdrText | |
} | |
X = T({ | |
isSelectDivHorzScrollable: this.opts.isSelectDivHorzScrollable, | |
selectCls: this._FROM_SEL_CLS | |
}); | |
ab += X; | |
Z += gui.emitHtml("div", { | |
"class": te.concatStr(this._FROM_SEL_CLS + "-div", "gui-inline-block", "w400pc") | |
}, ab); | |
ab = ""; | |
ab += gui.emitHtml("div", {}, gui.emitHtml("input", { | |
id: this._addBtnDivId, | |
type: "button", | |
value: ">>", | |
"class": te.concatStr(this._ADD_BTN_CLS, gui.Button.prototype._CLS, this.opts.btnCls, "gui-inline-block"), | |
title: te.loc("L@S#2107") | |
})); | |
ab += gui.emitHtml("div", {}, gui.emitHtml("input", { | |
id: this._removeBtnDivId, | |
type: "button", | |
value: "<<", | |
"class": te.concatStr(this._REMOVE_BTN_CLS, gui.Button.prototype._CLS, this.opts.btnCls), | |
title: te.loc("L@S#2108") | |
})); | |
ab = gui.emitHtml("div", { | |
"class": this._BTNS_CLS | |
}, ab); | |
Z += gui.emitHtml("div", { | |
"class": te.concatStr(this._BTNS_CLS_WRAP, "gui-inline-block") | |
}, ab); | |
ab = ""; | |
if (this.opts.toSelHdrText != null) { | |
ab += this.opts.toSelHdrText | |
} | |
X = T({ | |
isSelectDivHorzScrollable: this.opts.isSelectDivHorzScrollable, | |
selectCls: this._TO_SEL_CLS | |
}); | |
ab += X; | |
Z += gui.emitHtml("div", { | |
"class": te.concatStr(this._TO_SEL_CLS + "-div", "gui-inline-block", "w400pc") | |
}, ab); | |
Z += gui.emitClearFloat(); | |
Z = gui.emitHtml("div", { | |
"class": this._CONTAINER_CLS | |
}, Z); | |
$(this._hashDivId).html(Z); | |
gui.fixTooltips(this._hashDivId); | |
te.emitOffScreenLabel(this._addBtnDivId, te.loc("L@S#2107")); | |
te.emitOffScreenLabel(this._removeBtnDivId, te.loc("L@S#2108")); | |
var aa = this; | |
$(this._hashDivId + " ." + this._ADD_BTN_CLS).click(function() { | |
aa._startMove() | |
}); | |
$(this._hashDivId + " ." + this._REMOVE_BTN_CLS).click(function() { | |
aa._startMove(false) | |
}); | |
if (this.opts.selSize != null) { | |
$(this._hashDivId + " ." + this._FROM_SEL_CLS).attr("size", this.opts.selSize); | |
$(this._hashDivId + " ." + this._TO_SEL_CLS).attr("size", this.opts.selSize) | |
} | |
}; | |
gui.DualSelectBox.prototype.isVisible = function() { | |
return $(this._hashDivId).is(":visible") | |
}; | |
gui.DualSelectBox.prototype.show = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashDivId).show() | |
} else { | |
$(this._hashDivId).hide() | |
} | |
}; | |
gui.DualSelectBox.prototype.isEnabled = function() { | |
return true | |
}; | |
gui.DualSelectBox.prototype.enable = function(X) {}; | |
gui.DualSelectBox.prototype.val = function(X) { | |
if (X !== undefined) { | |
var Y = this.opts.getFromToListFn.call(this, X); | |
this.fromList = Y.fromList; | |
this.toList = Y.toList; | |
this._update() | |
} | |
var Z = []; | |
$(this._hashDivId + " ." + this._TO_SEL_CLS).children().each(function(aa) { | |
Z.push($(this).val()) | |
}); | |
return Z | |
}; | |
gui.DualSelectBox.prototype.clearInfo = function() { | |
$(this._hashDivId + " ." + this._TO_SEL_CLS).removeClass(this._SEL_ERR_CLS) | |
}; | |
gui.DualSelectBox.prototype.validate = function() { | |
var X = this.val().length > 0; | |
if (!X) { | |
$(this._hashDivId + " ." + this._TO_SEL_CLS).addClass(this._SEL_ERR_CLS); | |
if (this.opts.errText) { | |
return this.opts.errText | |
} | |
} | |
return X | |
}; | |
gui.DualSelectBox.prototype._update = function() { | |
if ($.browser.msie7) { | |
$(this._hashDivId + " ." + this._FROM_SEL_CLS).css("width", "1px"); | |
$(this._hashDivId + " ." + this._TO_SEL_CLS).css("width", "1px") | |
} | |
t(this._hashDivId + " ." + this._FROM_SEL_CLS, this.fromList); | |
t(this._hashDivId + " ." + this._TO_SEL_CLS, this.toList); | |
if ($.browser.msie7) { | |
$(this._hashDivId + " ." + this._FROM_SEL_CLS).css("width", ""); | |
$(this._hashDivId + " ." + this._TO_SEL_CLS).css("width", "") | |
} | |
}; | |
gui.DualSelectBox.prototype._startMove = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (!X) { | |
this._move(this._hashDivId + " ." + this._TO_SEL_CLS, this.toList, this.fromList) | |
} else { | |
this._move(this._hashDivId + " ." + this._FROM_SEL_CLS, this.fromList, this.toList) | |
} | |
}; | |
gui.DualSelectBox.prototype._move = function(Y, aa, Z) { | |
$(Y).children().each(function(ab) { | |
if ($(this).attr("selected")) { | |
Z.push(aa[ab]); | |
aa[ab] = null | |
} | |
Z.sort(N) | |
}); | |
for (var X = 0; X < aa.length; ++X) { | |
if (aa[X] == null) { | |
aa.splice(X, 1); | |
--X | |
} | |
} | |
this._update() | |
}; | |
function T(Z) { | |
var Y = ""; | |
var X = Z.isSelectDivHorzScrollable ? "" : "w1000pc"; | |
Y = gui.emitHtml("select", { | |
"class": te.concatStr(Z.selectCls, X), | |
multiple: true | |
}, ""); | |
if (Z.isSelectDivHorzScrollable) { | |
Y = gui.emitHtml("div", { | |
"class": "gui-dual-select-box-horz-scroll" | |
}, Y) | |
} | |
return Y | |
} | |
gui.GeoLocPicker = function(X) { | |
X = $.fillIn(X, { | |
useStdStyle: true, | |
onBlur: this._removeInvalidVal, | |
onFocus: $.noop, | |
onKeyUp: this._keyUpHandler, | |
onKeyDown: this._keyDownHandler, | |
onKeyPress: this._keyPressHandler, | |
onClearInfo: $.noop, | |
onValidate: $.noop, | |
onValidateActions: [] | |
}); | |
this.opts = X | |
}; | |
gui.GeoLocPicker.prototype = new gui.BaseWidget({ | |
name: "GeoLocPicker" | |
}); | |
gui.GeoLocPicker.prototype._INPUT_CLS = "gui-geo-loc-picker-input"; | |
gui.GeoLocPicker.prototype._SELECT_CLS = "gui-geo-loc-picker-select"; | |
gui.GeoLocPicker.prototype._DIV_CLS = "gui-quad-box-div"; | |
gui.GeoLocPicker.prototype._INFO_CLS = "gui-quad-box-info"; | |
gui.GeoLocPicker.prototype._LABEL_ERR_CLS = "gui-input-field-label-err"; | |
gui.GeoLocPicker.prototype._ERR_CLS = "gui-quad-box-err"; | |
gui.GeoLocPicker.prototype._DISABLED_CLS = "gui-quad-box-disabled"; | |
gui.GeoLocPicker.prototype.create = function(ac) { | |
var ab = this; | |
var X = ["°", "′", "″"]; | |
this._inputDivId = ac + "-Inp"; | |
this._infoDivId = ac + "-Info"; | |
this._hashInputId = "#" + this._inputDivId; | |
this._hashDivId = "#" + ac; | |
var ad = ""; | |
var af = ""; | |
var Y; | |
if (ab.opts.isLongitude) { | |
Y = 3 | |
} else { | |
Y = 2 | |
} | |
if (ab.opts.title) { | |
ab.opts.title = te.loc(ab.opts.title) | |
} | |
var ae = ""; | |
for (var aa = 0; aa < 3; ++aa) { | |
ad += gui.emitHtml("input", { | |
id: this._inputDivId + aa, | |
name: this._inputDivId + "-name", | |
maxlength: Y, | |
type: "text", | |
disabled: d(this.opts.disabled), | |
"class": te.concatStr(this._INPUT_CLS, ae, this.opts.inputCls), | |
title: ab.opts.title | |
}); | |
ad += "<strong><sup>" + X[aa] + "</sup></strong>"; | |
Y = 2; | |
ae = "gui-horz-margin-50" | |
} | |
for (var Z = 0; Z < this.opts.optionArray.length; ++Z) { | |
af += gui.emitHtml("option", { | |
value: this.opts.optionArray[Z] | |
}, this.opts.optionArray[Z]) | |
} | |
ad += gui.emitHtml("select", { | |
id: this._inputDivId + aa, | |
name: this._inputDivId + "-name", | |
disabled: d(this.opts.disabled), | |
"class": te.concatStr(this._SELECT_CLS, this.opts.inputCls), | |
title: te.loc(ab.opts.title) | |
}, af); | |
if ($.browser.msie) { | |
ad = " " + ad | |
} | |
ad = gui.emitHtml("div", { | |
id: this._inputDivId, | |
"class": this._DIV_CLS | |
}, ad); | |
ad += gui.emitClearFloat(); | |
$("#" + ac).html(ad); | |
gui.fixTooltips("#" + ac); | |
if (ab.opts.useStdStyle) { | |
O(ab, "#" + ac) | |
} | |
this._name = "input:text[name=" + this._inputDivId + "-name]"; | |
$(this._name).blur(function() { | |
return ab.opts.onBlur.call(ab, this) | |
}).focus(function() { | |
return ab.opts.onFocus.call(ab, this) | |
}).keyup(function(ag) { | |
return ab.opts.onKeyUp.call(ab, this, ag) | |
}).keydown(function(ag) { | |
return ab.opts.onKeyDown.call(ab, this, ag) | |
}).keypress(function(ag) { | |
return ab.opts.onKeyPress.call(ab, this, ag) | |
}) | |
}; | |
gui.GeoLocPicker.prototype.isVisible = function() { | |
return $(this._hashDivId).is(":visible") | |
}; | |
gui.GeoLocPicker.prototype.show = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashDivId).show() | |
} else { | |
$(this._hashDivId).hide() | |
} | |
}; | |
gui.GeoLocPicker.prototype.val = function(Y) { | |
if (Y === null) { | |
Y = "" | |
} | |
var X = ["degrees", "minutes", "seconds", "direction"]; | |
if (Y != null) { | |
for (Z = 0; Z < 4; Z++) { | |
$(this._hashInputId + Z).val(Y[X[Z]]) | |
} | |
} | |
var aa = {}; | |
for (var Z = 0; Z < 4; ++Z) { | |
if ($(this._hashInputId + Z).val() != "") { | |
if (X[Z] != null && X[Z] != "direction") { | |
aa[X[Z]] = +$(this._hashInputId + Z).val() | |
} else { | |
aa[X[Z]] = $(this._hashInputId + Z).val() | |
} | |
} | |
} | |
return aa | |
}; | |
gui.GeoLocPicker.prototype.hasOnlyDirection = function(X) { | |
if (X.degrees == null && X.minutes == null && X.seconds == null) { | |
return true | |
} | |
return false | |
}; | |
gui.GeoLocPicker.prototype.setLinkedField = function(X) { | |
this.opts._valLinkedField = X | |
}; | |
gui.GeoLocPicker.prototype.validate = function() { | |
function X(ad) { | |
var ae = "L@S#2294"; | |
if (isNaN(aa)) { | |
$(ad._labelObj).addClass(ad._LABEL_ERR_CLS); | |
$(ad._hashDivId).addClass(ad._ERR_CLS); | |
return y(ad, "L@S#2290") | |
} else { | |
if (ad.opts.isLatitude) { | |
if (aa < -90 || aa > 90) { | |
$(ad._labelObj).addClass(ad._LABEL_ERR_CLS); | |
$(ad._hashDivId).addClass(ad._ERR_CLS); | |
return y(ad, ae) | |
} | |
} else { | |
if (aa < -180 || aa > 180) { | |
$(ad._labelObj).addClass(ad._LABEL_ERR_CLS); | |
$(ad._hashDivId).addClass(ad._ERR_CLS); | |
return y(ad, ae) | |
} | |
} | |
} | |
return true | |
} | |
var Y = this; | |
var ac; | |
var ab = Y.val(); | |
var aa = te.convertDMSToDecimalDegrees(ab); | |
var Z = Y.opts._valLinkedField.val(); | |
Z = te.convertDMSToDecimalDegrees(Z); | |
if (aa == "" && Z == "") { | |
return true | |
} else { | |
if (aa != "" && Z != "") { | |
return X(this) | |
} else { | |
ac = te.loc("L@S#2292"); | |
if (aa == "") { | |
$(Y._labelObj).addClass(Y._LABEL_ERR_CLS); | |
$(Y._hashDivId).addClass(Y._ERR_CLS); | |
Y.opts.onValidateActions.push("emptyCheck"); | |
W(Y); | |
return y(this, ac) | |
} else { | |
return X(this) | |
} | |
} | |
} | |
}; | |
gui.GeoLocPicker.prototype.isReqField = function() { | |
var Y = this; | |
if ($(Y._hashDivId).hasClass(Y._ERR_CLS)) { | |
for (var X = 0; X < Y.opts.onValidateActions.length; ++X) { | |
if (Y.opts.onValidateActions[X] == "emptyCheck") { | |
return true | |
} | |
} | |
} | |
return false | |
}; | |
gui.GeoLocPicker.prototype.clearInfo = function() { | |
$(this._labelObj).removeClass(this._LABEL_ERR_CLS); | |
$(this._hashDivId).removeClass(this._ERR_CLS); | |
$("#" + this._infoDivId).hide(); | |
W(this); | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.GeoLocPicker.prototype._keyPressHandler = function(aa, Z) { | |
var X; | |
if (window.event) { | |
X = Z.keyCode | |
} else { | |
if (Z.which) { | |
X = Z.which | |
} | |
} | |
var ab = String.fromCharCode(X); | |
var Y = /[a-zA-Z`~!@#$%^&\*\(\)_\-\+=\|\\\}\{\]\["':;\?\/>\.<,]/; | |
if (Y.test(ab)) { | |
return false | |
} | |
this._autoTab(aa, Z); | |
return true | |
}; | |
gui.GeoLocPicker.prototype._keyUpHandler = function(Y, X) { | |
this._removeInvalidVal(Y); | |
this._autoTab(Y, X) | |
}; | |
gui.GeoLocPicker.prototype._keyDownHandler = function(Y, X) { | |
if ($.browser.msie) { | |
this._autoTab(Y, X) | |
} | |
}; | |
gui.GeoLocPicker.prototype._removeInvalidVal = function(Y) { | |
var X = /[a-zA-Z`~!@#$%^&\*\(\)_\-\+=\|\\\}\{\]\["':;\?\/>\.<,]/; | |
if (X.test($(Y).val())) { | |
$(Y).val("") | |
} | |
}; | |
gui.GeoLocPicker.prototype._autoTab = function(aa, Z) { | |
var Y = this; | |
setTimeout(X, C); | |
function X() { | |
function ag(aj) { | |
var ai = $("#" + aj).val(); | |
$("#" + aj).val(""); | |
$("#" + aj).val(ai) | |
} | |
var ac; | |
if (window.event) { | |
ac = Z.keyCode | |
} else { | |
if (Z.which) { | |
ac = Z.which | |
} | |
} | |
if (ac == undefined) { | |
return | |
} | |
var ah = $(aa); | |
var ab = ah.attr("maxlength"); | |
var ad = $.trim(ah.val()); | |
if (ab == 3) { | |
if (+ad > 180) { | |
ad = 0 | |
} | |
} else { | |
var af = Y._inputDivId + "1"; | |
var ae = Y._inputDivId + "2"; | |
if (ah.attr("id") == af || ah.attr("id") == ae) { | |
if (+ad >= 60) { | |
ad = 0 | |
} | |
} else { | |
if (+ad > 90) { | |
ad = 0 | |
} | |
} | |
} | |
ah.val(ad); | |
if (ac == 8 && ad.length == 0) { | |
switch (ah.attr("id")) { | |
case Y._inputDivId + "1": | |
$("#" + Y._inputDivId + "0").focus(); | |
if ($.browser.mozilla) { | |
ag(Y._inputDivId + "0") | |
} | |
break; | |
case Y._inputDivId + "2": | |
$("#" + Y._inputDivId + "1").focus(); | |
if ($.browser.mozilla) { | |
ag(Y._inputDivId + "1") | |
} | |
break; | |
default: | |
break | |
} | |
} else { | |
if (ad.length == ab) { | |
switch (ac) { | |
case 8: | |
case 9: | |
case 16: | |
case 17: | |
case 18: | |
case 32: | |
case 33: | |
case 34: | |
case 35: | |
case 36: | |
case 37: | |
case 38: | |
case 39: | |
case 40: | |
case 46: | |
break; | |
default: | |
switch (ah.attr("id")) { | |
case Y._inputDivId + "0": | |
$("#" + Y._inputDivId + "1").focus(); | |
break; | |
case Y._inputDivId + "1": | |
$("#" + Y._inputDivId + "2").focus(); | |
break; | |
default: | |
break | |
} | |
break | |
} | |
} | |
} | |
} | |
}; | |
(function() { | |
var X = function(Y) { | |
this.opts = Y | |
}; | |
X.prototype = new gui.BaseWidget({ | |
name: "HorzSetTbl" | |
}); | |
X.prototype.create = function(ad) { | |
var ab = this; | |
var ac; | |
if (gui.isMobileBrowser()) { | |
ac = true | |
} | |
if (!ac) { | |
var Y = new gui.ListTbl(ab.opts); | |
Y.create(ad); | |
return | |
} | |
var aa = gui.mkQId(ad); | |
var Z; | |
if (ab.opts.getHdr) { | |
Z = ab.opts.getHdr.call(ab) | |
} | |
var ag = []; | |
var ae = 0; | |
while (true) { | |
ab.skip = false; | |
var af = this.opts.getData.call(ab, ae); | |
if (af == null) { | |
break | |
}++ae; | |
if (ab.skip) { | |
continue | |
} | |
ag.push(af) | |
} | |
$.each(ag, function(ah, al) { | |
var ak = $.hlp.getTmpDivId(); | |
$(aa).append(gui.emitHtml("div", { | |
id: ak | |
}, "")); | |
var ai = $.extend({}, ab.opts, ab.opts.mobileOpts || {}); | |
ai.getData = function(am) { | |
if (am == Z.length) { | |
return null | |
} | |
return [Z[am], al[am]] | |
}; | |
var aj = new gui.ListTbl(ai); | |
aj.create(ak) | |
}) | |
}; | |
X.prototype.val = function(Y) {}; | |
gui.HorzSetTbl = X | |
})(); | |
gui.InputField = function(X) { | |
X = $.extend({ | |
useStdStyle: true, | |
example: "", | |
onBlur: $.noop, | |
onClick: $.noop, | |
onFocus: $.noop, | |
onKeyPress: $.noop, | |
onKeyUp: $.noop, | |
onClearInfo: $.noop, | |
onValidate: $.noop, | |
onValidateActions: [], | |
userActions: {}, | |
userMsgs: {}, | |
useExampleTemplate: true | |
}, X); | |
if (X.infoMsg) { | |
if ($.typeOf(X.infoMsg) == "string") { | |
X.infoMsg = { | |
text: X.infoMsg | |
} | |
} | |
if (!X.infoMsg.showAlways && !X.infoMsg.showOnFocus) { | |
X.infoMsg.showOnErr = true | |
} | |
} | |
if (X.descMsg) { | |
if ($.typeOf(X.descMsg) == "string") { | |
X.descMsg = { | |
text: X.descMsg, | |
cls: "" | |
} | |
} | |
} | |
if (X.maxLength == null && X._valRange != null) { | |
X.maxLength = Math.max(String(X._valRange[0]).length, String(X._valRange[1]).length) | |
} | |
this.opts = X | |
}; | |
gui.InputField.prototype = new gui.BaseWidget({ | |
name: "InputField", | |
type: "text" | |
}); | |
gui.InputField.prototype._CLS = "gui-input-field text"; | |
gui.InputField.prototype._INFO_CLS = "gui-input-field-info"; | |
gui.InputField.prototype._LABEL_ERR_CLS = "gui-input-field-label-err"; | |
gui.InputField.prototype._ERR_CLS = "gui-input-field-err"; | |
gui.InputField.prototype._EXAMPLE_CLS = "gui-input-field-eg"; | |
gui.InputField.prototype._HIDDEN_CLS = "gui-hidden"; | |
gui.InputField.prototype._MOUSE_OVER_CLS = "gui-mouseover"; | |
gui.InputField.prototype.getDivId = function() { | |
return ($(this._hashDivId).hasClass(this._HIDDEN_CLS) && this.opts.example) ? this._hashDivId_eg : this._hashDivId | |
}; | |
gui.InputField.prototype.getShowDivId = function() { | |
return this._divId | |
}; | |
gui.InputField.prototype.create = function(Y) { | |
function ae() { | |
if (!ad.isFakeFilled()) { | |
return | |
} | |
ad.clearFakeFilled(); | |
ad.setFakeFilled(false); | |
if (ad.opts._valLinkedField && !ad.opts._editLinkedField) { | |
ad.opts._valLinkedField.clearFakeFilled(); | |
ad.opts._valLinkedField.setFakeFilled(false) | |
} | |
} | |
var ad = this; | |
ad._divId = Q(Y); | |
ad._inputDivId = z(Y) + "-Inp"; | |
ad._inputDivId_eg = z(Y) + "-Inp-eg"; | |
ad._infoDivId = z(Y) + "-Info"; | |
ad._hashDivId = Q(ad._inputDivId); | |
ad._hashDivId_eg = Q(ad._inputDivId_eg); | |
ad._attnNoteDivId = z(Y) + "-Attn"; | |
ad._descMsgDivId = z(Y) + "-Desc"; | |
if (ad.opts.maxLength <= 0) { | |
r(Y + ": maxLength " + ad.opts.maxLength) | |
} | |
if (ad.opts.title) { | |
ad.opts.title = te.loc(ad.opts.title) | |
} | |
var ab = ad.opts.isPw ? "gui-password" : ""; | |
var aa = ad.opts.disabled ? "disabled" : ""; | |
var ac = gui.emitHtml("input", { | |
id: ad._inputDivId, | |
type: ad.opts.isPw ? "password" : "text", | |
disabled: d(ad.opts.disabled), | |
readonly: L(ad.opts.readonly), | |
"class": te.concatStr(ad._CLS, ad.opts.mainCls, ab, aa), | |
maxlength: ad.opts.maxLength, | |
title: ad.opts.title | |
}); | |
if (ad.opts.example) { | |
ac += gui.emitHtml("input", { | |
id: ad._inputDivId_eg, | |
type: "text", | |
disabled: d(ad.opts.disabled), | |
readonly: L(ad.opts.readonly), | |
"class": te.concatStr(ad._CLS, ad.opts.mainCls, "gui-hidden"), | |
title: ad.opts.title | |
}) | |
} | |
if (ad.opts.extLabelCls) { | |
ad._labelObj = Q(ad.opts.extLabelCls, ".") | |
} | |
if (ad.opts.infoMsg) { | |
var X = ""; | |
ad.opts.infoMsg.text = te.loc(ad.opts.infoMsg.text); | |
if (ad.opts.infoMsg.showOnFocus) { | |
X = ad.opts.infoMsg.text | |
} else { | |
if (ad.opts.infoMsg.showTextAlways) { | |
X = ad.opts.infoMsg.text | |
} else { | |
if (ad.opts.infoMsg.showAlways || ad.opts.infoMsg.showOnErr) { | |
var Z = ad.opts.infoMsg.showAlways ? M : K; | |
X = gui.emitHtml("img", { | |
src: Z, | |
title: ad.opts.infoMsg.text, | |
alt: "" | |
}) | |
} | |
} | |
} | |
ac += gui.emitHtml("span", { | |
id: ad._infoDivId, | |
"class": ad._INFO_CLS | |
}, X) | |
} | |
if (ad.opts.attnNote) { | |
var X = ""; | |
X = gui.formatInfoNotes({ | |
img: ad.opts.attnNote.img, | |
msg: ad.opts.attnNote.parenthesize ? "(" + te.loc(ad.opts.attnNote.msg) + ")" : te.loc(ad.opts.attnNote.msg), | |
title: te.loc(ad.opts.attnNote.title), | |
addClass: ad.opts.attnNote.addClass | |
}); | |
ac += gui.emitHtml("div", { | |
id: ad._attnNoteDivId | |
}, X) | |
} | |
if (ad.opts.descMsg) { | |
ad.opts.descMsg.text = te.loc(ad.opts.descMsg.text); | |
ac += gui.emitHtml("div", { | |
id: ad._descMsgDivId, | |
"class": ad.opts.descMsg.cls | |
}, ad.opts.descMsg.text) | |
} | |
$(Q(Y)).html(ac); | |
gui.fixTooltips(Q(Y)); | |
if (ad.opts.useStdStyle) { | |
O(ad, Q(Y)) | |
} | |
$(ad._hashDivId).focus(function() { | |
if (ad.opts.infoMsg && ad.opts.infoMsg.showOnFocus) { | |
$(Q(ad._infoDivId)).show() | |
} | |
if ((gui.isTabletDevice() || gui.isMobileBrowser()) && ($.browser.chrome || $.browser.mozilla) && ad.isFakeFilled() && ad.opts._valLinkedField.isFakeFilled()) { | |
ad.clearFakeFilled(); | |
ad.opts._valLinkedField.clearFakeFilled() | |
} | |
return ad.opts.onFocus.call(ad, this) | |
}).blur(function() { | |
if (ad.opts.infoMsg && ad.opts.infoMsg.showOnFocus) { | |
$(Q(ad._infoDivId)).hide() | |
} | |
if (ad.isFakeFilled() && $(this).val() == "") { | |
ae() | |
} | |
return ad.opts.onBlur.call(ad, this) | |
}).click(function() { | |
return ad.opts.onClick.call(ad, this) | |
}).keydown(function(ah) { | |
var ag = ah.keyCode || ah.which; | |
var af = ad.isFakeFilled(); | |
if (ag == u || ag == j) { | |
ae() | |
} | |
if ((gui.isTabletDevice() || gui.isMobileBrowser()) && ($.browser.chrome || $.browser.mozilla) && ag == 0) { | |
ae() | |
} | |
if (ag == u && af) { | |
return false | |
} | |
}).keypress(function(ag) { | |
var af = ag.keyCode || ag.which; | |
if (af != I) { | |
ae() | |
} | |
if (ad.opts.isNumeric) { | |
if (!gui.isNumericKey(af) && !gui.isMovementKey(af)) { | |
return false | |
} | |
} | |
return ad.opts.onKeyPress.call(ad, this, ag) | |
}).keyup(function() { | |
return ad.opts.onKeyUp.call(ad, this) | |
}).hover(function(af) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass(ad._MOUSE_OVER_CLS) | |
} | |
}, function(af) { | |
$(this).removeClass(ad._MOUSE_OVER_CLS) | |
}); | |
$(ad._hashDivId_eg).focus(function() { | |
ad._hideExample(); | |
$(ad._hashDivId).focus() | |
}).click(function() { | |
ad._hideExample(); | |
$(ad._hashDivId).click() | |
}).keydown(function(af) { | |
ad._hideExample(); | |
$(ad._hashDivId).keydown() | |
}).keypress(function(af) { | |
ad._hideExample(); | |
$(ad._hashDivId).keypress() | |
}).hover(function(af) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass(ad._MOUSE_OVER_CLS) | |
} | |
}, function(af) { | |
$(this).removeClass(ad._MOUSE_OVER_CLS) | |
}) | |
}; | |
gui.InputField.prototype.val = function(X) { | |
if (X === null) { | |
X = "" | |
} | |
if (X != null) { | |
if (X == "" && this.opts.fakeFilled) { | |
this.setFakeFilled() | |
} else { | |
this._hideExample(); | |
$(this._hashDivId).val(X) | |
} | |
} | |
if (this.isFakeFilled()) { | |
return null | |
} else { | |
return $(this._hashDivId).val() | |
} | |
}; | |
gui.InputField.prototype.clearInfo = function() { | |
var X = this; | |
$(X._labelObj).removeClass(X._LABEL_ERR_CLS); | |
$(X._hashDivId).removeClass(X._ERR_CLS); | |
$(X._hashDivId_eg).removeClass(X._ERR_CLS); | |
if (X.opts.infoMsg && !X.opts.infoMsg.showAlways && !X.opts.infoMsg.showTextAlways) { | |
$(Q(X._infoDivId)).hide() | |
} | |
if (X.opts.useStdStyle) { | |
W(X) | |
} | |
X._showExample(); | |
X.opts.onClearInfo.call(X) | |
}; | |
gui.InputField.prototype.validate = function() { | |
function ae() { | |
var ai = ab.opts.onValidateActions; | |
var am = true; | |
var ag; | |
var af; | |
var ak; | |
for (var ah = 0; ah < ai.length; ++ah) { | |
var al = ai[ah]; | |
if ($.typeOf(al) == "object") { | |
var aj = te.getObjKeys(al); | |
ag = aj[0]; | |
af = al[aj[0]] | |
} else { | |
ag = ai[ah]; | |
af = null; | |
al = {} | |
} | |
if (ab.opts.userActions[ag]) { | |
ak = ab.opts.userActions[ag].call(ab, af, al) | |
} else { | |
if (ab._builtInActions[ag]) { | |
ak = ab._builtInActions[ag].call(ab, af, al) | |
} else { | |
v("gui.InputField: undefined action " + ag) | |
} | |
} | |
if (ak === true) { | |
return [null, undefined] | |
} | |
if (ak !== undefined) { | |
break | |
} | |
} | |
if (ak === undefined) { | |
ag = null | |
} | |
return [ag, ak] | |
} | |
var ab = this; | |
if (ab.isFakeFilled()) { | |
if ($.inArray("notNullCheck", ab.opts.onValidateActions) < 0) { | |
return true | |
} | |
} | |
var aa = ae(); | |
var ac = aa[0] == null; | |
var ad; | |
var Y; | |
var X = ab.opts.isByteLen !== undefined ? ab.opts.isByteLen : false; | |
if (ac && ab.opts.maxLength != null && X) { | |
if (te.encodeUtf8(ab.val()).length > ab.opts.maxLength) { | |
aa = ["maxLenCheck", "maxLen"]; | |
ac = false | |
} | |
} | |
if (!ac) { | |
var Z = aa[1]; | |
Y = aa[0]; | |
if (ab.opts.userMsgs[Z]) { | |
ad = ab.opts.userMsgs[Z] | |
} else { | |
if (ab._builtInMsgs[Z]) { | |
ad = ab._builtInMsgs[Z]; | |
if (Z == "outOfRange" && ab.opts._valRange) { | |
ad = te.loc(ad) + " (" + ab.opts._valRange[0] + "-" + ab.opts._valRange[1] + ")" | |
} | |
} else { | |
v("gui.InputField: undefined err " + Z) | |
} | |
} | |
if (ab.opts.infoMsg && ab.opts.infoMsg.showOnErr) { | |
$(Q(ab._infoDivId)).show() | |
} | |
} | |
aa = ab.opts.onValidate.call(ab, aa[0] == null, aa[0]); | |
if (aa !== undefined) { | |
if ($.typeOf(aa) == "string") { | |
ad = aa | |
} | |
ac &= aa | |
} | |
if (!ac) { | |
$(ab._labelObj).addClass(ab._LABEL_ERR_CLS); | |
ab._showExample(); | |
$(ab.getDivId()).addClass(ab._ERR_CLS); | |
if (Z == "empty") { | |
ab.opts.onValidateActions.push("emptyCheck") | |
} | |
if (ab.opts.useStdStyle) { | |
W(ab) | |
} | |
return y(ab, ad, Y) | |
} | |
return true | |
}; | |
gui.InputField.prototype.setLinkedField = function(X) { | |
this.opts._valLinkedField = X | |
}; | |
gui.InputField.prototype.isFakeFilled = function() { | |
return this.opts._isFakeFilled | |
}; | |
gui.InputField.prototype.setFakeFilled = function(Y) { | |
if (Y == null) { | |
Y = true | |
} | |
this.opts._isFakeFilled = Y; | |
if (Y) { | |
var X = "fakefilled"; | |
if (this.opts.maxLength != null && X.length > this.opts.maxLength) { | |
X = X.substring(0, this.opts.maxLength) | |
} | |
$(this._hashDivId).val(X) | |
} | |
}; | |
gui.InputField.prototype.clearFakeFilled = function() { | |
$(this._hashDivId).val("") | |
}; | |
gui.InputField.prototype._builtInActions = { | |
allowEmptyCheck: function(Y, X) { | |
if (this.val().length == 0) { | |
return true | |
} | |
}, | |
allowEmptyLinkedField: function() { | |
var X = $.trim(this.val()); | |
var Y = $.trim(this.opts._valLinkedField.val()); | |
if (Y == "" && X == "") { | |
return true | |
} else { | |
if (X == "" && Y != "") { | |
return "empty" | |
} | |
} | |
}, | |
checkLinked: function() { | |
if (this.val() != this.opts._valLinkedField.val()) { | |
return "notMatched" | |
} | |
}, | |
checkPrintableAscii: function(ab, X) { | |
var Y = this.val(); | |
for (var Z = 0; Z < Y.length; ++Z) { | |
var aa = Y.charCodeAt(Z); | |
if (aa < 32 || aa > 126) { | |
return "notPrintableAscii" | |
} | |
} | |
}, | |
decimalDegreeCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.match(/^[+\-]?[0-9]{1,3}\.[0-9]{3,6}$/) == null) { | |
return "notValid" | |
} | |
}, | |
disallowEmptyLinkedField: function() { | |
var X = $.trim(this.val()); | |
var Y = $.trim(this.opts._valLinkedField.val()); | |
if (X != "" && this.opts._valLinkedField.isFakeFilled()) { | |
return true | |
} else { | |
if (Y != "" && X != "") { | |
return true | |
} else { | |
if (X == "" || Y == "") { | |
return "invalidInput" | |
} | |
} | |
} | |
}, | |
emailAddrCheck: function(ad, Y) { | |
var aa = this.val(); | |
if (!aa.match(/^(.*)@(.*)$/)) { | |
return | |
} | |
var ac = RegExp.$1; | |
var Z = RegExp.$2; | |
if (!ac.match(/^(([a-zA-Z0-9!\\$&*-=^`|~#%'+?\/_{}]+)|(".+"))$/)) { | |
return "notValid" | |
} | |
var X; | |
if (Z.match(/^\[(.*)\]$/)) { | |
Z = RegExp.$1; | |
X = "ipV4V6Check" | |
} else { | |
X = "fqdnCheck" | |
} | |
var ab = { | |
val: function() { | |
return Z | |
} | |
}; | |
return this._builtInActions[X].call(ab, ad, Y) | |
}, | |
emptyCheck: function(Y, X) { | |
if (this.val().length == 0) { | |
return "empty" | |
} | |
}, | |
fqdnCheck: function(ab, Y) { | |
var aa = this.val().split("."); | |
var Z; | |
var X = true; | |
$.each(aa, function(ac, ad) { | |
if (ad.length < 1 || ad.length > 63) { | |
Z = "notValid"; | |
return false | |
} | |
if (ad.match(/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/) == null) { | |
Z = "notValid"; | |
return false | |
} | |
X &= !!ad.match(/^[0-9]+$/) | |
}); | |
if (X) { | |
return "notValid" | |
} else { | |
return Z | |
} | |
}, | |
hexCheck: function(Y, X) { | |
if (this.val().match(/^[0-9a-fA-F]+$/) == null) { | |
return "notMatched" | |
} | |
}, | |
hostnameCheck: function(Y, X) { | |
if (this._builtInActions.fqdnCheck.call(this, Y, X) != "notValid" || this._builtInActions.ipV4V6Check.call(this, Y, X) != "notValid") { | |
return true | |
} else { | |
return "notValid" | |
} | |
}, | |
hostnameOnlyCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.match(/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/) == null) { | |
return "notValid" | |
} | |
}, | |
httpUrlCheck: function(ad, X) { | |
var aa = this.val(); | |
if (!aa.match(/^https?:\/\/([a-zA-Z0-9.-]+|\[([0-9a-fA-F:.]+)\])(:([0-9]+))?(\/.*)?$/)) { | |
return "notValid" | |
} | |
var Z = RegExp.$2 || RegExp.$1; | |
var Y = RegExp.$4; | |
var ac = { | |
val: function() { | |
return Z | |
} | |
}; | |
var ab = this._builtInActions.fqdnCheck.call(ac, ad, X); | |
if (ab !== undefined && ab !== true) { | |
ab = this._builtInActions.ipV4V6Check.call(ac, ad, X) | |
} | |
if (ab !== undefined && ab !== true) { | |
return ab | |
} | |
if (Y !== "" && +Y > 65535) { | |
return "notValid" | |
} | |
}, | |
ipV4allowZeroOrEmptyCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.length == 0 || Y == "0.0.0.0") { | |
return | |
} | |
if (!te.isIPv4(Y)) { | |
return "notValid" | |
} | |
}, | |
ipV4Check: function(Z, X) { | |
var Y = this.val(); | |
if (!te.isIPv4(Y)) { | |
return "notValid" | |
} | |
}, | |
ipV4NotAllowZeroCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.length == 0 || Y == "0.0.0.0") { | |
return "notValid" | |
} | |
return this._builtInActions.ipV4Check.call(this, Z, X) | |
}, | |
ipV4V6Check: function(aa, X) { | |
var Y = this.val(); | |
var Z = te.isIPv4(Y); | |
if (Z === true) { | |
return Z | |
} | |
if (!te.isIPv6(Y)) { | |
return "notValid" | |
} | |
}, | |
ipV4V6LinkFieldCheck: function(aa, X) { | |
var Y = this.val(); | |
var Z = $.trim(this.opts._valLinkedField.val()); | |
if (!this.opts._valLinkedField.isEnabled()) { | |
Z = Y | |
} | |
if (te.isIPv4(Y)) { | |
if (te.isIPv4(Z)) { | |
return true | |
} else { | |
if (te.isIPv6(Z)) { | |
return "invalidIPAddressRange" | |
} else { | |
return "invalidIPAddress" | |
} | |
} | |
} else { | |
if (te.isIPv6(Y)) { | |
if (te.isIPv6(Z)) { | |
return true | |
} else { | |
if (te.isIPv4(Z)) { | |
return "invalidIPAddressRange" | |
} else { | |
return "invalidIPAddress" | |
} | |
} | |
} else { | |
return "invalidIPAddress" | |
} | |
} | |
}, | |
ipV4V6NetworkPrefixCheck: function(aa, X) { | |
var Z = this.val(); | |
var ab = $.trim(this.opts._valLinkedField.val()); | |
var Y; | |
if (te.isIPv4(ab)) { | |
return (Z >= 1 && Z <= 30) ? true : "invalidNetworkPrefix" | |
} else { | |
if (te.isIPv6(ab)) { | |
return (Z >= 1 && Z <= 127) ? true : "invalidNetworkPrefix" | |
} else { | |
return true | |
} | |
} | |
}, | |
ipV6Check: function(Z, X) { | |
var Y = this.val(); | |
if (!te.isIPv6(Y)) { | |
return "notValid" | |
} | |
}, | |
ldapAttrCheck: function(Y, X) { | |
if (this.val().match(/^[a-zA-Z][a-zA-Z0-9\-]*$/) == null) { | |
return "notValid" | |
} | |
}, | |
maxLenCheck: function(Y, X) { | |
Y = Y != null ? Y : this.opts._valMaxLen; | |
X = $.extend({ | |
err: "maxLen" | |
}, X); | |
if (this.val().length > Y) { | |
return X.err | |
} | |
}, | |
minLenCheck: function(Y, X) { | |
Y = Y != null ? Y : this.opts._valMinLen; | |
X = $.extend({ | |
err: "minLen" | |
}, X); | |
if (this.val().length < Y) { | |
return X.err | |
} | |
}, | |
netMaskCheck: function() { | |
var Y = this.val(); | |
var X = Y.split("."); | |
if (!te.isValidNetMask(X)) { | |
return "invalidNetMask" | |
} | |
}, | |
networkPathCheck: function(Y, X) { | |
if (this.val().match(/^\\\\[^\\]+\\[^\\].*$/) == null) { | |
return "invalidNetworkPath" | |
} | |
}, | |
networkPathHttpUrlCheck: function(Z, X) { | |
var Y = this._builtInActions.networkPathCheck.call(this, Z, X); | |
if (Y !== undefined && Y !== true) { | |
Y = this._builtInActions.httpUrlCheck.call(this, Z, X) | |
} | |
return Y | |
}, | |
networkRangeCheck: function() { | |
var X = this.val(); | |
var Z = this.opts.refIpAddr.val(); | |
var aa = this.opts.subnetMask.val(); | |
var Y = X.split("."); | |
Z = Z.split("."); | |
aa = aa.split("."); | |
var ab = te.networkRangeCheck({ | |
refIpAddr: Z, | |
netMask: aa, | |
hostIpAddr: Y | |
}); | |
if (!ab) { | |
return "outOfNetworkRange" | |
} | |
}, | |
notNullCheck: function(Y, X) { | |
if (this.val() === null) { | |
return "notValid" | |
} | |
}, | |
numericCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.match(/^[+-]?[0-9]*\.?[0-9]*$/) == null) { | |
return "numeric" | |
} else { | |
if (Y.match(/^[+-]?[0-9]+$/) == null) { | |
return "wholenum" | |
} | |
} | |
}, | |
numericFloatCheck: function(aa, Y) { | |
var X = false; | |
var Z = this.val(); | |
if (Z.match(/^[+-]?[0-9]*\.?[0-9]+$/) == null) { | |
return "numeric" | |
} else { | |
X = true | |
} | |
if (!X && Z.match(/^[+-]?[0-9]+$/) == null) { | |
return "wholenum" | |
} | |
}, | |
rangeCheck: function(Z, X) { | |
Z = Z != null ? Z : this.opts._valRange; | |
X = $.extend({ | |
err: "outOfRange" | |
}, X); | |
var Y = this.val(); | |
if (Y < Z[0] || Y > Z[1]) { | |
return X.err | |
} | |
}, | |
regExprCheck: function(Y, X) { | |
Y = Y != null ? Y : this.opts._valRegExpr; | |
X = $.extend({ | |
err: "regExpr" | |
}, X); | |
if (this.val().match(Y) == null) { | |
return X.err | |
} | |
}, | |
restrictedFilenameCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.match(/^[ \t]+$/)) { | |
return "notValid" | |
} | |
if (Y.match(/^\./)) { | |
return "notValid" | |
} | |
if (Y.match(/[\\\/<>?*:"|]/)) { | |
return "notValid" | |
} | |
}, | |
specificLenCheck: function(Y, X) { | |
Y = Y != null ? Y : this.opts._specificLen; | |
X = $.extend({ | |
err: "notLen" | |
}, X); | |
if (!$.isArray(Y)) { | |
Y = [Y] | |
} | |
if ($.inArray(this.val().length, Y) < 0) { | |
return X.err | |
} | |
}, | |
trim: function(Y, X) { | |
this.val($.trim(this.val())) | |
}, | |
wepCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.length == 5 || Y.length == 13) { | |
if (this._builtInActions.checkPrintableAscii.call(this, Z, X) == "notPrintableAscii") { | |
return "invalidPaswd" | |
} | |
} else { | |
if (Y.length == 10 || Y.length == 26) { | |
if (this._builtInActions.hexCheck.call(this, Z, X) == "notMatched") { | |
return "invalidPaswd" | |
} | |
} else { | |
return "invalidPaswd" | |
} | |
} | |
}, | |
wpaCheck: function(Z, X) { | |
var Y = this.val(); | |
if (Y.length > 7 && Y.length < 64) { | |
if (this._builtInActions.checkPrintableAscii.call(this, Z, X) == "notPrintableAscii") { | |
return "invalidPaswd" | |
} | |
} else { | |
if (Y.length == 64) { | |
if (this._builtInActions.hexCheck.call(this, Z, X) == "notMatched") { | |
return "invalidPaswd" | |
} | |
} else { | |
return "invalidPaswd" | |
} | |
} | |
} | |
}; | |
gui.InputField.prototype._builtInMsgs = { | |
empty: "L@S#2292", | |
invalidInput: "L@S#3129", | |
invalidIPAddress: "L@S#4518", | |
invalidIPAddressRange: "L@S#4517", | |
invalidNetMask: "L@S#2297", | |
invalidNetworkPath: "L@S#0369", | |
invalidNetworkPrefix: "L@S#4516", | |
invalidPaswd: "L@S#0339", | |
maxLen: "L@S#2731", | |
minLen: "L@S#2295", | |
notLen: "L@S#2296", | |
notMatched: "L@S#2293", | |
notPrintableAscii: "L@S#0369", | |
notValid: "L@S#0369", | |
numeric: "L@S#2290", | |
outOfNetworkRange: "L@S#2294", | |
outOfRange: "L@S#2294", | |
regExpr: "L@S#0369", | |
wholenum: "L@S#2910" | |
}; | |
gui.InputField.prototype.isReqField = function() { | |
var Y = this; | |
if (!Y.isVisible() || !Y.isEnabled()) { | |
return false | |
} | |
if ($(Y.getDivId()).hasClass(Y._ERR_CLS)) { | |
for (var X = 0; X < Y.opts.onValidateActions.length; ++X) { | |
if (Y.opts.onValidateActions[X] == "emptyCheck") { | |
return true | |
} | |
} | |
} | |
return false | |
}; | |
gui.InputField.prototype._showExample = function() { | |
var X = this; | |
var Z = X.opts.example; | |
if (Z && $(X._hashDivId).val() == "") { | |
var Y = te.concatStr("(", te.loc("L@S#3410", te.loc("L@S#3438"), te.loc(Z)), ")"); | |
if (!X.opts.useExampleTemplate) { | |
Y = te.loc(Z) | |
} | |
if (!$(X._hashDivId).hasClass(X._HIDDEN_CLS)) { | |
$(X._hashDivId).addClass(X._HIDDEN_CLS) | |
} | |
$(X._hashDivId_eg).removeClass(X._HIDDEN_CLS); | |
$(X._hashDivId_eg).val(Y); | |
if (!$(X._hashDivId_eg).hasClass(X._EXAMPLE_CLS)) { | |
$(X._hashDivId_eg).addClass(X._EXAMPLE_CLS) | |
} | |
$(X._hashDivId_eg).parent().siblings("label").attr("for", X._inputDivId_eg) | |
} | |
}; | |
gui.InputField.prototype._isExample = function() { | |
var X = this; | |
var Y = X.opts.example; | |
if (Y && $(X._hashDivId_eg).hasClass(X._EXAMPLE_CLS)) { | |
return true | |
} | |
return false | |
}; | |
gui.InputField.prototype._hideExample = function() { | |
var X = this; | |
var Y = X.opts.example; | |
if (Y && $(X._hashDivId_eg).hasClass(X._EXAMPLE_CLS)) { | |
$(X._hashDivId).removeClass(X._HIDDEN_CLS); | |
$(X._hashDivId).parent().siblings("label").attr("for", X._inputDivId); | |
if (!$(X._hashDivId_eg).hasClass(X._HIDDEN_CLS)) { | |
$(X._hashDivId_eg).addClass(X._HIDDEN_CLS) | |
} | |
if (gui.isTheatreLNF() && $(X._hashDivId_eg).hasClass(X._MOUSE_OVER_CLS)) { | |
$(X._hashDivId_eg).removeClass(X._MOUSE_OVER_CLS) | |
} | |
$(X._hashDivId_eg).removeClass(X._EXAMPLE_CLS) | |
} | |
}; | |
gui.IPv4QuadBox = function(X) { | |
X = $.fillIn(X, { | |
useStdStyle: true, | |
onBlur: this._blurHandler, | |
onFocus: $.noop, | |
onKeyUp: this._keyUpHandler, | |
onKeyDown: this._keyDownHandler, | |
onKeyPress: this._keyPressHandler, | |
onClearInfo: $.noop, | |
onValidate: $.noop | |
}); | |
this.opts = X | |
}; | |
gui.IPv4QuadBox.prototype = new gui.BaseWidget({ | |
name: "IPv4QuadBox", | |
type: "ipv4" | |
}); | |
gui.IPv4QuadBox.prototype._INPUT_CLS = "gui-quad-box-input"; | |
gui.IPv4QuadBox.prototype._DIV_CLS = "gui-quad-box-div"; | |
gui.IPv4QuadBox.prototype._INFO_CLS = "gui-quad-box-info"; | |
gui.IPv4QuadBox.prototype._LABEL_ERR_CLS = "gui-input-field-label-err"; | |
gui.IPv4QuadBox.prototype._ERR_CLS = "gui-quad-box-err"; | |
gui.IPv4QuadBox.prototype._DISABLED_CLS = "gui-quad-box-disabled"; | |
gui.IPv4QuadBox.prototype.create = function(X) { | |
var aa = this; | |
this._inputDivId = X + "-Inp"; | |
this._infoDivId = X + "-Info"; | |
this._hashInputId = "#" + this._inputDivId; | |
this._hashDivId = "#" + X; | |
var Z = ""; | |
if (aa.opts.title) { | |
aa.opts.title = te.loc(aa.opts.title) | |
} | |
for (var Y = 0; Y < 4; ++Y) { | |
if (Y > 0) { | |
Z += "<strong>.</strong>" | |
} | |
Z += gui.emitHtml("input", { | |
id: this._inputDivId + Y, | |
name: this._inputDivId + "-name", | |
maxlength: 3, | |
type: "text", | |
disabled: d(this.opts.disabled), | |
"class": te.concatStr(this._INPUT_CLS, this.opts.inputCls), | |
title: aa.opts.title | |
}) | |
} | |
if ($.browser.msie) { | |
Z = " " + Z | |
} | |
Z = gui.emitHtml("div", { | |
id: this._inputDivId, | |
"class": this._DIV_CLS | |
}, Z); | |
if (this.opts.createInfoDiv) { | |
Z += gui.emitHtml("span", { | |
id: this._infoDivId, | |
"class": this._INFO_CLS | |
}, "") | |
} | |
Z += gui.emitClearFloat(); | |
$("#" + X).html(Z); | |
gui.fixTooltips("#" + X); | |
if (aa.opts.useStdStyle) { | |
O(aa, "#" + X) | |
} | |
this._name = "input:text[name=" + this._inputDivId + "-name]"; | |
$(this._name).blur(function() { | |
return aa.opts.onBlur.call(aa, this) | |
}).focus(function() { | |
return aa.opts.onFocus.call(aa, this) | |
}).keyup(function(ab) { | |
return aa.opts.onKeyUp.call(aa, this, ab) | |
}).keydown(function(ab) { | |
return aa.opts.onKeyDown.call(aa, this, ab) | |
}).keypress(function(ab) { | |
return aa.opts.onKeyPress.call(aa, this, ab) | |
}) | |
}; | |
gui.IPv4QuadBox.prototype.isVisible = function() { | |
return $(this._hashDivId).is(":visible") | |
}; | |
gui.IPv4QuadBox.prototype.show = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashDivId).show() | |
} else { | |
$(this._hashDivId).hide() | |
} | |
}; | |
gui.IPv4QuadBox.prototype.isEnabled = function() { | |
return $(this._name).is(":enabled") | |
}; | |
gui.IPv4QuadBox.prototype.enable = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._name).removeAttr("disabled"); | |
$(this._name).removeClass(this._DISABLED_CLS) | |
} else { | |
$(this._name).attr("disabled", "disabled"); | |
$(this._name).addClass(this._DISABLED_CLS) | |
} | |
}; | |
gui.IPv4QuadBox.prototype.val = function(Y) { | |
if (Y === null) { | |
Y = "" | |
} | |
var aa = [], | |
X = ""; | |
if (Y != null) { | |
aa = Y.split("."); | |
for (Z = 0; Z < 4; Z++) { | |
$(this._hashInputId + Z).val(aa[Z]) | |
} | |
} | |
for (var Z = 0; Z < 4; ++Z) { | |
if ($(this._hashInputId + Z).val() != "") { | |
if (Z > 0) { | |
X += "." | |
} | |
X += "" + +$(this._hashInputId + Z).val() | |
} | |
} | |
return X | |
}; | |
gui.IPv4QuadBox.prototype.validate = function() { | |
var ae = this; | |
if (!ae.opts._valRegExpr) { | |
ae.opts._valRegExpr = /^((1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/ | |
} | |
var Z = ae.val(); | |
if (ae.opts.allowEmpty && Z == "") { | |
return true | |
} | |
var af = Z && Z.match(ae.opts._valRegExpr); | |
var aa; | |
if (af && Z == "0.0.0.0" && !ae.opts.allowZero) { | |
af = false | |
} | |
if (Z == "") { | |
aa = te.loc("L@S#2292"); | |
af = false | |
} else { | |
if (!af) { | |
aa = te.loc("L@S#0202") | |
} | |
} | |
if (af && ae.opts.isNetMask) { | |
var ab = []; | |
for (var ac = 0; ac < 4; ++ac) { | |
ab.push($(ae._hashInputId + ac).val()) | |
} | |
af = te.isValidNetMask(ab); | |
if (!af) { | |
aa = te.loc("L@S#2297") | |
} | |
} else { | |
if (af && ae.opts.isNetworkRange) { | |
var ad = []; | |
var ag = []; | |
var Y = []; | |
for (var ac = 0; ac < 4; ++ac) { | |
Y.push($(ae._hashInputId + ac).val()); | |
ad.push($(ae.opts.refIpAddr._hashInputId + ac).val()); | |
ag.push($(ae.opts.subnetMask._hashInputId + ac).val()) | |
} | |
af = te.networkRangeCheck({ | |
refIpAddr: ad, | |
netMask: ag, | |
hostIpAddr: Y | |
}); | |
if (!af) { | |
aa = "L@S#2294" | |
} | |
} | |
} | |
var X = ae.opts.onValidate.call(this, af); | |
if (X !== undefined) { | |
if ($.typeOf(X) == "string") { | |
aa = X | |
} | |
af &= X | |
} | |
if (!af) { | |
$(ae._labelObj).addClass(ae._LABEL_ERR_CLS); | |
$(ae._hashDivId).addClass(ae._ERR_CLS); | |
if (ae.opts.useStdStyle) { | |
W(ae) | |
} | |
return y(this, aa) | |
} | |
return true | |
}; | |
gui.IPv4QuadBox.prototype.isReqField = function() { | |
var Y = this; | |
if ($(Y._hashDivId).hasClass(Y._ERR_CLS)) { | |
for (var X = 0; X < Y.opts.onValidateActions.length; ++X) { | |
if (Y.opts.onValidateActions[X] == "emptyCheck") { | |
return true | |
} | |
} | |
} | |
return false | |
}; | |
gui.IPv4QuadBox.prototype.clearInfo = function() { | |
$(this._labelObj).removeClass(this._LABEL_ERR_CLS); | |
$(this._hashDivId).removeClass(this._ERR_CLS); | |
$("#" + this._infoDivId).hide(); | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.IPv4QuadBox.prototype._keyPressHandler = function(aa, Z) { | |
var X; | |
if (window.event) { | |
X = Z.keyCode | |
} else { | |
if (Z.which) { | |
X = Z.which | |
} | |
} | |
var ab = String.fromCharCode(X); | |
var Y = /[a-zA-Z`~!@#$%^&\*\(\)_\-\+=\|\\\}\{\]\["':;\?\/>\.<,]/; | |
if (Y.test(ab)) { | |
return false | |
} | |
this._autoTab(aa, Z); | |
return true | |
}; | |
gui.IPv4QuadBox.prototype._blurHandler = function(Y, X) { | |
this._removeInvalidVal(Y); | |
this._autoTab(Y, X) | |
}; | |
gui.IPv4QuadBox.prototype._keyUpHandler = function(Y, X) { | |
this._removeInvalidVal(Y); | |
this._autoTab(Y, X) | |
}; | |
gui.IPv4QuadBox.prototype._keyDownHandler = function(Y, X) { | |
if ($.browser.msie) { | |
this._autoTab(Y, X) | |
} | |
}; | |
gui.IPv4QuadBox.prototype._removeInvalidVal = function(Y) { | |
var X = /[a-zA-Z`~!@#$%^&\*\(\)_\-\+=\|\\\}\{\]\["':;\?\/>\.<,]/; | |
if (X.test($(Y).val())) { | |
$(Y).val("") | |
} | |
}; | |
gui.IPv4QuadBox.prototype._autoTab = function(aa, Z) { | |
var Y = this; | |
setTimeout(X, C); | |
function X() { | |
var ab = Z.keyCode || Z.which; | |
if (ab == undefined) { | |
return | |
} | |
var ad = $(aa); | |
var ac = $.trim(ad.val()); | |
if (+ac > 255) { | |
ac = 0 | |
} | |
ad.val(ac); | |
if (ab == 8 && ac.length == 0) { | |
switch (ad.attr("id")) { | |
case Y._inputDivId + "1": | |
$("#" + Y._inputDivId + "0").focus(); | |
break; | |
case Y._inputDivId + "2": | |
$("#" + Y._inputDivId + "1").focus(); | |
break; | |
case Y._inputDivId + "3": | |
$("#" + Y._inputDivId + "2").focus(); | |
break; | |
default: | |
break | |
} | |
} else { | |
if (ac.length == 3) { | |
switch (ab) { | |
case 8: | |
case 9: | |
case 16: | |
case 17: | |
case 18: | |
case 32: | |
case 33: | |
case 34: | |
case 35: | |
case 36: | |
case 37: | |
case 38: | |
case 39: | |
case 40: | |
case 46: | |
break; | |
default: | |
switch (ad.attr("id")) { | |
case Y._inputDivId + "0": | |
$("#" + Y._inputDivId + "1").focus(); | |
break; | |
case Y._inputDivId + "1": | |
$("#" + Y._inputDivId + "2").focus(); | |
break; | |
case Y._inputDivId + "2": | |
$("#" + Y._inputDivId + "3").focus(); | |
break; | |
default: | |
break | |
} | |
break | |
} | |
} | |
} | |
} | |
}; | |
gui.Radio = function(X) { | |
X = $.fillIn(X, { | |
useStdStyle: true, | |
isBlock: true, | |
descIndent: true, | |
onBlur: $.noop, | |
onClick: $.noop, | |
onFocus: $.noop, | |
onClearInfo: $.noop, | |
onValidate: V, | |
onValidateActions: [], | |
userActions: {}, | |
userMsgs: {} | |
}); | |
if (X.optionArray == null && te.isBoolValType(X.valType)) { | |
X.isBool = true | |
} | |
if (X.isBool && X.optionArray == null) { | |
X.optionArray = ["true", "false"] | |
} | |
this.opts = X | |
}; | |
gui.Radio.prototype = new gui.BaseWidget({ | |
name: "Radio" | |
}); | |
gui.Radio.prototype._LABEL_CLS = "gui-radio-label"; | |
gui.Radio.prototype._INPUT_CLS = "gui-radio-input"; | |
gui.Radio.prototype._SPAN_CLS = "gui-radio-span"; | |
gui.Radio.prototype._LABEL_ERR_CLS = "gui-input-field-label-err"; | |
gui.Radio.prototype.getDivId = function() { | |
return this._name | |
}; | |
gui.Radio.prototype.create = function(aa) { | |
var am = this; | |
var ah; | |
if (this.opts.inputId == null) { | |
this.opts.inputId = aj(aa) + "-Inp" | |
} | |
if ($.isArray(aa)) { | |
ah = aa.length; | |
this.opts.divId = aa | |
} else { | |
ah = 1; | |
this.opts.divId = [aa] | |
} | |
if (am.opts.radioGroupLabelCls) { | |
am._radioGroupLabelObj = Q(am.opts.radioGroupLabelCls, ".") | |
} | |
var af = ""; | |
var ai = 0; | |
var ag = this.opts.locMap || $.locMap.get(this.opts.jsField); | |
if (ag) { | |
al(ag); | |
for (var an in ag) { | |
if (ak(an)) { | |
var Y = this.opts.inputId + "_" + an; | |
var ab = gui.emitHtml("input", { | |
id: Y, | |
name: this.opts.inputId, | |
type: "radio", | |
disabled: d(this.opts.disabled), | |
"class": te.concatStr(this._INPUT_CLS, this.opts.inputCls), | |
value: an | |
}); | |
var ad = gui.emitHtml("span", { | |
"class": te.concatStr(this._SPAN_CLS, this.opts.spanCls, Y) | |
}, te.loc(ag[an].text)); | |
var Z; | |
if (ag[an].example) { | |
Z = gui.emitHtml("span", { | |
"class": te.concatStr("gui-format-infoNotes-font", "gui-radio-span") | |
}, te.loc(ag[an].example)) | |
} else { | |
Z = "" | |
} | |
var X = this._LABEL_CLS; | |
if (this.opts.isBlock) { | |
X += " gui-radio-block"; | |
X += " gui-block" | |
} | |
var ao = (ag[an].title != ag[an].text) ? ag[an].title : ""; | |
af += gui.emitHtml("label", { | |
"class": te.concatStr(X, this.opts.lblCls), | |
title: te.loc(ao) | |
}, ab + ad + Z); | |
if (this.opts.descCls || ag[an].desc != null) { | |
var ac = this.opts.descCls || ""; | |
var ae; | |
if (ag[an].desc) { | |
ae = te.loc(ag[an].desc) | |
} else { | |
ae = "" | |
} | |
af += gui.emitHtml("div", { | |
"class": te.concatStr(ac, ac + "-" + an, am.opts.descIndent ? "gui-indent-radio" : "gui-left-margin-31px") | |
}, ae); | |
if (ag[an].desc2) { | |
ae = te.loc(ag[an].desc2) | |
} else { | |
ae = "" | |
} | |
af += gui.emitHtml("div", { | |
"class": te.concatStr(ac, ac + "-" + an, am.opts.descIndent ? "gui-indent-radio" : "gui-left-margin-31px") | |
}, ae) | |
} | |
} | |
if (ah > 1) { | |
this._hashDivId = Q(this.opts.divId[ai++]); | |
$(this._hashDivId).html(af); | |
gui.fixTooltips(this._hashDivId); | |
af = ""; | |
--ah | |
} | |
} | |
this._hashDivId = Q(this.opts.divId[ai++]); | |
$(this._hashDivId).html(af); | |
gui.fixTooltips(this._hashDivId) | |
} | |
this._name = "input:radio[name=" + this.opts.inputId + "]"; | |
$(this._name).blur(function() { | |
return am.opts.onBlur.call(am, this) | |
}).click(function() { | |
am.clearInfo(); | |
return am.opts.onClick.call(am, this) | |
}).focus(function() { | |
return am.opts.onFocus.call(am, this) | |
}); | |
function aj(ap) { | |
if ($.isArray(ap)) { | |
return ap.join("_") | |
} else { | |
return ap | |
} | |
} | |
function al(ap) { | |
for (var aq in ap) { | |
var ar = ap[aq]; | |
if ($.typeOf(ar) == "string") { | |
ar = ap[aq] = { | |
text: ar | |
} | |
} | |
} | |
} | |
function ak(aq) { | |
for (var ap = 0; ap < am.opts.optionArray.length; ++ap) { | |
if (aq == am.opts.optionArray[ap]) { | |
return true | |
} | |
} | |
return false | |
} | |
}; | |
gui.Radio.prototype.val = function(X) { | |
if (X === null) { | |
X = this.opts.defaultValue || "" | |
} | |
if (X != null) { | |
if (this.opts.isBool) { | |
X = "" + X | |
} | |
$(this._name).val([X]) | |
} | |
X = $(this._name + ":checked").val(); | |
if (this.opts.isBool) { | |
return X == "true" | |
} else { | |
return X | |
} | |
}; | |
gui.Radio.prototype.clearInfo = function() { | |
var Z = this; | |
var Y; | |
for (var X = 0; X < Z.opts.optionArray.length; ++X) { | |
Y = Z.opts.optionArray[X]; | |
Z._labelObj = Z._radioGroupLabelObj || Q(Z.opts.inputId + "_" + Y, "."); | |
if ($(Z._labelObj).hasClass(Z._LABEL_ERR_CLS)) { | |
$(Z._labelObj).removeClass(Z._LABEL_ERR_CLS); | |
Z._labelObjHasErr = false | |
} | |
if (Z.opts.useStdStyle) { | |
Z._labelObjSingleMode = true; | |
W(Z); | |
Z._labelObjSingleMode = false | |
} | |
} | |
Z.opts.onClearInfo.call(Z) | |
}; | |
gui.Radio.prototype.validate = function() { | |
function ae() { | |
var ai = ab.opts.onValidateActions; | |
var am = true; | |
var ag; | |
var af; | |
var ak; | |
for (var ah = 0; ah < ai.length; ++ah) { | |
var al = ai[ah]; | |
if ($.typeOf(al) == "object") { | |
var aj = te.getObjKeys(al); | |
ag = aj[0]; | |
af = al[aj[0]] | |
} else { | |
ag = ai[ah]; | |
af = null; | |
al = {} | |
} | |
if (ab.opts.userActions[ag]) { | |
ak = ab.opts.userActions[ag].call(ab, af, al) | |
} else { | |
if (ab._builtInActions[ag]) { | |
ak = ab._builtInActions[ag].call(ab, af, al) | |
} else { | |
v("gui.Widget.Radio: undefined action " + ag) | |
} | |
} | |
if (ak === true) { | |
return [null, undefined] | |
} | |
if (ak !== undefined) { | |
break | |
} | |
} | |
if (ak === undefined) { | |
ag = null | |
} | |
return [ag, ak] | |
} | |
var ab = this; | |
var aa = ae(); | |
var ac = aa[0] == null; | |
var ad; | |
var X; | |
if (!ac) { | |
var Z = aa[1]; | |
X = aa[0]; | |
if (ab.opts.userMsgs[Z]) { | |
ad = ab.opts.userMsgs[Z] | |
} else { | |
if (ab._builtInMsgs[Z]) { | |
ad = ab._builtInMsgs[Z] | |
} else { | |
v("gui.Widget.Radio: undefined err " + Z) | |
} | |
} | |
} | |
aa = ab.opts.onValidate.call(ab, aa[0] == null, aa[0]); | |
if (aa !== undefined) { | |
if ($.typeOf(aa) == "string") { | |
ad = ab._builtInMsgs[aa] || aa | |
} | |
ac &= aa | |
} | |
if (!ac) { | |
var Y = $(ab._name + ":checked").val(); | |
ab._labelObj = ab._radioGroupLabelObj || Q(ab.opts.inputId + "_" + Y, "."); | |
$(ab._labelObj).addClass(ab._LABEL_ERR_CLS); | |
ab._labelObjHasErr = true; | |
if (ab.opts.useStdStyle) { | |
ab._labelObjSingleMode = true; | |
W(ab); | |
ab._labelObjSingleMode = false | |
} | |
return y(ab, ad, null) | |
} | |
return aa | |
}; | |
gui.Radio.prototype.getLabelCls = function(X) { | |
return this.opts.inputId + "_" + X | |
}; | |
gui.Radio.prototype._builtInActions = { | |
emptyCheck: function(Y, X) { | |
if (this.val() === undefined) { | |
return "emptyCheck" | |
} | |
} | |
}; | |
gui.Radio.prototype._builtInMsgs = { | |
emptyCheck: "L@S#2292", | |
error: "L@S#0561" | |
}; | |
gui.Radio.prototype.isReqField = function() { | |
var Z = this; | |
if (!Z.isVisible() || !Z.isEnabled()) { | |
return false | |
} | |
if (Z._labelObjSingleMode == undefined) { | |
Z._labelObjSingleMode = false | |
} | |
var Y = $(Z._name + ":checked").val(); | |
var aa = Z._labelObjSingleMode; | |
if (!aa || (Z._labelObjHasErr && ((aa && Z._labelObj == Q(this.opts.inputId + "_" + Y, ".")) || Z._radioGroupLabelObj !== undefined))) { | |
for (var X = 0; X < Z.opts.onValidateActions.length; ++X) { | |
if (Z.opts.onValidateActions[X] == "emptyCheck") { | |
return true | |
} | |
} | |
} | |
return false | |
}; | |
gui.Slider = function(X) { | |
this.opts = X | |
}; | |
gui.Slider.prototype = new gui.BaseWidget({ | |
name: "Slider" | |
}); | |
gui.Slider.prototype._CLS = "gui-slider-cls"; | |
gui.Slider.prototype._VAL_CLS = "gui-slider-val-cls"; | |
gui.Slider.prototype.create = function(ae) { | |
var X = this; | |
var ac = te.isLangRTL(te.getDisplayLang()); | |
if (this.opts.divId == null) { | |
this.opts.divId = z(ae) | |
} | |
this._sliderDivId = this.opts.divId + "-Div"; | |
if (this.opts.valId == null) { | |
this.opts.valId = this._sliderDivId + "-Val" | |
} | |
this._hashDivId = "#" + this.opts.divId; | |
var af = gui.emitHtml("div", { | |
id: this._sliderDivId, | |
"class": te.concatStr(this._CLS, this.opts.mainCls), | |
title: te.loc(this.opts.title) | |
}, "<div class='ui-slider-inside'></div><div class='ui-slider-handle'></div>"); | |
if (this.opts.minMaxImages) { | |
var Y = gui.emitHtml("div", { | |
"class": "gui-slider-cls-img-min gui-top-margin-30" | |
}, gui.emitHtml("img", { | |
src: this.opts.minMaxImages[0] | |
})); | |
var ab = gui.emitHtml("div", { | |
"class": "gui-slider-cls-img-max" | |
}, gui.emitHtml("img", { | |
src: this.opts.minMaxImages[1] | |
})); | |
if (ac) { | |
af = ab + gui.emitHtml("div", { | |
"class": "gui-slider-cls-div gui-slider-cls-marker gui-top-margin-30 gui-horz-margin-100" | |
}, af) + Y | |
} else { | |
af = Y + gui.emitHtml("div", { | |
"class": "gui-slider-cls-div gui-slider-cls-marker gui-top-margin-30 gui-horz-margin-100" | |
}, af) + ab | |
} | |
if (this.opts.sliderValues) { | |
this.opts.min = 0; | |
this.opts.max = this.opts.sliderValues.length - 1; | |
this.opts.step = 1 | |
} | |
} else { | |
if (this.opts.endText) { | |
var aa = gui.emitHtml("div", { | |
"class": this.opts.valCls | |
}, te.loc(this.opts.endText[0])); | |
var ad = gui.emitHtml("div", { | |
"class": this.opts.valCls | |
}, te.loc(this.opts.endText[1])); | |
af = gui.emitHtml("div", { | |
"class": "gui-slider-cls-div" | |
}, af); | |
af += gui.emitClearFloat(); | |
if (ac) { | |
af += ad + aa | |
} else { | |
af += aa + ad | |
} | |
$(this._hashDivId).addClass("gui-ie-set-layout") | |
} else { | |
af = gui.emitHtml("div", { | |
"class": "gui-slider-cls-div" | |
}, af); | |
af += gui.emitHtml("input", { | |
id: this.opts.valId, | |
name: this.opts.valId, | |
readonly: true, | |
type: "text", | |
"class": te.concatStr(this._VAL_CLS, this.opts.valCls) | |
}) | |
} | |
} | |
$(this._hashDivId).html(af); | |
gui.fixTooltips(this._hashDivId); | |
if (this.opts.markerImg) { | |
$(".gui-slider-cls-marker").css({ | |
"background-image": "url(" + this.opts.markerImg + ")" | |
}) | |
} | |
if (this.opts.value == null) { | |
this.opts.value = this.opts.min | |
} else { | |
if (this.opts.sliderValues) { | |
for (var Z = this.opts.min; Z < this.opts.max; Z++) { | |
if (this.opts.value == this.opts.sliderValues[Z]) { | |
this.opts.value = Z | |
} | |
} | |
} | |
} | |
$("#" + this._sliderDivId).slider({ | |
animate: false, | |
min: this.opts.min, | |
max: this.opts.max, | |
startValue: this.opts.value, | |
steps: (this.opts.max - this.opts.min) / (this.opts.step > 0 ? this.opts.step : 1), | |
slide: function(ah, ag) { | |
$(".ui-slider-inside", $(this)).css({ | |
width: $(".ui-slider-handle", $(this)).css("left") | |
}); | |
$(".ui-slider-handle", $(this)).parent().attr("aria-valuenow", ag.value); | |
if (X.opts.valId) { | |
$("#" + X.opts.valId).val(ag.value) | |
} | |
}, | |
change: function(ah, ag) { | |
if (X.opts.valId) { | |
$("#" + X.opts.valId).val(ag.value) | |
} | |
$(".ui-slider-inside", $(this)).css({ | |
width: $(".ui-slider-handle", $(this)).css("left") | |
}); | |
$(".ui-slider-handle", $(this)).parent().attr("aria-valuenow", ag.value); | |
if (X.opts.onChange) { | |
return X.opts.onChange.call(X, this, ah, ag) | |
} | |
} | |
}); | |
if (this.opts.width) { | |
$("#" + this._sliderDivId).width(this.opts.width) | |
} | |
}; | |
gui.Slider.prototype.isVisible = function() { | |
return $(this._hashDivId).is(":visible") | |
}; | |
gui.Slider.prototype.show = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$(this._hashDivId).slideDown(200) | |
} else { | |
$(this._hashDivId).slideUp(200) | |
} | |
}; | |
gui.Slider.prototype.isEnabled = function() { | |
return !($("#" + this._sliderDivId).hasClass("ui-slider-disabled")) | |
}; | |
gui.Slider.prototype.enable = function(X) { | |
if (X == null) { | |
X = true | |
} | |
if (X) { | |
$("#" + this._sliderDivId).slider("enable") | |
} else { | |
$("#" + this._sliderDivId).slider("disable") | |
} | |
}; | |
gui.Slider.prototype.val = function(X) { | |
if (X === null) { | |
X = "" | |
} | |
var Y = this; | |
if (X != null && Y.opts.valId) { | |
if (Y.opts.sliderValues) { | |
X = $.inArray(X, Y.opts.sliderValues) | |
} | |
setTimeout(function() { | |
$("#" + Y._sliderDivId).slider("moveTo", X) | |
}, 100); | |
$("#" + Y.opts.valId).val(X) | |
} | |
var Z = $("#" + Y._sliderDivId).slider("value"); | |
if (Y.opts.sliderValues) { | |
Z = Y.opts.sliderValues[Z] | |
} | |
return Z | |
}; | |
gui.Slider.prototype.onShowTouchup = function() { | |
$("#" + this._sliderDivId).slider("moveTo", $("#" + this.opts.valId).val()) | |
}; | |
gui.Slider.prototype.setTooltip = function(X) { | |
$("#" + this._sliderDivId).attr("title", X); | |
gui.fixTooltips(this._hashDivId) | |
}; | |
(function() { | |
var X = function(Y) { | |
this.opts = Y | |
}; | |
X.prototype = new gui.BaseWidget({ | |
name: "TableBar" | |
}); | |
X.prototype.create = function(aj) { | |
var ah = this; | |
var ag = gui.mkQId(aj); | |
var ae = !!ah.opts.paginateOpts; | |
var af = !!ah.opts.toolbarList; | |
var ad; | |
var al; | |
var ac; | |
var Y; | |
var ab = $.hlp.getTmpDivId(); | |
var Z = ""; | |
if (ae) { | |
ad = $.hlp.getTmpDivId(); | |
Z += gui.emitHtml("div", { | |
id: ad, | |
"class": "gui-pagination-cls-" + ad + " gui-pagination-bar gui-pagination-bar-top" | |
}, "") | |
} | |
if (af) { | |
ac = $.hlp.getTmpDivId(); | |
Z += gui.emitHtml("div", { | |
id: ac | |
}, "") | |
} | |
Z += gui.emitHtml("div", { | |
id: ab | |
}, ""); | |
if (af) { | |
Y = $.hlp.getTmpDivId(); | |
Z += gui.emitHtml("div", { | |
id: Y | |
}, "") | |
} | |
if (ae) { | |
al = $.hlp.getTmpDivId(); | |
Z += gui.emitHtml("div", { | |
id: al, | |
"class": "gui-pagination-cls-" + ad + " gui-pagination-bar gui-pagination-bar-btm" | |
}, "") | |
} | |
$(ag).html(Z); | |
var ai = { | |
enableTick: true, | |
fixedLayout: ah.opts.fixedLayout, | |
forceSort: ae, | |
getHdr: function() { | |
var am = ah.opts.getHdr.call(ah); | |
if ($.isArray(am)) { | |
if (ah.opts.implicitTick) { | |
am.unshift({ | |
type: "tick", | |
widthCls: "w20", | |
title: "L@S#1590" | |
}) | |
} | |
if (ah.opts.implicitEdit) { | |
am.push({ | |
text: "", | |
widthCls: "w50" | |
}) | |
} | |
} | |
return am | |
}, | |
getData: function(am) { | |
var ao = ah.opts.getData.call(ah, am); | |
if ($.isArray(ao)) { | |
if (ah.opts.implicitTick) { | |
ao.unshift({ | |
type: "tick", | |
title: "L@S#0894" | |
}) | |
} | |
if (ah.opts.implicitEdit) { | |
var an = te.loc("L@S#1127"); | |
ao.push({ | |
html: gui.emitHtml("a", { | |
href: "#", | |
"class": "gui-list-tbl-edit-link", | |
title: an | |
}, an) | |
}) | |
} | |
} | |
return ao | |
}, | |
onTick: function(am) { | |
if (ah.opts.updateToolbar) { | |
ah.opts.updateToolbar.call(ah, ah.toolbar) | |
} | |
}, | |
onTickAll: function() { | |
if (ah.opts.updateToolbar) { | |
ah.opts.updateToolbar.call(ah, ah.toolbar) | |
} | |
} | |
}; | |
if (!ah.opts.getHdr) { | |
delete ai.getHdr | |
} | |
ah.listTbl = new gui.ListTbl(ai); | |
ah.listTbl.create(ab); | |
if (ah.opts.implicitEdit) { | |
$(gui.mkQId(ab) + " .gui-list-tbl-edit-link").each(function(am) { | |
$(this).click(function(an) { | |
an.preventDefault(); | |
ah.opts.handleEdit.call(ah, am) | |
}) | |
}) | |
} | |
if (af) { | |
var aa = { | |
list: ah.opts.toolbarList, | |
onClick: function(ap, ao) { | |
function am(aq) { | |
if (aq) { | |
ah.opts.handleMultiSelect.call(ah, an) | |
} | |
} | |
if (ao == "new" && ah.opts.handleEdit) { | |
ah.opts.handleEdit.call(ah) | |
} else { | |
if (ao == ah.opts.multiSelectCmd) { | |
var an = ah.listTbl.getTickedRowsIdx(); | |
if (an.length == 0) { | |
return | |
} | |
if (ah.opts.confirmMultiSelect) { | |
ah.opts.confirmMultiSelect.call(ah, an, am) | |
} else { | |
am(true) | |
} | |
} else { | |
return ah.opts.handleToolbar.call(ah, ap, ao) | |
} | |
} | |
} | |
}; | |
ah.toolbar = new gui.CommandBtns(aa); | |
ah.toolbar.create(ac); | |
ah.toolbar.create(Y); | |
ah.opts.updateToolbar.call(ah, ah.toolbar) | |
} | |
if (ah.opts.paginateOpts) { | |
var ak = $.extend({}, ah.opts.paginateOpts); | |
if (ak.size == null) { | |
ak.size = ak.rowsPerPage | |
} | |
if (ak.titlePageArray) { | |
ak.titlePageArray = $.map(ak.titlePageArray, function(an, am) { | |
return te.loc(an) | |
}) | |
} | |
ak.container = ".gui-pagination-cls-" + ad; | |
ah.listTbl.paginate(ak) | |
} | |
}; | |
X.prototype.val = function(Y) {}; | |
gui.TableBar = X | |
})(); | |
(function() { | |
gui.TextArea = function(Y) { | |
Y = $.fillIn(Y, { | |
onBlur: $.noop, | |
onChange: $.noop, | |
onFocus: $.noop, | |
onKeyPress: $.noop, | |
onClearInfo: $.noop, | |
onValidate: V | |
}); | |
this.opts = Y | |
}; | |
gui.TextArea.prototype = new gui.BaseWidget({ | |
name: "TextArea" | |
}); | |
gui.TextArea.prototype._CLS = "gui-textarea text"; | |
gui.TextArea.prototype._MOUSE_OVER_CLS = "gui-mouseover"; | |
gui.TextArea.prototype.getDivId = function() { | |
return this._hashInputId | |
}; | |
gui.TextArea.prototype.create = function(Y) { | |
function ab() { | |
var ac = aa.val(); | |
var ad = ac.length; | |
if (aa.opts.maxLength && ad > aa.opts.maxLength) { | |
aa.val(ac.substring(0, aa.opts.maxLength)) | |
} | |
} | |
var aa = this; | |
this._inputId = Y + "-Inp"; | |
this._hashInputId = "#" + this._inputId; | |
var Z = gui.emitHtml("textarea", { | |
id: this._inputId, | |
"class": te.concatStr(this._CLS, this.opts.mainCls), | |
title: te.loc(this.opts.title), | |
disabled: d(aa.opts.disabled), | |
rows: this.opts.rows, | |
cols: this.opts.cols, | |
readonly: L(aa.opts.readonly) | |
}, ""); | |
$("#" + Y).html(Z); | |
gui.fixTooltips("#" + Y); | |
$(this._hashInputId).blur(function() { | |
return aa.opts.onBlur.call(aa, this) | |
}).change(function() { | |
ab(); | |
return aa.opts.onChange.call(aa, this) | |
}).focus(function() { | |
return aa.opts.onFocus.call(aa, this) | |
}).keypress(function(ad) { | |
if (aa.opts.maxLength && $(aa._hashInputId).val().length >= aa.opts.maxLength) { | |
if (X($(aa._hashInputId)).length > 0) { | |
return true | |
} | |
var ac = ad.keyCode || ad.which; | |
if (!gui.isMovementKey(ac)) { | |
return false | |
} | |
} | |
return aa.opts.onKeyPress.call(aa, this, ad) | |
}).keyup(function(ac) { | |
ab() | |
}).hover(function(ac) { | |
if (!$(this).hasClass("disabled")) { | |
$(this).addClass(aa._MOUSE_OVER_CLS) | |
} | |
}, function(ac) { | |
$(this).removeClass(aa._MOUSE_OVER_CLS) | |
}).bind("paste", function(ac) { | |
setTimeout(function() { | |
ab() | |
}, 100) | |
}); | |
if (aa.opts.disabled) { | |
aa.enable(false) | |
} | |
}; | |
gui.TextArea.prototype.val = function(Y) { | |
if (Y === null) { | |
Y = "" | |
} | |
if (Y != null) { | |
if ($.browser.webkit) { | |
if (Y == "") { | |
Y = " " | |
} | |
} | |
$(this._hashInputId).val(Y) | |
} | |
return $.trim($(this._hashInputId).val()) | |
}; | |
gui.TextArea.prototype.clearInfo = function() { | |
var Y = this; | |
if (Y.opts.infoMsg && !Y.opts.infoMsg.showAlways) { | |
$("#" + Y._infoDivId).hide() | |
} | |
this.opts.onClearInfo.call(this) | |
}; | |
gui.TextArea.prototype.validate = function() { | |
return this.opts.onValidate.call(this) | |
}; | |
function X(aa) { | |
var ab = aa.get(0); | |
if (ab.selectionStart != null) { | |
if (ab.selectionStart != ab.selectionEnd) { | |
return ab.value.substring(ab.selectionStart, ab.selectionEnd) | |
} | |
} else { | |
if (document.selection.createRange) { | |
var Z = document.selection.createRange(); | |
var Y = Z.parentElement(); | |
if (Y === ab) { | |
return Z.text | |
} | |
} | |
} | |
return "" | |
} | |
})(); | |
gui.TimeWidget = function(X) { | |
X = $.fillIn(X, { | |
onBlur: $.noop, | |
onChange: $.noop, | |
onFocus: $.noop, | |
onClearInfo: $.noop, | |
onValidate: $.noop, | |
onValidateActions: [], | |
userActions: {}, | |
userMsgs: {} | |
}); | |
this.opts = X | |
}; | |
gui.TimeWidget.prototype = new gui.BaseWidget({ | |
name: "TimeWidget", | |
type: "time" | |
}); | |
gui.TimeWidget.prototype._CLS = "gui-dropdownboxselect-cls"; | |
gui.TimeWidget.prototype._LABEL_ERR_CLS = "gui-input-field-label-err"; | |
gui.TimeWidget.prototype._ERR_CLS = "gui-input-field-err"; | |
gui.TimeWidget.prototype.MIN_SEC_OptionArray = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"]; | |
gui.TimeWidget.prototype.getHrOptionArray = function(X) { | |
if (X == "HR24") { | |
return ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"] | |
} else { | |
return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"] | |
} | |
}; | |
gui.TimeWidget.prototype.TIME_12_24_MAPPING = { | |
"01": "13", | |
"02": "14", | |
"03": "15", | |
"04": "16", | |
"05": "17", | |
"06": "18", | |
"07": "19", | |
"08": "20", | |
"09": "21", | |
"10": "22", | |
"11": "23", | |
"12": "00" | |
}; | |
gui.TimeWidget.prototype.AM_TI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment