Created
September 9, 2019 19:45
-
-
Save jalbertbowden/718855793363c1c435a00740441d37f8 to your computer and use it in GitHub Desktop.
music theory js unmin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function topKey(keys, chords) { | |
var counts = {}, | |
result = []; | |
_(keys).each(function(values, key, list) { | |
counts[key] = _(values).chain().intersection(this.chords).size().value() | |
}, { | |
chords: chords | |
}); | |
var max = _(counts).max(); | |
return _(counts).each(function(value, key, list) { | |
value === this.max && result.push(key) | |
}, { | |
max: max | |
}), result | |
} | |
function namethatkey() { | |
var chords = jQuery.makeArray(jQuery(".selected").map(function() { | |
return jQuery(this).html() | |
})), | |
topkeys = topKey(Keys, chords); | |
jQuery("#result").css("display", "block"), jQuery(".selected_slice").removeClass("selected_slice"), jQuery(".selected_slice_minor").removeClass("selected_slice_minor"), jQuery(".selected_key_text").removeClass("selected_key_text"), _(topkeys).each(function(item, index) { | |
var id_major = item.replace(" ", "_").replace("#", "sharp"); | |
jQuery("#" + id_major + " .pie").addClass("selected_slice"); | |
var id_minor = item.replace(" ", "_").replace("#", "sharp"); | |
jQuery("#" + id_minor + " .pie_minor").addClass("selected_slice_minor"); | |
var id_ie_major = item.replace(" ", "_").replace("#", "sharp").replace("Major", ""); | |
jQuery("#ie_" + id_ie_major + "Major").addClass("selected_slice"); | |
var id_ie_minor = item.replace(" ", "_").replace("#", "sharp").replace("Minor", ""); | |
jQuery("#ie_" + id_ie_minor + "Minor").addClass("selected_slice_minor"); | |
var id_selected_text = item.replace(" ", "_").replace("#", "sharp"); | |
id_selected_text += "-label", jQuery("#" + id_selected_text).addClass("selected_key_text") | |
}), 0 == jQuery("#chord_selector td.selected").length && (jQuery(".selected_slice").removeClass("selected_slice"), jQuery(".selected_slice_minor").removeClass("selected_slice_minor"), jQuery(".selected_key_text").removeClass("selected_key_text")) | |
} | |
function scaleGen(start, scale) { | |
function chord_note(degree) { | |
return degree -= 1, i + degree >= s.length ? i + degree - s.length : i + degree | |
} | |
var notes, scales, triads, the_key, s, notes_array, i, start_reference, total; | |
for (notes = { | |
sharps: ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"], | |
flats: ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"] | |
}, scales = { | |
major: [2, 2, 1, 2, 2, 2], | |
blues: [3, 2, 1, 1, 3], | |
natural_minor: [2, 1, 2, 2, 1, 2], | |
harmonic_minor: [2, 1, 2, 2, 1, 3], | |
melodic_minor: [2, 1, 2, 2, 2, 2, 1, -2, -2, -1, -2, -2, -1, -2] | |
}, triads = { | |
major: [4, 3], | |
minor: [3, 4], | |
dim: [3, 3], | |
aug: [4, 4] | |
}, start = start || 0, scaleIntervals = scale ? scales[scale] : scales.major, notes_array = scaleIntervals !== scales.major ? 0 === start || 1 === start || 2 === start || 3 === start || 5 === start || 7 === start || 8 === start || 10 === start ? notes.flats : notes.sharps : 1 === start || 3 === start || 5 === start || 8 === start || 10 === start ? notes.flats : notes.sharps, the_key = { | |
the_scale: [], | |
diatonic_triad_notes: [], | |
diatonic_triad_names: [], | |
diatonic_sevenths_notes: [], | |
scale_type: scale, | |
root: notes_array[start], | |
scale_intervals: scaleIntervals | |
}, s = the_key.the_scale, Array.prototype.findIndex = function(value) { | |
var ctr, i; | |
for (ctr = "", i = 0; i < this.length; i++) | |
if (this[i] === value) return i; | |
return ctr | |
}, start_reference = [], total = 0, i = 0; i <= scaleIntervals.length; i++) { | |
total += scaleIntervals[i], start_reference.push(total); | |
var current_note = 0 === i ? start : start + start_reference[i - 1]; | |
current_note >= notes_array.length && (current_note -= 12), s.push(notes_array[current_note]) | |
} | |
for (scaleIntervals !== scales.major ? (the_key.relative_major = s[2], the_key.relative_major_ref = notes_array.findIndex(s[2])) : (the_key.relative_minor = s[5], the_key.relative_minor_ref = notes_array.findIndex(s[5])), scaleIntervals !== scales.major ? the_key.pentatonic_scale = [s[0], s[2], s[3], s[4], s[6]] : the_key.pentatonic_scale = [s[0], s[1], s[2], s[4], s[5]], i = 0; i < s.length; i++) { | |
var third_extend, fifth_extend, M, m, dim; | |
the_key.diatonic_triad_notes.push([s[chord_note(1)], s[chord_note(3)], s[chord_note(5)]]), the_key.diatonic_sevenths_notes.push([s[chord_note(1)], s[chord_note(3)], s[chord_note(5)], s[chord_note(7)]]), third_extend = notes_array.findIndex(s[chord_note(3)]) < notes_array.findIndex(s[chord_note(1)]) ? notes_array.findIndex(s[chord_note(3)]) + notes_array.length : notes_array.findIndex(s[chord_note(3)]), fifth_extend = notes_array.findIndex(s[chord_note(5)]) < third_extend ? notes_array.findIndex(s[chord_note(5)]) + notes_array.length : notes_array.findIndex(s[chord_note(5)]), M = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.major[0] && fifth_extend - third_extend === triads.major[1], m = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.minor[0] && fifth_extend - third_extend === triads.minor[1], dim = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.dim[0] && fifth_extend - third_extend === triads.dim[1], aug = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.aug[0] && fifth_extend - third_extend === triads.aug[1], M7 = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.major[0] && fifth_extend - third_extend === triads.major[1], Dom7 = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.major[0] && fifth_extend - third_extend === triads.major[1], m7 = third_extend - notes_array.findIndex(s[chord_note(1)]) === triads.major[0] && fifth_extend - third_extend === triads.major[1], M && the_key.diatonic_triad_names.push(s[i] + "M"), m && the_key.diatonic_triad_names.push(s[i] + "m"), dim && the_key.diatonic_triad_names.push(s[i] + "dim"), aug && the_key.diatonic_triad_names.push(s[i] + "aug") | |
} | |
return the_key | |
}! function(factory) { | |
var registeredInModuleLoader = !1; | |
if ("function" == typeof define && define.amd && (define(factory), registeredInModuleLoader = !0), "object" == typeof exports && (module.exports = factory(), registeredInModuleLoader = !0), !registeredInModuleLoader) { | |
var OldCookies = window.Cookies, | |
api = window.Cookies = factory(); | |
api.noConflict = function() { | |
return window.Cookies = OldCookies, api | |
} | |
} | |
}(function() { | |
function extend() { | |
for (var i = 0, result = {}; i < arguments.length; i++) { | |
var attributes = arguments[i]; | |
for (var key in attributes) result[key] = attributes[key] | |
} | |
return result | |
} | |
function init(converter) { | |
function api(key, value, attributes) { | |
var result; | |
if ("undefined" != typeof document) { | |
if (arguments.length > 1) { | |
if (attributes = extend({ | |
path: "/" | |
}, api.defaults, attributes), "number" == typeof attributes.expires) { | |
var expires = new Date; | |
expires.setMilliseconds(expires.getMilliseconds() + 864e5 * attributes.expires), attributes.expires = expires | |
} | |
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ""; | |
try { | |
result = JSON.stringify(value), /^[\{\[]/.test(result) && (value = result) | |
} catch (e) {} | |
value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), key = encodeURIComponent(String(key)), key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent), key = key.replace(/[\(\)]/g, escape); | |
var stringifiedAttributes = ""; | |
for (var attributeName in attributes) attributes[attributeName] && (stringifiedAttributes += "; " + attributeName, !0 !== attributes[attributeName] && (stringifiedAttributes += "=" + attributes[attributeName])); | |
return document.cookie = key + "=" + value + stringifiedAttributes | |
} | |
key || (result = {}); | |
for (var cookies = document.cookie ? document.cookie.split("; ") : [], rdecode = /(%[0-9A-Z]{2})+/g, i = 0; i < cookies.length; i++) { | |
var parts = cookies[i].split("="), | |
cookie = parts.slice(1).join("="); | |
this.json || '"' !== cookie.charAt(0) || (cookie = cookie.slice(1, -1)); | |
try { | |
var name = parts[0].replace(rdecode, decodeURIComponent); | |
if (cookie = converter.read ? converter.read(cookie, name) : converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent), this.json) try { | |
cookie = JSON.parse(cookie) | |
} catch (e) {} | |
if (key === name) { | |
result = cookie; | |
break | |
} | |
key || (result[name] = cookie) | |
} catch (e) {} | |
} | |
return result | |
} | |
} | |
return api.set = api, api.get = function(key) { | |
return api.call(api, key) | |
}, api.getJSON = function() { | |
return api.apply({ | |
json: !0 | |
}, [].slice.call(arguments)) | |
}, api.defaults = {}, api.remove = function(key, attributes) { | |
api(key, "", extend(attributes, { | |
expires: -1 | |
})) | |
}, api.withConverter = init, api | |
} | |
return init(function() {}) | |
}), | |
function(global, factory) { | |
"object" == typeof module && "object" == typeof module.exports ? module.exports = global.document ? factory(global, !0) : function(w) { | |
if (!w.document) throw new Error("jQuery requires a window with a document"); | |
return factory(w) | |
} : factory(global) | |
}("undefined" != typeof window ? window : this, function(window, noGlobal) { | |
function isArraylike(obj) { | |
var length = obj.length, | |
type = jQuery.type(obj); | |
return "function" !== type && !jQuery.isWindow(obj) && (!(1 !== obj.nodeType || !length) || ("array" === type || 0 === length || "number" == typeof length && length > 0 && length - 1 in obj)) | |
} | |
function winnow(elements, qualifier, not) { | |
if (jQuery.isFunction(qualifier)) return jQuery.grep(elements, function(elem, i) { | |
return !!qualifier.call(elem, i, elem) !== not | |
}); | |
if (qualifier.nodeType) return jQuery.grep(elements, function(elem) { | |
return elem === qualifier !== not | |
}); | |
if ("string" == typeof qualifier) { | |
if (risSimple.test(qualifier)) return jQuery.filter(qualifier, elements, not); | |
qualifier = jQuery.filter(qualifier, elements) | |
} | |
return jQuery.grep(elements, function(elem) { | |
return jQuery.inArray(elem, qualifier) >= 0 !== not | |
}) | |
} | |
function sibling(cur, dir) { | |
do { | |
cur = cur[dir] | |
} while (cur && 1 !== cur.nodeType); | |
return cur | |
} | |
function createOptions(options) { | |
var object = optionsCache[options] = {}; | |
return jQuery.each(options.match(rnotwhite) || [], function(_, flag) { | |
object[flag] = !0 | |
}), object | |
} | |
function detach() { | |
document.addEventListener ? (document.removeEventListener("DOMContentLoaded", completed, !1), window.removeEventListener("load", completed, !1)) : (document.detachEvent("onreadystatechange", completed), window.detachEvent("onload", completed)) | |
} | |
function completed() { | |
(document.addEventListener || "load" === event.type || "complete" === document.readyState) && (detach(), jQuery.ready()) | |
} | |
function dataAttr(elem, key, data) { | |
if (void 0 === data && 1 === elem.nodeType) { | |
var name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase(); | |
if ("string" == typeof(data = elem.getAttribute(name))) { | |
try { | |
data = "true" === data || "false" !== data && ("null" === data ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data) | |
} catch (e) {} | |
jQuery.data(elem, key, data) | |
} else data = void 0 | |
} | |
return data | |
} | |
function isEmptyDataObject(obj) { | |
var name; | |
for (name in obj) | |
if (("data" !== name || !jQuery.isEmptyObject(obj[name])) && "toJSON" !== name) return !1; | |
return !0 | |
} | |
function internalData(elem, name, data, pvt) { | |
if (jQuery.acceptData(elem)) { | |
var ret, thisCache, internalKey = jQuery.expando, | |
isNode = elem.nodeType, | |
cache = isNode ? jQuery.cache : elem, | |
id = isNode ? elem[internalKey] : elem[internalKey] && internalKey; | |
if (id && cache[id] && (pvt || cache[id].data) || void 0 !== data || "string" != typeof name) return id || (id = isNode ? elem[internalKey] = deletedIds.pop() || jQuery.guid++ : internalKey), cache[id] || (cache[id] = isNode ? {} : { | |
toJSON: jQuery.noop | |
}), "object" != typeof name && "function" != typeof name || (pvt ? cache[id] = jQuery.extend(cache[id], name) : cache[id].data = jQuery.extend(cache[id].data, name)), thisCache = cache[id], pvt || (thisCache.data || (thisCache.data = {}), thisCache = thisCache.data), void 0 !== data && (thisCache[jQuery.camelCase(name)] = data), "string" == typeof name ? null == (ret = thisCache[name]) && (ret = thisCache[jQuery.camelCase(name)]) : ret = thisCache, ret | |
} | |
} | |
function internalRemoveData(elem, name, pvt) { | |
if (jQuery.acceptData(elem)) { | |
var thisCache, i, isNode = elem.nodeType, | |
cache = isNode ? jQuery.cache : elem, | |
id = isNode ? elem[jQuery.expando] : jQuery.expando; | |
if (cache[id]) { | |
if (name && (thisCache = pvt ? cache[id] : cache[id].data)) { | |
jQuery.isArray(name) ? name = name.concat(jQuery.map(name, jQuery.camelCase)) : name in thisCache ? name = [name] : (name = jQuery.camelCase(name), name = name in thisCache ? [name] : name.split(" ")), i = name.length; | |
for (; i--;) delete thisCache[name[i]]; | |
if (pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache)) return | |
}(pvt || (delete cache[id].data, isEmptyDataObject(cache[id]))) && (isNode ? jQuery.cleanData([elem], !0) : support.deleteExpando || cache != cache.window ? delete cache[id] : cache[id] = null) | |
} | |
} | |
} | |
function returnTrue() { | |
return !0 | |
} | |
function returnFalse() { | |
return !1 | |
} | |
function safeActiveElement() { | |
try { | |
return document.activeElement | |
} catch (err) {} | |
} | |
function createSafeFragment(document) { | |
var list = nodeNames.split("|"), | |
safeFrag = document.createDocumentFragment(); | |
if (safeFrag.createElement) | |
for (; list.length;) safeFrag.createElement(list.pop()); | |
return safeFrag | |
} | |
function getAll(context, tag) { | |
var elems, elem, i = 0, | |
found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName(tag || "*") : typeof context.querySelectorAll !== strundefined ? context.querySelectorAll(tag || "*") : void 0; | |
if (!found) | |
for (found = [], elems = context.childNodes || context; null != (elem = elems[i]); i++) !tag || jQuery.nodeName(elem, tag) ? found.push(elem) : jQuery.merge(found, getAll(elem, tag)); | |
return void 0 === tag || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], found) : found | |
} | |
function fixDefaultChecked(elem) { | |
rcheckableType.test(elem.type) && (elem.defaultChecked = elem.checked) | |
} | |
function manipulationTarget(elem, content) { | |
return jQuery.nodeName(elem, "table") && jQuery.nodeName(11 !== content.nodeType ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem | |
} | |
function disableScript(elem) { | |
return elem.type = (null !== jQuery.find.attr(elem, "type")) + "/" + elem.type, elem | |
} | |
function restoreScript(elem) { | |
var match = rscriptTypeMasked.exec(elem.type); | |
return match ? elem.type = match[1] : elem.removeAttribute("type"), elem | |
} | |
function setGlobalEval(elems, refElements) { | |
for (var elem, i = 0; null != (elem = elems[i]); i++) jQuery._data(elem, "globalEval", !refElements || jQuery._data(refElements[i], "globalEval")) | |
} | |
function cloneCopyEvent(src, dest) { | |
if (1 === dest.nodeType && jQuery.hasData(src)) { | |
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++) jQuery.event.add(dest, type, events[type][i]) | |
} | |
curData.data && (curData.data = jQuery.extend({}, curData.data)) | |
} | |
} | |
function fixCloneNodeIssues(src, dest) { | |
var nodeName, e, data; | |
if (1 === dest.nodeType) { | |
if (nodeName = dest.nodeName.toLowerCase(), !support.noCloneEvent && dest[jQuery.expando]) { | |
data = jQuery._data(dest); | |
for (e in data.events) jQuery.removeEvent(dest, e, data.handle); | |
dest.removeAttribute(jQuery.expando) | |
} | |
"script" === nodeName && dest.text !== src.text ? (disableScript(dest).text = src.text, restoreScript(dest)) : "object" === nodeName ? (dest.parentNode && (dest.outerHTML = src.outerHTML), support.html5Clone && src.innerHTML && !jQuery.trim(dest.innerHTML) && (dest.innerHTML = src.innerHTML)) : "input" === nodeName && rcheckableType.test(src.type) ? (dest.defaultChecked = dest.checked = src.checked, dest.value !== src.value && (dest.value = src.value)) : "option" === nodeName ? dest.defaultSelected = dest.selected = src.defaultSelected : "input" !== nodeName && "textarea" !== nodeName || (dest.defaultValue = src.defaultValue) | |
} | |
} | |
function actualDisplay(name, doc) { | |
var style, elem = jQuery(doc.createElement(name)).appendTo(doc.body), | |
display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ? style.display : jQuery.css(elem[0], "display"); | |
return elem.detach(), display | |
} | |
function defaultDisplay(nodeName) { | |
var doc = document, | |
display = elemdisplay[nodeName]; | |
return display || (display = actualDisplay(nodeName, doc), "none" !== display && display || (iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement), doc = (iframe[0].contentWindow || iframe[0].contentDocument).document, doc.write(), doc.close(), display = actualDisplay(nodeName, doc), iframe.detach()), elemdisplay[nodeName] = display), display | |
} | |
function addGetHookIf(conditionFn, hookFn) { | |
return { | |
get: function() { | |
var condition = conditionFn(); | |
if (null != condition) return condition ? void delete this.get : (this.get = hookFn).apply(this, arguments) | |
} | |
} | |
} | |
function vendorPropName(style, name) { | |
if (name in style) return name; | |
for (var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; i--;) | |
if ((name = cssPrefixes[i] + capName) in style) return name; | |
return origName | |
} | |
function showHide(elements, show) { | |
for (var display, elem, hidden, values = [], index = 0, length = elements.length; index < length; index++) elem = elements[index], elem.style && (values[index] = jQuery._data(elem, "olddisplay"), display = elem.style.display, show ? (values[index] || "none" !== display || (elem.style.display = ""), "" === elem.style.display && isHidden(elem) && (values[index] = jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName)))) : (hidden = isHidden(elem), (display && "none" !== display || !hidden) && jQuery._data(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display")))); | |
for (index = 0; index < length; index++) elem = elements[index], elem.style && (show && "none" !== elem.style.display && "" !== elem.style.display || (elem.style.display = show ? values[index] || "" : "none")); | |
return elements | |
} | |
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, styles) { | |
for (var i = extra === (isBorderBox ? "border" : "content") ? 4 : "width" === name ? 1 : 0, val = 0; i < 4; i += 2) "margin" === extra && (val += jQuery.css(elem, extra + cssExpand[i], !0, styles)), isBorderBox ? ("content" === extra && (val -= jQuery.css(elem, "padding" + cssExpand[i], !0, styles)), "margin" !== extra && (val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", !0, styles))) : (val += jQuery.css(elem, "padding" + cssExpand[i], !0, styles), "padding" !== extra && (val += jQuery.css(elem, "border" + cssExpand[i] + "Width", !0, styles))); | |
return val | |
} | |
function getWidthOrHeight(elem, name, extra) { | |
var valueIsBorderBox = !0, | |
val = "width" === name ? elem.offsetWidth : elem.offsetHeight, | |
styles = getStyles(elem), | |
isBorderBox = support.boxSizing && "border-box" === jQuery.css(elem, "boxSizing", !1, styles); | |
if (val <= 0 || null == val) { | |
if (val = curCSS(elem, name, styles), (val < 0 || null == val) && (val = elem.style[name]), rnumnonpx.test(val)) return val; | |
valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]), val = parseFloat(val) || 0 | |
} | |
return val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles) + "px" | |
} | |
function Tween(elem, options, prop, end, easing) { | |
return new Tween.prototype.init(elem, options, prop, end, easing) | |
} | |
function createFxNow() { | |
return setTimeout(function() { | |
fxNow = void 0 | |
}), fxNow = jQuery.now() | |
} | |
function genFx(type, includeWidth) { | |
var which, attrs = { | |
height: type | |
}, | |
i = 0; | |
for (includeWidth = includeWidth ? 1 : 0; i < 4; i += 2 - includeWidth) which = cssExpand[i], attrs["margin" + which] = attrs["padding" + which] = type; | |
return includeWidth && (attrs.opacity = attrs.width = type), attrs | |
} | |
function createTween(value, prop, animation) { | |
for (var tween, collection = (tweeners[prop] || []).concat(tweeners["*"]), index = 0, length = collection.length; index < length; index++) | |
if (tween = collection[index].call(animation, prop, value)) return tween | |
} | |
function defaultPrefilter(elem, props, opts) { | |
var prop, value, toggle, tween, hooks, oldfire, display, anim = this, | |
orig = {}, | |
style = elem.style, | |
hidden = elem.nodeType && isHidden(elem), | |
dataShow = jQuery._data(elem, "fxshow"); | |
opts.queue || (hooks = jQuery._queueHooks(elem, "fx"), null == hooks.unqueued && (hooks.unqueued = 0, oldfire = hooks.empty.fire, hooks.empty.fire = function() { | |
hooks.unqueued || oldfire() | |
}), hooks.unqueued++, anim.always(function() { | |
anim.always(function() { | |
hooks.unqueued--, jQuery.queue(elem, "fx").length || hooks.empty.fire() | |
}) | |
})), 1 === elem.nodeType && ("height" in props || "width" in props) && (opts.overflow = [style.overflow, style.overflowX, style.overflowY], display = jQuery.css(elem, "display"), "inline" === ("none" === display ? jQuery._data(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display) && "none" === jQuery.css(elem, "float") && (support.inlineBlockNeedsLayout && "inline" !== defaultDisplay(elem.nodeName) ? style.zoom = 1 : style.display = "inline-block")), opts.overflow && (style.overflow = "hidden", support.shrinkWrapBlocks() || anim.always(function() { | |
style.overflow = opts.overflow[0], style.overflowX = opts.overflow[1], style.overflowY = opts.overflow[2] | |
})); | |
for (prop in props) | |
if (value = props[prop], rfxtypes.exec(value)) { | |
if (delete props[prop], toggle = toggle || "toggle" === value, value === (hidden ? "hide" : "show")) { | |
if ("show" !== value || !dataShow || void 0 === dataShow[prop]) continue; | |
hidden = !0 | |
} | |
orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop) | |
} else display = void 0; | |
if (jQuery.isEmptyObject(orig)) "inline" === ("none" === display ? defaultDisplay(elem.nodeName) : display) && (style.display = display); | |
else { | |
dataShow ? "hidden" in dataShow && (hidden = dataShow.hidden) : dataShow = jQuery._data(elem, "fxshow", {}), toggle && (dataShow.hidden = !hidden), hidden ? jQuery(elem).show() : anim.done(function() { | |
jQuery(elem).hide() | |
}), anim.done(function() { | |
var prop; | |
jQuery._removeData(elem, "fxshow"); | |
for (prop in orig) jQuery.style(elem, prop, orig[prop]) | |
}); | |
for (prop in orig) tween = createTween(hidden ? dataShow[prop] : 0, prop, anim), prop in dataShow || (dataShow[prop] = tween.start, hidden && (tween.end = tween.start, tween.start = "width" === prop || "height" === prop ? 1 : 0)) | |
} | |
} | |
function propFilter(props, specialEasing) { | |
var index, name, easing, value, hooks; | |
for (index in props) | |
if (name = jQuery.camelCase(index), easing = specialEasing[name], value = props[index], jQuery.isArray(value) && (easing = value[1], value = props[index] = value[0]), index !== name && (props[name] = value, delete props[index]), (hooks = jQuery.cssHooks[name]) && "expand" in hooks) { | |
value = hooks.expand(value), delete props[name]; | |
for (index in value) index in props || (props[index] = value[index], specialEasing[index] = easing) | |
} else specialEasing[name] = easing | |
} | |
function Animation(elem, properties, options) { | |
var result, stopped, index = 0, | |
length = animationPrefilters.length, | |
deferred = jQuery.Deferred().always(function() { | |
delete tick.elem | |
}), | |
tick = function() { | |
if (stopped) return !1; | |
for (var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; index < length; index++) animation.tweens[index].run(percent); | |
return deferred.notifyWith(elem, [animation, percent, remaining]), percent < 1 && length ? remaining : (deferred.resolveWith(elem, [animation]), !1) | |
}, | |
animation = deferred.promise({ | |
elem: elem, | |
props: jQuery.extend({}, properties), | |
opts: jQuery.extend(!0, { | |
specialEasing: {} | |
}, options), | |
originalProperties: properties, | |
originalOptions: options, | |
startTime: fxNow || createFxNow(), | |
duration: options.duration, | |
tweens: [], | |
createTween: function(prop, end) { | |
var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); | |
return animation.tweens.push(tween), tween | |
}, | |
stop: function(gotoEnd) { | |
var index = 0, | |
length = gotoEnd ? animation.tweens.length : 0; | |
if (stopped) return this; | |
for (stopped = !0; index < length; index++) animation.tweens[index].run(1); | |
return gotoEnd ? deferred.resolveWith(elem, [animation, gotoEnd]) : deferred.rejectWith(elem, [animation, gotoEnd]), this | |
} | |
}), | |
props = animation.props; | |
for (propFilter(props, animation.opts.specialEasing); index < length; index++) | |
if (result = animationPrefilters[index].call(animation, elem, props, animation.opts)) return result; | |
return jQuery.map(props, createTween, animation), jQuery.isFunction(animation.opts.start) && animation.opts.start.call(elem, animation), jQuery.fx.timer(jQuery.extend(tick, { | |
elem: elem, | |
anim: animation, | |
queue: animation.opts.queue | |
})), animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always) | |
} | |
function addToPrefiltersOrTransports(structure) { | |
return function(dataTypeExpression, func) { | |
"string" != typeof dataTypeExpression && (func = dataTypeExpression, dataTypeExpression = "*"); | |
var dataType, i = 0, | |
dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || []; | |
if (jQuery.isFunction(func)) | |
for (; dataType = dataTypes[i++];) "+" === dataType.charAt(0) ? (dataType = dataType.slice(1) || "*", (structure[dataType] = structure[dataType] || []).unshift(func)) : (structure[dataType] = structure[dataType] || []).push(func) | |
} | |
} | |
function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { | |
function inspect(dataType) { | |
var selected; | |
return inspected[dataType] = !0, jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) { | |
var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); | |
return "string" != typeof dataTypeOrTransport || seekingTransport || inspected[dataTypeOrTransport] ? seekingTransport ? !(selected = dataTypeOrTransport) : void 0 : (options.dataTypes.unshift(dataTypeOrTransport), inspect(dataTypeOrTransport), !1) | |
}), selected | |
} | |
var inspected = {}, | |
seekingTransport = structure === transports; | |
return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*") | |
} | |
function ajaxExtend(target, src) { | |
var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; | |
for (key in src) void 0 !== src[key] && ((flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]); | |
return deep && jQuery.extend(!0, target, deep), target | |
} | |
function ajaxHandleResponses(s, jqXHR, responses) { | |
for (var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; | |
"*" === dataTypes[0];) dataTypes.shift(), void 0 === ct && (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 | |
} | |
firstDataType || (firstDataType = type) | |
} | |
finalDataType = finalDataType || firstDataType | |
} | |
if (finalDataType) return finalDataType !== dataTypes[0] && dataTypes.unshift(finalDataType), responses[finalDataType] | |
} | |
function ajaxConvert(s, response, jqXHR, isSuccess) { | |
var conv2, current, conv, tmp, prev, converters = {}, | |
dataTypes = s.dataTypes.slice(); | |
if (dataTypes[1]) | |
for (conv in s.converters) converters[conv.toLowerCase()] = s.converters[conv]; | |
for (current = dataTypes.shift(); current;) | |
if (s.responseFields[current] && (jqXHR[s.responseFields[current]] = response), !prev && isSuccess && s.dataFilter && (response = s.dataFilter(response, s.dataType)), prev = current, current = dataTypes.shift()) | |
if ("*" === current) current = prev; | |
else if ("*" !== prev && prev !== current) { | |
if (!(conv = converters[prev + " " + current] || converters["* " + current])) | |
for (conv2 in converters) | |
if (tmp = conv2.split(" "), tmp[1] === current && (conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]])) { | |
!0 === conv ? conv = converters[conv2] : !0 !== converters[conv2] && (current = tmp[0], dataTypes.unshift(tmp[1])); | |
break | |
} | |
if (!0 !== conv) | |
if (conv && s.throws) response = conv(response); | |
else try { | |
response = conv(response) | |
} catch (e) { | |
return { | |
state: "parsererror", | |
error: conv ? e : "No conversion from " + prev + " to " + current | |
} | |
} | |
} | |
return { | |
state: "success", | |
data: response | |
} | |
} | |
function buildParams(prefix, obj, traditional, add) { | |
var name; | |
if (jQuery.isArray(obj)) jQuery.each(obj, function(i, v) { | |
traditional || rbracket.test(prefix) ? add(prefix, v) : buildParams(prefix + "[" + ("object" == typeof v ? i : "") + "]", v, traditional, add) | |
}); | |
else if (traditional || "object" !== jQuery.type(obj)) add(prefix, obj); | |
else | |
for (name in obj) buildParams(prefix + "[" + name + "]", obj[name], traditional, add) | |
} | |
function createStandardXHR() { | |
try { | |
return new window.XMLHttpRequest | |
} catch (e) {} | |
} | |
function createActiveXHR() { | |
try { | |
return new window.ActiveXObject("Microsoft.XMLHTTP") | |
} catch (e) {} | |
} | |
function getWindow(elem) { | |
return jQuery.isWindow(elem) ? elem : 9 === elem.nodeType && (elem.defaultView || elem.parentWindow) | |
} | |
var deletedIds = [], | |
slice = deletedIds.slice, | |
concat = deletedIds.concat, | |
push = deletedIds.push, | |
indexOf = deletedIds.indexOf, | |
class2type = {}, | |
toString = class2type.toString, | |
hasOwn = class2type.hasOwnProperty, | |
support = {}, | |
version = "1.11.1", | |
jQuery = function(selector, context) { | |
return new jQuery.fn.init(selector, context) | |
}, | |
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, | |
rmsPrefix = /^-ms-/, | |
rdashAlpha = /-([\da-z])/gi, | |
fcamelCase = function(all, letter) { | |
return letter.toUpperCase() | |
}; | |
jQuery.fn = jQuery.prototype = { | |
jquery: version, | |
constructor: jQuery, | |
selector: "", | |
length: 0, | |
toArray: function() { | |
return slice.call(this) | |
}, | |
get: function(num) { | |
return null != num ? num < 0 ? this[num + this.length] : this[num] : slice.call(this) | |
}, | |
pushStack: function(elems) { | |
var ret = jQuery.merge(this.constructor(), elems); | |
return ret.prevObject = this, ret.context = this.context, ret | |
}, | |
each: function(callback, args) { | |
return jQuery.each(this, callback, args) | |
}, | |
map: function(callback) { | |
return this.pushStack(jQuery.map(this, function(elem, i) { | |
return callback.call(elem, i, elem) | |
})) | |
}, | |
slice: function() { | |
return this.pushStack(slice.apply(this, arguments)) | |
}, | |
first: function() { | |
return this.eq(0) | |
}, | |
last: function() { | |
return this.eq(-1) | |
}, | |
eq: function(i) { | |
var len = this.length, | |
j = +i + (i < 0 ? len : 0); | |
return this.pushStack(j >= 0 && j < len ? [this[j]] : []) | |
}, | |
end: function() { | |
return this.prevObject || this.constructor(null) | |
}, | |
push: push, | |
sort: deletedIds.sort, | |
splice: deletedIds.splice | |
}, jQuery.extend = jQuery.fn.extend = function() { | |
var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, | |
i = 1, | |
length = arguments.length, | |
deep = !1; | |
for ("boolean" == typeof target && (deep = target, target = arguments[i] || {}, i++), "object" == typeof target || jQuery.isFunction(target) || (target = {}), i === length && (target = this, i--); i < length; i++) | |
if (null != (options = arguments[i])) | |
for (name in options) src = target[name], copy = options[name], target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, clone = src && jQuery.isArray(src) ? src : []) : clone = src && jQuery.isPlainObject(src) ? src : {}, target[name] = jQuery.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy)); | |
return target | |
}, jQuery.extend({ | |
expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""), | |
isReady: !0, | |
error: function(msg) { | |
throw new Error(msg) | |
}, | |
noop: function() {}, | |
isFunction: function(obj) { | |
return "function" === jQuery.type(obj) | |
}, | |
isArray: Array.isArray || function(obj) { | |
return "array" === jQuery.type(obj) | |
}, | |
isWindow: function(obj) { | |
return null != obj && obj == obj.window | |
}, | |
isNumeric: function(obj) { | |
return !jQuery.isArray(obj) && obj - parseFloat(obj) >= 0 | |
}, | |
isEmptyObject: function(obj) { | |
var name; | |
for (name in obj) return !1; | |
return !0 | |
}, | |
isPlainObject: function(obj) { | |
var key; | |
if (!obj || "object" !== jQuery.type(obj) || obj.nodeType || jQuery.isWindow(obj)) return !1; | |
try { | |
if (obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) return !1 | |
} catch (e) { | |
return !1 | |
} | |
if (support.ownLast) | |
for (key in obj) return hasOwn.call(obj, key); | |
for (key in obj); | |
return void 0 === key || hasOwn.call(obj, key) | |
}, | |
type: function(obj) { | |
return null == obj ? obj + "" : "object" == typeof obj || "function" == typeof obj ? class2type[toString.call(obj)] || "object" : typeof obj | |
}, | |
globalEval: function(data) { | |
data && jQuery.trim(data) && (window.execScript || function(data) { | |
window.eval.call(window, data) | |
})(data) | |
}, | |
camelCase: function(string) { | |
return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase) | |
}, | |
nodeName: function(elem, name) { | |
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase() | |
}, | |
each: function(obj, callback, args) { | |
var i = 0, | |
length = obj.length, | |
isArray = isArraylike(obj); | |
if (args) { | |
if (isArray) | |
for (; i < length && !1 !== callback.apply(obj[i], args); i++); | |
else | |
for (i in obj) | |
if (!1 === callback.apply(obj[i], args)) break | |
} else if (isArray) | |
for (; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++); | |
else | |
for (i in obj) | |
if (!1 === callback.call(obj[i], i, obj[i])) break; return obj | |
}, | |
trim: function(text) { | |
return null == text ? "" : (text + "").replace(rtrim, "") | |
}, | |
makeArray: function(arr, results) { | |
var ret = results || []; | |
return null != arr && (isArraylike(Object(arr)) ? jQuery.merge(ret, "string" == typeof arr ? [arr] : arr) : push.call(ret, arr)), ret | |
}, | |
inArray: function(elem, arr, i) { | |
var len; | |
if (arr) { | |
if (indexOf) return indexOf.call(arr, elem, i); | |
for (len = arr.length, i = i ? i < 0 ? Math.max(0, len + i) : i : 0; i < len; i++) | |
if (i in arr && arr[i] === elem) return i | |
} | |
return -1 | |
}, | |
merge: function(first, second) { | |
for (var len = +second.length, j = 0, i = first.length; j < len;) first[i++] = second[j++]; | |
if (len !== len) | |
for (; void 0 !== second[j];) first[i++] = second[j++]; | |
return first.length = i, first | |
}, | |
grep: function(elems, callback, invert) { | |
for (var matches = [], i = 0, length = elems.length, callbackExpect = !invert; i < length; i++) !callback(elems[i], i) !== callbackExpect && matches.push(elems[i]); | |
return matches | |
}, | |
map: function(elems, callback, arg) { | |
var value, i = 0, | |
length = elems.length, | |
isArray = isArraylike(elems), | |
ret = []; | |
if (isArray) | |
for (; i < length; i++) null != (value = callback(elems[i], i, arg)) && ret.push(value); | |
else | |
for (i in elems) null != (value = callback(elems[i], i, arg)) && ret.push(value); | |
return concat.apply([], ret) | |
}, | |
guid: 1, | |
proxy: function(fn, context) { | |
var args, proxy, tmp; | |
if ("string" == typeof context && (tmp = fn[context], context = fn, fn = tmp), jQuery.isFunction(fn)) return args = slice.call(arguments, 2), proxy = function() { | |
return fn.apply(context || this, args.concat(slice.call(arguments))) | |
}, proxy.guid = fn.guid = fn.guid || jQuery.guid++, proxy | |
}, | |
now: function() { | |
return +new Date | |
}, | |
support: support | |
}), jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { | |
class2type["[object " + name + "]"] = name.toLowerCase() | |
}); | |
var Sizzle = function(window) { | |
function Sizzle(selector, context, results, seed) { | |
var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector; | |
if ((context ? context.ownerDocument || context : preferredDoc) !== document && setDocument(context), context = context || document, results = results || [], !selector || "string" != typeof selector) return results; | |
if (1 !== (nodeType = context.nodeType) && 9 !== nodeType) return []; | |
if (documentIsHTML && !seed) { | |
if (match = rquickExpr.exec(selector)) | |
if (m = match[1]) { | |
if (9 === nodeType) { | |
if (!(elem = context.getElementById(m)) || !elem.parentNode) return results; | |
if (elem.id === m) return results.push(elem), results | |
} else if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) return results.push(elem), results | |
} else { | |
if (match[2]) return push.apply(results, context.getElementsByTagName(selector)), results; | |
if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) return push.apply(results, context.getElementsByClassName(m)), results | |
} | |
if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) { | |
if (nid = old = expando, newContext = context, newSelector = 9 === nodeType && selector, 1 === nodeType && "object" !== context.nodeName.toLowerCase()) { | |
for (groups = tokenize(selector), (old = context.getAttribute("id")) ? nid = old.replace(rescape, "\\$&") : context.setAttribute("id", nid), nid = "[id='" + nid + "'] ", i = groups.length; i--;) groups[i] = nid + toSelector(groups[i]); | |
newContext = rsibling.test(selector) && testContext(context.parentNode) || context, newSelector = groups.join(",") | |
} | |
if (newSelector) try { | |
return push.apply(results, newContext.querySelectorAll(newSelector)), results | |
} catch (qsaError) {} finally { | |
old || context.removeAttribute("id") | |
} | |
} | |
} | |
return select(selector.replace(rtrim, "$1"), context, results, seed) | |
} | |
function createCache() { | |
function cache(key, value) { | |
return keys.push(key + " ") > Expr.cacheLength && delete cache[keys.shift()], cache[key + " "] = value | |
} | |
var keys = []; | |
return cache | |
} | |
function markFunction(fn) { | |
return fn[expando] = !0, fn | |
} | |
function assert(fn) { | |
var div = document.createElement("div"); | |
try { | |
return !!fn(div) | |
} catch (e) { | |
return !1 | |
} finally { | |
div.parentNode && div.parentNode.removeChild(div), div = null | |
} | |
} | |
function addHandle(attrs, handler) { | |
for (var arr = attrs.split("|"), i = attrs.length; i--;) Expr.attrHandle[arr[i]] = handler | |
} | |
function siblingCheck(a, b) { | |
var cur = b && a, | |
diff = cur && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE); | |
if (diff) return diff; | |
if (cur) | |
for (; cur = cur.nextSibling;) | |
if (cur === b) return -1; | |
return a ? 1 : -1 | |
} | |
function createInputPseudo(type) { | |
return function(elem) { | |
return "input" === elem.nodeName.toLowerCase() && elem.type === type | |
} | |
} | |
function createButtonPseudo(type) { | |
return function(elem) { | |
var name = elem.nodeName.toLowerCase(); | |
return ("input" === name || "button" === name) && elem.type === type | |
} | |
} | |
function createPositionalPseudo(fn) { | |
return markFunction(function(argument) { | |
return argument = +argument, markFunction(function(seed, matches) { | |
for (var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; i--;) seed[j = matchIndexes[i]] && (seed[j] = !(matches[j] = seed[j])) | |
}) | |
}) | |
} | |
function testContext(context) { | |
return context && typeof context.getElementsByTagName !== strundefined && context | |
} | |
function setFilters() {} | |
function toSelector(tokens) { | |
for (var i = 0, len = tokens.length, selector = ""; i < len; i++) selector += tokens[i].value; | |
return selector | |
} | |
function addCombinator(matcher, combinator, base) { | |
var dir = combinator.dir, | |
checkNonElements = base && "parentNode" === dir, | |
doneName = done++; | |
return combinator.first ? function(elem, context, xml) { | |
for (; elem = elem[dir];) | |
if (1 === elem.nodeType || checkNonElements) return matcher(elem, context, xml) | |
} : function(elem, context, xml) { | |
var oldCache, outerCache, newCache = [dirruns, doneName]; | |
if (xml) { | |
for (; elem = elem[dir];) | |
if ((1 === elem.nodeType || checkNonElements) && matcher(elem, context, xml)) return !0 | |
} else | |
for (; elem = elem[dir];) | |
if (1 === elem.nodeType || checkNonElements) { | |
if (outerCache = elem[expando] || (elem[expando] = {}), (oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) return newCache[2] = oldCache[2]; | |
if (outerCache[dir] = newCache, newCache[2] = matcher(elem, context, xml)) return !0 | |
} | |
} | |
} | |
function elementMatcher(matchers) { | |
return matchers.length > 1 ? function(elem, context, xml) { | |
for (var i = matchers.length; i--;) | |
if (!matchers[i](elem, context, xml)) return !1; | |
return !0 | |
} : matchers[0] | |
} | |
function multipleContexts(selector, contexts, results) { | |
for (var i = 0, len = contexts.length; i < len; i++) Sizzle(selector, contexts[i], results); | |
return results | |
} | |
function condense(unmatched, map, filter, context, xml) { | |
for (var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = null != map; i < len; i++)(elem = unmatched[i]) && (filter && !filter(elem, context, xml) || (newUnmatched.push(elem), mapped && map.push(i))); | |
return newUnmatched | |
} | |
function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { | |
return postFilter && !postFilter[expando] && (postFilter = setMatcher(postFilter)), postFinder && !postFinder[expando] && (postFinder = setMatcher(postFinder, postSelector)), markFunction(function(seed, results, context, xml) { | |
var temp, i, elem, preMap = [], | |
postMap = [], | |
preexisting = results.length, | |
elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), | |
matcherIn = !preFilter || !seed && selector ? elems : condense(elems, preMap, preFilter, context, xml), | |
matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn; | |
if (matcher && matcher(matcherIn, matcherOut, context, xml), postFilter) | |
for (temp = condense(matcherOut, postMap), postFilter(temp, [], context, xml), i = temp.length; i--;)(elem = temp[i]) && (matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem)); | |
if (seed) { | |
if (postFinder || preFilter) { | |
if (postFinder) { | |
for (temp = [], i = matcherOut.length; i--;)(elem = matcherOut[i]) && temp.push(matcherIn[i] = elem); | |
postFinder(null, matcherOut = [], temp, xml) | |
} | |
for (i = matcherOut.length; i--;)(elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1 && (seed[temp] = !(results[temp] = elem)) | |
} | |
} else matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut), postFinder ? postFinder(null, results, matcherOut, xml) : push.apply(results, matcherOut) | |
}) | |
} | |
function matcherFromTokens(tokens) { | |
for (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, !0), matchAnyContext = addCombinator(function(elem) { | |
return indexOf.call(checkContext, elem) > -1 | |
}, implicitRelative, !0), matchers = [function(elem, context, xml) { | |
return !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)) | |
}]; i < len; i++) | |
if (matcher = Expr.relative[tokens[i].type]) matchers = [addCombinator(elementMatcher(matchers), matcher)]; | |
else { | |
if (matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches), matcher[expando]) { | |
for (j = ++i; j < len && !Expr.relative[tokens[j].type]; j++); | |
return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ | |
value: " " === tokens[i - 2].type ? "*" : "" | |
})).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens)) | |
} | |
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, outermost) { | |
var elem, j, matcher, matchedCount = 0, | |
i = "0", | |
unmatched = seed && [], | |
setMatched = [], | |
contextBackup = outermostContext, | |
elems = seed || byElement && Expr.find.TAG("*", outermost), | |
dirrunsUnique = dirruns += null == contextBackup ? 1 : Math.random() || .1, | |
len = elems.length; | |
for (outermost && (outermostContext = context !== document && context); i !== len && null != (elem = elems[i]); i++) { | |
if (byElement && elem) { | |
for (j = 0; matcher = elementMatchers[j++];) | |
if (matcher(elem, context, xml)) { | |
results.push(elem); | |
break | |
} | |
outermost && (dirruns = dirrunsUnique) | |
} | |
bySet && ((elem = !matcher && elem) && matchedCount--, seed && unmatched.push(elem)) | |
} | |
if (matchedCount += i, bySet && i !== matchedCount) { | |
for (j = 0; matcher = setMatchers[j++];) matcher(unmatched, setMatched, context, xml); | |
if (seed) { | |
if (matchedCount > 0) | |
for (; i--;) unmatched[i] || setMatched[i] || (setMatched[i] = pop.call(results)); | |
setMatched = condense(setMatched) | |
} | |
push.apply(results, setMatched), outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1 && Sizzle.uniqueSort(results) | |
} | |
return outermost && (dirruns = dirrunsUnique, outermostContext = contextBackup), unmatched | |
}; | |
return bySet ? markFunction(superMatcher) : superMatcher | |
} | |
var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + -new Date, | |
preferredDoc = window.document, | |
dirruns = 0, | |
done = 0, | |
classCache = createCache(), | |
tokenCache = createCache(), | |
compilerCache = createCache(), | |
sortOrder = function(a, b) { | |
return a === b && (hasDuplicate = !0), 0 | |
}, | |
strundefined = "undefined", | |
MAX_NEGATIVE = 1 << 31, | |
hasOwn = {}.hasOwnProperty, | |
arr = [], | |
pop = arr.pop, | |
push_native = arr.push, | |
push = arr.push, | |
slice = arr.slice, | |
indexOf = arr.indexOf || function(elem) { | |
for (var i = 0, len = this.length; i < len; i++) | |
if (this[i] === elem) return i; | |
return -1 | |
}, | |
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", | |
whitespace = "[\\x20\\t\\r\\n\\f]", | |
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", | |
identifier = characterEncoding.replace("w", "w#"), | |
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", | |
pseudos = ":(" + characterEncoding + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|.*)\\)|)", | |
rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), | |
rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), | |
rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), | |
rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"), | |
rpseudo = new RegExp(pseudos), | |
ridentifier = new RegExp("^" + identifier + "$"), | |
matchExpr = { | |
ID: new RegExp("^#(" + characterEncoding + ")"), | |
CLASS: new RegExp("^\\.(" + characterEncoding + ")"), | |
TAG: new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"), | |
ATTR: new RegExp("^" + attributes), | |
PSEUDO: new RegExp("^" + pseudos), | |
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), | |
bool: new RegExp("^(?:" + booleans + ")$", "i"), | |
needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") | |
}, | |
rinputs = /^(?:input|select|textarea|button)$/i, | |
rheader = /^h\d$/i, | |
rnative = /^[^{]+\{\s*\[native \w/, | |
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, | |
rsibling = /[+~]/, | |
rescape = /'|\\/g, | |
runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"), | |
funescape = function(_, escaped, escapedWhitespace) { | |
var high = "0x" + escaped - 65536; | |
return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, 1023 & high | 56320) | |
}; | |
try { | |
push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes), arr[preferredDoc.childNodes.length].nodeType | |
} catch (e) { | |
push = { | |
apply: arr.length ? function(target, els) { | |
push_native.apply(target, slice.call(els)) | |
} : function(target, els) { | |
for (var j = target.length, i = 0; target[j++] = els[i++];); | |
target.length = j - 1 | |
} | |
} | |
} | |
support = Sizzle.support = {}, isXML = Sizzle.isXML = function(elem) { | |
var documentElement = elem && (elem.ownerDocument || elem).documentElement; | |
return !!documentElement && "HTML" !== documentElement.nodeName | |
}, setDocument = Sizzle.setDocument = function(node) { | |
var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, | |
parent = doc.defaultView; | |
return doc !== document && 9 === doc.nodeType && doc.documentElement ? (document = doc, docElem = doc.documentElement, documentIsHTML = !isXML(doc), parent && parent !== parent.top && (parent.addEventListener ? parent.addEventListener("unload", function() { | |
setDocument() | |
}, !1) : parent.attachEvent && parent.attachEvent("onunload", function() { | |
setDocument() | |
})), support.attributes = assert(function(div) { | |
return div.className = "i", !div.getAttribute("className") | |
}), support.getElementsByTagName = assert(function(div) { | |
return div.appendChild(doc.createComment("")), !div.getElementsByTagName("*").length | |
}), support.getElementsByClassName = rnative.test(doc.getElementsByClassName) && assert(function(div) { | |
return div.innerHTML = "<div class='a'></div><div class='a i'></div>", div.firstChild.className = "i", 2 === div.getElementsByClassName("i").length | |
}), support.getById = assert(function(div) { | |
return docElem.appendChild(div).id = expando, !doc.getElementsByName || !doc.getElementsByName(expando).length | |
}), support.getById ? (Expr.find.ID = function(id, context) { | |
if (typeof context.getElementById !== strundefined && documentIsHTML) { | |
var m = context.getElementById(id); | |
return m && m.parentNode ? [m] : [] | |
} | |
}, Expr.filter.ID = function(id) { | |
var attrId = id.replace(runescape, funescape); | |
return function(elem) { | |
return elem.getAttribute("id") === attrId | |
} | |
}) : (delete Expr.find.ID, Expr.filter.ID = function(id) { | |
var attrId = id.replace(runescape, funescape); | |
return function(elem) { | |
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); | |
return node && node.value === attrId | |
} | |
}), Expr.find.TAG = support.getElementsByTagName ? function(tag, context) { | |
if (typeof context.getElementsByTagName !== strundefined) return context.getElementsByTagName(tag) | |
} : function(tag, context) { | |
var elem, tmp = [], | |
i = 0, | |
results = context.getElementsByTagName(tag); | |
if ("*" === tag) { | |
for (; elem = results[i++];) 1 === elem.nodeType && tmp.push(elem); | |
return tmp | |
} | |
return results | |
}, Expr.find.CLASS = support.getElementsByClassName && function(className, context) { | |
if (typeof context.getElementsByClassName !== strundefined && documentIsHTML) return context.getElementsByClassName(className) | |
}, rbuggyMatches = [], rbuggyQSA = [], (support.qsa = rnative.test(doc.querySelectorAll)) && (assert(function(div) { | |
div.innerHTML = "<select msallowclip=''><option selected=''></option></select>", div.querySelectorAll("[msallowclip^='']").length && rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")"), div.querySelectorAll("[selected]").length || rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")"), div.querySelectorAll(":checked").length || rbuggyQSA.push(":checked") | |
}), assert(function(div) { | |
var input = doc.createElement("input"); | |
input.setAttribute("type", "hidden"), div.appendChild(input).setAttribute("name", "D"), div.querySelectorAll("[name=d]").length && rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?="), div.querySelectorAll(":enabled").length || rbuggyQSA.push(":enabled", ":disabled"), div.querySelectorAll("*,:x"), rbuggyQSA.push(",.*:") | |
})), (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) && assert(function(div) { | |
support.disconnectedMatch = matches.call(div, "div"), matches.call(div, "[s!='']:x"), rbuggyMatches.push("!=", pseudos) | |
}), rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")), rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")), hasCompare = rnative.test(docElem.compareDocumentPosition), contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) { | |
var adown = 9 === a.nodeType ? a.documentElement : a, | |
bup = b && b.parentNode; | |
return a === bup || !(!bup || 1 !== bup.nodeType || !(adown.contains ? adown.contains(bup) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(bup))) | |
} : function(a, b) { | |
if (b) | |
for (; b = b.parentNode;) | |
if (b === a) return !0; | |
return !1 | |
}, sortOrder = hasCompare ? function(a, b) { | |
if (a === b) return hasDuplicate = !0, 0; | |
var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; | |
return compare || (compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & compare || !support.sortDetached && b.compareDocumentPosition(a) === compare ? a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ? -1 : b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ? 1 : sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0 : 4 & compare ? -1 : 1) | |
} : function(a, b) { | |
if (a === b) return hasDuplicate = !0, 0; | |
var cur, i = 0, | |
aup = a.parentNode, | |
bup = b.parentNode, | |
ap = [a], | |
bp = [b]; | |
if (!aup || !bup) return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0; | |
if (aup === bup) return siblingCheck(a, b); | |
for (cur = a; cur = cur.parentNode;) ap.unshift(cur); | |
for (cur = b; cur = cur.parentNode;) bp.unshift(cur); | |
for (; ap[i] === bp[i];) i++; | |
return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0 | |
}, doc) : document | |
}, Sizzle.matches = function(expr, elements) { | |
return Sizzle(expr, null, null, elements) | |
}, Sizzle.matchesSelector = function(elem, expr) { | |
if ((elem.ownerDocument || elem) !== document && setDocument(elem), expr = expr.replace(rattributeQuotes, "='$1']"), support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) try { | |
var ret = matches.call(elem, expr); | |
if (ret || support.disconnectedMatch || elem.document && 11 !== elem.document.nodeType) return ret | |
} catch (e) {} | |
return Sizzle(expr, document, null, [elem]).length > 0 | |
}, Sizzle.contains = function(context, elem) { | |
return (context.ownerDocument || context) !== document && setDocument(context), contains(context, elem) | |
}, Sizzle.attr = function(elem, name) { | |
(elem.ownerDocument || elem) !== document && setDocument(elem); | |
var fn = Expr.attrHandle[name.toLowerCase()], | |
val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0; | |
return void 0 !== val ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null | |
}, Sizzle.error = function(msg) { | |
throw new Error("Syntax error, unrecognized expression: " + msg) | |
}, Sizzle.uniqueSort = function(results) { | |
var elem, duplicates = [], | |
j = 0, | |
i = 0; | |
if (hasDuplicate = !support.detectDuplicates, sortInput = !support.sortStable && results.slice(0), results.sort(sortOrder), hasDuplicate) { | |
for (; elem = results[i++];) elem === results[i] && (j = duplicates.push(i)); | |
for (; j--;) results.splice(duplicates[j], 1) | |
} | |
return sortInput = null, results | |
}, getText = Sizzle.getText = function(elem) { | |
var node, ret = "", | |
i = 0, | |
nodeType = elem.nodeType; | |
if (nodeType) { | |
if (1 === nodeType || 9 === nodeType || 11 === nodeType) { | |
if ("string" == typeof elem.textContent) return elem.textContent; | |
for (elem = elem.firstChild; elem; elem = elem.nextSibling) ret += getText(elem) | |
} else if (3 === nodeType || 4 === nodeType) return elem.nodeValue | |
} else | |
for (; node = elem[i++];) ret += getText(node); | |
return ret | |
}, Expr = Sizzle.selectors = { | |
cacheLength: 50, | |
createPseudo: markFunction, | |
match: matchExpr, | |
attrHandle: {}, | |
find: {}, | |
relative: { | |
">": { | |
dir: "parentNode", | |
first: !0 | |
}, | |
" ": { | |
dir: "parentNode" | |
}, | |
"+": { | |
dir: "previousSibling", | |
first: !0 | |
}, | |
"~": { | |
dir: "previousSibling" | |
} | |
}, | |
preFilter: { | |
ATTR: function(match) { | |
return match[1] = match[1].replace(runescape, funescape), match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape), "~=" === match[2] && (match[3] = " " + match[3] + " "), match.slice(0, 4) | |
}, | |
CHILD: function(match) { | |
return match[1] = match[1].toLowerCase(), "nth" === match[1].slice(0, 3) ? (match[3] || Sizzle.error(match[0]), match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * ("even" === match[3] || "odd" === match[3])), match[5] = +(match[7] + match[8] || "odd" === match[3])) : match[3] && Sizzle.error(match[0]), match | |
}, | |
PSEUDO: function(match) { | |
var excess, unquoted = !match[6] && match[2]; | |
return matchExpr.CHILD.test(match[0]) ? null : (match[3] ? match[2] = match[4] || match[5] || "" : unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, !0)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length) && (match[0] = match[0].slice(0, excess), match[2] = unquoted.slice(0, excess)), match.slice(0, 3)) | |
} | |
}, | |
filter: { | |
TAG: function(nodeNameSelector) { | |
var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); | |
return "*" === nodeNameSelector ? function() { | |
return !0 | |
} : function(elem) { | |
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName | |
} | |
}, | |
CLASS: function(className) { | |
var pattern = classCache[className + " "]; | |
return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) { | |
return pattern.test("string" == typeof elem.className && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "") | |
}) | |
}, | |
ATTR: function(name, operator, check) { | |
return function(elem) { | |
var result = Sizzle.attr(elem, name); | |
return null == result ? "!=" === operator : !operator || (result += "", "=" === operator ? result === check : "!=" === operator ? result !== check : "^=" === operator ? check && 0 === result.indexOf(check) : "*=" === operator ? check && result.indexOf(check) > -1 : "$=" === operator ? check && result.slice(-check.length) === check : "~=" === operator ? (" " + result + " ").indexOf(check) > -1 : "|=" === operator && (result === check || result.slice(0, check.length + 1) === check + "-")) | |
} | |
}, | |
CHILD: function(type, what, argument, first, last) { | |
var simple = "nth" !== type.slice(0, 3), | |
forward = "last" !== type.slice(-4), | |
ofType = "of-type" === what; | |
return 1 === first && 0 === last ? function(elem) { | |
return !!elem.parentNode | |
} : function(elem, context, xml) { | |
var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", | |
parent = elem.parentNode, | |
name = ofType && elem.nodeName.toLowerCase(), | |
useCache = !xml && !ofType; | |
if (parent) { | |
if (simple) { | |
for (; dir;) { | |
for (node = elem; node = node[dir];) | |
if (ofType ? node.nodeName.toLowerCase() === name : 1 === node.nodeType) return !1; | |
start = dir = "only" === type && !start && "nextSibling" | |
} | |
return !0 | |
} | |
if (start = [forward ? parent.firstChild : parent.lastChild], forward && useCache) { | |
for (outerCache = parent[expando] || (parent[expando] = {}), cache = outerCache[type] || [], nodeIndex = cache[0] === dirruns && cache[1], diff = cache[0] === dirruns && cache[2], node = nodeIndex && parent.childNodes[nodeIndex]; node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop();) | |
if (1 === node.nodeType && ++diff && node === elem) { | |
outerCache[type] = [dirruns, nodeIndex, diff]; | |
break | |
} | |
} else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) diff = cache[1]; | |
else | |
for (; | |
(node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) && ((ofType ? node.nodeName.toLowerCase() !== name : 1 !== node.nodeType) || !++diff || (useCache && ((node[expando] || (node[expando] = {}))[type] = [dirruns, diff]), node !== elem));); | |
return (diff -= last) === first || diff % first == 0 && diff / first >= 0 | |
} | |
} | |
}, | |
PSEUDO: function(pseudo, argument) { | |
var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); | |
return fn[expando] ? fn(argument) : fn.length > 1 ? (args = [pseudo, pseudo, "", argument], Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches) { | |
for (var idx, matched = fn(seed, argument), i = matched.length; i--;) idx = indexOf.call(seed, matched[i]), seed[idx] = !(matches[idx] = matched[i]) | |
}) : function(elem) { | |
return fn(elem, 0, args) | |
}) : fn | |
} | |
}, | |
pseudos: { | |
not: markFunction(function(selector) { | |
var input = [], | |
results = [], | |
matcher = compile(selector.replace(rtrim, "$1")); | |
return matcher[expando] ? markFunction(function(seed, matches, context, xml) { | |
for (var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; i--;)(elem = unmatched[i]) && (seed[i] = !(matches[i] = elem)) | |
}) : function(elem, context, xml) { | |
return input[0] = elem, matcher(input, null, xml, results), !results.pop() | |
} | |
}), | |
has: markFunction(function(selector) { | |
return function(elem) { | |
return Sizzle(selector, elem).length > 0 | |
} | |
}), | |
contains: markFunction(function(text) { | |
return function(elem) { | |
return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1 | |
} | |
}), | |
lang: markFunction(function(lang) { | |
return ridentifier.test(lang || "") || Sizzle.error("unsupported lang: " + lang), lang = lang.replace(runescape, funescape).toLowerCase(), | |
function(elem) { | |
var elemLang; | |
do { | |
if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) return (elemLang = elemLang.toLowerCase()) === lang || 0 === elemLang.indexOf(lang + "-") | |
} while ((elem = elem.parentNode) && 1 === elem.nodeType); | |
return !1 | |
} | |
}), | |
target: function(elem) { | |
var hash = window.location && window.location.hash; | |
return hash && hash.slice(1) === elem.id | |
}, | |
root: function(elem) { | |
return elem === docElem | |
}, | |
focus: function(elem) { | |
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex) | |
}, | |
enabled: function(elem) { | |
return !1 === elem.disabled | |
}, | |
disabled: function(elem) { | |
return !0 === elem.disabled | |
}, | |
checked: function(elem) { | |
var nodeName = elem.nodeName.toLowerCase(); | |
return "input" === nodeName && !!elem.checked || "option" === nodeName && !!elem.selected | |
}, | |
selected: function(elem) { | |
return elem.parentNode && elem.parentNode.selectedIndex, !0 === elem.selected | |
}, | |
empty: function(elem) { | |
for (elem = elem.firstChild; elem; elem = elem.nextSibling) | |
if (elem.nodeType < 6) return !1; | |
return !0 | |
}, | |
parent: function(elem) { | |
return !Expr.pseudos.empty(elem) | |
}, | |
header: function(elem) { | |
return rheader.test(elem.nodeName) | |
}, | |
input: function(elem) { | |
return rinputs.test(elem.nodeName) | |
}, | |
button: function(elem) { | |
var name = elem.nodeName.toLowerCase(); | |
return "input" === name && "button" === elem.type || "button" === name | |
}, | |
text: function(elem) { | |
var attr; | |
return "input" === elem.nodeName.toLowerCase() && "text" === elem.type && (null == (attr = elem.getAttribute("type")) || "text" === attr.toLowerCase()) | |
}, | |
first: createPositionalPseudo(function() { | |
return [0] | |
}), | |
last: createPositionalPseudo(function(matchIndexes, length) { | |
return [length - 1] | |
}), | |
eq: createPositionalPseudo(function(matchIndexes, length, argument) { | |
return [argument < 0 ? argument + length : argument] | |
}), | |
even: createPositionalPseudo(function(matchIndexes, length) { | |
for (var i = 0; i < length; i += 2) matchIndexes.push(i); | |
return matchIndexes | |
}), | |
odd: createPositionalPseudo(function(matchIndexes, length) { | |
for (var i = 1; i < length; i += 2) matchIndexes.push(i); | |
return matchIndexes | |
}), | |
lt: createPositionalPseudo(function(matchIndexes, length, argument) { | |
for (var i = argument < 0 ? argument + length : argument; --i >= 0;) matchIndexes.push(i); | |
return matchIndexes | |
}), | |
gt: createPositionalPseudo(function(matchIndexes, length, argument) { | |
for (var i = argument < 0 ? argument + length : argument; ++i < length;) matchIndexes.push(i); | |
return matchIndexes | |
}) | |
} | |
}, Expr.pseudos.nth = Expr.pseudos.eq; | |
for (i in { | |
radio: !0, | |
checkbox: !0, | |
file: !0, | |
password: !0, | |
image: !0 | |
}) Expr.pseudos[i] = createInputPseudo(i); | |
for (i in { | |
submit: !0, | |
reset: !0 | |
}) Expr.pseudos[i] = createButtonPseudo(i); | |
return setFilters.prototype = Expr.filters = Expr.pseudos, Expr.setFilters = new setFilters, tokenize = Sizzle.tokenize = function(selector, parseOnly) { | |
var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "]; | |
if (cached) return parseOnly ? 0 : cached.slice(0); | |
for (soFar = selector, groups = [], preFilters = Expr.preFilter; soFar;) { | |
matched && !(match = rcomma.exec(soFar)) || (match && (soFar = soFar.slice(match[0].length) || soFar), groups.push(tokens = [])), matched = !1, (match = rcombinators.exec(soFar)) && (matched = match.shift(), tokens.push({ | |
value: matched, | |
type: match[0].replace(rtrim, " ") | |
}), soFar = soFar.slice(matched.length)); | |
for (type in Expr.filter) !(match = matchExpr[type].exec(soFar)) || preFilters[type] && !(match = preFilters[type](match)) || (matched = match.shift(), tokens.push({ | |
value: matched, | |
type: type, | |
matches: match | |
}), soFar = soFar.slice(matched.length)); | |
if (!matched) break | |
} | |
return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0) | |
}, compile = Sizzle.compile = function(selector, match) { | |
var i, setMatchers = [], | |
elementMatchers = [], | |
cached = compilerCache[selector + " "]; | |
if (!cached) { | |
for (match || (match = tokenize(selector)), i = match.length; i--;) cached = matcherFromTokens(match[i]), cached[expando] ? setMatchers.push(cached) : elementMatchers.push(cached); | |
cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)), cached.selector = selector | |
} | |
return cached | |
}, select = Sizzle.select = function(selector, context, results, seed) { | |
var i, tokens, token, type, find, compiled = "function" == typeof selector && selector, | |
match = !seed && tokenize(selector = compiled.selector || selector); | |
if (results = results || [], 1 === match.length) { | |
if (tokens = match[0] = match[0].slice(0), tokens.length > 2 && "ID" === (token = tokens[0]).type && support.getById && 9 === context.nodeType && documentIsHTML && Expr.relative[tokens[1].type]) { | |
if (!(context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0])) return results; | |
compiled && (context = context.parentNode), selector = selector.slice(tokens.shift().value.length) | |
} | |
for (i = matchExpr.needsContext.test(selector) ? 0 : tokens.length; i-- && (token = tokens[i], !Expr.relative[type = token.type]);) | |
if ((find = Expr.find[type]) && (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context))) { | |
if (tokens.splice(i, 1), !(selector = seed.length && toSelector(tokens))) return push.apply(results, seed), results; | |
break | |
} | |
} | |
return (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context), results | |
}, support.sortStable = expando.split("").sort(sortOrder).join("") === expando, support.detectDuplicates = !!hasDuplicate, setDocument(), support.sortDetached = assert(function(div1) { | |
return 1 & div1.compareDocumentPosition(document.createElement("div")) | |
}), assert(function(div) { | |
return div.innerHTML = "<a href='#'></a>", "#" === div.firstChild.getAttribute("href") | |
}) || addHandle("type|href|height|width", function(elem, name, isXML) { | |
if (!isXML) return elem.getAttribute(name, "type" === name.toLowerCase() ? 1 : 2) | |
}), support.attributes && assert(function(div) { | |
return div.innerHTML = "<input/>", div.firstChild.setAttribute("value", ""), "" === div.firstChild.getAttribute("value") | |
}) || addHandle("value", function(elem, name, isXML) { | |
if (!isXML && "input" === elem.nodeName.toLowerCase()) return elem.defaultValue | |
}), assert(function(div) { | |
return null == div.getAttribute("disabled") | |
}) || addHandle(booleans, function(elem, name, isXML) { | |
var val; | |
if (!isXML) return !0 === elem[name] ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null | |
}), Sizzle | |
}(window); | |
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; | |
var rneedsContext = jQuery.expr.match.needsContext, | |
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, | |
risSimple = /^.[^:#\[\.,]*$/; | |
jQuery.filter = function(expr, elems, not) { | |
var elem = elems[0]; | |
return not && (expr = ":not(" + expr + ")"), 1 === elems.length && 1 === elem.nodeType ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(elem) { | |
return 1 === elem.nodeType | |
})) | |
}, jQuery.fn.extend({ | |
find: function(selector) { | |
var i, ret = [], | |
self = this, | |
len = self.length; | |
if ("string" != typeof selector) return this.pushStack(jQuery(selector).filter(function() { | |
for (i = 0; i < len; i++) | |
if (jQuery.contains(self[i], this)) return !0 | |
})); | |
for (i = 0; i < len; i++) jQuery.find(selector, self[i], ret); | |
return ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret), ret.selector = this.selector ? this.selector + " " + selector : selector, ret | |
}, | |
filter: function(selector) { | |
return this.pushStack(winnow(this, selector || [], !1)) | |
}, | |
not: function(selector) { | |
return this.pushStack(winnow(this, selector || [], !0)) | |
}, | |
is: function(selector) { | |
return !!winnow(this, "string" == typeof selector && rneedsContext.test(selector) ? jQuery(selector) : selector || [], !1).length | |
} | |
}); | |
var rootjQuery, document = window.document, | |
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; | |
(jQuery.fn.init = function(selector, context) { | |
var match, elem; | |
if (!selector) return this; | |
if ("string" == typeof selector) { | |
if (!(match = "<" === selector.charAt(0) && ">" === selector.charAt(selector.length - 1) && selector.length >= 3 ? [null, selector, null] : rquickExpr.exec(selector)) || !match[1] && context) return !context || context.jquery ? (context || rootjQuery).find(selector) : this.constructor(context).find(selector); | |
if (match[1]) { | |
if (context = context instanceof jQuery ? context[0] : context, jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, !0)), rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) | |
for (match in context) jQuery.isFunction(this[match]) ? this[match](context[match]) : this.attr(match, context[match]); | |
return this | |
} | |
if ((elem = document.getElementById(match[2])) && elem.parentNode) { | |
if (elem.id !== match[2]) return rootjQuery.find(selector); | |
this.length = 1, this[0] = elem | |
} | |
return this.context = document, this.selector = selector, this | |
} | |
return selector.nodeType ? (this.context = this[0] = selector, this.length = 1, this) : jQuery.isFunction(selector) ? void 0 !== rootjQuery.ready ? rootjQuery.ready(selector) : selector(jQuery) : (void 0 !== selector.selector && (this.selector = selector.selector, this.context = selector.context), jQuery.makeArray(selector, this)) | |
}).prototype = jQuery.fn, rootjQuery = jQuery(document); | |
var rparentsprev = /^(?:parents|prev(?:Until|All))/, | |
guaranteedUnique = { | |
children: !0, | |
contents: !0, | |
next: !0, | |
prev: !0 | |
}; | |
jQuery.extend({ | |
dir: function(elem, dir, until) { | |
for (var matched = [], cur = elem[dir]; cur && 9 !== cur.nodeType && (void 0 === until || 1 !== cur.nodeType || !jQuery(cur).is(until));) 1 === cur.nodeType && matched.push(cur), cur = cur[dir]; | |
return matched | |
}, | |
sibling: function(n, elem) { | |
for (var r = []; n; n = n.nextSibling) 1 === n.nodeType && n !== elem && r.push(n); | |
return r | |
} | |
}), jQuery.fn.extend({ | |
has: function(target) { | |
var i, targets = jQuery(target, this), | |
len = targets.length; | |
return this.filter(function() { | |
for (i = 0; i < len; i++) | |
if (jQuery.contains(this, targets[i])) return !0 | |
}) | |
}, | |
closest: function(selectors, context) { | |
for (var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test(selectors) || "string" != typeof selectors ? jQuery(selectors, context || this.context) : 0; i < l; i++) | |
for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) | |
if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : 1 === cur.nodeType && jQuery.find.matchesSelector(cur, selectors))) { | |
matched.push(cur); | |
break | |
} | |
return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched) | |
}, | |
index: function(elem) { | |
return elem ? "string" == typeof elem ? jQuery.inArray(this[0], jQuery(elem)) : jQuery.inArray(elem.jquery ? elem[0] : elem, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 | |
}, | |
add: function(selector, context) { | |
return this.pushStack(jQuery.unique(jQuery.merge(this.get(), jQuery(selector, context)))) | |
}, | |
addBack: function(selector) { | |
return this.add(null == selector ? this.prevObject : this.prevObject.filter(selector)) | |
} | |
}), jQuery.each({ | |
parent: function(elem) { | |
var parent = elem.parentNode; | |
return parent && 11 !== parent.nodeType ? parent : null | |
}, | |
parents: function(elem) { | |
return jQuery.dir(elem, "parentNode") | |
}, | |
parentsUntil: function(elem, i, until) { | |
return jQuery.dir(elem, "parentNode", until) | |
}, | |
next: function(elem) { | |
return sibling(elem, "nextSibling") | |
}, | |
prev: function(elem) { | |
return sibling(elem, "previousSibling") | |
}, | |
nextAll: function(elem) { | |
return jQuery.dir(elem, "nextSibling") | |
}, | |
prevAll: function(elem) { | |
return jQuery.dir(elem, "previousSibling") | |
}, | |
nextUntil: function(elem, i, until) { | |
return jQuery.dir(elem, "nextSibling", until) | |
}, | |
prevUntil: function(elem, i, until) { | |
return jQuery.dir(elem, "previousSibling", until) | |
}, | |
siblings: function(elem) { | |
return jQuery.sibling((elem.parentNode || {}).firstChild, elem) | |
}, | |
children: function(elem) { | |
return jQuery.sibling(elem.firstChild) | |
}, | |
contents: function(elem) { | |
return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.merge([], elem.childNodes) | |
} | |
}, function(name, fn) { | |
jQuery.fn[name] = function(until, selector) { | |
var ret = jQuery.map(this, fn, until); | |
return "Until" !== name.slice(-5) && (selector = until), selector && "string" == typeof selector && (ret = jQuery.filter(selector, ret)), this.length > 1 && (guaranteedUnique[name] || (ret = jQuery.unique(ret)), rparentsprev.test(name) && (ret = ret.reverse())), this.pushStack(ret) | |
} | |
}); | |
var rnotwhite = /\S+/g, | |
optionsCache = {}; | |
jQuery.Callbacks = function(options) { | |
options = "string" == typeof options ? optionsCache[options] || createOptions(options) : jQuery.extend({}, options); | |
var firing, memory, fired, firingLength, firingIndex, firingStart, list = [], | |
stack = !options.once && [], | |
fire = function(data) { | |
for (memory = options.memory && data, fired = !0, firingIndex = firingStart || 0, firingStart = 0, firingLength = list.length, firing = !0; list && firingIndex < firingLength; firingIndex++) | |
if (!1 === list[firingIndex].apply(data[0], data[1]) && options.stopOnFalse) { | |
memory = !1; | |
break | |
} | |
firing = !1, list && (stack ? stack.length && fire(stack.shift()) : memory ? list = [] : self.disable()) | |
}, | |
self = { | |
add: function() { | |
if (list) { | |
var start = list.length; | |
! function add(args) { | |
jQuery.each(args, function(_, arg) { | |
var type = jQuery.type(arg); | |
"function" === type ? options.unique && self.has(arg) || list.push(arg) : arg && arg.length && "string" !== type && add(arg) | |
}) | |
}(arguments), firing ? firingLength = list.length : memory && (firingStart = start, fire(memory)) | |
} | |
return this | |
}, | |
remove: function() { | |
return list && jQuery.each(arguments, function(_, arg) { | |
for (var index; | |
(index = jQuery.inArray(arg, list, index)) > -1;) list.splice(index, 1), firing && (index <= firingLength && firingLength--, index <= firingIndex && firingIndex--) | |
}), this | |
}, | |
has: function(fn) { | |
return fn ? jQuery.inArray(fn, list) > -1 : !(!list || !list.length) | |
}, | |
empty: function() { | |
return list = [], firingLength = 0, this | |
}, | |
disable: function() { | |
return list = stack = memory = void 0, this | |
}, | |
disabled: function() { | |
return !list | |
}, | |
lock: function() { | |
return stack = void 0, memory || self.disable(), this | |
}, | |
locked: function() { | |
return !stack | |
}, | |
fireWith: function(context, args) { | |
return !list || fired && !stack || (args = args || [], args = [context, args.slice ? args.slice() : args], firing ? stack.push(args) : fire(args)), this | |
}, | |
fire: function() { | |
return self.fireWith(this, arguments), this | |
}, | |
fired: function() { | |
return !!fired | |
} | |
}; | |
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 = { | |
state: function() { | |
return state | |
}, | |
always: function() { | |
return deferred.done(arguments).fail(arguments), this | |
}, | |
then: function() { | |
var fns = arguments; | |
return jQuery.Deferred(function(newDefer) { | |
jQuery.each(tuples, function(i, tuple) { | |
var fn = jQuery.isFunction(fns[i]) && fns[i]; | |
deferred[tuple[1]](function() { | |
var returned = fn && fn.apply(this, arguments); | |
returned && jQuery.isFunction(returned.promise) ? returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify) : newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments) | |
}) | |
}), fns = null | |
}).promise() | |
}, | |
promise: function(obj) { | |
return null != obj ? jQuery.extend(obj, promise) : promise | |
} | |
}, | |
deferred = {}; | |
return promise.pipe = promise.then, jQuery.each(tuples, function(i, tuple) { | |
var list = tuple[2], | |
stateString = tuple[3]; | |
promise[tuple[1]] = list.add, stateString && list.add(function() { | |
state = stateString | |
}, tuples[1 ^ i][2].disable, tuples[2][2].lock), deferred[tuple[0]] = function() { | |
return deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments), this | |
}, deferred[tuple[0] + "With"] = list.fireWith | |
}), promise.promise(deferred), func && func.call(deferred, deferred), deferred | |
}, | |
when: function(subordinate) { | |
var progressValues, progressContexts, resolveContexts, i = 0, | |
resolveValues = slice.call(arguments), | |
length = resolveValues.length, | |
remaining = 1 !== length || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0, | |
deferred = 1 === remaining ? subordinate : jQuery.Deferred(), | |
updateFunc = function(i, contexts, values) { | |
return function(value) { | |
contexts[i] = this, values[i] = arguments.length > 1 ? slice.call(arguments) : value, values === progressValues ? deferred.notifyWith(contexts, values) : --remaining || deferred.resolveWith(contexts, values) | |
} | |
}; | |
if (length > 1) | |
for (progressValues = new Array(length), progressContexts = new Array(length), resolveContexts = new Array(length); i < length; i++) resolveValues[i] && jQuery.isFunction(resolveValues[i].promise) ? resolveValues[i].promise().done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject).progress(updateFunc(i, progressContexts, progressValues)) : --remaining; | |
return remaining || deferred.resolveWith(resolveContexts, resolveValues), deferred.promise() | |
} | |
}); | |
var readyList; | |
jQuery.fn.ready = function(fn) { | |
return jQuery.ready.promise().done(fn), this | |
}, jQuery.extend({ | |
isReady: !1, | |
readyWait: 1, | |
holdReady: function(hold) { | |
hold ? jQuery.readyWait++ : jQuery.ready(!0) | |
}, | |
ready: function(wait) { | |
if (!0 === wait ? !--jQuery.readyWait : !jQuery.isReady) { | |
if (!document.body) return setTimeout(jQuery.ready); | |
jQuery.isReady = !0, !0 !== wait && --jQuery.readyWait > 0 || (readyList.resolveWith(document, [jQuery]), jQuery.fn.triggerHandler && (jQuery(document).triggerHandler("ready"), jQuery(document).off("ready"))) | |
} | |
} | |
}), jQuery.ready.promise = function(obj) { | |
if (!readyList) | |
if (readyList = jQuery.Deferred(), "complete" === document.readyState) setTimeout(jQuery.ready); | |
else if (document.addEventListener) document.addEventListener("DOMContentLoaded", completed, !1), window.addEventListener("load", completed, !1); | |
else { | |
document.attachEvent("onreadystatechange", completed), window.attachEvent("onload", completed); | |
var top = !1; | |
try { | |
top = null == window.frameElement && document.documentElement | |
} catch (e) {} | |
top && top.doScroll && function doScrollCheck() { | |
if (!jQuery.isReady) { | |
try { | |
top.doScroll("left") | |
} catch (e) { | |
return setTimeout(doScrollCheck, 50) | |
} | |
detach(), jQuery.ready() | |
} | |
}() | |
} | |
return readyList.promise(obj) | |
}; | |
var i, strundefined = "undefined"; | |
for (i in jQuery(support)) break; | |
support.ownLast = "0" !== i, support.inlineBlockNeedsLayout = !1, jQuery(function() { | |
var val, div, body, container; | |
(body = document.getElementsByTagName("body")[0]) && body.style && (div = document.createElement("div"), container = document.createElement("div"), container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", body.appendChild(container).appendChild(div), typeof div.style.zoom !== strundefined && (div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", support.inlineBlockNeedsLayout = val = 3 === div.offsetWidth, val && (body.style.zoom = 1)), body.removeChild(container)) | |
}), | |
function() { | |
var div = document.createElement("div"); | |
if (null == support.deleteExpando) { | |
support.deleteExpando = !0; | |
try { | |
delete div.test | |
} catch (e) { | |
support.deleteExpando = !1 | |
} | |
} | |
div = null | |
}(), jQuery.acceptData = function(elem) { | |
var noData = jQuery.noData[(elem.nodeName + " ").toLowerCase()], | |
nodeType = +elem.nodeType || 1; | |
return (1 === nodeType || 9 === nodeType) && (!noData || !0 !== noData && elem.getAttribute("classid") === noData) | |
}; | |
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, | |
rmultiDash = /([A-Z])/g; | |
jQuery.extend({ | |
cache: {}, | |
noData: { | |
"applet ": !0, | |
"embed ": !0, | |
"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" | |
}, | |
hasData: function(elem) { | |
return !!(elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando]) && !isEmptyDataObject(elem) | |
}, | |
data: function(elem, name, data) { | |
return internalData(elem, name, data) | |
}, | |
removeData: function(elem, name) { | |
return internalRemoveData(elem, name) | |
}, | |
_data: function(elem, name, data) { | |
return internalData(elem, name, data, !0) | |
}, | |
_removeData: function(elem, name) { | |
return internalRemoveData(elem, name, !0) | |
} | |
}), jQuery.fn.extend({ | |
data: function(key, value) { | |
var i, name, data, elem = this[0], | |
attrs = elem && elem.attributes; | |
if (void 0 === key) { | |
if (this.length && (data = jQuery.data(elem), 1 === elem.nodeType && !jQuery._data(elem, "parsedAttrs"))) { | |
for (i = attrs.length; i--;) attrs[i] && (name = attrs[i].name, 0 === name.indexOf("data-") && (name = jQuery.camelCase(name.slice(5)), dataAttr(elem, name, data[name]))); | |
jQuery._data(elem, "parsedAttrs", !0) | |
} | |
return data | |
} | |
return "object" == typeof key ? this.each(function() { | |
jQuery.data(this, key) | |
}) : arguments.length > 1 ? this.each(function() { | |
jQuery.data(this, key, value) | |
}) : elem ? dataAttr(elem, key, jQuery.data(elem, key)) : void 0 | |
}, | |
removeData: function(key) { | |
return this.each(function() { | |
jQuery.removeData(this, key) | |
}) | |
} | |
}), jQuery.extend({ | |
queue: function(elem, type, data) { | |
var queue; | |
if (elem) return type = (type || "fx") + "queue", queue = jQuery._data(elem, type), data && (!queue || jQuery.isArray(data) ? queue = jQuery._data(elem, type, jQuery.makeArray(data)) : queue.push(data)), queue || [] | |
}, | |
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) | |
}; | |
"inprogress" === fn && (fn = queue.shift(), startLength--), fn && ("fx" === type && queue.unshift("inprogress"), delete hooks.stop, fn.call(elem, next, hooks)), !startLength && hooks && hooks.empty.fire() | |
}, | |
_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"), jQuery._removeData(elem, key) | |
}) | |
}) | |
} | |
}), jQuery.fn.extend({ | |
queue: function(type, data) { | |
var setter = 2; | |
return "string" != typeof type && (data = type, type = "fx", setter--), arguments.length < setter ? jQuery.queue(this[0], type) : void 0 === data ? this : this.each(function() { | |
var queue = jQuery.queue(this, type, data); | |
jQuery._queueHooks(this, type), "fx" === type && "inprogress" !== queue[0] && jQuery.dequeue(this, type) | |
}) | |
}, | |
dequeue: function(type) { | |
return this.each(function() { | |
jQuery.dequeue(this, type) | |
}) | |
}, | |
clearQueue: function(type) { | |
return this.queue(type || "fx", []) | |
}, | |
promise: function(type, obj) { | |
var tmp, count = 1, | |
defer = jQuery.Deferred(), | |
elements = this, | |
i = this.length, | |
resolve = function() { | |
--count || defer.resolveWith(elements, [elements]) | |
}; | |
for ("string" != typeof type && (obj = type, type = void 0), type = type || "fx"; i--;)(tmp = jQuery._data(elements[i], type + "queueHooks")) && tmp.empty && (count++, tmp.empty.add(resolve)); | |
return resolve(), defer.promise(obj) | |
} | |
}); | |
var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, | |
cssExpand = ["Top", "Right", "Bottom", "Left"], | |
isHidden = function(elem, el) { | |
return elem = el || elem, "none" === jQuery.css(elem, "display") || !jQuery.contains(elem.ownerDocument, elem) | |
}, | |
access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) { | |
var i = 0, | |
length = elems.length, | |
bulk = null == key; | |
if ("object" === jQuery.type(key)) { | |
chainable = !0; | |
for (i in key) jQuery.access(elems, fn, i, key[i], !0, emptyGet, raw) | |
} else if (void 0 !== value && (chainable = !0, jQuery.isFunction(value) || (raw = !0), bulk && (raw ? (fn.call(elems, value), fn = null) : (bulk = fn, fn = function(elem, key, value) { | |
return bulk.call(jQuery(elem), value) | |
})), fn)) | |
for (; i < length; i++) fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))); | |
return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet | |
}, | |
rcheckableType = /^(?:checkbox|radio)$/i; | |
! function() { | |
var input = document.createElement("input"), | |
div = document.createElement("div"), | |
fragment = document.createDocumentFragment(); | |
if (div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", support.leadingWhitespace = 3 === div.firstChild.nodeType, support.tbody = !div.getElementsByTagName("tbody").length, support.htmlSerialize = !!div.getElementsByTagName("link").length, support.html5Clone = "<:nav></:nav>" !== document.createElement("nav").cloneNode(!0).outerHTML, input.type = "checkbox", input.checked = !0, fragment.appendChild(input), support.appendChecked = input.checked, div.innerHTML = "<textarea>x</textarea>", support.noCloneChecked = !!div.cloneNode(!0).lastChild.defaultValue, fragment.appendChild(div), div.innerHTML = "<input type='radio' checked='checked' name='t'/>", support.checkClone = div.cloneNode(!0).cloneNode(!0).lastChild.checked, support.noCloneEvent = !0, div.attachEvent && (div.attachEvent("onclick", function() { | |
support.noCloneEvent = !1 | |
}), div.cloneNode(!0).click()), null == support.deleteExpando) { | |
support.deleteExpando = !0; | |
try { | |
delete div.test | |
} catch (e) { | |
support.deleteExpando = !1 | |
} | |
} | |
}(), | |
function() { | |
var i, eventName, div = document.createElement("div"); | |
for (i in { | |
submit: !0, | |
change: !0, | |
focusin: !0 | |
}) eventName = "on" + i, (support[i + "Bubbles"] = eventName in window) || (div.setAttribute(eventName, "t"), support[i + "Bubbles"] = !1 === div.attributes[eventName].expando); | |
div = null | |
}(); | |
var rformElems = /^(?:input|select|textarea)$/i, | |
rkeyEvent = /^key/, | |
rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, | |
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, | |
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; | |
jQuery.event = { | |
global: {}, | |
add: function(elem, types, handler, data, selector) { | |
var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data(elem); | |
if (elemData) { | |
for (handler.handler && (handleObjIn = handler, handler = handleObjIn.handler, selector = handleObjIn.selector), handler.guid || (handler.guid = jQuery.guid++), (events = elemData.events) || (events = elemData.events = {}), (eventHandle = elemData.handle) || (eventHandle = elemData.handle = function(e) { | |
return typeof jQuery === strundefined || e && jQuery.event.triggered === e.type ? void 0 : jQuery.event.dispatch.apply(eventHandle.elem, arguments) | |
}, eventHandle.elem = elem), types = (types || "").match(rnotwhite) || [""], t = types.length; t--;) tmp = rtypenamespace.exec(types[t]) || [], type = origType = tmp[1], namespaces = (tmp[2] || "").split(".").sort(), type && (special = jQuery.event.special[type] || {}, type = (selector ? special.delegateType : special.bindType) || type, special = jQuery.event.special[type] || {}, handleObj = jQuery.extend({ | |
type: type, | |
origType: origType, | |
data: data, | |
handler: handler, | |
guid: handler.guid, | |
selector: selector, | |
needsContext: selector && jQuery.expr.match.needsContext.test(selector), | |
namespace: namespaces.join(".") | |
}, handleObjIn), (handlers = events[type]) || (handlers = events[type] = [], handlers.delegateCount = 0, special.setup && !1 !== special.setup.call(elem, data, namespaces, eventHandle) || (elem.addEventListener ? elem.addEventListener(type, eventHandle, !1) : elem.attachEvent && elem.attachEvent("on" + type, eventHandle))), special.add && (special.add.call(elem, handleObj), handleObj.handler.guid || (handleObj.handler.guid = handler.guid)), selector ? handlers.splice(handlers.delegateCount++, 0, handleObj) : handlers.push(handleObj), jQuery.event.global[type] = !0); | |
elem = null | |
} | |
}, | |
remove: function(elem, types, handler, selector, mappedTypes) { | |
var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData(elem) && jQuery._data(elem); | |
if (elemData && (events = elemData.events)) { | |
for (types = (types || "").match(rnotwhite) || [""], t = types.length; t--;) | |
if (tmp = rtypenamespace.exec(types[t]) || [], type = origType = tmp[1], namespaces = (tmp[2] || "").split(".").sort(), type) { | |
for (special = jQuery.event.special[type] || {}, type = (selector ? special.delegateType : special.bindType) || type, handlers = events[type] || [], tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"), origCount = j = handlers.length; j--;) handleObj = handlers[j], !mappedTypes && origType !== handleObj.origType || handler && handler.guid !== handleObj.guid || tmp && !tmp.test(handleObj.namespace) || selector && selector !== handleObj.selector && ("**" !== selector || !handleObj.selector) || (handlers.splice(j, 1), handleObj.selector && handlers.delegateCount--, special.remove && special.remove.call(elem, handleObj)); | |
origCount && !handlers.length && (special.teardown && !1 !== special.teardown.call(elem, namespaces, elemData.handle) || jQuery.removeEvent(elem, type, elemData.handle), delete events[type]) | |
} else | |
for (type in events) jQuery.event.remove(elem, type + types[t], handler, selector, !0); | |
jQuery.isEmptyObject(events) && (delete elemData.handle, jQuery._removeData(elem, "events")) | |
} | |
}, | |
trigger: function(event, data, elem, onlyHandlers) { | |
var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [elem || document], | |
type = hasOwn.call(event, "type") ? event.type : event, | |
namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; | |
if (cur = tmp = elem = elem || document, 3 !== elem.nodeType && 8 !== elem.nodeType && !rfocusMorph.test(type + jQuery.event.triggered) && (type.indexOf(".") >= 0 && (namespaces = type.split("."), type = namespaces.shift(), namespaces.sort()), ontype = type.indexOf(":") < 0 && "on" + type, event = event[jQuery.expando] ? event : new jQuery.Event(type, "object" == typeof event && event), event.isTrigger = onlyHandlers ? 2 : 3, event.namespace = namespaces.join("."), event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, event.result = void 0, event.target || (event.target = elem), data = null == data ? [event] : jQuery.makeArray(data, [event]), special = jQuery.event.special[type] || {}, onlyHandlers || !special.trigger || !1 !== special.trigger.apply(elem, data))) { | |
if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) { | |
for (bubbleType = special.delegateType || type, rfocusMorph.test(bubbleType + type) || (cur = cur.parentNode); cur; cur = cur.parentNode) eventPath.push(cur), tmp = cur; | |
tmp === (elem.ownerDocument || document) && eventPath.push(tmp.defaultView || tmp.parentWindow || window) | |
} | |
for (i = 0; | |
(cur = eventPath[i++]) && !event.isPropagationStopped();) event.type = i > 1 ? bubbleType : special.bindType || type, handle = (jQuery._data(cur, "events") || {})[event.type] && jQuery._data(cur, "handle"), handle && handle.apply(cur, data), (handle = ontype && cur[ontype]) && handle.apply && jQuery.acceptData(cur) && (event.result = handle.apply(cur, data), !1 === event.result && event.preventDefault()); | |
if (event.type = type, !onlyHandlers && !event.isDefaultPrevented() && (!special._default || !1 === special._default.apply(eventPath.pop(), data)) && jQuery.acceptData(elem) && ontype && elem[type] && !jQuery.isWindow(elem)) { | |
tmp = elem[ontype], tmp && (elem[ontype] = null), jQuery.event.triggered = type; | |
try { | |
elem[type]() | |
} catch (e) {} | |
jQuery.event.triggered = void 0, tmp && (elem[ontype] = tmp) | |
} | |
return event.result | |
} | |
}, | |
dispatch: function(event) { | |
event = jQuery.event.fix(event); | |
var i, ret, handleObj, matched, j, handlerQueue = [], | |
args = slice.call(arguments), | |
handlers = (jQuery._data(this, "events") || {})[event.type] || [], | |
special = jQuery.event.special[event.type] || {}; | |
if (args[0] = event, event.delegateTarget = this, !special.preDispatch || !1 !== special.preDispatch.call(this, event)) { | |
for (handlerQueue = jQuery.event.handlers.call(this, event, handlers), i = 0; | |
(matched = handlerQueue[i++]) && !event.isPropagationStopped();) | |
for (event.currentTarget = matched.elem, j = 0; | |
(handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped();) event.namespace_re && !event.namespace_re.test(handleObj.namespace) || (event.handleObj = handleObj, event.data = handleObj.data, void 0 !== (ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args)) && !1 === (event.result = ret) && (event.preventDefault(), event.stopPropagation())); | |
return special.postDispatch && special.postDispatch.call(this, event), event.result | |
} | |
}, | |
handlers: function(event, handlers) { | |
var sel, handleObj, matches, i, handlerQueue = [], | |
delegateCount = handlers.delegateCount, | |
cur = event.target; | |
if (delegateCount && cur.nodeType && (!event.button || "click" !== event.type)) | |
for (; cur != this; cur = cur.parentNode || this) | |
if (1 === cur.nodeType && (!0 !== cur.disabled || "click" !== event.type)) { | |
for (matches = [], i = 0; i < delegateCount; i++) handleObj = handlers[i], sel = handleObj.selector + " ", void 0 === matches[sel] && (matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery.find(sel, this, null, [cur]).length), matches[sel] && matches.push(handleObj); | |
matches.length && handlerQueue.push({ | |
elem: cur, | |
handlers: matches | |
}) | |
} | |
return delegateCount < handlers.length && handlerQueue.push({ | |
elem: this, | |
handlers: handlers.slice(delegateCount) | |
}), handlerQueue | |
}, | |
fix: function(event) { | |
if (event[jQuery.expando]) return event; | |
var i, prop, copy, type = event.type, | |
originalEvent = event, | |
fixHook = this.fixHooks[type]; | |
for (fixHook || (this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {}), copy = fixHook.props ? this.props.concat(fixHook.props) : this.props, event = new jQuery.Event(originalEvent), i = copy.length; i--;) prop = copy[i], event[prop] = originalEvent[prop]; | |
return event.target || (event.target = originalEvent.srcElement || document), 3 === event.target.nodeType && (event.target = event.target.parentNode), event.metaKey = !!event.metaKey, fixHook.filter ? fixHook.filter(event, originalEvent) : event | |
}, | |
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | |
fixHooks: {}, | |
keyHooks: { | |
props: "char charCode key keyCode".split(" "), | |
filter: function(event, original) { | |
return null == event.which && (event.which = null != original.charCode ? original.charCode : original.keyCode), event | |
} | |
}, | |
mouseHooks: { | |
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | |
filter: function(event, original) { | |
var body, eventDoc, doc, button = original.button, | |
fromElement = original.fromElement; | |
return null == event.pageX && null != original.clientX && (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)), !event.relatedTarget && fromElement && (event.relatedTarget = fromElement === event.target ? original.toElement : fromElement), event.which || void 0 === button || (event.which = 1 & button ? 1 : 2 & button ? 3 : 4 & button ? 2 : 0), event | |
} | |
}, | |
special: { | |
load: { | |
noBubble: !0 | |
}, | |
focus: { | |
trigger: function() { | |
if (this !== safeActiveElement() && this.focus) try { | |
return this.focus(), !1 | |
} catch (e) {} | |
}, | |
delegateType: "focusin" | |
}, | |
blur: { | |
trigger: function() { | |
if (this === safeActiveElement() && this.blur) return this.blur(), !1 | |
}, | |
delegateType: "focusout" | |
}, | |
click: { | |
trigger: function() { | |
if (jQuery.nodeName(this, "input") && "checkbox" === this.type && this.click) return this.click(), !1 | |
}, | |
_default: function(event) { | |
return jQuery.nodeName(event.target, "a") | |
} | |
}, | |
beforeunload: { | |
postDispatch: function(event) { | |
void 0 !== event.result && event.originalEvent && (event.originalEvent.returnValue = event.result) | |
} | |
} | |
}, | |
simulate: function(type, elem, event, bubble) { | |
var e = jQuery.extend(new jQuery.Event, event, { | |
type: type, | |
isSimulated: !0, | |
originalEvent: {} | |
}); | |
bubble ? jQuery.event.trigger(e, null, elem) : jQuery.event.dispatch.call(elem, e), e.isDefaultPrevented() && event.preventDefault() | |
} | |
}, jQuery.removeEvent = document.removeEventListener ? function(elem, type, handle) { | |
elem.removeEventListener && elem.removeEventListener(type, handle, !1) | |
} : function(elem, type, handle) { | |
var name = "on" + type; | |
elem.detachEvent && (typeof elem[name] === strundefined && (elem[name] = null), elem.detachEvent(name, handle)) | |
}, jQuery.Event = function(src, props) { | |
if (!(this instanceof jQuery.Event)) return new jQuery.Event(src, props); | |
src && src.type ? (this.originalEvent = src, this.type = src.type, this.isDefaultPrevented = src.defaultPrevented || void 0 === src.defaultPrevented && !1 === src.returnValue ? returnTrue : returnFalse) : this.type = src, props && jQuery.extend(this, props), this.timeStamp = src && src.timeStamp || jQuery.now(), this[jQuery.expando] = !0 | |
}, jQuery.Event.prototype = { | |
isDefaultPrevented: returnFalse, | |
isPropagationStopped: returnFalse, | |
isImmediatePropagationStopped: returnFalse, | |
preventDefault: function() { | |
var e = this.originalEvent; | |
this.isDefaultPrevented = returnTrue, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) | |
}, | |
stopPropagation: function() { | |
var e = this.originalEvent; | |
this.isPropagationStopped = returnTrue, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) | |
}, | |
stopImmediatePropagation: function() { | |
var e = this.originalEvent; | |
this.isImmediatePropagationStopped = returnTrue, e && e.stopImmediatePropagation && e.stopImmediatePropagation(), this.stopPropagation() | |
} | |
}, jQuery.each({ | |
mouseenter: "mouseover", | |
mouseleave: "mouseout", | |
pointerenter: "pointerover", | |
pointerleave: "pointerout" | |
}, function(orig, fix) { | |
jQuery.event.special[orig] = { | |
delegateType: fix, | |
bindType: fix, | |
handle: function(event) { | |
var ret, target = this, | |
related = event.relatedTarget, | |
handleObj = event.handleObj; | |
return related && (related === target || jQuery.contains(target, related)) || (event.type = handleObj.origType, ret = handleObj.handler.apply(this, arguments), event.type = fix), ret | |
} | |
} | |
}), support.submitBubbles || (jQuery.event.special.submit = { | |
setup: function() { | |
if (jQuery.nodeName(this, "form")) return !1; | |
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 : void 0; | |
form && !jQuery._data(form, "submitBubbles") && (jQuery.event.add(form, "submit._submit", function(event) { | |
event._submit_bubble = !0 | |
}), jQuery._data(form, "submitBubbles", !0)) | |
}) | |
}, | |
postDispatch: function(event) { | |
event._submit_bubble && (delete event._submit_bubble, this.parentNode && !event.isTrigger && jQuery.event.simulate("submit", this.parentNode, event, !0)) | |
}, | |
teardown: function() { | |
if (jQuery.nodeName(this, "form")) return !1; | |
jQuery.event.remove(this, "._submit") | |
} | |
}), support.changeBubbles || (jQuery.event.special.change = { | |
setup: function() { | |
if (rformElems.test(this.nodeName)) return "checkbox" !== this.type && "radio" !== this.type || (jQuery.event.add(this, "propertychange._change", function(event) { | |
"checked" === event.originalEvent.propertyName && (this._just_changed = !0) | |
}), jQuery.event.add(this, "click._change", function(event) { | |
this._just_changed && !event.isTrigger && (this._just_changed = !1), jQuery.event.simulate("change", this, event, !0) | |
})), !1; | |
jQuery.event.add(this, "beforeactivate._change", function(e) { | |
var elem = e.target; | |
rformElems.test(elem.nodeName) && !jQuery._data(elem, "changeBubbles") && (jQuery.event.add(elem, "change._change", function(event) { | |
!this.parentNode || event.isSimulated || event.isTrigger || jQuery.event.simulate("change", this.parentNode, event, !0) | |
}), jQuery._data(elem, "changeBubbles", !0)) | |
}) | |
}, | |
handle: function(event) { | |
var elem = event.target; | |
if (this !== elem || event.isSimulated || event.isTrigger || "radio" !== elem.type && "checkbox" !== elem.type) return event.handleObj.handler.apply(this, arguments) | |
}, | |
teardown: function() { | |
return jQuery.event.remove(this, "._change"), !rformElems.test(this.nodeName) | |
} | |
}), support.focusinBubbles || jQuery.each({ | |
focus: "focusin", | |
blur: "focusout" | |
}, function(orig, fix) { | |
var handler = function(event) { | |
jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), !0) | |
}; | |
jQuery.event.special[fix] = { | |
setup: function() { | |
var doc = this.ownerDocument || this, | |
attaches = jQuery._data(doc, fix); | |
attaches || doc.addEventListener(orig, handler, !0), jQuery._data(doc, fix, (attaches || 0) + 1) | |
}, | |
teardown: function() { | |
var doc = this.ownerDocument || this, | |
attaches = jQuery._data(doc, fix) - 1; | |
attaches ? jQuery._data(doc, fix, attaches) : (doc.removeEventListener(orig, handler, !0), jQuery._removeData(doc, fix)) | |
} | |
} | |
}), jQuery.fn.extend({ | |
on: function(types, selector, data, fn, one) { | |
var type, origFn; | |
if ("object" == typeof types) { | |
"string" != typeof selector && (data = data || selector, selector = void 0); | |
for (type in types) this.on(type, selector, data, types[type], one); | |
return this | |
} | |
if (null == data && null == fn ? (fn = selector, data = selector = void 0) : null == fn && ("string" == typeof selector ? (fn = data, data = void 0) : (fn = data, data = selector, selector = void 0)), !1 === fn) fn = returnFalse; | |
else if (!fn) return this; | |
return 1 === one && (origFn = fn, fn = function(event) { | |
return jQuery().off(event), origFn.apply(this, arguments) | |
}, fn.guid = origFn.guid || (origFn.guid = jQuery.guid++)), 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) | |
}, | |
off: function(types, selector, fn) { | |
var handleObj, type; | |
if (types && types.preventDefault && types.handleObj) return handleObj = types.handleObj, jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler), this; | |
if ("object" == typeof types) { | |
for (type in types) this.off(type, selector, types[type]); | |
return this | |
} | |
return !1 !== selector && "function" != typeof selector || (fn = selector, selector = void 0), !1 === fn && (fn = returnFalse), this.each(function() { | |
jQuery.event.remove(this, types, fn, selector) | |
}) | |
}, | |
trigger: function(type, data) { | |
return this.each(function() { | |
jQuery.event.trigger(type, data, this) | |
}) | |
}, | |
triggerHandler: function(type, data) { | |
var elem = this[0]; | |
if (elem) return jQuery.event.trigger(type, data, elem, !0) | |
} | |
}); | |
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", | |
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, | |
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), | |
rleadingWhitespace = /^\s+/, | |
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, | |
rtagName = /<([\w:]+)/, | |
rtbody = /<tbody/i, | |
rhtml = /<|&#?\w+;/, | |
rnoInnerhtml = /<(?:script|style|link)/i, | |
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, | |
rscriptType = /^$|\/(?:java|ecma)script/i, | |
rscriptTypeMasked = /^true\/(.*)/, | |
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, | |
wrapMap = { | |
option: [1, "<select multiple='multiple'>", "</select>"], | |
legend: [1, "<fieldset>", "</fieldset>"], | |
area: [1, "<map>", "</map>"], | |
param: [1, "<object>", "</object>"], | |
thead: [1, "<table>", "</table>"], | |
tr: [2, "<table><tbody>", "</tbody></table>"], | |
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], | |
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], | |
_default: support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] | |
}, | |
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, jQuery.extend({ | |
clone: function(elem, dataAndEvents, deepDataAndEvents) { | |
var destElements, node, clone, i, srcElements, inPage = jQuery.contains(elem.ownerDocument, elem); | |
if (support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">") ? clone = elem.cloneNode(!0) : (fragmentDiv.innerHTML = elem.outerHTML, fragmentDiv.removeChild(clone = fragmentDiv.firstChild)), !(support.noCloneEvent && support.noCloneChecked || 1 !== elem.nodeType && 11 !== elem.nodeType || jQuery.isXMLDoc(elem))) | |
for (destElements = getAll(clone), srcElements = getAll(elem), i = 0; null != (node = srcElements[i]); ++i) destElements[i] && fixCloneNodeIssues(node, destElements[i]); | |
if (dataAndEvents) | |
if (deepDataAndEvents) | |
for (srcElements = srcElements || getAll(elem), destElements = destElements || getAll(clone), i = 0; null != (node = srcElements[i]); i++) cloneCopyEvent(node, destElements[i]); | |
else cloneCopyEvent(elem, clone); | |
return destElements = getAll(clone, "script"), destElements.length > 0 && setGlobalEval(destElements, !inPage && getAll(elem, "script")), destElements = srcElements = node = null, clone | |
}, | |
buildFragment: function(elems, context, scripts, selection) { | |
for (var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, safe = createSafeFragment(context), nodes = [], i = 0; i < l; i++) | |
if ((elem = elems[i]) || 0 === elem) | |
if ("object" === jQuery.type(elem)) jQuery.merge(nodes, elem.nodeType ? [elem] : elem); | |
else if (rhtml.test(elem)) { | |
for (tmp = tmp || safe.appendChild(context.createElement("div")), tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(), | |
wrap = wrapMap[tag] || wrapMap._default, tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2], j = wrap[0]; j--;) tmp = tmp.lastChild; | |
if (!support.leadingWhitespace && rleadingWhitespace.test(elem) && nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])), !support.tbody) | |
for (elem = "table" !== tag || rtbody.test(elem) ? "<table>" !== wrap[1] || rtbody.test(elem) ? 0 : tmp : tmp.firstChild, j = elem && elem.childNodes.length; j--;) jQuery.nodeName(tbody = elem.childNodes[j], "tbody") && !tbody.childNodes.length && elem.removeChild(tbody); | |
for (jQuery.merge(nodes, tmp.childNodes), tmp.textContent = ""; tmp.firstChild;) tmp.removeChild(tmp.firstChild); | |
tmp = safe.lastChild | |
} else nodes.push(context.createTextNode(elem)); | |
for (tmp && safe.removeChild(tmp), support.appendChecked || jQuery.grep(getAll(nodes, "input"), fixDefaultChecked), i = 0; elem = nodes[i++];) | |
if ((!selection || -1 === jQuery.inArray(elem, selection)) && (contains = jQuery.contains(elem.ownerDocument, elem), tmp = getAll(safe.appendChild(elem), "script"), contains && setGlobalEval(tmp), scripts)) | |
for (j = 0; elem = tmp[j++];) rscriptType.test(elem.type || "") && scripts.push(elem); | |
return tmp = null, safe | |
}, | |
cleanData: function(elems, acceptData) { | |
for (var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = support.deleteExpando, special = jQuery.event.special; null != (elem = elems[i]); i++) | |
if ((acceptData || jQuery.acceptData(elem)) && (id = elem[internalKey], data = id && cache[id])) { | |
if (data.events) | |
for (type in data.events) special[type] ? jQuery.event.remove(elem, type) : jQuery.removeEvent(elem, type, data.handle); | |
cache[id] && (delete cache[id], deleteExpando ? delete elem[internalKey] : typeof elem.removeAttribute !== strundefined ? elem.removeAttribute(internalKey) : elem[internalKey] = null, deletedIds.push(id)) | |
} | |
} | |
}), jQuery.fn.extend({ | |
text: function(value) { | |
return access(this, function(value) { | |
return void 0 === value ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value)) | |
}, null, value, arguments.length) | |
}, | |
append: function() { | |
return this.domManip(arguments, function(elem) { | |
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { | |
manipulationTarget(this, elem).appendChild(elem) | |
} | |
}) | |
}, | |
prepend: function() { | |
return this.domManip(arguments, function(elem) { | |
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { | |
var target = manipulationTarget(this, elem); | |
target.insertBefore(elem, target.firstChild) | |
} | |
}) | |
}, | |
before: function() { | |
return this.domManip(arguments, function(elem) { | |
this.parentNode && this.parentNode.insertBefore(elem, this) | |
}) | |
}, | |
after: function() { | |
return this.domManip(arguments, function(elem) { | |
this.parentNode && this.parentNode.insertBefore(elem, this.nextSibling) | |
}) | |
}, | |
remove: function(selector, keepData) { | |
for (var elem, elems = selector ? jQuery.filter(selector, this) : this, i = 0; null != (elem = elems[i]); i++) keepData || 1 !== elem.nodeType || jQuery.cleanData(getAll(elem)), elem.parentNode && (keepData && jQuery.contains(elem.ownerDocument, elem) && setGlobalEval(getAll(elem, "script")), elem.parentNode.removeChild(elem)); | |
return this | |
}, | |
empty: function() { | |
for (var elem, i = 0; null != (elem = this[i]); i++) { | |
for (1 === elem.nodeType && jQuery.cleanData(getAll(elem, !1)); elem.firstChild;) elem.removeChild(elem.firstChild); | |
elem.options && jQuery.nodeName(elem, "select") && (elem.options.length = 0) | |
} | |
return this | |
}, | |
clone: function(dataAndEvents, deepDataAndEvents) { | |
return dataAndEvents = null != dataAndEvents && dataAndEvents, deepDataAndEvents = null == deepDataAndEvents ? dataAndEvents : deepDataAndEvents, this.map(function() { | |
return jQuery.clone(this, dataAndEvents, deepDataAndEvents) | |
}) | |
}, | |
html: function(value) { | |
return access(this, function(value) { | |
var elem = this[0] || {}, | |
i = 0, | |
l = this.length; | |
if (void 0 === value) return 1 === elem.nodeType ? elem.innerHTML.replace(rinlinejQuery, "") : void 0; | |
if ("string" == typeof value && !rnoInnerhtml.test(value) && (support.htmlSerialize || !rnoshimcache.test(value)) && (support.leadingWhitespace || !rleadingWhitespace.test(value)) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { | |
value = value.replace(rxhtmlTag, "<$1></$2>"); | |
try { | |
for (; i < l; i++) elem = this[i] || {}, 1 === elem.nodeType && (jQuery.cleanData(getAll(elem, !1)), elem.innerHTML = value); | |
elem = 0 | |
} catch (e) {} | |
} | |
elem && this.empty().append(value) | |
}, null, value, arguments.length) | |
}, | |
replaceWith: function() { | |
var arg = arguments[0]; | |
return this.domManip(arguments, function(elem) { | |
arg = this.parentNode, jQuery.cleanData(getAll(this)), arg && arg.replaceChild(elem, this) | |
}), arg && (arg.length || arg.nodeType) ? this : this.remove() | |
}, | |
detach: function(selector) { | |
return this.remove(selector, !0) | |
}, | |
domManip: function(args, callback) { | |
args = concat.apply([], args); | |
var first, node, hasScripts, scripts, doc, fragment, i = 0, | |
l = this.length, | |
set = this, | |
iNoClone = l - 1, | |
value = args[0], | |
isFunction = jQuery.isFunction(value); | |
if (isFunction || l > 1 && "string" == typeof value && !support.checkClone && rchecked.test(value)) return this.each(function(index) { | |
var self = set.eq(index); | |
isFunction && (args[0] = value.call(this, index, self.html())), self.domManip(args, callback) | |
}); | |
if (l && (fragment = jQuery.buildFragment(args, this[0].ownerDocument, !1, this), first = fragment.firstChild, 1 === fragment.childNodes.length && (fragment = first), first)) { | |
for (scripts = jQuery.map(getAll(fragment, "script"), disableScript), hasScripts = scripts.length; i < l; i++) node = fragment, i !== iNoClone && (node = jQuery.clone(node, !0, !0), hasScripts && jQuery.merge(scripts, getAll(node, "script"))), callback.call(this[i], node, i); | |
if (hasScripts) | |
for (doc = scripts[scripts.length - 1].ownerDocument, jQuery.map(scripts, restoreScript), i = 0; i < hasScripts; i++) node = scripts[i], rscriptType.test(node.type || "") && !jQuery._data(node, "globalEval") && jQuery.contains(doc, node) && (node.src ? jQuery._evalUrl && jQuery._evalUrl(node.src) : jQuery.globalEval((node.text || node.textContent || node.innerHTML || "").replace(rcleanScript, ""))); | |
fragment = first = null | |
} | |
return this | |
} | |
}), jQuery.each({ | |
appendTo: "append", | |
prependTo: "prepend", | |
insertBefore: "before", | |
insertAfter: "after", | |
replaceAll: "replaceWith" | |
}, function(name, original) { | |
jQuery.fn[name] = function(selector) { | |
for (var elems, i = 0, ret = [], insert = jQuery(selector), last = insert.length - 1; i <= last; i++) elems = i === last ? this : this.clone(!0), jQuery(insert[i])[original](elems), push.apply(ret, elems.get()); | |
return this.pushStack(ret) | |
} | |
}); | |
var iframe, elemdisplay = {}; | |
! function() { | |
var shrinkWrapBlocksVal; | |
support.shrinkWrapBlocks = function() { | |
if (null != shrinkWrapBlocksVal) return shrinkWrapBlocksVal; | |
shrinkWrapBlocksVal = !1; | |
var div, body, container; | |
return (body = document.getElementsByTagName("body")[0]) && body.style ? (div = document.createElement("div"), container = document.createElement("div"), container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", body.appendChild(container).appendChild(div), typeof div.style.zoom !== strundefined && (div.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", div.appendChild(document.createElement("div")).style.width = "5px", shrinkWrapBlocksVal = 3 !== div.offsetWidth), body.removeChild(container), shrinkWrapBlocksVal) : void 0 | |
} | |
}(); | |
var getStyles, curCSS, rmargin = /^margin/, | |
rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i"), | |
rposition = /^(top|right|bottom|left)$/; | |
window.getComputedStyle ? (getStyles = function(elem) { | |
return elem.ownerDocument.defaultView.getComputedStyle(elem, null) | |
}, curCSS = function(elem, name, computed) { | |
var width, minWidth, maxWidth, ret, style = elem.style; | |
return computed = computed || getStyles(elem), ret = computed ? computed.getPropertyValue(name) || computed[name] : void 0, computed && ("" !== ret || jQuery.contains(elem.ownerDocument, elem) || (ret = jQuery.style(elem, name)), 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)), void 0 === ret ? ret : ret + "" | |
}) : document.documentElement.currentStyle && (getStyles = function(elem) { | |
return elem.currentStyle | |
}, curCSS = function(elem, name, computed) { | |
var left, rs, rsLeft, ret, style = elem.style; | |
return computed = computed || getStyles(elem), ret = computed ? computed[name] : void 0, null == ret && style && style[name] && (ret = style[name]), rnumnonpx.test(ret) && !rposition.test(name) && (left = style.left, rs = elem.runtimeStyle, rsLeft = rs && rs.left, rsLeft && (rs.left = elem.currentStyle.left), style.left = "fontSize" === name ? "1em" : ret, ret = style.pixelLeft + "px", style.left = left, rsLeft && (rs.left = rsLeft)), void 0 === ret ? ret : ret + "" || "auto" | |
}), | |
function() { | |
function computeStyleTests() { | |
var div, body, container, contents; | |
(body = document.getElementsByTagName("body")[0]) && body.style && (div = document.createElement("div"), container = document.createElement("div"), container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", body.appendChild(container).appendChild(div), div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", pixelPositionVal = boxSizingReliableVal = !1, reliableMarginRightVal = !0, window.getComputedStyle && (pixelPositionVal = "1%" !== (window.getComputedStyle(div, null) || {}).top, boxSizingReliableVal = "4px" === (window.getComputedStyle(div, null) || { | |
width: "4px" | |
}).width, contents = div.appendChild(document.createElement("div")), contents.style.cssText = div.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", contents.style.marginRight = contents.style.width = "0", div.style.width = "1px", reliableMarginRightVal = !parseFloat((window.getComputedStyle(contents, null) || {}).marginRight)), div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", contents = div.getElementsByTagName("td"), contents[0].style.cssText = "margin:0;border:0;padding:0;display:none", reliableHiddenOffsetsVal = 0 === contents[0].offsetHeight, reliableHiddenOffsetsVal && (contents[0].style.display = "", contents[1].style.display = "none", reliableHiddenOffsetsVal = 0 === contents[0].offsetHeight), body.removeChild(container)) | |
} | |
var div, style, a, pixelPositionVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal; | |
div = document.createElement("div"), div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", a = div.getElementsByTagName("a")[0], (style = a && a.style) && (style.cssText = "float:left;opacity:.5", support.opacity = "0.5" === style.opacity, support.cssFloat = !!style.cssFloat, div.style.backgroundClip = "content-box", div.cloneNode(!0).style.backgroundClip = "", support.clearCloneStyle = "content-box" === div.style.backgroundClip, support.boxSizing = "" === style.boxSizing || "" === style.MozBoxSizing || "" === style.WebkitBoxSizing, jQuery.extend(support, { | |
reliableHiddenOffsets: function() { | |
return null == reliableHiddenOffsetsVal && computeStyleTests(), reliableHiddenOffsetsVal | |
}, | |
boxSizingReliable: function() { | |
return null == boxSizingReliableVal && computeStyleTests(), boxSizingReliableVal | |
}, | |
pixelPosition: function() { | |
return null == pixelPositionVal && computeStyleTests(), pixelPositionVal | |
}, | |
reliableMarginRight: function() { | |
return null == reliableMarginRightVal && computeStyleTests(), reliableMarginRightVal | |
} | |
})) | |
}(), jQuery.swap = function(elem, options, callback, args) { | |
var ret, name, old = {}; | |
for (name in options) old[name] = elem.style[name], elem.style[name] = options[name]; | |
ret = callback.apply(elem, args || []); | |
for (name in options) elem.style[name] = old[name]; | |
return ret | |
}; | |
var ralpha = /alpha\([^)]*\)/i, | |
ropacity = /opacity\s*=\s*([^)]*)/, | |
rdisplayswap = /^(none|table(?!-c[ea]).+)/, | |
rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"), | |
rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"), | |
cssShow = { | |
position: "absolute", | |
visibility: "hidden", | |
display: "block" | |
}, | |
cssNormalTransform = { | |
letterSpacing: "0", | |
fontWeight: "400" | |
}, | |
cssPrefixes = ["Webkit", "O", "Moz", "ms"]; | |
jQuery.extend({ | |
cssHooks: { | |
opacity: { | |
get: function(elem, computed) { | |
if (computed) { | |
var ret = curCSS(elem, "opacity"); | |
return "" === ret ? "1" : ret | |
} | |
} | |
} | |
}, | |
cssNumber: { | |
columnCount: !0, | |
fillOpacity: !0, | |
flexGrow: !0, | |
flexShrink: !0, | |
fontWeight: !0, | |
lineHeight: !0, | |
opacity: !0, | |
order: !0, | |
orphans: !0, | |
widows: !0, | |
zIndex: !0, | |
zoom: !0 | |
}, | |
cssProps: { | |
float: support.cssFloat ? "cssFloat" : "styleFloat" | |
}, | |
style: function(elem, name, value, extra) { | |
if (elem && 3 !== elem.nodeType && 8 !== elem.nodeType && elem.style) { | |
var ret, type, hooks, origName = jQuery.camelCase(name), | |
style = elem.style; | |
if (name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], void 0 === value) return hooks && "get" in hooks && void 0 !== (ret = hooks.get(elem, !1, extra)) ? ret : style[name]; | |
if (type = typeof value, "string" === type && (ret = rrelNum.exec(value)) && (value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)), type = "number"), null != value && value === value && ("number" !== type || jQuery.cssNumber[origName] || (value += "px"), support.clearCloneStyle || "" !== value || 0 !== name.indexOf("background") || (style[name] = "inherit"), !(hooks && "set" in hooks && void 0 === (value = hooks.set(elem, value, extra))))) try { | |
style[name] = value | |
} catch (e) {} | |
} | |
}, | |
css: function(elem, name, extra, styles) { | |
var num, val, hooks, origName = jQuery.camelCase(name); | |
return name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], hooks && "get" in hooks && (val = hooks.get(elem, !0, extra)), void 0 === val && (val = curCSS(elem, name, styles)), "normal" === val && name in cssNormalTransform && (val = cssNormalTransform[name]), "" === extra || extra ? (num = parseFloat(val), !0 === extra || jQuery.isNumeric(num) ? num || 0 : val) : val | |
} | |
}), jQuery.each(["height", "width"], function(i, name) { | |
jQuery.cssHooks[name] = { | |
get: function(elem, computed, extra) { | |
if (computed) return rdisplayswap.test(jQuery.css(elem, "display")) && 0 === elem.offsetWidth ? jQuery.swap(elem, cssShow, function() { | |
return getWidthOrHeight(elem, name, extra) | |
}) : getWidthOrHeight(elem, name, extra) | |
}, | |
set: function(elem, value, extra) { | |
var styles = extra && getStyles(elem); | |
return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, support.boxSizing && "border-box" === jQuery.css(elem, "boxSizing", !1, styles), styles) : 0) | |
} | |
} | |
}), support.opacity || (jQuery.cssHooks.opacity = { | |
get: function(elem, computed) { | |
return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : computed ? "1" : "" | |
}, | |
set: function(elem, value) { | |
var style = elem.style, | |
currentStyle = elem.currentStyle, | |
opacity = jQuery.isNumeric(value) ? "alpha(opacity=" + 100 * value + ")" : "", | |
filter = currentStyle && currentStyle.filter || style.filter || ""; | |
style.zoom = 1, (value >= 1 || "" === value) && "" === jQuery.trim(filter.replace(ralpha, "")) && style.removeAttribute && (style.removeAttribute("filter"), "" === value || currentStyle && !currentStyle.filter) || (style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : filter + " " + opacity) | |
} | |
}), jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight, function(elem, computed) { | |
if (computed) return jQuery.swap(elem, { | |
display: "inline-block" | |
}, curCSS, [elem, "marginRight"]) | |
}), jQuery.each({ | |
margin: "", | |
padding: "", | |
border: "Width" | |
}, function(prefix, suffix) { | |
jQuery.cssHooks[prefix + suffix] = { | |
expand: function(value) { | |
for (var i = 0, expanded = {}, parts = "string" == typeof value ? value.split(" ") : [value]; i < 4; i++) expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; | |
return expanded | |
} | |
}, rmargin.test(prefix) || (jQuery.cssHooks[prefix + suffix].set = setPositiveNumber) | |
}), jQuery.fn.extend({ | |
css: function(name, value) { | |
return access(this, function(elem, name, value) { | |
var styles, len, map = {}, | |
i = 0; | |
if (jQuery.isArray(name)) { | |
for (styles = getStyles(elem), len = name.length; i < len; i++) map[name[i]] = jQuery.css(elem, name[i], !1, styles); | |
return map | |
} | |
return void 0 !== value ? jQuery.style(elem, name, value) : jQuery.css(elem, name) | |
}, name, value, arguments.length > 1) | |
}, | |
show: function() { | |
return showHide(this, !0) | |
}, | |
hide: function() { | |
return showHide(this) | |
}, | |
toggle: function(state) { | |
return "boolean" == typeof state ? state ? this.show() : this.hide() : this.each(function() { | |
isHidden(this) ? jQuery(this).show() : jQuery(this).hide() | |
}) | |
} | |
}), jQuery.Tween = Tween, Tween.prototype = { | |
constructor: Tween, | |
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") | |
}, | |
cur: function() { | |
var hooks = Tween.propHooks[this.prop]; | |
return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this) | |
}, | |
run: function(percent) { | |
var eased, hooks = Tween.propHooks[this.prop]; | |
return this.options.duration ? this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration) : this.pos = eased = percent, this.now = (this.end - this.start) * eased + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), hooks && hooks.set ? hooks.set(this) : Tween.propHooks._default.set(this), this | |
} | |
}, Tween.prototype.init.prototype = Tween.prototype, Tween.propHooks = { | |
_default: { | |
get: function(tween) { | |
var result; | |
return null == tween.elem[tween.prop] || tween.elem.style && null != tween.elem.style[tween.prop] ? (result = jQuery.css(tween.elem, tween.prop, ""), result && "auto" !== result ? result : 0) : tween.elem[tween.prop] | |
}, | |
set: function(tween) { | |
jQuery.fx.step[tween.prop] ? jQuery.fx.step[tween.prop](tween) : tween.elem.style && (null != tween.elem.style[jQuery.cssProps[tween.prop]] || jQuery.cssHooks[tween.prop]) ? jQuery.style(tween.elem, tween.prop, tween.now + tween.unit) : tween.elem[tween.prop] = tween.now | |
} | |
} | |
}, Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { | |
set: function(tween) { | |
tween.elem.nodeType && tween.elem.parentNode && (tween.elem[tween.prop] = tween.now) | |
} | |
}, jQuery.easing = { | |
linear: function(p) { | |
return p | |
}, | |
swing: function(p) { | |
return .5 - Math.cos(p * Math.PI) / 2 | |
} | |
}, jQuery.fx = Tween.prototype.init, jQuery.fx.step = {}; | |
var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, | |
rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"), | |
rrun = /queueHooks$/, | |
animationPrefilters = [defaultPrefilter], | |
tweeners = { | |
"*": [function(prop, value) { | |
var tween = this.createTween(prop, value), | |
target = tween.cur(), | |
parts = rfxnum.exec(value), | |
unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"), | |
start = (jQuery.cssNumber[prop] || "px" !== unit && +target) && rfxnum.exec(jQuery.css(tween.elem, prop)), | |
scale = 1, | |
maxIterations = 20; | |
if (start && start[3] !== unit) { | |
unit = unit || start[3], parts = parts || [], start = +target || 1; | |
do { | |
scale = scale || ".5", start /= scale, jQuery.style(tween.elem, prop, start + unit) | |
} while (scale !== (scale = tween.cur() / target) && 1 !== scale && --maxIterations) | |
} | |
return parts && (start = tween.start = +start || +target || 0, tween.unit = unit, tween.end = parts[1] ? start + (parts[1] + 1) * parts[2] : +parts[2]), tween | |
}] | |
}; | |
jQuery.Animation = jQuery.extend(Animation, { | |
tweener: function(props, callback) { | |
jQuery.isFunction(props) ? (callback = props, props = ["*"]) : props = props.split(" "); | |
for (var prop, index = 0, length = props.length; index < length; index++) prop = props[index], tweeners[prop] = tweeners[prop] || [], tweeners[prop].unshift(callback) | |
}, | |
prefilter: function(callback, prepend) { | |
prepend ? animationPrefilters.unshift(callback) : animationPrefilters.push(callback) | |
} | |
}), jQuery.speed = function(speed, easing, fn) { | |
var opt = speed && "object" == typeof speed ? jQuery.extend({}, speed) : { | |
complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, | |
duration: speed, | |
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing | |
}; | |
return opt.duration = jQuery.fx.off ? 0 : "number" == typeof opt.duration ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default, null != opt.queue && !0 !== opt.queue || (opt.queue = "fx"), opt.old = opt.complete, opt.complete = function() { | |
jQuery.isFunction(opt.old) && opt.old.call(this), opt.queue && jQuery.dequeue(this, opt.queue) | |
}, opt | |
}, jQuery.fn.extend({ | |
fadeTo: function(speed, to, easing, callback) { | |
return this.filter(isHidden).css("opacity", 0).show().end().animate({ | |
opacity: to | |
}, speed, easing, callback) | |
}, | |
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); | |
(empty || jQuery._data(this, "finish")) && anim.stop(!0) | |
}; | |
return doAnimation.finish = doAnimation, empty || !1 === optall.queue ? this.each(doAnimation) : this.queue(optall.queue, doAnimation) | |
}, | |
stop: function(type, clearQueue, gotoEnd) { | |
var stopQueue = function(hooks) { | |
var stop = hooks.stop; | |
delete hooks.stop, stop(gotoEnd) | |
}; | |
return "string" != typeof type && (gotoEnd = clearQueue, clearQueue = type, type = void 0), clearQueue && !1 !== type && this.queue(type || "fx", []), this.each(function() { | |
var dequeue = !0, | |
index = null != type && type + "queueHooks", | |
timers = jQuery.timers, | |
data = jQuery._data(this); | |
if (index) data[index] && data[index].stop && stopQueue(data[index]); | |
else | |
for (index in data) data[index] && data[index].stop && rrun.test(index) && stopQueue(data[index]); | |
for (index = timers.length; index--;) timers[index].elem !== this || null != type && timers[index].queue !== type || (timers[index].anim.stop(gotoEnd), dequeue = !1, timers.splice(index, 1)); | |
!dequeue && gotoEnd || jQuery.dequeue(this, type) | |
}) | |
}, | |
finish: function(type) { | |
return !1 !== type && (type = type || "fx"), this.each(function() { | |
var index, data = jQuery._data(this), | |
queue = data[type + "queue"], | |
hooks = data[type + "queueHooks"], | |
timers = jQuery.timers, | |
length = queue ? queue.length : 0; | |
for (data.finish = !0, jQuery.queue(this, type, []), hooks && hooks.stop && hooks.stop.call(this, !0), index = timers.length; index--;) timers[index].elem === this && timers[index].queue === type && (timers[index].anim.stop(!0), timers.splice(index, 1)); | |
for (index = 0; index < length; index++) queue[index] && queue[index].finish && queue[index].finish.call(this); | |
delete data.finish | |
}) | |
} | |
}), jQuery.each(["toggle", "show", "hide"], function(i, name) { | |
var cssFn = jQuery.fn[name]; | |
jQuery.fn[name] = function(speed, easing, callback) { | |
return null == speed || "boolean" == typeof speed ? cssFn.apply(this, arguments) : this.animate(genFx(name, !0), speed, easing, callback) | |
} | |
}), jQuery.each({ | |
slideDown: genFx("show"), | |
slideUp: genFx("hide"), | |
slideToggle: genFx("toggle"), | |
fadeIn: { | |
opacity: "show" | |
}, | |
fadeOut: { | |
opacity: "hide" | |
}, | |
fadeToggle: { | |
opacity: "toggle" | |
} | |
}, function(name, props) { | |
jQuery.fn[name] = function(speed, easing, callback) { | |
return this.animate(props, speed, easing, callback) | |
} | |
}), jQuery.timers = [], jQuery.fx.tick = function() { | |
var timer, timers = jQuery.timers, | |
i = 0; | |
for (fxNow = jQuery.now(); i < timers.length; i++)(timer = timers[i])() || timers[i] !== timer || timers.splice(i--, 1); | |
timers.length || jQuery.fx.stop(), fxNow = void 0 | |
}, jQuery.fx.timer = function(timer) { | |
jQuery.timers.push(timer), timer() ? jQuery.fx.start() : jQuery.timers.pop() | |
}, jQuery.fx.interval = 13, jQuery.fx.start = function() { | |
timerId || (timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval)) | |
}, jQuery.fx.stop = function() { | |
clearInterval(timerId), timerId = null | |
}, jQuery.fx.speeds = { | |
slow: 600, | |
fast: 200, | |
_default: 400 | |
}, jQuery.fn.delay = function(time, type) { | |
return time = jQuery.fx ? jQuery.fx.speeds[time] || time : time, type = type || "fx", this.queue(type, function(next, hooks) { | |
var timeout = setTimeout(next, time); | |
hooks.stop = function() { | |
clearTimeout(timeout) | |
} | |
}) | |
}, | |
function() { | |
var input, div, select, a, opt; | |
div = document.createElement("div"), div.setAttribute("className", "t"), div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", a = div.getElementsByTagName("a")[0], select = document.createElement("select"), opt = select.appendChild(document.createElement("option")), input = div.getElementsByTagName("input")[0], a.style.cssText = "top:1px", support.getSetAttribute = "t" !== div.className, support.style = /top/.test(a.getAttribute("style")), support.hrefNormalized = "/a" === a.getAttribute("href"), support.checkOn = !!input.value, support.optSelected = opt.selected, support.enctype = !!document.createElement("form").enctype, select.disabled = !0, support.optDisabled = !opt.disabled, input = document.createElement("input"), input.setAttribute("value", ""), support.input = "" === input.getAttribute("value"), input.value = "t", input.setAttribute("type", "radio"), support.radioValue = "t" === input.value | |
}(); | |
var rreturn = /\r/g; | |
jQuery.fn.extend({ | |
val: function(value) { | |
var hooks, ret, isFunction, elem = this[0]; { | |
if (arguments.length) return isFunction = jQuery.isFunction(value), this.each(function(i) { | |
var val; | |
1 === this.nodeType && (val = isFunction ? value.call(this, i, jQuery(this).val()) : value, null == val ? val = "" : "number" == typeof val ? val += "" : jQuery.isArray(val) && (val = jQuery.map(val, function(value) { | |
return null == value ? "" : value + "" | |
})), (hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]) && "set" in hooks && void 0 !== hooks.set(this, val, "value") || (this.value = val)) | |
}); | |
if (elem) return (hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]) && "get" in hooks && void 0 !== (ret = hooks.get(elem, "value")) ? ret : (ret = elem.value, "string" == typeof ret ? ret.replace(rreturn, "") : null == ret ? "" : ret) | |
} | |
} | |
}), jQuery.extend({ | |
valHooks: { | |
option: { | |
get: function(elem) { | |
var val = jQuery.find.attr(elem, "value"); | |
return null != val ? val : jQuery.trim(jQuery.text(elem)) | |
} | |
}, | |
select: { | |
get: function(elem) { | |
for (var value, option, options = elem.options, index = elem.selectedIndex, one = "select-one" === elem.type || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; i < max; i++) | |
if (option = options[i], (option.selected || i === index) && (support.optDisabled ? !option.disabled : null === option.getAttribute("disabled")) && (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) { | |
if (value = jQuery(option).val(), one) return value; | |
values.push(value) | |
} | |
return values | |
}, | |
set: function(elem, value) { | |
for (var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length; i--;) | |
if (option = options[i], jQuery.inArray(jQuery.valHooks.option.get(option), values) >= 0) try { | |
option.selected = optionSet = !0 | |
} catch (_) { | |
option.scrollHeight | |
} else option.selected = !1; | |
return optionSet || (elem.selectedIndex = -1), options | |
} | |
} | |
} | |
}), jQuery.each(["radio", "checkbox"], function() { | |
jQuery.valHooks[this] = { | |
set: function(elem, value) { | |
if (jQuery.isArray(value)) return elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0 | |
} | |
}, support.checkOn || (jQuery.valHooks[this].get = function(elem) { | |
return null === elem.getAttribute("value") ? "on" : elem.value | |
}) | |
}); | |
var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle, | |
ruseDefault = /^(?:checked|selected)$/i, | |
getSetAttribute = support.getSetAttribute, | |
getSetInput = support.input; | |
jQuery.fn.extend({ | |
attr: function(name, value) { | |
return access(this, jQuery.attr, name, value, arguments.length > 1) | |
}, | |
removeAttr: function(name) { | |
return this.each(function() { | |
jQuery.removeAttr(this, name) | |
}) | |
} | |
}), jQuery.extend({ | |
attr: function(elem, name, value) { | |
var hooks, ret, nType = elem.nodeType; | |
if (elem && 3 !== nType && 8 !== nType && 2 !== nType) return typeof elem.getAttribute === strundefined ? jQuery.prop(elem, name, value) : (1 === nType && jQuery.isXMLDoc(elem) || (name = name.toLowerCase(), hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook)), void 0 === value ? hooks && "get" in hooks && null !== (ret = hooks.get(elem, name)) ? ret : (ret = jQuery.find.attr(elem, name), null == ret ? void 0 : ret) : null !== value ? hooks && "set" in hooks && void 0 !== (ret = hooks.set(elem, value, name)) ? ret : (elem.setAttribute(name, value + ""), value) : void jQuery.removeAttr(elem, name)) | |
}, | |
removeAttr: function(elem, value) { | |
var name, propName, i = 0, | |
attrNames = value && value.match(rnotwhite); | |
if (attrNames && 1 === elem.nodeType) | |
for (; name = attrNames[i++];) propName = jQuery.propFix[name] || name, jQuery.expr.match.bool.test(name) ? getSetInput && getSetAttribute || !ruseDefault.test(name) ? elem[propName] = !1 : elem[jQuery.camelCase("default-" + name)] = elem[propName] = !1 : jQuery.attr(elem, name, ""), elem.removeAttribute(getSetAttribute ? name : propName) | |
}, | |
attrHooks: { | |
type: { | |
set: function(elem, value) { | |
if (!support.radioValue && "radio" === value && jQuery.nodeName(elem, "input")) { | |
var val = elem.value; | |
return elem.setAttribute("type", value), val && (elem.value = val), value | |
} | |
} | |
} | |
} | |
}), boolHook = { | |
set: function(elem, value, name) { | |
return !1 === value ? jQuery.removeAttr(elem, name) : getSetInput && getSetAttribute || !ruseDefault.test(name) ? elem.setAttribute(!getSetAttribute && jQuery.propFix[name] || name, name) : elem[jQuery.camelCase("default-" + name)] = elem[name] = !0, name | |
} | |
}, jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) { | |
var getter = attrHandle[name] || jQuery.find.attr; | |
attrHandle[name] = getSetInput && getSetAttribute || !ruseDefault.test(name) ? function(elem, name, isXML) { | |
var ret, handle; | |
return isXML || (handle = attrHandle[name], attrHandle[name] = ret, ret = null != getter(elem, name, isXML) ? name.toLowerCase() : null, attrHandle[name] = handle), ret | |
} : function(elem, name, isXML) { | |
if (!isXML) return elem[jQuery.camelCase("default-" + name)] ? name.toLowerCase() : null | |
} | |
}), getSetInput && getSetAttribute || (jQuery.attrHooks.value = { | |
set: function(elem, value, name) { | |
if (!jQuery.nodeName(elem, "input")) return nodeHook && nodeHook.set(elem, value, name); | |
elem.defaultValue = value | |
} | |
}), getSetAttribute || (nodeHook = { | |
set: function(elem, value, name) { | |
var ret = elem.getAttributeNode(name); | |
if (ret || elem.setAttributeNode(ret = elem.ownerDocument.createAttribute(name)), ret.value = value += "", "value" === name || value === elem.getAttribute(name)) return value | |
} | |
}, attrHandle.id = attrHandle.name = attrHandle.coords = function(elem, name, isXML) { | |
var ret; | |
if (!isXML) return (ret = elem.getAttributeNode(name)) && "" !== ret.value ? ret.value : null | |
}, jQuery.valHooks.button = { | |
get: function(elem, name) { | |
var ret = elem.getAttributeNode(name); | |
if (ret && ret.specified) return ret.value | |
}, | |
set: nodeHook.set | |
}, jQuery.attrHooks.contenteditable = { | |
set: function(elem, value, name) { | |
nodeHook.set(elem, "" !== value && value, name) | |
} | |
}, jQuery.each(["width", "height"], function(i, name) { | |
jQuery.attrHooks[name] = { | |
set: function(elem, value) { | |
if ("" === value) return elem.setAttribute(name, "auto"), value | |
} | |
} | |
})), support.style || (jQuery.attrHooks.style = { | |
get: function(elem) { | |
return elem.style.cssText || void 0 | |
}, | |
set: function(elem, value) { | |
return elem.style.cssText = value + "" | |
} | |
}); | |
var rfocusable = /^(?:input|select|textarea|button|object)$/i, | |
rclickable = /^(?:a|area)$/i; | |
jQuery.fn.extend({ | |
prop: function(name, value) { | |
return access(this, jQuery.prop, name, value, arguments.length > 1) | |
}, | |
removeProp: function(name) { | |
return name = jQuery.propFix[name] || name, this.each(function() { | |
try { | |
this[name] = void 0, delete this[name] | |
} catch (e) {} | |
}) | |
} | |
}), jQuery.extend({ | |
propFix: { | |
for: "htmlFor", | |
class: "className" | |
}, | |
prop: function(elem, name, value) { | |
var ret, hooks, notxml, nType = elem.nodeType; | |
if (elem && 3 !== nType && 8 !== nType && 2 !== nType) return notxml = 1 !== nType || !jQuery.isXMLDoc(elem), notxml && (name = jQuery.propFix[name] || name, hooks = jQuery.propHooks[name]), void 0 !== value ? hooks && "set" in hooks && void 0 !== (ret = hooks.set(elem, value, name)) ? ret : elem[name] = value : hooks && "get" in hooks && null !== (ret = hooks.get(elem, name)) ? ret : elem[name] | |
}, | |
propHooks: { | |
tabIndex: { | |
get: function(elem) { | |
var tabindex = jQuery.find.attr(elem, "tabindex"); | |
return tabindex ? parseInt(tabindex, 10) : rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? 0 : -1 | |
} | |
} | |
} | |
}), support.hrefNormalized || jQuery.each(["href", "src"], function(i, name) { | |
jQuery.propHooks[name] = { | |
get: function(elem) { | |
return elem.getAttribute(name, 4) | |
} | |
} | |
}), support.optSelected || (jQuery.propHooks.selected = { | |
get: function(elem) { | |
var parent = elem.parentNode; | |
return parent && (parent.selectedIndex, parent.parentNode && parent.parentNode.selectedIndex), null | |
} | |
}), jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { | |
jQuery.propFix[this.toLowerCase()] = this | |
}), support.enctype || (jQuery.propFix.enctype = "encoding"); | |
var rclass = /[\t\r\n\f]/g; | |
jQuery.fn.extend({ | |
addClass: function(value) { | |
var classes, elem, cur, clazz, j, finalValue, i = 0, | |
len = this.length, | |
proceed = "string" == typeof value && value; | |
if (jQuery.isFunction(value)) return this.each(function(j) { | |
jQuery(this).addClass(value.call(this, j, this.className)) | |
}); | |
if (proceed) | |
for (classes = (value || "").match(rnotwhite) || []; i < len; i++) | |
if (elem = this[i], cur = 1 === elem.nodeType && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : " ")) { | |
for (j = 0; clazz = classes[j++];) cur.indexOf(" " + clazz + " ") < 0 && (cur += clazz + " "); | |
finalValue = jQuery.trim(cur), elem.className !== finalValue && (elem.className = finalValue) | |
} | |
return this | |
}, | |
removeClass: function(value) { | |
var classes, elem, cur, clazz, j, finalValue, i = 0, | |
len = this.length, | |
proceed = 0 === arguments.length || "string" == typeof value && value; | |
if (jQuery.isFunction(value)) return this.each(function(j) { | |
jQuery(this).removeClass(value.call(this, j, this.className)) | |
}); | |
if (proceed) | |
for (classes = (value || "").match(rnotwhite) || []; i < len; i++) | |
if (elem = this[i], cur = 1 === elem.nodeType && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : "")) { | |
for (j = 0; clazz = classes[j++];) | |
for (; cur.indexOf(" " + clazz + " ") >= 0;) cur = cur.replace(" " + clazz + " ", " "); | |
finalValue = value ? jQuery.trim(cur) : "", elem.className !== finalValue && (elem.className = finalValue) | |
} | |
return this | |
}, | |
toggleClass: function(value, stateVal) { | |
var type = typeof value; | |
return "boolean" == typeof stateVal && "string" === type ? stateVal ? this.addClass(value) : this.removeClass(value) : jQuery.isFunction(value) ? this.each(function(i) { | |
jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal) | |
}) : this.each(function() { | |
if ("string" === type) | |
for (var className, i = 0, self = jQuery(this), classNames = value.match(rnotwhite) || []; className = classNames[i++];) self.hasClass(className) ? self.removeClass(className) : self.addClass(className); | |
else type !== strundefined && "boolean" !== type || (this.className && jQuery._data(this, "__className__", this.className), this.className = this.className || !1 === value ? "" : jQuery._data(this, "__className__") || "") | |
}) | |
}, | |
hasClass: function(selector) { | |
for (var className = " " + selector + " ", i = 0, l = this.length; i < l; i++) | |
if (1 === this[i].nodeType && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) return !0; | |
return !1 | |
} | |
}), jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(i, name) { | |
jQuery.fn[name] = function(data, fn) { | |
return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name) | |
} | |
}), jQuery.fn.extend({ | |
hover: function(fnOver, fnOut) { | |
return this.mouseenter(fnOver).mouseleave(fnOut || fnOver) | |
}, | |
bind: function(types, data, fn) { | |
return this.on(types, null, data, fn) | |
}, | |
unbind: function(types, fn) { | |
return this.off(types, null, fn) | |
}, | |
delegate: function(selector, types, data, fn) { | |
return this.on(types, selector, data, fn) | |
}, | |
undelegate: function(selector, types, fn) { | |
return 1 === arguments.length ? this.off(selector, "**") : this.off(types, selector || "**", fn) | |
} | |
}); | |
var nonce = jQuery.now(), | |
rquery = /\?/, | |
rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; | |
jQuery.parseJSON = function(data) { | |
if (window.JSON && window.JSON.parse) return window.JSON.parse(data + ""); | |
var requireNonComma, depth = null, | |
str = jQuery.trim(data + ""); | |
return str && !jQuery.trim(str.replace(rvalidtokens, function(token, comma, open, close) { | |
return requireNonComma && comma && (depth = 0), 0 === depth ? token : (requireNonComma = open || comma, depth += !close - !open, "") | |
})) ? Function("return " + str)() : jQuery.error("Invalid JSON: " + data) | |
}, jQuery.parseXML = function(data) { | |
var xml, tmp; | |
if (!data || "string" != typeof data) return null; | |
try { | |
window.DOMParser ? (tmp = new DOMParser, xml = tmp.parseFromString(data, "text/xml")) : (xml = new ActiveXObject("Microsoft.XMLDOM"), xml.async = "false", xml.loadXML(data)) | |
} catch (e) { | |
xml = void 0 | |
} | |
return xml && xml.documentElement && !xml.getElementsByTagName("parsererror").length || jQuery.error("Invalid XML: " + data), xml | |
}; | |
var ajaxLocParts, ajaxLocation, rhash = /#.*$/, | |
rts = /([?&])_=[^&]*/, | |
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, | |
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, | |
rnoContent = /^(?:GET|HEAD)$/, | |
rprotocol = /^\/\//, | |
rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, | |
prefilters = {}, | |
transports = {}, | |
allTypes = "*/".concat("*"); | |
try { | |
ajaxLocation = location.href | |
} catch (e) { | |
ajaxLocation = document.createElement("a"), ajaxLocation.href = "", ajaxLocation = ajaxLocation.href | |
} | |
ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [], jQuery.extend({ | |
active: 0, | |
lastModified: {}, | |
etag: {}, | |
ajaxSettings: { | |
url: ajaxLocation, | |
type: "GET", | |
isLocal: rlocalProtocol.test(ajaxLocParts[1]), | |
global: !0, | |
processData: !0, | |
async: !0, | |
contentType: "application/x-www-form-urlencoded; charset=UTF-8", | |
accepts: { | |
"*": allTypes, | |
text: "text/plain", | |
html: "text/html", | |
xml: "application/xml, text/xml", | |
json: "application/json, text/javascript" | |
}, | |
contents: { | |
xml: /xml/, | |
html: /html/, | |
json: /json/ | |
}, | |
responseFields: { | |
xml: "responseXML", | |
text: "responseText", | |
json: "responseJSON" | |
}, | |
converters: { | |
"* text": String, | |
"text html": !0, | |
"text json": jQuery.parseJSON, | |
"text xml": jQuery.parseXML | |
}, | |
flatOptions: { | |
url: !0, | |
context: !0 | |
} | |
}, | |
ajaxSetup: function(target, settings) { | |
return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target) | |
}, | |
ajaxPrefilter: addToPrefiltersOrTransports(prefilters), | |
ajaxTransport: addToPrefiltersOrTransports(transports), | |
ajax: function(url, options) { | |
function done(status, nativeStatusText, responses, headers) { | |
var isSuccess, success, error, response, modified, statusText = nativeStatusText; | |
2 !== state && (state = 2, timeoutTimer && clearTimeout(timeoutTimer), transport = void 0, responseHeadersString = headers || "", jqXHR.readyState = status > 0 ? 4 : 0, isSuccess = status >= 200 && status < 300 || 304 === status, responses && (response = ajaxHandleResponses(s, jqXHR, responses)), response = ajaxConvert(s, response, jqXHR, isSuccess), isSuccess ? (s.ifModified && (modified = jqXHR.getResponseHeader("Last-Modified"), modified && (jQuery.lastModified[cacheURL] = modified), (modified = jqXHR.getResponseHeader("etag")) && (jQuery.etag[cacheURL] = modified)), 204 === status || "HEAD" === s.type ? statusText = "nocontent" : 304 === status ? statusText = "notmodified" : (statusText = response.state, success = response.data, error = response.error, isSuccess = !error)) : (error = statusText, !status && statusText || (statusText = "error", status < 0 && (status = 0))), jqXHR.status = status, jqXHR.statusText = (nativeStatusText || statusText) + "", isSuccess ? deferred.resolveWith(callbackContext, [success, statusText, jqXHR]) : deferred.rejectWith(callbackContext, [jqXHR, statusText, error]), jqXHR.statusCode(statusCode), statusCode = void 0, fireGlobals && globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]), completeDeferred.fireWith(callbackContext, [jqXHR, statusText]), fireGlobals && (globalEventContext.trigger("ajaxComplete", [jqXHR, s]), --jQuery.active || jQuery.event.trigger("ajaxStop"))) | |
} | |
"object" == typeof url && (options = url, url = void 0), options = options || {}; | |
var parts, i, cacheURL, responseHeadersString, timeoutTimer, fireGlobals, transport, responseHeaders, s = jQuery.ajaxSetup({}, options), | |
callbackContext = s.context || s, | |
globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, | |
deferred = jQuery.Deferred(), | |
completeDeferred = jQuery.Callbacks("once memory"), | |
statusCode = s.statusCode || {}, | |
requestHeaders = {}, | |
requestHeadersNames = {}, | |
state = 0, | |
strAbort = "canceled", | |
jqXHR = { | |
readyState: 0, | |
getResponseHeader: function(key) { | |
var match; | |
if (2 === state) { | |
if (!responseHeaders) | |
for (responseHeaders = {}; match = rheaders.exec(responseHeadersString);) responseHeaders[match[1].toLowerCase()] = match[2]; | |
match = responseHeaders[key.toLowerCase()] | |
} | |
return null == match ? null : match | |
}, | |
getAllResponseHeaders: function() { | |
return 2 === state ? responseHeadersString : null | |
}, | |
setRequestHeader: function(name, value) { | |
var lname = name.toLowerCase(); | |
return state || (name = requestHeadersNames[lname] = requestHeadersNames[lname] || name, requestHeaders[name] = value), this | |
}, | |
overrideMimeType: function(type) { | |
return state || (s.mimeType = type), this | |
}, | |
statusCode: function(map) { | |
var code; | |
if (map) | |
if (state < 2) | |
for (code in map) statusCode[code] = [statusCode[code], map[code]]; | |
else jqXHR.always(map[jqXHR.status]); | |
return this | |
}, | |
abort: function(statusText) { | |
var finalText = statusText || strAbort; | |
return transport && transport.abort(finalText), done(0, finalText), this | |
} | |
}; | |
if (deferred.promise(jqXHR).complete = completeDeferred.add, jqXHR.success = jqXHR.done, jqXHR.error = jqXHR.fail, s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "").replace(rprotocol, ajaxLocParts[1] + "//"), s.type = options.method || options.type || s.method || s.type, s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""], null == s.crossDomain && (parts = rurl.exec(s.url.toLowerCase()), s.crossDomain = !(!parts || parts[1] === ajaxLocParts[1] && parts[2] === ajaxLocParts[2] && (parts[3] || ("http:" === parts[1] ? "80" : "443")) === (ajaxLocParts[3] || ("http:" === ajaxLocParts[1] ? "80" : "443")))), s.data && s.processData && "string" != typeof s.data && (s.data = jQuery.param(s.data, s.traditional)), inspectPrefiltersOrTransports(prefilters, s, options, jqXHR), 2 === state) return jqXHR; | |
fireGlobals = s.global, fireGlobals && 0 == jQuery.active++ && jQuery.event.trigger("ajaxStart"), s.type = s.type.toUpperCase(), s.hasContent = !rnoContent.test(s.type), cacheURL = s.url, s.hasContent || (s.data && (cacheURL = s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data, delete s.data), !1 === s.cache && (s.url = rts.test(cacheURL) ? cacheURL.replace(rts, "$1_=" + nonce++) : cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++)), s.ifModified && (jQuery.lastModified[cacheURL] && jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]), jQuery.etag[cacheURL] && jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL])), (s.data && s.hasContent && !1 !== s.contentType || options.contentType) && jqXHR.setRequestHeader("Content-Type", s.contentType), 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 && (!1 === s.beforeSend.call(callbackContext, jqXHR, s) || 2 === state)) return jqXHR.abort(); | |
strAbort = "abort"; | |
for (i in { | |
success: 1, | |
error: 1, | |
complete: 1 | |
}) jqXHR[i](s[i]); | |
if (transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR)) { | |
jqXHR.readyState = 1, fireGlobals && globalEventContext.trigger("ajaxSend", [jqXHR, s]), 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)) throw e; | |
done(-1, e) | |
} | |
} else done(-1, "No Transport"); | |
return jqXHR | |
}, | |
getJSON: function(url, data, callback) { | |
return jQuery.get(url, data, callback, "json") | |
}, | |
getScript: function(url, callback) { | |
return jQuery.get(url, void 0, callback, "script") | |
} | |
}), jQuery.each(["get", "post"], function(i, method) { | |
jQuery[method] = function(url, data, callback, type) { | |
return jQuery.isFunction(data) && (type = type || callback, callback = data, data = void 0), jQuery.ajax({ | |
url: url, | |
type: method, | |
dataType: type, | |
data: data, | |
success: callback | |
}) | |
} | |
}), jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) { | |
jQuery.fn[type] = function(fn) { | |
return this.on(type, fn) | |
} | |
}), jQuery._evalUrl = function(url) { | |
return jQuery.ajax({ | |
url: url, | |
type: "GET", | |
dataType: "script", | |
async: !1, | |
global: !1, | |
throws: !0 | |
}) | |
}, jQuery.fn.extend({ | |
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(!0); | |
this[0].parentNode && wrap.insertBefore(this[0]), wrap.map(function() { | |
for (var elem = this; elem.firstChild && 1 === elem.firstChild.nodeType;) elem = elem.firstChild; | |
return elem | |
}).append(this) | |
} | |
return this | |
}, | |
wrapInner: function(html) { | |
return jQuery.isFunction(html) ? this.each(function(i) { | |
jQuery(this).wrapInner(html.call(this, i)) | |
}) : this.each(function() { | |
var self = jQuery(this), | |
contents = self.contents(); | |
contents.length ? contents.wrapAll(html) : self.append(html) | |
}) | |
}, | |
wrap: function(html) { | |
var isFunction = jQuery.isFunction(html); | |
return this.each(function(i) { | |
jQuery(this).wrapAll(isFunction ? html.call(this, i) : html) | |
}) | |
}, | |
unwrap: function() { | |
return this.parent().each(function() { | |
jQuery.nodeName(this, "body") || jQuery(this).replaceWith(this.childNodes) | |
}).end() | |
} | |
}), jQuery.expr.filters.hidden = function(elem) { | |
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || !support.reliableHiddenOffsets() && "none" === (elem.style && elem.style.display || jQuery.css(elem, "display")) | |
}, jQuery.expr.filters.visible = function(elem) { | |
return !jQuery.expr.filters.hidden(elem) | |
}; | |
var r20 = /%20/g, | |
rbracket = /\[\]$/, | |
rCRLF = /\r?\n/g, | |
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, | |
rsubmittable = /^(?:input|select|textarea|keygen)/i; | |
jQuery.param = function(a, traditional) { | |
var prefix, s = [], | |
add = function(key, value) { | |
value = jQuery.isFunction(value) ? value() : null == value ? "" : value, s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value) | |
}; | |
if (void 0 === traditional && (traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional), 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, "+") | |
}, jQuery.fn.extend({ | |
serialize: function() { | |
return jQuery.param(this.serializeArray()) | |
}, | |
serializeArray: function() { | |
return this.map(function() { | |
var elements = jQuery.prop(this, "elements"); | |
return elements ? jQuery.makeArray(elements) : this | |
}).filter(function() { | |
var type = this.type; | |
return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)) | |
}).map(function(i, elem) { | |
var val = jQuery(this).val(); | |
return null == val ? null : jQuery.isArray(val) ? jQuery.map(val, function(val) { | |
return { | |
name: elem.name, | |
value: val.replace(rCRLF, "\r\n") | |
} | |
}) : { | |
name: elem.name, | |
value: val.replace(rCRLF, "\r\n") | |
} | |
}).get() | |
} | |
}), jQuery.ajaxSettings.xhr = void 0 !== window.ActiveXObject ? function() { | |
return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && createStandardXHR() || createActiveXHR() | |
} : createStandardXHR; | |
var xhrId = 0, | |
xhrCallbacks = {}, | |
xhrSupported = jQuery.ajaxSettings.xhr(); | |
window.ActiveXObject && jQuery(window).on("unload", function() { | |
for (var key in xhrCallbacks) xhrCallbacks[key](void 0, !0) | |
}), support.cors = !!xhrSupported && "withCredentials" in xhrSupported, xhrSupported = support.ajax = !!xhrSupported, xhrSupported && jQuery.ajaxTransport(function(options) { | |
if (!options.crossDomain || support.cors) { | |
var callback; | |
return { | |
send: function(headers, complete) { | |
var i, xhr = options.xhr(), | |
id = ++xhrId; | |
if (xhr.open(options.type, options.url, options.async, options.username, options.password), options.xhrFields) | |
for (i in options.xhrFields) xhr[i] = options.xhrFields[i]; | |
options.mimeType && xhr.overrideMimeType && xhr.overrideMimeType(options.mimeType), options.crossDomain || headers["X-Requested-With"] || (headers["X-Requested-With"] = "XMLHttpRequest"); | |
for (i in headers) void 0 !== headers[i] && xhr.setRequestHeader(i, headers[i] + ""); | |
xhr.send(options.hasContent && options.data || null), callback = function(_, isAbort) { | |
var status, statusText, responses; | |
if (callback && (isAbort || 4 === xhr.readyState)) | |
if (delete xhrCallbacks[id], callback = void 0, xhr.onreadystatechange = jQuery.noop, isAbort) 4 !== xhr.readyState && xhr.abort(); | |
else { | |
responses = {}, status = xhr.status, "string" == typeof xhr.responseText && (responses.text = xhr.responseText); | |
try { | |
statusText = xhr.statusText | |
} catch (e) { | |
statusText = "" | |
} | |
status || !options.isLocal || options.crossDomain ? 1223 === status && (status = 204) : status = responses.text ? 200 : 404 | |
} | |
responses && complete(status, statusText, responses, xhr.getAllResponseHeaders()) | |
}, options.async ? 4 === xhr.readyState ? setTimeout(callback) : xhr.onreadystatechange = xhrCallbacks[id] = callback : callback() | |
}, | |
abort: function() { | |
callback && callback(void 0, !0) | |
} | |
} | |
} | |
}), jQuery.ajaxSetup({ | |
accepts: { | |
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" | |
}, | |
contents: { | |
script: /(?:java|ecma)script/ | |
}, | |
converters: { | |
"text script": function(text) { | |
return jQuery.globalEval(text), text | |
} | |
} | |
}), jQuery.ajaxPrefilter("script", function(s) { | |
void 0 === s.cache && (s.cache = !1), s.crossDomain && (s.type = "GET", s.global = !1) | |
}), jQuery.ajaxTransport("script", function(s) { | |
if (s.crossDomain) { | |
var script, head = document.head || jQuery("head")[0] || document.documentElement; | |
return { | |
send: function(_, callback) { | |
script = document.createElement("script"), script.async = !0, s.scriptCharset && (script.charset = s.scriptCharset), script.src = s.url, script.onload = script.onreadystatechange = function(_, isAbort) { | |
(isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) && (script.onload = script.onreadystatechange = null, script.parentNode && script.parentNode.removeChild(script), script = null, isAbort || callback(200, "success")) | |
}, head.insertBefore(script, head.firstChild) | |
}, | |
abort: function() { | |
script && script.onload(void 0, !0) | |
} | |
} | |
} | |
}); | |
var oldCallbacks = [], | |
rjsonp = /(=)\?(?=&|$)|\?\?/; | |
jQuery.ajaxSetup({ | |
jsonp: "callback", | |
jsonpCallback: function() { | |
var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce++; | |
return this[callback] = !0, callback | |
} | |
}), jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) { | |
var callbackName, overwritten, responseContainer, jsonProp = !1 !== s.jsonp && (rjsonp.test(s.url) ? "url" : "string" == typeof s.data && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"); | |
if (jsonProp || "jsonp" === s.dataTypes[0]) return callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback, jsonProp ? s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName) : !1 !== s.jsonp && (s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName), s.converters["script json"] = function() { | |
return responseContainer || jQuery.error(callbackName + " was not called"), responseContainer[0] | |
}, s.dataTypes[0] = "json", overwritten = window[callbackName], window[callbackName] = function() { | |
responseContainer = arguments | |
}, jqXHR.always(function() { | |
window[callbackName] = overwritten, s[callbackName] && (s.jsonpCallback = originalSettings.jsonpCallback, oldCallbacks.push(callbackName)), responseContainer && jQuery.isFunction(overwritten) && overwritten(responseContainer[0]), responseContainer = overwritten = void 0 | |
}), "script" | |
}), jQuery.parseHTML = function(data, context, keepScripts) { | |
if (!data || "string" != typeof data) return null; | |
"boolean" == typeof context && (keepScripts = context, context = !1), context = context || document; | |
var parsed = rsingleTag.exec(data), | |
scripts = !keepScripts && []; | |
return parsed ? [context.createElement(parsed[1])] : (parsed = jQuery.buildFragment([data], context, scripts), scripts && scripts.length && jQuery(scripts).remove(), jQuery.merge([], parsed.childNodes)) | |
}; | |
var _load = jQuery.fn.load; | |
jQuery.fn.load = function(url, params, callback) { | |
if ("string" != typeof url && _load) return _load.apply(this, arguments); | |
var selector, response, type, self = this, | |
off = url.indexOf(" "); | |
return off >= 0 && (selector = jQuery.trim(url.slice(off, url.length)), url = url.slice(0, off)), jQuery.isFunction(params) ? (callback = params, params = void 0) : params && "object" == typeof params && (type = "POST"), self.length > 0 && jQuery.ajax({ | |
url: url, | |
type: type, | |
dataType: "html", | |
data: params | |
}).done(function(responseText) { | |
response = arguments, self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText) | |
}).complete(callback && function(jqXHR, status) { | |
self.each(callback, response || [jqXHR.responseText, status, jqXHR]) | |
}), this | |
}, jQuery.expr.filters.animated = function(elem) { | |
return jQuery.grep(jQuery.timers, function(fn) { | |
return elem === fn.elem | |
}).length | |
}; | |
var docElem = window.document.documentElement; | |
jQuery.offset = { | |
setOffset: function(elem, options, i) { | |
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), | |
curElem = jQuery(elem), | |
props = {}; | |
"static" === position && (elem.style.position = "relative"), curOffset = curElem.offset(), curCSSTop = jQuery.css(elem, "top"), curCSSLeft = jQuery.css(elem, "left"), calculatePosition = ("absolute" === position || "fixed" === position) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, calculatePosition ? (curPosition = curElem.position(), curTop = curPosition.top, curLeft = curPosition.left) : (curTop = parseFloat(curCSSTop) || 0, curLeft = parseFloat(curCSSLeft) || 0), jQuery.isFunction(options) && (options = options.call(elem, i, curOffset)), null != options.top && (props.top = options.top - curOffset.top + curTop), null != options.left && (props.left = options.left - curOffset.left + curLeft), "using" in options ? options.using.call(elem, props) : curElem.css(props) | |
} | |
}, jQuery.fn.extend({ | |
offset: function(options) { | |
if (arguments.length) return void 0 === options ? this : this.each(function(i) { | |
jQuery.offset.setOffset(this, options, i) | |
}); | |
var docElem, win, box = { | |
top: 0, | |
left: 0 | |
}, | |
elem = this[0], | |
doc = elem && elem.ownerDocument; | |
if (doc) return docElem = doc.documentElement, jQuery.contains(docElem, elem) ? (typeof elem.getBoundingClientRect !== strundefined && (box = elem.getBoundingClientRect()), win = getWindow(doc), { | |
top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), | |
left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) | |
}) : box | |
}, | |
position: function() { | |
if (this[0]) { | |
var offsetParent, offset, parentOffset = { | |
top: 0, | |
left: 0 | |
}, | |
elem = this[0]; | |
return "fixed" === jQuery.css(elem, "position") ? offset = elem.getBoundingClientRect() : (offsetParent = this.offsetParent(), offset = this.offset(), jQuery.nodeName(offsetParent[0], "html") || (parentOffset = offsetParent.offset()), parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", !0), parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", !0)), { | |
top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", !0), | |
left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", !0) | |
} | |
} | |
}, | |
offsetParent: function() { | |
return this.map(function() { | |
for (var offsetParent = this.offsetParent || docElem; offsetParent && !jQuery.nodeName(offsetParent, "html") && "static" === jQuery.css(offsetParent, "position");) offsetParent = offsetParent.offsetParent; | |
return offsetParent || docElem | |
}) | |
} | |
}), jQuery.each({ | |
scrollLeft: "pageXOffset", | |
scrollTop: "pageYOffset" | |
}, function(method, prop) { | |
var top = /Y/.test(prop); | |
jQuery.fn[method] = function(val) { | |
return access(this, function(elem, method, val) { | |
var win = getWindow(elem); | |
if (void 0 === val) return win ? prop in win ? win[prop] : win.document.documentElement[method] : elem[method]; | |
win ? win.scrollTo(top ? jQuery(win).scrollLeft() : val, top ? val : jQuery(win).scrollTop()) : elem[method] = val | |
}, method, val, arguments.length, null) | |
} | |
}), jQuery.each(["top", "left"], function(i, prop) { | |
jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function(elem, computed) { | |
if (computed) return computed = curCSS(elem, prop), rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed | |
}) | |
}), jQuery.each({ | |
Height: "height", | |
Width: "width" | |
}, function(name, type) { | |
jQuery.each({ | |
padding: "inner" + name, | |
content: type, | |
"": "outer" + name | |
}, function(defaultExtra, funcName) { | |
jQuery.fn[funcName] = function(margin, value) { | |
var chainable = arguments.length && (defaultExtra || "boolean" != typeof margin), | |
extra = defaultExtra || (!0 === margin || !0 === value ? "margin" : "border"); | |
return access(this, function(elem, type, value) { | |
var doc; | |
return jQuery.isWindow(elem) ? elem.document.documentElement["client" + name] : 9 === elem.nodeType ? (doc = elem.documentElement, Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name])) : void 0 === value ? jQuery.css(elem, type, extra) : jQuery.style(elem, type, value, extra) | |
}, type, chainable ? margin : void 0, chainable, null) | |
} | |
}) | |
}), jQuery.fn.size = function() { | |
return this.length | |
}, jQuery.fn.andSelf = jQuery.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function() { | |
return jQuery | |
}); | |
var _jQuery = window.jQuery, | |
_$ = window.$; | |
return jQuery.noConflict = function(deep) { | |
return window.$ === jQuery && (window.$ = _$), deep && window.jQuery === jQuery && (window.jQuery = _jQuery), jQuery | |
}, typeof noGlobal === strundefined && (window.jQuery = window.$ = jQuery), jQuery | |
}), | |
function() { | |
var n = this, | |
t = n._, | |
r = Array.prototype, | |
e = Object.prototype, | |
u = Function.prototype, | |
i = r.push, | |
a = r.slice, | |
o = r.concat, | |
l = e.toString, | |
c = e.hasOwnProperty, | |
f = Array.isArray, | |
s = Object.keys, | |
p = u.bind, | |
h = function(n) { | |
return n instanceof h ? n : this instanceof h ? void(this._wrapped = n) : new h(n) | |
}; | |
"undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = h), exports._ = h) : n._ = h, h.VERSION = "1.7.0"; | |
var g = function(n, t, r) { | |
if (void 0 === t) return n; | |
switch (null == r ? 3 : r) { | |
case 1: | |
return function(r) { | |
return n.call(t, r) | |
}; | |
case 2: | |
return function(r, e) { | |
return n.call(t, r, e) | |
}; | |
case 3: | |
return function(r, e, u) { | |
return n.call(t, r, e, u) | |
}; | |
case 4: | |
return function(r, e, u, i) { | |
return n.call(t, r, e, u, i) | |
} | |
} | |
return function() { | |
return n.apply(t, arguments) | |
} | |
}; | |
h.iteratee = function(n, t, r) { | |
return null == n ? h.identity : h.isFunction(n) ? g(n, t, r) : h.isObject(n) ? h.matches(n) : h.property(n) | |
}, h.each = h.forEach = function(n, t, r) { | |
if (null == n) return n; | |
t = g(t, r); | |
var e, u = n.length; | |
if (u === +u) | |
for (e = 0; u > e; e++) t(n[e], e, n); | |
else { | |
var i = h.keys(n); | |
for (e = 0, u = i.length; u > e; e++) t(n[i[e]], i[e], n) | |
} | |
return n | |
}, h.map = h.collect = function(n, t, r) { | |
if (null == n) return []; | |
t = h.iteratee(t, r); | |
for (var e, u = n.length !== +n.length && h.keys(n), i = (u || n).length, a = Array(i), o = 0; i > o; o++) e = u ? u[o] : o, a[o] = t(n[e], e, n); | |
return a | |
}; | |
var v = "Reduce of empty array with no initial value"; | |
h.reduce = h.foldl = h.inject = function(n, t, r, e) { | |
null == n && (n = []), t = g(t, e, 4); | |
var u, i = n.length !== +n.length && h.keys(n), | |
a = (i || n).length, | |
o = 0; | |
if (arguments.length < 3) { | |
if (!a) throw new TypeError(v); | |
r = n[i ? i[o++] : o++] | |
} | |
for (; a > o; o++) u = i ? i[o] : o, r = t(r, n[u], u, n); | |
return r | |
}, h.reduceRight = h.foldr = function(n, t, r, e) { | |
null == n && (n = []), t = g(t, e, 4); | |
var u, i = n.length !== +n.length && h.keys(n), | |
a = (i || n).length; | |
if (arguments.length < 3) { | |
if (!a) throw new TypeError(v); | |
r = n[i ? i[--a] : --a] | |
} | |
for (; a--;) u = i ? i[a] : a, r = t(r, n[u], u, n); | |
return r | |
}, h.find = h.detect = function(n, t, r) { | |
var e; | |
return t = h.iteratee(t, r), h.some(n, function(n, r, u) { | |
return t(n, r, u) ? (e = n, !0) : void 0 | |
}), e | |
}, h.filter = h.select = function(n, t, r) { | |
var e = []; | |
return null == n ? e : (t = h.iteratee(t, r), h.each(n, function(n, r, u) { | |
t(n, r, u) && e.push(n) | |
}), e) | |
}, h.reject = function(n, t, r) { | |
return h.filter(n, h.negate(h.iteratee(t)), r) | |
}, h.every = h.all = function(n, t, r) { | |
if (null == n) return !0; | |
t = h.iteratee(t, r); | |
var e, u, i = n.length !== +n.length && h.keys(n), | |
a = (i || n).length; | |
for (e = 0; a > e; e++) | |
if (u = i ? i[e] : e, !t(n[u], u, n)) return !1; | |
return !0 | |
}, h.some = h.any = function(n, t, r) { | |
if (null == n) return !1; | |
t = h.iteratee(t, r); | |
var e, u, i = n.length !== +n.length && h.keys(n), | |
a = (i || n).length; | |
for (e = 0; a > e; e++) | |
if (u = i ? i[e] : e, t(n[u], u, n)) return !0; | |
return !1 | |
}, h.contains = h.include = function(n, t) { | |
return null != n && (n.length !== +n.length && (n = h.values(n)), h.indexOf(n, t) >= 0) | |
}, h.invoke = function(n, t) { | |
var r = a.call(arguments, 2), | |
e = h.isFunction(t); | |
return h.map(n, function(n) { | |
return (e ? t : n[t]).apply(n, r) | |
}) | |
}, h.pluck = function(n, t) { | |
return h.map(n, h.property(t)) | |
}, h.where = function(n, t) { | |
return h.filter(n, h.matches(t)) | |
}, h.findWhere = function(n, t) { | |
return h.find(n, h.matches(t)) | |
}, h.max = function(n, t, r) { | |
var e, u, i = -1 / 0, | |
a = -1 / 0; | |
if (null == t && null != n) { | |
n = n.length === +n.length ? n : h.values(n); | |
for (var o = 0, l = n.length; l > o; o++)(e = n[o]) > i && (i = e) | |
} else t = h.iteratee(t, r), h.each(n, function(n, r, e) { | |
((u = t(n, r, e)) > a || u === -1 / 0 && i === -1 / 0) && (i = n, a = u) | |
}); | |
return i | |
}, h.min = function(n, t, r) { | |
var e, u, i = 1 / 0, | |
a = 1 / 0; | |
if (null == t && null != n) { | |
n = n.length === +n.length ? n : h.values(n); | |
for (var o = 0, l = n.length; l > o; o++) e = n[o], i > e && (i = e) | |
} else t = h.iteratee(t, r), h.each(n, function(n, r, e) { | |
u = t(n, r, e), (a > u || 1 / 0 === u && 1 / 0 === i) && (i = n, a = u) | |
}); | |
return i | |
}, h.shuffle = function(n) { | |
for (var t, r = n && n.length === +n.length ? n : h.values(n), e = r.length, u = Array(e), i = 0; e > i; i++) t = h.random(0, i), t !== i && (u[i] = u[t]), u[t] = r[i]; | |
return u | |
}, h.sample = function(n, t, r) { | |
return null == t || r ? (n.length !== +n.length && (n = h.values(n)), n[h.random(n.length - 1)]) : h.shuffle(n).slice(0, Math.max(0, t)) | |
}, h.sortBy = function(n, t, r) { | |
return t = h.iteratee(t, r), h.pluck(h.map(n, function(n, r, e) { | |
return { | |
value: n, | |
index: r, | |
criteria: t(n, r, e) | |
} | |
}).sort(function(n, t) { | |
var r = n.criteria, | |
e = t.criteria; | |
if (r !== e) { | |
if (r > e || void 0 === r) return 1; | |
if (e > r || void 0 === e) return -1 | |
} | |
return n.index - t.index | |
}), "value") | |
}; | |
var m = function(n) { | |
return function(t, r, e) { | |
var u = {}; | |
return r = h.iteratee(r, e), h.each(t, function(e, i) { | |
var a = r(e, i, t); | |
n(u, e, a) | |
}), u | |
} | |
}; | |
h.groupBy = m(function(n, t, r) { | |
h.has(n, r) ? n[r].push(t) : n[r] = [t] | |
}), h.indexBy = m(function(n, t, r) { | |
n[r] = t | |
}), h.countBy = m(function(n, t, r) { | |
h.has(n, r) ? n[r]++ : n[r] = 1 | |
}), h.sortedIndex = function(n, t, r, e) { | |
r = h.iteratee(r, e, 1); | |
for (var u = r(t), i = 0, a = n.length; a > i;) { | |
var o = i + a >>> 1; | |
r(n[o]) < u ? i = o + 1 : a = o | |
} | |
return i | |
}, h.toArray = function(n) { | |
return n ? h.isArray(n) ? a.call(n) : n.length === +n.length ? h.map(n, h.identity) : h.values(n) : [] | |
}, h.size = function(n) { | |
return null == n ? 0 : n.length === +n.length ? n.length : h.keys(n).length | |
}, h.partition = function(n, t, r) { | |
t = h.iteratee(t, r); | |
var e = [], | |
u = []; | |
return h.each(n, function(n, r, i) { | |
(t(n, r, i) ? e : u).push(n) | |
}), [e, u] | |
}, h.first = h.head = h.take = function(n, t, r) { | |
return null == n ? void 0 : null == t || r ? n[0] : 0 > t ? [] : a.call(n, 0, t) | |
}, h.initial = function(n, t, r) { | |
return a.call(n, 0, Math.max(0, n.length - (null == t || r ? 1 : t))) | |
}, h.last = function(n, t, r) { | |
return null == n ? void 0 : null == t || r ? n[n.length - 1] : a.call(n, Math.max(n.length - t, 0)) | |
}, h.rest = h.tail = h.drop = function(n, t, r) { | |
return a.call(n, null == t || r ? 1 : t) | |
}, h.compact = function(n) { | |
return h.filter(n, h.identity) | |
}; | |
var y = function(n, t, r, e) { | |
if (t && h.every(n, h.isArray)) return o.apply(e, n); | |
for (var u = 0, a = n.length; a > u; u++) { | |
var l = n[u]; | |
h.isArray(l) || h.isArguments(l) ? t ? i.apply(e, l) : y(l, t, r, e) : r || e.push(l) | |
} | |
return e | |
}; | |
h.flatten = function(n, t) { | |
return y(n, t, !1, []) | |
}, h.without = function(n) { | |
return h.difference(n, a.call(arguments, 1)) | |
}, h.uniq = h.unique = function(n, t, r, e) { | |
if (null == n) return []; | |
h.isBoolean(t) || (e = r, r = t, t = !1), null != r && (r = h.iteratee(r, e)); | |
for (var u = [], i = [], a = 0, o = n.length; o > a; a++) { | |
var l = n[a]; | |
if (t) a && i === l || u.push(l), i = l; | |
else if (r) { | |
var c = r(l, a, n); | |
h.indexOf(i, c) < 0 && (i.push(c), u.push(l)) | |
} else h.indexOf(u, l) < 0 && u.push(l) | |
} | |
return u | |
}, h.union = function() { | |
return h.uniq(y(arguments, !0, !0, [])) | |
}, h.intersection = function(n) { | |
if (null == n) return []; | |
for (var t = [], r = arguments.length, e = 0, u = n.length; u > e; e++) { | |
var i = n[e]; | |
if (!h.contains(t, i)) { | |
for (var a = 1; r > a && h.contains(arguments[a], i); a++); | |
a === r && t.push(i) | |
} | |
} | |
return t | |
}, h.difference = function(n) { | |
var t = y(a.call(arguments, 1), !0, !0, []); | |
return h.filter(n, function(n) { | |
return !h.contains(t, n) | |
}) | |
}, h.zip = function(n) { | |
if (null == n) return []; | |
for (var t = h.max(arguments, "length").length, r = Array(t), e = 0; t > e; e++) r[e] = h.pluck(arguments, e); | |
return r | |
}, h.object = function(n, t) { | |
if (null == n) return {}; | |
for (var r = {}, e = 0, u = n.length; u > e; e++) t ? r[n[e]] = t[e] : r[n[e][0]] = n[e][1]; | |
return r | |
}, h.indexOf = function(n, t, r) { | |
if (null == n) return -1; | |
var e = 0, | |
u = n.length; | |
if (r) { | |
if ("number" != typeof r) return e = h.sortedIndex(n, t), n[e] === t ? e : -1; | |
e = 0 > r ? Math.max(0, u + r) : r | |
} | |
for (; u > e; e++) | |
if (n[e] === t) return e; | |
return -1 | |
}, h.lastIndexOf = function(n, t, r) { | |
if (null == n) return -1; | |
var e = n.length; | |
for ("number" == typeof r && (e = 0 > r ? e + r + 1 : Math.min(e, r + 1)); --e >= 0;) | |
if (n[e] === t) return e; | |
return -1 | |
}, h.range = function(n, t, r) { | |
arguments.length <= 1 && (t = n || 0, n = 0), r = r || 1; | |
for (var e = Math.max(Math.ceil((t - n) / r), 0), u = Array(e), i = 0; e > i; i++, n += r) u[i] = n; | |
return u | |
}; | |
var d = function() {}; | |
h.bind = function(n, t) { | |
var r, e; | |
if (p && n.bind === p) return p.apply(n, a.call(arguments, 1)); | |
if (!h.isFunction(n)) throw new TypeError("Bind must be called on a function"); | |
return r = a.call(arguments, 2), e = function() { | |
if (!(this instanceof e)) return n.apply(t, r.concat(a.call(arguments))); | |
d.prototype = n.prototype; | |
var u = new d; | |
d.prototype = null; | |
var i = n.apply(u, r.concat(a.call(arguments))); | |
return h.isObject(i) ? i : u | |
} | |
}, h.partial = function(n) { | |
var t = a.call(arguments, 1); | |
return function() { | |
for (var r = 0, e = t.slice(), u = 0, i = e.length; i > u; u++) e[u] === h && (e[u] = arguments[r++]); | |
for (; r < arguments.length;) e.push(arguments[r++]); | |
return n.apply(this, e) | |
} | |
}, h.bindAll = function(n) { | |
var t, r, e = arguments.length; | |
if (1 >= e) throw new Error("bindAll must be passed function names"); | |
for (t = 1; e > t; t++) r = arguments[t], n[r] = h.bind(n[r], n); | |
return n | |
}, h.memoize = function(n, t) { | |
var r = function(e) { | |
var u = r.cache, | |
i = t ? t.apply(this, arguments) : e; | |
return h.has(u, i) || (u[i] = n.apply(this, arguments)), u[i] | |
}; | |
return r.cache = {}, r | |
}, h.delay = function(n, t) { | |
var r = a.call(arguments, 2); | |
return setTimeout(function() { | |
return n.apply(null, r) | |
}, t) | |
}, h.defer = function(n) { | |
return h.delay.apply(h, [n, 1].concat(a.call(arguments, 1))) | |
}, h.throttle = function(n, t, r) { | |
var e, u, i, a = null, | |
o = 0; | |
r || (r = {}); | |
var l = function() { | |
o = !1 === r.leading ? 0 : h.now(), a = null, i = n.apply(e, u), a || (e = u = null) | |
}; | |
return function() { | |
var c = h.now(); | |
o || !1 !== r.leading || (o = c); | |
var f = t - (c - o); | |
return e = this, u = arguments, 0 >= f || f > t ? (clearTimeout(a), a = null, o = c, i = n.apply(e, u), a || (e = u = null)) : a || !1 === r.trailing || (a = setTimeout(l, f)), i | |
} | |
}, h.debounce = function(n, t, r) { | |
var e, u, i, a, o, l = function() { | |
var c = h.now() - a; | |
t > c && c > 0 ? e = setTimeout(l, t - c) : (e = null, r || (o = n.apply(i, u), e || (i = u = null))) | |
}; | |
return function() { | |
i = this, u = arguments, a = h.now(); | |
var c = r && !e; | |
return e || (e = setTimeout(l, t)), c && (o = n.apply(i, u), i = u = null), o | |
} | |
}, h.wrap = function(n, t) { | |
return h.partial(t, n) | |
}, h.negate = function(n) { | |
return function() { | |
return !n.apply(this, arguments) | |
} | |
}, h.compose = function() { | |
var n = arguments, | |
t = n.length - 1; | |
return function() { | |
for (var r = t, e = n[t].apply(this, arguments); r--;) e = n[r].call(this, e); | |
return e | |
} | |
}, h.after = function(n, t) { | |
return function() { | |
return --n < 1 ? t.apply(this, arguments) : void 0 | |
} | |
}, h.before = function(n, t) { | |
var r; | |
return function() { | |
return --n > 0 ? r = t.apply(this, arguments) : t = null, r | |
} | |
}, h.once = h.partial(h.before, 2), h.keys = function(n) { | |
if (!h.isObject(n)) return []; | |
if (s) return s(n); | |
var t = []; | |
for (var r in n) h.has(n, r) && t.push(r); | |
return t | |
}, h.values = function(n) { | |
for (var t = h.keys(n), r = t.length, e = Array(r), u = 0; r > u; u++) e[u] = n[t[u]]; | |
return e | |
}, h.pairs = function(n) { | |
for (var t = h.keys(n), r = t.length, e = Array(r), u = 0; r > u; u++) e[u] = [t[u], n[t[u]]]; | |
return e | |
}, h.invert = function(n) { | |
for (var t = {}, r = h.keys(n), e = 0, u = r.length; u > e; e++) t[n[r[e]]] = r[e]; | |
return t | |
}, h.functions = h.methods = function(n) { | |
var t = []; | |
for (var r in n) h.isFunction(n[r]) && t.push(r); | |
return t.sort() | |
}, h.extend = function(n) { | |
if (!h.isObject(n)) return n; | |
for (var t, r, e = 1, u = arguments.length; u > e; e++) { | |
t = arguments[e]; | |
for (r in t) c.call(t, r) && (n[r] = t[r]) | |
} | |
return n | |
}, h.pick = function(n, t, r) { | |
var e, u = {}; | |
if (null == n) return u; | |
if (h.isFunction(t)) { | |
t = g(t, r); | |
for (e in n) { | |
var i = n[e]; | |
t(i, e, n) && (u[e] = i) | |
} | |
} else { | |
var l = o.apply([], a.call(arguments, 1)); | |
n = new Object(n); | |
for (var c = 0, f = l.length; f > c; c++)(e = l[c]) in n && (u[e] = n[e]) | |
} | |
return u | |
}, h.omit = function(n, t, r) { | |
if (h.isFunction(t)) t = h.negate(t); | |
else { | |
var e = h.map(o.apply([], a.call(arguments, 1)), String); | |
t = function(n, t) { | |
return !h.contains(e, t) | |
} | |
} | |
return h.pick(n, t, r) | |
}, h.defaults = function(n) { | |
if (!h.isObject(n)) return n; | |
for (var t = 1, r = arguments.length; r > t; t++) { | |
var e = arguments[t]; | |
for (var u in e) void 0 === n[u] && (n[u] = e[u]) | |
} | |
return n | |
}, h.clone = function(n) { | |
return h.isObject(n) ? h.isArray(n) ? n.slice() : h.extend({}, n) : n | |
}, h.tap = function(n, t) { | |
return t(n), n | |
}; | |
var b = function(n, t, r, e) { | |
if (n === t) return 0 !== n || 1 / n == 1 / t; | |
if (null == n || null == t) return n === t; | |
n instanceof h && (n = n._wrapped), t instanceof h && (t = t._wrapped); | |
var u = l.call(n); | |
if (u !== l.call(t)) return !1; | |
switch (u) { | |
case "[object RegExp]": | |
case "[object String]": | |
return "" + n == "" + t; | |
case "[object Number]": | |
return +n != +n ? +t != +t : 0 == +n ? 1 / +n == 1 / t : +n == +t; | |
case "[object Date]": | |
case "[object Boolean]": | |
return +n == +t | |
} | |
if ("object" != typeof n || "object" != typeof t) return !1; | |
for (var i = r.length; i--;) | |
if (r[i] === n) return e[i] === t; | |
var a = n.constructor, | |
o = t.constructor; | |
if (a !== o && "constructor" in n && "constructor" in t && !(h.isFunction(a) && a instanceof a && h.isFunction(o) && o instanceof o)) return !1; | |
r.push(n), e.push(t); | |
var c, f; | |
if ("[object Array]" === u) { | |
if (c = n.length, f = c === t.length) | |
for (; c-- && (f = b(n[c], t[c], r, e));); | |
} else { | |
var s, p = h.keys(n); | |
if (c = p.length, f = h.keys(t).length === c) | |
for (; c-- && (s = p[c], f = h.has(t, s) && b(n[s], t[s], r, e));); | |
} | |
return r.pop(), e.pop(), f | |
}; | |
h.isEqual = function(n, t) { | |
return b(n, t, [], []) | |
}, h.isEmpty = function(n) { | |
if (null == n) return !0; | |
if (h.isArray(n) || h.isString(n) || h.isArguments(n)) return 0 === n.length; | |
for (var t in n) | |
if (h.has(n, t)) return !1; | |
return !0 | |
}, h.isElement = function(n) { | |
return !(!n || 1 !== n.nodeType) | |
}, h.isArray = f || function(n) { | |
return "[object Array]" === l.call(n) | |
}, h.isObject = function(n) { | |
var t = typeof n; | |
return "function" === t || "object" === t && !!n | |
}, h.each(["Arguments", "Function", "String", "Number", "Date", "RegExp"], function(n) { | |
h["is" + n] = function(t) { | |
return l.call(t) === "[object " + n + "]" | |
} | |
}), h.isArguments(arguments) || (h.isArguments = function(n) { | |
return h.has(n, "callee") | |
}), "function" != typeof /./ && (h.isFunction = function(n) { | |
return "function" == typeof n || !1 | |
}), h.isFinite = function(n) { | |
return isFinite(n) && !isNaN(parseFloat(n)) | |
}, h.isNaN = function(n) { | |
return h.isNumber(n) && n !== +n | |
}, h.isBoolean = function(n) { | |
return !0 === n || !1 === n || "[object Boolean]" === l.call(n) | |
}, h.isNull = function(n) { | |
return null === n | |
}, h.isUndefined = function(n) { | |
return void 0 === n | |
}, h.has = function(n, t) { | |
return null != n && c.call(n, t) | |
}, h.noConflict = function() { | |
return n._ = t, this | |
}, h.identity = function(n) { | |
return n | |
}, h.constant = function(n) { | |
return function() { | |
return n | |
} | |
}, h.noop = function() {}, h.property = function(n) { | |
return function(t) { | |
return t[n] | |
} | |
}, h.matches = function(n) { | |
var t = h.pairs(n), | |
r = t.length; | |
return function(n) { | |
if (null == n) return !r; | |
n = new Object(n); | |
for (var e = 0; r > e; e++) { | |
var u = t[e], | |
i = u[0]; | |
if (u[1] !== n[i] || !(i in n)) return !1 | |
} | |
return !0 | |
} | |
}, h.times = function(n, t, r) { | |
var e = Array(Math.max(0, n)); | |
t = g(t, r, 1); | |
for (var u = 0; n > u; u++) e[u] = t(u); | |
return e | |
}, h.random = function(n, t) { | |
return null == t && (t = n, n = 0), n + Math.floor(Math.random() * (t - n + 1)) | |
}, h.now = Date.now || function() { | |
return (new Date).getTime() | |
}; | |
var _ = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
'"': """, | |
"'": "'", | |
"`": "`" | |
}, | |
w = h.invert(_), | |
j = function(n) { | |
var t = function(t) { | |
return n[t] | |
}, | |
r = "(?:" + h.keys(n).join("|") + ")", | |
e = RegExp(r), | |
u = RegExp(r, "g"); | |
return function(n) { | |
return n = null == n ? "" : "" + n, e.test(n) ? n.replace(u, t) : n | |
} | |
}; | |
h.escape = j(_), h.unescape = j(w), h.result = function(n, t) { | |
if (null != n) { | |
var r = n[t]; | |
return h.isFunction(r) ? n[t]() : r | |
} | |
}; | |
var x = 0; | |
h.uniqueId = function(n) { | |
var t = ++x + ""; | |
return n ? n + t : t | |
}, h.templateSettings = { | |
evaluate: /<%([\s\S]+?)%>/g, | |
interpolate: /<%=([\s\S]+?)%>/g, | |
escape: /<%-([\s\S]+?)%>/g | |
}; | |
var A = /(.)^/, | |
k = { | |
"'": "'", | |
"\\": "\\", | |
"\r": "r", | |
"\n": "n", | |
"\u2028": "u2028", | |
"\u2029": "u2029" | |
}, | |
O = /\\|'|\r|\n|\u2028|\u2029/g, | |
F = function(n) { | |
return "\\" + k[n] | |
}; | |
h.template = function(n, t, r) { | |
!t && r && (t = r), t = h.defaults({}, t, h.templateSettings); | |
var e = RegExp([(t.escape || A).source, (t.interpolate || A).source, (t.evaluate || A).source].join("|") + "|$", "g"), | |
u = 0, | |
i = "__p+='"; | |
n.replace(e, function(t, r, e, a, o) { | |
return i += n.slice(u, o).replace(O, F), u = o + t.length, r ? i += "'+\n((__t=(" + r + "))==null?'':_.escape(__t))+\n'" : e ? i += "'+\n((__t=(" + e + "))==null?'':__t)+\n'" : a && (i += "';\n" + a + "\n__p+='"), t | |
}), i += "';\n", t.variable || (i = "with(obj||{}){\n" + i + "}\n"), i = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + i + "return __p;\n"; | |
try { | |
var a = new Function(t.variable || "obj", "_", i) | |
} catch (o) { | |
throw o.source = i, o | |
} | |
var l = function(n) { | |
return a.call(this, n, h) | |
}, | |
c = t.variable || "obj"; | |
return l.source = "function(" + c + "){\n" + i + "}", l | |
}, h.chain = function(n) { | |
var t = h(n); | |
return t._chain = !0, t | |
}; | |
var E = function(n) { | |
return this._chain ? h(n).chain() : n | |
}; | |
h.mixin = function(n) { | |
h.each(h.functions(n), function(t) { | |
var r = h[t] = n[t]; | |
h.prototype[t] = function() { | |
var n = [this._wrapped]; | |
return i.apply(n, arguments), E.call(this, r.apply(h, n)) | |
} | |
}) | |
}, h.mixin(h), h.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(n) { | |
var t = r[n]; | |
h.prototype[n] = function() { | |
var r = this._wrapped; | |
return t.apply(r, arguments), "shift" !== n && "splice" !== n || 0 !== r.length || delete r[0], E.call(this, r) | |
} | |
}), h.each(["concat", "join", "slice"], function(n) { | |
var t = r[n]; | |
h.prototype[n] = function() { | |
return E.call(this, t.apply(this._wrapped, arguments)) | |
} | |
}), h.prototype.value = function() { | |
return this._wrapped | |
}, "function" == typeof define && define.amd && define("underscore", [], function() { | |
return h | |
}) | |
}.call(this); | |
var Keys = { | |
"C Major": ["C", "Cmaj7", "Dm", "Dm7", "Em", "Em7", "F", "Fmaj7", "G", "G7", "Am", "Am7", "Bdim"], | |
"C# Major": ["C#", "C#maj7", "D#m", "D#m7", "E#m", "E#m7", "F#", "F#maj7", "G#", "G#7", "A#m", "A#m7", "B#dim"], | |
"Db Major": ["Db", "Dbmaj7", "Ebm", "Ebm7", "Fm", "Fm7", "Gb", "Gbmaj7", "Ab", "Ab7", "Bbm", "Bbm7", "Cdim"], | |
"D Major": ["D", "Dmaj7", "Em", "Em7", "F#m", "F#m7", "G", "Gmaj7", "A", "A7", "Bm", "Bm7", "C#dim"], | |
"D# Major": ["D#", "D#maj7", "E#m", "E#m7", "F##m", "F##m7", "G#", "G#maj7", "A#", "A#7", "B#m", "B#m7", "C##dim"], | |
"Eb Major": ["Eb", "Ebmaj7", "Fm", "Fm7", "Gm", "Gm7", "Ab", "Abmaj7", "Bb", "Bb7", "Cm", "Cm7", "Ddim"], | |
"E Major": ["E", "Emaj7", "F#m", "F#m7", "G#m", "G#m7", "A", "Amaj7", "B", "B7", "C#m", "C#m7", "D#dim"], | |
"F Major": ["F", "Fmaj7", "Gm", "Gm7", "Am", "Am7", "Bb", "Bbmaj7", "C", "C7", "Dm", "Dm7", "Edim"], | |
"F# Major": ["F#", "F#maj7", "G#m", "G#m7", "A#m", "A#m7", "B", "Bmaj7", "C#", "C#7", "D#m", "D#m7", "E#dim"], | |
"Gb Major": ["Gb", "Gbmaj7", "Abm", "Abm7", "Bbm", "Bbm7", "Cb", "Cbmaj7", "Db", "Db7", "Ebm", "Ebm7", "Fdim"], | |
"G Major": ["G", "Gmaj7", "Am", "Am7", "Bm", "Bm7", "C", "Cmaj7", "D", "D7", "Em", "Em7", "F#dim"], | |
"G# Major": ["G#", "G#maj7", "A#m", "A#m7", "B#m", "B#m7", "C#", "C#maj7", "D#", "D#7", "E#m", "E#m7", "F##dim"], | |
"Ab Major": ["Ab", "Abmaj7", "Bbm", "Bbm7", "Cm", "Cm7", "Db", "Dbmaj7", "Eb", "Eb7", "Fm", "Fm7", "Gdim"], | |
"A Major": ["A", "Amaj7", "Bm", "Bm7", "C#m", "C#m7", "D", "Dmaj7", "E", "E7", "F#m", "F#m7", "G#dim"], | |
"A# Major": ["A#", "A#maj7", "B#m", "B#m7", "C##m", "C##m7", "D#", "D#maj7", "E#", "E#7", "F##m", "F##m7", "G##dim"], | |
"Bb Major": ["Bb", "Bbmaj7", "Cm", "Cm7", "Dm", "Dm7", "Eb", "Ebmaj7", "F", "F7", "Gm", "Gm7", "Adim"], | |
"B Major": ["B", "Bmaj7", "C#m", "C#m7", "D#m", "D#m7", "E", "Emaj7", "F#", "F#7", "G#m", "G#m7", "A#dim"], | |
"C Minor": ["Eb", "Ebmaj7", "Fm", "Fm7", "Gm", "Gm7", "G", "G7", "Ab", "Abmaj7", "Bb", "Bb7", "Cm", "Cm7", "Ddim"], | |
"G Minor": ["Bb", "Bbmaj7", "Cm", "Cm7", "Dm", "Dm7", "D", "D7", "Eb", "Ebmaj7", "F", "F7", "Gm", "Gm7", "Adim"], | |
"D Minor": ["F", "Fmaj7", "Gm", "Gm7", "Am", "Am7", "A", "A7", "Bb", "Bbmaj7", "C", "C7", "Dm", "Dm7", "Edim"], | |
"A Minor": ["C", "Cmaj7", "Dm", "Dm7", "Em", "Em7", "E", "E7", "F", "Fmaj7", "G", "G7", "Am", "Am7", "Bdim"], | |
"E Minor": ["G", "Gmaj7", "Am", "Am7", "Bm", "Bm7", "B", "B7", "C", "Cmaj7", "D", "D7", "Em", "Em7", "F#dim"], | |
"B Minor": ["D", "Dmaj7", "Em", "Em7", "F#m", "F#m7", "F#", "F#7", "G", "Gmaj7", "A", "A7", "Bm", "Bm7", "C#dim"], | |
"F# Minor": ["A", "Amaj7", "Bm", "Bm7", "C#m", "C#m7", "C#", "C#7", "D", "Dmaj7", "E", "E7", "F#m", "F#m7", "G#dim"], | |
"C# Minor": ["E", "Emaj7", "F#m", "F#m7", "G#m", "G#m7", "G#", "G#7", "A", "Amaj7", "B", "B7", "C#m", "C#m7", "D#dim"], | |
"Db Minor": ["E", "Emaj7", "F#m", "F#m7", "G#m", "G#m7", "G#", "G#7", "A", "Amaj7", "B", "B7", "C#m", "C#m7", "D#dim"], | |
"Ab Minor": ["B", "Bmaj7", "C#m", "C#m7", "D#m", "D#m7", "D#", "D#7", "E", "Emaj7", "F#", "F#7", "G#m", "G#m7", "A#dim"], | |
"Eb Minor": ["Gb", "Gbmaj7", "Abm", "Abm7", "Bbm", "Bbm7", "Bb", "Bb7", "Cb", "Cbmaj7", "Db", "Db7", "Ebm", "Ebm7", "Fdim"], | |
"Bb Minor": ["Db", "Dbmaj7", "Ebm", "Ebm7", "Fm", "Fm7", "F", "F7", "Gb", "Gbmaj7", "Ab", "Ab7", "Bbm", "Bbm7", "Cdim"], | |
"F Minor": ["Ab", "Abmaj7", "Bbm", "Bbm7", "Cm", "Cm7", "C", "C7", "Db", "Dbmaj7", "Eb", "Eb7", "Fm", "Fm7", "Gdim"] | |
}; | |
if (jQuery(function() { | |
jQuery("#key_labels a").attr("href", "javascript:;"), jQuery("#toggle_instr").click(function() { | |
jQuery("#instructions").slideToggle("medium", function() {}) | |
}), jQuery("#chord_selector tr:odd").addClass("odd"), jQuery("#chord_selector td").addClass("highlight"), jQuery("#chord_selector td").click(function() { | |
jQuery(this).toggleClass("selected"), namethatkey(), ga("send", "event", "key-identifier", "click", "chord", jQuery(this).text()) | |
}), jQuery("#clear_selected").click(function() { | |
jQuery("#chord_selector td").removeClass("selected"), namethatkey(), ga("send", "event", "key-identifier", "click", "clear") | |
}), jQuery("#diatonic_chords td").addClass("jtab"), "Microsoft Internet Explorer" == navigator.appName && jQuery("#ie_nag").css("display", "block"), "Microsoft Internet Explorer" != navigator.appName ? jQuery("#circle_of_fifths").css("display", "block") : jQuery("#ie_results").css("display", "block") | |
}), $(function() { | |
function update_scale() { | |
$("td.display").text(""); | |
var root_note = parseFloat($("#root").val()), | |
scale_type = $("#scale_type").val(); | |
$.each(scaleGen(root_note, scale_type), function(key, value) { | |
"the_scale" == key && $("td#display_scale").append(value.join(", ")), "pentatonic_scale" == key && $("td#display_pent_scale").append(value.join(", ")), "diatonic_triad_names" == key && $.each(this, function(key, value) { | |
$("td#display_triad_names").append(key + 1 + ". " + value + " →<br />") | |
}), "diatonic_triad_notes" == key && $.each(this, function(key, value) { | |
$("td#display_triad_notes").append(value.join(", ") + "<br /> ") | |
}), "relative_major" == key && $("td#display_relative").append('<a href=javascript:; title="Go to key">' + value + " Major</a>"), "relative_major_ref" == key && $("td#display_relative a").click(function() { | |
$("form#scale_select #root").val(value), $("form#scale_select #scale_type").val("major"), update_scale() | |
}), "relative_minor" == key && $("td#display_relative").append('<a href=javascript:; title="Go to key">' + value + " Minor</a>"), "relative_minor_ref" == key && $("td#display_relative a").click(function() { | |
$("form#scale_select #root").val(value), $("form#scale_select #scale_type").val("natural_minor"), update_scale() | |
}) | |
}) | |
} | |
update_scale(), $("form#scale_select").change(function() { | |
update_scale() | |
}) | |
}), $(function() { | |
function topChord(chords, notes) { | |
var result = { | |
exact: [], | |
partial: [] | |
}; | |
return _(chords).each(function(values, chord, list) { | |
var numNotes = _(this.notes).size(), | |
matchCount = _(values).chain().intersection(this.notes).size().value(); | |
numNotes === matchCount && (_(values).size() === numNotes ? result.exact.push(chord) : matchCount >= 2 && result.partial.push(chord)) | |
}, { | |
notes: notes | |
}), result | |
} | |
function namethatchord() { | |
var selected_notes, unique_selected_notes, finalResults; | |
selected_notes = $.makeArray($(".selected").map(function() { | |
return $(this).html() | |
})), unique_selected_notes = _.uniq(selected_notes), finalResults = topChord(Chords, unique_selected_notes), $("#chord_results").html(finalResults.partial.join(", ")), $("#exact_results").html(finalResults.exact.join(", ")), 0 === selected_notes.length && $("#chord_results").html(""), $("#chosen_notes").html(selected_notes.join(", ")) | |
} | |
function clear_notes() { | |
$("#note_selectors a").removeClass("selected"), $("#store_chord").addClass("disabled"), $("#frets_url").val(""), $("#embed_code").val(""), namethatchord() | |
} | |
function load_note_audio(note) { | |
var audio_type = ".mp3"; | |
$("audio#" + note).length || $.ajax({ | |
url: "/assets/audio/clean_" + note + audio_type, | |
success: function() { | |
$("<audio/>", { | |
id: note, | |
src: "/assets/audio/clean_" + note + audio_type, | |
preload: "true" | |
}).appendTo("#audio") | |
} | |
}) | |
} | |
function build_frets_url() { | |
var string, fret, url = "http://musictheorysite.com/namethatchord/?frets"; | |
return $(".selected").each(function() { | |
string = $(this).parent().attr("id").substr(0, 1), fret = +$(this).index(), url += "&" + string + "=" + fret | |
}), url | |
} | |
function build_embed_code() { | |
return "<iframe width='650' height='235' scrolling='no' src='" + build_frets_url() + "&embed' frameborder='0' style='overflow:hidden'></iframe>" | |
} | |
var user_stored_chords = {}, | |
Chords = { | |
C: ["C", "E", "G"], | |
Db: ["Db", "F", "Ab"], | |
D: ["D", "F#", "A"], | |
Eb: ["Eb", "G", "Bb"], | |
E: ["E", "Ab", "B"], | |
F: ["F", "A", "C"], | |
"F#": ["F#", "Bb", "Db"], | |
Gb: ["Gb", "Bb", "Ab"], | |
G: ["G", "B", "D"], | |
Ab: ["Ab", "C", "Eb"], | |
A: ["A", "Db", "E"], | |
Bb: ["Bb", "D", "F"], | |
B: ["B", "Eb", "F#"], | |
Cm: ["C", "Eb", "G"], | |
Dbm: ["Db", "E", "Ab"], | |
Dm: ["D", "F", "A"], | |
Ebm: ["Eb", "F#", "Bb"], | |
Em: ["E", "G", "B"], | |
Fm: ["F", "Ab", "C"], | |
"F#m": ["F#", "A", "Db"], | |
Gm: ["G", "Bb", "D"], | |
Abm: ["Ab", "B", "Eb"], | |
Am: ["A", "C", "E"], | |
Bbm: ["Bb", "Db", "F"], | |
Bm: ["B", "D", "F#"], | |
CM7: ["C", "E", "G", "B"], | |
DbM7: ["Db", "F", "Ab", "C"], | |
DM7: ["D", "F#", "A", "Db"], | |
EbM7: ["Eb", "G", "Bb", "D"], | |
EM7: ["E", "Ab", "B", "Eb"], | |
FM7: ["F", "A", "C", "E"], | |
"F#M7": ["F#", "Bb", "Db", "E#"], | |
GbM7: ["Gb", "Bb", "Ab", "F"], | |
GM7: ["G", "B", "D", "F#"], | |
AbM7: ["Ab", "C", "Eb", "G"], | |
AM7: ["A", "Db", "E", "Ab"], | |
BbM7: ["Bb", "D", "F", "A"], | |
BM7: ["B", "Eb", "F#", "Bb", "Bb"], | |
Cm7: ["C", "Eb", "G", "Bb"], | |
Dbm7: ["Db", "E", "Ab", "B"], | |
Dm7: ["D", "F", "A", "C"], | |
Ebm7: ["Eb", "F#", "Bb", "Db"], | |
Em7: ["E", "G", "B", "D"], | |
Fm7: ["F", "Ab", "C", "Eb"], | |
"F#m7": ["F#", "A", "Db", "E"], | |
Gm7: ["G", "Bb", "D", "F"], | |
Abm7: ["Ab", "B", "Eb", "F#"], | |
Am7: ["A", "C", "E", "G"], | |
Bbm7: ["Bb", "D", "F", "Ab"], | |
Bm7: ["B", "D", "F#", "A"], | |
C7: ["C", "E", "G", "Bb"], | |
Db7: ["Db", "F", "Ab", "B"], | |
D7: ["D", "F#", "A", "C"], | |
Eb7: ["Eb", "G", "Bb", "Db"], | |
E7: ["E", "Ab", "B", "D"], | |
F7: ["F", "A", "C", "Eb"], | |
"F#7": ["F#", "Bb", "Db", "E"], | |
Gb7: ["Gb", "Bb", "Ab", "E"], | |
G7: ["G", "B", "D", "F"], | |
Ab7: ["Ab", "C", "Eb", "Gb", "F#"], | |
A7: ["A", "Db", "E", "G"], | |
Bb7: ["Bb", "D", "F", "Ab"], | |
B7: ["B", "Eb", "F#", "A"], | |
Cadd9: ["C", "D", "E", "G"], | |
Dbadd9: ["Db", "Eb", "F", "Ab"], | |
Dadd9: ["D", "E", "F#", "A"], | |
Ebadd9: ["Eb", "F", "G", "Bb"], | |
Eadd9: ["E", "F#", "Ab", "B"], | |
Fadd9: ["F", "G", "A", "C"], | |
"F#add9": ["F#", "Ab", "Bb", "Db"], | |
Gbadd9: ["Gb", "Ab", "Bb", "Db"], | |
Gadd9: ["G", "A", "B", "D"], | |
Abadd9: ["Ab", "Bb", "C", "Eb"], | |
Aadd9: ["A", "B", "Db", "E"], | |
Bbadd9: ["Bb", "C", "D", "F"], | |
Badd9: ["B", "Db", "Eb", "F#"], | |
C6: ["C", "E", "G", "A"], | |
Db6: ["Db", "F", "Ab", "Bb"], | |
D6: ["D", "F#", "A", "B"], | |
Eb6: ["Eb", "G", "Bb", "C"], | |
E6: ["E", "Ab", "B", "Db"], | |
F6: ["F", "A", "C", "D"], | |
"F#6": ["F#", "Bb", "Db", "Eb"], | |
Gb6: ["Gb", "Bb", "Db", "Eb"], | |
G6: ["G", "B", "D", "E"], | |
Ab6: ["Ab", "C", "Eb", "F"], | |
A6: ["A", "Db", "E", "F#"], | |
Bb6: ["Bb", "D", "F", "G"], | |
B6: ["B", "Eb", "F#", "Ab"], | |
C9: ["C", "E", "G", "Bb", "D"], | |
Db9: ["Db", "F", "Ab", "B", "Eb"], | |
D9: ["D", "F#", "A", "C", "E"], | |
Eb9: ["Eb", "G", "Bb", "Db", "F"], | |
E9: ["E", "Ab", "B", "D", "F#"], | |
F9: ["F", "A", "C", "Eb", "G"], | |
"F#9": ["F#", "Bb", "Db", "E", "Ab"], | |
Gb9: ["Gb", "Bb", "Ab", "E", "Ab"], | |
G9: ["G", "B", "D", "F", "A"], | |
Ab9: ["Ab", "C", "Eb", "Gb", "F#", "Bb"], | |
A9: ["A", "Db", "E", "G", "B"], | |
Bb9: ["Bb", "D", "F", "Ab", "C"], | |
B9: ["B", "Eb", "F#", "A", "Db"] | |
}; | |
for (i = 0; i <= 17; i++) { | |
var fret = "fret_" + i; | |
$("#e_notes a").eq(i).addClass(fret), $("#B_notes a").eq(i).addClass(fret), $("#G_notes a").eq(i).addClass(fret), $("#D_notes a").eq(i).addClass(fret), $("#A_notes a").eq(i).addClass(fret), $("#E_notes a").eq(i).addClass(fret) | |
} | |
$("#note_selectors a").each(function() { | |
$(this).addClass($(this).text()) | |
}), $("#note_selectors a").attr("href", "javascript:;"), $("#frets_url, #embed_code").click(function() { | |
$(this).select() | |
}), $("#note_selectors a").click(function() { | |
if (url_params.hasOwnProperty("embed") || ($(this).siblings(".selected").length >= 1 && $(this).siblings(".selected").removeClass("selected"), $(this).toggleClass("selected"), $(".selected").length ? $("#store_chord").removeClass("disabled") : $("#store_chord").addClass("disabled"), $("#frets_url").val(build_frets_url()), $("#embed_code").val(build_embed_code()), namethatchord(), ga("send", "event", "namethatchord", "click", "note", jQuery(this).attr("class").replace(" selected", ""))), url_params.hasOwnProperty("embed") && url_params.hasOwnProperty("listen") || !url_params.hasOwnProperty("embed")) { | |
load_note_audio($(this).attr("class").split(" ")[0]) | |
} | |
}), $("#clear_selections").click(function() { | |
clear_notes(), ga("send", "event", "namethatchord", "click", "clear notes") | |
}), $("#store_chord").click(function() { | |
if (!$("#store_chord").is(".disabled")) { | |
0 === _.size(user_stored_chords) && $("#stored_chords p").remove(); | |
var next_entry_no = _.size(user_stored_chords) + 1; | |
user_stored_chords[next_entry_no] = {}, user_stored_chords[next_entry_no].frets = {}, user_stored_chords[next_entry_no].notes = [], $(".selected").each(function() { | |
var string = $(this).parent().attr("id"), | |
fret = $(this).attr("class").split(" ")[1], | |
note = $(this).attr("class").split(" ")[2]; | |
user_stored_chords[next_entry_no].frets[string] = fret, user_stored_chords[next_entry_no].notes.push(note) | |
}), $("#stored_chords").append($("<div />", { | |
id: "button_group_" + next_entry_no, | |
style: "float:left;" | |
}).addClass("btn-group")), $("<button />", { | |
id: next_entry_no + "_stored", | |
text: next_entry_no | |
}).addClass("btn btn-primary stored_box").appendTo("#button_group_" + next_entry_no), $("#store_chord").addClass("disabled"), ga("send", "event", "namethatchord", "click", "store chord") | |
} | |
}), $("#stored_chords").delegate(".stored_box", "click", function() { | |
var this_chord = user_stored_chords[parseInt($(this).attr("id"))]; | |
clear_notes(), _.each(this_chord, function(value, key) { | |
"frets" == key && _.each(value, function(fret, string) { | |
$("#" + string).children("a." + fret).addClass("selected") | |
}) | |
}), $("#frets_url").val(build_frets_url()), namethatchord() | |
}), $("#chord_listen").click(function() { | |
$(this).is(".disabled") || ($(".selected").each(function() { | |
var note = $(this).attr("class").split(" ")[0]; | |
$("audio#" + note).trigger("load"), $("audio#" + note).trigger("play") | |
}), ga("send", "event", "namethatchord", "click", "listen to chord")) | |
}), $("#ajaxload").ajaxStart(function() { | |
$(this).show(), $("#chord_listen").addClass("disabled") | |
}), $("#ajaxload").ajaxStop(function() { | |
$(this).hide(), $("#chord_listen").removeClass("disabled") | |
}), "object" == typeof url_params && ($.each(url_params, function(key, value) { | |
if (-1 != $.inArray(key, ["E", "A", "D", "G", "B", "e"])) { | |
$("#" + key + "_notes").find(".fret_" + value).addClass("selected"); | |
var note = $("#" + key + "_notes").find(".fret_" + value).attr("class").split(" ")[0]; | |
url_params.hasOwnProperty("embed") || load_note_audio(note) | |
} | |
}), $("#frets_url").val(build_frets_url()), namethatchord()) | |
}), "undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); + function(a) { | |
"use strict"; | |
function b() { | |
var a = document.createElement("bootstrap"), | |
b = { | |
WebkitTransition: "webkitTransitionEnd", | |
MozTransition: "transitionend", | |
OTransition: "oTransitionEnd otransitionend", | |
transition: "transitionend" | |
}; | |
for (var c in b) | |
if (void 0 !== a.style[c]) return { | |
end: b[c] | |
}; | |
return !1 | |
} | |
a.fn.emulateTransitionEnd = function(b) { | |
var c = !1, | |
d = this; | |
a(this).one("bsTransitionEnd", function() { | |
c = !0 | |
}); | |
var e = function() { | |
c || a(d).trigger(a.support.transition.end) | |
}; | |
return setTimeout(e, b), this | |
}, a(function() { | |
a.support.transition = b(), a.support.transition && (a.event.special.bsTransitionEnd = { | |
bindType: a.support.transition.end, | |
delegateType: a.support.transition.end, | |
handle: function(b) { | |
return a(b.target).is(this) ? b.handleObj.handler.apply(this, arguments) : void 0 | |
} | |
}) | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var c = a(this), | |
e = c.data("bs.alert"); | |
e || c.data("bs.alert", e = new d(this)), "string" == typeof b && e[b].call(c) | |
}) | |
} | |
var c = '[data-dismiss="alert"]', | |
d = function(b) { | |
a(b).on("click", c, this.close) | |
}; | |
d.VERSION = "3.2.0", d.prototype.close = function(b) { | |
function c() { | |
f.detach().trigger("closed.bs.alert").remove() | |
} | |
var d = a(this), | |
e = d.attr("data-target"); | |
e || (e = d.attr("href"), e = e && e.replace(/.*(?=#[^\s]*$)/, "")); | |
var f = a(e); | |
b && b.preventDefault(), f.length || (f = d.hasClass("alert") ? d : d.parent()), f.trigger(b = a.Event("close.bs.alert")), b.isDefaultPrevented() || (f.removeClass("in"), a.support.transition && f.hasClass("fade") ? f.one("bsTransitionEnd", c).emulateTransitionEnd(150) : c()) | |
}; | |
var e = a.fn.alert; | |
a.fn.alert = b, a.fn.alert.Constructor = d, a.fn.alert.noConflict = function() { | |
return a.fn.alert = e, this | |
}, a(document).on("click.bs.alert.data-api", c, d.prototype.close) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.button"), | |
f = "object" == typeof b && b; | |
e || d.data("bs.button", e = new c(this, f)), "toggle" == b ? e.toggle() : b && e.setState(b) | |
}) | |
} | |
var c = function(b, d) { | |
this.$element = a(b), this.options = a.extend({}, c.DEFAULTS, d), this.isLoading = !1 | |
}; | |
c.VERSION = "3.2.0", c.DEFAULTS = { | |
loadingText: "loading..." | |
}, c.prototype.setState = function(b) { | |
var c = "disabled", | |
d = this.$element, | |
e = d.is("input") ? "val" : "html", | |
f = d.data(); | |
b += "Text", null == f.resetText && d.data("resetText", d[e]()), d[e](null == f[b] ? this.options[b] : f[b]), setTimeout(a.proxy(function() { | |
"loadingText" == b ? (this.isLoading = !0, d.addClass(c).attr(c, c)) : this.isLoading && (this.isLoading = !1, d.removeClass(c).removeAttr(c)) | |
}, this), 0) | |
}, c.prototype.toggle = function() { | |
var a = !0, | |
b = this.$element.closest('[data-toggle="buttons"]'); | |
if (b.length) { | |
var c = this.$element.find("input"); | |
"radio" == c.prop("type") && (c.prop("checked") && this.$element.hasClass("active") ? a = !1 : b.find(".active").removeClass("active")), a && c.prop("checked", !this.$element.hasClass("active")).trigger("change") | |
} | |
a && this.$element.toggleClass("active") | |
}; | |
var d = a.fn.button; | |
a.fn.button = b, a.fn.button.Constructor = c, a.fn.button.noConflict = function() { | |
return a.fn.button = d, this | |
}, a(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(c) { | |
var d = a(c.target); | |
d.hasClass("btn") || (d = d.closest(".btn")), b.call(d, "toggle"), c.preventDefault() | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.carousel"), | |
f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b), | |
g = "string" == typeof b ? b : f.slide; | |
e || d.data("bs.carousel", e = new c(this, f)), "number" == typeof b ? e.to(b) : g ? e[g]() : f.interval && e.pause().cycle() | |
}) | |
} | |
var c = function(b, c) { | |
this.$element = a(b).on("keydown.bs.carousel", a.proxy(this.keydown, this)), this.$indicators = this.$element.find(".carousel-indicators"), this.options = c, this.paused = this.sliding = this.interval = this.$active = this.$items = null, "hover" == this.options.pause && this.$element.on("mouseenter.bs.carousel", a.proxy(this.pause, this)).on("mouseleave.bs.carousel", a.proxy(this.cycle, this)) | |
}; | |
c.VERSION = "3.2.0", c.DEFAULTS = { | |
interval: 5e3, | |
pause: "hover", | |
wrap: !0 | |
}, c.prototype.keydown = function(a) { | |
switch (a.which) { | |
case 37: | |
this.prev(); | |
break; | |
case 39: | |
this.next(); | |
break; | |
default: | |
return | |
} | |
a.preventDefault() | |
}, c.prototype.cycle = function(b) { | |
return b || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), this | |
}, c.prototype.getItemIndex = function(a) { | |
return this.$items = a.parent().children(".item"), this.$items.index(a || this.$active) | |
}, c.prototype.to = function(b) { | |
var c = this, | |
d = this.getItemIndex(this.$active = this.$element.find(".item.active")); | |
return b > this.$items.length - 1 || 0 > b ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() { | |
c.to(b) | |
}) : d == b ? this.pause().cycle() : this.slide(b > d ? "next" : "prev", a(this.$items[b])) | |
}, c.prototype.pause = function(b) { | |
return b || (this.paused = !0), this.$element.find(".next, .prev").length && a.support.transition && (this.$element.trigger(a.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this | |
}, c.prototype.next = function() { | |
return this.sliding ? void 0 : this.slide("next") | |
}, c.prototype.prev = function() { | |
return this.sliding ? void 0 : this.slide("prev") | |
}, c.prototype.slide = function(b, c) { | |
var d = this.$element.find(".item.active"), | |
e = c || d[b](), | |
f = this.interval, | |
g = "next" == b ? "left" : "right", | |
h = "next" == b ? "first" : "last", | |
i = this; | |
if (!e.length) { | |
if (!this.options.wrap) return; | |
e = this.$element.find(".item")[h]() | |
} | |
if (e.hasClass("active")) return this.sliding = !1; | |
var j = e[0], | |
k = a.Event("slide.bs.carousel", { | |
relatedTarget: j, | |
direction: g | |
}); | |
if (this.$element.trigger(k), !k.isDefaultPrevented()) { | |
if (this.sliding = !0, f && this.pause(), this.$indicators.length) { | |
this.$indicators.find(".active").removeClass("active"); | |
var l = a(this.$indicators.children()[this.getItemIndex(e)]); | |
l && l.addClass("active") | |
} | |
var m = a.Event("slid.bs.carousel", { | |
relatedTarget: j, | |
direction: g | |
}); | |
return a.support.transition && this.$element.hasClass("slide") ? (e.addClass(b), e[0].offsetWidth, d.addClass(g), e.addClass(g), d.one("bsTransitionEnd", function() { | |
e.removeClass([b, g].join(" ")).addClass("active"), d.removeClass(["active", g].join(" ")), i.sliding = !1, setTimeout(function() { | |
i.$element.trigger(m) | |
}, 0) | |
}).emulateTransitionEnd(1e3 * d.css("transition-duration").slice(0, -1))) : (d.removeClass("active"), e.addClass("active"), this.sliding = !1, this.$element.trigger(m)), f && this.cycle(), this | |
} | |
}; | |
var d = a.fn.carousel; | |
a.fn.carousel = b, a.fn.carousel.Constructor = c, a.fn.carousel.noConflict = function() { | |
return a.fn.carousel = d, this | |
}, a(document).on("click.bs.carousel.data-api", "[data-slide], [data-slide-to]", function(c) { | |
var d, e = a(this), | |
f = a(e.attr("data-target") || (d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, "")); | |
if (f.hasClass("carousel")) { | |
var g = a.extend({}, f.data(), e.data()), | |
h = e.attr("data-slide-to"); | |
h && (g.interval = !1), b.call(f, g), h && f.data("bs.carousel").to(h), c.preventDefault() | |
} | |
}), a(window).on("load", function() { | |
a('[data-ride="carousel"]').each(function() { | |
var c = a(this); | |
b.call(c, c.data()) | |
}) | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.collapse"), | |
f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b); | |
!e && f.toggle && "show" == b && (b = !b), e || d.data("bs.collapse", e = new c(this, f)), "string" == typeof b && e[b]() | |
}) | |
} | |
var c = function(b, d) { | |
this.$element = a(b), this.options = a.extend({}, c.DEFAULTS, d), this.transitioning = null, this.options.parent && (this.$parent = a(this.options.parent)), this.options.toggle && this.toggle() | |
}; | |
c.VERSION = "3.2.0", c.DEFAULTS = { | |
toggle: !0 | |
}, c.prototype.dimension = function() { | |
return this.$element.hasClass("width") ? "width" : "height" | |
}, c.prototype.show = function() { | |
if (!this.transitioning && !this.$element.hasClass("in")) { | |
var c = a.Event("show.bs.collapse"); | |
if (this.$element.trigger(c), !c.isDefaultPrevented()) { | |
var d = this.$parent && this.$parent.find("> .panel > .in"); | |
if (d && d.length) { | |
var e = d.data("bs.collapse"); | |
if (e && e.transitioning) return; | |
b.call(d, "hide"), e || d.data("bs.collapse", null) | |
} | |
var f = this.dimension(); | |
this.$element.removeClass("collapse").addClass("collapsing")[f](0), this.transitioning = 1; | |
var g = function() { | |
this.$element.removeClass("collapsing").addClass("collapse in")[f](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") | |
}; | |
if (!a.support.transition) return g.call(this); | |
var h = a.camelCase(["scroll", f].join("-")); | |
this.$element.one("bsTransitionEnd", a.proxy(g, this)).emulateTransitionEnd(350)[f](this.$element[0][h]) | |
} | |
} | |
}, c.prototype.hide = function() { | |
if (!this.transitioning && this.$element.hasClass("in")) { | |
var b = a.Event("hide.bs.collapse"); | |
if (this.$element.trigger(b), !b.isDefaultPrevented()) { | |
var c = this.dimension(); | |
this.$element[c](this.$element[c]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1; | |
var d = function() { | |
this.transitioning = 0, this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse") | |
}; | |
return a.support.transition ? void this.$element[c](0).one("bsTransitionEnd", a.proxy(d, this)).emulateTransitionEnd(350) : d.call(this) | |
} | |
} | |
}, c.prototype.toggle = function() { | |
this[this.$element.hasClass("in") ? "hide" : "show"]() | |
}; | |
var d = a.fn.collapse; | |
a.fn.collapse = b, a.fn.collapse.Constructor = c, a.fn.collapse.noConflict = function() { | |
return a.fn.collapse = d, this | |
}, a(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(c) { | |
var d, e = a(this), | |
f = e.attr("data-target") || c.preventDefault() || (d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""), | |
g = a(f), | |
h = g.data("bs.collapse"), | |
i = h ? "toggle" : e.data(), | |
j = e.attr("data-parent"), | |
k = j && a(j); | |
h && h.transitioning || (k && k.find('[data-toggle="collapse"][data-parent="' + j + '"]').not(e).addClass("collapsed"), e[g.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), b.call(g, i) | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
b && 3 === b.which || (a(e).remove(), a(f).each(function() { | |
var d = c(a(this)), | |
e = { | |
relatedTarget: this | |
}; | |
d.hasClass("open") && (d.trigger(b = a.Event("hide.bs.dropdown", e)), b.isDefaultPrevented() || d.removeClass("open").trigger("hidden.bs.dropdown", e)) | |
})) | |
} | |
function c(b) { | |
var c = b.attr("data-target"); | |
c || (c = b.attr("href"), c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, "")); | |
var d = c && a(c); | |
return d && d.length ? d : b.parent() | |
} | |
function d(b) { | |
return this.each(function() { | |
var c = a(this), | |
d = c.data("bs.dropdown"); | |
d || c.data("bs.dropdown", d = new g(this)), "string" == typeof b && d[b].call(c) | |
}) | |
} | |
var e = ".dropdown-backdrop", | |
f = '[data-toggle="dropdown"]', | |
g = function(b) { | |
a(b).on("click.bs.dropdown", this.toggle) | |
}; | |
g.VERSION = "3.2.0", g.prototype.toggle = function(d) { | |
var e = a(this); | |
if (!e.is(".disabled, :disabled")) { | |
var f = c(e), | |
g = f.hasClass("open"); | |
if (b(), !g) { | |
"ontouchstart" in document.documentElement && !f.closest(".navbar-nav").length && a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click", b); | |
var h = { | |
relatedTarget: this | |
}; | |
if (f.trigger(d = a.Event("show.bs.dropdown", h)), d.isDefaultPrevented()) return; | |
e.trigger("focus"), f.toggleClass("open").trigger("shown.bs.dropdown", h) | |
} | |
return !1 | |
} | |
}, g.prototype.keydown = function(b) { | |
if (/(38|40|27)/.test(b.keyCode)) { | |
var d = a(this); | |
if (b.preventDefault(), b.stopPropagation(), !d.is(".disabled, :disabled")) { | |
var e = c(d), | |
g = e.hasClass("open"); | |
if (!g || g && 27 == b.keyCode) return 27 == b.which && e.find(f).trigger("focus"), d.trigger("click"); | |
var h = " li:not(.divider):visible a", | |
i = e.find('[role="menu"]' + h + ', [role="listbox"]' + h); | |
if (i.length) { | |
var j = i.index(i.filter(":focus")); | |
38 == b.keyCode && j > 0 && j--, 40 == b.keyCode && j < i.length - 1 && j++, ~j || (j = 0), i.eq(j).trigger("focus") | |
} | |
} | |
} | |
}; | |
var h = a.fn.dropdown; | |
a.fn.dropdown = d, a.fn.dropdown.Constructor = g, a.fn.dropdown.noConflict = function() { | |
return a.fn.dropdown = h, this | |
}, a(document).on("click.bs.dropdown.data-api", b).on("click.bs.dropdown.data-api", ".dropdown form", function(a) { | |
a.stopPropagation() | |
}).on("click.bs.dropdown.data-api", f, g.prototype.toggle).on("keydown.bs.dropdown.data-api", f + ', [role="menu"], [role="listbox"]', g.prototype.keydown) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b, d) { | |
return this.each(function() { | |
var e = a(this), | |
f = e.data("bs.modal"), | |
g = a.extend({}, c.DEFAULTS, e.data(), "object" == typeof b && b); | |
f || e.data("bs.modal", f = new c(this, g)), "string" == typeof b ? f[b](d) : g.show && f.show(d) | |
}) | |
} | |
var c = function(b, c) { | |
this.options = c, this.$body = a(document.body), this.$element = a(b), this.$backdrop = this.isShown = null, this.scrollbarWidth = 0, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, a.proxy(function() { | |
this.$element.trigger("loaded.bs.modal") | |
}, this)) | |
}; | |
c.VERSION = "3.2.0", c.DEFAULTS = { | |
backdrop: !0, | |
keyboard: !0, | |
show: !0 | |
}, c.prototype.toggle = function(a) { | |
return this.isShown ? this.hide() : this.show(a) | |
}, c.prototype.show = function(b) { | |
var c = this, | |
d = a.Event("show.bs.modal", { | |
relatedTarget: b | |
}); | |
this.$element.trigger(d), this.isShown || d.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.$body.addClass("modal-open"), this.setScrollbar(), this.escape(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), this.backdrop(function() { | |
var d = a.support.transition && c.$element.hasClass("fade"); | |
c.$element.parent().length || c.$element.appendTo(c.$body), c.$element.show().scrollTop(0), d && c.$element[0].offsetWidth, c.$element.addClass("in").attr("aria-hidden", !1), c.enforceFocus(); | |
var e = a.Event("shown.bs.modal", { | |
relatedTarget: b | |
}); | |
d ? c.$element.find(".modal-dialog").one("bsTransitionEnd", function() { | |
c.$element.trigger("focus").trigger(e) | |
}).emulateTransitionEnd(300) : c.$element.trigger("focus").trigger(e) | |
})) | |
}, c.prototype.hide = function(b) { | |
b && b.preventDefault(), b = a.Event("hide.bs.modal"), this.$element.trigger(b), this.isShown && !b.isDefaultPrevented() && (this.isShown = !1, this.$body.removeClass("modal-open"), this.resetScrollbar(), this.escape(), a(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.bs.modal"), a.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", a.proxy(this.hideModal, this)).emulateTransitionEnd(300) : this.hideModal()) | |
}, c.prototype.enforceFocus = function() { | |
a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function(a) { | |
this.$element[0] === a.target || this.$element.has(a.target).length || this.$element.trigger("focus") | |
}, this)) | |
}, c.prototype.escape = function() { | |
this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.bs.modal", a.proxy(function(a) { | |
27 == a.which && this.hide() | |
}, this)) : this.isShown || this.$element.off("keyup.dismiss.bs.modal") | |
}, c.prototype.hideModal = function() { | |
var a = this; | |
this.$element.hide(), this.backdrop(function() { | |
a.$element.trigger("hidden.bs.modal") | |
}) | |
}, c.prototype.removeBackdrop = function() { | |
this.$backdrop && this.$backdrop.remove(), this.$backdrop = null | |
}, c.prototype.backdrop = function(b) { | |
var c = this, | |
d = this.$element.hasClass("fade") ? "fade" : ""; | |
if (this.isShown && this.options.backdrop) { | |
var e = a.support.transition && d; | |
if (this.$backdrop = a('<div class="modal-backdrop ' + d + '" />').appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", a.proxy(function(a) { | |
a.target === a.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this)) | |
}, this)), e && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !b) return; | |
e ? this.$backdrop.one("bsTransitionEnd", b).emulateTransitionEnd(150) : b() | |
} else if (!this.isShown && this.$backdrop) { | |
this.$backdrop.removeClass("in"); | |
var f = function() { | |
c.removeBackdrop(), b && b() | |
}; | |
a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", f).emulateTransitionEnd(150) : f() | |
} else b && b() | |
}, c.prototype.checkScrollbar = function() { | |
document.body.clientWidth >= window.innerWidth || (this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()) | |
}, c.prototype.setScrollbar = function() { | |
var a = parseInt(this.$body.css("padding-right") || 0, 10); | |
this.scrollbarWidth && this.$body.css("padding-right", a + this.scrollbarWidth) | |
}, c.prototype.resetScrollbar = function() { | |
this.$body.css("padding-right", "") | |
}, c.prototype.measureScrollbar = function() { | |
var a = document.createElement("div"); | |
a.className = "modal-scrollbar-measure", this.$body.append(a); | |
var b = a.offsetWidth - a.clientWidth; | |
return this.$body[0].removeChild(a), b | |
}; | |
var d = a.fn.modal; | |
a.fn.modal = b, a.fn.modal.Constructor = c, a.fn.modal.noConflict = function() { | |
return a.fn.modal = d, this | |
}, a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(c) { | |
var d = a(this), | |
e = d.attr("href"), | |
f = a(d.attr("data-target") || e && e.replace(/.*(?=#[^\s]+$)/, "")), | |
g = f.data("bs.modal") ? "toggle" : a.extend({ | |
remote: !/#/.test(e) && e | |
}, f.data(), d.data()); | |
d.is("a") && c.preventDefault(), f.one("show.bs.modal", function(a) { | |
a.isDefaultPrevented() || f.one("hidden.bs.modal", function() { | |
d.is(":visible") && d.trigger("focus") | |
}) | |
}), b.call(f, g, this) | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.tooltip"), | |
f = "object" == typeof b && b; | |
(e || "destroy" != b) && (e || d.data("bs.tooltip", e = new c(this, f)), "string" == typeof b && e[b]()) | |
}) | |
} | |
var c = function(a, b) { | |
this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", a, b) | |
}; | |
c.VERSION = "3.2.0", c.DEFAULTS = { | |
animation: !0, | |
placement: "top", | |
selector: !1, | |
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', | |
trigger: "hover focus", | |
title: "", | |
delay: 0, | |
html: !1, | |
container: !1, | |
viewport: { | |
selector: "body", | |
padding: 0 | |
} | |
}, c.prototype.init = function(b, c, d) { | |
this.enabled = !0, this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.$viewport = this.options.viewport && a(this.options.viewport.selector || this.options.viewport); | |
for (var e = this.options.trigger.split(" "), f = e.length; f--;) { | |
var g = e[f]; | |
if ("click" == g) this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)); | |
else if ("manual" != g) { | |
var h = "hover" == g ? "mouseenter" : "focusin", | |
i = "hover" == g ? "mouseleave" : "focusout"; | |
this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this)) | |
} | |
} | |
this.options.selector ? this._options = a.extend({}, this.options, { | |
trigger: "manual", | |
selector: "" | |
}) : this.fixTitle() | |
}, c.prototype.getDefaults = function() { | |
return c.DEFAULTS | |
}, c.prototype.getOptions = function(b) { | |
return b = a.extend({}, this.getDefaults(), this.$element.data(), b), b.delay && "number" == typeof b.delay && (b.delay = { | |
show: b.delay, | |
hide: b.delay | |
}), b | |
}, c.prototype.getDelegateOptions = function() { | |
var b = {}, | |
c = this.getDefaults(); | |
return this._options && a.each(this._options, function(a, d) { | |
c[a] != d && (b[a] = d) | |
}), b | |
}, c.prototype.enter = function(b) { | |
var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type); | |
return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), clearTimeout(c.timeout), c.hoverState = "in", c.options.delay && c.options.delay.show ? void(c.timeout = setTimeout(function() { | |
"in" == c.hoverState && c.show() | |
}, c.options.delay.show)) : c.show() | |
}, c.prototype.leave = function(b) { | |
var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type); | |
return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), clearTimeout(c.timeout), c.hoverState = "out", c.options.delay && c.options.delay.hide ? void(c.timeout = setTimeout(function() { | |
"out" == c.hoverState && c.hide() | |
}, c.options.delay.hide)) : c.hide() | |
}, c.prototype.show = function() { | |
var b = a.Event("show.bs." + this.type); | |
if (this.hasContent() && this.enabled) { | |
this.$element.trigger(b); | |
var c = a.contains(document.documentElement, this.$element[0]); | |
if (b.isDefaultPrevented() || !c) return; | |
var d = this, | |
e = this.tip(), | |
f = this.getUID(this.type); | |
this.setContent(), e.attr("id", f), this.$element.attr("aria-describedby", f), this.options.animation && e.addClass("fade"); | |
var g = "function" == typeof this.options.placement ? this.options.placement.call(this, e[0], this.$element[0]) : this.options.placement, | |
h = /\s?auto?\s?/i, | |
i = h.test(g); | |
i && (g = g.replace(h, "") || "top"), e.detach().css({ | |
top: 0, | |
left: 0, | |
display: "block" | |
}).addClass(g).data("bs." + this.type, this), this.options.container ? e.appendTo(this.options.container) : e.insertAfter(this.$element); | |
var j = this.getPosition(), | |
k = e[0].offsetWidth, | |
l = e[0].offsetHeight; | |
if (i) { | |
var m = g, | |
n = this.$element.parent(), | |
o = this.getPosition(n); | |
g = "bottom" == g && j.top + j.height + l - o.scroll > o.height ? "top" : "top" == g && j.top - o.scroll - l < 0 ? "bottom" : "right" == g && j.right + k > o.width ? "left" : "left" == g && j.left - k < o.left ? "right" : g, e.removeClass(m).addClass(g) | |
} | |
var p = this.getCalculatedOffset(g, j, k, l); | |
this.applyPlacement(p, g); | |
var q = function() { | |
d.$element.trigger("shown.bs." + d.type), d.hoverState = null | |
}; | |
a.support.transition && this.$tip.hasClass("fade") ? e.one("bsTransitionEnd", q).emulateTransitionEnd(150) : q() | |
} | |
}, c.prototype.applyPlacement = function(b, c) { | |
var d = this.tip(), | |
e = d[0].offsetWidth, | |
f = d[0].offsetHeight, | |
g = parseInt(d.css("margin-top"), 10), | |
h = parseInt(d.css("margin-left"), 10); | |
isNaN(g) && (g = 0), isNaN(h) && (h = 0), b.top = b.top + g, b.left = b.left + h, a.offset.setOffset(d[0], a.extend({ | |
using: function(a) { | |
d.css({ | |
top: Math.round(a.top), | |
left: Math.round(a.left) | |
}) | |
} | |
}, b), 0), d.addClass("in"); | |
var i = d[0].offsetWidth, | |
j = d[0].offsetHeight; | |
"top" == c && j != f && (b.top = b.top + f - j); | |
var k = this.getViewportAdjustedDelta(c, b, i, j); | |
k.left ? b.left += k.left : b.top += k.top; | |
var l = k.left ? 2 * k.left - e + i : 2 * k.top - f + j, | |
m = k.left ? "left" : "top", | |
n = k.left ? "offsetWidth" : "offsetHeight"; | |
d.offset(b), this.replaceArrow(l, d[0][n], m) | |
}, c.prototype.replaceArrow = function(a, b, c) { | |
this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "") | |
}, c.prototype.setContent = function() { | |
var a = this.tip(), | |
b = this.getTitle(); | |
a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right") | |
}, c.prototype.hide = function() { | |
function b() { | |
"in" != c.hoverState && d.detach(), c.$element.trigger("hidden.bs." + c.type) | |
} | |
var c = this, | |
d = this.tip(), | |
e = a.Event("hide.bs." + this.type); | |
return this.$element.removeAttr("aria-describedby"), this.$element.trigger(e), e.isDefaultPrevented() ? void 0 : (d.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? d.one("bsTransitionEnd", b).emulateTransitionEnd(150) : b(), this.hoverState = null, this) | |
}, c.prototype.fixTitle = function() { | |
var a = this.$element; | |
(a.attr("title") || "string" != typeof a.attr("data-original-title")) && a.attr("data-original-title", a.attr("title") || "").attr("title", "") | |
}, c.prototype.hasContent = function() { | |
return this.getTitle() | |
}, c.prototype.getPosition = function(b) { | |
b = b || this.$element; | |
var c = b[0], | |
d = "BODY" == c.tagName; | |
return a.extend({}, "function" == typeof c.getBoundingClientRect ? c.getBoundingClientRect() : null, { | |
scroll: d ? document.documentElement.scrollTop || document.body.scrollTop : b.scrollTop(), | |
width: d ? a(window).width() : b.outerWidth(), | |
height: d ? a(window).height() : b.outerHeight() | |
}, d ? { | |
top: 0, | |
left: 0 | |
} : b.offset()) | |
}, c.prototype.getCalculatedOffset = function(a, b, c, d) { | |
return "bottom" == a ? { | |
top: b.top + b.height, | |
left: b.left + b.width / 2 - c / 2 | |
} : "top" == a ? { | |
top: b.top - d, | |
left: b.left + b.width / 2 - c / 2 | |
} : "left" == a ? { | |
top: b.top + b.height / 2 - d / 2, | |
left: b.left - c | |
} : { | |
top: b.top + b.height / 2 - d / 2, | |
left: b.left + b.width | |
} | |
}, c.prototype.getViewportAdjustedDelta = function(a, b, c, d) { | |
var e = { | |
top: 0, | |
left: 0 | |
}; | |
if (!this.$viewport) return e; | |
var f = this.options.viewport && this.options.viewport.padding || 0, | |
g = this.getPosition(this.$viewport); | |
if (/right|left/.test(a)) { | |
var h = b.top - f - g.scroll, | |
i = b.top + f - g.scroll + d; | |
h < g.top ? e.top = g.top - h : i > g.top + g.height && (e.top = g.top + g.height - i) | |
} else { | |
var j = b.left - f, | |
k = b.left + f + c; | |
j < g.left ? e.left = g.left - j : k > g.width && (e.left = g.left + g.width - k) | |
} | |
return e | |
}, c.prototype.getTitle = function() { | |
var b = this.$element, | |
c = this.options; | |
return b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title) | |
}, c.prototype.getUID = function(a) { | |
do { | |
a += ~~(1e6 * Math.random()) | |
} while (document.getElementById(a)); | |
return a | |
}, c.prototype.tip = function() { | |
return this.$tip = this.$tip || a(this.options.template) | |
}, c.prototype.arrow = function() { | |
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") | |
}, c.prototype.validate = function() { | |
this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null) | |
}, c.prototype.enable = function() { | |
this.enabled = !0 | |
}, c.prototype.disable = function() { | |
this.enabled = !1 | |
}, c.prototype.toggleEnabled = function() { | |
this.enabled = !this.enabled | |
}, c.prototype.toggle = function(b) { | |
var c = this; | |
b && ((c = a(b.currentTarget).data("bs." + this.type)) || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c))), c.tip().hasClass("in") ? c.leave(c) : c.enter(c) | |
}, c.prototype.destroy = function() { | |
clearTimeout(this.timeout), this.hide().$element.off("." + this.type).removeData("bs." + this.type) | |
}; | |
var d = a.fn.tooltip; | |
a.fn.tooltip = b, a.fn.tooltip.Constructor = c, a.fn.tooltip.noConflict = function() { | |
return a.fn.tooltip = d, this | |
} | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.popover"), | |
f = "object" == typeof b && b; | |
(e || "destroy" != b) && (e || d.data("bs.popover", e = new c(this, f)), "string" == typeof b && e[b]()) | |
}) | |
} | |
var c = function(a, b) { | |
this.init("popover", a, b) | |
}; | |
if (!a.fn.tooltip) throw new Error("Popover requires tooltip.js"); | |
c.VERSION = "3.2.0", c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, { | |
placement: "right", | |
trigger: "click", | |
content: "", | |
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' | |
}), c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype), c.prototype.constructor = c, c.prototype.getDefaults = function() { | |
return c.DEFAULTS | |
}, c.prototype.setContent = function() { | |
var a = this.tip(), | |
b = this.getTitle(), | |
c = this.getContent(); | |
a.find(".popover-title")[this.options.html ? "html" : "text"](b), a.find(".popover-content").empty()[this.options.html ? "string" == typeof c ? "html" : "append" : "text"](c), a.removeClass("fade top bottom left right in"), a.find(".popover-title").html() || a.find(".popover-title").hide() | |
}, c.prototype.hasContent = function() { | |
return this.getTitle() || this.getContent() | |
}, c.prototype.getContent = function() { | |
var a = this.$element, | |
b = this.options; | |
return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content) | |
}, c.prototype.arrow = function() { | |
return this.$arrow = this.$arrow || this.tip().find(".arrow") | |
}, c.prototype.tip = function() { | |
return this.$tip || (this.$tip = a(this.options.template)), this.$tip | |
}; | |
var d = a.fn.popover; | |
a.fn.popover = b, a.fn.popover.Constructor = c, a.fn.popover.noConflict = function() { | |
return a.fn.popover = d, this | |
} | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(c, d) { | |
var e = a.proxy(this.process, this); | |
this.$body = a("body"), this.$scrollElement = a(a(c).is("body") ? window : c), this.options = a.extend({}, b.DEFAULTS, d), this.selector = (this.options.target || "") + " .nav li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", e), this.refresh(), this.process() | |
} | |
function c(c) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.scrollspy"), | |
f = "object" == typeof c && c; | |
e || d.data("bs.scrollspy", e = new b(this, f)), "string" == typeof c && e[c]() | |
}) | |
} | |
b.VERSION = "3.2.0", b.DEFAULTS = { | |
offset: 10 | |
}, b.prototype.getScrollHeight = function() { | |
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) | |
}, b.prototype.refresh = function() { | |
var b = "offset", | |
c = 0; | |
a.isWindow(this.$scrollElement[0]) || (b = "position", c = this.$scrollElement.scrollTop()), this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight(); | |
var d = this; | |
this.$body.find(this.selector).map(function() { | |
var d = a(this), | |
e = d.data("target") || d.attr("href"), | |
f = /^#./.test(e) && a(e); | |
return f && f.length && f.is(":visible") && [ | |
[f[b]().top + c, e] | |
] || null | |
}).sort(function(a, b) { | |
return a[0] - b[0] | |
}).each(function() { | |
d.offsets.push(this[0]), d.targets.push(this[1]) | |
}) | |
}, b.prototype.process = function() { | |
var a, b = this.$scrollElement.scrollTop() + this.options.offset, | |
c = this.getScrollHeight(), | |
d = this.options.offset + c - this.$scrollElement.height(), | |
e = this.offsets, | |
f = this.targets, | |
g = this.activeTarget; | |
if (this.scrollHeight != c && this.refresh(), b >= d) return g != (a = f[f.length - 1]) && this.activate(a); | |
if (g && b <= e[0]) return g != (a = f[0]) && this.activate(a); | |
for (a = e.length; a--;) g != f[a] && b >= e[a] && (!e[a + 1] || b <= e[a + 1]) && this.activate(f[a]) | |
}, b.prototype.activate = function(b) { | |
this.activeTarget = b, a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active"); | |
var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', | |
d = a(c).parents("li").addClass("active"); | |
d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), d.trigger("activate.bs.scrollspy") | |
}; | |
var d = a.fn.scrollspy; | |
a.fn.scrollspy = c, a.fn.scrollspy.Constructor = b, a.fn.scrollspy.noConflict = function() { | |
return a.fn.scrollspy = d, this | |
}, a(window).on("load.bs.scrollspy.data-api", function() { | |
a('[data-spy="scroll"]').each(function() { | |
var b = a(this); | |
c.call(b, b.data()) | |
}) | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.tab"); | |
e || d.data("bs.tab", e = new c(this)), "string" == typeof b && e[b]() | |
}) | |
} | |
var c = function(b) { | |
this.element = a(b) | |
}; | |
c.VERSION = "3.2.0", c.prototype.show = function() { | |
var b = this.element, | |
c = b.closest("ul:not(.dropdown-menu)"), | |
d = b.data("target"); | |
if (d || (d = b.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")), !b.parent("li").hasClass("active")) { | |
var e = c.find(".active:last a")[0], | |
f = a.Event("show.bs.tab", { | |
relatedTarget: e | |
}); | |
if (b.trigger(f), !f.isDefaultPrevented()) { | |
var g = a(d); | |
this.activate(b.closest("li"), c), this.activate(g, g.parent(), function() { | |
b.trigger({ | |
type: "shown.bs.tab", | |
relatedTarget: e | |
}) | |
}) | |
} | |
} | |
}, c.prototype.activate = function(b, c, d) { | |
function e() { | |
f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), b.addClass("active"), g ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), b.parent(".dropdown-menu") && b.closest("li.dropdown").addClass("active"), d && d() | |
} | |
var f = c.find("> .active"), | |
g = d && a.support.transition && f.hasClass("fade"); | |
g ? f.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(), f.removeClass("in") | |
}; | |
var d = a.fn.tab; | |
a.fn.tab = b, a.fn.tab.Constructor = c, a.fn.tab.noConflict = function() { | |
return a.fn.tab = d, this | |
}, a(document).on("click.bs.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function(c) { | |
c.preventDefault(), b.call(a(this), "show") | |
}) | |
}(jQuery), | |
function(a) { | |
"use strict"; | |
function b(b) { | |
return this.each(function() { | |
var d = a(this), | |
e = d.data("bs.affix"), | |
f = "object" == typeof b && b; | |
e || d.data("bs.affix", e = new c(this, f)), "string" == typeof b && e[b]() | |
}) | |
} | |
var c = function(b, d) { | |
this.options = a.extend({}, c.DEFAULTS, d), this.$target = a(this.options.target).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)), this.$element = a(b), this.affixed = this.unpin = this.pinnedOffset = null, this.checkPosition() | |
}; | |
c.VERSION = "3.2.0", c.RESET = "affix affix-top affix-bottom", c.DEFAULTS = { | |
offset: 0, | |
target: window | |
}, c.prototype.getPinnedOffset = function() { | |
if (this.pinnedOffset) return this.pinnedOffset; | |
this.$element.removeClass(c.RESET).addClass("affix"); | |
var a = this.$target.scrollTop(), | |
b = this.$element.offset(); | |
return this.pinnedOffset = b.top - a | |
}, c.prototype.checkPositionWithEventLoop = function() { | |
setTimeout(a.proxy(this.checkPosition, this), 1) | |
}, c.prototype.checkPosition = function() { | |
if (this.$element.is(":visible")) { | |
var b = a(document).height(), | |
d = this.$target.scrollTop(), | |
e = this.$element.offset(), | |
f = this.options.offset, | |
g = f.top, | |
h = f.bottom; | |
"object" != typeof f && (h = g = f), "function" == typeof g && (g = f.top(this.$element)), "function" == typeof h && (h = f.bottom(this.$element)); | |
var i = !(null != this.unpin && d + this.unpin <= e.top) && (null != h && e.top + this.$element.height() >= b - h ? "bottom" : null != g && g >= d && "top"); | |
if (this.affixed !== i) { | |
null != this.unpin && this.$element.css("top", ""); | |
var j = "affix" + (i ? "-" + i : ""), | |
k = a.Event(j + ".bs.affix"); | |
this.$element.trigger(k), k.isDefaultPrevented() || (this.affixed = i, this.unpin = "bottom" == i ? this.getPinnedOffset() : null, this.$element.removeClass(c.RESET).addClass(j).trigger(a.Event(j.replace("affix", "affixed"))), "bottom" == i && this.$element.offset({ | |
top: b - this.$element.height() - h | |
})) | |
} | |
} | |
}; | |
var d = a.fn.affix; | |
a.fn.affix = b, a.fn.affix.Constructor = c, a.fn.affix.noConflict = function() { | |
return a.fn.affix = d, this | |
}, a(window).on("load", function() { | |
a('[data-spy="affix"]').each(function() { | |
var c = a(this), | |
d = c.data(); | |
d.offset = d.offset || {}, d.offsetBottom && (d.offset.bottom = d.offsetBottom), d.offsetTop && (d.offset.top = d.offsetTop), b.call(c, d) | |
}) | |
}) | |
}(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment