if (typeof jQuery == "undefined") { (function (window, undefined) { var rootjQuery, readyList, document = window.document, location = window.location, navigator = window.navigator, _jQuery = window.jQuery, _$ = window.$, core_push = Array.prototype.push, core_slice = Array.prototype.slice, core_indexOf = Array.prototype.indexOf, core_toString = Object.prototype.toString, core_hasOwn = Object.prototype.hasOwnProperty, core_trim = String.prototype.trim, jQuery = function (selector, context) { return new jQuery .fn .init(selector, context, rootjQuery); }, core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, core_rnotwhite = /\S/, core_rspace = /\s+/, rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, fcamelCase = function (all, letter) { return (letter + "").toUpperCase(); }, DOMContentLoaded = function () { if (document.addEventListener) { document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false); jQuery.ready(); } else if (document.readyState === "complete") { document.detachEvent("onreadystatechange", DOMContentLoaded); jQuery.ready(); } }, class2type = {}; jQuery.fn = jQuery.prototype = { constructor: jQuery, each : function (callback, args) { return jQuery.each(this, callback, args); }, end : function () { return this.prevObject || this.constructor(null); }, eq : function (i) { i = +i; return i === -1 ? this.slice(i) : this.slice(i, i + 1); }, first : function () { return this.eq(0); }, get : function (num) { return num == null ? this.toArray() : (num < 0 ? this[this.length + num] : this[num]); }, init : function (selector, context, rootjQuery) { var match, elem, ret, doc; if (!selector) { return this; } if (selector.nodeType) { this.context = this[0] = selector; this.length = 1; return this; } if (typeof selector === "string") { if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) { match = [null, selector, null]; } else { match = rquickExpr.exec(selector); } if (match && (match[1] || !context)) { if (match[1]) { context = context instanceof jQuery ? context[0] : context; doc = (context && context.nodeType ? context.ownerDocument || context : document); selector = jQuery.parseHTML(match[1], doc, true); if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) { this .attr .call(selector, context, true); } return jQuery.merge(this, selector); } else { elem = document.getElementById(match[2]); if (elem && elem.parentNode) { if (elem.id !== match[2]) { return rootjQuery.find(selector); } this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } } else if (!context || context.jquery) { return (context || rootjQuery).find(selector); } else { return this .constructor(context) .find(selector); } } else if (jQuery.isFunction(selector)) { return rootjQuery.ready(selector); } if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray(selector, this); }, jquery : "1.8.2", last : function () { return this.eq(-1); }, length : 0, map : function (callback) { return this.pushStack(jQuery.map(this, function (elem, i) { return callback.call(elem, i, elem); })); }, push : core_push, pushStack : function (elems, name, selector) { var ret = jQuery.merge(this.constructor(), elems); ret.prevObject = this; ret.context = this.context; if (name === "find") { ret.selector = this.selector + (this.selector ? " " : "") + selector; } else if (name) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } return ret; }, ready : function (fn) { jQuery .ready .promise() .done(fn); return this; }, selector : "", size : function () { return this.length; }, slice : function () { return this.pushStack(core_slice.apply(this, arguments), "slice", core_slice.call(arguments).join(",")); }, sort : [].sort, splice : [].splice, toArray : function () { return core_slice.call(this); } }; jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function () { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; if (typeof target === "boolean") { deep = target; target = arguments[1] || {}; i = 2; } if (typeof target !== "object" && !jQuery.isFunction(target)) { target = {}; } if (length === i) { target = this; i -= 1; } for (; i < length; i += 1) { if ((options = arguments[i]) != null) { for (name in options) { src = target[name]; copy = options[name]; if (target === copy) { continue; } if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } target[name] = jQuery.extend(deep, clone, copy); } else if (copy !== undefined) { target[name] = copy; } } } } return target; }; jQuery.extend({ access : function (elems, fn, key, value, chainable, emptyGet, pass) { var exec, bulk = key == null, i = 0, length = elems.length; if (key && typeof key === "object") { for (i in key) { jQuery.access(elems, fn, i, key[i], 1, emptyGet, value); } chainable = 1; } else if (value !== undefined) { exec = pass === undefined && jQuery.isFunction(value); if (bulk) { if (exec) { exec = fn; fn = function (elem, key, value) { return exec.call(jQuery(elem), value); }; } else { fn.call(elems, value); fn = null; } } if (fn) { for (; i < length; i += 1) { fn(elems[i], key, exec ? value.call(elems[i], i, fn(elems[i], key)) : value, pass); } } chainable = 1; } return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet; }, camelCase : function (string) { return string .replace(rmsPrefix, "ms-") .replace(rdashAlpha, fcamelCase); }, each : function (obj, callback, args) { var name, i = 0, length = obj.length, isObj = length === undefined || jQuery.isFunction(obj); if (args) { if (isObj) { for (name in obj) { if (callback.apply(obj[name], args) === false) { break; } } } else { for (; i < length;) { if (callback.apply(obj[i++], args) === false) { break; } } } } else { if (isObj) { for (name in obj) { if (callback.call(obj[name], name, obj[name]) === false) { break; } } } else { for (; i < length;) { if (callback.call(obj[i], i, obj[i++]) === false) { break; } } } } return obj; }, error : function (msg) { throw new Error(msg); }, globalEval : function (data) { if (data && core_rnotwhite.test(data)) { (window.execScript || function (data) { window["eval"].call(window, data); })(data); } }, grep : function (elems, callback, inv) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; for (; i < length; i += 1) { retVal = !!callback(elems[i], i); if (inv !== retVal) { ret.push(elems[i]); } } return ret; }, guid : 1, holdReady : function (hold) { if (hold) { jQuery.readyWait += 1; } else { jQuery.ready(true); } }, inArray : function (elem, arr, i) { var len; if (arr) { if (core_indexOf) { return core_indexOf.call(arr, elem, i); } len = arr.length; i = i ? i < 0 ? Math.max(0, len + i) : i : 0; for (; i < len; i += 1) { if (i in arr && arr[i] === elem) { return i; } } } return -1; }, isArray : Array.isArray || function (obj) { return jQuery.type(obj) === "array"; }, isEmptyObject: function (obj) { var name; for (name in obj) { return false; } return true; }, isFunction : function (obj) { return jQuery.type(obj) === "function"; }, isNumeric : function (obj) { return !isNaN(parseFloat(obj)) && isFinite(obj); }, isPlainObject: function (obj) { if (!obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) { return false; } try { if (obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) { return false; } } catch (e) { return false; } var key; for (key in obj) {} return key === undefined || core_hasOwn.call(obj, key); }, isReady : false, isWindow : function (obj) { return obj != null && obj == obj.window; }, makeArray : function (arr, results) { var type, ret = results || []; if (arr != null) { type = jQuery.type(arr); if (arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow(arr)) { core_push.call(ret, arr); } else { jQuery.merge(ret, arr); } } return ret; }, map : function (elems, callback, arg) { var value, key, ret = [], i = 0, length = elems.length, isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ((length > 0 && elems[0] && elems[length - 1]) || length === 0 || jQuery.isArray(elems)); if (isArray) { for (; i < length; i += 1) { value = callback(elems[i], i, arg); if (value != null) { ret[ret.length] = value; } } } else { for (key in elems) { value = callback(elems[key], key, arg); if (value != null) { ret[ret.length] = value; } } } return ret .concat .apply([], ret); }, merge : function (first, second) { var l = second.length, i = first.length, j = 0; if (typeof l === "number") { for (; j < l; j += 1) { first[i++] = second[j]; } } else { while (second[j] !== undefined) { first[i++] = second[j++]; } } first.length = i; return first; }, noConflict : function (deep) { if (window.$ === jQuery) { window.$ = _$; } if (deep && window.jQuery === jQuery) { window.jQuery = _jQuery; } return jQuery; }, nodeName : function (elem, name) { return elem.nodeName && elem .nodeName .toLowerCase() === name.toLowerCase(); }, noop : function () {}, now : function () { return (new Date()).getTime(); }, parseHTML : function (data, context, scripts) { var parsed; if (!data || typeof data !== "string") { return null; } if (typeof context === "boolean") { scripts = context; context = 0; } context = context || document; if ((parsed = rsingleTag.exec(data))) { return [context.createElement(parsed[1])]; } parsed = jQuery.buildFragment([data], context, scripts ? null : []); return jQuery.merge([], (parsed.cacheable ? jQuery.clone(parsed.fragment) : parsed.fragment).childNodes); }, parseJSON : function (data) { if (!data || typeof data !== "string") { return null; } data = jQuery.trim(data); if (window.JSON && window.JSON.parse) { return window .JSON .parse(data); } if (rvalidchars.test(data.replace(rvalidescape, "@").replace(rvalidtokens, "]").replace(rvalidbraces, ""))) { return (new Function("return " + data))(); } jQuery.error("Invalid JSON: " + data); }, parseXML : function (data) { var xml, tmp; if (!data || typeof data !== "string") { return null; } try { if (window.DOMParser) { tmp = new DOMParser(); xml = tmp.parseFromString(data, "text/xml"); } else { xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = "false"; xml.loadXML(data); } } catch (e) { xml = undefined; } if (!xml || !xml.documentElement || xml.getElementsByTagName("parsererror").length) { jQuery.error("Invalid XML: " + data); } return xml; }, proxy : function (fn, context) { var tmp, args, proxy; if (typeof context === "string") { tmp = fn[context]; context = fn; fn = tmp; } if (!jQuery.isFunction(fn)) { return undefined; } args = core_slice.call(arguments, 2); proxy = function () { return fn.apply(context, args.concat(core_slice.call(arguments))); }; proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, ready : function (wait) { if (wait === true ? --jQuery.readyWait : jQuery.isReady) { return; } if (!document.body) { return setTimeout(jQuery.ready, 1); } jQuery.isReady = true; if (wait !== true && --jQuery.readyWait > 0) { return; } readyList.resolveWith(document, [jQuery]); if (jQuery.fn.trigger) { jQuery(document) .trigger("ready") .off("ready"); } }, readyWait : 1, trim : core_trim && !core_trim.call("\uFEFF\xA0") ? function (text) { return text == null ? "" : core_trim.call(text); } : function (text) { return text == null ? "" : (text + "").replace(rtrim, ""); }, type : function (obj) { return obj == null ? String(obj) : class2type[core_toString.call(obj)] || "object"; } }); jQuery.ready.promise = function (obj) { if (!readyList) { readyList = jQuery.Deferred(); if (document.readyState === "complete") { setTimeout(jQuery.ready, 1); } else if (document.addEventListener) { document.addEventListener("DOMContentLoaded", DOMContentLoaded, false); window.addEventListener("load", jQuery.ready, false); } else { document.attachEvent("onreadystatechange", DOMContentLoaded); window.attachEvent("onload", jQuery.ready); var top = false; try { top = window.frameElement == null && document.documentElement; } catch (e) {} if (top && top.doScroll) { (function doScrollCheck() { if (!jQuery.isReady) { try { top.doScroll("left"); } catch (e) { return setTimeout(doScrollCheck, 50); } jQuery.ready(); } })(); } } } return readyList.promise(obj); }; jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (i, name) { class2type["[object " + name + "]"] = name.toLowerCase(); }); rootjQuery = jQuery(document); var optionsCache = {}; function createOptions(options) { var object = optionsCache[options] = {}; jQuery.each(options.split(core_rspace), function (_, flag) { object[flag] = true; }); return object; } jQuery.Callbacks = function (options) { options = typeof options === "string" ? (optionsCache[options] || createOptions(options)) : jQuery.extend({}, options); var memory, fired, firing, firingStart, firingLength, firingIndex, list = [], stack = !options.once && [], fire = function (data) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for (; list && firingIndex < firingLength; firingIndex += 1) { if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) { memory = false; break; } } firing = false; if (list) { if (stack) { if (stack.length) { fire(stack.shift()); } } else if (memory) { list = []; } else { self.disable(); } } }, self = { add : function () { if (list) { var start = list.length; (function add(args) { jQuery.each(args, function (_, arg) { var type = jQuery.type(arg); if (type === "function" && (!options.unique || !self.has(arg))) { list.push(arg); } else if (arg && arg.length && type !== "string") { add(arg); } }); })(arguments); if (firing) { firingLength = list.length; } else if (memory) { firingStart = start; fire(memory); } } return this; }, disable : function () { list = stack = memory = undefined; return this; }, disabled: function () { return !list; }, empty : function () { list = []; return this; }, fire : function () { self.fireWith(this, arguments); return this; }, fired : function () { return !!fired; }, fireWith: function (context, args) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if (list && (!fired || stack)) { if (firing) { stack.push(args); } else { fire(args); } } return this; }, has : function (fn) { return jQuery.inArray(fn, list) > -1; }, lock : function () { stack = undefined; if (!memory) { self.disable(); } return this; }, locked : function () { return !stack; }, remove : function () { if (list) { jQuery.each(arguments, function (_, arg) { var index; while ((index = jQuery.inArray(arg, list, index)) > -1) { list.splice(index, 1); if (firing) { if (index <= firingLength) { firingLength -= 1; } if (index <= firingIndex) { firingIndex -= 1; } } } }); } return this; } }; return self; }; jQuery.extend({ Deferred: function (func) { var tuples = [ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { always : function () { deferred .done(arguments) .fail(arguments); return this; }, promise: function (obj) { return obj != null ? jQuery.extend(obj, promise) : promise; }, state : function () { return state; }, then : function () { var fns = arguments; return jQuery .Deferred(function (newDefer) { jQuery.each(tuples, function (i, tuple) { var action = tuple[0], fn = fns[i]; deferred[tuple[1]](jQuery.isFunction(fn) ? function () { var returned = fn.apply(this, arguments); if (returned && jQuery.isFunction(returned.promise)) { returned .promise() .done(newDefer.resolve) .fail(newDefer.reject) .progress(newDefer.notify); } else { newDefer[action + "With"](this === deferred ? newDefer : this, [returned]); } } : newDefer[action]); }); fns = null; }) .promise(); } }, deferred = {}; promise.pipe = promise.then; jQuery.each(tuples, function (i, tuple) { var list = tuple[2], stateString = tuple[3]; promise[tuple[1]] = list.add; if (stateString) { list.add(function () { state = stateString; }, tuples[i ^ 1][2].disable, tuples[2][2].lock); } deferred[tuple[0]] = list.fire; deferred[tuple[0] + "With"] = list.fireWith; }); promise.promise(deferred); if (func) { func.call(deferred, deferred); } return deferred; }, when : function (subordinate) { var i = 0, resolveValues = core_slice.call(arguments), length = resolveValues.length, remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0, deferred = remaining === 1 ? subordinate : jQuery.Deferred(), updateFunc = function (i, contexts, values) { return function (value) { contexts[i] = this; values[i] = arguments.length > 1 ? core_slice.call(arguments) : value; if (values === progressValues) { deferred.notifyWith(contexts, values); } else if (!(remaining -= 1)) { deferred.resolveWith(contexts, values); } }; }, progressValues, progressContexts, resolveContexts; if (length > 1) { progressValues = [length]; progressContexts = [length]; resolveContexts = [length]; for (; i < length; i += 1) { if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) { resolveValues[i] .promise() .done(updateFunc(i, resolveContexts, resolveValues)) .fail(deferred.reject) .progress(updateFunc(i, progressContexts, progressValues)); } else { remaining -= 1; } } } if (!remaining) { deferred.resolveWith(resolveContexts, resolveValues); } return deferred.promise(); } }); jQuery.support = (function () { var support, all, a, select, opt, input, fragment, eventName, i, isSupported, clickFn, div = document.createElement("div"); div.setAttribute("className", "t"); div.innerHTML = "
a"; all = div.getElementsByTagName("*"); a = div.getElementsByTagName("a")[0]; a.style.cssText = "top:1px;float:left;opacity:.5"; if (!all || !all.length) { return {}; } select = document.createElement("select"); opt = select.appendChild(document.createElement("option")); input = div.getElementsByTagName("input")[0]; support = { boxModel : (document.compatMode === "CSS1Compat"), boxSizingReliable : true, changeBubbles : true, checkOn : (input.value === "on"), cssFloat : !!a.style.cssFloat, deleteExpando : true, enctype : !!document .createElement("form") .enctype, focusinBubbles : false, getSetAttribute : div.className !== "t", hrefNormalized : (a.getAttribute("href") === "/a"), html5Clone : document .createElement("nav") .cloneNode(true) .outerHTML !== "<:nav>", htmlSerialize : !!div .getElementsByTagName("link") .length, inlineBlockNeedsLayout: false, leadingWhitespace : (div.firstChild.nodeType === 3), noCloneEvent : true, opacity : /^0.5/.test(a.style.opacity), optSelected : opt.selected, pixelPosition : false, reliableMarginRight : true, shrinkWrapBlocks : false, style : /top/.test(a.getAttribute("style")), submitBubbles : true, tbody : !div .getElementsByTagName("tbody") .length }; input.checked = true; support.noCloneChecked = input .cloneNode(true) .checked; select.disabled = true; support.optDisabled = !opt.disabled; try { delete div.test; } catch (e) { support.deleteExpando = false; } if (!div.addEventListener && div.attachEvent && div.fireEvent) { div.attachEvent("onclick", clickFn = function () { support.noCloneEvent = false; }); div .cloneNode(true) .fireEvent("onclick"); div.detachEvent("onclick", clickFn); } input = document.createElement("input"); input.value = "t"; input.setAttribute("type", "radio"); support.radioValue = input.value === "t"; input.setAttribute("checked", "checked"); input.setAttribute("name", "t"); div.appendChild(input); fragment = document.createDocumentFragment(); fragment.appendChild(div.lastChild); support.checkClone = fragment .cloneNode(true) .cloneNode(true) .lastChild .checked; support.appendChecked = input.checked; fragment.removeChild(input); fragment.appendChild(div); if (div.attachEvent) { for (i in {change: true, focusin: true, submit: true}) { eventName = "on" + i; isSupported = (eventName in div); if (!isSupported) { div.setAttribute(eventName, "return;"); isSupported = (typeof div[eventName] === "function"); } support[i + "Bubbles"] = isSupported; } } jQuery(function () { var container, div, tds, marginDiv, divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", body = document.getElementsByTagName("body")[0]; if (!body) { return; } container = document.createElement("div"); container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1" + "px"; body.insertBefore(container, body.firstChild); div = document.createElement("div"); container.appendChild(div); div.innerHTML = "
t
"; tds = div.getElementsByTagName("td"); tds[0].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = (tds[0].offsetHeight === 0); tds[0].style.display = ""; tds[1].style.display = "none"; support.reliableHiddenOffsets = isSupported && (tds[0].offsetHeight === 0); div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box" + ";padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolut" + "e;top:1%;"; support.boxSizing = (div.offsetWidth === 4); support.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== 1); if (window.getComputedStyle) { support.pixelPosition = (window.getComputedStyle(div, null) || {}).top !== "1%"; support.boxSizingReliable = (window.getComputedStyle(div, null) || { width: "4px" }).width === "4px"; marginDiv = document.createElement("div"); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; div.appendChild(marginDiv); support.reliableMarginRight = !parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight); } if (typeof div.style.zoom !== "undefined") { div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = (div.offsetWidth === 3); div.style.display = "block"; div.style.overflow = "visible"; div.innerHTML = "
"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = (div.offsetWidth !== 3); container.style.zoom = 1; } body.removeChild(container); container = div = tds = marginDiv = null; }); fragment.removeChild(div); all = a = select = opt = input = fragment = div = null; return support; })(); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; jQuery.extend({ _data : function (elem, name, data) { return jQuery.data(elem, name, data, true); }, acceptData: function (elem) { var noData = elem.nodeName && jQuery.noData[ elem .nodeName .toLowerCase() ]; return !noData || noData !== true && elem.getAttribute("classid") === noData; }, cache : {}, data : function (elem, name, data, pvt) { if (!jQuery.acceptData(elem)) { return; } var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", isNode = elem.nodeType, cache = isNode ? jQuery.cache : elem, id = isNode ? elem[internalKey] : elem[internalKey] && internalKey; if ((!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined) { return; } if (!id) { if (isNode) { elem[internalKey] = id = jQuery .deletedIds .pop() || jQuery.guid++; } else { id = internalKey; } } if (!cache[id]) { cache[id] = {}; if (!isNode) { cache[id].toJSON = jQuery.noop; } } if (typeof name === "object" || typeof name === "function") { if (pvt) { cache[id] = jQuery.extend(cache[id], name); } else { cache[id].data = jQuery.extend(cache[id].data, name); } } thisCache = cache[id]; if (!pvt) { if (!thisCache.data) { thisCache.data = {}; } thisCache = thisCache.data; } if (data !== undefined) { thisCache[jQuery.camelCase(name)] = data; } if (getByName) { ret = thisCache[name]; if (ret == null) { ret = thisCache[jQuery.camelCase(name)]; } } else { ret = thisCache; } return ret; }, deletedIds: [], expando : "jQuery" + (jQuery.fn.jquery + Math.random()).replace(/\D/g, ""), hasData : function (elem) { elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando]; return !!elem && !isEmptyDataObject(elem); }, noData : { "applet": true, "embed" : true, "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, removeData: function (elem, name, pvt) { if (!jQuery.acceptData(elem)) { return; } var thisCache, i, l, isNode = elem.nodeType, cache = isNode ? jQuery.cache : elem, id = isNode ? elem[jQuery.expando] : jQuery.expando; if (!cache[id]) { return; } if (name) { thisCache = pvt ? cache[id] : cache[id].data; if (thisCache) { if (!jQuery.isArray(name)) { if (name in thisCache) { name = [name]; } else { name = jQuery.camelCase(name); if (name in thisCache) { name = [name]; } else { name = name.split(" "); } } } for (i = 0, l = name.length; i < l; i += 1) { delete thisCache[name[i]]; } if (!(pvt ? isEmptyDataObject : jQuery.isEmptyObject)(thisCache)) { return; } } } if (!pvt) { delete cache[id].data; if (!isEmptyDataObject(cache[id])) { return; } } if (isNode) { jQuery.cleanData([elem], true); } else if (jQuery.support.deleteExpando || cache != cache.window) { delete cache[id]; } else { cache[id] = null; } }, uuid : 0 }); jQuery .fn .extend({ data : function (key, value) { var parts, part, attr, name, l, elem = this[0], i = 0, data = null; if (key === undefined) { if (this.length) { data = jQuery.data(elem); if (elem.nodeType === 1 && !jQuery._data(elem, "parsedAttrs")) { attr = elem.attributes; for (l = attr.length; i < l; i += 1) { name = attr[i].name; if (!name.indexOf("data-")) { name = jQuery.camelCase(name.substring(5)); dataAttr(elem, name, data[name]); } } jQuery._data(elem, "parsedAttrs", true); } } return data; } if (typeof key === "object") { return this.each(function () { jQuery.data(this, key); }); } parts = key.split(".", 2); parts[1] = parts[1] ? "." + parts[1] : ""; part = parts[1] + "!"; return jQuery.access(this, function (value) { if (value === undefined) { data = this.triggerHandler("getData" + part, [parts[0]]); if (data === undefined && elem) { data = jQuery.data(elem, key); data = dataAttr(elem, key, data); } return data === undefined && parts[1] ? this.data(parts[0]) : data; } parts[1] = value; this.each(function () { var self = jQuery(this); self.triggerHandler("setData" + part, parts); jQuery.data(this, key, value); self.triggerHandler("changeData" + part, parts); }); }, null, value, arguments.length > 1, null, false); }, removeData: function (key) { return this.each(function () { jQuery.removeData(this, key); }); } }); function dataAttr(elem, key, data) { if (data === undefined && elem.nodeType === 1) { var name = "data-" + key .replace(rmultiDash, "-$1") .toLowerCase(); data = elem.getAttribute(name); if (typeof data === "string") { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data; } catch (e) {} jQuery.data(elem, key, data); } else { data = undefined; } } return data; } function isEmptyDataObject(obj) { var name; for (name in obj) { if (name === "data" && jQuery.isEmptyObject(obj[name])) { continue; } if (name !== "toJSON") { return false; } } return true; } jQuery.extend({ _queueHooks: function (elem, type) { var key = type + "queueHooks"; return jQuery._data(elem, key) || jQuery._data(elem, key, { empty: jQuery .Callbacks("once memory") .add(function () { jQuery.removeData(elem, type + "queue", true); jQuery.removeData(elem, key, true); }) }); }, dequeue : function (elem, type) { type = type || "fx"; var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function () { jQuery.dequeue(elem, type); }; if (fn === "inprogress") { fn = queue.shift(); startLength -= 1; } if (fn) { if (type === "fx") { queue.unshift("inprogress"); } delete hooks.stop; fn.call(elem, next, hooks); } if (!startLength && hooks) { hooks .empty .fire(); } }, queue : function (elem, type, data) { var queue; if (elem) { type = (type || "fx") + "queue"; queue = jQuery._data(elem, type); if (data) { if (!queue || jQuery.isArray(data)) { queue = jQuery._data(elem, type, jQuery.makeArray(data)); } else { queue.push(data); } } return queue || []; } } }); jQuery .fn .extend({ clearQueue: function (type) { return this.queue(type || "fx", []); }, delay : function (time, type) { time = jQuery.fx ? jQuery .fx .speeds[time] || time : time; type = type || "fx"; return this.queue(type, function (next, hooks) { var timeout = setTimeout(next, time); hooks.stop = function () { clearTimeout(timeout); }; }); }, dequeue : function (type) { return this.each(function () { jQuery.dequeue(this, type); }); }, promise : function (type, obj) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function () { if (!(count -= 1)) { defer.resolveWith(elements, [elements]); } }; if (typeof type !== "string") { obj = type; type = undefined; } type = type || "fx"; while (i--) { tmp = jQuery._data(elements[i], type + "queueHooks"); if (tmp && tmp.empty) { count += 1; tmp .empty .add(resolve); } } resolve(); return defer.promise(obj); }, queue : function (type, data) { var setter = 2; if (typeof type !== "string") { data = type; type = "fx"; setter -= 1; } if (arguments.length < setter) { return jQuery.queue(this[0], type); } return data === undefined ? this : this.each(function () { var queue = jQuery.queue(this, type, data); jQuery._queueHooks(this, type); if (type === "fx" && queue[0] !== "inprogress") { jQuery.dequeue(this, type); } }); } }); var nodeHook, boolHook, fixSpecified, rclass = /[\t\r\n]/g, rreturn = /\r/g, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, rclickable = /^a(?:rea|)$/i, rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute; jQuery .fn .extend({ addClass : function (value) { var classNames, i, l, elem, setClass, c, cl; if (jQuery.isFunction(value)) { return this.each(function (j) { jQuery(this).addClass(value.call(this, j, this.className)); }); } if (value && typeof value === "string") { classNames = value.split(core_rspace); for (i = 0, l = this.length; i < l; i += 1) { elem = this[i]; if (elem.nodeType === 1) { if (!elem.className && classNames.length === 1) { elem.className = value; } else { setClass = " " + elem.className + " "; for (c = 0, cl = classNames.length; c < cl; c += 1) { if (setClass.indexOf(" " + classNames[c] + " ") < 0) { setClass += classNames[c] + " "; } } elem.className = jQuery.trim(setClass); } } } } return this; }, attr : function (name, value) { return jQuery.access(this, jQuery.attr, name, value, arguments.length > 1); }, hasClass : function (selector) { var className = " " + selector + " ", i = 0, l = this.length; for (; i < l; i += 1) { if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) { return true; } } return false; }, prop : function (name, value) { return jQuery.access(this, jQuery.prop, name, value, arguments.length > 1); }, removeAttr : function (name) { return this.each(function () { jQuery.removeAttr(this, name); }); }, removeClass: function (value) { var removes, className, elem, c, cl, i, l; if (jQuery.isFunction(value)) { return this.each(function (j) { jQuery(this).removeClass(value.call(this, j, this.className)); }); } if ((value && typeof value === "string") || value === undefined) { removes = (value || "").split(core_rspace); for (i = 0, l = this.length; i < l; i += 1) { elem = this[i]; if (elem.nodeType === 1 && elem.className) { className = (" " + elem.className + " ").replace(rclass, " "); for (c = 0, cl = removes.length; c < cl; c += 1) { while (className.indexOf(" " + removes[c] + " ") >= 0) { className = className.replace(" " + removes[c] + " ", " "); } } elem.className = value ? jQuery.trim(className) : ""; } } } return this; }, removeProp : function (name) { name = jQuery.propFix[name] || name; return this.each(function () { try { this[name] = undefined; delete this[name]; } catch (e) {} }); }, toggleClass: function (value, stateVal) { var type = typeof value, isBool = typeof stateVal === "boolean"; if (jQuery.isFunction(value)) { return this.each(function (i) { jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal); }); } return this.each(function () { if (type === "string") { var className, i = 0, self = jQuery(this), state = stateVal, classNames = value.split(core_rspace); while ((className = classNames[i++])) { state = isBool ? state : !self.hasClass(className); self[ state ? "addClass" : "removeClass" ](className); } } else if (type === "undefined" || type === "boolean") { if (this.className) { jQuery._data(this, "__className__", this.className); } this.className = this.className || value === false ? "" : jQuery._data(this, "__className__") || ""; } }); }, val : function (value) { var hooks, ret, isFunction, elem = this[0]; if (!arguments.length) { if (elem) { hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[ elem .nodeName .toLowerCase() ]; if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) { return ret; } ret = elem.value; return typeof ret === "string" ? ret.replace(rreturn, "") : ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction(value); return this.each(function (i) { var val, self = jQuery(this); if (this.nodeType !== 1) { return; } if (isFunction) { val = value.call(this, i, self.val()); } else { val = value; } if (val == null) { val = ""; } else if (typeof val === "number") { val += ""; } else if (jQuery.isArray(val)) { val = jQuery.map(val, function (value) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[this.type] || jQuery.valHooks[ this .nodeName .toLowerCase() ]; if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) { this.value = val; } }); } }); jQuery.extend({ attr : function (elem, name, value, pass) { var ret, hooks, notxml, nType = elem.nodeType; if (!elem || nType === 3 || nType === 8 || nType === 2) { return; } if (pass && jQuery.isFunction(jQuery.fn[name])) { return jQuery(elem)[name](value); } if (typeof elem.getAttribute === "undefined") { return jQuery.prop(elem, name, value); } notxml = nType !== 1 || !jQuery.isXMLDoc(elem); if (notxml) { name = name.toLowerCase(); hooks = jQuery.attrHooks[name] || (rboolean.test(name) ? boolHook : nodeHook); } if (value !== undefined) { if (value === null) { jQuery.removeAttr(elem, name); return; } else if (hooks && "set" in hooks && notxml && (ret = hooks.set(elem, value, name)) !== undefined) { return ret; } else { elem.setAttribute(name, value + ""); return value; } } else if (hooks && "get" in hooks && notxml && (ret = hooks.get(elem, name)) !== null) { return ret; } else { ret = elem.getAttribute(name); return ret === null ? undefined : ret; } }, attrFn : {}, attrHooks : { type : { set: function (elem, value) { if (rtype.test(elem.nodeName) && elem.parentNode) { jQuery.error("type property can't be changed"); } else if (!jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input")) { var val = elem.value; elem.setAttribute("type", value); if (val) { elem.value = val; } return value; } } }, value: { get: function (elem, name) { if (nodeHook && jQuery.nodeName(elem, "button")) { return nodeHook.get(elem, name); } return name in elem ? elem.value : null; }, set: function (elem, value, name) { if (nodeHook && jQuery.nodeName(elem, "button")) { return nodeHook.set(elem, value, name); } elem.value = value; } } }, prop : function (elem, name, value) { var ret, hooks, notxml, nType = elem.nodeType; if (!elem || nType === 3 || nType === 8 || nType === 2) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc(elem); if (notxml) { name = jQuery.propFix[name] || name; hooks = jQuery.propHooks[name]; } if (value !== undefined) { if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { return ret; } else { return (elem[name] = value); } } else { if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { return ret; } else { return elem[name]; } } }, propFix : { "class" : "className", "for" : "htmlFor", cellpadding : "cellPadding", cellspacing : "cellSpacing", colspan : "colSpan", contenteditable: "contentEditable", frameborder : "frameBorder", maxlength : "maxLength", readonly : "readOnly", rowspan : "rowSpan", tabindex : "tabIndex", usemap : "useMap" }, propHooks : { tabIndex: { get: function (elem) { var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt(attributeNode.value, 10) : rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? 0 : undefined; } } }, removeAttr: function (elem, value) { var propName, attrNames, name, isBool, i = 0; if (value && elem.nodeType === 1) { attrNames = value.split(core_rspace); for (; i < attrNames.length; i += 1) { name = attrNames[i]; if (name) { propName = jQuery.propFix[name] || name; isBool = rboolean.test(name); if (!isBool) { jQuery.attr(elem, name, ""); } elem.removeAttribute(getSetAttribute ? name : propName); if (isBool && propName in elem) { elem[propName] = false; } } } } }, valHooks : { option: { get: function (elem) { var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function (elem) { var value, i, max, option, index = elem.selectedIndex, values = [], options = elem.options, one = elem.type === "select-one"; if (index < 0) { return null; } i = one ? index : 0; max = one ? index + 1 : options.length; for (; i < max; i += 1) { option = options[i]; if (option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) { value = jQuery(option).val(); if (one) { return value; } values.push(value); } } if (one && !values.length && options.length) { return jQuery(options[index]).val(); } return values; }, set: function (elem, value) { var values = jQuery.makeArray(value); jQuery(elem) .find("option") .each(function () { this.selected = jQuery.inArray(jQuery(this).val(), values) >= 0; }); if (!values.length) { elem.selectedIndex = -1; } return values; } } } }); boolHook = { get: function (elem, name) { var attrNode, property = jQuery.prop(elem, name); return property === true || typeof property !== "boolean" && (attrNode = elem.getAttributeNode(name)) && attrNode.nodeValue !== false ? name.toLowerCase() : undefined; }, set: function (elem, value, name) { var propName; if (value === false) { jQuery.removeAttr(elem, name); } else { propName = jQuery.propFix[name] || name; if (propName in elem) { elem[propName] = true; } elem.setAttribute(name, name.toLowerCase()); } return name; } }; if (!getSetAttribute) { fixSpecified = { coords: true, id : true, name : true }; nodeHook = jQuery.valHooks.button = { get: function (elem, name) { var ret; ret = elem.getAttributeNode(name); return ret && (fixSpecified[name] ? ret.value !== "" : ret.specified) ? ret.value : undefined; }, set: function (elem, value, name) { var ret = elem.getAttributeNode(name); if (!ret) { ret = document.createAttribute(name); elem.setAttributeNode(ret); } return (ret.value = value + ""); } }; jQuery.each([ "width", "height" ], function (i, name) { jQuery.attrHooks[name] = jQuery.extend(jQuery.attrHooks[name], { set: function (elem, value) { if (value === "") { elem.setAttribute(name, "auto"); return value; } } }); }); jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function (elem, value, name) { if (value === "") { value = "false"; } nodeHook.set(elem, value, name); } }; } if (!jQuery.support.hrefNormalized) { jQuery.each([ "href", "src", "width", "height" ], function (i, name) { jQuery.attrHooks[name] = jQuery.extend(jQuery.attrHooks[name], { get: function (elem) { var ret = elem.getAttribute(name, 2); return ret === null ? undefined : ret; } }); }); } if (!jQuery.support.style) { jQuery.attrHooks.style = { get: function (elem) { return elem .style .cssText .toLowerCase() || undefined; }, set: function (elem, value) { return (elem.style.cssText = value + ""); } }; } if (!jQuery.support.optSelected) { jQuery.propHooks.selected = jQuery.extend(jQuery.propHooks.selected, { get: function (elem) { var parent = elem.parentNode; if (parent) { parent.selectedIndex; if (parent.parentNode) { parent.parentNode.selectedIndex; } } return null; } }); } if (!jQuery.support.enctype) { jQuery.propFix.enctype = "encoding"; } if (!jQuery.support.checkOn) { jQuery.each([ "radio", "checkbox" ], function () { jQuery.valHooks[this] = { get: function (elem) { return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function () { jQuery.valHooks[this] = jQuery.extend(jQuery.valHooks[this], { set: function (elem, value) { if (jQuery.isArray(value)) { return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0); } } }); }); var rformElems = /^(?:textarea|input|select)$/i, rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/, rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, hoverHack = function (events) { return jQuery.event.special.hover ? events : events.replace(rhoverHack, "mouseenter$1 mouseleave$1"); }; jQuery.event = { add : function (elem, types, handler, data, selector) { var elemData, eventHandle, events, t, tns, type, namespaces, handleObj, handleObjIn, handlers, special; if (elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data(elem))) { return; } if (handler.handler) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } if (!handler.guid) { handler.guid = jQuery.guid++; } events = elemData.events; if (!events) { elemData.events = events = {}; } eventHandle = elemData.handle; if (!eventHandle) { elemData.handle = eventHandle = function (e) { return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? jQuery .event .dispatch .apply(eventHandle.elem, arguments) : undefined; }; eventHandle.elem = elem; } types = jQuery .trim(hoverHack(types)) .split(" "); for (t = 0; t < types.length; t += 1) { tns = rtypenamespace.exec(types[t]) || []; type = tns[1]; namespaces = (tns[2] || "") .split(".") .sort(); special = jQuery .event .special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; special = jQuery .event .special[type] || {}; handleObj = jQuery.extend({ data : data, guid : handler.guid, handler : handler, namespace : namespaces.join("."), needsContext: selector && jQuery .expr .match .needsContext .test(selector), origType : tns[1], selector : selector, type : type }, handleObjIn); handlers = events[type]; if (!handlers) { handlers = events[type] = []; handlers.delegateCount = 0; if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { if (elem.addEventListener) { elem.addEventListener(type, eventHandle, false); } else if (elem.attachEvent) { elem.attachEvent("on" + type, eventHandle); } } } if (special.add) { special .add .call(elem, handleObj); if (!handleObj.handler.guid) { handleObj.handler.guid = handler.guid; } } if (selector) { handlers.splice(handlers.delegateCount++, 0, handleObj); } else { handlers.push(handleObj); } jQuery .event .global[type] = true; } elem = null; }, customEvent: { "changeData": true, "getData" : true, "setData" : true }, dispatch : function (event) { event = jQuery .event .fix(event || window.event); var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related, handlers = ((jQuery._data(this, "events") || {})[event.type] || []), delegateCount = handlers.delegateCount, args = core_slice.call(arguments), run_all = !event.exclusive && !event.namespace, special = jQuery .event .special[event.type] || {}, handlerQueue = []; args[0] = event; event.delegateTarget = this; if (special.preDispatch && special.preDispatch.call(this, event) === false) { return; } if (delegateCount && !(event.button && event.type === "click")) { for (cur = event.target; cur != this; cur = cur.parentNode || this) { if (cur.disabled !== true || event.type !== "click") { selMatch = {}; matches = []; for (i = 0; i < delegateCount; i += 1) { handleObj = handlers[i]; sel = handleObj.selector; if (selMatch[sel] === undefined) { selMatch[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery .find(sel, this, null, [cur]) .length; } if (selMatch[sel]) { matches.push(handleObj); } } if (matches.length) { handlerQueue.push({elem: cur, matches: matches}); } } } } if (handlers.length > delegateCount) { handlerQueue.push({elem: this, matches: handlers.slice(delegateCount)}); } for (i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i += 1) { matched = handlerQueue[i]; event.currentTarget = matched.elem; for (j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j += 1) { handleObj = matched.matches[j]; if (run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test(handleObj.namespace)) { event.data = handleObj.data; event.handleObj = handleObj; ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); if (ret !== undefined) { event.result = ret; if (ret === false) { event.preventDefault(); event.stopPropagation(); } } } } } if (special.postDispatch) { special .postDispatch .call(this, event); } return event.result; }, fix : function (event) { if (event[jQuery.expando]) { return event; } var i, prop, originalEvent = event, fixHook = jQuery .event .fixHooks[event.type] || {}, copy = fixHook.props ? this .props .concat(fixHook.props) : this.props; event = jQuery.Event(originalEvent); for (i = copy.length; i;) { prop = copy[i -= 1]; event[prop] = originalEvent[prop]; } if (!event.target) { event.target = originalEvent.srcElement || document; } if (event.target.nodeType === 3) { event.target = event.target.parentNode; } event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter(event, originalEvent) : event; }, fixHooks : {}, global : {}, keyHooks : { filter: function (event, original) { if (event.which == null) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; }, props : "char charCode key keyCode".split(" ") }, mouseHooks : { filter: function (event, original) { var eventDoc, doc, body, button = original.button, fromElement = original.fromElement; if (event.pageX == null && original.clientX != null) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } if (!event.relatedTarget && fromElement) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } if (!event.which && button !== undefined) { event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0))); } return event; }, props : ("button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX" + " screenY toElement").split(" ") }, props : ("attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey c" + "urrentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view w" + "hich").split(" "), remove : function (elem, types, handler, selector, mappedTypes) { var t, tns, type, origType, namespaces, origCount, j, events, special, eventType, handleObj, elemData = jQuery.hasData(elem) && jQuery._data(elem); if (!elemData || !(events = elemData.events)) { return; } types = jQuery .trim(hoverHack(types || "")) .split(" "); for (t = 0; t < types.length; t += 1) { tns = rtypenamespace.exec(types[t]) || []; type = origType = tns[1]; namespaces = tns[2]; if (!type) { for (type in events) { jQuery .event .remove(elem, type + types[t], handler, selector, true); } continue; } special = jQuery .event .special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; eventType = events[type] || []; origCount = eventType.length; namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; for (j = 0; j < eventType.length; j += 1) { handleObj = eventType[j]; if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!namespaces || namespaces.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { eventType.splice(j--, 1); if (handleObj.selector) { eventType.delegateCount -= 1; } if (special.remove) { special .remove .call(elem, handleObj); } } } if (eventType.length === 0 && origCount !== eventType.length) { if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { jQuery.removeEvent(elem, type, elemData.handle); } delete events[type]; } } if (jQuery.isEmptyObject(events)) { delete elemData.handle; jQuery.removeData(elem, "events", true); } }, simulate : function (type, elem, event, bubble) { var e = jQuery.extend(new jQuery.Event(), event, { isSimulated : true, originalEvent: {}, type : type }); if (bubble) { jQuery .event .trigger(e, null, elem); } else { jQuery .event .dispatch .call(elem, e); } if (e.isDefaultPrevented()) { event.preventDefault(); } }, special : { beforeunload: { setup : function (data, namespaces, eventHandle) { if (jQuery.isWindow(this)) { this.onbeforeunload = eventHandle; } }, teardown: function (namespaces, eventHandle) { if (this.onbeforeunload === eventHandle) { this.onbeforeunload = null; } } }, blur : { delegateType: "focusout" }, focus : { delegateType: "focusin" }, load : { noBubble: true } }, trigger : function (event, data, elem, onlyHandlers) { if (elem && (elem.nodeType === 3 || elem.nodeType === 8)) { return; } var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, type = event.type || event, namespaces = []; if (rfocusMorph.test(type + jQuery.event.triggered)) { return; } if (type.indexOf("!") >= 0) { type = type.slice(0, -1); exclusive = true; } if (type.indexOf(".") >= 0) { namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } if ((!elem || jQuery.event.customEvent[type]) && !jQuery.event.global[type]) { return; } event = typeof event === "object" ? event[jQuery.expando] ? event : new jQuery.Event(type, event) : new jQuery.Event(type); event.type = type; event.isTrigger = true; event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; ontype = type.indexOf(":") < 0 ? "on" + type : ""; if (!elem) { cache = jQuery.cache; for (i in cache) { if (cache[i].events && cache[i].events[type]) { jQuery .event .trigger(event, data, cache[i].handle.elem, true); } } return; } event.result = undefined; if (!event.target) { event.target = elem; } data = data != null ? jQuery.makeArray(data) : []; data.unshift(event); special = jQuery .event .special[type] || {}; if (special.trigger && special.trigger.apply(elem, data) === false) { return; } eventPath = [ [ elem, special.bindType || type ] ]; if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) { bubbleType = special.delegateType || type; cur = rfocusMorph.test(bubbleType + type) ? elem : elem.parentNode; for (old = elem; cur; cur = cur.parentNode) { eventPath.push([cur, bubbleType]); old = cur; } if (old === (elem.ownerDocument || document)) { eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); } } for (i = 0; i < eventPath.length && !event.isPropagationStopped(); i += 1) { cur = eventPath[i][0]; event.type = eventPath[i][1]; handle = (jQuery._data(cur, "events") || {})[event.type] && jQuery._data(cur, "handle"); if (handle) { handle.apply(cur, data); } handle = ontype && cur[ontype]; if (handle && jQuery.acceptData(cur) && handle.apply && handle.apply(cur, data) === false) { event.preventDefault(); } } event.type = type; if (!onlyHandlers && !event.isDefaultPrevented()) { if ((!special._default || special._default.apply(elem.ownerDocument, data) === false) && !(type === "click" && jQuery.nodeName(elem, "a")) && jQuery.acceptData(elem)) { if (ontype && elem[type] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow(elem)) { old = elem[ontype]; if (old) { elem[ontype] = null; } jQuery.event.triggered = type; elem[type](); jQuery.event.triggered = undefined; if (old) { elem[ontype] = old; } } } } return event.result; } }; jQuery.event.handle = jQuery.event.dispatch; jQuery.removeEvent = document.removeEventListener ? function (elem, type, handle) { if (elem.removeEventListener) { elem.removeEventListener(type, handle, false); } } : function (elem, type, handle) { var name = "on" + type; if (elem.detachEvent) { if (typeof elem[name] === "undefined") { elem[name] = null; } elem.detachEvent(name, handle); } }; jQuery.Event = function (src, props) { if (!(this instanceof jQuery.Event)) { return new jQuery.Event(src, props); } if (src && src.type) { this.originalEvent = src; this.type = src.type; this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; } else { this.type = src; } if (props) { jQuery.extend(this, props); } this.timeStamp = src && src.timeStamp || jQuery.now(); this[jQuery.expando] = true; }; function returnFalse() { return false; } function returnTrue() { return true; } jQuery.Event.prototype = { isDefaultPrevented : returnFalse, isImmediatePropagationStopped: returnFalse, isPropagationStopped : returnFalse, preventDefault : function () { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if (!e) { return; } if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }, stopImmediatePropagation : function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, stopPropagation : function () { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if (!e) { return; } if (e.stopPropagation) { e.stopPropagation(); } e.cancelBubble = true; } }; jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (orig, fix) { jQuery .event .special[orig] = { bindType : fix, delegateType: fix, handle : function (event) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj, selector = handleObj.selector; if (!related || (related !== target && !jQuery.contains(target, related))) { event.type = handleObj.origType; ret = handleObj .handler .apply(this, arguments); event.type = fix; } return ret; } }; }); if (!jQuery.support.submitBubbles) { jQuery.event.special.submit = { postDispatch: function (event) { if (event._submit_bubble) { delete event._submit_bubble; if (this.parentNode && !event.isTrigger) { jQuery .event .simulate("submit", this.parentNode, event, true); } } }, setup : function () { if (jQuery.nodeName(this, "form")) { return false; } jQuery .event .add(this, "click._submit keypress._submit", function (e) { var elem = e.target, form = jQuery.nodeName(elem, "input") || jQuery.nodeName(elem, "button") ? elem.form : undefined; if (form && !jQuery._data(form, "_submit_attached")) { jQuery .event .add(form, "submit._submit", function (event) { event._submit_bubble = true; }); jQuery._data(form, "_submit_attached", true); } }); }, teardown : function () { if (jQuery.nodeName(this, "form")) { return false; } jQuery .event .remove(this, "._submit"); } }; } if (!jQuery.support.changeBubbles) { jQuery.event.special.change = { handle : function (event) { var elem = event.target; if (this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox")) { return event .handleObj .handler .apply(this, arguments); } }, setup : function () { if (rformElems.test(this.nodeName)) { if (this.type === "checkbox" || this.type === "radio") { jQuery .event .add(this, "propertychange._change", function (event) { if (event.originalEvent.propertyName === "checked") { this._just_changed = true; } }); jQuery .event .add(this, "click._change", function (event) { if (this._just_changed && !event.isTrigger) { this._just_changed = false; } jQuery .event .simulate("change", this, event, true); }); } return false; } jQuery .event .add(this, "beforeactivate._change", function (e) { var elem = e.target; if (rformElems.test(elem.nodeName) && !jQuery._data(elem, "_change_attached")) { jQuery .event .add(elem, "change._change", function (event) { if (this.parentNode && !event.isSimulated && !event.isTrigger) { jQuery .event .simulate("change", this.parentNode, event, true); } }); jQuery._data(elem, "_change_attached", true); } }); }, teardown: function () { jQuery .event .remove(this, "._change"); return !rformElems.test(this.nodeName); } }; } if (!jQuery.support.focusinBubbles) { jQuery.each({ blur : "focusout", focus: "focusin" }, function (orig, fix) { var attaches = 0, handler = function (event) { jQuery .event .simulate(fix, event.target, jQuery.event.fix(event), true); }; jQuery .event .special[fix] = { setup : function () { if (attaches++ === 0) { document.addEventListener(orig, handler, true); } }, teardown: function () { if (--attaches === 0) { document.removeEventListener(orig, handler, true); } } }; }); } jQuery .fn .extend({ bind : function (types, data, fn) { return this.on(types, null, data, fn); }, delegate : function (selector, types, data, fn) { return this.on(types, selector, data, fn); }, die : function (types, fn) { jQuery(this.context).off(types, this.selector || "**", fn); return this; }, hover : function (fnOver, fnOut) { return this .mouseenter(fnOver) .mouseleave(fnOut || fnOver); }, live : function (types, data, fn) { jQuery(this.context).on(types, this.selector, data, fn); return this; }, off : function (types, selector, fn) { var handleObj, type; if (types && types.preventDefault && types.handleObj) { handleObj = types.handleObj; jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler); return this; } if (typeof types === "object") { for (type in types) { this.off(type, selector, types[type]); } return this; } if (selector === false || typeof selector === "function") { fn = selector; selector = undefined; } if (fn === false) { fn = returnFalse; } return this.each(function () { jQuery .event .remove(this, types, fn, selector); }); }, on : function (types, selector, data, fn, one) { var origFn, type; if (typeof types === "object") { if (typeof selector !== "string") { data = data || selector; selector = undefined; } for (type in types) { this.on(type, selector, data, types[type], one); } return this; } if (data == null && fn == null) { fn = selector; data = selector = undefined; } else if (fn == null) { if (typeof selector === "string") { fn = data; data = undefined; } else { fn = data; data = selector; selector = undefined; } } if (fn === false) { fn = returnFalse; } else if (!fn) { return this; } if (one === 1) { origFn = fn; fn = function (event) { jQuery().off(event); return origFn.apply(this, arguments); }; fn.guid = origFn.guid || (origFn.guid = jQuery.guid++); } return this.each(function () { jQuery .event .add(this, types, fn, data, selector); }); }, one : function (types, selector, data, fn) { return this.on(types, selector, data, fn, 1); }, toggle : function (fn) { var args = arguments, guid = fn.guid || jQuery.guid++, i = 0, toggler = function (event) { var lastToggle = (jQuery._data(this, "lastToggle" + fn.guid) || 0) % i; jQuery._data(this, "lastToggle" + fn.guid, lastToggle + 1); event.preventDefault(); return args[lastToggle].apply(this, arguments) || false; }; toggler.guid = guid; while (i < args.length) { args[i++].guid = guid; } return this.click(toggler); }, trigger : function (type, data) { return this.each(function () { jQuery .event .trigger(type, data, this); }); }, triggerHandler: function (type, data) { if (this[0]) { return jQuery .event .trigger(type, data, this[0], true); } }, unbind : function (types, fn) { return this.off(types, null, fn); }, undelegate : function (selector, types, fn) { return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn); } }); jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown" + " mouseup mousemove mouseover mouseout mouseenter mouseleave change select subm" + "it keydown keypress keyup error contextmenu").split(" "), function (i, name) { jQuery.fn[name] = function (data, fn) { if (fn == null) { fn = data; data = null; } return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name); }; if (rkeyEvent.test(name)) { jQuery .event .fixHooks[name] = jQuery.event.keyHooks; } if (rmouseEvent.test(name)) { jQuery .event .fixHooks[name] = jQuery.event.mouseHooks; } }); (function (window, undefined) { var cachedruns, assertGetIdNotName, Expr, getText, isXML, contains, compile, sortOrder, hasDuplicate, outermostContext, baseHasDuplicate = true, strundefined = "undefined", expando = ("sizcache" + Math.random()).replace(".", ""), Token = String, document = window.document, docElem = document.documentElement, dirruns = 0, done = 0, pop = [].pop, push = [].push, slice = [].slice, indexOf = [].indexOf || function (elem) { var i = 0, len = this.length; for (; i < len; i += 1) { if (this[i] === elem) { return i; } } return -1; }, markFunction = function (fn, value) { fn[expando] = value == null || value; return fn; }, createCache = function () { var cache = {}, keys = []; return markFunction(function (key, value) { if (keys.push(key) > Expr.cacheLength) { delete cache[keys.shift()]; } return (cache[key] = value); }, cache); }, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), whitespace = "[\\x20\\t\\r\\n\\f]", characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", identifier = characterEncoding.replace("w", "w#"), operators = "([*^$|!~]?=)", attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]" + "]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)", pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*"), rpseudo = new RegExp(pseudos), rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, rnot = /^:not/, rsibling = /[\x20\t\r\n\f]*[+~]/, rendsWithNot = /:not\($/, rheader = /h\d/i, rinputs = /input|select|textarea|button/i, rbackslash = /\\(?!\\)/g, matchExpr = { "ATTR" : new RegExp("^" + attributes), "CHILD" : new RegExp("^:(only|nth|first|last)-child(?:\\(" + whitespace + "*(eve" + "n|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|" + "))" + whitespace + "*\\)|)", "i"), "CLASS" : new RegExp("^\\.(" + characterEncoding + ")"), "ID" : new RegExp("^#(" + characterEncoding + ")"), "NAME" : new RegExp("^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]"), "needsContext": new RegExp("^" + whitespace + "*[>+~]|" + pos, "i"), "POS" : new RegExp(pos, "i"), "PSEUDO" : new RegExp("^" + pseudos), "TAG" : new RegExp("^(" + characterEncoding.replace("w", "w*") + ")") }, assert = function (fn) { var div = document.createElement("div"); try { return fn(div); } catch (e) { return false; } finally { div = null; } }, assertTagNameNoComments = assert(function (div) { div.appendChild(document.createComment("")); return !div .getElementsByTagName("*") .length; }), assertHrefNotNormalized = assert(function (div) { div.innerHTML = ""; return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && div .firstChild .getAttribute("href") === "#"; }), assertAttributes = assert(function (div) { div.innerHTML = ""; var type = typeof div .lastChild .getAttribute("multiple"); return type !== "boolean" && type !== "string"; }), assertUsableClassName = assert(function (div) { div.innerHTML = ""; if (!div.getElementsByClassName || !div.getElementsByClassName("e").length) { return false; } div.lastChild.className = "e"; return div .getElementsByClassName("e") .length === 2; }), assertUsableName = assert(function (div) { div.id = expando + 0; div.innerHTML = "
"; docElem.insertBefore(div, docElem.firstChild); var pass = document.getElementsByName && document .getElementsByName(expando) .length === 2 + document .getElementsByName(expando + 0) .length; assertGetIdNotName = !document.getElementById(expando); docElem.removeChild(div); return pass; }); try { slice .call(docElem.childNodes, 0)[0] .nodeType; } catch (e) { slice = function (i) { var elem, results = []; for (; (elem = this[i]); i += 1) { results.push(elem); } return results; }; } function Sizzle(selector, context, results, seed) { results = results || []; context = context || document; var match, elem, xml, m, nodeType = context.nodeType; if (!selector || typeof selector !== "string") { return results; } if (nodeType !== 1 && nodeType !== 9) { return []; } xml = isXML(context); if (!xml && !seed) { if ((match = rquickExpr.exec(selector))) { if ((m = match[1])) { if (nodeType === 9) { elem = context.getElementById(m); if (elem && elem.parentNode) { if (elem.id === m) { results.push(elem); return results; } } else { return results; } } else { if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) { results.push(elem); return results; } } } else if (match[2]) { push.apply(results, slice.call(context.getElementsByTagName(selector), 0)); return results; } else if ((m = match[3]) && assertUsableClassName && context.getElementsByClassName) { push.apply(results, slice.call(context.getElementsByClassName(m), 0)); return results; } } } return select(selector.replace(rtrim, "$1"), context, results, seed, xml); } Sizzle.matches = function (expr, elements) { return Sizzle(expr, null, null, elements); }; Sizzle.matchesSelector = function (elem, expr) { return Sizzle(expr, null, null, [elem]).length > 0; }; function createInputPseudo(type) { return function (elem) { var name = elem .nodeName .toLowerCase(); return name === "input" && elem.type === type; }; } function createButtonPseudo(type) { return function (elem) { var name = elem .nodeName .toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } function createPositionalPseudo(fn) { return markFunction(function (argument) { argument = +argument; return markFunction(function (seed, matches) { var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; while (i--) { if (seed[(j = matchIndexes[i])]) { seed[j] = !(matches[j] = seed[j]); } } }); }); } getText = Sizzle.getText = function (elem) { var node, ret = "", i = 0, nodeType = elem.nodeType; if (nodeType) { if (nodeType === 1 || nodeType === 9 || nodeType === 11) { if (typeof elem.textContent === "string") { return elem.textContent; } else { for (elem = elem.firstChild; elem; elem = elem.nextSibling) { ret += getText(elem); } } } else if (nodeType === 3 || nodeType === 4) { return elem.nodeValue; } } else { for (; (node = elem[i]); i += 1) { ret += getText(node); } } return ret; }; isXML = Sizzle.isXML = function (elem) { var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; contains = Sizzle.contains = docElem.contains ? function (a, b) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!(bup && bup.nodeType === 1 && adown.contains && adown.contains(bup)); } : docElem.compareDocumentPosition ? function (a, b) { return b && !!(a.compareDocumentPosition(b) & 16); } : function (a, b) { while ((b = b.parentNode)) { if (b === a) { return true; } } return false; }; Sizzle.attr = function (elem, name) { var val, xml = isXML(elem); if (!xml) { name = name.toLowerCase(); } if ((val = Expr.attrHandle[name])) { return val(elem); } if (xml || assertAttributes) { return elem.getAttribute(name); } val = elem.getAttributeNode(name); return val ? typeof elem[name] === "boolean" ? elem[name] ? name : null : val.specified ? val.value : null : null; }; Expr = Sizzle.selectors = { attrHandle : assertHrefNotNormalized ? {} : { "href": function (elem) { return elem.getAttribute("href", 2); }, "type": function (elem) { return elem.getAttribute("type"); } }, cacheLength : 50, createPseudo: markFunction, filter : { "ATTR" : function (name, operator, check) { return function (elem, context) { var result = Sizzle.attr(elem, name); if (result == null) { return operator === "!="; } if (!operator) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.substr(result.length - check.length) === check : operator === "~=" ? (" " + result + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.substr(0, check.length + 1) === check + "-" : false; }; }, "CHILD" : function (type, argument, first, last) { if (type === "nth") { return function (elem) { var node, diff, parent = elem.parentNode; if (first === 1 && last === 0) { return true; } if (parent) { diff = 0; for (node = parent.firstChild; node; node = node.nextSibling) { if (node.nodeType === 1) { diff += 1; if (elem === node) { break; } } } } diff -= last; return diff === first || (diff % first === 0 && diff / first >= 0); }; } return function (elem) { var node = elem; switch (type) { case "only": case "first": while ((node = node.previousSibling)) { if (node.nodeType === 1) { return false; } } if (type === "first") { return true; } node = elem; case "last": while ((node = node.nextSibling)) { if (node.nodeType === 1) { return false; } } return true; } }; }, "CLASS" : function (className) { var pattern = classCache[expando][className]; if (!pattern) { pattern = classCache(className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")); } return function (elem) { return pattern.test(elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || ""); }; }, "ID" : assertGetIdNotName ? function (id) { id = id.replace(rbackslash, ""); return function (elem) { return elem.getAttribute("id") === id; }; } : function (id) { id = id.replace(rbackslash, ""); return function (elem) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === id; }; }, "PSEUDO": function (pseudo, argument) { var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); if (fn[expando]) { return fn(argument); } if (fn.length > 1) { args = [pseudo, pseudo, "", argument]; return Expr .setFilters .hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) { var idx, matched = fn(seed, argument), i = matched.length; while (i--) { idx = indexOf.call(seed, matched[i]); seed[idx] = !(matches[idx] = matched[i]); } }) : function (elem) { return fn(elem, 0, args); }; } return fn; }, "TAG" : function (nodeName) { if (nodeName === "*") { return function () { return true; }; } nodeName = nodeName .replace(rbackslash, "") .toLowerCase(); return function (elem) { return elem.nodeName && elem .nodeName .toLowerCase() === nodeName; }; } }, find : { "CLASS": assertUsableClassName && function (className, context, xml) { if (typeof context.getElementsByClassName !== strundefined && !xml) { return context.getElementsByClassName(className); } }, "ID" : assertGetIdNotName ? function (id, context, xml) { if (typeof context.getElementById !== strundefined && !xml) { var m = context.getElementById(id); return m && m.parentNode ? [m] : []; } } : function (id, context, xml) { if (typeof context.getElementById !== strundefined && !xml) { var m = context.getElementById(id); return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m .getAttributeNode("id") .value === id ? [m] : undefined : []; } }, "NAME" : assertUsableName && function (tag, context) { if (typeof context.getElementsByName !== strundefined) { return context.getElementsByName(name); } }, "TAG" : assertTagNameNoComments ? function (tag, context) { if (typeof context.getElementsByTagName !== strundefined) { return context.getElementsByTagName(tag); } } : function (tag, context) { var results = context.getElementsByTagName(tag); if (tag === "*") { var elem, tmp = [], i = 0; for (; (elem = results[i]); i += 1) { if (elem.nodeType === 1) { tmp.push(elem); } } return tmp; } return results; } }, match : matchExpr, preFilter : { "ATTR" : function (match) { match[1] = match[1].replace(rbackslash, ""); match[3] = (match[4] || match[5] || "").replace(rbackslash, ""); if (match[2] === "~=") { match[3] = " " + match[3] + " "; } return match.slice(0, 4); }, "CHILD" : function (match) { match[1] = match[1].toLowerCase(); if (match[1] === "nth") { if (!match[2]) { Sizzle.error(match[0]); } match[3] = +(match[3] ? match[4] + (match[5] || 1) : 2 * (match[2] === "even" || match[2] === "odd")); match[4] = +((match[6] + match[7]) || match[2] === "odd"); } else if (match[2]) { Sizzle.error(match[0]); } return match; }, "PSEUDO": function (match) { var unquoted, excess; if (matchExpr["CHILD"].test(match[0])) { return null; } if (match[3]) { match[2] = match[3]; } else if ((unquoted = match[4])) { if (rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { unquoted = unquoted.slice(0, excess); match[0] = match[0].slice(0, excess); } match[2] = unquoted; } return match.slice(0, 3); } }, pseudos : { "active" : function (elem) { return elem === elem.ownerDocument.activeElement; }, "button" : function (elem) { var name = elem .nodeName .toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "checkbox": createInputPseudo("checkbox"), "checked" : function (elem) { var nodeName = elem .nodeName .toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "contains": markFunction(function (text) { return function (elem) { return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1; }; }), "disabled": function (elem) { return elem.disabled === true; }, "empty" : function (elem) { var nodeType; elem = elem.firstChild; while (elem) { if (elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4) { return false; } elem = elem.nextSibling; } return true; }, "enabled" : function (elem) { return elem.disabled === false; }, "eq" : createPositionalPseudo(function (matchIndexes, length, argument) { return [ argument < 0 ? argument + length : argument ]; }), "even" : createPositionalPseudo(function (matchIndexes, length, argument) { for (var i = 0; i < length; i += 2) { matchIndexes.push(i); } return matchIndexes; }), "file" : createInputPseudo("file"), "first" : createPositionalPseudo(function (matchIndexes, length, argument) { return [0]; }), "focus" : function (elem) { var doc = elem.ownerDocument; return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href); }, "gt" : createPositionalPseudo(function (matchIndexes, length, argument) { for (var i = argument < 0 ? argument + length : argument; ++i < length;) { matchIndexes.push(i); } return matchIndexes; }), "has" : markFunction(function (selector) { return function (elem) { return Sizzle(selector, elem).length > 0; }; }), "header" : function (elem) { return rheader.test(elem.nodeName); }, "image" : createInputPseudo("image"), "input" : function (elem) { return rinputs.test(elem.nodeName); }, "last" : createPositionalPseudo(function (matchIndexes, length, argument) { return [length - 1]; }), "lt" : createPositionalPseudo(function (matchIndexes, length, argument) { for (var i = argument < 0 ? argument + length : argument; --i >= 0;) { matchIndexes.push(i); } return matchIndexes; }), "not" : markFunction(function (selector) { var input = [], results = [], matcher = compile(selector.replace(rtrim, "$1")); return matcher[expando] ? markFunction(function (seed, matches, context, xml) { var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; while (i--) { if ((elem = unmatched[i])) { seed[i] = !(matches[i] = elem); } } }) : function (elem, context, xml) { input[0] = elem; matcher(input, null, xml, results); return !results.pop(); }; }), "odd" : createPositionalPseudo(function (matchIndexes, length, argument) { for (var i = 1; i < length; i += 2) { matchIndexes.push(i); } return matchIndexes; }), "parent" : function (elem) { return !Expr.pseudos["empty"](elem); }, "password": createInputPseudo("password"), "radio" : createInputPseudo("radio"), "reset" : createButtonPseudo("reset"), "selected": function (elem) { if (elem.parentNode) { elem.parentNode.selectedIndex; } return elem.selected === true; }, "submit" : createButtonPseudo("submit"), "text" : function (elem) { var type, attr; return elem .nodeName .toLowerCase() === "input" && (type = elem.type) === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type); } }, relative : { " ": { dir: "parentNode" }, "+": { dir : "previousSibling", first: true }, ">": { dir : "parentNode", first: true }, "~": { dir: "previousSibling" } } }; function siblingCheck(a, b, ret) { if (a === b) { return ret; } var cur = a.nextSibling; while (cur) { if (cur === b) { return -1; } cur = cur.nextSibling; } return 1; } sortOrder = docElem.compareDocumentPosition ? function (a, b) { if (a === b) { hasDuplicate = true; return 0; } return (!a.compareDocumentPosition || !b.compareDocumentPosition ? a.compareDocumentPosition : a.compareDocumentPosition(b) & 4) ? -1 : 1; } : function (a, b) { if (a === b) { hasDuplicate = true; return 0; } else if (a.sourceIndex && b.sourceIndex) { return a.sourceIndex - b.sourceIndex; } var al, bl, ap = [], bp = [], aup = a.parentNode, bup = b.parentNode, cur = aup; if (aup === bup) { return siblingCheck(a, b); } else if (!aup) { return -1; } else if (!bup) { return 1; } while (cur) { ap.unshift(cur); cur = cur.parentNode; } cur = bup; while (cur) { bp.unshift(cur); cur = cur.parentNode; } al = ap.length; bl = bp.length; for (var i = 0; i < al && i < bl; i += 1) { if (ap[i] !== bp[i]) { return siblingCheck(ap[i], bp[i]); } } return i === al ? siblingCheck(a, bp[i], -1) : siblingCheck(ap[i], b, 1); }; [0, 0].sort(sortOrder); baseHasDuplicate = !hasDuplicate; Sizzle.uniqueSort = function (results) { var elem, i = 1; hasDuplicate = baseHasDuplicate; results.sort(sortOrder); if (hasDuplicate) { for (; (elem = results[i]); i += 1) { if (elem === results[i - 1]) { results.splice(i--, 1); } } } return results; }; Sizzle.error = function (msg) { throw new Error("Syntax error, unrecognized expression: " + msg); }; function tokenize(selector, parseOnly) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[expando][selector]; if (cached) { return parseOnly ? 0 : cached.slice(0); } soFar = selector; groups = []; preFilters = Expr.preFilter; while (soFar) { if (!matched || (match = rcomma.exec(soFar))) { if (match) { soFar = soFar.slice(match[0].length); } groups.push(tokens = []); } matched = false; if ((match = rcombinators.exec(soFar))) { tokens.push(matched = new Token(match.shift())); soFar = soFar.slice(matched.length); matched.type = match[0].replace(rtrim, " "); } for (type in Expr.filter) { if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match, document, true)))) { tokens.push(matched = new Token(match.shift())); soFar = soFar.slice(matched.length); matched.type = type; matched.matches = match; } } if (!matched) { break; } } return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0); } function addCombinator(matcher, combinator, base) { var dir = combinator.dir, checkNonElements = base && combinator.dir === "parentNode", doneName = done++; return combinator.first ? function (elem, context, xml) { while ((elem = elem[dir])) { if (checkNonElements || elem.nodeType === 1) { return matcher(elem, context, xml); } } } : function (elem, context, xml) { if (!xml) { var cache, dirkey = dirruns + " " + doneName + " ", cachedkey = dirkey + cachedruns; while ((elem = elem[dir])) { if (checkNonElements || elem.nodeType === 1) { if ((cache = elem[expando]) === cachedkey) { return elem.sizset; } else if (typeof cache === "string" && cache.indexOf(dirkey) === 0) { if (elem.sizset) { return elem; } } else { elem[expando] = cachedkey; if (matcher(elem, context, xml)) { elem.sizset = true; return elem; } elem.sizset = false; } } } } else { while ((elem = elem[dir])) { if (checkNonElements || elem.nodeType === 1) { if (matcher(elem, context, xml)) { return elem; } } } } }; } function elementMatcher(matchers) { return matchers.length > 1 ? function (elem, context, xml) { var i = matchers.length; while (i--) { if (!matchers[i](elem, context, xml)) { return false; } } return true; } : matchers[0]; } function condense(unmatched, map, filter, context, xml) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for (; i < len; i += 1) { if ((elem = unmatched[i])) { if (!filter || filter(elem, context, xml)) { newUnmatched.push(elem); if (mapped) { map.push(i); } } } } return newUnmatched; } function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { if (postFilter && !postFilter[expando]) { postFilter = setMatcher(postFilter); } if (postFinder && !postFinder[expando]) { postFinder = setMatcher(postFinder, postSelector); } return markFunction(function (seed, results, context, xml) { if (seed && postFinder) { return; } var i, elem, postFilterIn, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, [], seed), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn; if (matcher) { matcher(matcherIn, matcherOut, context, xml); } if (postFilter) { postFilterIn = condense(matcherOut, postMap); postFilter(postFilterIn, [], context, xml); i = postFilterIn.length; while (i--) { if ((elem = postFilterIn[i])) { matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem); } } } if (seed) { i = preFilter && matcherOut.length; while (i--) { if ((elem = matcherOut[i])) { seed[preMap[i]] = !(results[preMap[i]] = elem); } } } else { matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); if (postFinder) { postFinder(null, results, matcherOut, xml); } else { push.apply(results, matcherOut); } } }); } function matcherFromTokens(tokens) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) { return elem === checkContext; }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) { return indexOf.call(checkContext, elem) > -1; }, implicitRelative, true), matchers = [ function (elem, context, xml) { return (!leadingRelative && (xml || context !== outermostContext)) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); } ]; for (; i < len; i += 1) { if ((matcher = Expr.relative[tokens[i].type])) { matchers = [addCombinator(elementMatcher(matchers), matcher)]; } else { matcher = Expr .filter[tokens[i].type] .apply(null, tokens[i].matches); if (matcher[expando]) { j = ++i; for (; j < len; j += 1) { if (Expr.relative[tokens[j].type]) { break; } } return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && tokens.slice(0, i - 1).join("").replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens((tokens = tokens.slice(j))), j < len && tokens.join("")); } matchers.push(matcher); } } return elementMatcher(matchers); } function matcherFromGroupMatchers(elementMatchers, setMatchers) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, expandContext) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, elems = seed || byElement && Expr.find["TAG"]("*", expandContext && context.parentNode || context), dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); if (outermost) { outermostContext = context !== document && context; cachedruns = superMatcher.el; } for (; (elem = elems[i]) != null; i += 1) { if (byElement && elem) { for (j = 0; (matcher = elementMatchers[j]); j += 1) { if (matcher(elem, context, xml)) { results.push(elem); break; } } if (outermost) { dirruns = dirrunsUnique; cachedruns = ++superMatcher.el; } } if (bySet) { if ((elem = !matcher && elem)) { matchedCount -= 1; } if (seed) { unmatched.push(elem); } } } matchedCount += i; if (bySet && i !== matchedCount) { for (j = 0; (matcher = setMatchers[j]); j += 1) { matcher(unmatched, setMatched, context, xml); } if (seed) { if (matchedCount > 0) { while (i--) { if (!(unmatched[i] || setMatched[i])) { setMatched[i] = pop.call(results); } } } setMatched = condense(setMatched); } push.apply(results, setMatched); if (outermost && !seed && setMatched.length > 0 && (matchedCount + setMatchers.length) > 1) { Sizzle.uniqueSort(results); } } if (outermost) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; superMatcher.el = 0; return bySet ? markFunction(superMatcher) : superMatcher; } compile = Sizzle.compile = function (selector, group) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[expando][selector]; if (!cached) { if (!group) { group = tokenize(selector); } i = group.length; while (i--) { cached = matcherFromTokens(group[i]); if (cached[expando]) { setMatchers.push(cached); } else { elementMatchers.push(cached); } } cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); } return cached; }; function multipleContexts(selector, contexts, results, seed) { var i = 0, len = contexts.length; for (; i < len; i += 1) { Sizzle(selector, contexts[i], results, seed); } return results; } function select(selector, context, results, seed, xml) { var i, tokens, token, type, find, match = tokenize(selector), j = match.length; if (!seed) { if (match.length === 1) { tokens = match[0] = match[0].slice(0); if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && !xml && Expr.relative[tokens[1].type]) { context = Expr.find["ID"](token.matches[0].replace(rbackslash, ""), context, xml)[0]; if (!context) { return results; } selector = selector.slice(tokens.shift().length); } for (i = matchExpr["POS"].test(selector) ? -1 : tokens.length - 1; i >= 0; i -= 1) { token = tokens[i]; if (Expr.relative[(type = token.type)]) { break; } if ((find = Expr.find[type])) { if ((seed = find(token.matches[0].replace(rbackslash, ""), rsibling.test(tokens[0].type) && context.parentNode || context, xml))) { tokens.splice(i, 1); selector = seed.length && tokens.join(""); if (!selector) { push.apply(results, slice.call(seed, 0)); return results; } break; } } } } } compile(selector, match)(seed, context, xml, results, rsibling.test(selector)); return results; } if (document.querySelectorAll) { (function () { var disconnectedMatch, oldSelect = select, rescape = /'|\\/g, rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, rbuggyQSA = [":focus"], rbuggyMatches = [ ":active", ":focus" ], matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector; assert(function (div) { div.innerHTML = ""; if (!div.querySelectorAll("[selected]").length) { rbuggyQSA.push("\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readon" + "ly|selected|value)"); } if (!div.querySelectorAll(":checked").length) { rbuggyQSA.push(":checked"); } }); assert(function (div) { div.innerHTML = "

"; if (div.querySelectorAll("[test^='']").length) { rbuggyQSA.push("[*^$]=" + whitespace + "*(?:\"\"|'')"); } div.innerHTML = ""; if (!div.querySelectorAll(":enabled").length) { rbuggyQSA.push(":enabled", ":disabled"); } }); rbuggyQSA = new RegExp(rbuggyQSA.join("|")); select = function (selector, context, results, seed, xml) { if (!seed && !xml && (!rbuggyQSA || !rbuggyQSA.test(selector))) { var groups, i, old = true, nid = expando, newContext = context, newSelector = context.nodeType === 9 && selector; if (context.nodeType === 1 && context.nodeName.toLowerCase() !== "object") { groups = tokenize(selector); if ((old = context.getAttribute("id"))) { nid = old.replace(rescape, "\\$&"); } else { context.setAttribute("id", nid); } nid = "[id='" + nid + "'] "; i = groups.length; while (i--) { groups[i] = nid + groups[i].join(""); } newContext = rsibling.test(selector) && context.parentNode || context; newSelector = groups.join(","); } if (newSelector) { try { push.apply(results, slice.call(newContext.querySelectorAll(newSelector), 0)); return results; } catch (qsaError) {} finally { if (!old) { context.removeAttribute("id"); } } } } return oldSelect(selector, context, results, seed, xml); }; if (matches) { assert(function (div) { disconnectedMatch = matches.call(div, "div"); try { matches.call(div, "[test!='']:sizzle"); rbuggyMatches.push("!=", pseudos); } catch (e) {} }); rbuggyMatches = new RegExp(rbuggyMatches.join("|")); Sizzle.matchesSelector = function (elem, expr) { expr = expr.replace(rattributeQuotes, "='$1']"); if (!isXML(elem) && !rbuggyMatches.test(expr) && (!rbuggyQSA || !rbuggyQSA.test(expr))) { try { var ret = matches.call(elem, expr); if (ret || disconnectedMatch || elem.document && elem.document.nodeType !== 11) { return ret; } } catch (e) {} } return Sizzle(expr, null, null, [elem]).length > 0; }; } })(); } Expr.pseudos["nth"] = Expr.pseudos["eq"]; function setFilters() {} Expr.filters = setFilters.prototype = Expr.pseudos; Expr.setFilters = new setFilters(); Sizzle.attr = jQuery.attr; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(window); var runtil = /Until$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, rneedsContext = jQuery.expr.match.needsContext, guaranteedUnique = { children: true, contents: true, next : true, prev : true }; jQuery .fn .extend({ add : function (selector, context) { var set = typeof selector === "string" ? jQuery(selector, context) : jQuery.makeArray(selector && selector.nodeType ? [selector] : selector), all = jQuery.merge(this.get(), set); return this.pushStack(isDisconnected(set[0]) || isDisconnected(all[0]) ? all : jQuery.unique(all)); }, addBack: function (selector) { return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)); }, closest: function (selectors, context) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test(selectors) || typeof selectors !== "string" ? jQuery(selectors, context || this.context) : 0; for (; i < l; i += 1) { cur = this[i]; while (cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11) { if (pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors)) { ret.push(cur); break; } cur = cur.parentNode; } } ret = ret.length > 1 ? jQuery.unique(ret) : ret; return this.pushStack(ret, "closest", selectors); }, filter : function (selector) { return this.pushStack(winnow(this, selector, true), "filter", selector); }, find : function (selector) { var i, l, length, n, r, ret, self = this; if (typeof selector !== "string") { return jQuery(selector).filter(function () { for (i = 0, l = self.length; i < l; i += 1) { if (jQuery.contains(self[i], this)) { return true; } } }); } ret = this.pushStack("", "find", selector); for (i = 0, l = this.length; i < l; i += 1) { length = ret.length; jQuery.find(selector, this[i], ret); if (i > 0) { for (n = length; n < ret.length; n += 1) { for (r = 0; r < length; r += 1) { if (ret[r] === ret[n]) { ret.splice(n--, 1); break; } } } } } return ret; }, has : function (target) { var i, targets = jQuery(target, this), len = targets.length; return this.filter(function () { for (i = 0; i < len; i += 1) { if (jQuery.contains(this, targets[i])) { return true; } } }); }, index : function (elem) { if (!elem) { return (this[0] && this[0].parentNode) ? this .prevAll() .length : -1; } if (typeof elem === "string") { return jQuery.inArray(this[0], jQuery(elem)); } return jQuery.inArray(elem.jquery ? elem[0] : elem, this); }, is : function (selector) { return !!selector && (typeof selector === "string" ? rneedsContext.test(selector) ? jQuery(selector, this.context).index(this[0]) >= 0 : jQuery.filter(selector, this).length > 0 : this.filter(selector).length > 0); }, not : function (selector) { return this.pushStack(winnow(this, selector, false), "not", selector); } }); jQuery.fn.andSelf = jQuery.fn.addBack; function isDisconnected(node) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } function sibling(cur, dir) { do { cur = cur[dir]; } while (cur && cur.nodeType !== 1); return cur; } jQuery.each({ children : function (elem) { return jQuery.sibling(elem.firstChild); }, contents : function (elem) { return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.merge([], elem.childNodes); }, next : function (elem) { return sibling(elem, "nextSibling"); }, nextAll : function (elem) { return jQuery.dir(elem, "nextSibling"); }, nextUntil : function (elem, i, until) { return jQuery.dir(elem, "nextSibling", until); }, parent : function (elem) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents : function (elem) { return jQuery.dir(elem, "parentNode"); }, parentsUntil: function (elem, i, until) { return jQuery.dir(elem, "parentNode", until); }, prev : function (elem) { return sibling(elem, "previousSibling"); }, prevAll : function (elem) { return jQuery.dir(elem, "previousSibling"); }, prevUntil : function (elem, i, until) { return jQuery.dir(elem, "previousSibling", until); }, siblings : function (elem) { return jQuery.sibling((elem.parentNode || {}).firstChild, elem); } }, function (name, fn) { jQuery.fn[name] = function (until, selector) { var ret = jQuery.map(this, fn, until); if (!runtil.test(name)) { selector = until; } if (selector && typeof selector === "string") { ret = jQuery.filter(selector, ret); } ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret; if (this.length > 1 && rparentsprev.test(name)) { ret = ret.reverse(); } return this.pushStack(ret, name, core_slice.call(arguments).join(",")); }; }); jQuery.extend({ dir : function (elem, dir, until) { var matched = [], cur = elem[dir]; while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) { if (cur.nodeType === 1) { matched.push(cur); } cur = cur[dir]; } return matched; }, filter : function (expr, elems, not) { if (not) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery .find .matchesSelector(elems[0], expr) ? [elems[0]] : [] : jQuery .find .matches(expr, elems); }, sibling: function (n, elem) { var r = []; for (; n; n = n.nextSibling) { if (n.nodeType === 1 && n !== elem) { r.push(n); } } return r; } }); function winnow(elements, qualifier, keep) { qualifier = qualifier || 0; if (jQuery.isFunction(qualifier)) { return jQuery.grep(elements, function (elem, i) { var retVal = !!qualifier.call(elem, i, elem); return retVal === keep; }); } else if (qualifier.nodeType) { return jQuery.grep(elements, function (elem, i) { return (elem === qualifier) === keep; }); } else if (typeof qualifier === "string") { var filtered = jQuery.grep(elements, function (elem) { return elem.nodeType === 1; }); if (isSimple.test(qualifier)) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter(qualifier, filtered); } } return jQuery.grep(elements, function (elem, i) { return (jQuery.inArray(elem, qualifier) >= 0) === keep; }); } function createSafeFragment(document) { var list = nodeNames.split("|"), safeFrag = document.createDocumentFragment(); if (safeFrag.createElement) { while (list.length) { safeFrag.createElement(list.pop()); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|fo" + "oter|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /]", "i"), rcheckableType = /^(?:checkbox|radio)$/, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /\/(java|ecma)script/i, rcleanScript = /^\s*\s*$/g, wrapMap = { _default: [ 0, "", "" ], area : [ 1, "", "" ], col : [ 2, "", "
" ], legend : [ 1, "
", "
" ], option : [ 1, "" ], td : [ 3, "", "
" ], thead : [ 1, "", "
" ], tr : [2, "", "
"] }, safeFragment = createSafeFragment(document), fragmentDiv = safeFragment.appendChild(document.createElement("div")); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; if (!jQuery.support.htmlSerialize) { wrapMap._default = [1, "X
", "
"]; } jQuery .fn .extend({ after : function () { if (!isDisconnected(this[0])) { return this.domManip(arguments, false, function (elem) { this .parentNode .insertBefore(elem, this.nextSibling); }); } if (arguments.length) { var set = jQuery.clean(arguments); return this.pushStack(jQuery.merge(this, set), "after", this.selector); } }, append : function () { return this.domManip(arguments, true, function (elem) { if (this.nodeType === 1 || this.nodeType === 11) { this.appendChild(elem); } }); }, before : function () { if (!isDisconnected(this[0])) { return this.domManip(arguments, false, function (elem) { this .parentNode .insertBefore(elem, this); }); } if (arguments.length) { var set = jQuery.clean(arguments); return this.pushStack(jQuery.merge(set, this), "before", this.selector); } }, clone : function (dataAndEvents, deepDataAndEvents) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function () { return jQuery.clone(this, dataAndEvents, deepDataAndEvents); }); }, detach : function (selector) { return this.remove(selector, true); }, domManip : function (args, table, callback) { args = [] .concat .apply([], args); var results, first, fragment, iNoClone, i = 0, value = args[0], scripts = [], l = this.length; if (!jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test(value)) { return this.each(function () { jQuery(this).domManip(args, table, callback); }); } if (jQuery.isFunction(value)) { return this.each(function (i) { var self = jQuery(this); args[0] = value.call(this, i, table ? self.html() : undefined); self.domManip(args, table, callback); }); } if (this[0]) { results = jQuery.buildFragment(args, this, scripts); fragment = results.fragment; first = fragment.firstChild; if (fragment.childNodes.length === 1) { fragment = first; } if (first) { table = table && jQuery.nodeName(first, "tr"); for (iNoClone = results.cacheable || l - 1; i < l; i += 1) { callback.call(table && jQuery.nodeName(this[i], "table") ? findOrAppend(this[i], "tbody") : this[i], i === iNoClone ? fragment : jQuery.clone(fragment, true, true)); } } fragment = first = null; if (scripts.length) { jQuery.each(scripts, function (i, elem) { if (elem.src) { if (jQuery.ajax) { jQuery.ajax({ "throws": true, async : false, dataType: "script", global : false, type : "GET", url : elem.src }); } else { jQuery.error("no ajax"); } } else { jQuery.globalEval((elem.text || elem.textContent || elem.innerHTML || "").replace(rcleanScript, "")); } if (elem.parentNode) { elem .parentNode .removeChild(elem); } }); } } return this; }, empty : function () { var elem, i = 0; for (; (elem = this[i]) != null; i += 1) { if (elem.nodeType === 1) { jQuery.cleanData(elem.getElementsByTagName("*")); } while (elem.firstChild) { elem.removeChild(elem.firstChild); } } return this; }, html : function (value) { return jQuery.access(this, function (value) { var elem = this[0] || {}, i = 0, l = this.length; if (value === undefined) { return elem.nodeType === 1 ? elem .innerHTML .replace(rinlinejQuery, "") : undefined; } if (typeof value === "string" && !rnoInnerhtml.test(value) && (jQuery.support.htmlSerialize || !rnoshimcache.test(value)) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test(value)) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { value = value.replace(rxhtmlTag, "<$1>"); try { for (; i < l; i += 1) { elem = this[i] || {}; if (elem.nodeType === 1) { jQuery.cleanData(elem.getElementsByTagName("*")); elem.innerHTML = value; } } elem = 0; } catch (e) {} } if (elem) { this .empty() .append(value); } }, null, value, arguments.length); }, prepend : function () { return this.domManip(arguments, true, function (elem) { if (this.nodeType === 1 || this.nodeType === 11) { this.insertBefore(elem, this.firstChild); } }); }, remove : function (selector, keepData) { var elem, i = 0; for (; (elem = this[i]) != null; i += 1) { if (!selector || jQuery.filter(selector, [elem]).length) { if (!keepData && elem.nodeType === 1) { jQuery.cleanData(elem.getElementsByTagName("*")); jQuery.cleanData([elem]); } if (elem.parentNode) { elem .parentNode .removeChild(elem); } } } return this; }, replaceWith: function (value) { if (!isDisconnected(this[0])) { if (jQuery.isFunction(value)) { return this.each(function (i) { var self = jQuery(this), old = self.html(); self.replaceWith(value.call(this, i, old)); }); } if (typeof value !== "string") { value = jQuery(value).detach(); } return this.each(function () { var next = this.nextSibling, parent = this.parentNode; jQuery(this).remove(); if (next) { jQuery(next).before(value); } else { jQuery(parent).append(value); } }); } return this.length ? this.pushStack(jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value) : this; }, text : function (value) { return jQuery.access(this, function (value) { return value === undefined ? jQuery.text(this) : this .empty() .append((this[0] && this[0].ownerDocument || document).createTextNode(value)); }, null, value, arguments.length); }, unwrap : function () { return this .parent() .each(function () { if (!jQuery.nodeName(this, "body")) { jQuery(this).replaceWith(this.childNodes); } }) .end(); }, wrap : function (html) { var isFunction = jQuery.isFunction(html); return this.each(function (i) { jQuery(this).wrapAll(isFunction ? html.call(this, i) : html); }); }, wrapAll : function (html) { if (jQuery.isFunction(html)) { return this.each(function (i) { jQuery(this).wrapAll(html.call(this, i)); }); } if (this[0]) { var wrap = jQuery(html, this[0].ownerDocument) .eq(0) .clone(true); if (this[0].parentNode) { wrap.insertBefore(this[0]); } wrap .map(function () { var elem = this; while (elem.firstChild && elem.firstChild.nodeType === 1) { elem = elem.firstChild; } return elem; }) .append(this); } return this; }, wrapInner : function (html) { if (jQuery.isFunction(html)) { return this.each(function (i) { jQuery(this).wrapInner(html.call(this, i)); }); } return this.each(function () { var self = jQuery(this), contents = self.contents(); if (contents.length) { contents.wrapAll(html); } else { self.append(html); } }); } }); function findOrAppend(elem, tag) { return elem.getElementsByTagName(tag)[0] || elem.appendChild(elem.ownerDocument.createElement(tag)); } function cloneCopyEvent(src, dest) { if (dest.nodeType !== 1 || !jQuery.hasData(src)) { return; } var type, i, l, oldData = jQuery._data(src), curData = jQuery._data(dest, oldData), events = oldData.events; if (events) { delete curData.handle; curData.events = {}; for (type in events) { for (i = 0, l = events[type].length; i < l; i += 1) { jQuery .event .add(dest, type, events[type][i]); } } } if (curData.data) { curData.data = jQuery.extend({}, curData.data); } } function cloneFixAttributes(src, dest) { var nodeName; if (dest.nodeType !== 1) { return; } if (dest.clearAttributes) { dest.clearAttributes(); } if (dest.mergeAttributes) { dest.mergeAttributes(src); } nodeName = dest .nodeName .toLowerCase(); if (nodeName === "object") { if (dest.parentNode) { dest.outerHTML = src.outerHTML; } if (jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML))) { dest.innerHTML = src.innerHTML; } } else if (nodeName === "input" && rcheckableType.test(src.type)) { dest.defaultChecked = dest.checked = src.checked; if (dest.value !== src.value) { dest.value = src.value; } } else if (nodeName === "option") { dest.selected = src.defaultSelected; } else if (nodeName === "input" || nodeName === "textarea") { dest.defaultValue = src.defaultValue; } else if (nodeName === "script" && dest.text !== src.text) { dest.text = src.text; } dest.removeAttribute(jQuery.expando); } jQuery.buildFragment = function (args, context, scripts) { var fragment, cacheable, cachehit, first = args[0]; context = context || document; context = !context.nodeType && context[0] || context; context = context.ownerDocument || context; if (args.length === 1 && typeof first === "string" && first.length < 512 && context === document && first.charAt(0) === "<" && !rnocache.test(first) && (jQuery.support.checkClone || !rchecked.test(first)) && (jQuery.support.html5Clone || !rnoshimcache.test(first))) { cacheable = true; fragment = jQuery.fragments[first]; cachehit = fragment !== undefined; } if (!fragment) { fragment = context.createDocumentFragment(); jQuery.clean(args, context, fragment, scripts); if (cacheable) { jQuery.fragments[first] = cachehit && fragment; } } return {cacheable: cacheable, fragment: fragment}; }; jQuery.fragments = {}; jQuery.each({ appendTo : "append", insertAfter : "after", insertBefore: "before", prependTo : "prepend", replaceAll : "replaceWith" }, function (name, original) { jQuery.fn[name] = function (selector) { var elems, i = 0, ret = [], insert = jQuery(selector), l = insert.length, parent = this.length === 1 && this[0].parentNode; if ((parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1) { insert[original](this[0]); return this; } else { for (; i < l; i += 1) { elems = (i > 0 ? this.clone(true) : this).get(); jQuery(insert[i])[original](elems); ret = ret.concat(elems); } return this.pushStack(ret, name, insert.selector); } }; }); function getAll(elem) { if (typeof elem.getElementsByTagName !== "undefined") { return elem.getElementsByTagName("*"); } else if (typeof elem.querySelectorAll !== "undefined") { return elem.querySelectorAll("*"); } else { return []; } } function fixDefaultChecked(elem) { if (rcheckableType.test(elem.type)) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clean : function (elems, context, fragment, scripts) { var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags, safe = context === document && safeFragment, ret = []; if (!context || typeof context.createDocumentFragment === "undefined") { context = document; } for (i = 0; (elem = elems[i]) != null; i += 1) { if (typeof elem === "number") { elem += ""; } if (!elem) { continue; } if (typeof elem === "string") { if (!rhtml.test(elem)) { elem = context.createTextNode(elem); } else { safe = safe || createSafeFragment(context); div = context.createElement("div"); safe.appendChild(div); elem = elem.replace(rxhtmlTag, "<$1>"); tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); wrap = wrapMap[tag] || wrapMap._default; depth = wrap[0]; div.innerHTML = wrap[1] + elem + wrap[2]; while (depth--) { div = div.lastChild; } if (!jQuery.support.tbody) { hasBody = rtbody.test(elem); tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : wrap[1] === "" && !hasBody ? div.childNodes : []; for (j = tbody.length - 1; j >= 0; j -= 1) { if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) { tbody[j] .parentNode .removeChild(tbody[j]); } } } if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(elem)) { div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]), div.firstChild); } elem = div.childNodes; div .parentNode .removeChild(div); } } if (elem.nodeType) { ret.push(elem); } else { jQuery.merge(ret, elem); } } if (div) { elem = div = safe = null; } if (!jQuery.support.appendChecked) { for (i = 0; (elem = ret[i]) != null; i += 1) { if (jQuery.nodeName(elem, "input")) { fixDefaultChecked(elem); } else if (typeof elem.getElementsByTagName !== "undefined") { jQuery.grep(elem.getElementsByTagName("input"), fixDefaultChecked); } } } if (fragment) { handleScript = function (elem) { if (!elem.type || rscriptType.test(elem.type)) { return scripts ? scripts.push(elem.parentNode ? elem.parentNode.removeChild(elem) : elem) : fragment.appendChild(elem); } }; for (i = 0; (elem = ret[i]) != null; i += 1) { if (!(jQuery.nodeName(elem, "script") && handleScript(elem))) { fragment.appendChild(elem); if (typeof elem.getElementsByTagName !== "undefined") { jsTags = jQuery.grep(jQuery.merge([], elem.getElementsByTagName("script")), handleScript); ret .splice .apply(ret, [ i + 1, 0 ].concat(jsTags)); i += jsTags.length; } } } } return ret; }, cleanData: function (elems, acceptData) { var data, id, elem, type, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for (; (elem = elems[i]) != null; i += 1) { if (acceptData || jQuery.acceptData(elem)) { id = elem[internalKey]; data = id && cache[id]; if (data) { if (data.events) { for (type in data.events) { if (special[type]) { jQuery .event .remove(elem, type); } else { jQuery.removeEvent(elem, type, data.handle); } } } if (cache[id]) { delete cache[id]; if (deleteExpando) { delete elem[internalKey]; } else if (elem.removeAttribute) { elem.removeAttribute(internalKey); } else { elem[internalKey] = null; } jQuery .deletedIds .push(id); } } } } }, clone : function (elem, dataAndEvents, deepDataAndEvents) { var srcElements, destElements, i, clone; if (jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) { clone = elem.cloneNode(true); } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild(clone = fragmentDiv.firstChild); } if ((!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) { cloneFixAttributes(elem, clone); srcElements = getAll(elem); destElements = getAll(clone); for (i = 0; srcElements[i]; i += 1) { if (destElements[i]) { cloneFixAttributes(srcElements[i], destElements[i]); } } } if (dataAndEvents) { cloneCopyEvent(elem, clone); if (deepDataAndEvents) { srcElements = getAll(elem); destElements = getAll(clone); for (i = 0; srcElements[i]; i += 1) { cloneCopyEvent(srcElements[i], destElements[i]); } } } srcElements = destElements = null; return clone; } }); (function () { var matched, browser; jQuery.uaMatch = function (ua) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || []; return { browser: match[1] || "", version: match[2] || "0" }; }; matched = jQuery.uaMatch(navigator.userAgent); browser = {}; if (matched.browser) { browser[matched.browser] = true; browser.version = matched.version; } if (browser.chrome) { browser.webkit = true; } else if (browser.webkit) { browser.safari = true; } jQuery.browser = browser; jQuery.sub = function () { function jQuerySub(selector, context) { return new jQuerySub .fn .init(selector, context); } jQuery.extend(true, jQuerySub, this); jQuerySub.superclass = this; jQuerySub.fn = jQuerySub.prototype = this(); jQuerySub.fn.constructor = jQuerySub; jQuerySub.sub = this.sub; jQuerySub.fn.init = function init(selector, context) { if (context && context instanceof jQuery && !(context instanceof jQuerySub)) { context = jQuerySub(context); } return jQuery .fn .init .call(this, selector, context, rootjQuerySub); }; jQuerySub.fn.init.prototype = jQuerySub.fn; var rootjQuerySub = jQuerySub(document); return jQuerySub; }; })(); var curCSS, iframe, iframeDoc, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, rposition = /^(top|right|bottom|left)$/, rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp("^(" + core_pnum + ")(.*)$", "i"), rnumnonpx = new RegExp("^(" + core_pnum + ")(?!px)[a-z%]+$", "i"), rrelNum = new RegExp("^([-+])=(" + core_pnum + ")", "i"), elemdisplay = {}, cssShow = { display : "block", position : "absolute", visibility: "hidden" }, cssNormalTransform = { fontWeight : 400, letterSpacing: 0 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], eventsToggle = jQuery.fn.toggle; function vendorPropName(style, name) { if (name in style) { return name; } var capName = name .charAt(0) .toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while (i--) { name = cssPrefixes[i] + capName; if (name in style) { return name; } } return origName; } function isHidden(elem, el) { elem = el || elem; return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem); } function showHide(elements, show) { var elem, display, values = [], index = 0, length = elements.length; for (; index < length; index += 1) { elem = elements[index]; if (!elem.style) { continue; } values[index] = jQuery._data(elem, "olddisplay"); if (show) { if (!values[index] && elem.style.display === "none") { elem.style.display = ""; } if (elem.style.display === "" && isHidden(elem)) { values[index] = jQuery._data(elem, "olddisplay", css_defaultDisplay(elem.nodeName)); } } else { display = curCSS(elem, "display"); if (!values[index] && display !== "none") { jQuery._data(elem, "olddisplay", display); } } } for (index = 0; index < length; index += 1) { elem = elements[index]; if (!elem.style) { continue; } if (!show || elem.style.display === "none" || elem.style.display === "") { elem.style.display = show ? values[index] || "" : "none"; } } return elements; } jQuery .fn .extend({ css : function (name, value) { return jQuery.access(this, function (elem, name, value) { return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name); }, name, value, arguments.length > 1); }, hide : function () { return showHide(this); }, show : function () { return showHide(this, true); }, toggle: function (state, fn2) { var bool = typeof state === "boolean"; if (jQuery.isFunction(state) && jQuery.isFunction(fn2)) { return eventsToggle.apply(this, arguments); } return this.each(function () { if (bool ? state : isHidden(this)) { jQuery(this).show(); } else { jQuery(this).hide(); } }); } }); jQuery.extend({ css : function (elem, name, numeric, extra) { var val, num, hooks, origName = jQuery.camelCase(name); name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)); hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; if (hooks && "get" in hooks) { val = hooks.get(elem, true, extra); } if (val === undefined) { val = curCSS(elem, name); } if (val === "normal" && name in cssNormalTransform) { val = cssNormalTransform[name]; } if (numeric || extra !== undefined) { num = parseFloat(val); return numeric || jQuery.isNumeric(num) ? num || 0 : val; } return val; }, cssHooks : { opacity: { get: function (elem, computed) { if (computed) { var ret = curCSS(elem, "opacity"); return ret === "" ? "1" : ret; } } } }, cssNumber: { "fillOpacity": true, "fontWeight" : true, "lineHeight" : true, "opacity" : true, "orphans" : true, "widows" : true, "zIndex" : true, "zoom" : true }, cssProps : { "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, style : function (elem, name, value, extra) { if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { return; } var ret, type, hooks, origName = jQuery.camelCase(name), style = elem.style; name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)); hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; if (value !== undefined) { type = typeof value; if (type === "string" && (ret = rrelNum.exec(value))) { value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)); type = "number"; } if (value == null || type === "number" && isNaN(value)) { return; } if (type === "number" && !jQuery.cssNumber[origName]) { value += "px"; } if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) { try { style[name] = value; } catch (e) {} } } else { if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) { return ret; } return style[name]; } }, swap : function (elem, options, callback) { var ret, name, old = {}; for (name in options) { old[name] = elem.style[name]; elem.style[name] = options[name]; } ret = callback.call(elem); for (name in options) { elem.style[name] = old[name]; } return ret; } }); if (window.getComputedStyle) { curCSS = function (elem, name) { var ret, width, minWidth, maxWidth, computed = window.getComputedStyle(elem, null), style = elem.style; if (computed) { ret = computed[name]; if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) { ret = jQuery.style(elem, name); } if (rnumnonpx.test(ret) && rmargin.test(name)) { width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if (document.documentElement.currentStyle) { curCSS = function (elem, name) { var left, rsLeft, ret = elem.currentStyle && elem.currentStyle[name], style = elem.style; if (ret == null && style && style[name]) { ret = style[name]; } if (rnumnonpx.test(ret) && !rposition.test(name)) { left = style.left; rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; if (rsLeft) { elem.runtimeStyle.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; style.left = left; if (rsLeft) { elem.runtimeStyle.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber(elem, value, subtract) { var matches = rnumsplit.exec(value); return matches ? Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") : value; } function augmentWidthOrHeight(elem, name, extra, isBorderBox) { var i = extra === (isBorderBox ? "border" : "content") ? 4 : name === "width" ? 1 : 0, val = 0; for (; i < 4; i += 2) { if (extra === "margin") { val += jQuery.css(elem, extra + cssExpand[i], true); } if (isBorderBox) { if (extra === "content") { val -= parseFloat(curCSS(elem, "padding" + cssExpand[i])) || 0; } if (extra !== "margin") { val -= parseFloat(curCSS(elem, "border" + cssExpand[i] + "Width")) || 0; } } else { val += parseFloat(curCSS(elem, "padding" + cssExpand[i])) || 0; if (extra !== "padding") { val += parseFloat(curCSS(elem, "border" + cssExpand[i] + "Width")) || 0; } } } return val; } function getWidthOrHeight(elem, name, extra) { var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, valueIsBorderBox = true, isBorderBox = jQuery.support.boxSizing && jQuery.css(elem, "boxSizing") === "border-box"; if (val <= 0 || val == null) { val = curCSS(elem, name); if (val < 0 || val == null) { val = elem.style[name]; } if (rnumnonpx.test(val)) { return val; } valueIsBorderBox = isBorderBox && (jQuery.support.boxSizingReliable || val === elem.style[name]); val = parseFloat(val) || 0; } return (val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox)) + "px"; } function css_defaultDisplay(nodeName) { if (elemdisplay[nodeName]) { return elemdisplay[nodeName]; } var elem = jQuery("<" + nodeName + ">").appendTo(document.body), display = elem.css("display"); elem.remove(); if (display === "none" || display === "") { iframe = document .body .appendChild(iframe || jQuery.extend(document.createElement("iframe"), { frameBorder: 0, height : 0, width : 0 })); if (!iframeDoc || !iframe.createElement) { iframeDoc = (iframe.contentWindow || iframe.contentDocument).document; iframeDoc.write(""); iframeDoc.close(); } elem = iframeDoc .body .appendChild(iframeDoc.createElement(nodeName)); display = curCSS(elem, "display"); document .body .removeChild(iframe); } elemdisplay[nodeName] = display; return display; } jQuery.each([ "height", "width" ], function (i, name) { jQuery.cssHooks[name] = { get: function (elem, computed, extra) { if (computed) { if (elem.offsetWidth === 0 && rdisplayswap.test(curCSS(elem, "display"))) { return jQuery.swap(elem, cssShow, function () { return getWidthOrHeight(elem, name, extra); }); } else { return getWidthOrHeight(elem, name, extra); } } }, set: function (elem, value, extra) { return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, jQuery.support.boxSizing && jQuery.css(elem, "boxSizing") === "border-box") : 0); } }; }); if (!jQuery.support.opacity) { jQuery.cssHooks.opacity = { get: function (elem, computed) { return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? (0.01 * parseFloat(RegExp.$1)) + "" : computed ? "1" : ""; }, set: function (elem, value) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric(value) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; style.zoom = 1; if (value >= 1 && jQuery.trim(filter.replace(ralpha, "")) === "" && style.removeAttribute) { style.removeAttribute("filter"); if (currentStyle && !currentStyle.filter) { return; } } style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : filter + " " + opacity; } }; } jQuery(function () { if (!jQuery.support.reliableMarginRight) { jQuery.cssHooks.marginRight = { get: function (elem, computed) { return jQuery.swap(elem, { "display": "inline-block" }, function () { if (computed) { return curCSS(elem, "marginRight"); } }); } }; } if (!jQuery.support.pixelPosition && jQuery.fn.position) { jQuery.each([ "top", "left" ], function (i, prop) { jQuery.cssHooks[prop] = { get: function (elem, computed) { if (computed) { var ret = curCSS(elem, prop); return rnumnonpx.test(ret) ? jQuery(elem).position()[prop] + "px" : ret; } } }; }); } }); if (jQuery.expr && jQuery.expr.filters) { jQuery.expr.filters.hidden = function (elem) { return (elem.offsetWidth === 0 && elem.offsetHeight === 0) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS(elem, "display")) === "none"); }; jQuery.expr.filters.visible = function (elem) { return !jQuery .expr .filters .hidden(elem); }; } jQuery.each({ border : "Width", margin : "", padding: "" }, function (prefix, suffix) { jQuery.cssHooks[prefix + suffix] = { expand: function (value) { var i, parts = typeof value === "string" ? value.split(" ") : [value], expanded = {}; for (i = 0; i < 4; i += 1) { expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; } return expanded; } }; if (!rmargin.test(prefix)) { jQuery .cssHooks[prefix + suffix] .set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, rselectTextarea = /^(?:select|textarea)/i; jQuery .fn .extend({ serialize : function () { return jQuery.param(this.serializeArray()); }, serializeArray: function () { return this .map(function () { return this.elements ? jQuery.makeArray(this.elements) : this; }) .filter(function () { return this.name && !this.disabled && (this.checked || rselectTextarea.test(this.nodeName) || rinput.test(this.type)); }) .map(function (i, elem) { var val = jQuery(this).val(); return val == null ? null : jQuery.isArray(val) ? jQuery.map(val, function (val, i) { return { name : elem.name, value: val.replace(rCRLF, "\r\n") }; }) : { name : elem.name, value: val.replace(rCRLF, "\r\n") }; }) .get(); } }); jQuery.param = function (a, traditional) { var prefix, s = [], add = function (key, value) { value = jQuery.isFunction(value) ? value() : (value == null ? "" : value); s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value); }; if (traditional === undefined) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) { jQuery.each(a, function () { add(this.name, this.value); }); } else { for (prefix in a) { buildParams(prefix, a[prefix], traditional, add); } } return s .join("&") .replace(r20, "+"); }; function buildParams(prefix, obj, traditional, add) { var name; if (jQuery.isArray(obj)) { jQuery.each(obj, function (i, v) { if (traditional || rbracket.test(prefix)) { add(prefix, v); } else { buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add); } }); } else if (!traditional && jQuery.type(obj) === "object") { for (name in obj) { buildParams(prefix + "[" + name + "]", obj[name], traditional, add); } } else { add(prefix, obj); } } var ajaxLocParts, ajaxLocation, rhash = /#.*$/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rquery = /\?/, rscript = /)<[^<]*)*<\/script>/gi, rts = /([?&])_=[^&]*/, rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, _load = jQuery.fn.load, prefilters = {}, transports = {}, allTypes = ["*/"] + ["*"]; try { ajaxLocation = location.href; } catch (e) { ajaxLocation = document.createElement("a"); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []; function addToPrefiltersOrTransports(structure) { return function (dataTypeExpression, func) { if (typeof dataTypeExpression !== "string") { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, list, placeBefore, dataTypes = dataTypeExpression .toLowerCase() .split(core_rspace), i = 0, length = dataTypes.length; if (jQuery.isFunction(func)) { for (; i < length; i += 1) { dataType = dataTypes[i]; placeBefore = /^\+/.test(dataType); if (placeBefore) { dataType = dataType.substr(1) || "*"; } list = structure[dataType] = structure[dataType] || []; list[ placeBefore ? "unshift" : "push" ](func); } } }; } function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR, dataType, inspected) { dataType = dataType || options.dataTypes[0]; inspected = inspected || {}; inspected[dataType] = true; var selection, list = structure[dataType], i = 0, length = list ? list.length : 0, executeOnly = (structure === prefilters); for (; i < length && (executeOnly || !selection); i += 1) { selection = list[i](options, originalOptions, jqXHR); if (typeof selection === "string") { if (!executeOnly || inspected[selection]) { selection = undefined; } else { options .dataTypes .unshift(selection); selection = inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR, selection, inspected); } } } if ((executeOnly || !selection) && !inspected["*"]) { selection = inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR, "*", inspected); } return selection; } function ajaxExtend(target, src) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for (key in src) { if (src[key] !== undefined) { (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key]; } } if (deep) { jQuery.extend(true, target, deep); } } jQuery.fn.load = function (url, params, callback) { if (typeof url !== "string" && _load) { return _load.apply(this, arguments); } if (!this.length) { return this; } var selector, type, response, self = this, off = url.indexOf(" "); if (off >= 0) { selector = url.slice(off, url.length); url = url.slice(0, off); } if (jQuery.isFunction(params)) { callback = params; params = undefined; } else if (params && typeof params === "object") { type = "POST"; } jQuery .ajax({ complete: function (jqXHR, status) { if (callback) { self.each(callback, response || [jqXHR.responseText, status, jqXHR]); } }, data : params, dataType: "html", type : type, url : url }) .done(function (responseText) { response = arguments; self.html(selector ? jQuery("
").append(responseText.replace(rscript, "")).find(selector) : responseText); }); return this; }; jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (i, o) { jQuery.fn[o] = function (f) { return this.on(o, f); }; }); jQuery.each([ "get", "post" ], function (i, method) { jQuery[method] = function (url, data, callback, type) { if (jQuery.isFunction(data)) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({data: data, dataType: type, success: callback, type: method, url: url}); }; }); jQuery.extend({ active : 0, ajax : function (url, options) { if (typeof url === "object") { options = url; url = undefined; } options = options || {}; var ifModifiedKey, responseHeadersString, responseHeaders, transport, timeoutTimer, parts, fireGlobals, i, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = callbackContext !== s && (callbackContext.nodeType || callbackContext instanceof jQuery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, state = 0, strAbort = "canceled", jqXHR = { abort : function (statusText) { statusText = statusText || strAbort; if (transport) { transport.abort(statusText); } done(0, statusText); return this; }, getAllResponseHeaders: function () { return state === 2 ? responseHeadersString : null; }, getResponseHeader : function (key) { var match; if (state === 2) { if (!responseHeaders) { responseHeaders = {}; while ((match = rheaders.exec(responseHeadersString))) { responseHeaders[match[1].toLowerCase()] = match[2]; } } match = responseHeaders[key.toLowerCase()]; } return match === undefined ? null : match; }, overrideMimeType : function (type) { if (!state) { s.mimeType = type; } return this; }, readyState : 0, setRequestHeader : function (name, value) { if (!state) { var lname = name.toLowerCase(); name = requestHeadersNames[lname] = requestHeadersNames[lname] || name; requestHeaders[name] = value; } return this; } }; function done(status, nativeStatusText, responses, headers) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; if (state === 2) { return; } state = 2; if (timeoutTimer) { clearTimeout(timeoutTimer); } transport = undefined; responseHeadersString = headers || ""; jqXHR.readyState = status > 0 ? 4 : 0; if (responses) { response = ajaxHandleResponses(s, jqXHR, responses); } if (status >= 200 && status < 300 || status === 304) { if (s.ifModified) { modified = jqXHR.getResponseHeader("Last-Modified"); if (modified) { jQuery.lastModified[ifModifiedKey] = modified; } modified = jqXHR.getResponseHeader("Etag"); if (modified) { jQuery.etag[ifModifiedKey] = modified; } } if (status === 304) { statusText = "notmodified"; isSuccess = true; } else { isSuccess = ajaxConvert(s, response); statusText = isSuccess.state; success = isSuccess.data; error = isSuccess.error; isSuccess = !error; } } else { error = statusText; if (!statusText || status) { statusText = "error"; if (status < 0) { status = 0; } } } jqXHR.status = status; jqXHR.statusText = (nativeStatusText || statusText) + ""; if (isSuccess) { deferred.resolveWith(callbackContext, [success, statusText, jqXHR]); } else { deferred.rejectWith(callbackContext, [jqXHR, statusText, error]); } jqXHR.statusCode(statusCode); statusCode = undefined; if (fireGlobals) { globalEventContext.trigger("ajax" + (isSuccess ? "Success" : "Error"), [ jqXHR, s, isSuccess ? success : error ]); } completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); if (fireGlobals) { globalEventContext.trigger("ajaxComplete", [jqXHR, s]); if (!(--jQuery.active)) { jQuery .event .trigger("ajaxStop"); } } } deferred.promise(jqXHR); jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; jqXHR.complete = completeDeferred.add; jqXHR.statusCode = function (map) { if (map) { var tmp; if (state < 2) { for (tmp in map) { statusCode[tmp] = [ statusCode[tmp], map[tmp] ]; } } else { tmp = map[jqXHR.status]; jqXHR.always(tmp); } } return this; }; s.url = ((url || s.url) + "") .replace(rhash, "") .replace(rprotocol, ajaxLocParts[1] + "//"); s.dataTypes = jQuery .trim(s.dataType || "*") .toLowerCase() .split(core_rspace); if (s.crossDomain == null) { parts = rurl.exec(s.url.toLowerCase()) || false; s.crossDomain = parts && (parts.join(":") + (parts[3] ? "" : parts[1] === "http:" ? 80 : 443)) !== (ajaxLocParts.join(":") + (ajaxLocParts[3] ? "" : ajaxLocParts[1] === "http:" ? 80 : 443)); } if (s.data && s.processData && typeof s.data !== "string") { s.data = jQuery.param(s.data, s.traditional); } inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); if (state === 2) { return jqXHR; } fireGlobals = s.global; s.type = s .type .toUpperCase(); s.hasContent = !rnoContent.test(s.type); if (fireGlobals && jQuery.active++ === 0) { jQuery .event .trigger("ajaxStart"); } if (!s.hasContent) { if (s.data) { s.url += (rquery.test(s.url) ? "&" : "?") + s.data; delete s.data; } ifModifiedKey = s.url; if (s.cache === false) { var ts = jQuery.now(), ret = s .url .replace(rts, "$1_=" + ts); s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); } } if (s.data && s.hasContent && s.contentType !== false || options.contentType) { jqXHR.setRequestHeader("Content-Type", s.contentType); } if (s.ifModified) { ifModifiedKey = ifModifiedKey || s.url; if (jQuery.lastModified[ifModifiedKey]) { jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[ifModifiedKey]); } if (jQuery.etag[ifModifiedKey]) { jqXHR.setRequestHeader("If-None-Match", jQuery.etag[ifModifiedKey]); } } jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]); for (i in s.headers) { jqXHR.setRequestHeader(i, s.headers[i]); } if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) { return jqXHR.abort(); } strAbort = "abort"; for (i in {complete: 1, error: 1, success: 1}) { jqXHR[i](s[i]); } transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); if (!transport) { done(-1, "No Transport"); } else { jqXHR.readyState = 1; if (fireGlobals) { globalEventContext.trigger("ajaxSend", [jqXHR, s]); } if (s.async && s.timeout > 0) { timeoutTimer = setTimeout(function () { jqXHR.abort("timeout"); }, s.timeout); } try { state = 1; transport.send(requestHeaders, done); } catch (e) { if (state < 2) { done(-1, e); } else { throw e; } } } return jqXHR; }, ajaxPrefilter: addToPrefiltersOrTransports(prefilters), ajaxSettings : { accepts : { "*" : allTypes, html: "text/html", json: "application/json, text/javascript", text: "text/plain", xml : "application/xml, text/xml" }, async : true, contents : { html: /html/, json: /json/, xml : /xml/ }, contentType : "application/x-www-form-urlencoded; charset=UTF-8", converters : { "* text" : window.String, "text html": true, "text json": jQuery.parseJSON, "text xml" : jQuery.parseXML }, flatOptions : { context: true, url : true }, global : true, isLocal : rlocalProtocol.test(ajaxLocParts[1]), processData : true, responseFields: { text: "responseText", xml : "responseXML" }, type : "GET", url : ajaxLocation }, ajaxSetup : function (target, settings) { if (settings) { ajaxExtend(target, jQuery.ajaxSettings); } else { settings = target; target = jQuery.ajaxSettings; } ajaxExtend(target, settings); return target; }, ajaxTransport: addToPrefiltersOrTransports(transports), etag : {}, getJSON : function (url, data, callback) { return jQuery.get(url, data, callback, "json"); }, getScript : function (url, callback) { return jQuery.get(url, undefined, callback, "script"); }, lastModified : {} }); function ajaxHandleResponses(s, jqXHR, responses) { var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields; for (type in responseFields) { if (type in responses) { jqXHR[responseFields[type]] = responses[type]; } } while (dataTypes[0] === "*") { dataTypes.shift(); if (ct === undefined) { ct = s.mimeType || jqXHR.getResponseHeader("content-type"); } } if (ct) { for (type in contents) { if (contents[type] && contents[type].test(ct)) { dataTypes.unshift(type); break; } } } if (dataTypes[0] in responses) { finalDataType = dataTypes[0]; } else { for (type in responses) { if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { finalDataType = type; break; } if (!firstDataType) { firstDataType = type; } } finalDataType = finalDataType || firstDataType; } if (finalDataType) { if (finalDataType !== dataTypes[0]) { dataTypes.unshift(finalDataType); } return responses[finalDataType]; } } function ajaxConvert(s, response) { var conv, conv2, current, tmp, dataTypes = s .dataTypes .slice(), prev = dataTypes[0], converters = {}, i = 0; if (s.dataFilter) { response = s.dataFilter(response, s.dataType); } if (dataTypes[1]) { for (conv in s.converters) { converters[conv.toLowerCase()] = s.converters[conv]; } } for (; (current = dataTypes[i += 1]);) { if (current !== "*") { if (prev !== "*" && prev !== current) { conv = converters[prev + " " + current] || converters["* " + current]; if (!conv) { for (conv2 in converters) { tmp = conv2.split(" "); if (tmp[1] === current) { conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; if (conv) { if (conv === true) { conv = converters[conv2]; } else if (converters[conv2] !== true) { current = tmp[0]; dataTypes.splice(i--, 0, current); } break; } } } } if (conv !== true) { if (conv && s["throws"]) { response = conv(response); } else { try { response = conv(response); } catch (e) { return { error: conv ? e : "No conversion from " + prev + " to " + current, state: "parsererror" }; } } } } prev = current; } } return {data: response, state: "success"}; } var oldCallbacks = [], rquestion = /\?/, rjsonp = /(=)\?(?=&|$)|\?\?/, nonce = jQuery.now(); jQuery.ajaxSetup({ jsonp : "callback", jsonpCallback: function () { var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++)); this[callback] = true; return callback; } }); jQuery.ajaxPrefilter("json jsonp", function (s, originalSettings, jqXHR) { var callbackName, overwritten, responseContainer, data = s.data, url = s.url, hasCallback = s.jsonp !== false, replaceInUrl = hasCallback && rjsonp.test(url), replaceInData = hasCallback && !replaceInUrl && typeof data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(data); if (s.dataTypes[0] === "jsonp" || replaceInUrl || replaceInData) { callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback; overwritten = window[callbackName]; if (replaceInUrl) { s.url = url.replace(rjsonp, "$1" + callbackName); } else if (replaceInData) { s.data = data.replace(rjsonp, "$1" + callbackName); } else if (hasCallback) { s.url += (rquestion.test(url) ? "&" : "?") + s.jsonp + "=" + callbackName; } s.converters["script json"] = function () { if (!responseContainer) { jQuery.error(callbackName + " was not called"); } return responseContainer[0]; }; s.dataTypes[0] = "json"; window[callbackName] = function () { responseContainer = arguments; }; jqXHR.always(function () { window[callbackName] = overwritten; if (s[callbackName]) { s.jsonpCallback = originalSettings.jsonpCallback; oldCallbacks.push(callbackName); } if (responseContainer && jQuery.isFunction(overwritten)) { overwritten(responseContainer[0]); } responseContainer = overwritten = undefined; }); return "script"; } }); jQuery.ajaxSetup({ accepts : { script: "text/javascript, application/javascript, application/ecmascript, application/x" + "-ecmascript" }, contents : { script: /javascript|ecmascript/ }, converters: { "text script": function (text) { jQuery.globalEval(text); return text; } } }); jQuery.ajaxPrefilter("script", function (s) { if (s.cache === undefined) { s.cache = false; } if (s.crossDomain) { s.type = "GET"; s.global = false; } }); jQuery.ajaxTransport("script", function (s) { if (s.crossDomain) { var script, head = document.head || document.getElementsByTagName("head")[0] || document.documentElement; return { abort: function () { if (script) { script.onload(0, 1); } }, send : function (_, callback) { script = document.createElement("script"); script.async = "async"; if (s.scriptCharset) { script.charset = s.scriptCharset; } script.src = s.url; script.onload = script.onreadystatechange = function (_, isAbort) { if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) { script.onload = script.onreadystatechange = null; if (head && script.parentNode) { head.removeChild(script); } script = undefined; if (!isAbort) { callback(200, "success"); } } }; head.insertBefore(script, head.firstChild); } }; } }); var xhrCallbacks, xhrOnUnloadAbort = window.ActiveXObject ? function () { for (var key in xhrCallbacks) { xhrCallbacks[key](0, 1); } } : false, xhrId = 0; function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch (e) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } jQuery.ajaxSettings.xhr = window.ActiveXObject ? function () { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : createStandardXHR; (function (xhr) { jQuery.extend(jQuery.support, { ajax: !!xhr, cors: !!xhr && ("withCredentials" in xhr) }); })(jQuery.ajaxSettings.xhr()); if (jQuery.support.ajax) { jQuery.ajaxTransport(function (s) { if (!s.crossDomain || jQuery.support.cors) { var callback; return { abort: function () { if (callback) { callback(0, 1); } }, send : function (headers, complete) { var handle, i, xhr = s.xhr(); if (s.username) { xhr.open(s.type, s.url, s.async, s.username, s.password); } else { xhr.open(s.type, s.url, s.async); } if (s.xhrFields) { for (i in s.xhrFields) { xhr[i] = s.xhrFields[i]; } } if (s.mimeType && xhr.overrideMimeType) { xhr.overrideMimeType(s.mimeType); } if (!s.crossDomain && !headers["X-Requested-With"]) { headers["X-Requested-With"] = "XMLHttpRequest"; } try { for (i in headers) { xhr.setRequestHeader(i, headers[i]); } } catch (_) {} xhr.send((s.hasContent && s.data) || null); callback = function (_, isAbort) { var status, statusText, responseHeaders, responses, xml; try { if (callback && (isAbort || xhr.readyState === 4)) { callback = undefined; if (handle) { xhr.onreadystatechange = jQuery.noop; if (xhrOnUnloadAbort) { delete xhrCallbacks[handle]; } } if (isAbort) { if (xhr.readyState !== 4) { xhr.abort(); } } else { status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); responses = {}; xml = xhr.responseXML; if (xml && xml.documentElement) { responses.xml = xml; } try { responses.text = xhr.responseText; } catch (_) {} try { statusText = xhr.statusText; } catch (e) { statusText = ""; } if (!status && s.isLocal && !s.crossDomain) { status = responses.text ? 200 : 404; } else if (status === 1223) { status = 204; } } } } catch (firefoxAccessException) { if (!isAbort) { complete(-1, firefoxAccessException); } } if (responses) { complete(status, statusText, responses, responseHeaders); } }; if (!s.async) { callback(); } else if (xhr.readyState === 4) { setTimeout(callback, 0); } else { handle = ++xhrId; if (xhrOnUnloadAbort) { if (!xhrCallbacks) { xhrCallbacks = {}; jQuery(window).unload(xhrOnUnloadAbort); } xhrCallbacks[handle] = callback; } xhr.onreadystatechange = callback; } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp("^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i"), rrun = /queueHooks$/, animationPrefilters = [defaultPrefilter], tweeners = { "*": [ function (prop, value) { var end, unit, tween = this.createTween(prop, value), parts = rfxnum.exec(value), target = tween.cur(), start = +target || 0, scale = 1, maxIterations = 20; if (parts) { end = +parts[2]; unit = parts[3] || (jQuery.cssNumber[prop] ? "" : "px"); if (unit !== "px" && start) { start = jQuery.css(tween.elem, prop, true) || end || 1; do { scale = scale || ".5"; start = start / scale; jQuery.style(tween.elem, prop, start + unit); } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations); } tween.unit = unit; tween.start = start; tween.end = parts[1] ? start + (parts[1] + 1) * end : end; } return tween; } ] }; function createFxNow() { setTimeout(function () { fxNow = undefined; }, 0); return (fxNow = jQuery.now()); } function createTweens(animation, props) { jQuery.each(props, function (prop, value) { var collection = (tweeners[prop] || []).concat(tweeners["*"]), index = 0, length = collection.length; for (; index < length; index += 1) { if (collection[index].call(animation, prop, value)) { return; } } }); } function Animation(elem, properties, options) { var result, index = 0, tweenerIndex = 0, length = animationPrefilters.length, deferred = jQuery .Deferred() .always(function () { delete tick.elem; }), tick = function () { var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), percent = 1 - (remaining / animation.duration || 0), index = 0, length = animation.tweens.length; for (; index < length; index += 1) { animation .tweens[index] .run(percent); } deferred.notifyWith(elem, [animation, percent, remaining]); if (percent < 1 && length) { return remaining; } else { deferred.resolveWith(elem, [animation]); return false; } }, animation = deferred.promise({ createTween : function (prop, end, easing) { var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); animation .tweens .push(tween); return tween; }, duration : options.duration, elem : elem, opts : jQuery.extend(true, { specialEasing: {} }, options), originalOptions : options, originalProperties: properties, props : jQuery.extend({}, properties), startTime : fxNow || createFxNow(), stop : function (gotoEnd) { var index = 0, length = gotoEnd ? animation.tweens.length : 0; for (; index < length; index += 1) { animation .tweens[index] .run(1); } if (gotoEnd) { deferred.resolveWith(elem, [animation, gotoEnd]); } else { deferred.rejectWith(elem, [animation, gotoEnd]); } return this; }, tweens : [] }), props = animation.props; propFilter(props, animation.opts.specialEasing); for (; index < length; index += 1) { result = animationPrefilters[index].call(animation, elem, props, animation.opts); if (result) { return result; } } createTweens(animation, props); if (jQuery.isFunction(animation.opts.start)) { animation .opts .start .call(elem, animation); } jQuery .fx .timer(jQuery.extend(tick, { anim : animation, elem : elem, queue: animation.opts.queue })); return animation .progress(animation.opts.progress) .done(animation.opts.done, animation.opts.complete) .fail(animation.opts.fail) .always(animation.opts.always); } function propFilter(props, specialEasing) { var index, name, easing, value, hooks; for (index in props) { name = jQuery.camelCase(index); easing = specialEasing[name]; value = props[index]; if (jQuery.isArray(value)) { easing = value[1]; value = props[index] = value[0]; } if (index !== name) { props[name] = value; delete props[index]; } hooks = jQuery.cssHooks[name]; if (hooks && "expand" in hooks) { value = hooks.expand(value); delete props[name]; for (index in value) { if (!(index in props)) { props[index] = value[index]; specialEasing[index] = easing; } } } else { specialEasing[name] = easing; } } } jQuery.Animation = jQuery.extend(Animation, { prefilter: function (callback, prepend) { if (prepend) { animationPrefilters.unshift(callback); } else { animationPrefilters.push(callback); } }, tweener : function (props, callback) { if (jQuery.isFunction(props)) { callback = props; props = ["*"]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for (; index < length; index += 1) { prop = props[index]; tweeners[prop] = tweeners[prop] || []; tweeners[prop].unshift(callback); } } }); function defaultPrefilter(elem, props, opts) { var index, prop, value, length, dataShow, tween, hooks, oldfire, anim = this, style = elem.style, orig = {}, handled = [], hidden = elem.nodeType && isHidden(elem); if (!opts.queue) { hooks = jQuery._queueHooks(elem, "fx"); if (hooks.unqueued == null) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function () { if (!hooks.unqueued) { oldfire(); } }; } hooks.unqueued += 1; anim.always(function () { anim.always(function () { hooks.unqueued -= 1; if (!jQuery.queue(elem, "fx").length) { hooks .empty .fire(); } }); }); } if (elem.nodeType === 1 && ("height" in props || "width" in props)) { opts.overflow = [style.overflow, style.overflowX, style.overflowY]; if (jQuery.css(elem, "display") === "inline" && jQuery.css(elem, "float") === "none") { if (!jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay(elem.nodeName) === "inline") { style.display = "inline-block"; } else { style.zoom = 1; } } } if (opts.overflow) { style.overflow = "hidden"; if (!jQuery.support.shrinkWrapBlocks) { anim.done(function () { style.overflow = opts.overflow[0]; style.overflowX = opts.overflow[1]; style.overflowY = opts.overflow[2]; }); } } for (index in props) { value = props[index]; if (rfxtypes.exec(value)) { delete props[index]; if (value === (hidden ? "hide" : "show")) { continue; } handled.push(index); } } length = handled.length; if (length) { dataShow = jQuery._data(elem, "fxshow") || jQuery._data(elem, "fxshow", {}); if (hidden) { jQuery(elem).show(); } else { anim.done(function () { jQuery(elem).hide(); }); } anim.done(function () { var prop; jQuery.removeData(elem, "fxshow", true); for (prop in orig) { jQuery.style(elem, prop, orig[prop]); } }); for (index = 0; index < length; index += 1) { prop = handled[index]; tween = anim.createTween(prop, hidden ? dataShow[prop] : 0); orig[prop] = dataShow[prop] || jQuery.style(elem, prop); if (!(prop in dataShow)) { dataShow[prop] = tween.start; if (hidden) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween(elem, options, prop, end, easing) { return new Tween .prototype .init(elem, options, prop, end, easing); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, cur : function () { var hooks = Tween.propHooks[this.prop]; return hooks && hooks.get ? hooks.get(this) : Tween .propHooks ._default .get(this); }, init : function (elem, options, prop, end, easing, unit) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px"); }, run : function (percent) { var eased, hooks = Tween.propHooks[this.prop]; if (this.options.duration) { this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration); } else { this.pos = eased = percent; } this.now = (this.end - this.start) * eased + this.start; if (this.options.step) { this .options .step .call(this.elem, this.now, this); } if (hooks && hooks.set) { hooks.set(this); } else { Tween .propHooks ._default .set(this); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function (tween) { var result; if (tween.elem[tween.prop] != null && (!tween.elem.style || tween.elem.style[tween.prop] == null)) { return tween.elem[tween.prop]; } result = jQuery.css(tween.elem, tween.prop, false, ""); return !result || result === "auto" ? 0 : result; }, set: function (tween) { if (jQuery.fx.step[tween.prop]) { jQuery .fx .step[tween.prop](tween); } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) { jQuery.style(tween.elem, tween.prop, tween.now + tween.unit); } else { tween.elem[tween.prop] = tween.now; } } } }; Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function (tween) { if (tween.elem.nodeType && tween.elem.parentNode) { tween.elem[tween.prop] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function (i, name) { var cssFn = jQuery.fn[name]; jQuery.fn[name] = function (speed, easing, callback) { return speed == null || typeof speed === "boolean" || (!i && jQuery.isFunction(speed) && jQuery.isFunction(easing)) ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback); }; }); jQuery .fn .extend({ animate: function (prop, speed, easing, callback) { var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function () { var anim = Animation(this, jQuery.extend({}, prop), optall); if (empty) { anim.stop(true); } }; return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); }, fadeTo : function (speed, to, easing, callback) { return this .filter(isHidden) .css("opacity", 0) .show() .end() .animate({ opacity: to }, speed, easing, callback); }, stop : function (type, clearQueue, gotoEnd) { var stopQueue = function (hooks) { var stop = hooks.stop; delete hooks.stop; stop(gotoEnd); }; if (typeof type !== "string") { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if (clearQueue && type !== false) { this.queue(type || "fx", []); } return this.each(function () { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data(this); if (index) { if (data[index] && data[index].stop) { stopQueue(data[index]); } } else { for (index in data) { if (data[index] && data[index].stop && rrun.test(index)) { stopQueue(data[index]); } } } for (index = timers.length; index -= 1;) { if (timers[index].elem === this && (type == null || timers[index].queue === type)) { timers[index] .anim .stop(gotoEnd); dequeue = false; timers.splice(index, 1); } } if (dequeue || !gotoEnd) { jQuery.dequeue(this, type); } }); } }); function genFx(type, includeWidth) { var which, attrs = { height: type }, i = 0; includeWidth = includeWidth ? 1 : 0; for (; i < 4; i += 2 - includeWidth) { which = cssExpand[i]; attrs["margin" + which] = attrs["padding" + which] = type; } if (includeWidth) { attrs.opacity = attrs.width = type; } return attrs; } jQuery.each({ fadeIn : { opacity: "show" }, fadeOut : { opacity: "hide" }, fadeToggle : { opacity: "toggle" }, slideDown : genFx("show"), slideToggle: genFx("toggle"), slideUp : genFx("hide") }, function (name, props) { jQuery.fn[name] = function (speed, easing, callback) { return this.animate(props, speed, easing, callback); }; }); jQuery.speed = function (speed, easing, fn) { var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, duration: speed, easing : fn && easing || easing && !jQuery.isFunction(easing) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery .fx .speeds[opt.duration] : jQuery.fx.speeds._default; if (opt.queue == null || opt.queue === true) { opt.queue = "fx"; } opt.old = opt.complete; opt.complete = function () { if (jQuery.isFunction(opt.old)) { opt .old .call(this); } if (opt.queue) { jQuery.dequeue(this, opt.queue); } }; return opt; }; jQuery.easing = { linear: function (p) { return p; }, swing : function (p) { return 0.5 - Math.cos(p * Math.PI) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function () { var timer, timers = jQuery.timers, i = 0; for (; i < timers.length; i += 1) { timer = timers[i]; if (!timer() && timers[i] === timer) { timers.splice(i--, 1); } } if (!timers.length) { jQuery .fx .stop(); } }; jQuery.fx.timer = function (timer) { if (timer() && jQuery.timers.push(timer) && !timerId) { timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval); } }; jQuery.fx.interval = 13; jQuery.fx.stop = function () { clearInterval(timerId); timerId = null; }; jQuery.fx.speeds = { _default: 400, fast : 200, slow : 600 }; jQuery.fx.step = {}; if (jQuery.expr && jQuery.expr.filters) { jQuery.expr.filters.animated = function (elem) { return jQuery .grep(jQuery.timers, function (fn) { return elem === fn.elem; }) .length; }; } var rroot = /^(?:body|html)$/i; jQuery.fn.offset = function (options) { if (arguments.length) { return options === undefined ? this : this.each(function (i) { jQuery .offset .setOffset(this, options, i); }); } var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, box = { left: 0, top : 0 }, elem = this[0], doc = elem && elem.ownerDocument; if (!doc) { return; } if ((body = doc.body) === elem) { return jQuery .offset .bodyOffset(elem); } docElem = doc.documentElement; if (!jQuery.contains(docElem, elem)) { return box; } if (typeof elem.getBoundingClientRect !== "undefined") { box = elem.getBoundingClientRect(); } win = getWindow(doc); clientTop = docElem.clientTop || body.clientTop || 0; clientLeft = docElem.clientLeft || body.clientLeft || 0; scrollTop = win.pageYOffset || docElem.scrollTop; scrollLeft = win.pageXOffset || docElem.scrollLeft; return { left: box.left + scrollLeft - clientLeft, top : box.top + scrollTop - clientTop }; }; jQuery.offset = { bodyOffset: function (body) { var top = body.offsetTop, left = body.offsetLeft; if (jQuery.support.doesNotIncludeMarginInBodyOffset) { top += parseFloat(jQuery.css(body, "marginTop")) || 0; left += parseFloat(jQuery.css(body, "marginLeft")) || 0; } return {left: left, top: top}; }, setOffset : function (elem, options, i) { var position = jQuery.css(elem, "position"); if (position === "static") { elem.style.position = "relative"; } var curElem = jQuery(elem), curOffset = curElem.offset(), curCSSTop = jQuery.css(elem, "top"), curCSSLeft = jQuery.css(elem, "left"), calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; if (calculatePosition) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat(curCSSTop) || 0; curLeft = parseFloat(curCSSLeft) || 0; } if (jQuery.isFunction(options)) { options = options.call(elem, i, curOffset); } if (options.top != null) { props.top = (options.top - curOffset.top) + curTop; } if (options.left != null) { props.left = (options.left - curOffset.left) + curLeft; } if ("using" in options) { options .using .call(elem, props); } else { curElem.css(props); } } }; jQuery .fn .extend({ offsetParent: function () { return this.map(function () { var offsetParent = this.offsetParent || document.body; while (offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static")) { offsetParent = offsetParent.offsetParent; } return offsetParent || document.body; }); }, position : function () { if (!this[0]) { return; } var elem = this[0], offsetParent = this.offsetParent(), offset = this.offset(), parentOffset = rroot.test(offsetParent[0].nodeName) ? { top : 0, left: 0 } : offsetParent.offset(); offset.top -= parseFloat(jQuery.css(elem, "marginTop")) || 0; offset.left -= parseFloat(jQuery.css(elem, "marginLeft")) || 0; parentOffset.top += parseFloat(jQuery.css(offsetParent[0], "borderTopWidth")) || 0; parentOffset.left += parseFloat(jQuery.css(offsetParent[0], "borderLeftWidth")) || 0; return { left: offset.left - parentOffset.left, top : offset.top - parentOffset.top }; } }); jQuery.each({ scrollLeft: "pageXOffset", scrollTop : "pageYOffset" }, function (method, prop) { var top = /Y/.test(prop); jQuery.fn[method] = function (val) { return jQuery.access(this, function (elem, method, val) { var win = getWindow(elem); if (val === undefined) { return win ? (prop in win) ? win[prop] : win .document .documentElement[method] : elem[method]; } if (win) { win.scrollTo(!top ? val : jQuery(win).scrollLeft(), top ? val : jQuery(win).scrollTop()); } else { elem[method] = val; } }, method, val, arguments.length, null); }; }); function getWindow(elem) { return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } jQuery.each({ Height: "height", Width : "width" }, function (name, type) { jQuery.each({ "" : "outer" + name, content: type, padding: "inner" + name }, function (defaultExtra, funcName) { jQuery.fn[funcName] = function (margin, value) { var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border"); return jQuery.access(this, function (elem, type, value) { var doc; if (jQuery.isWindow(elem)) { return elem .document .documentElement["client" + name]; } if (elem.nodeType === 9) { doc = elem.documentElement; return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]); } return value === undefined ? jQuery.css(elem, type, value, extra) : jQuery.style(elem, type, value, extra); }, type, chainable ? margin : undefined, chainable, null); }; }); }); window.jQuery = window.$ = window.$CQ = jQuery; if (typeof define === "function" && define.amd && define.amd.jQuery) { define("jquery", [], function () { return jQuery; }); } })(window); } if (typeof jQuery != "undefined" && typeof $.ui == "undefined") { (function ($, undefined) { var uuid = 0, runiqueId = /^ui-id-\d+$/; $.ui = $.ui || {}; $.extend($.ui, { keyCode: { BACKSPACE : 8, COMMA : 188, DELETE : 46, DOWN : 40, END : 35, ENTER : 13, ESCAPE : 27, HOME : 36, LEFT : 37, NUMPAD_ADD : 107, NUMPAD_DECIMAL : 110, NUMPAD_DIVIDE : 111, NUMPAD_ENTER : 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN : 34, PAGE_UP : 33, PERIOD : 190, RIGHT : 39, SPACE : 32, TAB : 9, UP : 38 }, version: "1.10.2" }); $ .fn .extend({ focus : (function (orig) { return function (delay, fn) { return typeof delay === "number" ? this.each(function () { var elem = this; setTimeout(function () { $(elem).focus(); if (fn) { fn.call(elem); } }, delay); }) : orig.apply(this, arguments); }; })($.fn.focus), removeUniqueId: function () { return this.each(function () { if (runiqueId.test(this.id)) { $(this).removeAttr("id"); } }); }, scrollParent : function () { var scrollParent; if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { scrollParent = this .parents() .filter(function () { return (/(relative|absolute|fixed)/).test($.css(this, "position")) && (/(auto|scroll)/).test($.css(this, "overflow") + $.css(this, "overflow-y") + $.css(this, "overflow-x")); }) .eq(0); } else { scrollParent = this .parents() .filter(function () { return (/(auto|scroll)/).test($.css(this, "overflow") + $.css(this, "overflow-y") + $.css(this, "overflow-x")); }) .eq(0); } return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent; }, uniqueId : function () { return this.each(function () { if (!this.id) { this.id = "ui-id-" + (uuid += 1); } }); }, zIndex : function (zIndex) { if (zIndex !== undefined) { return this.css("zIndex", zIndex); } if (this.length) { var elem = $(this[0]), position, value; while (elem.length && elem[0] !== document) { position = elem.css("position"); if (position === "absolute" || position === "relative" || position === "fixed") { value = parseInt(elem.css("zIndex"), 10); if (!isNaN(value) && value !== 0) { return value; } } elem = elem.parent(); } } return 0; } }); function focusable(element, isTabIndexNotNaN) { var map, mapName, img, nodeName = element .nodeName .toLowerCase(); if ("area" === nodeName) { map = element.parentNode; mapName = map.name; if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") { return false; } img = $("img[usemap=#" + mapName + "]")[0]; return !!img && visible(img); } return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element); } function visible(element) { return $ .expr .filters .visible(element) && !$(element) .parents() .addBack() .filter(function () { return $.css(this, "visibility") === "hidden"; }) .length; } $.extend($.expr[":"], { data : $.expr.createPseudo ? $ .expr .createPseudo(function (dataName) { return function (elem) { return !!$.data(elem, dataName); }; }) : function (elem, i, match) { return !!$.data(elem, match[3]); }, focusable: function (element) { return focusable(element, !isNaN($.attr(element, "tabindex"))); }, tabbable : function (element) { var tabIndex = $.attr(element, "tabindex"), isTabIndexNaN = isNaN(tabIndex); return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); } }); if (!$("").outerWidth(1).jquery) { $.each([ "Width", "Height" ], function (i, name) { var side = name === "Width" ? ["Left", "Right"] : [ "Top", "Bottom" ], type = name.toLowerCase(), orig = { innerHeight: $.fn.innerHeight, innerWidth : $.fn.innerWidth, outerHeight: $.fn.outerHeight, outerWidth : $.fn.outerWidth }; function reduce(elem, size, border, margin) { $.each(side, function () { size -= parseFloat($.css(elem, "padding" + this)) || 0; if (border) { size -= parseFloat($.css(elem, "border" + this + "Width")) || 0; } if (margin) { size -= parseFloat($.css(elem, "margin" + this)) || 0; } }); return size; } $.fn["inner" + name] = function (size) { if (size === undefined) { return orig["inner" + name].call(this); } return this.each(function () { $(this).css(type, reduce(this, size) + "px"); }); }; $.fn["outer" + name] = function (size, margin) { if (typeof size !== "number") { return orig["outer" + name].call(this, size); } return this.each(function () { $(this).css(type, reduce(this, size, true, margin) + "px"); }); }; }); } if (!$.fn.addBack) { $.fn.addBack = function (selector) { return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)); }; } if ($("").data("a-b", "a").removeData("a-b").data("a-b")) { $.fn.removeData = (function (removeData) { return function (key) { if (arguments.length) { return removeData.call(this, $.camelCase(key)); } else { return removeData.call(this); } }; })($.fn.removeData); } $.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); $.support.selectstart = "onselectstart" in document.createElement("div"); $ .fn .extend({ disableSelection: function () { return this.bind(($.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (event) { event.preventDefault(); }); }, enableSelection : function () { return this.unbind(".ui-disableSelection"); } }); $.extend($.ui, { hasScroll: function (el, a) { if ($(el).css("overflow") === "hidden") { return false; } var scroll = (a && a === "left") ? "scrollLeft" : "scrollTop", has = false; if (el[scroll] > 0) { return true; } el[scroll] = 1; has = (el[scroll] > 0); el[scroll] = 0; return has; }, plugin : { add : function (module, option, set) { var i, proto = $ .ui[module] .prototype; for (i in set) { proto.plugins[i] = proto.plugins[i] || []; proto .plugins[i] .push([ option, set[i] ]); } }, call: function (instance, name, args) { var i, set = instance.plugins[name]; if (!set || !instance.element[0].parentNode || instance.element[0].parentNode.nodeType === 11) { return; } for (i = 0; i < set.length; i += 1) { if (instance.options[set[i][0]]) { set[i][1].apply(instance.element, args); } } } } }); })(jQuery); (function ($, undefined) { var uuid = 0, slice = Array.prototype.slice, _cleanData = $.cleanData; $.cleanData = function (elems) { for (var i = 0, elem; (elem = elems[i]) != null; i += 1) { try { $(elem).triggerHandler("remove"); } catch (e) {} } _cleanData(elems); }; $.widget = function (name, base, prototype) { var fullName, existingConstructor, constructor, basePrototype, proxiedPrototype = {}, namespace = name.split(".")[0]; name = name.split(".")[1]; fullName = namespace + "-" + name; if (!prototype) { prototype = base; base = $.Widget; } $.expr[":"][fullName.toLowerCase()] = function (elem) { return !!$.data(elem, fullName); }; $[namespace] = $[namespace] || {}; existingConstructor = $[namespace][name]; constructor = $[namespace][name] = function (options, element) { if (!this._createWidget) { return new constructor(options, element); } if (arguments.length) { this._createWidget(options, element); } }; $.extend(constructor, existingConstructor, { _childConstructors: [], _proto : $.extend({}, prototype), version : prototype.version }); basePrototype = new base(); basePrototype.options = $ .widget .extend({}, basePrototype.options); $.each(prototype, function (prop, value) { if (!$.isFunction(value)) { proxiedPrototype[prop] = value; return; } proxiedPrototype[prop] = (function () { var _super = function () { return base .prototype[prop] .apply(this, arguments); }, _superApply = function (args) { return base .prototype[prop] .apply(this, args); }; return function () { var __super = this._super, __superApply = this._superApply, returnValue; this._super = _super; this._superApply = _superApply; returnValue = value.apply(this, arguments); this._super = __super; this._superApply = __superApply; return returnValue; }; })(); }); constructor.prototype = $ .widget .extend(basePrototype, { widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name }, proxiedPrototype, { constructor : constructor, namespace : namespace, widgetFullName: fullName, widgetName : name }); if (existingConstructor) { $.each(existingConstructor._childConstructors, function (i, child) { var childPrototype = child.prototype; $.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto); }); delete existingConstructor._childConstructors; } else { base ._childConstructors .push(constructor); } $ .widget .bridge(name, constructor); }; $.widget.extend = function (target) { var input = slice.call(arguments, 1), inputIndex = 0, inputLength = input.length, key, value; for (; inputIndex < inputLength; inputIndex += 1) { for (key in input[inputIndex]) { value = input[inputIndex][key]; if (input[inputIndex].hasOwnProperty(key) && value !== undefined) { if ($.isPlainObject(value)) { target[key] = $.isPlainObject(target[key]) ? $ .widget .extend({}, target[key], value) : $ .widget .extend({}, value); } else { target[key] = value; } } } } return target; }; $.widget.bridge = function (name, object) { var fullName = object.prototype.widgetFullName || name; $.fn[name] = function (options) { var isMethodCall = typeof options === "string", args = slice.call(arguments, 1), returnValue = this; options = !isMethodCall && args.length ? $ .widget .extend .apply(null, [options].concat(args)) : options; if (isMethodCall) { this.each(function () { var methodValue, instance = $.data(this, fullName); if (!instance) { return $.error("cannot call methods on " + name + " prior to initialization; at" + "tempted to call method '" + options + "'"); } if (!$.isFunction(instance[options]) || options.charAt(0) === "_") { return $.error("no such method '" + options + "' for " + name + " widget instan" + "ce"); } methodValue = instance[options].apply(instance, args); if (methodValue !== instance && methodValue !== undefined) { returnValue = methodValue && methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue; return false; } }); } else { this.each(function () { var instance = $.data(this, fullName); if (instance) { instance .option(options || {}) ._init(); } else { $.data(this, fullName, new object(options, this)); } }); } return returnValue; }; }; $.Widget = function () {}; $.Widget._childConstructors = []; $.Widget.prototype = { _create : $.noop, _createWidget : function (options, element) { element = $(element || this.defaultElement || this)[0]; this.element = $(element); this.uuid = uuid++; this.eventNamespace = "." + this.widgetName + this.uuid; this.options = $ .widget .extend({}, this.options, this._getCreateOptions(), options); this.bindings = $(); this.hoverable = $(); this.focusable = $(); if (element !== this) { $.data(element, this.widgetFullName, this); this._on(true, this.element, { remove: function (event) { if (event.target === element) { this.destroy(); } } }); this.document = $(element.style ? element.ownerDocument : element.document || element); this.window = $(this.document[0].defaultView || this.document[0].parentWindow); } this._create(); this._trigger("create", null, this._getCreateEventData()); this._init(); }, _delay : function (handler, delay) { function handlerProxy() { return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments); } var instance = this; return setTimeout(handlerProxy, delay || 0); }, _destroy : $.noop, _focusable : function (element) { this.focusable = this .focusable .add(element); this._on(element, { focusin : function (event) { $(event.currentTarget).addClass("ui-state-focus"); }, focusout: function (event) { $(event.currentTarget).removeClass("ui-state-focus"); } }); }, _getCreateEventData: $.noop, _getCreateOptions : $.noop, _hoverable : function (element) { this.hoverable = this .hoverable .add(element); this._on(element, { mouseenter: function (event) { $(event.currentTarget).addClass("ui-state-hover"); }, mouseleave: function (event) { $(event.currentTarget).removeClass("ui-state-hover"); } }); }, _init : $.noop, _off : function (element, eventName) { eventName = (eventName || "") .split(" ") .join(this.eventNamespace + " ") + this.eventNamespace; element .unbind(eventName) .undelegate(eventName); }, _on : function (suppressDisabledCheck, element, handlers) { var delegateElement, instance = this; if (typeof suppressDisabledCheck !== "boolean") { handlers = element; element = suppressDisabledCheck; suppressDisabledCheck = false; } if (!handlers) { handlers = element; element = this.element; delegateElement = this.widget(); } else { element = delegateElement = $(element); this.bindings = this .bindings .add(element); } $.each(handlers, function (event, handler) { function handlerProxy() { if (!suppressDisabledCheck && (instance.options.disabled === true || $(this).hasClass("ui-state-disabled"))) { return; } return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments); } if (typeof handler !== "string") { handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++; } var match = event.match(/^(\w+)\s*(.*)$/), eventName = match[1] + instance.eventNamespace, selector = match[2]; if (selector) { delegateElement.delegate(selector, eventName, handlerProxy); } else { element.bind(eventName, handlerProxy); } }); }, _setOption : function (key, value) { this.options[key] = value; if (key === "disabled") { this .widget() .toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!value) .attr("aria-disabled", value); this .hoverable .removeClass("ui-state-hover"); this .focusable .removeClass("ui-state-focus"); } return this; }, _setOptions : function (options) { var key; for (key in options) { this._setOption(key, options[key]); } return this; }, _trigger : function (type, event, data) { var prop, orig, callback = this.options[type]; data = data || {}; event = $.Event(event); event.type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase(); event.target = this.element[0]; orig = event.originalEvent; if (orig) { for (prop in orig) { if (!(prop in event)) { event[prop] = orig[prop]; } } } this .element .trigger(event, data); return !($.isFunction(callback) && callback.apply(this.element[0], [event].concat(data)) === false || event.isDefaultPrevented()); }, defaultElement : "
", destroy : function () { this._destroy(); this .element .unbind(this.eventNamespace) .removeData(this.widgetName) .removeData(this.widgetFullName) .removeData($.camelCase(this.widgetFullName)); this .widget() .unbind(this.eventNamespace) .removeAttr("aria-disabled") .removeClass(this.widgetFullName + "-disabled ui-state-disabled"); this .bindings .unbind(this.eventNamespace); this .hoverable .removeClass("ui-state-hover"); this .focusable .removeClass("ui-state-focus"); }, disable : function () { return this._setOption("disabled", true); }, enable : function () { return this._setOption("disabled", false); }, option : function (key, value) { var options = key, parts, curOption, i; if (arguments.length === 0) { return $ .widget .extend({}, this.options); } if (typeof key === "string") { options = {}; parts = key.split("."); key = parts.shift(); if (parts.length) { curOption = options[key] = $ .widget .extend({}, this.options[key]); for (i = 0; i < parts.length - 1; i += 1) { curOption[parts[i]] = curOption[parts[i]] || {}; curOption = curOption[parts[i]]; } key = parts.pop(); if (value === undefined) { return curOption[key] === undefined ? null : curOption[key]; } curOption[key] = value; } else { if (value === undefined) { return this.options[key] === undefined ? null : this.options[key]; } options[key] = value; } } this._setOptions(options); return this; }, options : { create : null, disabled: false }, widget : function () { return this.element; }, widgetEventPrefix : "", widgetName : "widget" }; $.each({ hide: "fadeOut", show: "fadeIn" }, function (method, defaultEffect) { $ .Widget .prototype["_" + method] = function (element, options, callback) { if (typeof options === "string") { options = { effect: options }; } var hasOptions, effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect; options = options || {}; if (typeof options === "number") { options = { duration: options }; } hasOptions = !$.isEmptyObject(options); options.complete = callback; if (options.delay) { element.delay(options.delay); } if (hasOptions && $.effects && $.effects.effect[effectName]) { element[method](options); } else if (effectName !== method && element[effectName]) { element[effectName](options.duration, options.easing, callback); } else { element.queue(function (next) { $(this)[method](); if (callback) { callback.call(element[0]); } next(); }); } }; }); })(jQuery); (function ($, undefined) { var mouseHandled = false; $(document).mouseup(function () { mouseHandled = false; }); $.widget("ui.mouse", { _mouseCapture : function () { return true; }, _mouseDelayMet : function () { return this.mouseDelayMet; }, _mouseDestroy : function () { this .element .unbind("." + this.widgetName); if (this._mouseMoveDelegate) { $(document) .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); } }, _mouseDistanceMet: function (event) { return (Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY)) >= this.options.distance); }, _mouseDown : function (event) { if (mouseHandled) { return; } (this._mouseStarted && this._mouseUp(event)); this._mouseDownEvent = event; var that = this, btnIsLeft = (event.which === 1), elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { return true; } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function () { that.mouseDelayMet = true; }, this.options.delay); } if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { this._mouseStarted = (this._mouseStart(event) !== false); if (!this._mouseStarted) { event.preventDefault(); return true; } } if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) { $.removeData(event.target, this.widgetName + ".preventClickEvent"); } this._mouseMoveDelegate = function (event) { return that._mouseMove(event); }; this._mouseUpDelegate = function (event) { return that._mouseUp(event); }; $(document) .bind("mousemove." + this.widgetName, this._mouseMoveDelegate) .bind("mouseup." + this.widgetName, this._mouseUpDelegate); event.preventDefault(); mouseHandled = true; return true; }, _mouseDrag : function () {}, _mouseInit : function () { var that = this; this .element .bind("mousedown." + this.widgetName, function (event) { return that._mouseDown(event); }) .bind("click." + this.widgetName, function (event) { if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { $.removeData(event.target, that.widgetName + ".preventClickEvent"); event.stopImmediatePropagation(); return false; } }); this.started = false; }, _mouseMove : function (event) { if ($.ui.ie && (!document.documentMode || document.documentMode < 9) && !event.button) { return this._mouseUp(event); } if (this._mouseStarted) { this._mouseDrag(event); return event.preventDefault(); } if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { this._mouseStarted = (this._mouseStart(this._mouseDownEvent, event) !== false); (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); } return !this._mouseStarted; }, _mouseStart : function () {}, _mouseStop : function () {}, _mouseUp : function (event) { $(document) .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; if (event.target === this._mouseDownEvent.target) { $.data(event.target, this.widgetName + ".preventClickEvent", true); } this._mouseStop(event); } return false; }, options : { cancel : "input,textarea,button,select,option", delay : 0, distance: 1 }, version : "1.10.2" }); })(jQuery); (function ($, undefined) { $.widget("ui.draggable", $.ui.mouse, { _adjustOffsetFromHelper: function (obj) { if (typeof obj === "string") { obj = obj.split(" "); } if ($.isArray(obj)) { obj = { left: +obj[0], top : +obj[1] || 0 }; } if ("left" in obj) { this.offset.click.left = obj.left + this.margins.left; } if ("right" in obj) { this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; } if ("top" in obj) { this.offset.click.top = obj.top + this.margins.top; } if ("bottom" in obj) { this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; } }, _cacheHelperProportions: function () { this.helperProportions = { height: this .helper .outerHeight(), width : this .helper .outerWidth() }; }, _cacheMargins : function () { this.margins = { bottom: (parseInt(this.element.css("marginBottom"), 10) || 0), left : (parseInt(this.element.css("marginLeft"), 10) || 0), right : (parseInt(this.element.css("marginRight"), 10) || 0), top : (parseInt(this.element.css("marginTop"), 10) || 0) }; }, _clear : function () { this .helper .removeClass("ui-draggable-dragging"); if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) { this .helper .remove(); } this.helper = null; this.cancelHelperRemoval = false; }, _convertPositionTo : function (d, pos) { if (!pos) { pos = this.position; } var mod = d === "absolute" ? 1 : -1, scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); return { left: (pos.left + this.offset.relative.left * mod + this.offset.parent.left * mod - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod)), top : (pos.top + this.offset.relative.top * mod + this.offset.parent.top * mod - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (scrollIsRootNode ? 0 : scroll.scrollTop())) * mod)) }; }, _create : function () { if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) { this .element[0] .style .position = "relative"; } if (this.options.addClasses) { this .element .addClass("ui-draggable"); } if (this.options.disabled) { this .element .addClass("ui-draggable-disabled"); } this._mouseInit(); }, _createHelper : function (event) { var o = this.options, helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element); if (!helper.parents("body").length) { helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo)); } if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) { helper.css("position", "absolute"); } return helper; }, _destroy : function () { this .element .removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._mouseDestroy(); }, _generatePosition : function (event) { var containment, co, top, left, o = this.options, scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName), pageX = event.pageX, pageY = event.pageY; if (this.originalPosition) { if (this.containment) { if (this.relative_container) { co = this .relative_container .offset(); containment = [ this.containment[0] + co.left, this.containment[1] + co.top, this.containment[2] + co.left, this.containment[3] + co.top ]; } else { containment = this.containment; } if (event.pageX - this.offset.click.left < containment[0]) { pageX = containment[0] + this.offset.click.left; } if (event.pageY - this.offset.click.top < containment[1]) { pageY = containment[1] + this.offset.click.top; } if (event.pageX - this.offset.click.left > containment[2]) { pageX = containment[2] + this.offset.click.left; } if (event.pageY - this.offset.click.top > containment[3]) { pageY = containment[3] + this.offset.click.top; } } if (o.grid) { top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; } } return { left: (pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()))), top : (pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (scrollIsRootNode ? 0 : scroll.scrollTop())))) }; }, _getHandle : function (event) { return this.options.handle ? !!$(event.target) .closest(this.element.find(this.options.handle)) .length : true; }, _getParentOffset : function () { this.offsetParent = this .helper .offsetParent(); var po = this .offsetParent .offset(); if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) { po.left += this .scrollParent .scrollLeft(); po.top += this .scrollParent .scrollTop(); } if ((this.offsetParent[0] === document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) { po = { left: 0, top : 0 }; } return { left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0), top : po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0) }; }, _getRelativeOffset : function () { if (this.cssPosition === "relative") { var p = this .element .position(); return { left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + this .scrollParent .scrollLeft(), top : p.top - (parseInt(this.helper.css("top"), 10) || 0) + this .scrollParent .scrollTop() }; } else { return {left: 0, top: 0}; } }, _mouseCapture : function (event) { var o = this.options; if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) { return false; } this.handle = this._getHandle(event); if (!this.handle) { return false; } $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function () { $("
") .css({ height : this.offsetHeight + "px", opacity : "0.001", position: "absolute", width : this.offsetWidth + "px", zIndex : 1000 }) .css($(this).offset()) .appendTo("body"); }); return true; }, _mouseDrag : function (event, noPropagation) { this.position = this._generatePosition(event); this.positionAbs = this._convertPositionTo("absolute"); if (!noPropagation) { var ui = this._uiHash(); if (this._trigger("drag", event, ui) === false) { this._mouseUp({}); return false; } this.position = ui.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 ($.ui.ddmanager) { $ .ui .ddmanager .drag(this, event); } return false; }, _mouseStart : function (event) { var o = this.options; this.helper = this._createHelper(event); this .helper .addClass("ui-draggable-dragging"); this._cacheHelperProportions(); if ($.ui.ddmanager) { $.ui.ddmanager.current = this; } this._cacheMargins(); this.cssPosition = this .helper .css("position"); this.scrollParent = this .helper .scrollParent(); this.offset = this.positionAbs = this .element .offset(); this.offset = { left: this.offset.left - this.margins.left, top : this.offset.top - this.margins.top }; $.extend(this.offset, { click : { left: event.pageX - this.offset.left, top : event.pageY - this.offset.top }, parent : this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this.position = this._generatePosition(event); this.originalPageX = event.pageX; this.originalPageY = event.pageY; (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); if (o.containment) { this._setContainment(); } if (this._trigger("start", event) === false) { this._clear(); return false; } this._cacheHelperProportions(); if ($.ui.ddmanager && !o.dropBehaviour) { $ .ui .ddmanager .prepareOffsets(this, event); } this._mouseDrag(event, true); if ($.ui.ddmanager) { $ .ui .ddmanager .dragStart(this, event); } return true; }, _mouseStop : function (event) { var element, that = this, elementInDom = false, dropped = false; if ($.ui.ddmanager && !this.options.dropBehaviour) { dropped = $ .ui .ddmanager .drop(this, event); } if (this.dropped) { dropped = this.dropped; this.dropped = false; } element = this.element[0]; while (element && (element = element.parentNode)) { if (element === document) { elementInDom = true; } } if (!elementInDom && this.options.helper === "original") { return false; } if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { if (that._trigger("stop", event) !== false) { that._clear(); } }); } else { if (this._trigger("stop", event) !== false) { this._clear(); } } return false; }, _mouseUp : function (event) { $("div.ui-draggable-iframeFix").each(function () { this .parentNode .removeChild(this); }); if ($.ui.ddmanager) { $ .ui .ddmanager .dragStop(this, event); } return $ .ui .mouse .prototype ._mouseUp .call(this, event); }, _setContainment : function () { var over, c, ce, o = this.options; if (o.containment === "parent") { o.containment = this .helper[0] .parentNode; } if (o.containment === "document" || o.containment === "window") { this.containment = [ o.containment === "document" ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, o.containment === "document" ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, (o.containment === "document" ? 0 : $(window).scrollLeft()) + $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (o.containment === "document" ? 0 : $(window).scrollTop()) + ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top ]; } if (!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor !== Array) { c = $(o.containment); ce = c[0]; if (!ce) { return; } over = ($(ce).css("overflow") !== "hidden"); this.containment = [ (parseInt($(ce).css("borderLeftWidth"), 10) || 0) + (parseInt($(ce).css("paddingLeft"), 10) || 0), (parseInt($(ce).css("borderTopWidth"), 10) || 0) + (parseInt($(ce).css("paddingTop"), 10) || 0), (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderRightWidth"), 10) || 0) - (parseInt($(ce).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderBottomWidth"), 10) || 0) - (parseInt($(ce).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom ]; this.relative_container = c; } else if (o.containment.constructor === Array) { this.containment = o.containment; } }, _trigger : function (type, event, ui) { ui = ui || this._uiHash(); $ .ui .plugin .call(this, type, [event, ui]); if (type === "drag") { this.positionAbs = this._convertPositionTo("absolute"); } return $ .Widget .prototype ._trigger .call(this, type, event, ui); }, _uiHash : function () { return {helper: this.helper, offset: this.positionAbs, originalPosition: this.originalPosition, position: this.position}; }, cancel : function () { if (this.helper.is(".ui-draggable-dragging")) { this._mouseUp({}); } else { this._clear(); } return this; }, options : { addClasses : true, appendTo : "parent", axis : false, connectToSortable: false, containment : false, cursor : "auto", cursorAt : false, drag : null, grid : false, handle : false, helper : "original", iframeFix : false, opacity : false, refreshPositions : false, revert : false, revertDuration : 500, scope : "default", scroll : true, scrollSensitivity: 20, scrollSpeed : 20, snap : false, snapMode : "both", snapTolerance : 20, stack : false, start : null, stop : null, zIndex : false }, plugins : {}, version : "1.10.2", widgetEventPrefix : "drag" }); $ .ui .plugin .add("draggable", "connectToSortable", { drag : function (event, ui) { var inst = $(this).data("ui-draggable"), that = this; $.each(inst.sortables, function () { var innermostIntersecting = false, thisSortable = this; this.instance.positionAbs = inst.positionAbs; this.instance.helperProportions = inst.helperProportions; this.instance.offset.click = inst.offset.click; if (this.instance._intersectsWith(this.instance.containerCache)) { innermostIntersecting = true; $.each(inst.sortables, function () { this.instance.positionAbs = inst.positionAbs; this.instance.helperProportions = inst.helperProportions; this.instance.offset.click = inst.offset.click; if (this !== thisSortable && this.instance._intersectsWith(this.instance.containerCache) && $.contains(thisSortable.instance.element[0], this.instance.element[0])) { innermostIntersecting = false; } return innermostIntersecting; }); } if (innermostIntersecting) { if (!this.instance.isOver) { this.instance.isOver = 1; this.instance.currentItem = $(that) .clone() .removeAttr("id") .appendTo(this.instance.element) .data("ui-sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function () { return ui.helper[0]; }; event.target = this .instance .currentItem[0]; this .instance ._mouseCapture(event, true); this .instance ._mouseStart(event, true, true); this.instance.offset.click.top = inst.offset.click.top; this.instance.offset.click.left = inst.offset.click.left; this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; inst._trigger("toSortable", event); inst.dropped = this.instance.element; inst.currentItem = inst.element; this.instance.fromOutside = inst; } if (this.instance.currentItem) { this .instance ._mouseDrag(event); } } else { if (this.instance.isOver) { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this .instance ._trigger("out", event, this.instance._uiHash(this.instance)); this .instance ._mouseStop(event, true); this.instance.options.helper = this.instance.options._helper; this .instance .currentItem .remove(); if (this.instance.placeholder) { this .instance .placeholder .remove(); } inst._trigger("fromSortable", event); inst.dropped = false; } } }); }, start: function (event, ui) { var inst = $(this).data("ui-draggable"), o = inst.options, uiSortable = $.extend({}, ui, {item: inst.element}); inst.sortables = []; $(o.connectToSortable).each(function () { var sortable = $.data(this, "ui-sortable"); if (sortable && !sortable.options.disabled) { inst .sortables .push({instance: sortable, shouldRevert: sortable.options.revert}); sortable.refreshPositions(); sortable._trigger("activate", event, uiSortable); } }); }, stop : function (event, ui) { var inst = $(this).data("ui-draggable"), uiSortable = $.extend({}, ui, {item: inst.element}); $.each(inst.sortables, function () { if (this.instance.isOver) { this.instance.isOver = 0; inst.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) { this.instance.options.revert = this.shouldRevert; } this .instance ._mouseStop(event); this.instance.options.helper = this.instance.options._helper; if (inst.options.helper === "original") { this .instance .currentItem .css({left: "auto", top: "auto"}); } } else { this.instance.cancelHelperRemoval = false; this .instance ._trigger("deactivate", event, uiSortable); } }); } }); $ .ui .plugin .add("draggable", "cursor", { start: function () { var t = $("body"), o = $(this) .data("ui-draggable") .options; if (t.css("cursor")) { o._cursor = t.css("cursor"); } t.css("cursor", o.cursor); }, stop : function () { var o = $(this) .data("ui-draggable") .options; if (o._cursor) { $("body").css("cursor", o._cursor); } } }); $ .ui .plugin .add("draggable", "opacity", { start: function (event, ui) { var t = $(ui.helper), o = $(this) .data("ui-draggable") .options; if (t.css("opacity")) { o._opacity = t.css("opacity"); } t.css("opacity", o.opacity); }, stop : function (event, ui) { var o = $(this) .data("ui-draggable") .options; if (o._opacity) { $(ui.helper).css("opacity", o._opacity); } } }); $ .ui .plugin .add("draggable", "scroll", { drag : function (event) { var i = $(this).data("ui-draggable"), o = i.options, scrolled = false; if (i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { if (!o.axis || o.axis !== "x") { if ((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { i .scrollParent[0] .scrollTop = scrolled = i .scrollParent[0] .scrollTop + o.scrollSpeed; } else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) { i .scrollParent[0] .scrollTop = scrolled = i .scrollParent[0] .scrollTop - o.scrollSpeed; } } if (!o.axis || o.axis !== "y") { if ((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) { i .scrollParent[0] .scrollLeft = scrolled = i .scrollParent[0] .scrollLeft + o.scrollSpeed; } else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) { i .scrollParent[0] .scrollLeft = scrolled = i .scrollParent[0] .scrollLeft - o.scrollSpeed; } } } else { if (!o.axis || o.axis !== "x") { if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) { scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) { scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); } } if (!o.axis || o.axis !== "y") { if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) { scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) { scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); } } } if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { $ .ui .ddmanager .prepareOffsets(i, event); } }, start: function () { var i = $(this).data("ui-draggable"); if (i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { i.overflowOffset = i .scrollParent .offset(); } } }); $ .ui .plugin .add("draggable", "snap", { drag : function (event, ui) { var ts, bs, ls, rs, l, r, t, b, i, first, inst = $(this).data("ui-draggable"), o = inst.options, d = o.snapTolerance, x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; for (i = inst.snapElements.length - 1; i >= 0; i -= 1) { l = inst .snapElements[i] .left; r = l + inst .snapElements[i] .width; t = inst .snapElements[i] .top; b = t + inst .snapElements[i] .height; if (!((l - d < x1 && x1 < r + d && t - d < y1 && y1 < b + d) || (l - d < x1 && x1 < r + d && t - d < y2 && y2 < b + d) || (l - d < x2 && x2 < r + d && t - d < y1 && y1 < b + d) || (l - d < x2 && x2 < r + d && t - d < y2 && y2 < b + d))) { if (inst.snapElements[i].snapping) { (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst .snapElements[i] .item }))); } inst .snapElements[i] .snapping = false; continue; } if (o.snapMode !== "inner") { ts = Math.abs(t - y2) <= d; bs = Math.abs(b - y1) <= d; ls = Math.abs(l - x2) <= d; rs = Math.abs(r - x1) <= d; if (ts) { ui.position.top = inst ._convertPositionTo("relative", { left: 0, top : t - inst.helperProportions.height }) .top - inst.margins.top; } if (bs) { ui.position.top = inst ._convertPositionTo("relative", { left: 0, top : b }) .top - inst.margins.top; } if (ls) { ui.position.left = inst ._convertPositionTo("relative", { left: l - inst.helperProportions.width, top : 0 }) .left - inst.margins.left; } if (rs) { ui.position.left = inst ._convertPositionTo("relative", { left: r, top : 0 }) .left - inst.margins.left; } } first = (ts || bs || ls || rs); if (o.snapMode !== "outer") { ts = Math.abs(t - y1) <= d; bs = Math.abs(b - y2) <= d; ls = Math.abs(l - x1) <= d; rs = Math.abs(r - x2) <= d; if (ts) { ui.position.top = inst ._convertPositionTo("relative", { left: 0, top : t }) .top - inst.margins.top; } if (bs) { ui.position.top = inst ._convertPositionTo("relative", { left: 0, top : b - inst.helperProportions.height }) .top - inst.margins.top; } if (ls) { ui.position.left = inst ._convertPositionTo("relative", { left: l, top : 0 }) .left - inst.margins.left; } if (rs) { ui.position.left = inst ._convertPositionTo("relative", { left: r - inst.helperProportions.width, top : 0 }) .left - inst.margins.left; } } if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) { (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst .snapElements[i] .item }))); } inst .snapElements[i] .snapping = (ts || bs || ls || rs || first); } }, start: function () { var i = $(this).data("ui-draggable"), o = i.options; i.snapElements = []; $(o.snap.constructor !== String ? (o.snap.items || ":data(ui-draggable)") : o.snap).each(function () { var $t = $(this), $o = $t.offset(); if (this !== i.element[0]) { i .snapElements .push({height: $t.outerHeight(), item: this, left: $o.left, top: $o.top, width: $t.outerWidth()}); } }); } }); $ .ui .plugin .add("draggable", "stack", { start: function () { var min, o = this .data("ui-draggable") .options, group = $ .makeArray($(o.stack)) .sort(function (a, b) { return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0); }); if (!group.length) { return; } min = parseInt($(group[0]).css("zIndex"), 10) || 0; $(group).each(function (i) { $(this).css("zIndex", min + i); }); this.css("zIndex", (min + group.length)); } }); $ .ui .plugin .add("draggable", "zIndex", { start: function (event, ui) { var t = $(ui.helper), o = $(this) .data("ui-draggable") .options; if (t.css("zIndex")) { o._zIndex = t.css("zIndex"); } t.css("zIndex", o.zIndex); }, stop : function (event, ui) { var o = $(this) .data("ui-draggable") .options; if (o._zIndex) { $(ui.helper).css("zIndex", o._zIndex); } } }); })(jQuery); (function ($, undefined) { function isOverAxis(x, reference, size) { return (x > reference) && (x < (reference + size)); } $.widget("ui.droppable", { _activate : function (event) { var draggable = $.ui.ddmanager.current; if (this.options.activeClass) { this .element .addClass(this.options.activeClass); } if (draggable) { this._trigger("activate", event, this.ui(draggable)); } }, _create : function () { var o = this.options, accept = o.accept; this.isover = false; this.isout = true; this.accept = $.isFunction(accept) ? accept : function (d) { return d.is(accept); }; this.proportions = { height: this .element[0] .offsetHeight, width : this .element[0] .offsetWidth }; $ .ui .ddmanager .droppables[o.scope] = $ .ui .ddmanager .droppables[o.scope] || []; $ .ui .ddmanager .droppables[o.scope] .push(this); (o.addClasses && this.element.addClass("ui-droppable")); }, _deactivate : function (event) { var draggable = $.ui.ddmanager.current; if (this.options.activeClass) { this .element .removeClass(this.options.activeClass); } if (draggable) { this._trigger("deactivate", event, this.ui(draggable)); } }, _destroy : function () { var i = 0, drop = $ .ui .ddmanager .droppables[this.options.scope]; for (; i < drop.length; i += 1) { if (drop[i] === this) { drop.splice(i, 1); } } this .element .removeClass("ui-droppable ui-droppable-disabled"); }, _drop : function (event, custom) { var draggable = custom || $.ui.ddmanager.current, childrenIntersection = false; if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) { return false; } this .element .find(":data(ui-droppable)") .not(".ui-draggable-dragging") .each(function () { var inst = $.data(this, "ui-droppable"); if (inst.options.greedy && !inst.options.disabled && inst.options.scope === draggable.options.scope && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) && $.ui.intersect(draggable, $.extend(inst, { offset: inst .element .offset() }), inst.options.tolerance)) { childrenIntersection = true; return false; } }); if (childrenIntersection) { return false; } if (this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) { if (this.options.activeClass) { this .element .removeClass(this.options.activeClass); } if (this.options.hoverClass) { this .element .removeClass(this.options.hoverClass); } this._trigger("drop", event, this.ui(draggable)); return this.element; } return false; }, _out : function (event) { var draggable = $.ui.ddmanager.current; if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) { return; } if (this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) { if (this.options.hoverClass) { this .element .removeClass(this.options.hoverClass); } this._trigger("out", event, this.ui(draggable)); } }, _over : function (event) { var draggable = $.ui.ddmanager.current; if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) { return; } if (this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) { if (this.options.hoverClass) { this .element .addClass(this.options.hoverClass); } this._trigger("over", event, this.ui(draggable)); } }, _setOption : function (key, value) { if (key === "accept") { this.accept = $.isFunction(value) ? value : function (d) { return d.is(value); }; } $ .Widget .prototype ._setOption .apply(this, arguments); }, options : { accept : "*", activate : null, activeClass: false, addClasses : true, deactivate : null, drop : null, greedy : false, hoverClass : false, out : null, over : null, scope : "default", tolerance : "intersect" }, ui : function (c) { return { draggable: (c.currentItem || c.element), helper : c.helper, offset : c.positionAbs, position : c.position }; }, version : "1.10.2", widgetEventPrefix: "drop" }); $.ui.intersect = function (draggable, droppable, toleranceMode) { if (!droppable.offset) { return false; } var draggableLeft, draggableTop, x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height, l = droppable.offset.left, r = l + droppable.proportions.width, t = droppable.offset.top, b = t + droppable.proportions.height; switch (toleranceMode) { case "fit": return (l <= x1 && x2 <= r && t <= y1 && y2 <= b); case "intersect": return (l < x1 + (draggable.helperProportions.width / 2) && x2 - (draggable.helperProportions.width / 2) < r && t < y1 + (draggable.helperProportions.height / 2) && y2 - (draggable.helperProportions.height / 2) < b); case "pointer": draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left); draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top); return isOverAxis(draggableTop, t, droppable.proportions.height) && isOverAxis(draggableLeft, l, droppable.proportions.width); case "touch": return ((y1 >= t && y1 <= b) || (y2 >= t && y2 <= b) || (y1 < t && y2 > b)) && ((x1 >= l && x1 <= r) || (x2 >= l && x2 <= r) || (x1 < l && x2 > r)); default: return false; } }; $.ui.ddmanager = { current : null, drag : function (draggable, event) { if (draggable.options.refreshPositions) { $ .ui .ddmanager .prepareOffsets(draggable, event); } $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function () { if (this.options.disabled || this.greedyChild || !this.visible) { return; } var parentInstance, scope, parent, intersects = $ .ui .intersect(draggable, this, this.options.tolerance), c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null); if (!c) { return; } if (this.options.greedy) { scope = this.options.scope; parent = this .element .parents(":data(ui-droppable)") .filter(function () { return $ .data(this, "ui-droppable") .options .scope === scope; }); if (parent.length) { parentInstance = $.data(parent[0], "ui-droppable"); parentInstance.greedyChild = (c === "isover"); } } if (parentInstance && c === "isover") { parentInstance.isover = false; parentInstance.isout = true; parentInstance ._out .call(parentInstance, event); } this[c] = true; this[ c === "isout" ? "isover" : "isout" ] = false; this[ c === "isover" ? "_over" : "_out" ].call(this, event); if (parentInstance && c === "isout") { parentInstance.isout = false; parentInstance.isover = true; parentInstance ._over .call(parentInstance, event); } }); }, dragStart : function (draggable, event) { draggable .element .parentsUntil("body") .bind("scroll.droppable", function () { if (!draggable.options.refreshPositions) { $ .ui .ddmanager .prepareOffsets(draggable, event); } }); }, dragStop : function (draggable, event) { draggable .element .parentsUntil("body") .unbind("scroll.droppable"); if (!draggable.options.refreshPositions) { $ .ui .ddmanager .prepareOffsets(draggable, event); } }, drop : function (draggable, event) { var dropped = false; $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function () { if (!this.options) { return; } if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) { dropped = this ._drop .call(this, event) || dropped; } if (!this.options.disabled && this.visible && this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) { this.isout = true; this.isover = false; this ._deactivate .call(this, event); } }); return dropped; }, droppables : { "default": [] }, prepareOffsets: function (t, event) { var i, j, m = $ .ui .ddmanager .droppables[t.options.scope] || [], type = event ? event.type : null, list = (t.currentItem || t.element) .find(":data(ui-droppable)") .addBack(); droppablesLoop : for (i = 0; i < m.length; i += 1) { if (m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0], (t.currentItem || t.element)))) { continue; } for (j = 0; j < list.length; j += 1) { if (list[j] === m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } } m[i].visible = m[i] .element .css("display") !== "none"; if (!m[i].visible) { continue; } if (type === "mousedown") { m[i] ._activate .call(m[i], event); } m[i].offset = m[i] .element .offset(); m[i].proportions = { height: m[i] .element[0] .offsetHeight, width : m[i] .element[0] .offsetWidth }; }; } }; })(jQuery); (function ($, undefined) { function num(v) { return parseInt(v, 10) || 0; } function isNumber(value) { return !isNaN(parseInt(value, 10)); } $.widget("ui.resizable", $.ui.mouse, { _change : { e : function (event, dx) { return { width: this.originalSize.width + dx }; }, n : function (event, dx, dy) { var cs = this.originalSize, sp = this.originalPosition; return { height: cs.height - dy, top : sp.top + dy }; }, ne: function (event, dx, dy) { return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); }, nw: function (event, dx, dy) { return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); }, s : function (event, dx, dy) { return { height: this.originalSize.height + dy }; }, se: function (event, dx, dy) { return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); }, sw: function (event, dx, dy) { return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); }, w : function (event, dx) { var cs = this.originalSize, sp = this.originalPosition; return { left : sp.left + dx, width: cs.width - dx }; } }, _create : function () { var n, i, handle, axis, hname, that = this, o = this.options; this .element .addClass("ui-resizable"); $.extend(this, { _aspectRatio : !!(o.aspectRatio), _helper : o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null, _proportionallyResizeElements: [], aspectRatio : o.aspectRatio, originalElement : this.element }); if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { this .element .wrap($("
").css({ height : this .element .outerHeight(), left : this .element .css("left"), position: this .element .css("position"), top : this .element .css("top"), width : this .element .outerWidth() })); this.element = this .element .parent() .data("ui-resizable", this.element.data("ui-resizable")); this.elementIsWrapper = true; this .element .css({ marginBottom: this .originalElement .css("marginBottom"), marginLeft : this .originalElement .css("marginLeft"), marginRight : this .originalElement .css("marginRight"), marginTop : this .originalElement .css("marginTop") }); this .originalElement .css({marginBottom: 0, marginLeft: 0, marginRight: 0, marginTop: 0}); this.originalResizeStyle = this .originalElement .css("resize"); this .originalElement .css("resize", "none"); this ._proportionallyResizeElements .push(this.originalElement.css({display: "block", position: "static", zoom: 1})); this .originalElement .css({ margin: this .originalElement .css("margin") }); this._proportionallyResize(); } this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : { e : ".ui-resizable-e", n : ".ui-resizable-n", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw", s : ".ui-resizable-s", se: ".ui-resizable-se", sw: ".ui-resizable-sw", w : ".ui-resizable-w" }); if (this.handles.constructor === String) { if (this.handles === "all") { this.handles = "n,e,s,w,se,sw,ne,nw"; } n = this .handles .split(","); this.handles = {}; for (i = 0; i < n.length; i += 1) { handle = $.trim(n[i]); hname = "ui-resizable-" + handle; axis = $("
"); axis.css({zIndex: o.zIndex}); if ("se" === handle) { axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"); } this.handles[handle] = ".ui-resizable-" + handle; this .element .append(axis); } } this._renderAxis = function (target) { var i, axis, padPos, padWrapper; target = target || this.element; for (i in this.handles) { if (this.handles[i].constructor === String) { this.handles[i] = $(this.handles[i], this.element).show(); } if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { axis = $(this.handles[i], this.element); padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); padPos = [ "padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left" ].join(""); target.css(padPos, padWrapper); this._proportionallyResize(); } if (!$(this.handles[i]).length) { continue; } } }; this._renderAxis(this.element); this._handles = $(".ui-resizable-handle", this.element).disableSelection(); this ._handles .mouseover(function () { if (!that.resizing) { if (this.className) { axis = this .className .match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); } that.axis = axis && axis[1] ? axis[1] : "se"; } }); if (o.autoHide) { this ._handles .hide(); $(this.element) .addClass("ui-resizable-autohide") .mouseenter(function () { if (o.disabled) { return; } $(this).removeClass("ui-resizable-autohide"); that ._handles .show(); }) .mouseleave(function () { if (o.disabled) { return; } if (!that.resizing) { $(this).addClass("ui-resizable-autohide"); that ._handles .hide(); } }); } this._mouseInit(); }, _destroy : function () { this._mouseDestroy(); var wrapper, _destroy = function (exp) { $(exp) .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") .removeData("resizable") .removeData("ui-resizable") .unbind(".resizable") .find(".ui-resizable-handle") .remove(); }; if (this.elementIsWrapper) { _destroy(this.element); wrapper = this.element; this .originalElement .css({height: wrapper.outerHeight(), left: wrapper.css("left"), position: wrapper.css("position"), top: wrapper.css("top"), width: wrapper.outerWidth()}) .insertAfter(wrapper); wrapper.remove(); } this .originalElement .css("resize", this.originalResizeStyle); _destroy(this.originalElement); return this; }, _mouseCapture : function (event) { var i, handle, capture = false; for (i in this.handles) { handle = $(this.handles[i])[0]; if (handle === event.target || $.contains(handle, event.target)) { capture = true; } } return !this.options.disabled && capture; }, _mouseDrag : function (event) { var data, el = this.helper, props = {}, smp = this.originalMousePosition, a = this.axis, prevTop = this.position.top, prevLeft = this.position.left, prevWidth = this.size.width, prevHeight = this.size.height, dx = (event.pageX - smp.left) || 0, dy = (event.pageY - smp.top) || 0, trigger = this._change[a]; if (!trigger) { return false; } data = trigger.apply(this, [event, dx, dy]); this._updateVirtualBoundaries(event.shiftKey); if (this._aspectRatio || event.shiftKey) { data = this._updateRatio(data, event); } data = this._respectSize(data, event); this._updateCache(data); this._propagate("resize", event); if (this.position.top !== prevTop) { props.top = this.position.top + "px"; } if (this.position.left !== prevLeft) { props.left = this.position.left + "px"; } if (this.size.width !== prevWidth) { props.width = this.size.width + "px"; } if (this.size.height !== prevHeight) { props.height = this.size.height + "px"; } el.css(props); if (!this._helper && this._proportionallyResizeElements.length) { this._proportionallyResize(); } if (!$.isEmptyObject(props)) { this._trigger("resize", event, this.ui()); } return false; }, _mouseStart : function (event) { var curleft, curtop, cursor, o = this.options, iniPos = this .element .position(), el = this.element; this.resizing = true; if ((/absolute/).test(el.css("position"))) { el.css({left: el.css("left"), position: "absolute", top: el.css("top")}); } else if (el.is(".ui-draggable")) { el.css({left: iniPos.left, position: "absolute", top: iniPos.top}); } this._renderProxy(); curleft = num(this.helper.css("left")); curtop = num(this.helper.css("top")); if (o.containment) { curleft += $(o.containment).scrollLeft() || 0; curtop += $(o.containment).scrollTop() || 0; } this.offset = this .helper .offset(); this.position = { left: curleft, top : curtop }; this.size = this._helper ? { width : el.outerWidth(), height: el.outerHeight() } : { height: el.height(), width : el.width() }; this.originalSize = this._helper ? { width : el.outerWidth(), height: el.outerHeight() } : { height: el.height(), width : el.width() }; this.originalPosition = { left: curleft, top : curtop }; this.sizeDiff = { height: el.outerHeight() - el.height(), width : el.outerWidth() - el.width() }; this.originalMousePosition = { left: event.pageX, top : event.pageY }; this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); cursor = $(".ui-resizable-" + this.axis).css("cursor"); $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor); el.addClass("ui-resizable-resizing"); this._propagate("start", event); return true; }, _mouseStop : function (event) { this.resizing = false; var pr, ista, soffseth, soffsetw, s, left, top, o = this.options, that = this; if (this._helper) { pr = this._proportionallyResizeElements; ista = pr.length && (/textarea/i).test(pr[0].nodeName); soffseth = ista && $ .ui .hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height; soffsetw = ista ? 0 : that.sizeDiff.width; s = { height: (that.helper.height() - soffseth), width : (that.helper.width() - soffsetw) }; left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null; top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null; if (!o.animate) { this .element .css($.extend(s, { left: left, top : top })); } that .helper .height(that.size.height); that .helper .width(that.size.width); if (this._helper && !o.animate) { this._proportionallyResize(); } } $("body").css("cursor", "auto"); this .element .removeClass("ui-resizable-resizing"); this._propagate("stop", event); if (this._helper) { this .helper .remove(); } return false; }, _propagate : function (n, event) { $ .ui .plugin .call(this, n, [event, this.ui()]); (n !== "resize" && this._trigger(n, event, this.ui())); }, _proportionallyResize : function () { if (!this._proportionallyResizeElements.length) { return; } var i, j, borders, paddings, prel, element = this.helper || this.element; for (i = 0; i < this._proportionallyResizeElements.length; i += 1) { prel = this._proportionallyResizeElements[i]; if (!this.borderDif) { this.borderDif = []; borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")]; paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")]; for (j = 0; j < borders.length; j += 1) { this.borderDif[j] = (parseInt(borders[j], 10) || 0) + (parseInt(paddings[j], 10) || 0); } } prel.css({ height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, width : (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 }); } }, _renderProxy : function () { var el = this.element, o = this.options; this.elementOffset = el.offset(); if (this._helper) { this.helper = this.helper || $("
"); this .helper .addClass(this._helper) .css({ height : this .element .outerHeight() - 1, left : this.elementOffset.left + "px", position: "absolute", top : this.elementOffset.top + "px", width : this .element .outerWidth() - 1, zIndex : ++o.zIndex }); this .helper .appendTo("body") .disableSelection(); } else { this.helper = this.element; } }, _respectSize : function (data) { var o = this._vBoundaries, a = this.axis, ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height), dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height, cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); if (isminw) { data.width = o.minWidth; } if (isminh) { data.height = o.minHeight; } if (ismaxw) { data.width = o.maxWidth; } if (ismaxh) { data.height = o.maxHeight; } if (isminw && cw) { data.left = dw - o.minWidth; } if (ismaxw && cw) { data.left = dw - o.maxWidth; } if (isminh && ch) { data.top = dh - o.minHeight; } if (ismaxh && ch) { data.top = dh - o.maxHeight; } if (!data.width && !data.height && !data.left && data.top) { data.top = null; } else if (!data.width && !data.height && !data.top && data.left) { data.left = null; } return data; }, _updateCache : function (data) { this.offset = this .helper .offset(); if (isNumber(data.left)) { this.position.left = data.left; } if (isNumber(data.top)) { this.position.top = data.top; } if (isNumber(data.height)) { this.size.height = data.height; } if (isNumber(data.width)) { this.size.width = data.width; } }, _updateRatio : function (data) { var cpos = this.position, csize = this.size, a = this.axis; if (isNumber(data.height)) { data.width = (data.height * this.aspectRatio); } else if (isNumber(data.width)) { data.height = (data.width / this.aspectRatio); } if (a === "sw") { data.left = cpos.left + (csize.width - data.width); data.top = null; } if (a === "nw") { data.top = cpos.top + (csize.height - data.height); data.left = cpos.left + (csize.width - data.width); } return data; }, _updateVirtualBoundaries: function (forceAspectRatio) { var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, o = this.options; b = { maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity, maxWidth : isNumber(o.maxWidth) ? o.maxWidth : Infinity, minHeight: isNumber(o.minHeight) ? o.minHeight : 0, minWidth : isNumber(o.minWidth) ? o.minWidth : 0 }; if (this._aspectRatio || forceAspectRatio) { pMinWidth = b.minHeight * this.aspectRatio; pMinHeight = b.minWidth / this.aspectRatio; pMaxWidth = b.maxHeight * this.aspectRatio; pMaxHeight = b.maxWidth / this.aspectRatio; if (pMinWidth > b.minWidth) { b.minWidth = pMinWidth; } if (pMinHeight > b.minHeight) { b.minHeight = pMinHeight; } if (pMaxWidth < b.maxWidth) { b.maxWidth = pMaxWidth; } if (pMaxHeight < b.maxHeight) { b.maxHeight = pMaxHeight; } } this._vBoundaries = b; }, options : { alsoResize : false, animate : false, animateDuration: "slow", animateEasing : "swing", aspectRatio : false, autoHide : false, containment : false, ghost : false, grid : false, handles : "e,s,se", helper : false, maxHeight : null, maxWidth : null, minHeight : 10, minWidth : 10, resize : null, start : null, stop : null, zIndex : 90 }, plugins : {}, ui : function () { return { element : this.element, helper : this.helper, originalElement : this.originalElement, originalPosition: this.originalPosition, originalSize : this.originalSize, position : this.position, size : this.size }; }, version : "1.10.2", widgetEventPrefix : "resize" }); $ .ui .plugin .add("resizable", "animate", { stop: function (event) { var that = $(this).data("ui-resizable"), o = that.options, pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), soffseth = ista && $ .ui .hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height, soffsetw = ista ? 0 : that.sizeDiff.width, style = { height: (that.size.height - soffseth), width : (that.size.width - soffsetw) }, left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null, top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null; that .element .animate($.extend(style, top && left ? { top : top, left: left } : {}), { duration: o.animateDuration, easing : o.animateEasing, step : function () { var data = { height: parseInt(that.element.css("height"), 10), left : parseInt(that.element.css("left"), 10), top : parseInt(that.element.css("top"), 10), width : parseInt(that.element.css("width"), 10) }; if (pr && pr.length) { $(pr[0]).css({height: data.height, width: data.width}); } that._updateCache(data); that._propagate("resize", event); } }); } }); $ .ui .plugin .add("resizable", "containment", { resize: function (event) { var woset, hoset, isParent, isOffsetRelative, that = $(this).data("ui-resizable"), o = that.options, co = that.containerOffset, cp = that.position, pRatio = that._aspectRatio || event.shiftKey, cop = { left: 0, top : 0 }, ce = that.containerElement; if (ce[0] !== document && (/static/).test(ce.css("position"))) { cop = co; } if (cp.left < (that._helper ? co.left : 0)) { that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); if (pRatio) { that.size.height = that.size.width / that.aspectRatio; } that.position.left = o.helper ? co.left : 0; } if (cp.top < (that._helper ? co.top : 0)) { that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); if (pRatio) { that.size.width = that.size.height * that.aspectRatio; } that.position.top = that._helper ? co.top : 0; } that.offset.left = that.parentData.left + that.position.left; that.offset.top = that.parentData.top + that.position.top; woset = Math.abs((that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width); hoset = Math.abs((that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height); isParent = that .containerElement .get(0) === that .element .parent() .get(0); isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position")); if (isParent && isOffsetRelative) { woset -= that.parentData.left; } if (woset + that.size.width >= that.parentData.width) { that.size.width = that.parentData.width - woset; if (pRatio) { that.size.height = that.size.width / that.aspectRatio; } } if (hoset + that.size.height >= that.parentData.height) { that.size.height = that.parentData.height - hoset; if (pRatio) { that.size.width = that.size.height * that.aspectRatio; } } }, start : function () { var element, p, co, ch, cw, width, height, that = $(this).data("ui-resizable"), o = that.options, el = that.element, oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el .parent() .get(0) : oc; if (!ce) { return; } that.containerElement = $(ce); if (/document/.test(oc) || oc === document) { that.containerOffset = { left: 0, top : 0 }; that.containerPosition = { left: 0, top : 0 }; that.parentData = { element: $(document), height : $(document).height() || document.body.parentNode.scrollHeight, left : 0, top : 0, width : $(document).width() }; } else { element = $(ce); p = []; $(["Top", "Right", "Left", "Bottom"]).each(function (i, name) { p[i] = num(element.css("padding" + name)); }); that.containerOffset = element.offset(); that.containerPosition = element.position(); that.containerSize = { height: (element.innerHeight() - p[3]), width : (element.innerWidth() - p[1]) }; co = that.containerOffset; ch = that.containerSize.height; cw = that.containerSize.width; width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw); height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); that.parentData = { element: ce, height : height, left : co.left, top : co.top, width : width }; } }, stop : function () { var that = $(this).data("ui-resizable"), o = that.options, co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement, helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) { $(this).css({ height: h, left : ho.left - cop.left - co.left, width : w }); } if (that._helper && !o.animate && (/static/).test(ce.css("position"))) { $(this).css({ height: h, left : ho.left - cop.left - co.left, width : w }); } } }); $ .ui .plugin .add("resizable", "alsoResize", { resize: function (event, ui) { var that = $(this).data("ui-resizable"), o = that.options, os = that.originalSize, op = that.originalPosition, delta = { height: (that.size.height - os.height) || 0, left : (that.position.left - op.left) || 0, top : (that.position.top - op.top) || 0, width : (that.size.width - os.width) || 0 }, _alsoResize = function (exp, c) { $(exp).each(function () { var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {}, css = c && c.length ? c : el .parents(ui.originalElement[0]) .length ? ["width", "height"] : ["width", "height", "top", "left"]; $.each(css, function (i, prop) { var sum = (start[prop] || 0) + (delta[prop] || 0); if (sum && sum >= 0) { style[prop] = sum || null; } }); el.css(style); }); }; if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) { $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); } else { _alsoResize(o.alsoResize); } }, start : function () { var that = $(this).data("ui-resizable"), o = that.options, _store = function (exp) { $(exp).each(function () { var el = $(this); el.data("ui-resizable-alsoresize", { height: parseInt(el.height(), 10), left : parseInt(el.css("left"), 10), top : parseInt(el.css("top"), 10), width : parseInt(el.width(), 10) }); }); }; if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) { if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } else { $.each(o.alsoResize, function (exp) { _store(exp); }); } } else { _store(o.alsoResize); } }, stop : function () { $(this).removeData("resizable-alsoresize"); } }); $ .ui .plugin .add("resizable", "ghost", { resize: function () { var that = $(this).data("ui-resizable"); if (that.ghost) { that .ghost .css({height: that.size.height, position: "relative", width: that.size.width}); } }, start : function () { var that = $(this).data("ui-resizable"), o = that.options, cs = that.size; that.ghost = that .originalElement .clone(); that .ghost .css({ display : "block", height : cs.height, left : 0, margin : 0, opacity : 0.25, position: "relative", top : 0, width : cs.width }) .addClass("ui-resizable-ghost") .addClass(typeof o.ghost === "string" ? o.ghost : ""); that .ghost .appendTo(that.helper); }, stop : function () { var that = $(this).data("ui-resizable"); if (that.ghost && that.helper) { that .helper .get(0) .removeChild(that.ghost.get(0)); } } }); $ .ui .plugin .add("resizable", "grid", { resize: function () { var that = $(this).data("ui-resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid, gridX = (grid[0] || 1), gridY = (grid[1] || 1), ox = Math.round((cs.width - os.width) / gridX) * gridX, oy = Math.round((cs.height - os.height) / gridY) * gridY, newWidth = os.width + ox, newHeight = os.height + oy, isMaxWidth = o.maxWidth && (o.maxWidth < newWidth), isMaxHeight = o.maxHeight && (o.maxHeight < newHeight), isMinWidth = o.minWidth && (o.minWidth > newWidth), isMinHeight = o.minHeight && (o.minHeight > newHeight); o.grid = grid; if (isMinWidth) { newWidth = newWidth + gridX; } if (isMinHeight) { newHeight = newHeight + gridY; } if (isMaxWidth) { newWidth = newWidth - gridX; } if (isMaxHeight) { newHeight = newHeight - gridY; } if (/^(se|s|e)$/.test(a)) { that.size.width = newWidth; that.size.height = newHeight; } else if (/^(ne)$/.test(a)) { that.size.width = newWidth; that.size.height = newHeight; that.position.top = op.top - oy; } else if (/^(sw)$/.test(a)) { that.size.width = newWidth; that.size.height = newHeight; that.position.left = op.left - ox; } else { that.size.width = newWidth; that.size.height = newHeight; that.position.top = op.top - oy; that.position.left = op.left - ox; } } }); })(jQuery); (function ($, undefined) { $.widget("ui.selectable", $.ui.mouse, { _create : function () { var selectees, that = this; this .element .addClass("ui-selectable"); this.dragged = false; this.refresh = function () { selectees = $(that.options.filter, that.element[0]); selectees.addClass("ui-selectee"); selectees.each(function () { var $this = $(this), pos = $this.offset(); $.data(this, "selectable-item", { $element : $this, bottom : pos.top + $this.outerHeight(), element : this, left : pos.left, right : pos.left + $this.outerWidth(), selected : $this.hasClass("ui-selected"), selecting : $this.hasClass("ui-selecting"), startselected: false, top : pos.top, unselecting : $this.hasClass("ui-unselecting") }); }); }; this.refresh(); this.selectees = selectees.addClass("ui-selectee"); this._mouseInit(); this.helper = $("
"); }, _destroy : function () { this .selectees .removeClass("ui-selectee") .removeData("selectable-item"); this .element .removeClass("ui-selectable ui-selectable-disabled"); this._mouseDestroy(); }, _mouseDrag : function (event) { this.dragged = true; if (this.options.disabled) { return; } var tmp, that = this, options = this.options, x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; } if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; } this .helper .css({ height: y2 - y1, left : x1, top : y1, width : x2 - x1 }); this .selectees .each(function () { var selectee = $.data(this, "selectable-item"), hit = false; if (!selectee || selectee.element === that.element[0]) { return; } if (options.tolerance === "touch") { hit = (!(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1)); } else if (options.tolerance === "fit") { hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); } if (hit) { if (selectee.selected) { selectee .$element .removeClass("ui-selected"); selectee.selected = false; } if (selectee.unselecting) { selectee .$element .removeClass("ui-unselecting"); selectee.unselecting = false; } if (!selectee.selecting) { selectee .$element .addClass("ui-selecting"); selectee.selecting = true; that._trigger("selecting", event, {selecting: selectee.element}); } } else { if (selectee.selecting) { if ((event.metaKey || event.ctrlKey) && selectee.startselected) { selectee .$element .removeClass("ui-selecting"); selectee.selecting = false; selectee .$element .addClass("ui-selected"); selectee.selected = true; } else { selectee .$element .removeClass("ui-selecting"); selectee.selecting = false; if (selectee.startselected) { selectee .$element .addClass("ui-unselecting"); selectee.unselecting = true; } that._trigger("unselecting", event, {unselecting: selectee.element}); } } if (selectee.selected) { if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { selectee .$element .removeClass("ui-selected"); selectee.selected = false; selectee .$element .addClass("ui-unselecting"); selectee.unselecting = true; that._trigger("unselecting", event, {unselecting: selectee.element}); } } } }); return false; }, _mouseStart: function (event) { var that = this, options = this.options; this.opos = [event.pageX, event.pageY]; if (this.options.disabled) { return; } this.selectees = $(options.filter, this.element[0]); this._trigger("start", event); $(options.appendTo).append(this.helper); this .helper .css({"height": 0, "left": event.pageX, "top": event.pageY, "width": 0}); if (options.autoRefresh) { this.refresh(); } this .selectees .filter(".ui-selected") .each(function () { var selectee = $.data(this, "selectable-item"); selectee.startselected = true; if (!event.metaKey && !event.ctrlKey) { selectee .$element .removeClass("ui-selected"); selectee.selected = false; selectee .$element .addClass("ui-unselecting"); selectee.unselecting = true; that._trigger("unselecting", event, {unselecting: selectee.element}); } }); $(event.target) .parents() .addBack() .each(function () { var doSelect, selectee = $.data(this, "selectable-item"); if (selectee) { doSelect = (!event.metaKey && !event.ctrlKey) || !selectee .$element .hasClass("ui-selected"); selectee .$element .removeClass(doSelect ? "ui-unselecting" : "ui-selected") .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); selectee.unselecting = !doSelect; selectee.selecting = doSelect; selectee.selected = doSelect; if (doSelect) { that._trigger("selecting", event, {selecting: selectee.element}); } else { that._trigger("unselecting", event, {unselecting: selectee.element}); } return false; } }); }, _mouseStop : function (event) { var that = this; this.dragged = false; $(".ui-unselecting", this.element[0]).each(function () { var selectee = $.data(this, "selectable-item"); selectee .$element .removeClass("ui-unselecting"); selectee.unselecting = false; selectee.startselected = false; that._trigger("unselected", event, {unselected: selectee.element}); }); $(".ui-selecting", this.element[0]).each(function () { var selectee = $.data(this, "selectable-item"); selectee .$element .removeClass("ui-selecting") .addClass("ui-selected"); selectee.selecting = false; selectee.selected = true; selectee.startselected = true; that._trigger("selected", event, {selected: selectee.element}); }); this._trigger("stop", event); this .helper .remove(); return false; }, options : { appendTo : "body", autoRefresh: true, distance : 0, filter : "*", selected : null, selecting : null, start : null, stop : null, tolerance : "touch", unselected : null, unselecting: null }, version : "1.10.2" }); })(jQuery); (function ($, undefined) { function isOverAxis(x, reference, size) { return (x > reference) && (x < (reference + size)); } function isFloating(item) { return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display")); } $.widget("ui.sortable", $.ui.mouse, { _adjustOffsetFromHelper : function (obj) { if (typeof obj === "string") { obj = obj.split(" "); } if ($.isArray(obj)) { obj = { left: +obj[0], top : +obj[1] || 0 }; } if ("left" in obj) { this.offset.click.left = obj.left + this.margins.left; } if ("right" in obj) { this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; } if ("top" in obj) { this.offset.click.top = obj.top + this.margins.top; } if ("bottom" in obj) { this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; } }, _cacheHelperProportions : function () { this.helperProportions = { height: this .helper .outerHeight(), width : this .helper .outerWidth() }; }, _cacheMargins : function () { this.margins = { left: (parseInt(this.currentItem.css("marginLeft"), 10) || 0), top : (parseInt(this.currentItem.css("marginTop"), 10) || 0) }; }, _clear : function (event, noPropagation) { this.reverting = false; var i, delayedTriggers = []; if (!this._noFinalSort && this.currentItem.parent().length) { this .placeholder .before(this.currentItem); } this._noFinalSort = null; if (this.helper[0] === this.currentItem[0]) { for (i in this._storedCSS) { if (this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") { this._storedCSS[i] = ""; } } this .currentItem .css(this._storedCSS) .removeClass("ui-sortable-helper"); } else { this .currentItem .show(); } if (this.fromOutside && !noPropagation) { delayedTriggers.push(function (event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); } if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) { delayedTriggers.push(function (event) { this._trigger("update", event, this._uiHash()); }); } if (this !== this.currentContainer) { if (!noPropagation) { delayedTriggers.push(function (event) { this._trigger("remove", event, this._uiHash()); }); delayedTriggers.push((function (c) { return function (event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); delayedTriggers.push((function (c) { return function (event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); } } for (i = this.containers.length - 1; i >= 0; i -= 1) { if (!noPropagation) { delayedTriggers.push((function (c) { return function (event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); } if (this.containers[i].containerCache.over) { delayedTriggers.push((function (c) { return function (event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); this .containers[i] .containerCache .over = 0; } } if (this.storedCursor) { this .document .find("body") .css("cursor", this.storedCursor); this .storedStylesheet .remove(); } if (this._storedOpacity) { this .helper .css("opacity", this._storedOpacity); } if (this._storedZIndex) { this .helper .css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex); } this.dragging = false; if (this.cancelHelperRemoval) { if (!noPropagation) { this._trigger("beforeStop", event, this._uiHash()); for (i = 0; i < delayedTriggers.length; i += 1) { delayedTriggers[i].call(this, event); } this._trigger("stop", event, this._uiHash()); } this.fromOutside = false; return false; } if (!noPropagation) { this._trigger("beforeStop", event, this._uiHash()); } this .placeholder[0] .parentNode .removeChild(this.placeholder[0]); if (this.helper[0] !== this.currentItem[0]) { this .helper .remove(); } this.helper = null; if (!noPropagation) { for (i = 0; i < delayedTriggers.length; i += 1) { delayedTriggers[i].call(this, event); } this._trigger("stop", event, this._uiHash()); } this.fromOutside = false; return true; }, _connectWith : function () { var options = this.options; return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith; }, _contactContainers : function (event) { var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating, innermostContainer = null, innermostIndex = null; for (i = this.containers.length - 1; i >= 0; i -= 1) { if ($.contains(this.currentItem[0], this.containers[i].element[0])) { continue; } if (this._intersectsWith(this.containers[i].containerCache)) { if (innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) { continue; } innermostContainer = this.containers[i]; innermostIndex = i; } else { if (this.containers[i].containerCache.over) { this .containers[i] ._trigger("out", event, this._uiHash(this)); this .containers[i] .containerCache .over = 0; } } } if (!innermostContainer) { return; } if (this.containers.length === 1) { if (!this.containers[innermostIndex].containerCache.over) { this .containers[innermostIndex] ._trigger("over", event, this._uiHash(this)); this .containers[innermostIndex] .containerCache .over = 1; } } else { dist = 10000; itemWithLeastDistance = null; floating = innermostContainer.floating || isFloating(this.currentItem); posProperty = floating ? "left" : "top"; sizeProperty = floating ? "width" : "height"; base = this.positionAbs[posProperty] + this .offset .click[posProperty]; for (j = this.items.length - 1; j >= 0; j -= 1) { if (!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) { continue; } if (this.items[j].item[0] === this.currentItem[0]) { continue; } if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) { continue; } cur = this .items[j] .item .offset()[posProperty]; nearBottom = false; if (Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)) { nearBottom = true; cur += this.items[j][sizeProperty]; } if (Math.abs(cur - base) < dist) { dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; this.direction = nearBottom ? "up" : "down"; } } if (!itemWithLeastDistance && !this.options.dropOnEmpty) { return; } if (this.currentContainer === this.containers[innermostIndex]) { return; } itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); this._trigger("change", event, this._uiHash()); this .containers[innermostIndex] ._trigger("change", event, this._uiHash(this)); this.currentContainer = this.containers[innermostIndex]; this .options .placeholder .update(this.currentContainer, this.placeholder); this .containers[innermostIndex] ._trigger("over", event, this._uiHash(this)); this .containers[innermostIndex] .containerCache .over = 1; } }, _convertPositionTo : function (d, pos) { if (!pos) { pos = this.position; } var mod = d === "absolute" ? 1 : -1, scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); return { left: (pos.left + this.offset.relative.left * mod + this.offset.parent.left * mod - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod)), top : (pos.top + this.offset.relative.top * mod + this.offset.parent.top * mod - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (scrollIsRootNode ? 0 : scroll.scrollTop())) * mod)) }; }, _create : function () { var o = this.options; this.containerCache = {}; this .element .addClass("ui-sortable"); this.refresh(); this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false; this.offset = this .element .offset(); this._mouseInit(); this.ready = true; }, _createHelper : function (event) { var o = this.options, helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem); if (!helper.parents("body").length) { $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); } if (helper[0] === this.currentItem[0]) { this._storedCSS = { height : this .currentItem[0] .style .height, left : this .currentItem .css("left"), position: this .currentItem .css("position"), top : this .currentItem .css("top"), width : this .currentItem[0] .style .width }; } if (!helper[0].style.width || o.forceHelperSize) { helper.width(this.currentItem.width()); } if (!helper[0].style.height || o.forceHelperSize) { helper.height(this.currentItem.height()); } return helper; }, _createPlaceholder : function (that) { that = that || this; var className, o = that.options; if (!o.placeholder || o.placeholder.constructor === String) { className = o.placeholder; o.placeholder = { element: function () { var nodeName = that .currentItem[0] .nodeName .toLowerCase(), element = $(that.document[0].createElement(nodeName)) .addClass(className || that.currentItem[0].className + " ui-sortable-placeholder") .removeClass("ui-sortable-helper"); if (nodeName === "tr") { element.append("
"); } else if (nodeName === "img") { element.attr("src", that.currentItem.attr("src")); } if (!className) { element.css("visibility", "hidden"); } return element; }, update : function (container, p) { if (className && !o.forcePlaceholderSize) { return; } if (!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop") || 0, 10) - parseInt(that.currentItem.css("paddingBottom") || 0, 10)); } if (!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft") || 0, 10) - parseInt(that.currentItem.css("paddingRight") || 0, 10)); } } }; } that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); that .currentItem .after(that.placeholder); o .placeholder .update(that, that.placeholder); }, _destroy : function () { this .element .removeClass("ui-sortable ui-sortable-disabled"); this._mouseDestroy(); for (var i = this.items.length - 1; i >= 0; i -= 1) { this .items[i] .item .removeData(this.widgetName + "-item"); } return this; }, _generatePosition : function (event) { var top, left, o = this.options, pageX = event.pageX, pageY = event.pageY, scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); if (this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset(); } if (this.originalPosition) { if (this.containment) { if (event.pageX - this.offset.click.left < this.containment[0]) { pageX = this.containment[0] + this.offset.click.left; } if (event.pageY - this.offset.click.top < this.containment[1]) { pageY = this.containment[1] + this.offset.click.top; } if (event.pageX - this.offset.click.left > this.containment[2]) { pageX = this.containment[2] + this.offset.click.left; } if (event.pageY - this.offset.click.top > this.containment[3]) { pageY = this.containment[3] + this.offset.click.top; } } if (o.grid) { top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; pageY = this.containment ? ((top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; pageX = this.containment ? ((left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; } } return { left: (pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()))), top : (pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (scrollIsRootNode ? 0 : scroll.scrollTop())))) }; }, _getDragHorizontalDirection: function () { var delta = this.positionAbs.left - this.lastPositionAbs.left; return delta !== 0 && (delta > 0 ? "right" : "left"); }, _getDragVerticalDirection : function () { var delta = this.positionAbs.top - this.lastPositionAbs.top; return delta !== 0 && (delta > 0 ? "down" : "up"); }, _getItemsAsjQuery : function (connected) { var i, j, cur, inst, items = [], queries = [], connectWith = this._connectWith(); if (connectWith && connected) { for (i = connectWith.length - 1; i >= 0; i -= 1) { cur = $(connectWith[i]); for (j = cur.length - 1; j >= 0; j -= 1) { inst = $.data(cur[j], this.widgetFullName); if (inst && inst !== this && !inst.options.disabled) { queries.push([ $.isFunction(inst.options.items) ? inst .options .items .call(inst.element) : $(inst.options.items, inst.element) .not(".ui-sortable-helper") .not(".ui-sortable-placeholder"), inst ]); } } } } queries.push([ $.isFunction(this.options.items) ? this .options .items .call(this.element, null, { item : this.currentItem, options: this.options }) : $(this.options.items, this.element) .not(".ui-sortable-helper") .not(".ui-sortable-placeholder"), this ]); for (i = queries.length - 1; i >= 0; i -= 1) { queries[i][0].each(function () { items.push(this); }); } return $(items); }, _getParentOffset : function () { this.offsetParent = this .helper .offsetParent(); var po = this .offsetParent .offset(); if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) { po.left += this .scrollParent .scrollLeft(); po.top += this .scrollParent .scrollTop(); } if (this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) { po = { left: 0, top : 0 }; } return { left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0), top : po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0) }; }, _getRelativeOffset : function () { if (this.cssPosition === "relative") { var p = this .currentItem .position(); return { left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + this .scrollParent .scrollLeft(), top : p.top - (parseInt(this.helper.css("top"), 10) || 0) + this .scrollParent .scrollTop() }; } else { return {left: 0, top: 0}; } }, _intersectsWith : function (item) { var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width, y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height, l = item.left, r = l + item.width, t = item.top, b = t + item.height, dyClick = this.offset.click.top, dxClick = this.offset.click.left, isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; if (this.options.tolerance === "pointer" || this.options.forcePointerForContainers || (this.options.tolerance !== "pointer" && this.helperProportions[ this.floating ? "width" : "height" ] > item[ this.floating ? "width" : "height" ])) { return isOverElement; } else { return (l < x1 + (this.helperProportions.width / 2) && x2 - (this.helperProportions.width / 2) < r && t < y1 + (this.helperProportions.height / 2) && y2 - (this.helperProportions.height / 2) < b); } }, _intersectsWithPointer : function (item) { var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), isOverElement = isOverElementHeight && isOverElementWidth, verticalDirection = this._getDragVerticalDirection(), horizontalDirection = this._getDragHorizontalDirection(); if (!isOverElement) { return false; } return this.floating ? (((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1) : (verticalDirection && (verticalDirection === "down" ? 2 : 1)); }, _intersectsWithSides : function (item) { var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height / 2), item.height), isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width / 2), item.width), verticalDirection = this._getDragVerticalDirection(), horizontalDirection = this._getDragHorizontalDirection(); if (this.floating && horizontalDirection) { return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf)); } else { return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf)); } }, _mouseCapture : function (event, overrideHandle) { var currentItem = null, validHandle = false, that = this; if (this.reverting) { return false; } if (this.options.disabled || this.options.type === "static") { return false; } this._refreshItems(event); $(event.target) .parents() .each(function () { if ($.data(this, that.widgetName + "-item") === that) { currentItem = $(this); return false; } }); if ($.data(event.target, that.widgetName + "-item") === that) { currentItem = $(event.target); } if (!currentItem) { return false; } if (this.options.handle && !overrideHandle) { $(this.options.handle, currentItem) .find("*") .addBack() .each(function () { if (this === event.target) { validHandle = true; } }); if (!validHandle) { return false; } } this.currentItem = currentItem; this._removeCurrentsFromItems(); return true; }, _mouseDrag : function (event) { var i, item, itemElement, intersection, o = this.options, scrolled = false; this.position = this._generatePosition(event); this.positionAbs = this._convertPositionTo("absolute"); if (!this.lastPositionAbs) { this.lastPositionAbs = this.positionAbs; } if (this.options.scroll) { if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { this .scrollParent[0] .scrollTop = scrolled = this .scrollParent[0] .scrollTop + o.scrollSpeed; } else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) { this .scrollParent[0] .scrollTop = scrolled = this .scrollParent[0] .scrollTop - o.scrollSpeed; } if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) { this .scrollParent[0] .scrollLeft = scrolled = this .scrollParent[0] .scrollLeft + o.scrollSpeed; } else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) { this .scrollParent[0] .scrollLeft = scrolled = this .scrollParent[0] .scrollLeft - o.scrollSpeed; } } else { if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) { scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) { scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); } if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) { scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) { scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); } } if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { $ .ui .ddmanager .prepareOffsets(this, event); } } this.positionAbs = this._convertPositionTo("absolute"); 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"; } for (i = this.items.length - 1; i >= 0; i -= 1) { item = this.items[i]; itemElement = item.item[0]; intersection = this._intersectsWithPointer(item); if (!intersection) { continue; } if (item.instance !== this.currentContainer) { continue; } if (itemElement !== this.currentItem[0] && this.placeholder[ intersection === 1 ? "next" : "prev" ]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) { this.direction = intersection === 1 ? "down" : "up"; if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { this._rearrange(event, item); } else { break; } this._trigger("change", event, this._uiHash()); break; } } this._contactContainers(event); if ($.ui.ddmanager) { $ .ui .ddmanager .drag(this, event); } this._trigger("sort", event, this._uiHash()); this.lastPositionAbs = this.positionAbs; return false; }, _mouseStart : function (event, overrideHandle, noActivation) { var i, body, o = this.options; this.currentContainer = this; this.refreshPositions(); this.helper = this._createHelper(event); this._cacheHelperProportions(); this._cacheMargins(); this.scrollParent = this .helper .scrollParent(); this.offset = this .currentItem .offset(); this.offset = { left: this.offset.left - this.margins.left, top : this.offset.top - this.margins.top }; $.extend(this.offset, { click : { left: event.pageX - this.offset.left, top : event.pageY - this.offset.top }, parent : this._getParentOffset(), relative: this._getRelativeOffset() }); this .helper .css("position", "absolute"); this.cssPosition = this .helper .css("position"); this.originalPosition = this._generatePosition(event); this.originalPageX = event.pageX; this.originalPageY = event.pageY; (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); this.domPosition = { parent: this .currentItem .parent()[0], prev : this .currentItem .prev()[0] }; if (this.helper[0] !== this.currentItem[0]) { this .currentItem .hide(); } this._createPlaceholder(); if (o.containment) { this._setContainment(); } if (o.cursor && o.cursor !== "auto") { body = this .document .find("body"); this.storedCursor = body.css("cursor"); body.css("cursor", o.cursor); this.storedStylesheet = $("