Created
June 17, 2012 18:20
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 (a) { | |
var b; | |
b = a.CLIPBOARD = a.CLIPBOARD || {}, a = b; | |
a.JSON = a.JSON || {}; | |
a.client = a.client || {}; | |
a.client.origins = a.client.origins || {}; | |
a.client.util = {}; | |
a.client.ui = {}; | |
a.client.selectors = {}; | |
a.client.extractors = {}; | |
a.client.popups = {} | |
})(window); | |
(function (b) { | |
function a() {} | |
a.prototype = { | |
showLoadingMessage: function () {}, | |
show3rdPartyCookiesErrorMessage: function () {}, | |
hideNotification: function () {}, | |
showErrorNotification: function () {}, | |
enableClipping: function () {}, | |
disableClipping: function () {}, | |
showNotification: function () {}, | |
handleExtraction: function () {}, | |
setPreferences: function () {}, | |
setLoginState: function () {} | |
}; | |
b.CLIPBOARD.client.UiController = a | |
})(window); | |
(function (b) { | |
function a(a) { | |
this.domain = a | |
} | |
a.prototype = { | |
hack: function () {} | |
}; | |
b.CLIPBOARD.client.extractors.DomainHacker = a | |
})(window); | |
(function (c) { | |
function d() {} | |
c = c.CLIPBOARD.client; | |
d.prototype = new c.extractors.DomainHacker("www.youtube.com"); | |
d.prototype.hack = function (b) { | |
var e = b.find("embed"), | |
b = b.constructor; | |
if (e.length) for (var f = 0; f < e.length; ++f) { | |
var a = b("embed")[0]; | |
if ((a = (a.outerHTML || (new XMLSerializer).serializeToString(a)).match(/video_id=([^&"]+)/g)) && 1 <= a.length) if ((a = /video_id=([^&"]+)/.exec(a[a.length - 1])) && 2 <= a.length) { | |
var c = b(e[f]).width(), | |
d = b(e[f]).height(), | |
a = '<iframe src="http://www.youtube.com/embed/{id}?wmode=transparent" width="{w}" height="{h}" frameborder="0" allowfullscreen></iframe>'.replace("{id}", a[1]).replace("{w}", c).replace("{h}", d); | |
b(e[f]).replaceWith(a) | |
} | |
} | |
}; | |
c.extractors.YouTubeHacker = d | |
})(window); | |
(function (a) { | |
function b() {} | |
a = a.CLIPBOARD.client; | |
b.prototype = new a.extractors.DomainHacker("tlc.discovery.com"); | |
b.prototype.hack = function (a) { | |
a.find('object[name="video-per-page-player"]').each(function () { | |
var b = a.constructor(this), | |
c = b.find('param[name="flashvars"]').attr("value").match(/clipRefId%22%3A%22(\w+?)%22/); | |
c && b.replaceWith('<iframe id="dit-video-embed" width="640" height="360" src="http://static.discoverymedia.com/videos/components/tlc/{refId}/snag-it-player.html?auto=no" frameborder="0" scrolling="no" allowtransparency="true"></iframe>'.replace("{refId}", c[1])) | |
}) | |
}; | |
a.extractors.TlcDiscoveryHacker = b | |
})(window); | |
(function (b) { | |
function a() {} | |
a.prototype = { | |
tweakPartially: function () {}, | |
tweakFully: function () {} | |
}; | |
b.CLIPBOARD.client.extractors.TagTweaker = a | |
})(window); | |
(function (b) { | |
function a() {} | |
a.prototype = { | |
extract: function () { | |
return "" | |
} | |
}; | |
b.CLIPBOARD.client.Extractor = a | |
})(window); | |
(function (b) { | |
function a() {} | |
a.prototype = { | |
select: function () {}, | |
getSelection: function () { | |
return { | |
startElement: null, | |
endElement: null | |
} | |
}, | |
disableGlobalEvents: function () {}, | |
enableGlobalEvents: function () {}, | |
shouldUseAsDefault: function () { | |
return !1 | |
}, | |
getExtractor: function () { | |
return null | |
}, | |
setPreferences: function () {} | |
}; | |
a.failureStatus = { | |
nowhereToZoom: "nowhereToZoom", | |
maxSizeExceededViaZoom: "maxSizeExceededViaZoom", | |
maxSizeExceededViaDrag: "maxSizeExceededViaDrag" | |
}; | |
b.CLIPBOARD.client.Selector = a | |
})(window); | |
(function (i) { | |
var h; | |
i.CLIPBOARD.client.util = { | |
idSuffix: "_clipboard_314159265", | |
rewriteClass: "node_clipboard_314159265", | |
doNotClipAttributeName: "ignore_clipboard_314159265", | |
doNotClipAllAttributeName: "ignoreAll_clipboard_314159265", | |
maxArea: Infinity, | |
clipContainerClass: "clipping_314159265", | |
addSuffix: function (a) { | |
return a + this.idSuffix | |
}, | |
shouldClip: function (a) { | |
return !a.attr(this.doNotClipAttributeName) && !a.attr(this.doNotClipAllAttributeName) | |
}, | |
cullNodeAttributeFlag: "cullNode_clipboard_314159265", | |
rgbToHex: function () { | |
function a(a) { | |
a = a.toString(16); | |
return 1 == a.length ? "0" + a : a | |
} | |
return function (b, c) { | |
return "#" + (c && 1 !== c ? a(Math.floor(255 * c)) : "") + a(b[0]) + a(b[1]) + a(b[2]) | |
} | |
}(), | |
rectColors: { | |
blue: { | |
startColor: [138, 194, 224], | |
stopColor: [108, 150, 173] | |
}, | |
green: { | |
startColor: [156, 209, 142], | |
stopColor: [57, 130, 53] | |
}, | |
orange: { | |
startColor: [246, 230, 18], | |
stopColor: [237, 144, 23] | |
}, | |
red: { | |
startColor: [235, 179, 172], | |
stopColor: [204, 85, 85] | |
}, | |
gray: { | |
startColor: [210, 210, 210], | |
stopColor: [139, 139, 139] | |
}, | |
purple: { | |
startColor: [227, 157, 226], | |
stopColor: [153, 72, 153] | |
}, | |
teal: { | |
startColor: [173, 255, 254], | |
stopColor: [50, 170, 168] | |
} | |
}, | |
applyGradient: function (a, b, c) { | |
var b = this.rectColors[b] || this.rectColors.blue, | |
d = i.navigator.userAgent, | |
c = c || 0.25, | |
e = "rgba(" + b.startColor.join(",") + ", " + c + ")", | |
f = "rgba(" + b.stopColor.join(",") + ", " + c + ")", | |
c = 'progid:DXImageTransform.Microsoft.gradient(startColorstr="' + this.rgbToHex(b.startColor, c) + '", endColorstr="' + this.rgbToHex(b.stopColor, c) + '", GradientType=0)', | |
e = "linear-gradient(top, " + e + " 0%, " + f + " 100%)"; | |
/Firefox/i.test(d) ? a.cssImportant("background-image", "-moz-" + e) : /Webkit/i.test(d) ? a.cssImportant("background-image", "-webkit-" + e) : /Opera/i.test(d) ? a.cssImportant("background-image", "-o-" + e) : /MSIE 10/i.test(d) ? a.cssImportant("background-image", "-ms-" + e) : /MSIE [89]/i.test(d) && a.cssImportant("filter", c); | |
/MSIE 8/i.test(d) ? b = "rgb(" + b.stopColor.join(",") + ")" : (b = this.rgbToHsl.apply(null, b.startColor), b[0] *= 360, b[1] = 100 * Math.min(1, Math.max(0, b[1] + 0.1)) + "%", b[2] = 100 * b[2] + "%", b = "hsla(" + b.join(",") + ", 0.5)"); | |
a.cssImportant("border-color", b) | |
}, | |
rgbToHsl: function (a, b, c) { | |
var a = a / 255, | |
b = b / 255, | |
c = c / 255, | |
d = Math.max(a, b, c), | |
e = Math.min(a, b, c), | |
f, g = (d + e) / 2; | |
if (d == e) f = e = 0; | |
else { | |
var j = d - e, | |
e = 0.5 < g ? j / (2 - d - e) : j / (d + e); | |
switch (d) { | |
case a: | |
f = (b - c) / j + (b < c ? 6 : 0); | |
break; | |
case b: | |
f = (c - a) / j + 2; | |
break; | |
case c: | |
f = (a - b) / j + 4 | |
} | |
f /= 6 | |
} | |
return [f, e, g] | |
}, | |
forEach: function (a, b) { | |
for (var c in a) a.hasOwnProperty(c) && b.call(null, a[c], c) | |
}, | |
getRangeData: function () { | |
return i.getSelection ? | |
function (a) { | |
var b, c = { | |
top: null, | |
left: null | |
}; | |
if (0 < i.getSelection().rangeCount) try { | |
b = i.getSelection().getRangeAt(0); | |
var d = b.getBoundingClientRect(); | |
c.top = d.top; | |
c.left = d.left | |
} catch (e) { | |
b = null | |
} | |
return { | |
fragment: b && b.cloneContents() || a.createDocumentFragment(), | |
text: b ? b.toString() : "", | |
offset: b ? c : { | |
top: 0, | |
left: 0 | |
} | |
} | |
} : function (a) { | |
var b = a.selection.createRange(), | |
c = a.createElement("div"), | |
d = { | |
top: b.boundingTop, | |
left: b.boundingLeft | |
}; | |
c.innerHTML = b.htmlText; | |
for (var a = a.createDocumentFragment(), e = 0, f = c.childNodes.length; e < f; e++) a.appendChild(c.childNodes[e].cloneNode(!0)); | |
return { | |
fragment: a, | |
text: b.text, | |
offset: d | |
} | |
} | |
}(), | |
trim: function (a, b) { | |
var c, d, e, a = a + ""; | |
c = b ? (b + "").replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^:])/g, "$1") : " \n\r\t\u000c\u000b\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000"; | |
for (e = 0, d = a.length; e < d; e++) if (-1 === c.indexOf(a.charAt(e))) { | |
a = a.substring(e); | |
break | |
} | |
for (e = a.length - 1; 0 <= e; e--) if (-1 === c.indexOf(a.charAt(e))) { | |
a = a.substring(0, e + 1); | |
break | |
} | |
return -1 === c.indexOf(a.charAt(0)) ? a : "" | |
}, | |
safeClone: function (a) { | |
var b = a.constructor, | |
a = a[0].cloneNode(!1), | |
c = [], | |
d, e, f, g; | |
e = b.extend({ | |
style: 1, | |
"class": 1, | |
width: 1, | |
height: 1 | |
}, i.CLIPBOARD.common.blobSanitization.unsafeAttributes); | |
for (d in e) e.hasOwnProperty(d) && a.removeAttribute(d); | |
this.removeOurAttributes(b(a)); | |
e = a.attributes; | |
f = e.length; | |
for (g = 0; g < f; g++) d = e[g], /^on/.test(d.name) && c.push(d.name); | |
for (; d = c.pop();) a.removeAttribute(d); | |
return b(a) | |
}, | |
merge: function (a, b) { | |
var a = a || {}, | |
c; | |
for (c in b) b.hasOwnProperty(c) && void 0 !== b[c] && (a[c] = b[c]); | |
return a | |
}, | |
inherit: function (a) { | |
for (var b = Array.prototype.slice.call(arguments), a = b.shift(), c = 0; c < b.length; c++) for (var d in b[c]) a.prototype[d] = b[c][d] | |
}, | |
computeOverlap: function (a, b) { | |
var c = { | |
left: Math.max(b.left, a.left), | |
right: Math.min(b.right, a.right), | |
top: Math.max(b.top, a.top), | |
bottom: Math.min(b.bottom, a.bottom) | |
}; | |
c.width = Math.max(c.right - c.left, 0); | |
c.height = Math.max(c.bottom - c.top, 0); | |
c.area = c.width * c.height; | |
return c | |
}, | |
dirname: function (a) { | |
-1 !== a.indexOf("#") && (a = a.replace(/#.*$/, "")); | |
return /\/$/.test(a) ? a.replace(/\/*$/, "") : a.replace(/\\/g, "/").replace(/\/[^\/]*\/?$/, "") | |
}, | |
normalizeUri: function (a, b) { | |
a = this.trim(a); | |
if ("" === a) a = b.uri; | |
if ("#" === a.charAt(0)) return b.uri + a; | |
if (/^(?:file|javascript):/i.test(a)) return "#"; | |
if (/^[A-Za-z][\w+-\.]*:/.test(a)) return a; | |
if ("/" !== a.charAt(0)) return b.relativeDir + "/" + a; | |
return "/" === a.charAt(1) ? (a = a.replace(/^\/+/, ""), b.protocol + "//" + a) : b.protocol + "//" + b.domainAndPort + a | |
}, | |
assureFixedPositioning: function (a) { | |
var b = a.constructor, | |
c = { | |
$element: a, | |
scrollLeft: 0, | |
scrollTop: 0, | |
originalPosition: a.css("position"), | |
fixed: !1, | |
scrollTo: function (a, b) { | |
if (!this.fixed) { | |
var c = a - this.scrollLeft, | |
g = b - this.scrollTop; | |
this.scrollLeft = a; | |
this.scrollTop = b; | |
var j = {}; | |
j.top = parseInt(this.$element.css("top")) + g; | |
g = parseInt(this.$element.css("left")) + c; | |
if (!isNaN(g)) j.left = g; | |
c = parseInt(this.$element.css("right")) - c; | |
if (!isNaN(c)) j.right = c; | |
this.$element.cssImportant(j) | |
} | |
} | |
}; | |
a.cssImportant("position", "fixed"); | |
c.fixed = "fixed" === a.css("position"); | |
c.fixed || (a.cssImportant("position", "absolute"), c.scrollTo(b(i).scrollLeft(), b(i).scrollTop())); | |
h ? h.push(c) : (h = [c], b(i).bind("scroll." + this.eventNamespace.global, function () { | |
for (var a = b(i).scrollLeft(), c = b(i).scrollTop(), f = 0; f < h.length; f++) h[f].scrollTo(a, c) | |
})) | |
}, | |
retireFixedPositioning: function (a) { | |
if (h) for (var b = 0; b < h.length; b++) if (h[b].$element === a) { | |
a.cssImportant("position", h[b].originalPosition); | |
h.splice(b, 1); | |
break | |
} | |
}, | |
disableAllFixies: function () { | |
h = null | |
}, | |
eventNamespace: { | |
global: "CLIPBOARD", | |
review: "CLIBPOARD_REVIEW" | |
}, | |
flagAsUnclippable: function (a) { | |
a.attr(this.doNotClipAllAttributeName, !0) | |
}, | |
getDimensions: function (a) { | |
var b = a.trueOffset(); | |
b.width = a.outerWidth(); | |
b.height = a.outerHeight(); | |
b.right = b.left + b.width; | |
b.bottom = b.top + b.height; | |
b.area = b.width * b.height; | |
return b | |
}, | |
getOuterDimensions: function (a) { | |
var b = a.trueOffset(), | |
b = { | |
left: b.left, | |
top: b.top | |
}, | |
c = parseFloat(a.css("margin-left")), | |
d = parseFloat(a.css("margin-top")); | |
0 < c && (b.left -= c); | |
0 < d && (b.top -= d); | |
b.width = a.outerWidth(!0); | |
b.height = a.outerHeight(!0); | |
b.right = b.left + b.width; | |
b.bottom = b.top + b.height; | |
b.area = b.height * b.width; | |
return b | |
}, | |
getBoundingDimensions: function (a, b) { | |
var c = this.getOuterDimensions, | |
d = c(a); | |
if (!b || !b.length || a[0] === b[0]) return d; | |
c = c(b); | |
d = { | |
top: Math.min(d.top, c.top), | |
left: Math.min(d.left, c.left), | |
bottom: Math.max(d.bottom, c.bottom), | |
right: Math.max(d.right, c.right) | |
}; | |
d.width = d.right - d.left; | |
d.height = d.bottom - d.top; | |
d.area = d.width * d.height; | |
return d | |
}, | |
adjustOffsetForMargins: function (a, b) { | |
var c = parseFloat(a.css("font-size")), | |
d = this.convertUnitsOrPercentageToPixels(parseFloat(a.css("margin-left")), c, a.parent().width()), | |
c = this.convertUnitsOrPercentageToPixels(parseFloat(a.css("margin-top")), c, a.parent().height()); | |
0 < d && (b.left -= d); | |
0 < c && (b.top -= c) | |
}, | |
convertUnitsToPixels: function (a, b, c) { | |
var d; | |
if (d = /^(?:-?[\d\.]+(px|em|cm|pt|in)?|0%?)$/.exec(a)) { | |
d[1] || (d[1] = "px"); | |
if (d[1]) switch (a = parseFloat(a), d[1]) { | |
case "px": | |
return a; | |
case "em": | |
return a * b; | |
case "cm": | |
return a * c / 2.54; | |
case "in": | |
return a * c; | |
case "pt": | |
return a * c / 72 | |
} | |
return 0 | |
} | |
return !1 | |
}, | |
convertUnitsOrPercentageToPixels: function (a, b, c, d) { | |
b = this.convertUnitsToPixels(a, b, c); | |
return !1 !== b ? b : parseFloat(a) / 100 * d | |
}, | |
removeOurAttributes: function (a) { | |
a.removeAttr(this.cullNodeAttributeFlag).removeTrueCoordinates() | |
}, | |
strings: { | |
error_unknown: "(\u256f\u00b0\u25a1\u00b0\uff09\u256f\ufe35 \u253b\u2501\u253b", | |
zoom_nowhereToZoom: "Nowhere to zoom :(", | |
zoom_tooLarge: "Too large to clip :(", | |
drag_tooLarge: "Too large to clip :(", | |
send_clipSaveTimedOut: "Error :|", | |
send_emptyResponseFromPromise: "Error :(", | |
send_xdmPromiseFail: "Error :(", | |
send_invalidResponseSavingClip: "Error :\\", | |
send_promiseRetryCount: "Error :|", | |
send_saveClipFail: "Error :/", | |
send_promiseUnavailable: "Error :{", | |
save_tutorial: "Saved", | |
save_default: "Saved" | |
}, | |
cloneableTags: { | |
embed: 1, | |
object: 1, | |
param: 1, | |
video: 1, | |
table: 1, | |
tbody: 1, | |
thead: 1, | |
th: 1, | |
tr: 1, | |
td: 1 | |
}, | |
semanticBlockTagNames: { | |
article: 1, | |
aside: 1, | |
details: 1, | |
figcaption: 1, | |
figure: 1, | |
footer: 1, | |
header: 1, | |
hgroup: 1, | |
menu: 1, | |
nav: 1, | |
section: 1 | |
}, | |
tagsToConvertToDiv: { | |
body: 1, | |
center: 1, | |
iframe: 1, | |
html: 1, | |
form: 1 | |
}, | |
isHiddenByAncestry: function () { | |
return function (a) { | |
if (a.is("object,param,embed")) return !1; | |
for (var b = this.getDimensions(a), c = a.parents(), a = a.constructor, d = 0, e = c.length; d < e; d++) { | |
var f = a(c[d]), | |
g; | |
if (!(g = "hidden" == f.css("visibility") || 0 === f.css("opacity") || f.attr(this.doNotClipAllAttributeName))) if (g = "hidden" === f.css("overflow")) f = this.getDimensions(f), g = b.right + 10 < f.left || b.left + 10 > f.right || b.bottom + 10 < f.top || b.top + 10 > f.bottom; | |
if (g) return !0 | |
} | |
return !1 | |
} | |
}(), | |
shouldInclude: function (a, b) { | |
var c = a[0].tagName.toLowerCase(); | |
if (c in { | |
head: 1, | |
script: 1, | |
style: 1, | |
noscript: 1, | |
noembed: 1 | |
}) return b.reason = "skipped tag", !1; | |
if ("br" === c) return !0; | |
if (!this.shouldClip(a)) return b.reason = "should not clip", !1; | |
if ("fixed" === a.css("position")) return b.reason = "fixed position", !1; | |
if (a.outerWidth() * a.outerHeight() > this.maxArea) return b.reason = "area too big", !1; | |
return this.isHiddenByAncestry(a) ? (b.reason = "hidden by ancestry", !1) : !0 | |
}, | |
disableAutoplayForUrl: function (a, b) { | |
var c = a.attr(b); | |
a.attr(b, c.replace(/(^|&|\?)(autoplay|autostart|isautoplay|config_settings_autoplay)=(?:true|1)($|&)/i, "$1$2=false$3")); | |
return c !== a.attr(b) | |
}, | |
copyAttributeIfExists: function (a, b, c, d, e) { | |
a = a.attr(c); | |
if (void 0 === a) return !1; | |
b.attr(c, d ? this.normalizeUri(a, e) : a); | |
return !0 | |
}, | |
copyAttributeAndNormalize: function (a, b, c, d) { | |
return this.copyAttributeIfExists(a, b, c, !0, d) | |
}, | |
compactCss: function (a) { | |
function b(b, c) { | |
var d; | |
for (d = 0; d < b.length; d++) if (!(b[d] in a)) return; | |
var e = []; | |
for (d = 0; d < b.length; d++) e.push(a[b[d]]); | |
a[c] = e.join(" "); | |
for (d = 0; d < b.length; d++) delete a[b[d]] | |
} | |
function c(b, c) { | |
var d; | |
for (d = 0; d < b.length; d++) if (!(b[d] in a)) return; | |
var e = a[b[0]]; | |
for (d = 1; d < b.length; d++) if (a[b[d]] != e) return; | |
a[c] = e; | |
for (d = 0; d < b.length; d++) delete a[b[d]] | |
} | |
c(["margin-top", "margin-right", "margin-bottom", "margin-left"], "margin"); | |
c(["padding-top", "padding-right", "padding-bottom", "padding-left"], "padding"); | |
var d = ["top", "right", "bottom", "left"], | |
e, f; | |
for (e = 0; e < d.length; e++) f = d[e], b(["border-" + f + "-width", "border-" + f + "-style", "border-" + f + "-color"], "border-" + f); | |
d = ["width", "style", "color"]; | |
for (e = 0; e < d.length; e++) f = d[e], c(["border-top-" + f, "border-right-" + f, "border-bottom-" + f, "border-left-" + f], "border-" + f); | |
c(["border-top", "border-right", "border-bottom", "border-left"], "border"); | |
if ("background-position-x" in a || "background-position-y" in a) a["background-position"] = (a["background-position-x"] || "0") + " " + (a["background-position-y"] || "0"), delete a["background-position-x"], delete a["background-position-y"]; | |
d = ["background-color", "background-image", "background-repeat", "background-attachment", "background-position"]; | |
(function () { | |
if ("background-repeat" in a && -1 !== a["background-repeat"].indexOf(" ")) { | |
var b = a["background-repeat"].split(" "); | |
a["background-repeat"] = "repeat" === b[0] ? "repeat" === b[1] ? "repeat" : "repeat-x" : "repeat" === b[1] ? "repeat-y" : "no-repeat" | |
} | |
})(); | |
for (e = 0; e < d.length; e++) "initial" == a[d[e]] && delete a[d[e]]; | |
b(["background-color", "background-image", "background-repeat", "background-attachment", "background-position"], "background"); | |
b(["list-style-type", "list-style-position", "list-style-image"], "list-style"); | |
b(["outline-width", "outline-style", "outline-color"], "outline"); | |
d = ["", "-webkit-", "-moz-"]; | |
for (e = 0; e < d.length; e++) c([d[e] + "border-top-right-radius", d[e] + "border-top-left-radius", d[e] + "border-bottom-right-radius", d[e] + "border-bottom-left-radius"], d[e] + "border-radius"); | |
for (f in a) a.hasOwnProperty(f) && "auto" === a[f] && !/^overflow/.test(f) && delete a[f] | |
}, | |
compactHtml: function (a) { | |
for (var b = /(<[^<>]*)(style=")([^"]*)(")/gi, c = b.exec(a), d = 0, e = []; c;) { | |
e.push(a.substring(d, c.index)); | |
e.push(c[1]); | |
e.push(c[2]); | |
for (var d = {}, f = /\s*(.+?)\s*:\s*(.+?)\s*(?:;(?!base64,)|$)/g, g = f.exec(c[3]); g;) d[g[1].toLowerCase()] = g[2], g = f.exec(c[3]); | |
this.compactCss(d); | |
for (var j in d) d.hasOwnProperty(j) && e.push(j + ":" + d[j] + ";"); | |
e.push(c[4]); | |
d = b.lastIndex; | |
c = b.exec(a) | |
} | |
e.push(a.substring(d)); | |
return e = e.join("") | |
}, | |
getElementFromPoint: function () { | |
return !i.document.elementFromPoint ? | |
function () { | |
return null | |
} : function (a, b, c, d) { | |
var e = d.elementFromPoint(a, b); | |
if (!e) return null; | |
var f = c(e), | |
g = f.offset(), | |
g = { | |
left: g.left, | |
top: g.top | |
}; | |
this.adjustOffsetForMargins(c(e), g); | |
if ("iframe" === e.nodeName.toLowerCase()) { | |
a -= g.left - c(d).scrollLeft(); | |
b -= g.top - c(d).scrollTop(); | |
try { | |
var j = this.getElementFromPoint(a, b, c, f.contents()[0]); | |
if (j) { | |
var e = j, | |
m = f.trueCoordinates(); | |
g.left += m.left; | |
g.top += m.top | |
} | |
} catch (k) {} | |
} | |
this.shouldInclude(f, {}) || (e = null); | |
e && f.trueCoordinates(g); | |
return e | |
} | |
}(), | |
rewritePageHtml: function (a, b, c) { | |
function d(b) { | |
if (!b.hasClass(f)) { | |
var g = b[0].childNodes, | |
k, l, i, h; | |
if (!(b[0].tagName.toLowerCase() in { | |
head: 1, | |
style: 1, | |
link: 1, | |
meta: 1, | |
title: 1, | |
base: 1, | |
basefont: 1, | |
isindex: 1, | |
textarea: 1, | |
button: 1, | |
script: 1 | |
}) && a(g).is(function () { | |
return 3 === this.nodeType | |
})) for (k = 0; k < g.length; k++) if (h = g[k], 3 === h.nodeType && (l = h.nodeValue, !(3 >= l.replace(/\s*/, "").length))) { | |
var n = g[k + 1]; | |
a(h).remove(); | |
if (c.regexSplit) h = l.split(/([\r\n]{2,})/); | |
else for (h = []; l;) { | |
i = /^(.+?)([\r\n]{2,})/.exec(l); | |
if (!i) { | |
h.push(l); | |
break | |
} | |
h.push(i[1], i[2]); | |
l = l.substring(i[0].length) | |
} | |
for (l = 0; l < h.length; l++) i = a("<" + e + "/>").addClass(f).text(h[l] + (h[++l] || "")), n ? i.insertBefore(n) : i.appendTo(b) | |
} | |
for (k = 0; k < g.length; k++) 1 === g[k].nodeType && d(a(g[k])) | |
} | |
} | |
if (!a.htmlRewritten) { | |
var e = "node", | |
f = this.rewriteClass; | |
if (a.browser.msie && (!a.support.boxModel || "8.0" === a.browser.version)) e = "span"; | |
var g = b.relativeDir; | |
a("object").each(function () { | |
var b, c, d; | |
b = a(this); | |
c = b.attr("classid"); | |
d = b.attr("type"); | |
"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" === c && (b.attr("type") || b.attr("type", "application/x-shockwave-flash"), c = a("param[name=movie]", b), c.length && (c = c.attr("value"), b.attr("data") || b.attr("data_clipboard3141592654", c))); | |
if (("clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" === d || "application/x-shockwave-flash" === d) && a.support.htmlSerialize) d = a('param[name="wmode"][value="transparent"]', b), 0 === d.length && b.prepend('<param name="wmode" value="transparent">'), a('param[name="base"]', b).remove(), b.prepend('<param name="base" value="' + g + '">') | |
}); | |
a("embed").each(function () { | |
var b; | |
a(this).attr("base", g); | |
b = a(this).attr("wmode"); | |
if (!b || "transparent" !== b) a(this).attr("wmode", "transparent"), a(this).replaceWith(a(this).clone()) | |
}); | |
a("br").wrap(a("<" + e + "/>").addClass(f)); | |
d(a("body")); | |
a("iframe").each(function () { | |
try { | |
d(a(this).contents().find("body")) | |
} catch (b) {} | |
}); | |
a.htmlRewritten = !0 | |
} | |
}, | |
createSandbox: function (a, b) { | |
var b = b || "body", | |
c, d = { | |
display: "block", | |
left: "-10000px", | |
top: "-10000px", | |
visibility: "hidden", | |
border: "none", | |
position: "absolute", | |
opacity: 0, | |
overflow: "hidden", | |
padding: 0 | |
}, | |
e = !1, | |
f = a("<style/>").attr("id", this.addSuffix("reset")).attr("type", "text/css"); | |
try { | |
f.text('.clipping_314159265 { font-family: times, serif; font-size: 16px; font-weight: normal; font-style: normal; color: black; line-height: normal; margin: 0; padding: 0;}.clipping_314159265 td { font-size: 16px;}.clipping_314159265 * { color: black; font: inherit; border: 0;}.clipping_314159265 a { text-decoration: none;}.clipping_314159265 html,.clipping_314159265 address,.clipping_314159265 blockquote,.clipping_314159265 body,.clipping_314159265 dd,.clipping_314159265 div,.clipping_314159265 dl,.clipping_314159265 dt,.clipping_314159265 fieldset,.clipping_314159265 form,.clipping_314159265 frame,.clipping_314159265 frameset,.clipping_314159265 h1,.clipping_314159265 h2,.clipping_314159265 h3,.clipping_314159265 h4,.clipping_314159265 h5,.clipping_314159265 h6,.clipping_314159265 noframes,.clipping_314159265 ol,.clipping_314159265 p,.clipping_314159265 ul,.clipping_314159265 center,.clipping_314159265 dir,.clipping_314159265 hr,.clipping_314159265 menu,.clipping_314159265 pre { display: | |
block;}.clipping_314159265 div { text-align: left;}.clipping_314159265 li { display: list-item; list-style: none; list-style-type: none;}.clipping_314159265 head { display: none;}.clipping_314159265 table { display: table; table-layout: fixed;}.clipping_314159265 tr { display: table-row;}.clipping_314159265 thead { display: table-header-group;}.clipping_314159265 tbody { display: table-row-group;}.clipping_314159265 tfoot { display: table-footer-group;}.clipping_314159265 col { display: table-column;}.clipping_314159265 colgroup { display: table-column-group;}.clipping_314159265 td, .clipping_314159265 th { display: table-cell;}.clipping_314159265 caption { display: table-caption;}.clipping_314159265 th { font-weight: bolder; text-align: center;}.clipping_314159265 caption { text-align: center;}.clipping_314159265 h1 { font-size: 2em; margin: .67em 0;}.clipping_314159265 h2 { font-size: 1.5em; margin: .75em 0;}.clipping_314159265 h3 { font-size: 1.17em; margin: .83em 0;}.clipping_314159265 h4,.clipping_ | |
314159265 p,.clipping_314159265 blockquote,.clipping_314159265 ul,.clipping_314159265 fieldset,.clipping_314159265 form,.clipping_314159265 ol,.clipping_314159265 dl,.clipping_314159265 dir,.clipping_314159265 menu { margin: 1.12em 0;}.clipping_314159265 h5 { font-size: .83em; margin: 1.5em 0;}.clipping_314159265 h6 { font-size: .75em; margin: 1.67em 0;}.clipping_314159265 h1,.clipping_314159265 h2,.clipping_314159265 h3,.clipping_314159265 h4,.clipping_314159265 h5,.clipping_314159265 h6,.clipping_314159265 b,.clipping_314159265 strong { font-weight: bolder;}.clipping_314159265 blockquote { margin-left: 40px; margin-right: 40px;}.clipping_314159265 i,.clipping_314159265 cite,.clipping_314159265 em,.clipping_314159265 var,.clipping_314159265 address { font-style: italic; font-weight: normal;}.clipping_314159265 pre,.clipping_314159265 tt,.clipping_314159265 code,.clipping_314159265 kbd,.clipping_314159265 samp { font-family: monospace;}.clipping_314159265 pre { white-space: pre; background-color: transparent; | |
margin: 0; padding: 0;}.clipping_314159265 button,.clipping_314159265 textarea,.clipping_314159265 input,.clipping_314159265 select { display: inline-block; padding: 0; margin: 0;}.clipping_314159265 big { font-size: 1.17em;}.clipping_314159265 small, .clipping_314159265 sub, .clipping_314159265 sup { font-size: .83em;}.clipping_314159265 sub { vertical-align: sub;}.clipping_314159265 sup { vertical-align: super;}.clipping_314159265 table { border-spacing: 2px;}.clipping_314159265 thead, .clipping_314159265 tbody, .clipping_314159265 tfoot { vertical-align: middle;}.clipping_314159265 td, .clipping_314159265 th, .clipping_314159265 tr { vertical-align: inherit;}.clipping_314159265 s, .clipping_314159265 strike, .clipping_314159265 del { text-decoration: line-through;}.clipping_314159265 hr { border: none;}.clipping_314159265 ol,.clipping_314159265 ul,.clipping_314159265 dir,.clipping_314159265 menu,.clipping_314159265 dd { margin-left: 40px;}.clipping_314159265 ol { list-style-type: decimal;}.clipping_ | |
314159265 ul, .clipping_314159265 ol { margin: 0; padding: 0;}.clipping_314159265 u, .clipping_314159265 ins { text-decoration: underline;}.clipping_314159265 br:before { content: "A"; white-space: pre-line;}.clipping_314159265 center { text-align: center;}.clipping_314159265 img { border: 0;}') | |
} catch (g) { | |
f[0].text = '.clipping_314159265 { font-family: times, serif; font-size: 16px; font-weight: normal; font-style: normal; color: black; line-height: normal; margin: 0; padding: 0;}.clipping_314159265 td { font-size: 16px;}.clipping_314159265 * { color: black; font: inherit; border: 0;}.clipping_314159265 a { text-decoration: none;}.clipping_314159265 html,.clipping_314159265 address,.clipping_314159265 blockquote,.clipping_314159265 body,.clipping_314159265 dd,.clipping_314159265 div,.clipping_314159265 dl,.clipping_314159265 dt,.clipping_314159265 fieldset,.clipping_314159265 form,.clipping_314159265 frame,.clipping_314159265 frameset,.clipping_314159265 h1,.clipping_314159265 h2,.clipping_314159265 h3,.clipping_314159265 h4,.clipping_314159265 h5,.clipping_314159265 h6,.clipping_314159265 noframes,.clipping_314159265 ol,.clipping_314159265 p,.clipping_314159265 ul,.clipping_314159265 center,.clipping_314159265 dir,.clipping_314159265 hr,.clipping_314159265 menu,.clipping_314159265 pre { | |
display: block;}.clipping_314159265 div { text-align: left;}.clipping_314159265 li { display: list-item; list-style: none; list-style-type: none;}.clipping_314159265 head { display: none;}.clipping_314159265 table { display: table; table-layout: fixed;}.clipping_314159265 tr { display: table-row;}.clipping_314159265 thead { display: table-header-group;}.clipping_314159265 tbody { display: table-row-group;}.clipping_314159265 tfoot { display: table-footer-group;}.clipping_314159265 col { display: table-column;}.clipping_314159265 colgroup { display: table-column-group;}.clipping_314159265 td, .clipping_314159265 th { display: table-cell;}.clipping_314159265 caption { display: table-caption;}.clipping_314159265 th { font-weight: bolder; text-align: center;}.clipping_314159265 caption { text-align: center;}.clipping_314159265 h1 { font-size: 2em; margin: .67em 0;}.clipping_314159265 h2 { font-size: 1.5em; margin: .75em 0;}.clipping_314159265 h3 { font-size: 1.17em; margin: .83em 0;}.clipping_314159265 h4,. | |
clipping_314159265 p,.clipping_314159265 blockquote,.clipping_314159265 ul,.clipping_314159265 fieldset,.clipping_314159265 form,.clipping_314159265 ol,.clipping_314159265 dl,.clipping_314159265 dir,.clipping_314159265 menu { margin: 1.12em 0;}.clipping_314159265 h5 { font-size: .83em; margin: 1.5em 0;}.clipping_314159265 h6 { font-size: .75em; margin: 1.67em 0;}.clipping_314159265 h1,.clipping_314159265 h2,.clipping_314159265 h3,.clipping_314159265 h4,.clipping_314159265 h5,.clipping_314159265 h6,.clipping_314159265 b,.clipping_314159265 strong { font-weight: bolder;}.clipping_314159265 blockquote { margin-left: 40px; margin-right: 40px;}.clipping_314159265 i,.clipping_314159265 cite,.clipping_314159265 em,.clipping_314159265 var,.clipping_314159265 address { font-style: italic; font-weight: normal;}.clipping_314159265 pre,.clipping_314159265 tt,.clipping_314159265 code,.clipping_314159265 kbd,.clipping_314159265 samp { font-family: monospace;}.clipping_314159265 pre { white-space: pre; background-color: | |
transparent; margin: 0; padding: 0;}.clipping_314159265 button,.clipping_314159265 textarea,.clipping_314159265 input,.clipping_314159265 select { display: inline-block; padding: 0; margin: 0;}.clipping_314159265 big { font-size: 1.17em;}.clipping_314159265 small, .clipping_314159265 sub, .clipping_314159265 sup { font-size: .83em;}.clipping_314159265 sub { vertical-align: sub;}.clipping_314159265 sup { vertical-align: super;}.clipping_314159265 table { border-spacing: 2px;}.clipping_314159265 thead, .clipping_314159265 tbody, .clipping_314159265 tfoot { vertical-align: middle;}.clipping_314159265 td, .clipping_314159265 th, .clipping_314159265 tr { vertical-align: inherit;}.clipping_314159265 s, .clipping_314159265 strike, .clipping_314159265 del { text-decoration: line-through;}.clipping_314159265 hr { border: none;}.clipping_314159265 ol,.clipping_314159265 ul,.clipping_314159265 dir,.clipping_314159265 menu,.clipping_314159265 dd { margin-left: 40px;}.clipping_314159265 ol { list-style-type: decimal;}. | |
clipping_314159265 ul, .clipping_314159265 ol { margin: 0; padding: 0;}.clipping_314159265 u, .clipping_314159265 ins { text-decoration: underline;}.clipping_314159265 br:before { content: "A"; white-space: pre-line;}.clipping_314159265 center { text-align: center;}.clipping_314159265 img { border: 0;}' | |
} | |
try { | |
c = a("<iframe/>").cssImportant(d).attr({ | |
scrolling: "no", | |
frameborder: 0 | |
}).appendTo(b); | |
var h = c.contents()[0]; | |
h.open(); | |
h.write("<!doctype html>"); | |
h.close(); | |
c.contents().find("head").append(f).end().find("body").css({ | |
margin: 0 | |
}); | |
e = !0 | |
} catch (i) { | |
d.display = "block", c = a("<div/>").cssImportant(d).appendTo(b), a("#" + this.addSuffix("reset")).length || f.appendTo("head") | |
} | |
this.flagAsUnclippable(c); | |
var k = this; | |
return { | |
addSandboxCss: function (b) { | |
var c = k.addSuffix("clipText"), | |
b = a("<link/>").attr({ | |
id: c, | |
rel: "stylesheet", | |
type: "text/css", | |
href: b + "/css/1.1.17/clipper_sandbox.css" | |
}); | |
e ? this.$element.contents().find("head").append(b) : a("#" + c).length || b.appendTo("head") | |
}, | |
$body: e ? c.contents().find("body") : c, | |
getDimensions: function () { | |
return { | |
width: this.$body.outerWidth(!0), | |
height: this.$body.outerHeight(!0) | |
} | |
}, | |
append: function () { | |
this.$body.append.apply(this.$body, arguments) | |
}, | |
html: function (a) { | |
this.$body.html(a) | |
}, | |
empty: function () { | |
this.$body.empty() | |
}, | |
$element: c, | |
destroy: function () { | |
this.$element.remove() | |
} | |
} | |
} | |
} | |
})(window); | |
(function (e) { | |
function a(a) { | |
this.baseData = a | |
} | |
function c(a, b) { | |
b.attr("bgcolor") && (b.css("background-color", b.css("background-color")), b.removeAttr("bgcolor")); | |
var c = b.attr("background"); | |
c && (b.removeAttr("background"), b.css("background-image", "url(" + d.util.normalizeUri(c, this.baseData) + ")")) | |
} | |
var d = e.CLIPBOARD.client; | |
d.util.inherit(a, new d.extractors.TagTweaker); | |
a.prototype.tweakFully = c; | |
a.prototype.tweakPartially = c; | |
d.extractors.TableTweaker = a | |
})(window); | |
(function (d) { | |
function b(a, b) { | |
c.util.copyAttributeAndNormalize(a, b, "src", this.baseData); | |
c.util.copyAttributeIfExists(a, b, "type") | |
} | |
function a(a) { | |
this.baseData = a | |
} | |
var c = d.CLIPBOARD.client; | |
c.util.inherit(a, new c.extractors.TagTweaker); | |
a.prototype.tweakFully = b; | |
a.prototype.tweakPartially = b; | |
c.extractors.SourceTweaker = a | |
})(window); | |
(function (d) { | |
function b(a, b) { | |
"submit" === a.attr("type") ? b.attr("value", a.attr("value") || "Submit Query") : c.util.copyAttributeIfExists(a, b, "value") | |
} | |
function a() {} | |
var c = d.CLIPBOARD.client; | |
c.util.inherit(a, new c.extractors.TagTweaker); | |
a.prototype.tweakFully = b; | |
a.prototype.tweakPartially = b; | |
c.extractors.InputTweaker = a | |
})(window); | |
(function (f) { | |
function d(a) { | |
this.baseData = a | |
} | |
function e(a, c) { | |
b.util.copyAttributeAndNormalize(a, c, "src", this.baseData) | |
} | |
var b = f.CLIPBOARD.client; | |
b.util.inherit(d, new b.extractors.TagTweaker); | |
d.prototype.tweakFully = function (a, c) { | |
e.call(this, a, c); | |
b.util.copyAttributeIfExists(a, c, "width"); | |
b.util.copyAttributeIfExists(a, c, "height") | |
}; | |
d.prototype.tweakPartially = e; | |
b.extractors.ImageTweaker = d | |
})(window); | |
(function (a) { | |
function b() {} | |
a = a.CLIPBOARD.client; | |
a.util.inherit(b, new a.extractors.TagTweaker); | |
b.prototype.tweakFully = function (a, b) { | |
b.height(a.outerHeight()).width(a.outerWidth()) | |
}; | |
a.extractors.ButtonTweaker = b | |
})(window); | |
(function (d) { | |
function a(a) { | |
this.baseData = a | |
} | |
function b(a, b) { | |
c.util.copyAttributeAndNormalize(a, b, "href", this.baseData) | |
} | |
var c = d.CLIPBOARD.client; | |
c.util.inherit(a, new c.extractors.TagTweaker); | |
a.prototype.tweakFully = b; | |
a.prototype.tweakPartially = b; | |
c.extractors.AnchorTweaker = a | |
})(window); | |
(function (g) { | |
function f() { | |
this.events = {} | |
} | |
f.prototype = { | |
on: function (a, c) { | |
for (var a = a.split(" "), b = 0, d; b < a.length; b++) d = a[b], this.events[d] || (this.events[d] = []), this.events[d].push(c); | |
return this | |
}, | |
trigger: function (a, c) { | |
var b = this.events[a] || []; | |
if (b.length) { | |
for (var d = { | |
name: a | |
}, e = 0; e < b.length && !(!1 === b[e].call(this, c, d)); e++); | |
return this | |
} | |
}, | |
bubble: function (a) { | |
var c = this; | |
return { | |
to: function (b, d) { | |
c.on(a, function (c) { | |
b.trigger(d || a, c) | |
}); | |
return c | |
} | |
} | |
}, | |
clear: function (a) { | |
a ? this.events[a] = [] : this.events = {} | |
} | |
}; | |
g.CLIPBOARD.client.EventEmitter = f | |
})(window); | |
(function (d) { | |
function c(b) { | |
this.baseData = b | |
} | |
var b = d.CLIPBOARD.client; | |
b.util.inherit(c, new b.extractors.TagTweaker, new b.EventEmitter); | |
c.prototype.tweakFully = function (c, a) { | |
a.attr("src") && a.attr("src", b.util.normalizeUri(a.attr("src"), this.baseData)); | |
a.attr("poster") && a.attr("poster", b.util.normalizeUri(a.attr("poster"), this.baseData)); | |
void 0 !== a.attr("autoplay") && (a.removeAttr("autoplay"), this.trigger("autoplayDisabled", { | |
source: "video.autoplay" | |
})); | |
a.attr("controls", "controls") | |
}; | |
b.extractors.VideoTweaker = c | |
})(window); | |
(function (g) { | |
function f(e, b) { | |
var c = e.attr("name"); | |
if (c) switch (b.attr("name", c), c = c.toLowerCase(), c) { | |
case "flashvars": | |
b.attr("value", e.attr("value")); | |
a.util.disableAutoplayForUrl(b, "value") && this.trigger("autoplayDisabled", { | |
source: "param.flashvars" | |
}); | |
break; | |
case "play": | |
case "autostart": | |
"false" !== b.attr("value") && (b.attr("value", "false"), this.trigger("autoplayDisabled", { | |
source: "param." + c | |
})); | |
break; | |
case "movie": | |
a.util.copyAttributeAndNormalize(e, b, "value", this.baseData) | |
} | |
} | |
function d(a) { | |
this.baseData = a | |
} | |
var a = g.CLIPBOARD.client; | |
a.util.inherit(d, new a.extractors.TagTweaker, new a.EventEmitter); | |
d.prototype.tweakFully = f; | |
d.prototype.tweakPartially = f; | |
a.extractors.ParamTweaker = d | |
})(window); | |
(function (d) { | |
function b(a) { | |
this.baseData = a | |
} | |
var a = d.CLIPBOARD.client; | |
a.util.inherit(b, new a.extractors.TagTweaker, new a.EventEmitter); | |
b.prototype.tweakFully = function (b, c) { | |
a.util.copyAttributeAndNormalize(b, c, "data", this.baseData) && a.util.disableAutoplayForUrl(c, "data") && this.trigger("autoplayDisabled", { | |
source: "object.data" | |
}) | |
}; | |
a.extractors.ObjectTweaker = b | |
})(window); | |
(function (f) { | |
function e(a) { | |
this.baseData = a | |
} | |
var a = f.CLIPBOARD.client; | |
a.util.inherit(e, new a.extractors.TagTweaker, new a.EventEmitter); | |
e.prototype.tweakFully = function (d, b) { | |
a.util.copyAttributeAndNormalize(d, b, "src", this.baseData) && (a.util.disableAutoplayForUrl(b, "src") ? this.trigger("autoplayDisabled", { | |
source: "iframe.src" | |
}) : "#" === b.attr("src") && b.attr("src", "about:blank")); | |
a.util.copyAttributeIfExists(d, b, "scrolling"); | |
a.util.copyAttributeIfExists(d, b, "frameborder"); | |
a.util.copyAttributeIfExists(d, b, "webkitAllowFullScreen"); | |
a.util.copyAttributeIfExists(d, b, "allowFullScreen"); | |
var c = b.attr("src"); | |
/^http:\/\/www\.youtube\.com\/embed\//.test(c) && (c = -1 !== c.indexOf("wmode=") ? c.replace(/\bwmode=.*?([&|$])/i, "wmode=transparent$1") : c + ((-1 === c.indexOf("?") ? "?" : "&") + "wmode=transparent"), b.attr("src", c)) | |
}; | |
a.extractors.IframeTweaker = e | |
})(window); | |
(function (e) { | |
function b(a) { | |
this.baseData = a | |
} | |
var a = e.CLIPBOARD.client; | |
a.util.inherit(b, new a.extractors.TagTweaker, new a.EventEmitter); | |
b.prototype.tweakFully = function (b, c) { | |
a.util.copyAttributeAndNormalize(b, c, "src", this.baseData) && a.util.disableAutoplayForUrl(c, "src") && this.trigger("autoplayDisabled", { | |
source: "embed.src" | |
}); | |
if (a.util.copyAttributeIfExists(b, c, "flashvars")) if (a.util.disableAutoplayForUrl(c, "flashvars")) this.trigger("autoplayDisabled", { | |
source: "embed.flashvars" | |
}); | |
else { | |
var d = c.attr("flashvars"); | |
c.attr("flashvars", d + (d.length ? "&" : "") + "autoplay=false") | |
} | |
}; | |
a.extractors.EmbedTweaker = b | |
})(window); | |
(function (g) { | |
function i(b) { | |
b.props = {}; | |
b.props[h.util.doNotClipAllAttributeName] = !0; | |
return new this.xdm.Socket(b) | |
} | |
function e(b, d, a) { | |
this.baseUri = b; | |
this.sendAjaxRequest = d; | |
this.promises = []; | |
this.xdm = a | |
} | |
var h = g.CLIPBOARD.client, | |
f = { | |
crossDomainPostFailed: "crossDomainPostFailedForPromise", | |
emptyResponse: "emptyResponseFromPromise", | |
retryCount: "maxedOutPromiseRetryCount", | |
serverSideSave: "failedToSaveClipOrBlob", | |
promiseUnavailable: "promiseUnavailable", | |
timeout: "savingClipTimedOut", | |
malformedResponse: "malformedJsonInClipSaveResponse", | |
invalidResponse: "invalidResponseSavingClip", | |
expiredRequest: "expiredRequest", | |
expiredSession: "expiredSession", | |
unauthorized: "unauthorized", | |
badRequest: "badRequest", | |
emptyResult: "emptyResultSavingClip", | |
unknown: "unknown" | |
}; | |
e.promiseResult = { | |
processing: 0, | |
succeeded: 1, | |
failedToSave: -1, | |
unavailable: -2 | |
}; | |
e.sendFailureStatus = f; | |
h.util.inherit(e, new h.EventEmitter); | |
e.prototype.constructor = e; | |
h.util.merge(e.prototype, { | |
addPromiseCheck: function (b, d) { | |
var a = this, | |
d = d || (new Date).getTime(); | |
a.promises.push(b); | |
if (!a.promises.timeoutId) a.promises.timeoutId = setTimeout(function () { | |
a.promises.timeoutId = null; | |
if (0 !== a.promises.length) { | |
var c = a.promises.shift(); | |
a.sendAjaxRequest({ | |
dataType: "jsonp", | |
url: a.baseUri + "api/v1/promises/" + encodeURIComponent(c.key), | |
error: function () { | |
a.trigger("sendFailed", { | |
reason: f.crossDomainPostFailed | |
}) | |
}, | |
success: function (b) { | |
if (b) switch (b.status) { | |
case e.promiseResult.processing: | |
if (10 < c.tryCount) { | |
a.trigger("sendFailed", { | |
reason: f.retryCount | |
}); | |
break | |
} | |
c.tryCount++; | |
a.addPromiseCheck(c, d); | |
break; | |
case e.promiseResult.succeeded: | |
a.trigger("sendSucceeded", { | |
retryAttempts: c.tryCount, | |
duration: (new Date).getTime() - d | |
}); | |
break; | |
case e.promiseResult.failedToSave: | |
a.trigger("sendFailed", { | |
reason: f.serverSideSave | |
}); | |
break; | |
case e.promiseResult.unavailable: | |
a.trigger("sendFailed", { | |
reason: f.promiseUnavailable | |
}) | |
} else a.trigger("sendFailed", { | |
reason: f.emptyResponse | |
}) | |
} | |
}) | |
} | |
}, 500) | |
}, | |
updatePreferences: function (b) { | |
var d = {}; | |
h.util.forEach(b, function (a, b) { | |
d[b] = "object" === typeof a ? g.CLIPBOARD.JSON.stringify(a) : a | |
}); | |
var a = i.call(this, { | |
remote: this.baseUri + "utils/xdm", | |
onReady: function () { | |
var c = g.CLIPBOARD.JSON.stringify({ | |
APIpath: "/api/v1/users", | |
method: "PUT", | |
data: d | |
}); | |
a.postMessage(c) | |
}, | |
onMessage: function () { | |
a.destroy() | |
} | |
}) | |
}, | |
sendClip: function (b) { | |
this.trigger("sendingClip"); | |
var d = this, | |
a = setTimeout(function () { | |
d.trigger("sendFailed", { | |
reason: f.timeout | |
}) | |
}, 3E4), | |
c = i.call(this, { | |
remote: d.baseUri + "utils/xdm", | |
onReady: function () { | |
clearTimeout(a); | |
c.postMessage(g.CLIPBOARD.JSON.stringify({ | |
APIpath: "/api/v1/clips", | |
method: "POST", | |
data: b | |
})) | |
}, | |
onMessage: function (a) { | |
var b; | |
if (a && 0 < a.length) try { | |
if (a = g.CLIPBOARD.JSON.parse(a), a.error) { | |
var e = a.error; | |
b = e.expiredSession ? f.expiredSession : e.expiredRequest ? f.expiredRequest : e.badRequest ? f.badRequest : e.unauthorized ? f.unauthorized : f.unknown | |
} else a.result ? d.addPromiseCheck({ | |
key: a.result.promiseKey, | |
tryCount: 0 | |
}) : b = f.emptyResult | |
} catch (h) { | |
b = f.malformedResponse | |
} else b = f.invalidResponse; | |
b && d.trigger("sendFailed", { | |
reason: b | |
}); | |
c.destroy() | |
} | |
}) | |
}, | |
logMetric: function (b, d, a) { | |
var c = this; | |
setTimeout(function () { | |
c.sendAjaxRequest(c.baseUri + "api/v1/metrics/" + (a.guid || ""), { | |
type: "GET", | |
data: { | |
eventName: b, | |
sessionId: a.sessionId, | |
data: d || {} | |
}, | |
dataType: "jsonp" | |
}) | |
}, 20) | |
}, | |
fetchAutocompleteData: function () { | |
var b = this, | |
d = i.call(this, { | |
remote: b.baseUri + "utils/xdm", | |
onReady: function () { | |
var a = g.CLIPBOARD.JSON.stringify({ | |
action: "fetchAutocompleteData" | |
}); | |
d.postMessage(a) | |
}, | |
onMessage: function (a) { | |
if (a && a.length) { | |
var c = null; | |
try { | |
c = g.CLIPBOARD.JSON.parse(a).result, b.trigger("autocompleteDataReceived", { | |
dict: c | |
}) | |
} catch (e) { | |
b.trigger("autocompleteDataFailed", { | |
error: "invalidJson" | |
}) | |
} | |
} else b.trigger("autocompleteDataFailed", { | |
error: "xdmFailed" | |
}); | |
d.destroy() | |
} | |
}) | |
}, | |
fetchUserData: function () { | |
var b = this, | |
d = i.call(b, { | |
remote: this.baseUri + "utils/xdm", | |
onReady: function () { | |
d.postMessage(g.CLIPBOARD.JSON.stringify({ | |
action: "fetchUserData" | |
})) | |
}, | |
onMessage: function (a) { | |
var c; | |
if (!a || !a.length) c = { | |
error: !0, | |
message: "Empty response" | |
}; | |
else try { | |
c = g.CLIPBOARD.JSON.parse(a) | |
} catch (e) { | |
c = { | |
error: !0, | |
message: "Invalid json" | |
} | |
} | |
b.trigger("userDataReceived", { | |
error: c.error ? c.message : null, | |
config: c.config, | |
loggedIn: c.loggedIn, | |
preferences: c.preferences, | |
userGuid: c.guid, | |
sessionId: c.sid, | |
thirdPartyCookiesEnabled: c.thirdPartyCookiesEnabled | |
}); | |
d.destroy() | |
} | |
}) | |
} | |
}); | |
h.DataAccess = e | |
})(window); | |
(function (d) { | |
function c() { | |
this.controls = [] | |
} | |
c.prototype = { | |
activate: function () { | |
this.trigger("activating"); | |
this.doActivate(); | |
for (var a = 0; a < this.controls.length; a++) this.controls[a].activate(); | |
this.trigger("activated") | |
}, | |
doActivate: function () {}, | |
deactivate: function () { | |
this.trigger("deactivating"); | |
for (var a = 0; a < this.controls.length; a++) this.controls[a].deactivate(); | |
this.doDeactivate(); | |
this.trigger("deactivated") | |
}, | |
doDeactivate: function () {}, | |
removeControl: function (a) { | |
if (a) for (var b = 0; b < this.controls.length; b++) if (this.controls[b] === a) { | |
this.controls.splice(b, 1); | |
break | |
} | |
}, | |
setLoginState: function () {}, | |
getResources: function () {} | |
}; | |
d.CLIPBOARD.client.ActivatableControl = c | |
})(window); | |
(function (a) { | |
function b() {} | |
a = a.CLIPBOARD.client; | |
a.util.inherit(b, new a.UiController, new a.ActivatableControl, new a.EventEmitter); | |
b.prototype.constructor = b; | |
a.ui.NoOpUiController = b | |
})(window); | |
(function (q) { | |
function b(a) { | |
return "widget_" + i.util.addSuffix(a) | |
} | |
function o(a, e) { | |
for (var d = e.split(" "), c = 0; c < d.length; c++) if (/Active_clipboard_314159265$/.test(d[c])) return d[c]; | |
return "" | |
} | |
function s(a) { | |
return function () { | |
return b(a + "Active") | |
} | |
} | |
function Q(a) { | |
return function () { | |
var e; | |
e = /Active_clipboard_314159265\b/.test(a.$("#" + d.selectorType)[0].className); | |
a.trigger("navigated", { | |
source: "initiate", | |
type: a.currentSelectorType, | |
status: e ? "disabled" : "enabled" | |
}) | |
} | |
} | |
function R(a) { | |
this.trigger("selectorSwitched", { | |
type: a | |
}) | |
} | |
function z() { | |
var a = this.$("#" + d.flyout).cssImportant("background-color", "#57443f"); | |
this.$.browser.webkit && a.show(); | |
a.slideDown(250); | |
this.$("#" + d.menuContainer).addClass(H) | |
} | |
function t(a) { | |
var e = this.$, | |
b = this; | |
e("#" + d.flyout).slideUp(250, function () { | |
e(this).empty(); | |
b.activeTab = null; | |
e(this).cssImportant("background-color", "transparent"); | |
e("#" + d.menuContainer).removeClass(H); | |
a && a() | |
}) | |
} | |
function I(a, e) { | |
var d = a.$; | |
return function () { | |
var c = d(this), | |
b = {}; | |
b[e] = c.is('input[type="checkbox"]') ? c.is(":checked") : c.val(); | |
J.call(a, b) | |
} | |
} | |
function J(a) { | |
this.trigger("preferencesUpdated", { | |
preferences: a | |
}) | |
} | |
function S() { | |
var a = this.$, | |
e = this, | |
j = a("#" + d.clipContainer).find("." + u).andSelf(); | |
if (this.activeTab === l.selectors) t.call(this, function () { | |
p(j, !1) | |
}); | |
else { | |
p(j, !0); | |
var c = []; | |
i.util.forEach(T, function (j, h) { | |
var m = h.toLowerCase(), | |
k = a("<div/>").addClass(A).applyBlockStyles(), | |
g = a("<div/>").applyBlockStyles().attr("id", b(m + "Dark")).addClass(v).appendTo(k); | |
m === e.currentSelectorType && g.addClass(s(m + "Dark")); | |
a("<h4/>").applyBlockStyles().addClass(b("selectorHeader")).mouseover(function () { | |
m !== e.currentSelectorType && g.addClass(s(m + "Dark")) | |
}).mouseout(function () { | |
m !== e.currentSelectorType && g.removeClass(o) | |
}).mousedown(function (c) { | |
c.stopPropagation(); | |
R.call(e, m); | |
var b = a(this).find("." + v)[0]; | |
a("#" + d.flyout).find("." + v).filter(function () { | |
return this !== b | |
}).removeClass(o) | |
}).append(g).append(a("<span/>").applyInlineStyles().text(h)).appendTo(k); | |
a("<div/>").applyBlockStyles().html(j).find("p").applyBlockStyles().end().appendTo(k); | |
c.push(k[0]) | |
}); | |
B.call(this, a(c)); | |
z.call(this) | |
} | |
} | |
function U() { | |
var a = this.$, | |
e = a("#" + d.help); | |
if (this.activeTab === l.help) t.call(this, function () { | |
w(e, !1); | |
p(e, !1) | |
}); | |
else { | |
w(e, !0); | |
p(e, !0); | |
var j = []; | |
i.util.forEach(V, function (c, e) { | |
var d = b(e), | |
k = a("<div/>").addClass(W).applyBlockStyles(); | |
a("<div/>").applyBlockStyles().addClass(d + " " + v).addClass(s(e)).appendTo(k); | |
a("<div/>").applyBlockStyles().addClass(X).html(c).find("p").applyBlockStyles().end().appendTo(k); | |
j.push(k[0]) | |
}); | |
for (var c = 0; c < j.length - 1; c++) a("<div/>").applyBlockStyles().addClass(b("divider")).appendTo(j[c]); | |
B.call(this, a(j)); | |
z.call(this) | |
} | |
} | |
function B(a) { | |
function e() { | |
function e() { | |
if ("auto" !== f) { | |
c.height("auto"); | |
var a = c.height(); | |
c.height(f); | |
c.animate({ | |
height: a | |
}, 200, "linear", function () { | |
c.height("auto"); | |
c.cssImportant("overflow", "auto") | |
}) | |
} | |
} | |
c.empty().append(a.hide()); | |
b.support.opacity ? a.fadeIn(250).promise().done(e) : (a.show(), e()) | |
} | |
var b = this.$, | |
c = b("#" + d.flyout), | |
f = c.height(), | |
f = f || "auto", | |
h = c.height(f).cssImportant("overflow", "hidden").contents(); | |
b.support.opacity ? h.fadeOut(250).promise().done(e) : (h.remove(), e()) | |
} | |
function Y() { | |
var a = this.$, | |
e = this, | |
j = a("#" + d.preferences); | |
if (this.activeTab === l.preferences) t.call(this, function () { | |
w(j, !1); | |
p(j, !1) | |
}); | |
else { | |
w(j, !0); | |
p(j, !0); | |
var c = a("<div/>").applyBlockStyles().addClass(A); | |
a("<h4/>").applyBlockStyles().text("Clip settings").appendTo(c); | |
var f = a("<table/>").applyTableStyles(), | |
h = []; | |
a("<tr/>").applyTableRowStyles().append(a("<td/>").applyTableCellStyles().append(a("<input/>").applyInlineStyles().attr({ | |
type: "checkbox", | |
id: b("preferencesReview"), | |
checked: this.preferences.reviewClip | |
}).change(I(this, "reviewClip"))), a("<td/>").applyTableCellStyles().append(a("<label/>").applyInlineStyles().attr({ | |
"for": b("preferencesReview") | |
}).text("Review clip before saving"))).appendTo(f); | |
a("<tr/>").applyTableRowStyles().append(a("<td/>").applyTableCellStyles().append(a("<input/>").applyInlineStyles().attr({ | |
type: "checkbox", | |
id: b("preferencesPublish"), | |
checked: this.preferences.publishByDefault | |
}).change(I(this, "publishByDefault"))), a("<td/>").applyTableCellStyles().append(a("<label/>").applyInlineStyles().attr({ | |
"for": b("preferencesPublish") | |
}).text("Publish clips by default"))).appendTo(f); | |
f.appendTo(c); | |
h.push(c[0]); | |
var c = a("<div/>").applyBlockStyles().addClass(A), | |
m = a("<ul/>").applyListStyles().attr("id", d.colorRadioList); | |
a("<h4/>").applyBlockStyles().text("Rectangle color").appendTo(c); | |
i.util.forEach(i.util.rectColors, function (c, d) { | |
var b = e.rgbaSupport ? "rgba(" + c.startColor.join(",") + ", 0.25)" : "rgb(" + c.startColor.join(",") + ")"; | |
a("<li/>").applyListItemStyles().cssImportant("background-color", b).click(function (a) { | |
return function () { | |
J.call(e, { | |
rectangleColor: a | |
}) | |
} | |
}(d)).appendTo(m) | |
}); | |
c.append(m); | |
c.append(a("<div/>").cssImportant("clear", "left")); | |
h.push(c[0]); | |
h.push(a("<div/>").cssImportant("clear", "left")[0]); | |
B.call(this, a(h)); | |
z.call(this) | |
} | |
} | |
function Z(a) { | |
var e = a.$; | |
return function () { | |
var b = e(this), | |
c = a.$container.find("." + K), | |
f = e("#" + d.menu), | |
h = (c.length - 1) * n + n / 3; | |
a.$container.data("expanded") ? t.call(a, function () { | |
f.find("." + u + ", " + x).filter(":not(#" + d.selectorType + ")").each(function () { | |
e(this).removeClass(o).removeClass(C).parent().removeClass(o).removeClass(L) | |
}); | |
var a = e(this); | |
f.animate({ | |
width: f.width() - h | |
}, 250, "easeInCubic", function () { | |
a.empty(); | |
c.hide(); | |
b.toggleClass(D + " " + M) | |
}) | |
}) : (f.width(f.width()), c.show(), f.animate({ | |
width: f.width() + h | |
}, 250, "easeInCubic", function () { | |
b.toggleClass(D + " " + M) | |
})); | |
a.$container.data("expanded", !a.$container.data("expanded")) | |
} | |
} | |
function w(a, e) { | |
var d = /^widget_(.+?)_clipboard_314159265$/.exec(a.attr("id"))[1]; | |
e ? a.addClass(s(d)) : a.removeClass(o) | |
} | |
function p(a, e) { | |
a.toggleClass(C, e).closest("." + x).toggleClass(L, e) | |
} | |
function E(a) { | |
this.$container.find("." + u + ", " + x).filter(":not(#" + d.selectorType + ")").removeClass(o); | |
p(this.$container.find("." + C), !1); | |
this.trigger("navigated", { | |
source: a | |
}); | |
switch (a) { | |
case l.help: | |
U.call(this); | |
break; | |
case l.preferences: | |
Y.call(this); | |
break; | |
case l.selectors: | |
S.call(this) | |
} | |
this.activeTab = l[a] | |
} | |
function $(a) { | |
var e = this; | |
this.$container.fadeOut("fast", function () { | |
e.$container.remove(); | |
e.$container = null; | |
a && a.call(e) | |
}) | |
} | |
function N(a) { | |
function e(a, e, b) { | |
a = c("<div/>").applyBlockStyles().attr("id", a + "_container").addClass(x + " " + r).append("<div/>").find("div").applyBlockStyles().attr("id", a).addClass(u).end(); | |
void 0 !== b && a.cssImportant("left", b); | |
e && a.addClass(K); | |
return a | |
} | |
var b = this, | |
c = b.$, | |
f = c("<div/>").applyBlockStyles().attr("id", d.clipContainer).addClass(r).append(e(d.selectorType, !1).toggleClass(r + " " + d.rectangle)).append(e(d.selectorDropDown, !0).removeClass(r)), | |
h = n + n / 3; | |
this.$container = c("<div/>").applyBlockStyles().attr("id", d.login).append("<div/>").find("div:first").applyBlockStyles().attr("id", d.menuContainer).append("<div/>").find("div:first").applyBlockStyles().attr("id", d.menuBackground).append(c("<div/>").applyBlockStyles().attr("id", d.message)).append("<div/>").find("div:eq(1)").width(n + n / 2).applyBlockStyles().attr("id", d.menu).append(f).append(e(d.preferences, !0, h + 0 * n)).append(e(d.help, !0, h + 1 * n)).append(e(d.home, !0, h + 2 * n)).append(e(d.close, !0, h + 3 * n)).append(e(d.expand).find("div").addClass(D).end()).end().end().end().append(c("<div/>").applyBlockStyles().attr("id", d.flyout).hide()); | |
c("body").append(this.$container); | |
c.support.boxModel ? c("#" + d.menuBackground).cssImportant("background-image", 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAYAAACkJ9JhAAAAt0lEQVQImQXBDS8CAQCA4ffnYQwRSQ2lUpfcLleSSulDXcvHGIb5qa/n4e85kd/VXH6WM/lOpvK1GMvn44N8zEbyPrmXt3FfXkc9eRl25WnQkVWvLctuLMnttSw6TZnfRDJrhTKNGzJpXso4CmQU1mQYVmXQKEu/XpJeUJS7WkG61TPpVE6lXcpL6zwncfFY4kJWopNDCfNpucrtSyObkvrRjgSZbakebMlFelMqextSTq1LaXfNf6t8Z14HSskhAAAAAElFTkSuQmCC")') : (c("#" + d.menuBackground).cssImportant({ | |
"padding-bottom": 0 | |
}), c("#" + d.flyout).cssImportant({ | |
position: "relative", | |
top: -2, | |
left: -1 | |
})); | |
i.util.flagAsUnclippable(this.$container); | |
this.$container.data("expanded", !1); | |
c("#" + d.selectorType).mousedown(Q(b)); | |
c("#" + d.selectorDropDown).click(function () { | |
E.call(b, l.selectors) | |
}); | |
c("#" + d.home).click(function () { | |
b.trigger("navigated", { | |
source: "home" | |
}); | |
q.open(b.baseUri, "clipboard_blank") | |
}); | |
c("#" + d.close).click(function () { | |
b.trigger("navigated", { | |
source: "close" | |
}) | |
}); | |
c("#" + d.expand).click(Z(this)); | |
c("#" + d.help).click(function () { | |
E.call(b, l.help) | |
}); | |
c("#" + d.preferences).click(function () { | |
E.call(b, l.preferences) | |
}); | |
F.call(this, "login", a) | |
} | |
function aa(a) { | |
var e = this, | |
b = e.baseUri, | |
c = e.$; | |
this.$container = c("<div/>").applyBlockStyles().attr("id", d.logout).append(c("<div/>").addClass(d.logoutLogo)).append(c("<div/>").addClass(d.logoutLoginSection).append(c("<p/>").addClass(d.logoutText).applyBlockStyles().append("Existing user?").append(c("<a/>").applyBlockStyles().addClass(d.logoutButton).addClass(d.logoutButtonBlue).attr({ | |
href: b + "login?popup=1", | |
target: "_blank", | |
id: d.loginLink | |
}).click(function () { | |
e.trigger("loginClicked", { | |
$element: c(this) | |
}); | |
return !1 | |
}).text("Log in")))).append(c("<div/>").addClass(d.logoutRegisterSection).append(c("<p/>").addClass(d.logoutText).applyBlockStyles().append("New to Clipboard?").append(c("<a/>").applyBlockStyles().addClass(d.logoutButton).addClass(d.logoutButtonGreen).attr({ | |
href: b + "register?source=widget&popup=1", | |
target: "_blank", | |
id: d.registerLink | |
}).click(function () { | |
e.trigger("registerClicked", { | |
$element: c(this) | |
}); | |
return !1 | |
}).text("Sign Up")))); | |
i.util.flagAsUnclippable(this.$container); | |
c("body").append(this.$container); | |
F.call(this, "logout", a) | |
} | |
function O(a) { | |
var e = this.$; | |
this.$container = e("<div/>").applyBlockStyles().attr("id", d.waiting).append(e("<img/>").applyInlineStyles().attr("id", d.spinner).attr("src", this.staticBaseUrl + "/images/1.1.17/loadingClipper.gif")); | |
i.util.flagAsUnclippable(this.$container); | |
e("body").append(this.$container); | |
F.call(this, "waiting", a) | |
} | |
function F(a, e) { | |
var b = this.$, | |
c = this; | |
this.$container.cssImportant({ | |
top: 0, | |
right: 20 | |
}); | |
b.support.opacity && this.$container.cssImportant("opacity", 0); | |
var d = { | |
top: "+=" + P | |
}; | |
if (b.support.opacity) d.opacity = ba; | |
i.util.assureFixedPositioning(this.$container); | |
this.$container.animate(d, 200, function () { | |
c.trigger("controlDisplayed", { | |
type: a | |
}); | |
e && e() | |
}) | |
} | |
function y(a, e) { | |
var b = this.$container && this.$container.attr("id"), | |
c; | |
switch (a) { | |
case "login": | |
c = N; | |
break; | |
case "logout": | |
c = aa; | |
break; | |
case "waiting": | |
c = O; | |
break; | |
default: | |
e && e.call(this); | |
return | |
} | |
var f = this, | |
h = function () { | |
c.call(f, e) | |
}; | |
b ? b !== d[a] ? $.call(this, h) : e && e.call(this) : h() | |
} | |
function g(a) { | |
this.$container = null; | |
this.baseUri = a.baseUri; | |
this.staticBaseUrl = a.staticBaseUrl; | |
this.$ = a.$; | |
this.currentSelectorType = "rectangle"; | |
this.activeTab = null; | |
this.rgbaSupport = a.support.rgba; | |
this.isLoggedIn = !1 | |
} | |
var i = q.CLIPBOARD.client, | |
P = 20, | |
K = b("verboseItem"), | |
D = b("expand"), | |
M = b("collapse"), | |
v = b("inlineIcon"), | |
H = b("flyout"), | |
A = b("preferencesBlock"), | |
C = b("selectedTab"), | |
L = b("selectedTabContainer"), | |
W = b("helpBlock"), | |
X = b("helpText"), | |
u = b("menuItemIcon"), | |
x = b("menuItemContainer"), | |
r = b("menuItemHoverContainer"), | |
n = 42, | |
ba = 0.99, | |
l = { | |
help: "help", | |
preferences: "preferences", | |
selectors: "selectors" | |
}, | |
d = { | |
loginLink: b("loginLink"), | |
registerLink: b("registerLink"), | |
clipContainer: b("clipContainer"), | |
selectorType: b("selectorType"), | |
rectangle: b("rectangle"), | |
home: b("home"), | |
close: b("close"), | |
bookmark: b("bookmark"), | |
text: b("text"), | |
help: b("help"), | |
preferences: b("preferences"), | |
expand: b("expand"), | |
message: b("message"), | |
logout: b("logoutControl"), | |
login: b("loginControl"), | |
selectorDropDown: b("selectorDropDown"), | |
menu: b("menu"), | |
menuContainer: b("menuContainer"), | |
menuBackground: b("menuBackground"), | |
flyout: b("flyout"), | |
colorRadioList: b("colorRadioList"), | |
waiting: b("waitingControl"), | |
spinner: b("waitingControlSpinner"), | |
logoutLogo: b("logout_logo"), | |
logoutText: b("logout_text"), | |
logoutLoginSection: b("logout_login"), | |
logoutRegisterSection: b("logout_register"), | |
logoutButton: b("logout_btn"), | |
logoutButtonBlue: b("logout_blue_button"), | |
logoutButtonGreen: b("logout_green_button") | |
}, | |
V = { | |
rectangle: '<p>Go to "clip mode." Just move your mouse around until you find something you like, and click.</p><p>You can also click and drag your mouse to get a better selection, or scroll the mousewheel to zoom in or out.</p><p>If you have text selected, this will automatically put you into "text mode" and extract the selected text.</p>', | |
text: '<p>Switch to "text mode." Highlight some text, and it will format it in an easy-to-read fashion.</p>', | |
preferences: "<p>Adjust your clipping preferences.</p>", | |
home: "<p>Open up your Clipboard home page in a new window.</p>", | |
close: "<p>Hide the Clipper.</p>" | |
}, | |
T = { | |
Rectangle: "<p>Select a rectangular region to clip. This is the default setting.</p>", | |
Text: "<p>Select a region to clip by highlighting text.</p>" | |
}, | |
G = function () { | |
function a(a, b, k) { | |
var i = this.$; | |
i("#" + d.menu).find("." + r + ":first").cssImportant("border-top-left-radius", "0px").cssImportant("border-bottom-left-radius", "0px"); | |
a = i("#" + d.message).removeClass().addClass(k).html(a); | |
k = a.show().width(); | |
i.support.boxModel ? a.cssImportant("width", "1px").animate({ | |
width: k | |
}, f, "easeOutCubic", function () { | |
i(this).width("auto") | |
}) : (a.cssImportant({ | |
visibility: "hidden", | |
position: "absolute", | |
width: "auto" | |
}).show(), k = a.parent().width() - a.next().width() - a.outerWidth() + 2, a.cssImportant({ | |
left: k, | |
visibility: "visible" | |
})); | |
var l = this, | |
a = void 0 === b ? g : b; | |
c = void 0 === b || 0 <= b ? q.setTimeout(function () { | |
e.call(l) | |
}, a) : 0 | |
} | |
function e(a) { | |
var b = this.$; | |
c = q.clearTimeout(c); | |
b.support.boxModel ? (b("#" + d.menu).find("." + r + ":first").cssImportant("border-top-left-radius", "4px").cssImportant("border-bottom-left-radius", "4px"), b("#" + d.message).animate({ | |
width: 0 | |
}, f, "easeInCubic", function () { | |
b(this).hide().width("auto"); | |
a && a() | |
})) : (b("#" + d.message).hide(), a && a()) | |
} | |
var g = 3E3, | |
c, f = 200; | |
return { | |
showMessage: function (c, d) { | |
var f = this; | |
y.call(this, "login", function () { | |
e.call(f, function () { | |
a.call(f, c, d, b("messageSuccess")) | |
}) | |
}) | |
}, | |
hideMessage: e, | |
showErrorMessage: function (c, d) { | |
var f = this; | |
y.call(this, "login", function () { | |
e.call(f, function () { | |
a.call(f, c, d, b("messageError")) | |
}) | |
}) | |
} | |
} | |
}(); | |
i.util.inherit(g, new i.ActivatableControl, new i.EventEmitter); | |
g.prototype.constructor = g; | |
g.prototype.enableClipping = function (a) { | |
var b = this, | |
g = q.setInterval(function () { | |
if (b.$container && b.$container.attr("id") === d.login) { | |
q.clearInterval(g); | |
var c = d[b.currentSelectorType]; | |
b.$("#" + d.selectorType).removeClass(c).addClass(d[a]).addClass(s(a)); | |
b.currentSelectorType = a | |
} | |
}, 100) | |
}; | |
g.prototype.doActivate = function () { | |
this.$container || (this.isLoggedIn ? N.call(this) : O.call(this)) | |
}; | |
g.prototype.doDeactivate = function () { | |
if (this.$container) { | |
var a = this, | |
b = { | |
top: "-=" + (P + this.$container.height()) | |
}; | |
if (this.$.support.opacity) b.opacity = 0; | |
this.$container.animate(b, function () { | |
a.$container.remove(); | |
a.$container = null | |
}) | |
} | |
this.activeTab = null | |
}; | |
g.prototype.show = function () { | |
this.$container && this.$container.fadeIn("fast") | |
}; | |
g.prototype.hide = function () { | |
this.$container && this.$container.fadeOut("fast") | |
}; | |
g.prototype.showMessage = G.showMessage; | |
g.prototype.hideMessage = G.hideMessage; | |
g.prototype.showErrorMessage = G.showErrorMessage; | |
g.prototype.disableClipping = function () { | |
this.hideMessage(); | |
this.$("#" + d.selectorType).removeClass(o) | |
}; | |
g.prototype.setPreferences = function (a) { | |
this.preferences = a | |
}; | |
g.prototype.showLoadingMessage = function () { | |
y.call(this, "waiting") | |
}; | |
g.prototype.setLoginState = function (a) { | |
this.isLoggedIn = a; | |
y.call(this, a ? "login" : "logout") | |
}; | |
i.ui.Widget = g | |
})(window); | |
(function (a) { | |
function b(a) { | |
this.$ = a.$; | |
this.baseUri = a.baseUri; | |
this.baseData = a.baseData | |
} | |
a = a.CLIPBOARD.client; | |
a.util.inherit(b, new a.Extractor, new a.ActivatableControl, new a.EventEmitter); | |
a.util.merge(b.prototype, { | |
constructor: b, | |
extract: function (a, b) { | |
this.trigger("extracted", { | |
elapsedTime: 0, | |
html: "", | |
text: "", | |
compressedHtml: "", | |
dimensions: { | |
width: 1280, | |
height: 1024 | |
}, | |
top: 0, | |
left: 0, | |
extractionType: b.extractionType | |
}) | |
} | |
}); | |
b.prototype.type = "bookmark"; | |
a.extractors.BookmarkExtractor = b | |
})(window); | |
(function (h) { | |
function o(a) { | |
function n(a, e) { | |
if (3 === a.nodeType) 0 < a.nodeValue.length && e.appendChild(a.cloneNode(!0)); | |
else if (1 === a.nodeType) { | |
var f = a.nodeName.toLowerCase(); | |
if (!l[f]) { | |
m[f] ? (e.appendChild(b.util.safeClone(i(a))[0]), e = e.lastChild, f = e.getAttribute("href"), null !== f && e.setAttribute("href", b.util.normalizeUri(f, d))) : p[f] && e.firstChild && (e.appendChild(g.createElement("br")), e.appendChild(g.createElement("br"))); | |
for (var f = 0, c = a.childNodes.length; f < c; f++) n(a.childNodes[f], e) | |
} | |
} | |
} | |
for (var d = this.baseData, i = this.$, j = this.document.createDocumentFragment(), g = this.document, c = 0, h = a.childNodes.length, k; c < h; c++) k = a.childNodes[c], n(k, j); | |
return j | |
} | |
function q(a) { | |
return '<blockquote class="' + r + '"><p class="' + s + '">' + a + "</p></blockquote>" | |
} | |
function t(a) { | |
var b = a.ownerDocument.createElement("div"); | |
b.appendChild(a); | |
return b.innerHTML | |
} | |
function d(a) { | |
this.$ = a.$; | |
this.baseData = a.baseData; | |
this.document = a.document; | |
this.staticBaseUrl = a.staticBaseUrl | |
} | |
var b = h.CLIPBOARD.client, | |
r = "clipboard_blockquote_314159265", | |
s = "clipboard_blockquote_text_314159265", | |
m = { | |
b: 1, | |
strong: 1, | |
em: 1, | |
i: 1, | |
code: 1, | |
samp: 1, | |
kbd: 1, | |
tt: 1, | |
"var": 1, | |
a: 1, | |
s: 1, | |
del: 1, | |
sup: 1, | |
sub: 1, | |
ins: 1, | |
u: 1, | |
abbr: 1, | |
acronym: 1, | |
small: 1, | |
big: 1, | |
dfn: 1, | |
br: 1, | |
q: 1, | |
cite: 1 | |
}, | |
p = { | |
p: 1 | |
}, | |
l = { | |
script: 1, | |
noscript: 1, | |
noembed: 1, | |
embed: 1, | |
object: 1, | |
meta: 1, | |
base: 1, | |
head: 1, | |
style: 1, | |
noframes: 1 | |
}; | |
d.prototype.constructor = d; | |
b.util.inherit(d, new b.Extractor, new b.ActivatableControl, new b.EventEmitter); | |
d.prototype.extract = function (a, d) { | |
var l = (new Date).getTime(), | |
i = o.call(this, a.fragment), | |
j = q(t(i)), | |
g = b.util.createSandbox(this.$), | |
c = this.$("<div/>").attr("id", b.util.addSuffix("sandbox_readiness")); | |
g.addSandboxCss(this.staticBaseUrl); | |
g.html(j); | |
g.append(c); | |
i = c.attr("id"); | |
c.attr("id", "foo").attr("id", i); | |
var m = this, | |
k = h.setInterval(function () { | |
if ("-9123px" === c.css("left")) { | |
h.clearInterval(k); | |
c.remove(); | |
g.$body.width(570); | |
var b = g.getDimensions(); | |
g.destroy(); | |
m.trigger("extracted", { | |
elapsedTime: (new Date).getTime() - l, | |
html: j, | |
text: a.text, | |
dimensions: b, | |
extractionType: "text", | |
left: d.left, | |
top: d.top | |
}) | |
} | |
}, 100) | |
}; | |
d.prototype.type = "text"; | |
b.extractors.TextExtractor = d | |
})(window); | |
(function (e) { | |
function f(a) { | |
return function () { | |
d.call(a) | |
} | |
} | |
function g(a) { | |
return function (b) { | |
27 === b.keyCode && (a.deactivate(), a.trigger("canceled", { | |
source: "escapeKey" | |
})) | |
} | |
} | |
function d() { | |
var a = this.getSelection(); | |
a.text && this.trigger("selectionEnded", { | |
selectionType: "text", | |
selectionData: a, | |
extractionContext: { | |
top: a.top, | |
left: a.left | |
} | |
}) | |
} | |
function b(a) { | |
this.type = "text"; | |
this.$ = a.$; | |
this.document = a.document; | |
this.startCoordinates = { | |
x: null, | |
y: null | |
}; | |
this.activated = !1; | |
this.getExtractor = function () { | |
return new c.extractors.TextExtractor(a) | |
} | |
} | |
var c = e.CLIPBOARD.client; | |
c.util.inherit(b, new c.Selector, new c.ActivatableControl, new c.EventEmitter); | |
b.prototype.constructor = b; | |
b.prototype.doActivate = function () { | |
if (!this.activated) this.activated = !0, this.startCoordinates.x = null, this.startCoordinates.y = null, this.enableGlobalEvents(), this.select() | |
}; | |
b.prototype.doDeactivate = function () { | |
this.disableGlobalEvents(); | |
this.activated = !1 | |
}; | |
b.prototype.getSelection = function () { | |
var a = c.util.getRangeData(this.document); | |
return { | |
fragment: a.fragment, | |
text: c.util.trim(a.text), | |
top: a.offset.top, | |
left: a.offset.left | |
} | |
}; | |
b.prototype.select = d; | |
b.prototype.enableGlobalEvents = function () { | |
this.$(this.document).on("mouseup.clipboard_text_selector", f(this)).on("keydown.clipboard_text_selector", g(this)) | |
}; | |
b.prototype.disableGlobalEvents = function () { | |
this.$(this.document).off(".clipboard_text_selector") | |
}; | |
b.prototype.shouldUseAsDefault = function () { | |
return !!c.util.trim(this.getSelection().text) | |
}; | |
c.selectors.TextSelector = b | |
})(window); | |
(function (f) { | |
function h(a) { | |
var b = [], | |
c; | |
for (c in a) a.hasOwnProperty(c) && b.push(c + "=" + a[c]); | |
return b.join(",") | |
} | |
function i(a, b, c) { | |
var d = this.$, | |
g, e; | |
void 0 === f.screenLeft ? (g = f.screenX, e = f.screenY) : (g = f.screenLeft, e = f.screenTop); | |
e += 100; | |
c ? (d = c.offset(), g += d.left + c.outerWidth() / 2, e += d.top + c.outerHeight() / 2) : (g += d(f).width() / 2, d(f).height()); | |
a = Math.max(0, g - a / 2); | |
b = Math.max(0, e - b / 2); | |
return { | |
left: a, | |
top: b | |
} | |
} | |
function j() { | |
var a = this, | |
b = f.setInterval(function () { | |
if (a.window.closed) a.alreadyClosed || a.trigger("closed", { | |
source: "manual" | |
}), f.clearInterval(b), a.alreadyClosed = !1 | |
}, 100) | |
} | |
function d(a, b, c) { | |
e.EventEmitter.call(this); | |
e.ActivatableControl.call(this); | |
c = c || {}; | |
this.$ = a.$; | |
this.xdm = a.xdm; | |
this.domain = a.domain; | |
this.url = b; | |
this.name = c.name || "popup_" + Math.round(1E6 * Math.random()); | |
this.width = c.width || 640; | |
this.height = c.height || 480 | |
} | |
var e = f.CLIPBOARD.client; | |
e.util.inherit(d, new e.ActivatableControl, new e.EventEmitter); | |
e.util.merge(d.prototype, { | |
constructor: d, | |
name: "", | |
window: null, | |
params: { | |
location: "yes", | |
resizable: "yes", | |
alwaysRaised: "yes" | |
}, | |
open: function (a) { | |
if (this.isOpen()) return this.window.focus(), this.window; | |
this.window && this.destroy(); | |
e.popups[this.name] = { | |
done: !1 | |
}; | |
var b = this.$, | |
a = b.extend({ | |
width: this.width, | |
height: this.height | |
}, this.params, i.call(this, this.width, this.height, a)), | |
c = b('iframe[name="' + this.name + '"]'); | |
c.length || (c = b("<iframe/>").attr("src", "https://" + this.domain + "/utils/clipper-connect-iframe").attr("name", this.name).css({ | |
top: -1E4, | |
left: -1E4, | |
display: "none", | |
position: "absolute" | |
}).appendTo("body")); | |
this.window = f.open(this.url, this.name + Math.round(1E5 * Math.random()), h(a)); | |
j.call(this); | |
var d = this; | |
b(f).on("message.clipboard_review", function (a) { | |
a = a.originalEvent; | |
!a || a.origin !== "https://" + d.domain || 0 !== a.data.indexOf("clipboard:") || (d.trigger("externalWorkCompleted", { | |
status: a.data.substring(10) | |
}), c.remove(), c = null) | |
}); | |
this.trigger("opened", { | |
window: this.window | |
}); | |
return this.window | |
}, | |
close: function (a, b) { | |
if (this.isOpen()) { | |
if ("manual" !== a) this.alreadyClosed = !0; | |
this.window.close(); | |
this.$(f).off("message.clipboard_review"); | |
this.trigger("closed", { | |
source: a || "programmatic", | |
status: b | |
}) | |
} | |
}, | |
destroy: function () { | |
this.close(); | |
this.window = null; | |
this.trigger("destroyed") | |
}, | |
isOpen: function () { | |
return this.window ? !this.window.closed : !1 | |
}, | |
doDeactivate: function () { | |
this.destroy() | |
} | |
}); | |
d.getOrigin = function () { | |
return f.location.href | |
}; | |
d.factory = function (a, b) { | |
switch (a) { | |
case "login": | |
return new d(b, b.baseUri + "login?display=popup", { | |
name: "clipboardLogin", | |
width: 640, | |
height: 400 | |
}); | |
case "register": | |
return new d(b, b.baseUri + "register?source=" + b.origin + "&display=popup", { | |
name: "clipboardRegister", | |
width: 1024, | |
height: 768 | |
}); | |
default: | |
throw Error("Unsupported popup window type"); | |
} | |
}; | |
e.ui.PopupWindow = d | |
})(window); | |
(function (g) { | |
function a(b) { | |
return "review_" + e.util.addSuffix(b) | |
} | |
function v(b, c, a) { | |
b.trigger("confirmed", { | |
method: a, | |
clip: c.clip, | |
reviewData: B.call(b) | |
}) | |
} | |
function B() { | |
var b = this.$, | |
a = e.util.trim(b("#" + c.annotationInput).val()); | |
a === b("#" + c.annotationInput).attr("placeholder") && (a = ""); | |
return { | |
title: e.util.trim(b("#" + c.titleInput).val()), | |
tweet: this.clipAction.postToTwitter, | |
postToFacebook: this.clipAction.postToFacebook, | |
published: this.clipAction.publish, | |
annotation: a | |
} | |
} | |
function r(b, a) { | |
b.trigger("canceled", { | |
method: a | |
}) | |
} | |
function C(b) { | |
var a = this.$, | |
e = a("<div/>").attr("id", c.bookmarkTitle).text(b.clip.title), | |
b = a("<div/>").attr("id", c.bookmarkSubtitle).text(b.clip.source), | |
d = a("<img/>").attr("id", c.bookmarkImage).attr("src", this.staticBaseUrl + "/images/1.1.17/bookmarkMed.png"), | |
e = a("<div/>").attr("id", c.bookmarkWrapper).append(d, e, b); | |
return a("<div/>").append(e).html() | |
} | |
function s(b) { | |
var a = "Publish" === b ? "publish" : "postTo" + b; | |
this.clipAction[a] = !this.clipAction[a]; | |
this.$("#" + c["actionMenuItem" + b]).toggleClass(c.actionMenuActive) | |
} | |
function k(b, a) { | |
return function (c) { | |
"success" === c.status && (s.call(b, a), b.preferences["connectedTo" + a] || b.trigger("socialNetworkConnected", { | |
network: a | |
}), b[a.toLowerCase() + "Window"].close({ | |
source: "external" | |
})) | |
} | |
} | |
function l(b, a) { | |
return function () { | |
b.$("#" + c["actionMenuItem" + a]).removeClass(c.spinner) | |
} | |
} | |
function f(a) { | |
this.baseUri = a.baseUri; | |
this.staticBaseUrl = a.staticBaseUrl; | |
this.$ = a.$; | |
this.domain = a.domain; | |
this.document = a.document; | |
this.$dialog = this.$overlay = null; | |
this.preferences = {}; | |
this.sandbox = null; | |
this.clipAction = { | |
publish: !1, | |
postToFacebook: !1, | |
postToTwitter: !1 | |
}; | |
this.facebookWindow = new e.ui.PopupWindow(a, "about:blank", { | |
name: "facebookStream" + e.util.idSuffix, | |
width: 650, | |
height: 310 | |
}); | |
var c = "twitter" + e.util.idSuffix, | |
f = "https://" + this.domain + "/oauth/twitter/?source=clipper&origin=" + g.encodeURIComponent(e.ui.PopupWindow.getOrigin()) + "&proxy=" + c; | |
this.twitterWindow = new e.ui.PopupWindow(a, f, { | |
name: c, | |
width: 550, | |
height: 550 | |
}); | |
this.twitterWindow.on("externalWorkCompleted", k(this, "Twitter")).on("closed", l(this, "Twitter")); | |
this.facebookWindow.on("externalWorkCompleted", k(this, "Facebook")).on("closed", l(this, "Facebook")); | |
this.controls = [this.facebookWindow, this.twitterWindow] | |
} | |
var e = g.CLIPBOARD.client, | |
c = { | |
overlay: a("overlay"), | |
fancyButton: a("button"), | |
bookmarkTitle: a("bookmarkTitle"), | |
bookmarkSubtitle: a("bookmarkSubtitle"), | |
bookmarkImage: a("bookmarkImage"), | |
bookmarkWrapper: a("bookmarkWrapper"), | |
activeControl: a("activeControl"), | |
publishControl: a("publishControl"), | |
publishWrapper: a("publishWrapper"), | |
publishText: a("publishText"), | |
annotationInput: a("annotate"), | |
autocompleteTrigger: a("autocompleteTrigger"), | |
dialog: a("dialog"), | |
header: a("header"), | |
titleInput: a("title"), | |
contents: a("contents"), | |
clipContents: a("clipContents"), | |
controls: a("controls"), | |
control: a("control"), | |
footer: a("footer"), | |
inputContainer: a("inputContainer"), | |
buttonWrapper: a("buttonWrapper"), | |
save: a("save"), | |
cancel: a("cancel"), | |
actionMenu: a("actionMenu"), | |
actionMenuItem: a("actionMenuItem"), | |
actionMenuItemFacebook: a("actionMenuItemFacebook"), | |
actionMenuItemTwitter: a("actionMenuItemTwitter"), | |
actionMenuItemPublish: a("actionMenuItemPublish"), | |
actionMenuIcon: a("actionMenuIcon"), | |
actionMenuIcon_publish: a("actionMenuIcon_publish"), | |
actionMenuIcon_facebook: a("actionMenuIcon_facebook"), | |
actionMenuIcon_twitter: a("actionMenuIcon_twitter"), | |
actionMenuLabel: a("actionMenuLabel"), | |
actionMenuActive: a("actionMenuActive"), | |
spinner: a("spinner"), | |
wrapper: a("wrapper") | |
}; | |
e.util.inherit(f, new e.ActivatableControl, new e.EventEmitter); | |
f.prototype.close = function () { | |
if (this.isOpen()) { | |
this.trigger("closing"); | |
this.$("#" + c.annotationInput).autocompleteMe("destroy"); | |
if (this.sandbox) this.sandbox.destroy(), this.sandbox = null; | |
var a = this, | |
f = this.$; | |
this.$overlay.fadeOut(200, function () { | |
a.$overlay.remove(); | |
a.$overlay = null | |
}); | |
this.$dialog.fadeOut(200, function () { | |
a.$dialog.remove(); | |
a.$dialog = null | |
}); | |
this.clipAction = { | |
publish: this.preferences.publishByDefault, | |
postToFacebook: !1, | |
postToTwitter: !1 | |
}; | |
f(this.document).off("." + e.util.eventNamespace.review); | |
this.trigger("closed") | |
} | |
}; | |
f.prototype.open = function (b) { | |
function f(a) { | |
return function () { | |
var b = t.caret(), | |
c = t.val(); | |
t.val(c.substring(0, b.start) + a + c.substring(b.start)).caret(b.start + 1, b.start + 1); | |
h.trigger("autocompleteTriggered", { | |
source: "clickTrigger", | |
type: "#" === a ? "tag" : "user" | |
}) | |
} | |
} | |
function k(b) { | |
var c = "autocompleteTrigger" + ("#" === b ? "Tag" : "User"), | |
e = "#" === b ? "tags" : "connections"; | |
return d("<span/>").applyInlineStyles().attr("id", a(c)).attr("title", "Show " + e).text(b).click(f(b)) | |
} | |
var d = this.$, | |
h = this; | |
h.trigger("opening"); | |
var l = d(g).width(), | |
u = d(g).height(), | |
j = b.clip.height + 2 + 30 + 158, | |
n, m = b.clip.width, | |
i = b.clip.height, | |
x = b.rawHtml; | |
"bookmark" === b.clip.type ? (x = C.call(this, b), n = m = 640, i = 120, j = Math.min(u - 100, i + 2 + 30 + 158)) : (n = Math.min(Math.max(600, b.clip.width + 50), l - 100), j = Math.min(j, u - 100)); | |
this.$dialog = d("<div/>").applyBlockStyles().attr("id", c.dialog); | |
var y = d("<div/>").applyBlockStyles().attr("id", c.header); | |
d("<input/>").applyTextInputStyles().attr({ | |
type: "text", | |
id: c.titleInput, | |
tabindex: 1, | |
placeholder: "Enter a title for your clip", | |
value: e.util.trim(b.clip.title) || this.document.title | |
}).appendTo(y); | |
var o = d("<div/>").applyBlockStyles().attr("id", c.contents).cssImportant("height", j - 158 + "px"); | |
d("<div/>").applyBlockStyles().attr("id", c.clipContents).cssImportant({ | |
height: i | |
}).appendTo(o); | |
var p = d("<div/>").applyBlockStyles().attr("id", c.footer), | |
q = d("<div/>").applyBlockStyles().attr("id", c.inputContainer).appendTo(p), | |
z = e.util.trim(b.clip.annote || ""), | |
t = d("<input/>").applyTextInputStyles().attr({ | |
tabindex: 2, | |
id: c.annotationInput, | |
placeholder: "Enter annotation, #tags and @mentions", | |
title: "Enter annotation, #tags and @mentions", | |
spellcheck: "true", | |
type: "text", | |
value: z ? z + " " : "" | |
}).on("keypress keydown keyup", function (a) { | |
27 === a.keyCode || 13 === a.keyCode || a.stopPropagation() | |
}).autocompletify({ | |
fixed: !0, | |
setCss: function (a, b, c) { | |
a.cssImportant(b, c) | |
}, | |
createElement: function (a) { | |
a = d("<" + a + "/>"); | |
return "block" === a.css("display") ? a.applyBlockStyles() : a.applyInlineStyles() | |
} | |
}).appendTo(q); | |
d("<div/>").applyBlockStyles().attr("id", c.autocompleteTrigger).append(k("#")).append(k("@")).appendTo(q); | |
(function () { | |
function a(b, e) { | |
var f = c.actionMenuItem, | |
g = b.toLowerCase(), | |
w = !1; | |
e && (f += " " + c.actionMenuActive); | |
if ("facebook" === g || "twitter" === g) w = !h.isLoggedIn; | |
f = d("<div/>").applyBlockStyles().addClass(f).attr("id", c["actionMenuItem" + b]).append(d("<span/>").applyInlineStyles().attr("id", c["actionMenuIcon_" + g]).addClass(c.actionMenuIcon)).append(d("<span/>").applyInlineStyles().addClass(c.actionMenuLabel).text(b)).click(function () { | |
"publish" === g ? s.call(h, b) : h.clipAction[g] ? h[g + "Window"].close() : h.preferences["Twitter" === b ? "connectedToTwitter" : "connectedToFbStream"] ? s.call(h, b) : (d(this).addClass(c.spinner), h[g + "Window"].open(d(this))) | |
}); | |
w && f.hide(); | |
return f | |
} | |
var b = d("<div/>").applyBlockStyles().attr("id", c.actionMenu).append(a("Publish", h.preferences.publishByDefault)); | |
h.preferences.connectedToTimeline || b.append(a("Facebook")); | |
return b.append(a("Twitter")) | |
})().appendTo(p); | |
var A = d("<span/>").applyInlineStyles().attr({ | |
id: c.cancel | |
}).text("Cancel").click(function () { | |
r(h, "cancelButton") | |
}), | |
q = d("<button/>").applyInlineStyles().attr({ | |
id: c.save, | |
tabindex: 3 | |
}).addClass(c.fancyButton).text("Save").click(function () { | |
v(h, b, "saveButton") | |
}); | |
d("<div/>").applyBlockStyles().attr("id", c.buttonWrapper).append(A, q).appendTo(p); | |
d("<div/>").applyBlockStyles().attr("id", c.wrapper).append(y, o, p).appendTo(this.$dialog); | |
this.$dialog.appendTo("body").find('input[type="text"]').placeholder(!0); | |
this.sandbox = e.util.createSandbox(d, d("#" + c.clipContents)); | |
this.sandbox.$element.cssImportant({ | |
visibility: "visible", | |
left: "auto", | |
top: "auto", | |
position: "static", | |
width: m, | |
height: i, | |
opacity: 1 | |
}); | |
this.sandbox.addSandboxCss(this.staticBaseUrl); | |
this.sandbox.html('<div class="' + e.util.clipContainerClass + '">' + x + "</div>"); | |
e.util.assureFixedPositioning(this.$dialog); | |
i = m = 0; | |
!d.support.boxModel && d.browser.msie && "8.0" === d.browser.version && (m = d(g).scrollTop(), i = d(g).scrollLeft()); | |
this.$overlay = d("<div>").applyBlockStyles().attr("id", c.overlay).cssImportant({ | |
top: 0, | |
left: 0, | |
position: "fixed" | |
}).appendTo("body"); | |
e.util.assureFixedPositioning(this.$overlay); | |
this.$overlay.animate({ | |
opacity: 0.8 | |
}, 500); | |
this.$dialog.cssImportant({ | |
left: b.clip.left - d(g).scrollLeft() - 15, | |
top: b.clip.top - d(g).scrollTop() - 81, | |
width: n, | |
height: j | |
}).css("opacity", 0).animate({ | |
opacity: 0.9 | |
}, 500); | |
this.$dialog.animate({ | |
left: 0.5 * (l - n) + i, | |
top: 0.5 * (u - j) + m, | |
opacity: 1 | |
}, 700, "easeOutExpo", function () { | |
var a = d(this).find("#" + c.annotationInput), | |
b = a.val().length; | |
a.focus().caret(b, b) | |
}); | |
d(this.document).on("keydown." + e.util.eventNamespace.review, function (a) { | |
27 === a.keyCode ? r(h, "escapeKey") : 13 === a.keyCode && (a.target === A[0] ? r(h, "cancelButton") : v(h, b, "enterKey")) | |
}); | |
(function () { | |
if (d.browser.webkit && "wolframalpha.com" === document.domain) { | |
var a = []; | |
o.find("img").attr("src", function () { | |
a.push(d(this).attr("src")); | |
d(this).css("opacity", "1"); | |
return "foo" | |
}); | |
var b = 0; | |
g.setTimeout(function () { | |
o.find("img").attr("src", function () { | |
return a[b++] | |
}) | |
}, 1E3) | |
} | |
})(); | |
this.trigger("opened") | |
}; | |
f.prototype.constructor = f; | |
f.prototype.isOpen = function () { | |
return !!this.$overlay && !! this.$dialog | |
}; | |
f.prototype.doDeactivate = function () { | |
if (this.isOpen() && (this.close(), this.sandbox)) this.sandbox.destroy(), this.sandbox = null | |
}; | |
f.prototype.setPreferences = function (a) { | |
this.preferences = a; | |
this.clipAction.publish = !! this.preferences.publishByDefault | |
}; | |
f.prototype.setLoginState = function (a) { | |
if (this.isLoggedIn = a) a = "https://" + this.domain + "/utils/clipper-connect?origin=" + e.ui.PopupWindow.getOrigin() + "&proxy=" + this.facebookWindow.name, this.facebookWindow.url = "http://www.facebook.com/dialog/oauth/?scope=email,publish_stream&client_id=" + g.CLIPBOARD.config.facebookAppId + "&redirect_uri=" + g.encodeURIComponent(a) + "&display=popup&response_type=token"; | |
this.isOpen() && (a = this.isLoggedIn ? "fadeIn" : "fadeOut", this.$("#" + c.actionMenuIcon_facebook).parent()[a]("slow"), this.$("#" + c.actionMenuIcon_twitter).parent()[a]("slow")) | |
}; | |
e.ui.Review = f | |
})(window); | |
(function (k) { | |
function m(a) { | |
function b() { | |
i.remove(); | |
e.remove(); | |
l.remove(); | |
h.remove() | |
} | |
var c = this.$, | |
e = c("<div/>").css({ | |
position: "fixed", | |
top: 0, | |
left: 0, | |
background: "#000000", | |
zIndex: j, | |
opacity: 0.5, | |
width: "100%", | |
height: "100%" | |
}), | |
f = "#faq-third-party-cookies", | |
g = k.navigator.userAgent; | |
/MSIE/i.test(g) ? f += "-ie" : /Firefox/i.test(g) ? f += "-firefox" : /Chrome/i.test(g) ? f += "-chrome" : /Safari/i.test(g) && (f += "-safari"); | |
g = ""; | |
switch (a) { | |
case "cookies": | |
g = '<p style="">The clipper requires 3rd party cookies to be enabled. Head over to our <a target="_blank" href="' + this.baseUri + "help" + f + '" style="color: #469CB9">help page</a> for instructions on how to enable them.</p>' | |
} | |
var g = g + '<p style="position: absolute; bottom: 40px; margin: 0 auto; width: 90%">Click anywhere to dismiss this message.</p>', | |
a = { | |
top: "50%", | |
left: "50%", | |
display: "none", | |
width: 600, | |
height: 440, | |
padding: "20px", | |
"margin-left": -300, | |
"margin-top": -220, | |
position: "fixed" | |
}, | |
h = c("<div/>").css(c.extend({}, a, { | |
background: "#eee", | |
"z-index": j + 3 | |
})).appendTo("body"), | |
i = c("<div/>").css(c.extend({}, a, { | |
background: "transparent url(" + this.staticBaseUrl + "/images/1.1.17/logo1.png) no-repeat center center", | |
opacity: 0.3, | |
"z-index": j + 4 | |
})), | |
l = c("<div/>"); | |
l.css(c.extend({}, a, { | |
zIndex: j + 5, | |
"-webkit-border-radius": "3px", | |
"-moz-border-radius": "3px", | |
"border-radius": "3px", | |
"-webkit-box-shadow": "-3px 3px 10px rgba(0,0,0,0.75)", | |
"box-shadow": "-3px 3px 10px rgba(0,0,0,0.75)", | |
background: "transparent", | |
color: "rgb(57,39,27)", | |
"text-align": "center", | |
"font-family": '"lucida grande", tahoma, verdana, arial, sans-serif', | |
"font-size": "22px" | |
})).html(g); | |
c.each([h, e, i, l], function () { | |
this.appendTo("body").fadeIn().click(b) | |
}); | |
d.util.assureFixedPositioning(e) | |
} | |
function n(a) { | |
return function () { | |
a.$(k).unbind("." + h); | |
a.$(a.document).unbind("." + h); | |
a.widget.hide() | |
} | |
} | |
function o(a) { | |
return function () { | |
a.widget.show() | |
} | |
} | |
function p(a) { | |
return function (b) { | |
a.trigger("reviewConfirmed", b); | |
a.review.close(); | |
var c = b.clip; | |
c.postToFacebook = b.reviewData.postToFacebook; | |
c.tweet = b.reviewData.tweet; | |
c.annotation = b.reviewData.annotation; | |
c["private"] = !b.reviewData.published; | |
c.title = b.reviewData.title || c.title; | |
a.trigger("clipConfirmed", { | |
clip: c | |
}) | |
} | |
} | |
function q() { | |
var a = this; | |
this.review.on("opening", n(this)).on("closing", o(this)).on("confirmed", p(this)).on("canceled", function () { | |
a.review.close() | |
}).on("socialNetworkConnected", function (b) { | |
var c = { | |
preferences: {} | |
}; | |
if ("Twitter" === b.network) c.preferences.connectedToTwitter = !0; | |
else if ("Facebook" === b.network) c.preferences.connectedToFbStream = !0; | |
a.trigger("preferencesUpdated", c) | |
}).bubble("preferencesUpdated").to(this).bubble("autocompleteTriggered").to(this).bubble("closing").to(this, "reviewClosing").bubble("closed").to(this, "reviewClosed").bubble("opening").to(this, "reviewOpening").bubble("canceled").to(this, "reviewCanceled"); | |
this.widget.on("loginClicked", function (b) { | |
a.loginWindow.open(b.$element) | |
}).on("registerClicked", function (b) { | |
a.registerWindow.open(b.$element) | |
}).bubble("navigated").to(this).bubble("selectorSwitched").to(this).bubble("preferencesUpdated").to(this).bubble("displayed").to(this, "controlsDisplayed"); | |
this.loginWindow.on("opened", function () { | |
a.registerWindow.close() | |
}).on("closed", function () { | |
a.trigger("userDataRequested") | |
}); | |
this.registerWindow.on("opened", function () { | |
a.loginWindow.close() | |
}).on("closed", function () { | |
a.trigger("userDataRequested") | |
}) | |
} | |
function e(a, b) { | |
this.baseUri = a.baseUri; | |
this.staticBaseUrl = a.staticBaseUrl; | |
this.$ = a.$; | |
this.document = a.document; | |
this.shouldShowReview = a.preferences.reviewClip; | |
b = d.util.merge(d.util.merge({}, { | |
review: i.review(a), | |
widget: i.widget(a) | |
}), b); | |
this.review = b.review; | |
this.widget = b.widget; | |
this.loginWindow = d.ui.PopupWindow.factory("login", a); | |
this.registerWindow = d.ui.PopupWindow.factory("register", a); | |
this.controls = [this.review, this.widget, this.loginWindow, this.registerWindow]; | |
q.call(this) | |
} | |
var d = k.CLIPBOARD.client, | |
j = 9999999, | |
h = "clipboard_ui", | |
i = { | |
review: function (a) { | |
return new d.ui.Review(a) | |
}, | |
widget: function (a) { | |
return new d.ui.Widget(a) | |
} | |
}; | |
d.util.inherit(e, new d.UiController, new d.ActivatableControl, new d.EventEmitter); | |
e.prototype.constructor = e; | |
e.prototype.doDeactivate = function () { | |
this.hideNotification() | |
}; | |
d.util.merge(e.prototype, { | |
showLoadingMessage: function () { | |
this.widget.showLoadingMessage() | |
}, | |
show3rdPartyCookiesErrorMessage: function () { | |
m.call(this, "cookies") | |
}, | |
showNotification: function (a, b) { | |
this.widget.showMessage(a, b) | |
}, | |
hideNotification: function (a) { | |
this.widget.hideMessage(a) | |
}, | |
showErrorNotification: function (a, b) { | |
this.widget.showErrorMessage(a, b) | |
}, | |
enableClipping: function (a) { | |
this.widget.enableClipping(a) | |
}, | |
disableClipping: function (a) { | |
this.widget.disableClipping(a) | |
}, | |
handleExtraction: function (a) { | |
this.shouldShowReview ? this.review.open(a) : this.trigger("clipConfirmed", a) | |
}, | |
setPreferences: function (a) { | |
this.shouldShowReview = !! a.reviewClip; | |
this.widget.setPreferences(a); | |
this.review.setPreferences(a) | |
}, | |
setLoginState: function (a) { | |
this.widget.setLoginState(a); | |
this.review.setLoginState(a) | |
} | |
}); | |
d.ui.WidgetUiController = e | |
})(window); | |
(function (A) { | |
function B(a, b, c) { | |
function e(b) { | |
b = h.util.getOuterDimensions(b); | |
return 0 < b.area && (b.left > a.right || b.right < a.left || b.top > a.bottom || b.bottom < a.top) | |
} | |
function d(a) { | |
var b = f(a); | |
if (!(!b.hasClass(h.util.rewriteClass) && !b.is(":visible") || e(b))) if (b.attr(h.util.cullNodeAttributeFlag, !0), n.push(a), b.children().each(function () { | |
d(this) | |
}), "iframe" === a.nodeName.toLowerCase()) try { | |
d(b.contents()[0].documentElement) | |
} catch (c) {} | |
} | |
function g(a, b) { | |
for (var c = a, e = b; c.length && e.length;) { | |
c = c.next(); | |
if (!c.length) { | |
c = b; | |
e = a; | |
break | |
} | |
if (c[0] === b[0]) { | |
c = a; | |
e = b; | |
break | |
} | |
e = e.next(); | |
if (e[0] === a[0]) { | |
c = b; | |
e = a; | |
break | |
} | |
if (!e.length) { | |
c = a; | |
e = b; | |
break | |
} | |
} | |
do if (d(c[0]), c[0] === e[0]) break; | |
while (c = c.next()) | |
} | |
var f = this.$, | |
j = this.document, | |
i, t, u, l, n = []; | |
l = !1; | |
if (b[0] === j.documentElement || c[0] === j.documentElement) i = j.documentElement; | |
else if (b[0] === c[0]) i = c[0]; | |
else { | |
j = b.allParents().toArray(); | |
l = c.allParents().toArray(); | |
j.reverse(); | |
l.reverse(); | |
j.push(b[0]); | |
l.push(c[0]); | |
c = Math.max(j.length, l.length); | |
for (b = 0; b < c; b++) { | |
var v = j[b], | |
k = l[b]; | |
if (v !== k) { | |
i = j[b - 1]; | |
t = f(v); | |
u = f(k); | |
break | |
} | |
} | |
if (!i) return []; | |
l = !0 | |
}(function (a) { | |
a.setAttribute(h.util.cullNodeAttributeFlag, !0); | |
var b = f(a).allParents().each(function () { | |
this.setAttribute(h.util.cullNodeAttributeFlag, !0) | |
}); | |
n.push(a); | |
Array.prototype.push.apply(n, b.toArray()) | |
})(i); | |
l ? g(t, u) : d(i); | |
return n | |
} | |
function w(a, b, c) { | |
var e = a.constructor; | |
if (a.hasClass(h.util.rewriteClass)) { | |
for (var a = a.contents(), d = 0, g = 0; g < a.length; g++) c.firstIteration = !1, d = o.call(this, e(a[g]), b, c) || d; | |
return d | |
} | |
return 0 | |
} | |
function x(a) { | |
for (var a = a.split(","), b = [], c = 0, e, d; c < a.length; c++) { | |
e = a[c]; | |
d = e.charAt(0); | |
if ('"' === d && e.charAt(e.length - 1) === d) { | |
if (-1 !== e.indexOf("'")) continue; | |
e = "'" + e.substring(1, e.length - 1) + "'" | |
} | |
b.push(e) | |
} | |
return b.join(",") | |
} | |
function m(a, b) { | |
for (var c in b) b.hasOwnProperty(c) && a.css(c) !== b[c] && a.css(c, b[c]) | |
} | |
function p(a, b) { | |
var c = {}, | |
e, d; | |
for (e = 0; e < b.length; e++) { | |
d = b[e]; | |
try { | |
var g = a.css(d); | |
"font-family" === d && (g = x(g)); | |
c[d] = g | |
} catch (f) {} | |
} | |
return c | |
} | |
function C(a, b) { | |
function c(b) { | |
void 0 === i[b] && (i[b] = a.css(b)); | |
i[b] && (h[b] = i[b]) | |
} | |
function e(a, b) { | |
"border" === a ? 0 !== i[a + b + "Width"] && d.each(["Style", "Width", "Color"], function (d, e) { | |
c(a + b + e) | |
}) : c(a + b) | |
} | |
var d = a.constructor, | |
g = a.trueOffset(), | |
f = {}, | |
h = { | |
marginTop: 0, | |
marginBottom: 0, | |
marginLeft: 0, | |
marginRight: 0, | |
paddingTop: 0, | |
paddingBottom: 0, | |
paddingLeft: 0, | |
paddingRight: 0 | |
}, | |
i = { | |
paddingLeft: parseFloat(a.css("padding-left")), | |
paddingRight: parseFloat(a.css("padding-right")), | |
paddingTop: parseFloat(a.css("padding-top")), | |
paddingBottom: parseFloat(a.css("padding-bottom")), | |
marginLeft: parseFloat(a.css("margin-left")), | |
marginTop: parseFloat(a.css("margin-top")), | |
marginRight: parseFloat(a.css("margin-right")), | |
marginBottom: parseFloat(a.css("margin-bottom")), | |
borderRightWidth: parseFloat(a.css("border-right-width")), | |
borderLeftWidth: parseFloat(a.css("border-left-width")), | |
borderTopWidth: parseFloat(a.css("border-top-width")), | |
borderBottomWidth: parseFloat(a.css("border-bottom-width")) | |
}; | |
f.borderLeft = g.left; | |
f.borderTop = g.top; | |
f.paddingLeft = f.borderLeft + i.borderLeftWidth; | |
f.paddingRight = f.paddingLeft + a.width() + i.paddingLeft + i.paddingRight; | |
f.paddingTop = f.borderTop + i.borderTopWidth; | |
f.paddingBottom = f.paddingTop + a.height() + i.paddingTop + i.paddingBottom; | |
f.borderRight = f.paddingRight + i.borderRightWidth; | |
f.borderBottom = f.paddingBottom + i.borderBottomWidth; | |
f.marginLeft = f.borderLeft - i.marginLeft; | |
f.marginTop = f.borderTop - i.marginTop; | |
f.marginRight = f.borderRight + i.marginRight; | |
f.marginBottom = f.borderBottom + i.marginBottom; | |
d.each(["Left", "Right", "Top", "Bottom"], function (a, c) { | |
var g = "Right" === c || "Bottom" === c; | |
d.each(["margin", "border", "padding"], function (a, d) { | |
var h = f[d + c]; | |
g ? h <= b[c.toLowerCase()] && !("margin" !== d ? 0 : 0 > i[d + c]) && e(d, c) : h >= b[c.toLowerCase()] && !("margin" !== d ? 0 : 0 > i[d + c]) && e(d, c) | |
}) | |
}); | |
return h | |
} | |
function D(a, b, c) { | |
function e(a, c, e) { | |
var f = h.util.convertUnitsToPixels(a, parseFloat(b.css("font-size"))); | |
if (!1 !== f) return f; | |
f = a; | |
switch (a) { | |
case "left": | |
case "top": | |
return 0; | |
case "right": | |
case "bottom": | |
a = "100%"; | |
break; | |
case "center": | |
a = "50%" | |
} | |
if (!/^-?[\d\.]+%$/.test(a)) return 0; | |
a = parseFloat(a); | |
c = (c = /url\(['"]?(.+?)['"]?\)/i.exec(c)) && 1 < c.length ? c[1] : null; | |
if (!c) return 0; | |
var c = d("<img/>").attr("src", c).css({ | |
left: "-100000px", | |
position: "absolute" | |
}).appendTo("body"), | |
g = c.width(), | |
j = c.height(); | |
c.remove(); | |
c = "horizontal" === e || f in { | |
left: 1, | |
right: 1 | |
} ? g : j; | |
e = "horizontal" === e || f in { | |
left: 1, | |
right: 1 | |
} ? b.width() : b.height(); | |
return a / 100 * e - c * (a / 100) | |
} | |
var d = b.constructor, | |
g = b.css("background-image"); | |
if ("none" !== g) { | |
var f = b.bgPosition().split(" "); | |
"undefined" === typeof f[1] && (f[1] = "center"); | |
if (!(3 <= f.length)) { | |
f[0] = e(f[0], g, "horizontal"); | |
f[1] = e(f[1], g, "vertical"); | |
var j = h.util.getDimensions(b); | |
if (j.top < c.top || j.left < c.left) f[0] -= c.left - j.left, f[1] -= c.top - j.top; | |
f[0] += "px"; | |
f[1] += "px"; | |
a["background-image"] = g; | |
a["background-position"] = f.join(" "); | |
a["background-attachment"] = "scroll" | |
} | |
} | |
} | |
function y(a, b, c) { | |
function e(a, d, e) { | |
f[a] < c[a] && i[a] < c[a] ? b.css(a, 0) : i[a] >= c[a] && i[a] + e <= c[d] ? b.css(a, g[a]) : b.css(a, g[a] - (c[a] - i[a])) | |
} | |
if (!a.is("param")) { | |
var d = a.css("position"); | |
if (!("static" === d || "fixed" === d)) if (b.css("position", d), "relative" !== d) { | |
var g = a.position(); | |
if (!("relative" === d && 0 === g.top && 0 === g.left)) { | |
var f = a.trueOffset(), | |
d = a.width() - Math.max(0, f.left + a.width() - c.right), | |
d = Math.min(c.width, d), | |
h = a.height() - Math.max(0, f.top + a.height() - c.bottom), | |
h = Math.min(c.height, h); | |
b.width(d); | |
b.height(h); | |
var i = a.offsetParent().offset(); | |
e("left", "right", a.width()); | |
e("top", "bottom", a.height()) | |
} | |
} | |
} | |
} | |
function z(a, b) { | |
var c = h.util.getOuterDimensions(a), | |
e = h.util.computeOverlap(c, b); | |
this.trigger("overlapCalculated", { | |
overlap: e, | |
sourceDimensions: c, | |
ratio: 0 !== c.area ? e.area / c.area : 0 | |
}); | |
return c.area && e.area >= 0.95 * c.area || a[0].nodeName.toLowerCase() in E || "none" !== a.css("clear") && 0 === a.children().length && 0 === c.area ? "full" : "partial" | |
} | |
function F(a, b) { | |
function c() { | |
return "none" !== e(this).css("float") | |
} | |
var e = this.$, | |
d = this.document, | |
g = e(a.startElement), | |
f = e(a.endElement), | |
j = (new Date).getTime(), | |
i = + !! e.browser.mozilla || + !! e.browser.msie, | |
g = B.call(this, b, g, f); | |
this.trigger("searchSpaceCulled", { | |
elements: g | |
}); | |
this.sandbox.$element.css({ | |
width: b.width + i, | |
height: b.height | |
}); | |
i = e("<div/>").addClass(q); | |
this.sandbox.append(i); | |
f = { | |
rect: b, | |
firstIteration: !0 | |
}; | |
r.call(this, e(this.document.documentElement), i, f, !0); | |
i.find(":last-child").each(function () { | |
var a = e(this); | |
if (!("inline" === a.css("display") || a.is("p,ul,ol,dl,dt,table,tr,td,th,tbody,thead,tfoot,q"))) { | |
var b = a.prev(); | |
b.length || (b = a); | |
b.children().is(c) && a.append(e("<div/>").css("clear", "both")) | |
} | |
}); | |
(d = this.domainHackers[d.domain]) && d.hack(i); | |
for (d = 0; d < g.length; ++d) g[d].removeAttribute(h.util.cullNodeAttributeFlag); | |
return { | |
clip: i, | |
elapsedTime: (new Date).getTime() - j | |
} | |
} | |
function r(a, b, c) { | |
if (!a.attr(h.util.cullNodeAttributeFlag)) return this.trigger("elementExtracting", { | |
element: a[0], | |
method: "rect" | |
}), this.trigger("elementIgnored", { | |
reason: "not culled" | |
}), !1; | |
var e = h.util.getOuterDimensions(a), | |
d = h.util.computeOverlap(e, c.rect), | |
g = z.call(this, a, c.rect); | |
this.trigger("elementExtracting", { | |
element: a[0], | |
method: "rect", | |
sourceDimensions: e, | |
overlap: d | |
}); | |
(a = "full" === g ? o.call(this, a, b, c) : s.call(this, a, b, c)) ? this.trigger("elementExtracted", { | |
method: "rect" | |
}) : this.trigger("elementIgnored", { | |
reason: "extractFull or extractPart failed" | |
}); | |
return a | |
} | |
function o(a, b, c) { | |
this.trigger("elementExtracting", { | |
method: "full", | |
element: a[0] | |
}); | |
var e = this.$; | |
if (3 === a[0].nodeType) return b.append(this.document.createTextNode(a[0].nodeValue)), this.trigger("elementExtracted", { | |
method: "full" | |
}), !0; | |
if (w.call(this, a, b, c)) return this.trigger("elementExtracted", { | |
method: "full" | |
}), !0; | |
var d = { | |
reason: null | |
}; | |
if (!h.util.shouldInclude(a, d)) return this.trigger("elementIgnored", { | |
reason: d.reason | |
}), !1; | |
var g = a[0].nodeName.toLowerCase(), | |
g = g in h.util.semanticBlockTagNames || "body" === g || "html" === g || "form" === g ? "div" : g; | |
if ("style" === g) return this.trigger("elementIgnored", { | |
reason: "style tag" | |
}), !1; | |
if ("fixed" == a.css("position")) return this.trigger("elementIgnored", { | |
reason: "fixed position" | |
}), !1; | |
if ("input" === g) { | |
d = a.prop("type"); | |
if ("hidden" === d) return this.trigger("elementIgnored", { | |
reason: "unsupported input: " + d | |
}), !1; | |
"submit" === d && (d = "button"); | |
d = e("<" + g + "/>").attr("type", d) | |
} else d = g in h.util.cloneableTags ? h.util.safeClone(a) : "canvas" === g ? e("<img/>").attr("src", a[0].toDataURL("image/png")).attr("alt", "image converted from <canvas>").attr("width", a.width()).attr("height", a.height()).css("display", "inline") : e("<" + g + "/>"); | |
G(a, d); | |
var f = H.call(this, a); | |
if (b.hasClass(q)) f.position = "static"; | |
b.append(d); | |
m(d, f); | |
(b = this.tweakers[g]) && b.tweakFully(a, d); | |
if ("iframe" !== g) { | |
b = a.contents(); | |
for (g = 0; g < b.length; g++) f = e(b[g]), 3 === b[g].nodeType ? d.append(this.document.createTextNode(b[g].nodeValue)) : 1 === b[g].nodeType && ("full" === z.call(this, f, c.rect) ? o.call(this, f, d, c) : s.call(this, f, d, c)) | |
} | |
f = p(a, ["width", "height"]); | |
m(d, f); | |
y(a, d, c.rect); | |
c.firstIteration = !1; | |
this.trigger("elementExtracted", { | |
method: "full" | |
}); | |
return !0 | |
} | |
function s(a, b, c) { | |
this.trigger("elementExtracting", { | |
method: "partial", | |
element: a[0] | |
}); | |
var e = this.$; | |
if (a.attr(h.util.doNotClipAllAttributeName)) return this.trigger("elementIgnored", { | |
reason: "do not clip attribute" | |
}), !1; | |
if (3 === a[0].nodeType) return b.append(document.createTextNode(a[0].nodeValue)), this.trigger("elementExtracted", { | |
method: "partial" | |
}), !0; | |
if (w.call(this, a, b, c)) return this.trigger("elementExtracted", { | |
method: "partial" | |
}), !0; | |
var d = { | |
reason: null | |
}; | |
if (!h.util.shouldInclude(a, d)) return this.trigger("elementIgnored", { | |
reason: d.reason | |
}), !1; | |
var g = a[0].nodeName.toLowerCase(), | |
g = g in h.util.semanticBlockTagNames ? "div" : g; | |
g in h.util.cloneableTags ? (d = h.util.safeClone(a), d.text("")) : d = g in h.util.tagsToConvertToDiv ? e("<div/>") : e("<" + g + "/>"); | |
b.append(d); | |
b.hasClass(q) ? (d.width(c.rect.width).height(c.rect.height), d.wrap('<div style="position:relative;z-index:0;overflow:hidden;"><div style="position:relative;z-index:-9999;background-color:#FFF;">')) : "table" === g && d.attr({ | |
cellpadding: 0, | |
cellspacing: 0, | |
border: 0 | |
}).css("border-collapse", "collapse"); | |
(b = this.tweakers[g]) && b.tweakPartially(a, d); | |
m(d, C(a, c.rect)); | |
var b = d, | |
f = c.rect, | |
j = p(a, ["background-clip", "background-color", "background-image", "background-origin", "background-repeat"]); | |
D(j, a, f); | |
m(b, j); | |
"fixed" !== a.css("position") && y(a, d, c.rect); | |
m(d, p(a, "display,float,clear,font-size,line-height,font-family,color,text-align,visibility,white-space".split(","))); | |
b = !1; | |
if ("iframe" !== g) { | |
if (a = a.contents(), a.length) for (var e = 0, i; e < a.length; e++) i = a.eq(e), 1 === i[0].nodeType ? (i.attr(h.util.cullNodeAttributeFlag) || i.is("br") || i.hasClass(h.util.rewriteClass) && i.find("br").length || 0 === h.util.getOuterDimensions(i).area) && r.call(this, i, d, c) && (b = !0) : 3 === i[0].nodeType && (b = s.call(this, i, d, c) || b) | |
} else try { | |
i = e(a.contents()[0].documentElement), d.css("display", "inline-block"), b = r.call(this, i, d, c) | |
} catch (k) { | |
b = !1 | |
} | |
b ? this.trigger("elementExtracted", { | |
method: "partial" | |
}) : (this.trigger("elementIgnored", { | |
reason: "no children were extracted" | |
}), d.remove()); | |
return b | |
} | |
function k(a) { | |
this.$ = a.$; | |
this.baseData = a.baseData; | |
this.support = a.support; | |
this.document = a.document; | |
this.sandbox = null; | |
this.tweakers = { | |
a: new h.extractors.AnchorTweaker(this.baseData), | |
button: new h.extractors.ButtonTweaker, | |
embed: (new h.extractors.EmbedTweaker(this.baseData)).bubble("autoplayDisabled").to(this), | |
iframe: (new h.extractors.IframeTweaker(this.baseData)).bubble("autoplayDisabled").to(this), | |
img: new h.extractors.ImageTweaker(this.baseData), | |
input: new h.extractors.InputTweaker(this.baseData), | |
object: (new h.extractors.ObjectTweaker(this.baseData)).bubble("autoplayDisabled").to(this), | |
param: (new h.extractors.ParamTweaker(this.baseData)).bubble("autoplayDisabled").to(this), | |
source: new h.extractors.SourceTweaker(this.baseData), | |
table: new h.extractors.TableTweaker(this.baseData), | |
video: (new h.extractors.VideoTweaker(this.baseData)).bubble("autoplayDisabled").to(this) | |
}; | |
this.domainHackers = { | |
"tlc.discovery.com": new h.extractors.TlcDiscoveryHacker, | |
"www.youtube.com": new h.extractors.YouTubeHacker | |
} | |
} | |
var h = A.CLIPBOARD.client, | |
q = h.util.clipContainerClass, | |
E = { | |
embed: 1, | |
param: 1, | |
object: 1, | |
video: 1, | |
audio: 1, | |
source: 1, | |
br: 1, | |
img: 1 | |
}, | |
H = function () { | |
var a = "-moz-border-bottom-left-radius,-moz-border-bottom-right-radius,-moz-border-top-left-radius,-moz-border-top-right-radius,-moz-box-shadow,-webkit-border-bottom-left-radius,-webkit-border-bottom-right-radius,-webkit-border-top-left-radius,-webkit-border-top-right-radius,-webkit-box-shadow,background-clip,background-color,background-image,background-origin,background-position,background-repeat,border-bottom-color,border-bottom-style,border-bottom-width,border-top-color,border-top-style,border-top-width,border-left-color,border-left-style,border-left-width,border-right-color,border-right-style,border-right-width,border-bottom-left-radius,border-bottom-right-radius,border-top-left-radius,border-top-right-radius,border-spacing,border-collapse,box-shadow,caption-side,clear,clip,color,content,counter-increment,counter-reset,cursor,direction,display,empty-cells,float,font-family,font-size,font-style,font-variant,font-weight,letter-spacing,line-height,list-style-image,list-style-position,list-style- | |
type,margin-bottom,margin-left,margin-right,margin-top,marker-offset,max-height,max-width,min-height,min-width,opacity,outline-color,outline-style,outline-width,overflow-x,overflow-y,overflow,padding-bottom,padding-left,padding-right,padding-top,page-break-after,page-break-before,page-break-inside,quotes,table-layout,text-align,text-shadow,text-decoration,text-indent,text-transform,vertical-align,visibility,white-space,word-spacing,z-index".split(","); | |
return function (b) { | |
for (var c = {}, e, d = this.document, g = 0; g < a.length; g++) { | |
var f = a[g]; | |
if ("line-height" === f && b[0].currentStyle) e = b[0].currentStyle.lineHeight; | |
else if ("margin-right" === f && d.defaultView && d.defaultView.getComputedStyle) e = d.defaultView.getComputedStyle(b[0], null).getPropertyValue("margin-right"); | |
else if (0 === f.indexOf("background-position")) e = b.bgPosition(); | |
else try { | |
e = b.css(f), "font-family" === f && (e = x(e)) | |
} catch (h) { | |
e = null | |
} | |
e && (c[f] = e) | |
} | |
"inline" === c.display && c.clip && delete c.clip; | |
return c | |
} | |
}(), | |
G = function () { | |
function a(a, c, e) { | |
(a = a.attr(e)) && c.attr(e, a) | |
} | |
return function (b, c) { | |
a(b, c, "title"); | |
a(b, c, "alt"); | |
a(b, c, "rel") | |
} | |
}(); | |
h.util.inherit(k, new h.Extractor, new h.ActivatableControl, new h.EventEmitter); | |
h.util.merge(k.prototype, { | |
constructor: k, | |
tweakers: {}, | |
domainHackers: {}, | |
extract: function (a, b) { | |
this.activate(); | |
this.trigger("extractionStarted", { | |
rect: b.rect, | |
selection: a | |
}); | |
var c = F.call(this, a, b.rect); | |
a.startElement = a.endElement = null; | |
if (c) { | |
var e = c.clip, | |
d = h.util.compactHtml(e.html()), | |
e = e.text().replace(/\s+/gm, " "), | |
g = this.sandbox.getDimensions(); | |
this.sandbox.empty(); - 1 !== d.indexOf("data_clipboard3141592654") && (d = d.replace("data_clipboard3141592654", "data"), d = d.replace(/classid=['"]?clsid:D27CDB6E-AE6D-11cf-96B8-444553540000['"]?/gi, "")); | |
this.trigger("extracted", { | |
elapsedTime: c.elapsedTime, | |
html: d, | |
text: e, | |
dimensions: g, | |
top: b.rect.top, | |
left: b.rect.left, | |
extractionType: b.extractionType, | |
clipData: b.clipData | |
}) | |
} else this.trigger("nothingExtracted"); | |
this.deactivate() | |
} | |
}); | |
k.prototype.doActivate = function () { | |
if (!this.sandbox) h.util.rewritePageHtml(this.$, this.baseData, this.support), this.sandbox = h.util.createSandbox(this.$), this.trigger("sandboxBuilt", { | |
nodeName: this.sandbox.$element[0].nodeName.toLowerCase() | |
}) | |
}; | |
k.prototype.doDeactivate = function () { | |
if (this.sandbox) this.sandbox.destroy(), this.sandbox = null | |
}; | |
k.prototype.type = "clip"; | |
h.extractors.HtmlExtractor = k | |
})(window); | |
(function (g) { | |
function r(a) { | |
return function () { | |
if (!a.bookmark) a.dragContext.dragging = !0 | |
} | |
} | |
function m(a) { | |
return function (f) { | |
if (3 !== f.which) { | |
var d = "click"; | |
a.bookmark ? d = "bookmark" : a.selectionData.startElement !== a.selectionData.endElement ? d = "drag" : a.zoomContext.zooming && (d = "zoom"); | |
var b = a.bookmark ? "bookmark" : "rectangle"; | |
a.selecting = !1; | |
a.dragContext.reset(); | |
k.call(a); | |
var c = a.getSelection(), | |
h = setInterval(function () { | |
if (!a.animationContext.animating) clearInterval(h), a.trigger("selectionEnded", { | |
selectionData: c, | |
selectionType: b, | |
extractionContext: { | |
rect: a.$zoomRect.data("dimensions"), | |
extractionType: d | |
} | |
}), a.selecting = !0 | |
}, 50) | |
} | |
} | |
} | |
function s(a) { | |
var f = !1, | |
d = 1E3 / n; | |
return function (b, c, h, e) { | |
if (b.metaKey || b.shiftKey || b.altKey || b.ctrlKey) { | |
if (!a.zoomContext.sentMetaEventToTracker) a.trigger("scrolled", { | |
source: "mouseWheelWithMetaKey" | |
}), a.zoomContext.sentMetaEventToTracker = !0; | |
return !0 | |
} | |
if (f || 0 === e || !a.selectionData.startElement) return !1; | |
f = !0; | |
if (!a.zoomContext.zooming) a.zoomContext.start.clientX = b.clientX, a.zoomContext.start.clientY = b.clientY; | |
0 > e ? a.zoomIn() : a.zoomOut(); | |
setTimeout(function () { | |
f = !1 | |
}, d); | |
return !1 | |
} | |
} | |
function u(a) { | |
var f = a.$; | |
return function (d) { | |
d.preventDefault(); | |
if (a.selecting) { | |
var b = a.dragContext; | |
if (b.dragging) { | |
var c = d.clientX + f(a.document).scrollLeft(), | |
h = d.clientY + f(a.document).scrollTop(); | |
if (0 > b.initialX) b.initialX = c, b.initialY = h; | |
b.currentX = c; | |
b.currentY = h; | |
b.direction = ""; | |
b.currentY > b.initialY ? b.direction += "s" : b.currentY < b.initialY && (b.direction += "n"); | |
b.currentX > b.initialX ? b.direction += "e" : b.currentX < b.initialX && (b.direction += "w") | |
} | |
if (!(b = !a.zoomContext.zooming)) c = a.zoomContext, b = c.start.clientX - d.clientX, c = c.start.clientY - d.clientY, b = Math.sqrt(b * b + c * c) >= v; | |
b && (a.zoomContext.reset(), a.animateTo({ | |
clientX: d.clientX, | |
clientY: d.clientY | |
})) | |
} | |
} | |
} | |
function w() { | |
if (!this.bookmark) this.trigger("bookmarkPage"), this.$zoomRect.cssImportant({ | |
"border-top-width": j, | |
"border-bottom-width": j, | |
"border-right-width": j, | |
"border-left-width": j | |
}, !0), x.call(this), this.$canvasOverlay.cssImportant("cursor", "pointer"), this.$bookmark.show().cssImportant({ | |
left: -80, | |
opacity: 0 | |
}).delay(200).animate({ | |
left: 20, | |
opacity: 1 | |
}, "fast", "linear"), this.selectionData.startElement = this.selectionData.startElement = null, this.bookmark = !0 | |
} | |
function k(a) { | |
var f = this.$; | |
this.bookmark = !1; | |
this.trigger("notBookmarkPage"); | |
this.$canvasOverlay.cssImportant("cursor", "default"); | |
this.$zoomRect.cssImportant({ | |
"border-top-width": i, | |
"border-bottom-width": i, | |
"border-right-width": i, | |
"border-left-width": i | |
}, !0); | |
c.util.retireFixedPositioning(this.$zoomRect); | |
this.$bookmark.animate({ | |
left: -80, | |
opacity: 0 | |
}, "fast", "linear", function () { | |
f(this).hide(); | |
a && a() | |
}) | |
} | |
function x() { | |
var a = this, | |
f = this.$, | |
d = f.support.boxModel ? 2 * (j + l) : 0; | |
c.util.assureFixedPositioning(this.$zoomRect); | |
this.$zoomRect.stop(!0, !1).animate({ | |
left: 0, | |
top: 0, | |
width: f(g).width() - d, | |
height: f(g).height() - d | |
}, 150, "easeOutQuad", function () { | |
a.animationContext.animating = !1; | |
f(this).cssImportant({ | |
width: f(g).width() - d, | |
height: f(g).height() - d | |
}) | |
}) | |
} | |
function y(a, c) { | |
var d = this.dragContext, | |
b = this.dragContext.direction, | |
e = a.top - c.top, | |
h = a.left - c.left, | |
t = a.bottom - c.bottom, | |
g = a.right - c.right, | |
i = Math.abs(d.currentY - c.top), | |
j = Math.abs(d.currentY - c.bottom), | |
k = Math.abs(d.currentX - c.left), | |
d = Math.abs(d.currentX - c.right); | |
switch (b.charAt(0)) { | |
case "n": | |
if (-50 > t || 50 < i) return !1; | |
break; | |
case "s": | |
if (50 < e || 50 < j) return !1; | |
break; | |
case "w": | |
if (50 < h || 50 < k) return !1; | |
break; | |
case "e": | |
if (50 < g || 50 < d) return !1 | |
} | |
return !0 | |
} | |
function o(a) { | |
this.bookmark && k.call(this); | |
var f = this.selectionData.endElement; | |
if (!(this.selectionData.startElement === a && this.selectionData.endElement === a)) { | |
if (this.dragContext.dragging) { | |
if (!this.selectionData.startElement) this.selectionData.startElement = a | |
} else this.selectionData.startElement = a; | |
this.selectionData.endElement = a; | |
this.animationContext.animating = !0; | |
this.trigger("selecting"); | |
var d = this.$, | |
a = d(this.selectionData.startElement), | |
d = d(this.selectionData.endElement), | |
a = c.util.getOuterDimensions(a), | |
d = c.util.getOuterDimensions(d), | |
a = { | |
top: Math.min(a.top, d.top), | |
left: Math.min(a.left, d.left), | |
bottom: Math.max(a.bottom, d.bottom), | |
right: Math.max(a.right, d.right) | |
}; | |
a.width = a.right - a.left; | |
a.height = a.bottom - a.top; | |
a.area = a.width * a.height; | |
if (this.dragContext.dragging && (d = this.$zoomRect.data("dimensions"), !y.call(this, d, a))) return; | |
if (a.area > c.util.maxArea) this.selectionData.endElement = f, this.trigger("selectionFailed", { | |
reason: c.Selector.failureStatus.maxSizeExceededViaDrag | |
}); | |
else { | |
this.$zoomRect.data("dimensions", a); | |
var b = this; | |
this.$zoomRect.stop(!0, !1).animate({ | |
left: a.left - i - l - this.bodyOffset.left, | |
top: a.top - i - l - this.bodyOffset.top, | |
width: a.width, | |
height: a.height | |
}, 250, "easeOutQuad", function () { | |
b.animationContext.animating = !1 | |
}) | |
} | |
} | |
} | |
function e(a) { | |
this.type = "rectangle"; | |
this.support = a.support; | |
this.bodyOffset = a.bodyOffset; | |
this.$ = a.$; | |
this.staticBaseUrl = a.staticBaseUrl; | |
this.selecting = !1; | |
this.baseData = a.baseData; | |
this.document = a.document; | |
this.preferences = a.preferences; | |
this.getExtractor = function () { | |
return new c.extractors.HtmlExtractor(a) | |
}; | |
this.$canvasOverlay = this.$zoomRect = null; | |
this.dragContext = { | |
dragging: !1, | |
direction: null, | |
initialX: -1, | |
initialY: -1, | |
currentX: -1, | |
currentY: -1, | |
reset: function () { | |
this.dragging = !1; | |
this.direction = null; | |
this.currentY = this.currentX = this.initialY = this.initialX = -1 | |
} | |
}; | |
this.zoomContext = { | |
zooming: !1, | |
noZoomReason: "", | |
lastZoom: 0, | |
start: { | |
clientX: 0, | |
clientY: 0 | |
}, | |
path: null, | |
current: -1, | |
reset: function () { | |
this.zooming = !1; | |
this.lastZoom = 0; | |
this.start.clientX = -1; | |
this.start.clientY = -1; | |
this.path = null; | |
this.current = -1; | |
this.noZoomReason = ""; | |
this.sentMetaEventToTracker = !1 | |
}, | |
sentMetaEventToTracker: !1 | |
}; | |
this.selectionData = { | |
startElement: null, | |
endElement: null | |
}; | |
this.animationContext = { | |
animating: !1, | |
timeoutId: 0 | |
} | |
} | |
var c = g.CLIPBOARD.client, | |
i = 2, | |
l = 2, | |
p = "rectangleSelector_" + c.util.idSuffix, | |
n = 5, | |
v = 15, | |
j = 10, | |
z = "zoom" + c.util.idSuffix, | |
A = "canvas" + c.util.idSuffix, | |
B = "bookmarkImage" + c.util.idSuffix, | |
q = function () { | |
function a(a) { | |
var b = this.$; | |
if (null === this.zoomContext.path) { | |
var e = !0, | |
h = b(this.selectionData.startElement), | |
g = h; | |
this.zoomContext.path = h.allParents().filter(function () { | |
e = f(b(this), g); | |
!0 === e && (g = b(this)); | |
return !0 === e | |
}).map(function () { | |
return b(this) | |
}).toArray(); | |
if (!0 === e) e = c.Selector.failureStatus.nowhereToZoom; | |
this.zoomContext.path.unshift(h); | |
this.zoomContext.noZoomReason = e | |
} | |
if (a) { | |
a = this.zoomContext.path[this.zoomContext.current + 1]; | |
if (!a) return this.zoomContext.lastZoom && (new Date).getTime() - this.zoomContext.lastZoom > 2 * (1E3 / n) && this.trigger("selectionFailed", { | |
reason: this.zoomContext.noZoomReason | |
}), this.zoomContext.lastZoom = (new Date).getTime(), []; | |
this.zoomContext.lastZoom = (new Date).getTime(); | |
this.zoomContext.current++; | |
return a | |
} | |
this.zoomContext.current = Math.max(0, this.zoomContext.current - 1); | |
return (a = this.zoomContext.path[this.zoomContext.current]) || [] | |
} | |
var f = function () { | |
var a = { | |
head: 1, | |
meta: 1, | |
link: 1, | |
style: 1, | |
script: 1 | |
}; | |
return function (b, f) { | |
var e; | |
if (!(e = !b[0])) if (!(e = 1 !== b[0].nodeType)) if (!(e = b[0].nodeName.toLowerCase() in a)) { | |
e = c.util.getDimensions(b); | |
var g = c.util.getDimensions(f); | |
e = e.area < 0.95 * g.area ? !1 : c.util.computeOverlap(e, g).area >= 0.95 * g.area; | |
e = !e | |
} | |
return e ? c.Selector.failureStatus.nowhereToZoom : !c.util.shouldInclude(b, {}) ? c.Selector.failureStatus.maxSizeExceededViaZoom : !0 | |
} | |
}(); | |
return function (d) { | |
var b = a.call(this, d); | |
if (b.length) this.zoomContext.zooming = !0, this.trigger("zooming", { | |
direction: d ? "in" : "out" | |
}), d = b.trueOffset(), c.util.adjustOffsetForMargins(b, d), b.trueCoordinates(d), this.animateTo(b[0]) | |
} | |
}(); | |
c.util.inherit(e, new c.Selector, new c.ActivatableControl, new c.EventEmitter); | |
e.prototype.constructor = e; | |
e.prototype.doActivate = function () { | |
var a = this.$; | |
if (!this.$zoomRect) c.util.rewritePageHtml(this.$, this.baseData, this.support), this.$zoomRect = a("<div/>").applyBlockStyles().attr("id", z), this.support.rgba ? this.$zoomRect.cssImportant("opacity", 1) : this.$zoomRect.cssImportant("opacity", 0.25), c.util.applyGradient(this.$zoomRect, this.preferences.rectangleColor), this.$bookmark = a("<img/>").applyBlockStyles().attr("id", B).attr("src", this.staticBaseUrl + "/images/1.1.17/bookmarkLarge.png").click(m(this)), c.util.flagAsUnclippable(this.$zoomRect), this.$canvasOverlay = a("<div/>").applyBlockStyles().attr("id", A).mousedown(r(this)).mousemove(u(this)).mouseup(m(this)).mousewheel(s(this)), c.util.flagAsUnclippable(this.$canvasOverlay), a("body").append(this.$canvasOverlay).append(this.$bookmark).append(this.$zoomRect), c.util.assureFixedPositioning(this.$canvasOverlay), c.util.assureFixedPositioning(this.$bookmark), this.enableGlobalEvents(), this.selecting = !0, this.dragContext.reset(), this.select() | |
}; | |
e.prototype.doDeactivate = function () { | |
this.selecting = !1; | |
if (this.$zoomRect && this.$canvasOverlay) { | |
if (this.animationContext.timeoutId) this.animationContext.timeoutId = g.clearTimeout(this.animationContext.timeoutId); | |
var a = this, | |
e = this.$(this.document); | |
this.bookmark && k.call(this, function () { | |
a.$bookmark.remove(); | |
a.$bookmark = null | |
}); | |
this.$zoomRect.animate({ | |
width: 0, | |
height: 0, | |
left: this.$(g).width() + e.scrollLeft() - 130, | |
top: e.scrollTop() + 40, | |
opacity: 0 | |
}, { | |
duration: 350, | |
easing: "easeInOutQuad", | |
complete: function () { | |
c.util.retireFixedPositioning(a.$zoomRect); | |
a.$zoomRect.remove(); | |
a.$zoomRect = null | |
} | |
}); | |
c.util.retireFixedPositioning(this.$canvasOverlay); | |
this.$canvasOverlay.remove(); | |
this.$canvasOverlay = null; | |
this.disableGlobalEvents(); | |
this.animationContext.animating = !1; | |
this.zoomContext.reset() | |
} | |
}; | |
e.prototype.disableGlobalEvents = function () { | |
this.$(this.document).unbind("keydown." + p) | |
}; | |
e.prototype.enableGlobalEvents = function () { | |
var a = this; | |
this.$(this.document).bind("keydown." + p, function (c) { | |
27 === c.keyCode && (a.deactivate(), a.trigger("canceled", { | |
source: "escapeKey" | |
})) | |
}) | |
}; | |
e.prototype.zoomIn = function () { | |
q.call(this, !0) | |
}; | |
e.prototype.zoomOut = function () { | |
q.call(this, !1) | |
}; | |
e.prototype.animateTo = function (a) { | |
var e = this.$; | |
if (0 <= this.animationContext.timeoutId) this.animationContext.timeoutId = clearTimeout(this.animationContext.timeoutId); | |
var d = null, | |
b = this; | |
if ("undefined" === typeof a.nodeType) { | |
if (!b.dragContext.dragging) { | |
var i = a.clientX, | |
h = a.clientY, | |
j = e(g).width(), | |
e = e(g).height(); | |
if (20 > i || i > j - 20 || 20 > h || h > e - 20) d = function () { | |
w.call(b) | |
} | |
} | |
d || (d = function () { | |
b.$canvasOverlay.hide(); | |
b.$zoomRect.hide(); | |
var d = c.util.getElementFromPoint(a.clientX, a.clientY, b.$, b.document); | |
b.$canvasOverlay.show(); | |
b.$zoomRect.show(); | |
d && o.call(b, d) | |
}) | |
} else d = function () { | |
a && o.call(b, a) | |
}; | |
this.animationContext.timeoutId = setTimeout(d, 20) | |
}; | |
e.prototype.getSelection = function () { | |
return { | |
startElement: this.selectionData.startElement, | |
endElement: this.selectionData.endElement | |
} | |
}; | |
e.prototype.shouldUseAsDefault = function () { | |
return !0 | |
}; | |
e.prototype.setPreferences = function (a) { | |
this.preferences = a; | |
this.$zoomRect && c.util.applyGradient(this.$zoomRect, this.preferences.rectangleColor) | |
}; | |
c.selectors.RectangleSelector = e | |
})(window); | |
(function (F) { | |
var Z; | |
function za(i) { | |
var j = i.getElementsByClassName; | |
if (F.Prototype && F.Prototype.Version) { | |
var t = F.Prototype.Version.replace(/_.*$/g, "").split("."), | |
f = parseInt(t[0]), | |
t = parseInt(t[1]); | |
if (1 >= f && 5 >= t) return i.getElementsByClassName = function (b) { | |
return $$("." + b) | |
}, Array.prototype.shift = function () { | |
for (var b = this[0], f = 0; f < this.length - 1; f++) this[f] = this[f + 1]; | |
this.length = Math.max(0, this.length - 1); | |
return b | |
}, { | |
getElementsByClassName: j, | |
stupidFuckingPrototype: !0 | |
} | |
} | |
return { | |
stupidFuckingPrototype: !1 | |
} | |
} | |
function I(i, j, t) { | |
if (this.shouldLogMetric(i)) j = j || {}, j.origin = this.origin, this.dao.logMetric((t || "bookmarklet") + "_" + i, j, this.user) | |
} | |
function X(i, j) { | |
i = i || Y; | |
j && i === Y ? this.setActiveSelectorByContext() : this.setActiveSelector(i); | |
this.ui.enableClipping(this.activeSelector.type); | |
this.activeSelector.activate() | |
} | |
function $() { | |
this.trigger("clippingCanceled"); | |
this.activeSelector && (this.ui.disableClipping(this.activeSelector.type), this.activeSelector.deactivate()) | |
} | |
function Aa(i) { | |
var j = x.util.strings, | |
t = x.DataAccess.sendFailureStatus; | |
switch (i) { | |
case t.crossDomainPostFailed: | |
return j.send_xdmPromiseFail; | |
case t.emptyResponse: | |
return j.send_emptyResponseFromPromise; | |
case t.retryCount: | |
return j.send_promiseRetryCount; | |
case t.serverSideSave: | |
return j.send_saveClipFail; | |
case t.promiseUnavailable: | |
return j.send_promiseUnavailable; | |
case t.timeout: | |
return j.send_clipSaveTimedOut; | |
case t.malformedResponse: | |
case t.invalidResponse: | |
case t.expiredRequest: | |
case t.expiredSession: | |
case t.unauthorized: | |
case t.badRequest: | |
case t.emptyResult: | |
return j.send_invalidResponseSavingClip; | |
default: | |
return j.error_unknown | |
} | |
} | |
function Ba(i) { | |
var j = x.util.strings, | |
t = x.Selector.failureStatus; | |
switch (i) { | |
case t.nowhereToZoom: | |
return j.zoom_nowhereToZoom; | |
case t.maxSizeExceededViaZoom: | |
return j.zoom_tooLarge; | |
case t.maxSizeExceededViaDrag: | |
return j.drag_tooLarge; | |
default: | |
return j.error_unknown | |
} | |
} | |
function Ca() { | |
var i = this; | |
this.ui.on("preferencesUpdated", function (j) { | |
i.dao.updatePreferences(j.preferences); | |
aa.call(i, j.preferences); | |
I.call(i, "updatePreferences", j.preferences) | |
}).on("autocompleteTriggered", function (j) { | |
I.call(i, "autocompleteTrigger", { | |
source: j.source, | |
type: j.type | |
}) | |
}).on("embedButtonClicked", function (j) { | |
i.selectors.identity && (i.setActiveSelector("identity"), i.activeSelector.setSelection(j.startElement, j.endElement, j.clipData), i.activeSelector.select()) | |
}).on("selectorSwitched", function (j) { | |
I.call(i, "selectorSwitch", { | |
selectorType: j.type | |
}); | |
$.call(i); | |
X.call(i, j.type) | |
}).on("navigated", function (j) { | |
I.call(i, "navigate", { | |
source: j.source | |
}); | |
switch (j.source) { | |
case "close": | |
i.deactivate() | |
} | |
}).on("navigated", function (j) { | |
"initiate" === j.source && ("disabled" === j.status ? $.call(i) : X.call(i, j.type)) | |
}).on("reviewConfirmed", function (j) { | |
var t = j.reviewData.annotation || ""; | |
I.call(i, "reviewSubmit", { | |
method: j.method, | |
published: j.reviewData.published, | |
annotated: !! t, | |
annotationLength: t.length, | |
postToFacebook: j.reviewData.postToFacebook, | |
tweet: j.reviewData.tweet | |
}) | |
}).on("clipConfirmed", function (j) { | |
i.ui.showLoadingMessage(); | |
i.dao.sendClip(j.clip); | |
i.activeSelector.deactivate(); | |
i.ui.disableClipping(i.activeSelector.type) | |
}).on("reviewOpening", function () { | |
i.activeSelector.disableGlobalEvents() | |
}).on("reviewClosed", function () { | |
i.activeSelector.enableGlobalEvents() | |
}).on("reviewCanceled", function (j) { | |
I.call(i, "reviewCancel", { | |
method: j.method | |
}) | |
}).on("userDataRequested", function () { | |
i.dao.fetchUserData() | |
}) | |
} | |
function aa(i) { | |
x.util.merge(this.preferences, i); | |
this.ui.setPreferences(this.preferences); | |
var j = this; | |
x.util.forEach(this.selectors, function (i) { | |
i.setPreferences(j.preferences) | |
}) | |
} | |
function Da(i) { | |
for (var j = 0; j < this.controls.length; j++) this.controls[j].setLoginState(i) | |
} | |
function Ea(i) { | |
var j = !1, | |
t = 0; | |
return function (f) { | |
if (f.error) I.call(i, "fetchUserDataFail", { | |
error: f.error | |
}); | |
else if (t++, K.checkedLoginStatus || I.call(i, "launch", { | |
status: f.loggedIn ? "loggedIn" : "loggedOut", | |
version: i.bookmarkletVersion | |
}), K.checkedLoginStatus = !0, f.thirdPartyCookiesEnabled) { | |
if (f.config) F.CLIPBOARD.config = f.config; | |
Da.call(i, f.loggedIn); | |
f.loggedIn ? (j && 0 < t && I.call(i, "login"), i.user.guid = f.userGuid, i.user.sessionId = f.sessionId, i.dao.fetchAutocompleteData(), aa.call(i, f.preferences), X.call(i, i.preferences.defaultSelectorType || Y, !0)) : j = !0 | |
} else fa.call(i), I.call(i, "info", { | |
data: "3rdPartyCookiesDisabled" | |
}) | |
} | |
} | |
function Fa() { | |
var i = this; | |
this.dao.on("autocompleteDataFailed", function (j) { | |
I.call(i, "autocompleteFail", { | |
error: j.error | |
}) | |
}).on("autocompleteDataReceived", function (j) { | |
F.CLIPBOARD.autocomplete.setData(j.dict) | |
}).on("sendFailed", function (j) { | |
I.call(i, "sendFail", { | |
reason: j.reason | |
}); | |
"expiredSession" === j.reason ? ($.call(i), i.dao.fetchUserData()) : i.ui.showErrorNotification(Aa(j.reason)) | |
}).on("sendSucceeded", function (j) { | |
I.call(i, "sendSuccess", { | |
saveDuration: j.duration, | |
attempts: j.retryAttempts | |
}); | |
i.ui.showNotification(x.util.strings.save_default) | |
}).on("userDataReceived", Ea(this)) | |
} | |
function Ga(i) { | |
var j = this; | |
i.on("canceled", function (i) { | |
j.ui.hideNotification(); | |
I.call(j, "cancelClipMode", { | |
source: i.source | |
}); | |
$.call(j) | |
}).on("scrolled", function (i) { | |
I.call(j, "scrollDuringExtract", { | |
source: i.source | |
}) | |
}).on("selectionEnded", function (i) { | |
switch (i.selectionType) { | |
case "bookmark": | |
j.activeExtractor = j.extractors.bookmark; | |
break; | |
case "text": | |
j.activeExtractor = j.extractors.text; | |
break; | |
case "rectangle": | |
j.activeExtractor = j.extractors.rectangle; | |
break; | |
case "identity": | |
j.activeExtractor = j.extractors.identity; | |
break; | |
default: | |
I.call(this, "info", { | |
data: "invalidSelectionType" | |
}); | |
return | |
} | |
j.activeExtractor.extract(i.selectionData, i.extractionContext) | |
}).on("selectionFailed", function (i) { | |
I.call(j, "selectionFail", { | |
reason: i.reason | |
}); | |
j.ui.showErrorNotification(Ba(i.reason)) | |
}).on("bookmarkPage", function () { | |
j.ui.showNotification("Bookmark page", -1) | |
}).on("notBookmarkPage", function () { | |
j.ui.hideNotification() | |
}) | |
} | |
function Ha(i) { | |
var j = this; | |
i.on("autoplayDisabled", function (i) { | |
I.call(j, "autoplayDisable", { | |
source: i.source | |
}) | |
}).on("sandboxBuilt", function (i) { | |
"iframe" !== i.nodeName && I.call(j, "sandbox", { | |
type: i.nodeName, | |
host: F.location.hostname | |
}) | |
}).on("extracted", function (t) { | |
var f = j.createClip(x.util.merge(t.clipData, { | |
width: t.dimensions.width, | |
height: t.dimensions.height, | |
html: t.html, | |
type: i.type, | |
text: t.text, | |
top: t.top, | |
left: t.left, | |
blobSchemaVersion: "0.2" | |
})); | |
I.call(j, "extract", { | |
elapsedTime: t.elapsedTime, | |
type: t.extractionType, | |
rectangleColor: j.preferences.rectangleColor, | |
reviewClip: j.preferences.reviewClip, | |
publishByDefault: j.preferences.publishByDefault, | |
connectedToTimeline: j.preferences.connectedToTimeline, | |
connectedToFbStream: j.preferences.connectedToFbStream, | |
connectedToTwitter: j.preferences.connectedToTwitter, | |
compatMode: j.document.compatMode | |
}); | |
j.ui.handleExtraction({ | |
clip: f, | |
rawHtml: t.html | |
}); | |
"identity" === j.activeSelector.type && j.activeSelector.deactivate() | |
}) | |
} | |
function Ia() { | |
Ca.call(this); | |
Fa.call(this); | |
for (var i in this.selectors) this.selectors.hasOwnProperty(i) && Ga.call(this, this.selectors[i]); | |
for (i in this.extractors) this.extractors.hasOwnProperty(i) && Ha.call(this, this.extractors[i]); | |
this.on("activated", function () { | |
K.cookiesDisabled && fa.call(this) | |
}) | |
} | |
function fa() { | |
K.cookiesDisabled = !0; | |
this.deactivate(); | |
this.ui.show3rdPartyCookiesErrorMessage() | |
} | |
function Ja(i) { | |
if (ba.indexOf) return ba.indexOf(i); | |
for (var j = 0; j < ba.length; j++) if (ba[j] === i) return j; | |
return -1 | |
} | |
function Ka(i) { | |
var i = i("<div/>").css({ | |
position: "absolute", | |
top: 0, | |
left: 0, | |
width: 1, | |
height: 1, | |
"margin-top": 0, | |
"margin-bottom": 0, | |
"margin-left": 0, | |
"margin-right": 0, | |
"background-color": "transparent" | |
}).appendTo("body"), | |
j = i.offset(); | |
i.remove(); | |
return j | |
} | |
function La(i) { | |
var i = i("<div>").css({ | |
width: 0, | |
height: 0, | |
display: "none", | |
"background-color": "rgba(64, 128, 256, 0.25)" | |
}).appendTo("body"), | |
j = i.css("background-color"); | |
i.remove(); | |
return /^rgba/.test(j) | |
} | |
function Ma(i) { | |
var i = i("<div/>").css({ | |
width: "1in", | |
visibility: "hidden", | |
position: "absolute", | |
left: "-10000px", | |
"padding-top": 0, | |
"padding-bottom": 0, | |
"padding-left": 0, | |
"padding-right": 0 | |
}).appendTo("body"), | |
j = i.width(); | |
i.remove(); | |
return j | |
} | |
function Na(i) { | |
i = i("head base:first").attr("href"); | |
if (!i) i = F.location.href, i = i.replace(/#.*$/, ""); | |
var j = document.createElement("a"); | |
j.href = i; | |
i = { | |
uri: i, | |
protocol: j.protocol, | |
host: j.hostname, | |
port: j.port, | |
query: j.search, | |
domainAndPort: /tps?:\/\/([^\/]+)/.exec(j.href)[1], | |
path: j.pathname.replace(/^([^\/])/, "/$1"), | |
relative: (j.href.match(/tps?:\/\/[^\/]+(.+)/) || [, ""])[1] | |
}; | |
i.relativeDir = i.protocol + "//" + i.domainAndPort + x.util.dirname(i.relative); | |
return i | |
} | |
function Oa() { | |
var i = ca[this.documentId]; | |
if (i.$) return this.$ = i.$, this.bodyOffset = i.bodyOffset, this.baseData = i.baseData, this.xdm = i.xdm, !1; | |
(function () { | |
(function (j, f) { | |
function b(a) { | |
var d = $a[a] = {}, | |
c, h, a = a.split(/\s+/); | |
for (c = 0, h = a.length; c < h; c++) d[a[c]] = !0; | |
return d | |
} | |
function k(a, d, g) { | |
if (g === f && 1 === a.nodeType) if (g = "data-" + d.replace(x, "-$1").toLowerCase(), g = a.getAttribute(g), "string" === typeof g) { | |
try { | |
g = "true" === g ? !0 : "false" === g ? !1 : "null" === g ? null : c.isNumeric(g) ? parseFloat(g) : tb.test(g) ? c.parseJSON(g) : g | |
} catch (h) {} | |
c.data(a, d, g) | |
} else g = f; | |
return g | |
} | |
function e(a) { | |
for (var d in a) if (!("data" === d && c.isEmptyObject(a[d])) && "toJSON" !== d) return !1; | |
return !0 | |
} | |
function r(a, d, g) { | |
var h = d + "defer", | |
m = d + "queue", | |
C = d + "mark", | |
b = c._data(a, h); | |
b && ("queue" === g || !c._data(a, m)) && ("mark" === g || !c._data(a, C)) && setTimeout(function () { | |
!c._data(a, m) && !c._data(a, C) && (c.removeData(a, h, !0), b.fire()) | |
}, 0) | |
} | |
function i() { | |
return !1 | |
} | |
function q() { | |
return !0 | |
} | |
function M(a, d, g) { | |
d = d || 0; | |
if (c.isFunction(d)) return c.grep(a, function (a, c) { | |
return !!d.call(a, c, a) === g | |
}); | |
if (d.nodeType) return c.grep(a, function (a) { | |
return a === d === g | |
}); | |
if ("string" === typeof d) { | |
var h = c.grep(a, function (a) { | |
return 1 === a.nodeType | |
}); | |
if (Pa.test(d)) return c.filter(d, h, !g); | |
d = c.filter(d, h) | |
} | |
return c.grep(a, function (a) { | |
return 0 <= c.inArray(a, d) === g | |
}) | |
} | |
function o(a) { | |
var d = ab.split("|"), | |
a = a.createDocumentFragment(); | |
if (a.createElement) for (; d.length;) a.createElement(d.pop()); | |
return a | |
} | |
function A(a, d) { | |
if (1 === d.nodeType && c.hasData(a)) { | |
var g, h, m; | |
h = c._data(a); | |
var C = c._data(d, h), | |
b = h.events; | |
if (b) for (g in delete C.handle, C.events = {}, b) for (h = 0, m = b[g].length; h < m; h++) c.event.add(d, g + (b[g][h].namespace ? "." : "") + b[g][h].namespace, b[g][h], b[g][h].data); | |
if (C.data) C.data = c.extend({}, C.data) | |
} | |
} | |
function ua(a, d) { | |
var g; | |
if (1 === d.nodeType) { | |
d.clearAttributes && d.clearAttributes(); | |
d.mergeAttributes && d.mergeAttributes(a); | |
g = d.nodeName.toLowerCase(); | |
if ("object" === g) d.outerHTML = a.outerHTML; | |
else if ("input" === g && ("checkbox" === a.type || "radio" === a.type)) { | |
if (a.checked) d.defaultChecked = d.checked = a.checked; | |
if (d.value !== a.value) d.value = a.value | |
} else if ("option" === g) d.selected = a.defaultSelected; | |
else if ("input" === g || "textarea" === g) d.defaultValue = a.defaultValue; | |
d.removeAttribute(c.expando) | |
} | |
} | |
function u(a) { | |
return "undefined" !== typeof a.getElementsByTagName ? a.getElementsByTagName("*") : "undefined" !== typeof a.querySelectorAll ? a.querySelectorAll("*") : [] | |
} | |
function v(a) { | |
if ("checkbox" === a.type || "radio" === a.type) a.defaultChecked = a.checked | |
} | |
function H(a) { | |
var d = (a.nodeName || "").toLowerCase(); | |
"input" === d ? v(a) : "script" !== d && "undefined" !== typeof a.getElementsByTagName && c.grep(a.getElementsByTagName("input"), v) | |
} | |
function D(a, d) { | |
d.src ? c.ajax({ | |
url: d.src, | |
async: !1, | |
dataType: "script" | |
}) : c.globalEval((d.text || d.textContent || d.innerHTML || "").replace(Ea, "/*$0*/")); | |
d.parentNode && d.parentNode.removeChild(d) | |
} | |
function z(a, d, g) { | |
var h = "width" === d ? a.offsetWidth : a.offsetHeight, | |
m = "width" === d ? Ka : La, | |
C = 0, | |
b = m.length; | |
if (0 < h) { | |
if ("border" !== g) for (; C < b; C++) g || (h -= parseFloat(c.css(a, "padding" + m[C])) || 0), h = "margin" === g ? h + (parseFloat(c.css(a, g + m[C])) || 0) : h - (parseFloat(c.css(a, "border" + m[C] + "Width")) || 0); | |
return h + "px" | |
} | |
h = la(a, d, d); | |
if (0 > h || null == h) h = a.style[d] || 0; | |
h = parseFloat(h) || 0; | |
if (g) for (; C < b; C++) h += parseFloat(c.css(a, "padding" + m[C])) || 0, "padding" !== g && (h += parseFloat(c.css(a, "border" + m[C] + "Width")) || 0), "margin" === g && (h += parseFloat(c.css(a, g + m[C])) || 0); | |
return h + "px" | |
} | |
function B(a) { | |
return function (d, g) { | |
var t; | |
"string" !== typeof d && (g = d, d = "*"); | |
if (c.isFunction(g)) for (var h = d.toLowerCase().split(bb), m = 0, C = h.length, b, l; m < C; m++) b = h[m], (l = /^\+/.test(b)) && (b = b.substr(1) || "*"), t = a[b] = a[b] || [], b = t, b[l ? "unshift" : "push"](g) | |
} | |
} | |
function N(a, d, c, h, m, C) { | |
m = m || d.dataTypes[0]; | |
C = C || {}; | |
C[m] = !0; | |
for (var m = a[m], b = 0, l = m ? m.length : 0, k = a === Qa, e; b < l && (k || !e); b++) e = m[b](d, c, h), "string" === typeof e && (!k || C[e] ? e = f : (d.dataTypes.unshift(e), e = N(a, d, c, h, e, C))); | |
if ((k || !e) && !C["*"]) e = N(a, d, c, h, "*", C); | |
return e | |
} | |
function F(a, d) { | |
var g, h, m = c.ajaxSettings.flatOptions || {}; | |
for (g in d) d[g] !== f && ((m[g] ? a : h || (h = {}))[g] = d[g]); | |
h && c.extend(!0, a, h) | |
} | |
function Ra(a, d, g, h) { | |
if (c.isArray(d)) c.each(d, function (d, m) { | |
g || Na.test(a) ? h(a, m) : Ra(a + "[" + ("object" === typeof m || c.isArray(m) ? d : "") + "]", m, g, h) | |
}); | |
else if (!g && null != d && "object" === typeof d) for (var m in d) Ra(a + "[" + m + "]", d[m], g, h); | |
else h(a, d) | |
} | |
function p() { | |
try { | |
return new j.XMLHttpRequest | |
} catch (a) {} | |
} | |
function S() { | |
setTimeout(s, 0); | |
return va = c.now() | |
} | |
function s() { | |
va = f | |
} | |
function J(a, d) { | |
var g = {}; | |
c.each(cb.concat.apply([], cb.slice(0, d)), function () { | |
g[this] = a | |
}); | |
return g | |
} | |
function P(a) { | |
if (!Sa[a]) { | |
var d = n.body, | |
g = c("<" + a + ">").appendTo(d), | |
h = g.css("display"); | |
g.remove(); | |
if ("none" === h || "" === h) { | |
if (!da) da = n.createElement("iframe"), da.frameBorder = da.width = da.height = 0; | |
d.appendChild(da); | |
if (!ma || !da.createElement) ma = (da.contentWindow || da.contentDocument).document, ma.write(("CSS1Compat" === n.compatMode ? "<!doctype html>" : "") + "<html><body>"), ma.close(); | |
g = ma.createElement(a); | |
ma.body.appendChild(g); | |
h = c.css(g, "display"); | |
d.removeChild(da) | |
} | |
Sa[a] = h | |
} | |
return Sa[a] | |
} | |
function Ta(a) { | |
return c.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1 | |
} | |
var n = j.document, | |
E = j.navigator, | |
na = j.location, | |
c = function () { | |
function a() { | |
if (!d.isReady) { | |
try { | |
n.documentElement.doScroll("left") | |
} catch (c) { | |
setTimeout(a, 1); | |
return | |
} | |
d.ready() | |
} | |
} | |
var d = function (a, c) { | |
return new d.fn.init(a, c, m) | |
}, | |
c = j.jQuery, | |
h = j.$, | |
m, b = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, | |
l = /\S/, | |
e = /^\s+/, | |
k = /\s+$/, | |
p = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, | |
r = /^[\],:{}\s]*$/, | |
y = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, | |
i = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, | |
s = /(?:^|:|,)(?:\s*\[)+/g, | |
S = /(webkit)[ \/]([\w.]+)/, | |
o = /(opera)(?:.*version)?[ \/]([\w.]+)/, | |
w = /(msie) ([\w.]+)/, | |
L = /(mozilla)(?:.*? rv:([\w.]+))?/, | |
J = /-([a-z]|[0-9])/ig, | |
q = /^-ms-/, | |
G = function (a, d) { | |
return (d + "").toUpperCase() | |
}, | |
u = E.userAgent, | |
O, oa, ub = Object.prototype.toString, | |
pa = Object.prototype.hasOwnProperty, | |
Ua = Array.prototype.push, | |
ta = Array.prototype.slice, | |
v = String.prototype.trim, | |
db = Array.prototype.indexOf, | |
A = {}; | |
d.fn = d.prototype = { | |
constructor: d, | |
init: function (a, c, g) { | |
var h; | |
if (!a) return this; | |
if (a.nodeType) return this.context = this[0] = a, this.length = 1, this; | |
if ("body" === a && !c && n.body) return this.context = n, this[0] = n.body, this.selector = a, this.length = 1, this; | |
if ("string" === typeof a) { | |
if ((h = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && 3 <= a.length ? [null, a, null] : b.exec(a)) && (h[1] || !c)) { | |
if (h[1]) return g = (c = c instanceof d ? c[0] : c) ? c.ownerDocument || c : n, (a = p.exec(a)) ? d.isPlainObject(c) ? (a = [n.createElement(a[1])], d.fn.attr.call(a, c, !0)) : a = [g.createElement(a[1])] : (a = d.buildFragment([h[1]], [g]), a = (a.cacheable ? d.clone(a.fragment) : a.fragment).childNodes), d.merge(this, a); | |
if ((c = n.getElementById(h[2])) && c.parentNode) { | |
if (c.id !== h[2]) return g.find(a); | |
this.length = 1; | |
this[0] = c | |
} | |
this.context = n; | |
this.selector = a; | |
return this | |
} | |
return !c || c.jquery ? (c || g).find(a) : this.constructor(c).find(a) | |
} | |
if (d.isFunction(a)) return g.ready(a); | |
if (a.selector !== f) this.selector = a.selector, this.context = a.context; | |
return d.makeArray(a, this) | |
}, | |
selector: "", | |
jquery: "1.7.1", | |
length: 0, | |
size: function () { | |
return this.length | |
}, | |
toArray: function () { | |
return ta.call(this, 0) | |
}, | |
get: function (a) { | |
return null == a ? this.toArray() : 0 > a ? this[this.length + a] : this[a] | |
}, | |
pushStack: function (a, c, g) { | |
var h = this.constructor(); | |
d.isArray(a) ? Ua.apply(h, a) : d.merge(h, a); | |
h.prevObject = this; | |
h.context = this.context; | |
if ("find" === c) h.selector = this.selector + (this.selector ? " " : "") + g; | |
else if (c) h.selector = this.selector + "." + c + "(" + g + ")"; | |
return h | |
}, | |
each: function (a, c) { | |
return d.each(this, a, c) | |
}, | |
ready: function (a) { | |
d.bindReady(); | |
O.add(a); | |
return this | |
}, | |
eq: function (a) { | |
a = +a; | |
return -1 === a ? this.slice(a) : this.slice(a, a + 1) | |
}, | |
first: function () { | |
return this.eq(0) | |
}, | |
last: function () { | |
return this.eq(-1) | |
}, | |
slice: function () { | |
return this.pushStack(ta.apply(this, arguments), "slice", ta.call(arguments).join(",")) | |
}, | |
map: function (a) { | |
return this.pushStack(d.map(this, function (d, c) { | |
return a.call(d, c, d) | |
})) | |
}, | |
end: function () { | |
return this.prevObject || this.constructor(null) | |
}, | |
push: Ua, | |
sort: [].sort, | |
splice: [].splice | |
}; | |
d.fn.init.prototype = d.fn; | |
d.extend = d.fn.extend = function () { | |
var a, c, g, h, m, b = arguments[0] || {}, | |
C = 1, | |
O = arguments.length, | |
l = !1; | |
"boolean" === typeof b && (l = b, b = arguments[1] || {}, C = 2); | |
"object" !== typeof b && !d.isFunction(b) && (b = {}); | |
O === C && (b = this, --C); | |
for (; C < O; C++) if (null != (a = arguments[C])) for (c in a) pa.call(a, c) && (g = b[c], h = a[c], b !== h && (l && h && (d.isPlainObject(h) || (m = d.isArray(h))) ? (m ? (m = !1, g = g && d.isArray(g) ? g : []) : g = g && d.isPlainObject(g) ? g : {}, b[c] = d.extend(l, g, h)) : h !== f && (b[c] = h))); | |
return b | |
}; | |
d.extend({ | |
noConflict: function (a) { | |
if (j.$ === d) j.$ = h; | |
if (a && j.jQuery === d) j.jQuery = c; | |
return d | |
}, | |
isReady: !1, | |
readyWait: 1, | |
holdReady: function (a) { | |
a ? d.readyWait++ : d.ready(!0) | |
}, | |
ready: function (a) { | |
if (!0 === a && !--d.readyWait || !0 !== a && !d.isReady) { | |
if (!n.body) return setTimeout(d.ready, 1); | |
d.isReady = !0; | |
!0 !== a && 0 < --d.readyWait || (O.fireWith(n, [d]), d.fn.trigger && d(n).trigger("ready").off("ready")) | |
} | |
}, | |
bindReady: function () { | |
if (!O) { | |
O = d.Callbacks("once memory"); | |
if ("complete" === n.readyState) return setTimeout(d.ready, 1); | |
if (n.addEventListener) n.addEventListener("DOMContentLoaded", oa, !1), j.addEventListener("load", d.ready, !1); | |
else if (n.attachEvent) { | |
n.attachEvent("onreadystatechange", oa); | |
j.attachEvent("onload", d.ready); | |
var c = !1; | |
try { | |
c = null == j.frameElement | |
} catch (g) {} | |
n.documentElement.doScroll && c && a() | |
} | |
} | |
}, | |
isFunction: function (a) { | |
return "function" === d.type(a) | |
}, | |
isArray: Array.isArray || | |
function (a) { | |
return "array" === d.type(a) | |
}, | |
isWindow: function (a) { | |
return a && "object" === typeof a && "setInterval" in a | |
}, | |
isNumeric: function (a) { | |
return !isNaN(parseFloat(a)) && isFinite(a) | |
}, | |
type: function (a) { | |
return null == a ? "" + a : A[ub.call(a)] || "object" | |
}, | |
isPlainObject: function (a) { | |
if (!a || "object" !== d.type(a) || a.nodeType || d.isWindow(a)) return !1; | |
try { | |
if (a.constructor && !pa.call(a, "constructor") && !pa.call(a.constructor.prototype, "isPrototypeOf")) return !1 | |
} catch (c) { | |
return !1 | |
} | |
for (var g in a); | |
return g === f || pa.call(a, g) | |
}, | |
isEmptyObject: function (a) { | |
for (var d in a) return !1; | |
return !0 | |
}, | |
error: function (a) { | |
throw Error(a); | |
}, | |
parseJSON: function (a) { | |
if ("string" !== typeof a || !a) return null; | |
a = d.trim(a); | |
if (j.JSON && j.JSON.parse) return j.JSON.parse(a); | |
if (r.test(a.replace(y, "@").replace(i, "]").replace(s, ""))) return (new Function("return " + a))(); | |
d.error("Invalid JSON: " + a) | |
}, | |
parseXML: function (a) { | |
var c, g; | |
try { | |
j.DOMParser ? (g = new DOMParser, c = g.parseFromString(a, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(a)) | |
} catch (h) { | |
c = f | |
}(!c || !c.documentElement || c.getElementsByTagName("parsererror").length) && d.error("Invalid XML: " + a); | |
return c | |
}, | |
noop: function () {}, | |
globalEval: function (a) { | |
a && l.test(a) && (j.execScript || | |
function (a) { | |
j.eval.call(j, a) | |
})(a) | |
}, | |
camelCase: function (a) { | |
return a.replace(q, "ms-").replace(J, G) | |
}, | |
nodeName: function (a, d) { | |
return a.nodeName && a.nodeName.toUpperCase() === d.toUpperCase() | |
}, | |
each: function (a, c, g) { | |
var h, m = 0, | |
b = a.length, | |
C = b === f || d.isFunction(a); | |
if (g) if (C) for (h in a) { | |
if (pa.call(a, h) && !1 === c.apply(a[h], g)) break | |
} else for (; m < b && !(!1 === c.apply(a[m++], g));); | |
else if (C) for (h in a) { | |
if (pa.call(a, h) && !1 === c.call(a[h], h, a[h])) break | |
} else for (; m < b && !(!1 === c.call(a[m], m, a[m++]));); | |
return a | |
}, | |
trim: v ? | |
function (a) { | |
return null == a ? "" : v.call(a) | |
} : function (a) { | |
return null == a ? "" : a.toString().replace(e, "").replace(k, "") | |
}, | |
makeArray: function (a, c) { | |
var g = c || []; | |
if (null != a) { | |
var h = d.type(a); | |
null == a.length || "string" === h || "function" === h || "regexp" === h || d.isWindow(a) ? Ua.call(g, a) : d.merge(g, a) | |
} | |
return g | |
}, | |
inArray: function (a, d, c) { | |
var g; | |
if (d) { | |
if (db) return db.call(d, a, c); | |
g = d.length; | |
for (c = c ? 0 > c ? Math.max(0, g + c) : c : 0; c < g; c++) if (c in d && d[c] === a) return c | |
} | |
return -1 | |
}, | |
merge: function (a, d) { | |
var c = a.length, | |
g = 0; | |
if ("number" === typeof d.length) for (var h = d.length; g < h; g++) a[c++] = d[g]; | |
else for (; d[g] !== f;) a[c++] = d[g++]; | |
a.length = c; | |
return a | |
}, | |
grep: function (a, d, c) { | |
for (var g = [], h, c = !! c, m = 0, b = a.length; m < b; m++) h = !! d(a[m], m), c !== h && g.push(a[m]); | |
return g | |
}, | |
map: function (a, c, g) { | |
var h, m, b = [], | |
C = 0, | |
O = a.length; | |
if (a instanceof d || O !== f && "number" === typeof O && (0 < O && a[0] && a[O - 1] || 0 === O || d.isArray(a))) for (; C < O; C++) h = c(a[C], C, g), null != h && (b[b.length] = h); | |
else for (m in a) h = c(a[m], m, g), null != h && (b[b.length] = h); | |
return b.concat.apply([], b) | |
}, | |
guid: 1, | |
proxy: function (a, c) { | |
if ("string" === typeof c) var g = a[c], | |
c = a, | |
a = g; | |
if (!d.isFunction(a)) return f; | |
var h = ta.call(arguments, 2), | |
g = function () { | |
return a.apply(c, h.concat(ta.call(arguments))) | |
}; | |
g.guid = a.guid = a.guid || g.guid || d.guid++; | |
return g | |
}, | |
access: function (a, c, g, h, m, b) { | |
var C = a.length; | |
if ("object" === typeof c) { | |
for (var O in c) d.access(a, O, c[O], h, m, g); | |
return a | |
} | |
if (g !== f) { | |
h = !b && h && d.isFunction(g); | |
for (O = 0; O < C; O++) m(a[O], c, h ? g.call(a[O], O, m(a[O], c)) : g, b); | |
return a | |
} | |
return C ? m(a[0], c) : f | |
}, | |
now: function () { | |
return (new Date).getTime() | |
}, | |
uaMatch: function (a) { | |
a = a.toLowerCase(); | |
a = S.exec(a) || o.exec(a) || w.exec(a) || 0 > a.indexOf("compatible") && L.exec(a) || []; | |
return { | |
browser: a[1] || "", | |
version: a[2] || "0" | |
} | |
}, | |
sub: function () { | |
function a(d, c) { | |
return new a.fn.init(d, c) | |
} | |
d.extend(!0, a, this); | |
a.superclass = this; | |
a.fn = a.prototype = this(); | |
a.fn.constructor = a; | |
a.sub = this.sub; | |
a.fn.init = function (g, h) { | |
h && h instanceof d && !(h instanceof a) && (h = a(h)); | |
return d.fn.init.call(this, g, h, c) | |
}; | |
a.fn.init.prototype = a.fn; | |
var c = a(n); | |
return a | |
}, | |
browser: {} | |
}); | |
d.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (a, d) { | |
A["[object " + d + "]"] = d.toLowerCase() | |
}); | |
u = d.uaMatch(u); | |
if (u.browser) d.browser[u.browser] = !0, d.browser.version = u.version; | |
if (d.browser.webkit) d.browser.safari = !0; | |
l.test("\u00a0") && (e = /^[\s\xA0]+/, k = /[\s\xA0]+$/); | |
m = d(n); | |
n.addEventListener ? oa = function () { | |
n.removeEventListener("DOMContentLoaded", oa, !1); | |
d.ready() | |
} : n.attachEvent && (oa = function () { | |
"complete" === n.readyState && (n.detachEvent("onreadystatechange", oa), d.ready()) | |
}); | |
return d | |
}(), | |
$a = {}; | |
c.Callbacks = function (a) { | |
var a = a ? $a[a] || b(a) : {}, | |
d = [], | |
g = [], | |
h, m, C, l, e, k = function (g) { | |
var h, m, b, C; | |
for (h = 0, m = g.length; h < m; h++) b = g[h], C = c.type(b), "array" === C ? k(b) : "function" === C && (!a.unique || !n.has(b)) && d.push(b) | |
}, | |
p = function (c, b) { | |
b = b || []; | |
h = !a.memory || [c, b]; | |
m = !0; | |
e = C || 0; | |
C = 0; | |
for (l = d.length; d && e < l; e++) if (!1 === d[e].apply(c, b) && a.stopOnFalse) { | |
h = !0; | |
break | |
} | |
m = !1; | |
d && (a.once ? !0 === h ? n.disable() : d = [] : g && g.length && (h = g.shift(), n.fireWith(h[0], h[1]))) | |
}, | |
n = { | |
add: function () { | |
if (d) { | |
var a = d.length; | |
k(arguments); | |
m ? l = d.length : h && !0 !== h && (C = a, p(h[0], h[1])) | |
} | |
return this | |
}, | |
remove: function () { | |
if (d) for (var c = arguments, g = 0, h = c.length; g < h; g++) for (var b = 0; b < d.length && !(c[g] === d[b] && (m && b <= l && (l--, b <= e && e--), d.splice(b--, 1), a.unique)); b++); | |
return this | |
}, | |
has: function (a) { | |
if (d) for (var c = 0, g = d.length; c < g; c++) if (a === d[c]) return !0; | |
return !1 | |
}, | |
empty: function () { | |
d = []; | |
return this | |
}, | |
disable: function () { | |
d = g = h = f; | |
return this | |
}, | |
disabled: function () { | |
return !d | |
}, | |
lock: function () { | |
g = f; | |
(!h || !0 === h) && n.disable(); | |
return this | |
}, | |
locked: function () { | |
return !g | |
}, | |
fireWith: function (d, c) { | |
g && (m ? a.once || g.push([d, c]) : (!a.once || !h) && p(d, c)); | |
return this | |
}, | |
fire: function () { | |
n.fireWith(this, arguments); | |
return this | |
}, | |
fired: function () { | |
return !!h | |
} | |
}; | |
return n | |
}; | |
var T = [].slice; | |
c.extend({ | |
Deferred: function (a) { | |
var d = c.Callbacks("once memory"), | |
g = c.Callbacks("once memory"), | |
h = c.Callbacks("memory"), | |
m = "pending", | |
b = { | |
resolve: d, | |
reject: g, | |
notify: h | |
}, | |
l = { | |
done: d.add, | |
fail: g.add, | |
progress: h.add, | |
state: function () { | |
return m | |
}, | |
isResolved: d.fired, | |
isRejected: g.fired, | |
then: function (a, d, c) { | |
f.done(a).fail(d).progress(c); | |
return this | |
}, | |
always: function () { | |
f.done.apply(f, arguments).fail.apply(f, arguments); | |
return this | |
}, | |
pipe: function (a, d, g) { | |
return c.Deferred(function (h) { | |
c.each({ | |
done: [a, "resolve"], | |
fail: [d, "reject"], | |
progress: [g, "notify"] | |
}, function (a, d) { | |
var g = d[0], | |
m = d[1], | |
b; | |
if (c.isFunction(g)) f[a](function () { | |
if ((b = g.apply(this, arguments)) && c.isFunction(b.promise)) b.promise().then(h.resolve, h.reject, h.notify); | |
else h[m + "With"](this === f ? h : this, [b]) | |
}); | |
else f[a](h[m]) | |
}) | |
}).promise() | |
}, | |
promise: function (a) { | |
if (null == a) a = l; | |
else for (var d in l) a[d] = l[d]; | |
return a | |
} | |
}, | |
f = l.promise({}), | |
e; | |
for (e in b) f[e] = b[e].fire, f[e + "With"] = b[e].fireWith; | |
f.done(function () { | |
m = "resolved" | |
}, g.disable, h.lock).fail(function () { | |
m = "rejected" | |
}, d.disable, h.lock); | |
a && a.call(f, f); | |
return f | |
}, | |
when: function (a) { | |
function d(a) { | |
return function (d) { | |
h[a] = 1 < arguments.length ? T.call(arguments, 0) : d; | |
--f || e.resolveWith(e, h) | |
} | |
} | |
function g(a) { | |
return function (d) { | |
l[a] = 1 < arguments.length ? T.call(arguments, 0) : d; | |
e.notifyWith(k, l) | |
} | |
} | |
var h = T.call(arguments, 0), | |
m = 0, | |
b = h.length, | |
l = Array(b), | |
f = b, | |
e = 1 >= b && a && c.isFunction(a.promise) ? a : c.Deferred(), | |
k = e.promise(); | |
if (1 < b) { | |
for (; m < b; m++) h[m] && h[m].promise && c.isFunction(h[m].promise) ? h[m].promise().then(d(m), e.reject, g(m)) : --f; | |
f || e.resolveWith(e, h) | |
} else e !== a && e.resolveWith(e, b ? [a] : []); | |
return k | |
} | |
}); | |
c.support = function () { | |
var a, d, g, h, m, b, l, f, e = n.createElement("div"); | |
e.setAttribute("className", "t"); | |
e.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; | |
d = e.getElementsByTagName("*"); | |
g = e.getElementsByTagName("a")[0]; | |
if (!d || !d.length || !g) return {}; | |
h = n.createElement("select"); | |
m = h.appendChild(n.createElement("option")); | |
d = e.getElementsByTagName("input")[0]; | |
a = { | |
leadingWhitespace: 3 === e.firstChild.nodeType, | |
tbody: !e.getElementsByTagName("tbody").length, | |
htmlSerialize: !! e.getElementsByTagName("link").length, | |
style: /top/.test(g.getAttribute("style")), | |
hrefNormalized: "/a" === g.getAttribute("href"), | |
opacity: /^0.55/.test(g.style.opacity), | |
cssFloat: !! g.style.cssFloat, | |
checkOn: "on" === d.value, | |
optSelected: m.selected, | |
getSetAttribute: "t" !== e.className, | |
enctype: !! n.createElement("form").enctype, | |
html5Clone: "<:nav></:nav>" !== n.createElement("nav").cloneNode(!0).outerHTML, | |
submitBubbles: !0, | |
changeBubbles: !0, | |
focusinBubbles: !1, | |
deleteExpando: !0, | |
noCloneEvent: !0, | |
inlineBlockNeedsLayout: !1, | |
shrinkWrapBlocks: !1, | |
reliableMarginRight: !0 | |
}; | |
d.checked = !0; | |
a.noCloneChecked = d.cloneNode(!0).checked; | |
h.disabled = !0; | |
a.optDisabled = !m.disabled; | |
try { | |
delete e.test | |
} catch (k) { | |
a.deleteExpando = !1 | |
}!e.addEventListener && e.attachEvent && e.fireEvent && (e.attachEvent("onclick", function () { | |
a.noCloneEvent = !1 | |
}), e.cloneNode(!0).fireEvent("onclick")); | |
d = n.createElement("input"); | |
d.value = "t"; | |
d.setAttribute("type", "radio"); | |
a.radioValue = "t" === d.value; | |
d.setAttribute("checked", "checked"); | |
e.appendChild(d); | |
g = n.createDocumentFragment(); | |
g.appendChild(e.lastChild); | |
a.checkClone = g.cloneNode(!0).cloneNode(!0).lastChild.checked; | |
a.appendChecked = d.checked; | |
g.removeChild(d); | |
g.appendChild(e); | |
e.innerHTML = ""; | |
if (j.getComputedStyle) d = n.createElement("div"), d.style.width = "0", d.style.marginRight = "0", e.style.width = "2px", e.appendChild(d), a.reliableMarginRight = 0 === (parseInt((j.getComputedStyle(d, null) || { | |
marginRight: 0 | |
}).marginRight, 10) || 0); | |
if (e.attachEvent) for (l in { | |
submit: 1, | |
change: 1, | |
focusin: 1 | |
}) d = "on" + l, f = d in e, f || (e.setAttribute(d, "return;"), f = "function" === typeof e[d]), a[l + "Bubbles"] = f; | |
g.removeChild(e); | |
g = h = m = d = e = d = null; | |
c(function () { | |
var d, g, h, m, l = n.getElementsByTagName("body")[0]; | |
if (l) { | |
d = n.createElement("div"); | |
d.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; | |
l.insertBefore(d, l.firstChild); | |
e = n.createElement("div"); | |
d.appendChild(e); | |
e.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; | |
b = e.getElementsByTagName("td"); | |
f = 0 === b[0].offsetHeight; | |
b[0].style.display = ""; | |
b[1].style.display = "none"; | |
a.reliableHiddenOffsets = f && 0 === b[0].offsetHeight; | |
e.innerHTML = ""; | |
e.style.width = e.style.paddingLeft = "1px"; | |
c.boxModel = a.boxModel = 2 === e.offsetWidth; | |
if ("undefined" !== typeof e.style.zoom) e.style.display = "inline", e.style.zoom = 1, a.inlineBlockNeedsLayout = 2 === e.offsetWidth, e.style.display = "", e.innerHTML = "<div style='width:4px;'></div>", a.shrinkWrapBlocks = 2 !== e.offsetWidth; | |
e.style.cssText = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;visibility:hidden;border:0;"; | |
e.innerHTML = "<div style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;'><div></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; | |
g = e.firstChild; | |
h = g.firstChild; | |
m = { | |
doesNotAddBorder: 5 !== h.offsetTop, | |
doesAddBorderForTableAndCells: 5 === g.nextSibling.firstChild.firstChild.offsetTop | |
}; | |
h.style.position = "fixed"; | |
h.style.top = "20px"; | |
m.fixedPosition = 20 === h.offsetTop || 15 === h.offsetTop; | |
h.style.position = h.style.top = ""; | |
g.style.overflow = "hidden"; | |
g.style.position = "relative"; | |
m.subtractsBorderForOverflowNotVisible = -5 === h.offsetTop; | |
m.doesNotIncludeMarginInBodyOffset = 1 !== l.offsetTop; | |
l.removeChild(d); | |
e = null; | |
c.extend(a, m) | |
} | |
}); | |
return a | |
}(); | |
var tb = /^(?:\{.*\}|\[.*\])$/, | |
x = /([A-Z])/g; | |
c.extend({ | |
cache: {}, | |
uuid: 0, | |
expando: "jQuery" + (c.fn.jquery + Math.random()).replace(/\D/g, ""), | |
noData: { | |
embed: !0, | |
object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", | |
applet: !0 | |
}, | |
hasData: function (a) { | |
a = a.nodeType ? c.cache[a[c.expando]] : a[c.expando]; | |
return !!a && !e(a) | |
}, | |
data: function (a, d, g, h) { | |
if (c.acceptData(a)) { | |
var m; | |
m = c.expando; | |
var b = "string" === typeof d, | |
l = a.nodeType, | |
e = l ? c.cache : a, | |
k = l ? a[m] : a[m] && m, | |
p = "events" === d; | |
if (k && e[k] && (p || h || e[k].data) || !(b && g === f)) { | |
k || (l ? a[m] = k = ++c.uuid : k = m); | |
if (!e[k] && (e[k] = {}, !l)) e[k].toJSON = c.noop; | |
if ("object" === typeof d || "function" === typeof d) h ? e[k] = c.extend(e[k], d) : e[k].data = c.extend(e[k].data, d); | |
m = a = e[k]; | |
if (!h) { | |
if (!a.data) a.data = {}; | |
a = a.data | |
} | |
g !== f && (a[c.camelCase(d)] = g); | |
if (p && !a[d]) return m.events; | |
b ? (g = a[d], null == g && (g = a[c.camelCase(d)])) : g = a; | |
return g | |
} | |
} | |
}, | |
removeData: function (a, d, g) { | |
if (c.acceptData(a)) { | |
var h, m, b, l = c.expando, | |
f = a.nodeType, | |
k = f ? c.cache : a, | |
p = f ? a[l] : l; | |
if (k[p]) { | |
if (d && (h = g ? k[p] : k[p].data)) { | |
c.isArray(d) || (d in h ? d = [d] : (d = c.camelCase(d), d = d in h ? [d] : d.split(" "))); | |
for (m = 0, b = d.length; m < b; m++) delete h[d[m]]; | |
if (!(g ? e : c.isEmptyObject)(h)) return | |
} | |
if (!g && (delete k[p].data, !e(k[p]))) return; | |
c.support.deleteExpando || !k.setInterval ? delete k[p] : k[p] = null; | |
f && (c.support.deleteExpando ? delete a[l] : a.removeAttribute ? a.removeAttribute(l) : a[l] = null) | |
} | |
} | |
}, | |
_data: function (a, d, g) { | |
return c.data(a, d, g, !0) | |
}, | |
acceptData: function (a) { | |
if (a.nodeName) { | |
var d = c.noData[a.nodeName.toLowerCase()]; | |
if (d) return !(!0 === d || a.getAttribute("classid") !== d) | |
} | |
return !0 | |
} | |
}); | |
c.fn.extend({ | |
data: function (a, d) { | |
var g, h, m, b = null; | |
if ("undefined" === typeof a) { | |
if (this.length && (b = c.data(this[0]), 1 === this[0].nodeType && !c._data(this[0], "parsedAttrs"))) { | |
h = this[0].attributes; | |
for (var l = 0, e = h.length; l < e; l++) m = h[l].name, 0 === m.indexOf("data-") && (m = c.camelCase(m.substring(5)), k(this[0], m, b[m])); | |
c._data(this[0], "parsedAttrs", !0) | |
} | |
return b | |
} | |
if ("object" === typeof a) return this.each(function () { | |
c.data(this, a) | |
}); | |
g = a.split("."); | |
g[1] = g[1] ? "." + g[1] : ""; | |
return d === f ? (b = this.triggerHandler("getData" + g[1] + "!", [g[0]]), b === f && this.length && (b = c.data(this[0], a), b = k(this[0], a, b)), b === f && g[1] ? this.data(g[0]) : b) : this.each(function () { | |
var h = c(this), | |
m = [g[0], d]; | |
h.triggerHandler("setData" + g[1] + "!", m); | |
c.data(this, a, d); | |
h.triggerHandler("changeData" + g[1] + "!", m) | |
}) | |
}, | |
removeData: function (a) { | |
return this.each(function () { | |
c.removeData(this, a) | |
}) | |
} | |
}); | |
c.extend({ | |
_mark: function (a, d) { | |
a && (d = (d || "fx") + "mark", c._data(a, d, (c._data(a, d) || 0) + 1)) | |
}, | |
_unmark: function (a, d, g) { | |
!0 !== a && (g = d, d = a, a = !1); | |
if (d) { | |
var g = g || "fx", | |
h = g + "mark"; | |
(a = a ? 0 : (c._data(d, h) || 1) - 1) ? c._data(d, h, a) : (c.removeData(d, h, !0), r(d, g, "mark")) | |
} | |
}, | |
queue: function (a, d, g) { | |
var h; | |
if (a) return d = (d || "fx") + "queue", h = c._data(a, d), g && (!h || c.isArray(g) ? h = c._data(a, d, c.makeArray(g)) : h.push(g)), h || [] | |
}, | |
dequeue: function (a, d) { | |
var d = d || "fx", | |
g = c.queue(a, d), | |
h = g.shift(), | |
m = {}; | |
"inprogress" === h && (h = g.shift()); | |
h && ("fx" === d && g.unshift("inprogress"), c._data(a, d + ".run", m), h.call(a, function () { | |
c.dequeue(a, d) | |
}, m)); | |
g.length || (c.removeData(a, d + "queue " + d + ".run", !0), r(a, d, "queue")) | |
} | |
}); | |
c.fn.extend({ | |
queue: function (a, d) { | |
"string" !== typeof a && (d = a, a = "fx"); | |
return d === f ? c.queue(this[0], a) : this.each(function () { | |
var g = c.queue(this, a, d); | |
"fx" === a && "inprogress" !== g[0] && c.dequeue(this, a) | |
}) | |
}, | |
dequeue: function (a) { | |
return this.each(function () { | |
c.dequeue(this, a) | |
}) | |
}, | |
delay: function (a, d) { | |
a = c.fx ? c.fx.speeds[a] || a : a; | |
return this.queue(d || "fx", function (d, c) { | |
var m = setTimeout(d, a); | |
c.stop = function () { | |
clearTimeout(m) | |
} | |
}) | |
}, | |
clearQueue: function (a) { | |
return this.queue(a || "fx", []) | |
}, | |
promise: function (a) { | |
function d() { | |
--b || g.resolveWith(h, [h]) | |
} | |
"string" !== typeof a && (a = f); | |
for (var a = a || "fx", g = c.Deferred(), h = this, m = h.length, b = 1, l = a + "defer", e = a + "queue", a = a + "mark", k; m--;) if (k = c.data(h[m], l, f, !0) || (c.data(h[m], e, f, !0) || c.data(h[m], a, f, !0)) && c.data(h[m], l, c.Callbacks("once memory"), !0)) b++, k.add(d); | |
d(); | |
return g.promise() | |
} | |
}); | |
var V = /[\n\t\r]/g, | |
I = /\s+/, | |
K = /\r/g, | |
ba = /^(?:button|input)$/i, | |
ca = /^(?:button|input|object|select|textarea)$/i, | |
X = /^a(?:rea)?$/i, | |
U = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, | |
ra = c.support.getSetAttribute, | |
l, y, L; | |
c.fn.extend({ | |
attr: function (a, d) { | |
return c.access(this, a, d, !0, c.attr) | |
}, | |
removeAttr: function (a) { | |
return this.each(function () { | |
c.removeAttr(this, a) | |
}) | |
}, | |
prop: function (a, d) { | |
return c.access(this, a, d, !0, c.prop) | |
}, | |
removeProp: function (a) { | |
a = c.propFix[a] || a; | |
return this.each(function () { | |
try { | |
this[a] = f, delete this[a] | |
} catch (d) {} | |
}) | |
}, | |
addClass: function (a) { | |
var d, g, h, m, b, l, e; | |
if (c.isFunction(a)) return this.each(function (d) { | |
c(this).addClass(a.call(this, d, this.className)) | |
}); | |
if (a && "string" === typeof a) { | |
d = a.split(I); | |
for (g = 0, h = this.length; g < h; g++) if (m = this[g], 1 === m.nodeType) if (!m.className && 1 === d.length) m.className = a; | |
else { | |
b = " " + m.className + " "; | |
for (l = 0, e = d.length; l < e; l++)~b.indexOf(" " + d[l] + " ") || (b += d[l] + " "); | |
m.className = c.trim(b) | |
} | |
} | |
return this | |
}, | |
removeClass: function (a) { | |
var d, g, h, m, b, l, e; | |
if (c.isFunction(a)) return this.each(function (d) { | |
c(this).removeClass(a.call(this, d, this.className)) | |
}); | |
if (a && "string" === typeof a || a === f) { | |
d = (a || "").split(I); | |
for (g = 0, h = this.length; g < h; g++) if (m = this[g], 1 === m.nodeType && m.className) if (a) { | |
b = (" " + m.className + " ").replace(V, " "); | |
for (l = 0, e = d.length; l < e; l++) b = b.replace(" " + d[l] + " ", " "); | |
m.className = c.trim(b) | |
} else m.className = "" | |
} | |
return this | |
}, | |
toggleClass: function (a, d) { | |
var g = typeof a, | |
h = "boolean" === typeof d; | |
return c.isFunction(a) ? this.each(function (g) { | |
c(this).toggleClass(a.call(this, g, this.className, d), d) | |
}) : this.each(function () { | |
if ("string" === g) for (var m, b = 0, l = c(this), e = d, f = a.split(I); m = f[b++];) e = h ? e : !l.hasClass(m), l[e ? "addClass" : "removeClass"](m); | |
else if ("undefined" === g || "boolean" === g) this.className && c._data(this, "__className__", this.className), this.className = this.className || !1 === a ? "" : c._data(this, "__className__") || "" | |
}) | |
}, | |
hasClass: function (a) { | |
for (var a = " " + a + " ", d = 0, c = this.length; d < c; d++) if (1 === this[d].nodeType && -1 < (" " + this[d].className + " ").replace(V, " ").indexOf(a)) return !0; | |
return !1 | |
}, | |
val: function (a) { | |
var d, g, h, m = this[0]; | |
if (arguments.length) return h = c.isFunction(a), this.each(function (g) { | |
var m = c(this); | |
if (1 === this.nodeType && (g = h ? a.call(this, g, m.val()) : a, null == g ? g = "" : "number" === typeof g ? g += "" : c.isArray(g) && (g = c.map(g, function (a) { | |
return null == a ? "" : a + "" | |
})), d = c.valHooks[this.nodeName.toLowerCase()] || c.valHooks[this.type], !d || !("set" in d) || d.set(this, g, "value") === f)) this.value = g | |
}); | |
if (m) { | |
if ((d = c.valHooks[m.nodeName.toLowerCase()] || c.valHooks[m.type]) && "get" in d && (g = d.get(m, "value")) !== f) return g; | |
g = m.value; | |
return "string" === typeof g ? g.replace(K, "") : null == g ? "" : g | |
} | |
} | |
}); | |
c.extend({ | |
valHooks: { | |
option: { | |
get: function (a) { | |
var d = a.attributes.value; | |
return !d || d.specified ? a.value : a.text | |
} | |
}, | |
select: { | |
get: function (a) { | |
var d, g, h = a.selectedIndex, | |
m = [], | |
b = a.options, | |
l = "select-one" === a.type; | |
if (0 > h) return null; | |
a = l ? h : 0; | |
for (g = l ? h + 1 : b.length; a < g; a++) if (d = b[a], d.selected && (c.support.optDisabled ? !d.disabled : null === d.getAttribute("disabled")) && (!d.parentNode.disabled || !c.nodeName(d.parentNode, "optgroup"))) { | |
d = c(d).val(); | |
if (l) return d; | |
m.push(d) | |
} | |
return l && !m.length && b.length ? c(b[h]).val() : m | |
}, | |
set: function (a, d) { | |
var g = c.makeArray(d); | |
c(a).find("option").each(function () { | |
this.selected = 0 <= c.inArray(c(this).val(), g) | |
}); | |
if (!g.length) a.selectedIndex = -1; | |
return g | |
} | |
} | |
}, | |
attrFn: { | |
val: !0, | |
css: !0, | |
html: !0, | |
text: !0, | |
data: !0, | |
width: !0, | |
height: !0, | |
offset: !0 | |
}, | |
attr: function (a, d, g, h) { | |
var m, b, e = a.nodeType; | |
if (a && !(3 === e || 8 === e || 2 === e)) { | |
if (h && d in c.attrFn) return c(a)[d](g); | |
if ("undefined" === typeof a.getAttribute) return c.prop(a, d, g); | |
if (h = 1 !== e || !c.isXMLDoc(a)) d = d.toLowerCase(), b = c.attrHooks[d] || (U.test(d) ? y : l); | |
if (g !== f) if (null === g) c.removeAttr(a, d); | |
else { | |
if (b && "set" in b && h && (m = b.set(a, g, d)) !== f) return m; | |
a.setAttribute(d, "" + g); | |
return g | |
} else { | |
if (b && "get" in b && h && null !== (m = b.get(a, d))) return m; | |
m = a.getAttribute(d); | |
return null === m ? f : m | |
} | |
} | |
}, | |
removeAttr: function (a, d) { | |
var g, h, m, b, l = 0; | |
if (d && 1 === a.nodeType) { | |
h = d.toLowerCase().split(I); | |
for (b = h.length; l < b; l++) if (m = h[l]) g = c.propFix[m] || m, c.attr(a, m, ""), a.removeAttribute(ra ? m : g), U.test(m) && g in a && (a[g] = !1) | |
} | |
}, | |
attrHooks: { | |
type: { | |
set: function (a, d) { | |
if (ba.test(a.nodeName) && a.parentNode) c.error("type property can't be changed"); | |
else if (!c.support.radioValue && "radio" === d && c.nodeName(a, "input")) { | |
var g = a.value; | |
a.setAttribute("type", d); | |
if (g) a.value = g; | |
return d | |
} | |
} | |
}, | |
value: { | |
get: function (a, d) { | |
return l && c.nodeName(a, "button") ? l.get(a, d) : d in a ? a.value : null | |
}, | |
set: function (a, d, g) { | |
if (l && c.nodeName(a, "button")) return l.set(a, d, g); | |
a.value = d | |
} | |
} | |
}, | |
propFix: { | |
tabindex: "tabIndex", | |
readonly: "readOnly", | |
"for": "htmlFor", | |
"class": "className", | |
maxlength: "maxLength", | |
cellspacing: "cellSpacing", | |
cellpadding: "cellPadding", | |
rowspan: "rowSpan", | |
colspan: "colSpan", | |
usemap: "useMap", | |
frameborder: "frameBorder", | |
contenteditable: "contentEditable" | |
}, | |
prop: function (a, d, g) { | |
var h, m, b = a.nodeType; | |
if (a && !(3 === b || 8 === b || 2 === b)) { | |
if (1 !== b || !c.isXMLDoc(a)) d = c.propFix[d] || d, m = c.propHooks[d]; | |
return g !== f ? m && "set" in m && (h = m.set(a, g, d)) !== f ? h : a[d] = g : m && "get" in m && null !== (h = m.get(a, d)) ? h : a[d] | |
} | |
}, | |
propHooks: { | |
tabIndex: { | |
get: function (a) { | |
var d = a.getAttributeNode("tabindex"); | |
return d && d.specified ? parseInt(d.value, 10) : ca.test(a.nodeName) || X.test(a.nodeName) && a.href ? 0 : f | |
} | |
} | |
} | |
}); | |
c.attrHooks.tabindex = c.propHooks.tabIndex; | |
y = { | |
get: function (a, d) { | |
var g, h = c.prop(a, d); | |
return !0 === h || "boolean" !== typeof h && (g = a.getAttributeNode(d)) && !1 !== g.nodeValue ? d.toLowerCase() : f | |
}, | |
set: function (a, d, g) { | |
!1 === d ? c.removeAttr(a, g) : (d = c.propFix[g] || g, d in a && (a[d] = !0), a.setAttribute(g, g.toLowerCase())); | |
return g | |
} | |
}; | |
if (!ra) L = { | |
name: !0, | |
id: !0 | |
}, l = c.valHooks.button = { | |
get: function (a, d) { | |
var c; | |
return (c = a.getAttributeNode(d)) && (L[d] ? "" !== c.nodeValue : c.specified) ? c.nodeValue : f | |
}, | |
set: function (a, d, c) { | |
var h = a.getAttributeNode(c); | |
h || (h = n.createAttribute(c), a.setAttributeNode(h)); | |
return h.nodeValue = d + "" | |
} | |
}, c.attrHooks.tabindex.set = l.set, c.each(["width", "height"], function (a, d) { | |
c.attrHooks[d] = c.extend(c.attrHooks[d], { | |
set: function (a, c) { | |
if ("" === c) return a.setAttribute(d, "auto"), c | |
} | |
}) | |
}), c.attrHooks.contenteditable = { | |
get: l.get, | |
set: function (a, d, c) { | |
"" === d && (d = "false"); | |
l.set(a, d, c) | |
} | |
}; | |
c.support.hrefNormalized || c.each(["href", "src", "width", "height"], function (a, d) { | |
c.attrHooks[d] = c.extend(c.attrHooks[d], { | |
get: function (a) { | |
a = a.getAttribute(d, 2); | |
return null === a ? f : a | |
} | |
}) | |
}); | |
if (!c.support.style) c.attrHooks.style = { | |
get: function (a) { | |
return a.style.cssText.toLowerCase() || f | |
}, | |
set: function (a, d) { | |
return a.style.cssText = "" + d | |
} | |
}; | |
if (!c.support.optSelected) c.propHooks.selected = c.extend(c.propHooks.selected, { | |
get: function () { | |
return null | |
} | |
}); | |
if (!c.support.enctype) c.propFix.enctype = "encoding"; | |
c.support.checkOn || c.each(["radio", "checkbox"], function () { | |
c.valHooks[this] = { | |
get: function (a) { | |
return null === a.getAttribute("value") ? "on" : a.value | |
} | |
} | |
}); | |
c.each(["radio", "checkbox"], function () { | |
c.valHooks[this] = c.extend(c.valHooks[this], { | |
set: function (a, d) { | |
if (c.isArray(d)) return a.checked = 0 <= c.inArray(c(a).val(), d) | |
} | |
}) | |
}); | |
var G = /^(?:textarea|input|select)$/i, | |
Q = /^([^\.]*)?(?:\.(.+))?$/, | |
R = /\bhover(\.\S+)?\b/, | |
ia = /^key/, | |
ea = /^(?:mouse|contextmenu)|click/, | |
eb = /^(?:focusinfocus|focusoutblur)$/, | |
ga = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, | |
Va = function (a) { | |
if (a = ga.exec(a)) a[1] = (a[1] || "").toLowerCase(), a[3] = a[3] && RegExp("(?:^|\\s)" + a[3] + "(?:\\s|$)"); | |
return a | |
}, | |
fb = function (a) { | |
return c.event.special.hover ? a : a.replace(R, "mouseenter$1 mouseleave$1") | |
}; | |
c.event = { | |
add: function (a, d, g, h, b) { | |
var l, e, k, p, n, r, j, y, i; | |
if (!(3 === a.nodeType || 8 === a.nodeType || !d || !g || !(l = c._data(a)))) { | |
if (g.handler) j = g, g = j.handler; | |
if (!g.guid) g.guid = c.guid++; | |
k = l.events; | |
if (!k) l.events = k = {}; | |
e = l.handle; | |
if (!e) l.handle = e = function (a) { | |
return "undefined" !== typeof c && (!a || c.event.triggered !== a.type) ? c.event.dispatch.apply(e.elem, arguments) : f | |
}, e.elem = a; | |
d = c.trim(fb(d)).split(" "); | |
for (l = 0; l < d.length; l++) { | |
p = Q.exec(d[l]) || []; | |
n = p[1]; | |
r = (p[2] || "").split(".").sort(); | |
i = c.event.special[n] || {}; | |
n = (b ? i.delegateType : i.bindType) || n; | |
i = c.event.special[n] || {}; | |
p = c.extend({ | |
type: n, | |
origType: p[1], | |
data: h, | |
handler: g, | |
guid: g.guid, | |
selector: b, | |
quick: Va(b), | |
namespace: r.join(".") | |
}, j); | |
y = k[n]; | |
if (!y && (y = k[n] = [], y.delegateCount = 0, !i.setup || !1 === i.setup.call(a, h, r, e))) a.addEventListener ? a.addEventListener(n, e, !1) : a.attachEvent && a.attachEvent("on" + n, e); | |
if (i.add && (i.add.call(a, p), !p.handler.guid)) p.handler.guid = g.guid; | |
b ? y.splice(y.delegateCount++, 0, p) : y.push(p); | |
c.event.global[n] = !0 | |
} | |
a = null | |
} | |
}, | |
global: {}, | |
remove: function (a, d, g, h, b) { | |
var l = c.hasData(a) && c._data(a), | |
e, f, k, p, n, r, j, i, y, s; | |
if (l && (j = l.events)) { | |
d = c.trim(fb(d || "")).split(" "); | |
for (e = 0; e < d.length; e++) if (f = Q.exec(d[e]) || [], k = p = f[1], f = f[2], k) { | |
i = c.event.special[k] || {}; | |
k = (h ? i.delegateType : i.bindType) || k; | |
y = j[k] || []; | |
n = y.length; | |
f = f ? RegExp("(^|\\.)" + f.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; | |
for (r = 0; r < y.length; r++) if (s = y[r], (b || p === s.origType) && (!g || g.guid === s.guid) && (!f || f.test(s.namespace)) && (!h || h === s.selector || "**" === h && s.selector)) y.splice(r--, 1), s.selector && y.delegateCount--, i.remove && i.remove.call(a, s); | |
0 === y.length && n !== y.length && ((!i.teardown || !1 === i.teardown.call(a, f)) && c.removeEvent(a, k, l.handle), delete j[k]) | |
} else for (k in j) j.hasOwnProperty(k) && c.event.remove(a, k + d[e], g, h, !0); | |
if (c.isEmptyObject(j)) { | |
if (d = l.handle) d.elem = null; | |
c.removeData(a, ["events", "handle"], !0) | |
} | |
} | |
}, | |
customEvent: { | |
getData: !0, | |
setData: !0, | |
changeData: !0 | |
}, | |
trigger: function (a, d, g, h) { | |
if (!g || !(3 === g.nodeType || 8 === g.nodeType)) { | |
var b = a.type || a, | |
l = [], | |
e, k, p, n, r; | |
if (!eb.test(b + c.event.triggered) && (0 <= b.indexOf("!") && (b = b.slice(0, -1), e = !0), 0 <= b.indexOf(".") && (l = b.split("."), b = l.shift(), l.sort()), g && !c.event.customEvent[b] || c.event.global[b])) if (a = "object" === typeof a ? a[c.expando] ? a : new c.Event(b, a) : new c.Event(b), a.type = b, a.isTrigger = !0, a.exclusive = e, a.namespace = l.join("."), a.namespace_re = a.namespace ? RegExp("(^|\\.)" + l.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, e = 0 > b.indexOf(":") ? "on" + b : "", g) { | |
a.result = f; | |
if (!a.target) a.target = g; | |
d = null != d ? c.makeArray(d) : []; | |
d.unshift(a); | |
p = c.event.special[b] || {}; | |
if (!(p.trigger && !1 === p.trigger.apply(g, d))) { | |
r = [ | |
[g, p.bindType || b] | |
]; | |
if (!h && !p.noBubble && !c.isWindow(g)) { | |
n = p.delegateType || b; | |
l = eb.test(n + b) ? g : g.parentNode; | |
for (k = null; l; l = l.parentNode) r.push([l, n]), k = l; | |
k && k === g.ownerDocument && r.push([k.defaultView || k.parentWindow || j, n]) | |
} | |
for (k = 0; k < r.length && !a.isPropagationStopped(); k++) l = r[k][0], a.type = r[k][1], (n = (c._data(l, "events") || {})[a.type] && c._data(l, "handle")) && n.apply(l, d), (n = e && l[e]) && c.acceptData(l) && !1 === n.apply(l, d) && a.preventDefault(); | |
a.type = b; | |
if (!h && !a.isDefaultPrevented() && (!p._default || !1 === p._default.apply(g.ownerDocument, d)) && !("click" === b && c.nodeName(g, "a")) && c.acceptData(g)) if (e && g[b] && ("focus" !== b && "blur" !== b || 0 !== a.target.offsetWidth) && !c.isWindow(g))(k = g[e]) && (g[e] = null), c.event.triggered = b, g[b](), c.event.triggered = f, k && (g[e] = k); | |
return a.result | |
} | |
} else for (k in g = c.cache, g) g[k].events && g[k].events[b] && c.event.trigger(a, d, g[k].handle.elem, !0) | |
} | |
}, | |
dispatch: function (a) { | |
var a = c.event.fix(a || j.event), | |
d = (c._data(this, "events") || {})[a.type] || [], | |
g = d.delegateCount, | |
h = [].slice.call(arguments, 0), | |
b = !a.exclusive && !a.namespace, | |
l = [], | |
e, k, p, n, r, y, i; | |
h[0] = a; | |
a.delegateTarget = this; | |
if (g && !a.target.disabled && !(a.button && "click" === a.type)) { | |
p = c(this); | |
p.context = this.ownerDocument || this; | |
for (k = a.target; k != this; k = k.parentNode || this) { | |
r = {}; | |
y = []; | |
p[0] = k; | |
for (e = 0; e < g; e++) { | |
n = d[e]; | |
i = n.selector; | |
if (r[i] === f) { | |
var s = r, | |
S = i, | |
o; | |
if (n.quick) { | |
o = n.quick; | |
var w = k.attributes || {}; | |
o = (!o[1] || k.nodeName.toLowerCase() === o[1]) && (!o[2] || (w.id || {}).value === o[2]) && (!o[3] || o[3].test((w["class"] || {}).value)) | |
} else o = p.is(i); | |
s[S] = o | |
} | |
r[i] && y.push(n) | |
} | |
y.length && l.push({ | |
elem: k, | |
matches: y | |
}) | |
} | |
} | |
d.length > g && l.push({ | |
elem: this, | |
matches: d.slice(g) | |
}); | |
for (e = 0; e < l.length && !a.isPropagationStopped(); e++) { | |
g = l[e]; | |
a.currentTarget = g.elem; | |
for (d = 0; d < g.matches.length && !a.isImmediatePropagationStopped(); d++) if (n = g.matches[d], b || !a.namespace && !n.namespace || a.namespace_re && a.namespace_re.test(n.namespace)) if (a.data = n.data, a.handleObj = n, n = ((c.event.special[n.origType] || {}).handle || n.handler).apply(g.elem, h), n !== f) a.result = n, !1 === n && (a.preventDefault(), a.stopPropagation()) | |
} | |
return a.result | |
}, | |
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | |
fixHooks: {}, | |
keyHooks: { | |
props: "char charCode key keyCode".split(" "), | |
filter: function (a, d) { | |
if (null == a.which) a.which = null != d.charCode ? d.charCode : d.keyCode; | |
return a | |
} | |
}, | |
mouseHooks: { | |
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | |
filter: function (a, d) { | |
var c, h, b = d.button, | |
l = d.fromElement; | |
if (null == a.pageX && null != d.clientX) c = a.target.ownerDocument || n, h = c.documentElement, c = c.body, a.pageX = d.clientX + (h && h.scrollLeft || c && c.scrollLeft || 0) - (h && h.clientLeft || c && c.clientLeft || 0), a.pageY = d.clientY + (h && h.scrollTop || c && c.scrollTop || 0) - (h && h.clientTop || c && c.clientTop || 0); | |
if (!a.relatedTarget && l) a.relatedTarget = l === a.target ? d.toElement : l; | |
if (!a.which && b !== f) a.which = b & 1 ? 1 : b & 2 ? 3 : b & 4 ? 2 : 0; | |
return a | |
} | |
}, | |
fix: function (a) { | |
if (a[c.expando]) return a; | |
var d, g, h = a, | |
b = c.event.fixHooks[a.type] || {}, | |
l = b.props ? this.props.concat(b.props) : this.props, | |
a = c.Event(h); | |
for (d = l.length; d;) g = l[--d], a[g] = h[g]; | |
if (!a.target) a.target = h.srcElement || n; | |
if (3 === a.target.nodeType) a.target = a.target.parentNode; | |
if (a.metaKey === f) a.metaKey = a.ctrlKey; | |
return b.filter ? b.filter(a, h) : a | |
}, | |
special: { | |
ready: { | |
setup: c.bindReady | |
}, | |
load: { | |
noBubble: !0 | |
}, | |
focus: { | |
delegateType: "focusin" | |
}, | |
blur: { | |
delegateType: "focusout" | |
}, | |
beforeunload: { | |
setup: function (a, d, g) { | |
if (c.isWindow(this)) this.onbeforeunload = g | |
}, | |
teardown: function (a, d) { | |
if (this.onbeforeunload === d) this.onbeforeunload = null | |
} | |
} | |
}, | |
simulate: function (a, d, g, h) { | |
a = c.extend(new c.Event, g, { | |
type: a, | |
isSimulated: !0, | |
originalEvent: {} | |
}); | |
h ? c.event.trigger(a, null, d) : c.event.dispatch.call(d, a); | |
a.isDefaultPrevented() && g.preventDefault() | |
} | |
}; | |
c.event.handle = c.event.dispatch; | |
c.removeEvent = n.removeEventListener ? | |
function (a, d, c) { | |
a.removeEventListener && a.removeEventListener(d, c, !1) | |
} : function (a, d, c) { | |
a.detachEvent && a.detachEvent("on" + d, c) | |
}; | |
c.Event = function (a, d) { | |
if (!(this instanceof c.Event)) return new c.Event(a, d); | |
a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || !1 === a.returnValue || a.getPreventDefault && a.getPreventDefault() ? q : i) : this.type = a; | |
d && c.extend(this, d); | |
this.timeStamp = a && a.timeStamp || c.now(); | |
this[c.expando] = !0 | |
}; | |
c.Event.prototype = { | |
preventDefault: function () { | |
this.isDefaultPrevented = q; | |
var a = this.originalEvent; | |
if (a) a.preventDefault ? a.preventDefault() : a.returnValue = !1 | |
}, | |
stopPropagation: function () { | |
this.isPropagationStopped = q; | |
var a = this.originalEvent; | |
if (a) a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0 | |
}, | |
stopImmediatePropagation: function () { | |
this.isImmediatePropagationStopped = q; | |
this.stopPropagation() | |
}, | |
isDefaultPrevented: i, | |
isPropagationStopped: i, | |
isImmediatePropagationStopped: i | |
}; | |
c.each({ | |
mouseenter: "mouseover", | |
mouseleave: "mouseout" | |
}, function (a, d) { | |
c.event.special[a] = { | |
delegateType: d, | |
bindType: d, | |
handle: function (a) { | |
var h = a.relatedTarget, | |
b = a.handleObj, | |
l; | |
if (!h || h !== this && !c.contains(this, h)) a.type = b.origType, l = b.handler.apply(this, arguments), a.type = d; | |
return l | |
} | |
} | |
}); | |
if (!c.support.submitBubbles) c.event.special.submit = { | |
setup: function () { | |
if (c.nodeName(this, "form")) return !1; | |
c.event.add(this, "click._submit keypress._submit", function (a) { | |
a = a.target; | |
if ((a = c.nodeName(a, "input") || c.nodeName(a, "button") ? a.form : f) && !a._submit_attached) c.event.add(a, "submit._submit", function (a) { | |
this.parentNode && !a.isTrigger && c.event.simulate("submit", this.parentNode, a, !0) | |
}), a._submit_attached = !0 | |
}) | |
}, | |
teardown: function () { | |
if (c.nodeName(this, "form")) return !1; | |
c.event.remove(this, "._submit") | |
} | |
}; | |
if (!c.support.changeBubbles) c.event.special.change = { | |
setup: function () { | |
if (G.test(this.nodeName)) { | |
if ("checkbox" === this.type || "radio" === this.type) c.event.add(this, "propertychange._change", function (a) { | |
if ("checked" === a.originalEvent.propertyName) this._just_changed = !0 | |
}), c.event.add(this, "click._change", function (a) { | |
if (this._just_changed && !a.isTrigger) this._just_changed = !1, c.event.simulate("change", this, a, !0) | |
}); | |
return !1 | |
} | |
c.event.add(this, "beforeactivate._change", function (a) { | |
a = a.target; | |
if (G.test(a.nodeName) && !a._change_attached) c.event.add(a, "change._change", function (a) { | |
this.parentNode && !a.isSimulated && !a.isTrigger && c.event.simulate("change", this.parentNode, a, !0) | |
}), a._change_attached = !0 | |
}) | |
}, | |
handle: function (a) { | |
var d = a.target; | |
if (this !== d || a.isSimulated || a.isTrigger || "radio" !== d.type && "checkbox" !== d.type) return a.handleObj.handler.apply(this, arguments) | |
}, | |
teardown: function () { | |
c.event.remove(this, "._change"); | |
return G.test(this.nodeName) | |
} | |
}; | |
c.support.focusinBubbles || c.each({ | |
focus: "focusin", | |
blur: "focusout" | |
}, function (a, d) { | |
var g = 0, | |
h = function (a) { | |
c.event.simulate(d, a.target, c.event.fix(a), !0) | |
}; | |
c.event.special[d] = { | |
setup: function () { | |
0 === g++ && n.addEventListener(a, h, !0) | |
}, | |
teardown: function () { | |
0 === --g && n.removeEventListener(a, h, !0) | |
} | |
} | |
}); | |
c.fn.extend({ | |
on: function (a, d, g, h, b) { | |
var l, e; | |
if ("object" === typeof a) { | |
"string" !== typeof d && (g = d, d = f); | |
for (e in a) this.on(e, d, g, a[e], b); | |
return this | |
} | |
null == g && null == h ? (h = d, g = d = f) : null == h && ("string" === typeof d ? (h = g, g = f) : (h = g, g = d, d = f)); | |
if (!1 === h) h = i; | |
else if (!h) return this; | |
if (1 === b) l = h, h = function (a) { | |
c().off(a); | |
return l.apply(this, arguments) | |
}, h.guid = l.guid || (l.guid = c.guid++); | |
return this.each(function () { | |
c.event.add(this, a, h, g, d) | |
}) | |
}, | |
one: function (a, d, c, h) { | |
return this.on.call(this, a, d, c, h, 1) | |
}, | |
off: function (a, d, g) { | |
if (a && a.preventDefault && a.handleObj) { | |
var h = a.handleObj; | |
c(a.delegateTarget).off(h.namespace ? h.type + "." + h.namespace : h.type, h.selector, h.handler); | |
return this | |
} | |
if ("object" === typeof a) { | |
for (h in a) this.off(h, d, a[h]); | |
return this | |
} | |
if (!1 === d || "function" === typeof d) g = d, d = f; | |
!1 === g && (g = i); | |
return this.each(function () { | |
c.event.remove(this, a, g, d) | |
}) | |
}, | |
bind: function (a, d, c) { | |
return this.on(a, null, d, c) | |
}, | |
unbind: function (a, d) { | |
return this.off(a, null, d) | |
}, | |
live: function (a, d, g) { | |
c(this.context).on(a, this.selector, d, g); | |
return this | |
}, | |
die: function (a, d) { | |
c(this.context).off(a, this.selector || "**", d); | |
return this | |
}, | |
delegate: function (a, d, c, h) { | |
return this.on(d, a, c, h) | |
}, | |
undelegate: function (a, d, c) { | |
return 1 == arguments.length ? this.off(a, "**") : this.off(d, a, c) | |
}, | |
trigger: function (a, d) { | |
return this.each(function () { | |
c.event.trigger(a, d, this) | |
}) | |
}, | |
triggerHandler: function (a, d) { | |
if (this[0]) return c.event.trigger(a, d, this[0], !0) | |
}, | |
toggle: function (a) { | |
var d = arguments, | |
g = a.guid || c.guid++, | |
h = 0, | |
b = function (g) { | |
var b = (c._data(this, "lastToggle" + a.guid) || 0) % h; | |
c._data(this, "lastToggle" + a.guid, b + 1); | |
g.preventDefault(); | |
return d[b].apply(this, arguments) || !1 | |
}; | |
for (b.guid = g; h < d.length;) d[h++].guid = g; | |
return this.click(b) | |
}, | |
hover: function (a, d) { | |
return this.mouseenter(a).mouseleave(d || a) | |
} | |
}); | |
c.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 (a, d) { | |
c.fn[d] = function (a, c) { | |
null == c && (c = a, a = null); | |
return 0 < arguments.length ? this.on(d, null, a, c) : this.trigger(d) | |
}; | |
c.attrFn && (c.attrFn[d] = !0); | |
if (ia.test(d)) c.event.fixHooks[d] = c.event.keyHooks; | |
if (ea.test(d)) c.event.fixHooks[d] = c.event.mouseHooks | |
}); | |
(function () { | |
function a(a, d, c, g, b, l) { | |
for (var b = 0, m = g.length; b < m; b++) { | |
var e = g[b]; | |
if (e) { | |
for (var f = !1, e = e[a]; e;) { | |
if (e[h] === c) { | |
f = g[e.sizset]; | |
break | |
} | |
if (1 === e.nodeType && !l) e[h] = c, e.sizset = b; | |
if (e.nodeName.toLowerCase() === d) { | |
f = e; | |
break | |
} | |
e = e[a] | |
} | |
g[b] = f | |
} | |
} | |
} | |
function d(a, d, c, g, b, l) { | |
for (var b = 0, m = g.length; b < m; b++) { | |
var e = g[b]; | |
if (e) { | |
for (var f = !1, e = e[a]; e;) { | |
if (e[h] === c) { | |
f = g[e.sizset]; | |
break | |
} | |
if (1 === e.nodeType) { | |
if (!l) e[h] = c, e.sizset = b; | |
if ("string" !== typeof d) { | |
if (e === d) { | |
f = !0; | |
break | |
} | |
} else if (0 < i.filter(d, [e]).length) { | |
f = e; | |
break | |
} | |
} | |
e = e[a] | |
} | |
g[b] = f | |
} | |
} | |
} | |
var g = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, | |
h = "sizcache" + (Math.random() + "").replace(".", ""), | |
b = 0, | |
l = Object.prototype.toString, | |
e = !1, | |
k = !0, | |
p = /\\/g, | |
r = /\r\n/g, | |
j = /\W/; | |
[0, 0].sort(function () { | |
k = !1; | |
return 0 | |
}); | |
var i = function (a, d, c, h) { | |
var c = c || [], | |
b = d = d || n; | |
if (1 !== d.nodeType && 9 !== d.nodeType) return []; | |
if (!a || "string" !== typeof a) return c; | |
var m, e, f, k, p, r = !0, | |
j = i.isXML(d), | |
y = [], | |
S = a; | |
do if (g.exec(""), m = g.exec(S)) if (S = m[3], y.push(m[1]), m[2]) { | |
k = m[3]; | |
break | |
} | |
while (m); | |
if (1 < y.length && o.exec(a)) if (2 === y.length && s.relative[y[0]]) e = u(y[0] + y[1], d, h); | |
else for (e = s.relative[y[0]] ? [d] : i(y.shift(), d); y.length;) a = y.shift(), s.relative[a] && (a += y.shift()), e = u(a, e, h); | |
else if (!h && 1 < y.length && 9 === d.nodeType && !j && s.match.ID.test(y[0]) && !s.match.ID.test(y[y.length - 1]) && (m = i.find(y.shift(), d, j), d = m.expr ? i.filter(m.expr, m.set)[0] : m.set[0]), d) { | |
m = h ? { | |
expr: y.pop(), | |
set: L(h) | |
} : i.find(y.pop(), 1 === y.length && ("~" === y[0] || "+" === y[0]) && d.parentNode ? d.parentNode : d, j); | |
e = m.expr ? i.filter(m.expr, m.set) : m.set; | |
for (0 < y.length ? f = L(e) : r = !1; y.length;) m = p = y.pop(), s.relative[p] ? m = y.pop() : p = "", null == m && (m = d), s.relative[p](f, m, j) | |
} else f = []; | |
f || (f = e); | |
f || i.error(p || a); | |
if ("[object Array]" === l.call(f)) if (r) if (d && 1 === d.nodeType) for (a = 0; null != f[a]; a++) f[a] && (!0 === f[a] || 1 === f[a].nodeType && i.contains(d, f[a])) && c.push(e[a]); | |
else for (a = 0; null != f[a]; a++) f[a] && 1 === f[a].nodeType && c.push(e[a]); | |
else c.push.apply(c, f); | |
else L(f, c); | |
k && (i(k, b, c, h), i.uniqueSort(c)); | |
return c | |
}; | |
i.uniqueSort = function (a) { | |
if (q && (e = k, a.sort(q), e)) for (var d = 1; d < a.length; d++) a[d] === a[d - 1] && a.splice(d--, 1); | |
return a | |
}; | |
i.matches = function (a, d) { | |
return i(a, null, null, d) | |
}; | |
i.matchesSelector = function (a, d) { | |
return 0 < i(d, null, null, [a]).length | |
}; | |
i.find = function (a, d, c) { | |
var g, h, b, m, l, e; | |
if (!a) return []; | |
for (h = 0, b = s.order.length; h < b; h++) if (l = s.order[h], m = s.leftMatch[l].exec(a)) if (e = m[1], m.splice(1, 1), "\\" !== e.substr(e.length - 1) && (m[1] = (m[1] || "").replace(p, ""), g = s.find[l](m, d, c), null != g)) { | |
a = a.replace(s.match[l], ""); | |
break | |
} | |
g || (g = "undefined" !== typeof d.getElementsByTagName ? d.getElementsByTagName("*") : []); | |
return { | |
set: g, | |
expr: a | |
} | |
}; | |
i.filter = function (a, d, c, g) { | |
for (var h, b, m, l, e, k, p, n, C = a, r = [], y = d, j = d && d[0] && i.isXML(d[0]); a && d.length;) { | |
for (m in s.filter) if (null != (h = s.leftMatch[m].exec(a)) && h[2]) if (k = s.filter[m], e = h[1], b = !1, h.splice(1, 1), "\\" !== e.substr(e.length - 1)) { | |
y === r && (r = []); | |
if (s.preFilter[m]) if (h = s.preFilter[m](h, y, c, r, g, j)) { | |
if (!0 === h) continue | |
} else b = l = !0; | |
if (h) for (p = 0; null != (e = y[p]); p++) e && (l = k(e, h, p, y), n = g ^ l, c && null != l ? n ? b = !0 : y[p] = !1 : n && (r.push(e), b = !0)); | |
if (l !== f) { | |
c || (y = r); | |
a = a.replace(s.match[m], ""); | |
if (!b) return []; | |
break | |
} | |
} | |
if (a === C) if (null == b) i.error(a); | |
else break; | |
C = a | |
} | |
return y | |
}; | |
i.error = function (a) { | |
throw Error("Syntax error, unrecognized expression: " + a); | |
}; | |
var y = i.getText = function (a) { | |
var d, c; | |
d = a.nodeType; | |
var g = ""; | |
if (d) if (1 === d || 9 === d) { | |
if ("string" === typeof a.textContent) return a.textContent; | |
if ("string" === typeof a.innerText) return a.innerText.replace(r, ""); | |
for (a = a.firstChild; a; a = a.nextSibling) g += y(a) | |
} else { | |
if (3 === d || 4 === d) return a.nodeValue | |
} else for (d = 0; c = a[d]; d++) 8 !== c.nodeType && (g += y(c)); | |
return g | |
}, | |
s = i.selectors = { | |
order: ["ID", "NAME", "TAG"], | |
match: { | |
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, | |
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, | |
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, | |
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, | |
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, | |
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, | |
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, | |
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ | |
}, | |
leftMatch: {}, | |
attrMap: { | |
"class": "className", | |
"for": "htmlFor" | |
}, | |
attrHandle: { | |
href: function (a) { | |
return a.getAttribute("href") | |
}, | |
type: function (a) { | |
return a.getAttribute("type") | |
} | |
}, | |
relative: { | |
"+": function (a, d) { | |
var c = "string" === typeof d, | |
g = c && !j.test(d), | |
c = c && !g; | |
g && (d = d.toLowerCase()); | |
for (var g = 0, h = a.length, b; g < h; g++) if (b = a[g]) { | |
for (; | |
(b = b.previousSibling) && 1 !== b.nodeType;); | |
a[g] = c || b && b.nodeName.toLowerCase() === d ? b || !1 : b === d | |
} | |
c && i.filter(d, a, !0) | |
}, | |
">": function (a, d) { | |
var c, g = "string" === typeof d, | |
h = 0, | |
b = a.length; | |
if (g && !j.test(d)) for (d = d.toLowerCase(); h < b; h++) { | |
if (c = a[h]) c = c.parentNode, a[h] = c.nodeName.toLowerCase() === d ? c : !1 | |
} else { | |
for (; h < b; h++)(c = a[h]) && (a[h] = g ? c.parentNode : c.parentNode === d); | |
g && i.filter(d, a, !0) | |
} | |
}, | |
"": function (c, g, h) { | |
var l, e = b++, | |
f = d; | |
"string" === typeof g && !j.test(g) && (l = g = g.toLowerCase(), f = a); | |
f("parentNode", g, e, c, l, h) | |
}, | |
"~": function (c, g, h) { | |
var l, e = b++, | |
f = d; | |
"string" === typeof g && !j.test(g) && (l = g = g.toLowerCase(), f = a); | |
f("previousSibling", g, e, c, l, h) | |
} | |
}, | |
find: { | |
ID: function (a, d, c) { | |
if ("undefined" !== typeof d.getElementById && !c) return (a = d.getElementById(a[1])) && a.parentNode ? [a] : [] | |
}, | |
NAME: function (a, d) { | |
if ("undefined" !== typeof d.getElementsByName) { | |
for (var c = [], g = d.getElementsByName(a[1]), h = 0, b = g.length; h < b; h++) g[h].getAttribute("name") === a[1] && c.push(g[h]); | |
return 0 === c.length ? null : c | |
} | |
}, | |
TAG: function (a, d) { | |
if ("undefined" !== typeof d.getElementsByTagName) return d.getElementsByTagName(a[1]) | |
} | |
}, | |
preFilter: { | |
CLASS: function (a, d, c, g, h, b) { | |
a = " " + a[1].replace(p, "") + " "; | |
if (b) return a; | |
for (var b = 0, m; null != (m = d[b]); b++) m && (h ^ (m.className && 0 <= (" " + m.className + " ").replace(/[\t\n\r]/g, " ").indexOf(a)) ? c || g.push(m) : c && (d[b] = !1)); | |
return !1 | |
}, | |
ID: function (a) { | |
return a[1].replace(p, "") | |
}, | |
TAG: function (a) { | |
return a[1].replace(p, "").toLowerCase() | |
}, | |
CHILD: function (a) { | |
if ("nth" === a[1]) { | |
a[2] || i.error(a[0]); | |
a[2] = a[2].replace(/^\+|\s*/g, ""); | |
var d = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even" === a[2] && "2n" || "odd" === a[2] && "2n+1" || !/\D/.test(a[2]) && "0n+" + a[2] || a[2]); | |
a[2] = d[1] + (d[2] || 1) - 0; | |
a[3] = d[3] - 0 | |
} else a[2] && i.error(a[0]); | |
a[0] = b++; | |
return a | |
}, | |
ATTR: function (a, d, c, g, h, b) { | |
d = a[1] = a[1].replace(p, ""); | |
!b && s.attrMap[d] && (a[1] = s.attrMap[d]); | |
a[4] = (a[4] || a[5] || "").replace(p, ""); | |
"~=" === a[2] && (a[4] = " " + a[4] + " "); | |
return a | |
}, | |
PSEUDO: function (a, d, c, h, b) { | |
if ("not" === a[1]) if (1 < (g.exec(a[3]) || "").length || /^\w/.test(a[3])) a[3] = i(a[3], null, null, d); | |
else return a = i.filter(a[3], d, c, 1 ^ b), c || h.push.apply(h, a), !1; | |
else if (s.match.POS.test(a[0]) || s.match.CHILD.test(a[0])) return !0; | |
return a | |
}, | |
POS: function (a) { | |
a.unshift(!0); | |
return a | |
} | |
}, | |
filters: { | |
enabled: function (a) { | |
return !1 === a.disabled && "hidden" !== a.type | |
}, | |
disabled: function (a) { | |
return !0 === a.disabled | |
}, | |
checked: function (a) { | |
return !0 === a.checked | |
}, | |
selected: function (a) { | |
return !0 === a.selected | |
}, | |
parent: function (a) { | |
return !!a.firstChild | |
}, | |
empty: function (a) { | |
return !a.firstChild | |
}, | |
has: function (a, d, c) { | |
return !!i(c[3], a).length | |
}, | |
header: function (a) { | |
return /h\d/i.test(a.nodeName) | |
}, | |
text: function (a) { | |
var d = a.getAttribute("type"), | |
c = a.type; | |
return "input" === a.nodeName.toLowerCase() && "text" === c && (d === c || null === d) | |
}, | |
radio: function (a) { | |
return "input" === a.nodeName.toLowerCase() && "radio" === a.type | |
}, | |
checkbox: function (a) { | |
return "input" === a.nodeName.toLowerCase() && "checkbox" === a.type | |
}, | |
file: function (a) { | |
return "input" === a.nodeName.toLowerCase() && "file" === a.type | |
}, | |
password: function (a) { | |
return "input" === a.nodeName.toLowerCase() && "password" === a.type | |
}, | |
submit: function (a) { | |
var d = a.nodeName.toLowerCase(); | |
return ("input" === d || "button" === d) && "submit" === a.type | |
}, | |
image: function (a) { | |
return "input" === a.nodeName.toLowerCase() && "image" === a.type | |
}, | |
reset: function (a) { | |
var d = a.nodeName.toLowerCase(); | |
return ("input" === d || "button" === d) && "reset" === a.type | |
}, | |
button: function (a) { | |
var d = a.nodeName.toLowerCase(); | |
return "input" === d && "button" === a.type || "button" === d | |
}, | |
input: function (a) { | |
return /input|select|textarea|button/i.test(a.nodeName) | |
}, | |
focus: function (a) { | |
return a === a.ownerDocument.activeElement | |
} | |
}, | |
setFilters: { | |
first: function (a, d) { | |
return 0 === d | |
}, | |
last: function (a, d, c, g) { | |
return d === g.length - 1 | |
}, | |
even: function (a, d) { | |
return 0 === d % 2 | |
}, | |
odd: function (a, d) { | |
return 1 === d % 2 | |
}, | |
lt: function (a, d, c) { | |
return d < c[3] - 0 | |
}, | |
gt: function (a, d, c) { | |
return d > c[3] - 0 | |
}, | |
nth: function (a, d, c) { | |
return c[3] - 0 === d | |
}, | |
eq: function (a, d, c) { | |
return c[3] - 0 === d | |
} | |
}, | |
filter: { | |
PSEUDO: function (a, d, c, g) { | |
var h = d[1], | |
b = s.filters[h]; | |
if (b) return b(a, c, d, g); | |
if ("contains" === h) return 0 <= (a.textContent || a.innerText || y([a]) || "").indexOf(d[3]); | |
if ("not" === h) { | |
d = d[3]; | |
c = 0; | |
for (g = d.length; c < g; c++) if (d[c] === a) return !1; | |
return !0 | |
} | |
i.error(h) | |
}, | |
CHILD: function (a, d) { | |
var c, g, b, m, l, e; | |
c = d[1]; | |
e = a; | |
switch (c) { | |
case "only": | |
case "first": | |
for (; e = e.previousSibling;) if (1 === e.nodeType) return !1; | |
if ("first" === c) return !0; | |
e = a; | |
case "last": | |
for (; e = e.nextSibling;) if (1 === e.nodeType) return !1; | |
return !0; | |
case "nth": | |
c = d[2]; | |
g = d[3]; | |
if (1 === c && 0 === g) return !0; | |
b = d[0]; | |
if ((m = a.parentNode) && (m[h] !== b || !a.nodeIndex)) { | |
l = 0; | |
for (e = m.firstChild; e; e = e.nextSibling) if (1 === e.nodeType) e.nodeIndex = ++l; | |
m[h] = b | |
} | |
e = a.nodeIndex - g; | |
return 0 === c ? 0 === e : 0 === e % c && 0 <= e / c | |
} | |
}, | |
ID: function (a, d) { | |
return 1 === a.nodeType && a.getAttribute("id") === d | |
}, | |
TAG: function (a, d) { | |
return "*" === d && 1 === a.nodeType || !! a.nodeName && a.nodeName.toLowerCase() === d | |
}, | |
CLASS: function (a, d) { | |
return -1 < (" " + (a.className || a.getAttribute("class")) + " ").indexOf(d) | |
}, | |
ATTR: function (a, d) { | |
var c = d[1], | |
c = i.attr ? i.attr(a, c) : s.attrHandle[c] ? s.attrHandle[c](a) : null != a[c] ? a[c] : a.getAttribute(c), | |
g = c + "", | |
h = d[2], | |
b = d[4]; | |
return null == c ? "!=" === h : !h && i.attr ? null != c : "=" === h ? g === b : "*=" === h ? 0 <= g.indexOf(b) : "~=" === h ? 0 <= (" " + g + " ").indexOf(b) : !b ? g && !1 !== c : "!=" === h ? g !== b : "^=" === h ? 0 === g.indexOf(b) : "$=" === h ? g.substr(g.length - b.length) === b : "|=" === h ? g === b || g.substr(0, b.length + 1) === b + "-" : !1 | |
}, | |
POS: function (a, d, c, g) { | |
var h = s.setFilters[d[2]]; | |
if (h) return h(a, c, d, g) | |
} | |
} | |
}, | |
o = s.match.POS, | |
S = function (a, d) { | |
return "\\" + (d - 0 + 1) | |
}, | |
w; | |
for (w in s.match) s.match[w] = RegExp(s.match[w].source + /(?![^\[]*\])(?![^\(]*\))/.source), s.leftMatch[w] = RegExp(/(^(?:.|\r|\n)*?)/.source + s.match[w].source.replace(/\\(\d+)/g, S)); | |
var L = function (a, d) { | |
a = Array.prototype.slice.call(a, 0); | |
return d ? (d.push.apply(d, a), d) : a | |
}; | |
try { | |
Array.prototype.slice.call(n.documentElement.childNodes, 0) | |
} catch (J) { | |
L = function (a, d) { | |
var c = 0, | |
g = d || []; | |
if ("[object Array]" === l.call(a)) Array.prototype.push.apply(g, a); | |
else if ("number" === typeof a.length) for (var h = a.length; c < h; c++) g.push(a[c]); | |
else for (; a[c]; c++) g.push(a[c]); | |
return g | |
} | |
} | |
var q, G; | |
n.documentElement.compareDocumentPosition ? q = function (a, d) { | |
return a === d ? (e = !0, 0) : !a.compareDocumentPosition || !d.compareDocumentPosition ? a.compareDocumentPosition ? -1 : 1 : a.compareDocumentPosition(d) & 4 ? -1 : 1 | |
} : (q = function (a, d) { | |
if (a === d) return e = !0, 0; | |
if (a.sourceIndex && d.sourceIndex) return a.sourceIndex - d.sourceIndex; | |
var c, g, h = [], | |
b = []; | |
c = a.parentNode; | |
g = d.parentNode; | |
var m = c; | |
if (c === g) return G(a, d); | |
if (c) { | |
if (!g) return 1 | |
} else return -1; | |
for (; m;) h.unshift(m), m = m.parentNode; | |
for (m = g; m;) b.unshift(m), m = m.parentNode; | |
c = h.length; | |
g = b.length; | |
for (m = 0; m < c && m < g; m++) if (h[m] !== b[m]) return G(h[m], b[m]); | |
return m === c ? G(a, b[m], -1) : G(h[m], d, 1) | |
}, G = function (a, d, c) { | |
if (a === d) return c; | |
for (a = a.nextSibling; a;) { | |
if (a === d) return -1; | |
a = a.nextSibling | |
} | |
return 1 | |
}); | |
(function () { | |
var a = n.createElement("div"), | |
d = "script" + (new Date).getTime(), | |
c = n.documentElement; | |
a.innerHTML = "<a name='" + d + "'/>"; | |
c.insertBefore(a, c.firstChild); | |
if (n.getElementById(d)) s.find.ID = function (a, d, c) { | |
if ("undefined" !== typeof d.getElementById && !c) return (d = d.getElementById(a[1])) ? d.id === a[1] || "undefined" !== typeof d.getAttributeNode && d.getAttributeNode("id").nodeValue === a[1] ? [d] : f : [] | |
}, s.filter.ID = function (a, d) { | |
var c = "undefined" !== typeof a.getAttributeNode && a.getAttributeNode("id"); | |
return 1 === a.nodeType && c && c.nodeValue === d | |
}; | |
c.removeChild(a); | |
c = a = null | |
})(); | |
(function () { | |
var a = n.createElement("div"); | |
a.appendChild(n.createComment("")); | |
if (0 < a.getElementsByTagName("*").length) s.find.TAG = function (a, d) { | |
var c = d.getElementsByTagName(a[1]); | |
if ("*" === a[1]) { | |
for (var g = [], h = 0; c[h]; h++) 1 === c[h].nodeType && g.push(c[h]); | |
c = g | |
} | |
return c | |
}; | |
a.innerHTML = "<a href='#'></a>"; | |
if (a.firstChild && "undefined" !== typeof a.firstChild.getAttribute && "#" !== a.firstChild.getAttribute("href")) s.attrHandle.href = function (a) { | |
return a.getAttribute("href", 2) | |
}; | |
a = null | |
})(); | |
n.querySelectorAll && | |
function () { | |
var a = i, | |
d = n.createElement("div"); | |
d.innerHTML = "<p class='TEST'></p>"; | |
if (!(d.querySelectorAll && 0 === d.querySelectorAll(".TEST").length)) { | |
i = function (d, c, g, h) { | |
c = c || n; | |
if (!h && !i.isXML(c)) { | |
var b = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(d); | |
if (b && (1 === c.nodeType || 9 === c.nodeType)) { | |
if (b[1]) return L(c.getElementsByTagName(d), g); | |
if (b[2] && s.find.CLASS && c.getElementsByClassName) return L(c.getElementsByClassName(b[2]), g) | |
} | |
if (9 === c.nodeType) { | |
if ("body" === d && c.body) return L([c.body], g); | |
if (b && b[3]) { | |
var m = c.getElementById(b[3]); | |
if (m && m.parentNode) { | |
if (m.id === b[3]) return L([m], g) | |
} else return L([], g) | |
} | |
try { | |
return L(c.querySelectorAll(d), g) | |
} catch (e) {} | |
} else if (1 === c.nodeType && "object" !== c.nodeName.toLowerCase()) { | |
var b = c, | |
l = (m = c.getAttribute("id")) || "__sizzle__", | |
f = c.parentNode, | |
k = /^\s*[+~]/.test(d); | |
m ? l = l.replace(/'/g, "\\$&") : c.setAttribute("id", l); | |
if (k && f) c = c.parentNode; | |
try { | |
if (!k || f) return L(c.querySelectorAll("[id='" + l + "'] " + d), g) | |
} catch (p) {} finally { | |
m || b.removeAttribute("id") | |
} | |
} | |
} | |
return a(d, c, g, h) | |
}; | |
for (var c in a) i[c] = a[c]; | |
d = null | |
} | |
}(); | |
(function () { | |
var a = n.documentElement, | |
d = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.msMatchesSelector; | |
if (d) { | |
var c = !d.call(n.createElement("div"), "div"), | |
g = !1; | |
try { | |
d.call(n.documentElement, "[test!='']:sizzle") | |
} catch (h) { | |
g = !0 | |
} | |
i.matchesSelector = function (a, h) { | |
h = h.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); | |
if (!i.isXML(a)) try { | |
if (g || !s.match.PSEUDO.test(h) && !/!=/.test(h)) { | |
var b = d.call(a, h); | |
if (b || !c || a.document && 11 !== a.document.nodeType) return b | |
} | |
} catch (m) {} | |
return 0 < i(h, null, null, [a]).length | |
} | |
} | |
})(); | |
(function () { | |
var a = n.createElement("div"); | |
a.innerHTML = "<div class='test e'></div><div class='test'></div>"; | |
if (a.getElementsByClassName && 0 !== a.getElementsByClassName("e").length && (a.lastChild.className = "e", 1 !== a.getElementsByClassName("e").length)) s.order.splice(1, 0, "CLASS"), s.find.CLASS = function (a, d, c) { | |
if ("undefined" !== typeof d.getElementsByClassName && !c) return d.getElementsByClassName(a[1]) | |
}, a = null | |
})(); | |
i.contains = n.documentElement.contains ? | |
function (a, d) { | |
return a !== d && (a.contains ? a.contains(d) : !0) | |
} : n.documentElement.compareDocumentPosition ? | |
function (a, d) { | |
return !!(a.compareDocumentPosition(d) & 16) | |
} : function () { | |
return !1 | |
}; | |
i.isXML = function (a) { | |
return (a = (a ? a.ownerDocument || a : 0).documentElement) ? "HTML" !== a.nodeName : !1 | |
}; | |
var u = function (a, d, c) { | |
for (var g, h = [], b = "", d = d.nodeType ? [d] : d; g = s.match.PSEUDO.exec(a);) b += g[0], a = a.replace(s.match.PSEUDO, ""); | |
a = s.relative[a] ? a + "*" : a; | |
g = 0; | |
for (var m = d.length; g < m; g++) i(a, d[g], h, c); | |
return i.filter(b, h) | |
}; | |
i.attr = c.attr; | |
i.selectors.attrMap = {}; | |
c.find = i; | |
c.expr = i.selectors; | |
c.expr[":"] = c.expr.filters; | |
c.unique = i.uniqueSort; | |
c.text = i.getText; | |
c.isXMLDoc = i.isXML; | |
c.contains = i.contains | |
})(); | |
var vb = /Until$/, | |
wb = /^(?:parents|prevUntil|prevAll)/, | |
Wa = /,/, | |
Pa = /^.[^:#\[\.,]*$/, | |
$ = Array.prototype.slice, | |
wa = c.expr.match.POS, | |
xb = { | |
children: !0, | |
contents: !0, | |
next: !0, | |
prev: !0 | |
}; | |
c.fn.extend({ | |
find: function (a) { | |
var d = this, | |
g, h; | |
if ("string" !== typeof a) return c(a).filter(function () { | |
for (g = 0, h = d.length; g < h; g++) if (c.contains(d[g], this)) return !0 | |
}); | |
var b = this.pushStack("", "find", a), | |
e, l, f; | |
for (g = 0, h = this.length; g < h; g++) if (e = b.length, c.find(a, this[g], b), 0 < g) for (l = e; l < b.length; l++) for (f = 0; f < e; f++) if (b[f] === b[l]) { | |
b.splice(l--, 1); | |
break | |
} | |
return b | |
}, | |
has: function (a) { | |
var d = c(a); | |
return this.filter(function () { | |
for (var a = 0, h = d.length; a < h; a++) if (c.contains(this, d[a])) return !0 | |
}) | |
}, | |
not: function (a) { | |
return this.pushStack(M(this, a, !1), "not", a) | |
}, | |
filter: function (a) { | |
return this.pushStack(M(this, a, !0), "filter", a) | |
}, | |
is: function (a) { | |
return !!a && ("string" === typeof a ? wa.test(a) ? 0 <= c(a, this.context).index(this[0]) : 0 < c.filter(a, this).length : 0 < this.filter(a).length) | |
}, | |
closest: function (a, d) { | |
var g = [], | |
h, b, e = this[0]; | |
if (c.isArray(a)) { | |
for (b = 1; e && e.ownerDocument && e !== d;) { | |
for (h = 0; h < a.length; h++) c(e).is(a[h]) && g.push({ | |
selector: a[h], | |
elem: e, | |
level: b | |
}); | |
e = e.parentNode; | |
b++ | |
} | |
return g | |
} | |
var l = wa.test(a) || "string" !== typeof a ? c(a, d || this.context) : 0; | |
for (h = 0, b = this.length; h < b; h++) for (e = this[h]; e;) if (l ? -1 < l.index(e) : c.find.matchesSelector(e, a)) { | |
g.push(e); | |
break | |
} else if (e = e.parentNode, !e || !e.ownerDocument || e === d || 11 === e.nodeType) break; | |
g = 1 < g.length ? c.unique(g) : g; | |
return this.pushStack(g, "closest", a) | |
}, | |
index: function (a) { | |
return !a ? this[0] && this[0].parentNode ? this.prevAll().length : -1 : "string" === typeof a ? c.inArray(this[0], c(a)) : c.inArray(a.jquery ? a[0] : a, this) | |
}, | |
add: function (a, d) { | |
var g = "string" === typeof a ? c(a, d) : c.makeArray(a && a.nodeType ? [a] : a), | |
h = c.merge(this.get(), g); | |
return this.pushStack(!g[0] || !g[0].parentNode || 11 === g[0].parentNode.nodeType || !h[0] || !h[0].parentNode || 11 === h[0].parentNode.nodeType ? h : c.unique(h)) | |
}, | |
andSelf: function () { | |
return this.add(this.prevObject) | |
} | |
}); | |
c.each({ | |
parent: function (a) { | |
return (a = a.parentNode) && 11 !== a.nodeType ? a : null | |
}, | |
parents: function (a) { | |
return c.dir(a, "parentNode") | |
}, | |
parentsUntil: function (a, d, g) { | |
return c.dir(a, "parentNode", g) | |
}, | |
next: function (a) { | |
return c.nth(a, 2, "nextSibling") | |
}, | |
prev: function (a) { | |
return c.nth(a, 2, "previousSibling") | |
}, | |
nextAll: function (a) { | |
return c.dir(a, "nextSibling") | |
}, | |
prevAll: function (a) { | |
return c.dir(a, "previousSibling") | |
}, | |
nextUntil: function (a, d, g) { | |
return c.dir(a, "nextSibling", g) | |
}, | |
prevUntil: function (a, d, g) { | |
return c.dir(a, "previousSibling", g) | |
}, | |
siblings: function (a) { | |
return c.sibling(a.parentNode.firstChild, a) | |
}, | |
children: function (a) { | |
return c.sibling(a.firstChild) | |
}, | |
contents: function (a) { | |
return c.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : c.makeArray(a.childNodes) | |
} | |
}, function (a, d) { | |
c.fn[a] = function (g, h) { | |
var b = c.map(this, d, g); | |
vb.test(a) || (h = g); | |
h && "string" === typeof h && (b = c.filter(h, b)); | |
b = 1 < this.length && !xb[a] ? c.unique(b) : b; | |
if ((1 < this.length || Wa.test(h)) && wb.test(a)) b = b.reverse(); | |
return this.pushStack(b, a, $.call(arguments).join(",")) | |
} | |
}); | |
c.extend({ | |
filter: function (a, d, g) { | |
g && (a = ":not(" + a + ")"); | |
return 1 === d.length ? c.find.matchesSelector(d[0], a) ? [d[0]] : [] : c.find.matches(a, d) | |
}, | |
dir: function (a, d, g) { | |
for (var h = [], a = a[d]; a && 9 !== a.nodeType && (g === f || 1 !== a.nodeType || !c(a).is(g));) 1 === a.nodeType && h.push(a), a = a[d]; | |
return h | |
}, | |
nth: function (a, d, c) { | |
for (var d = d || 1, h = 0; a && !(1 === a.nodeType && ++h === d); a = a[c]); | |
return a | |
}, | |
sibling: function (a, d) { | |
for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== d && c.push(a); | |
return c | |
} | |
}); | |
var ab = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", | |
Z = / jQuery\d+="(?:\d+|null)"/g, | |
Y = /^\s+/, | |
aa = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, | |
fa = /<([\w:]+)/, | |
za = /<tbody/i, | |
Aa = /<|&#?\w+;/, | |
Ba = /<(?:script|style)/i, | |
Ca = /<(?:script|object|embed|option|style)/i, | |
gb = RegExp("<(?:" + ab + ")", "i"), | |
hb = /checked\s*(?:[^=]|=\s*.checked.)/i, | |
Da = /\/(java|ecma)script/i, | |
Ea = /^\s*<!(?:\[CDATA\[|\-\-)/, | |
W = { | |
option: [1, "<select multiple='multiple'>", "</select>"], | |
legend: [1, "<fieldset>", "</fieldset>"], | |
thead: [1, "<table>", "</table>"], | |
tr: [2, "<table><tbody>", "</tbody></table>"], | |
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], | |
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], | |
area: [1, "<map>", "</map>"], | |
_default: [0, "", ""] | |
}, | |
ib = o(n); | |
W.optgroup = W.option; | |
W.tbody = W.tfoot = W.colgroup = W.caption = W.thead; | |
W.th = W.td; | |
if (!c.support.htmlSerialize) W._default = [1, "div<div>", "</div>"]; | |
c.fn.extend({ | |
text: function (a) { | |
return c.isFunction(a) ? this.each(function (d) { | |
var g = c(this); | |
g.text(a.call(this, d, g.text())) | |
}) : "object" !== typeof a && a !== f ? this.empty().append((this[0] && this[0].ownerDocument || n).createTextNode(a)) : c.text(this) | |
}, | |
wrapAll: function (a) { | |
if (c.isFunction(a)) return this.each(function (d) { | |
c(this).wrapAll(a.call(this, d)) | |
}); | |
if (this[0]) { | |
var d = c(a, this[0].ownerDocument).eq(0).clone(!0); | |
this[0].parentNode && d.insertBefore(this[0]); | |
d.map(function () { | |
for (var a = this; a.firstChild && 1 === a.firstChild.nodeType;) a = a.firstChild; | |
return a | |
}).append(this) | |
} | |
return this | |
}, | |
wrapInner: function (a) { | |
return c.isFunction(a) ? this.each(function (d) { | |
c(this).wrapInner(a.call(this, d)) | |
}) : this.each(function () { | |
var d = c(this), | |
g = d.contents(); | |
g.length ? g.wrapAll(a) : d.append(a) | |
}) | |
}, | |
wrap: function (a) { | |
var d = c.isFunction(a); | |
return this.each(function (g) { | |
c(this).wrapAll(d ? a.call(this, g) : a) | |
}) | |
}, | |
unwrap: function () { | |
return this.parent().each(function () { | |
c.nodeName(this, "body") || c(this).replaceWith(this.childNodes) | |
}).end() | |
}, | |
append: function () { | |
return this.domManip(arguments, !0, function (a) { | |
1 === this.nodeType && this.appendChild(a) | |
}) | |
}, | |
prepend: function () { | |
return this.domManip(arguments, !0, function (a) { | |
1 === this.nodeType && this.insertBefore(a, this.firstChild) | |
}) | |
}, | |
before: function () { | |
if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { | |
this.parentNode.insertBefore(a, this) | |
}); | |
if (arguments.length) { | |
var a = c.clean(arguments); | |
a.push.apply(a, this.toArray()); | |
return this.pushStack(a, "before", arguments) | |
} | |
}, | |
after: function () { | |
if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { | |
this.parentNode.insertBefore(a, this.nextSibling) | |
}); | |
if (arguments.length) { | |
var a = this.pushStack(this, "after", arguments); | |
a.push.apply(a, c.clean(arguments)); | |
return a | |
} | |
}, | |
remove: function (a, d) { | |
for (var g = 0, h; null != (h = this[g]); g++) if (!a || c.filter(a, [h]).length)!d && 1 === h.nodeType && (c.cleanData(h.getElementsByTagName("*")), c.cleanData([h])), h.parentNode && h.parentNode.removeChild(h); | |
return this | |
}, | |
empty: function () { | |
for (var a = 0, d; null != (d = this[a]); a++) for (1 === d.nodeType && c.cleanData(d.getElementsByTagName("*")); d.firstChild;) d.removeChild(d.firstChild); | |
return this | |
}, | |
clone: function (a, d) { | |
a = null == a ? !1 : a; | |
d = null == d ? a : d; | |
return this.map(function () { | |
return c.clone(this, a, d) | |
}) | |
}, | |
html: function (a) { | |
if (a === f) return this[0] && 1 === this[0].nodeType ? this[0].innerHTML.replace(Z, "") : null; | |
if ("string" === typeof a && !Ba.test(a) && (c.support.leadingWhitespace || !Y.test(a)) && !W[(fa.exec(a) || ["", ""])[1].toLowerCase()]) { | |
a = a.replace(aa, "<$1></$2>"); | |
try { | |
for (var d = 0, g = this.length; d < g; d++) if (1 === this[d].nodeType) c.cleanData(this[d].getElementsByTagName("*")), this[d].innerHTML = a | |
} catch (h) { | |
this.empty().append(a) | |
} | |
} else c.isFunction(a) ? this.each(function (d) { | |
var g = c(this); | |
g.html(a.call(this, d, g.html())) | |
}) : this.empty().append(a); | |
return this | |
}, | |
replaceWith: function (a) { | |
if (this[0] && this[0].parentNode) { | |
if (c.isFunction(a)) return this.each(function (d) { | |
var g = c(this), | |
h = g.html(); | |
g.replaceWith(a.call(this, d, h)) | |
}); | |
"string" !== typeof a && (a = c(a).detach()); | |
return this.each(function () { | |
var d = this.nextSibling, | |
g = this.parentNode; | |
c(this).remove(); | |
d ? c(d).before(a) : c(g).append(a) | |
}) | |
} | |
return this.length ? this.pushStack(c(c.isFunction(a) ? a() : a), "replaceWith", a) : this | |
}, | |
detach: function (a) { | |
return this.remove(a, !0) | |
}, | |
domManip: function (a, d, g) { | |
var h, b, e, l = a[0], | |
k = []; | |
if (!c.support.checkClone && 3 === arguments.length && "string" === typeof l && hb.test(l)) return this.each(function () { | |
c(this).domManip(a, d, g, !0) | |
}); | |
if (c.isFunction(l)) return this.each(function (h) { | |
var b = c(this); | |
a[0] = l.call(this, h, d ? b.html() : f); | |
b.domManip(a, d, g) | |
}); | |
if (this[0]) { | |
h = l && l.parentNode; | |
h = c.support.parentNode && h && 11 === h.nodeType && h.childNodes.length === this.length ? { | |
fragment: h | |
} : c.buildFragment(a, this, k); | |
e = h.fragment; | |
if (b = 1 === e.childNodes.length ? e = e.firstChild : e.firstChild) { | |
d = d && c.nodeName(b, "tr"); | |
b = 0; | |
for (var p = this.length, n = p - 1; b < p; b++) g.call(d ? c.nodeName(this[b], "table") ? this[b].getElementsByTagName("tbody")[0] || this[b].appendChild(this[b].ownerDocument.createElement("tbody")) : this[b] : this[b], h.cacheable || 1 < p && b < n ? c.clone(e, !0, !0) : e) | |
} | |
k.length && c.each(k, D) | |
} | |
return this | |
} | |
}); | |
c.buildFragment = function (a, d, g) { | |
var h, b, e, l, f = a[0]; | |
d && d[0] && (l = d[0].ownerDocument || d[0]); | |
l.createDocumentFragment || (l = n); | |
if (1 === a.length && "string" === typeof f && 512 > f.length && l === n && "<" === f.charAt(0) && !Ca.test(f) && (c.support.checkClone || !hb.test(f)) && (c.support.html5Clone || !gb.test(f))) b = !0, (e = c.fragments[f]) && 1 !== e && (h = e); | |
h || (h = l.createDocumentFragment(), c.clean(a, l, h, g)); | |
b && (c.fragments[f] = e ? h : 1); | |
return { | |
fragment: h, | |
cacheable: b | |
} | |
}; | |
c.fragments = {}; | |
c.each({ | |
appendTo: "append", | |
prependTo: "prepend", | |
insertBefore: "before", | |
insertAfter: "after", | |
replaceAll: "replaceWith" | |
}, function (a, d) { | |
c.fn[a] = function (g) { | |
var h = [], | |
g = c(g), | |
b = 1 === this.length && this[0].parentNode; | |
if (b && 11 === b.nodeType && 1 === b.childNodes.length && 1 === g.length) return g[d](this[0]), this; | |
for (var b = 0, e = g.length; b < e; b++) { | |
var l = (0 < b ? this.clone(!0) : this).get(); | |
c(g[b])[d](l); | |
h = h.concat(l) | |
} | |
return this.pushStack(h, a, g.selector) | |
} | |
}); | |
c.extend({ | |
clone: function (a, d, g) { | |
var h, b, e; | |
c.support.html5Clone || !gb.test("<" + a.nodeName) ? h = a.cloneNode(!0) : (h = n.createElement("div"), ib.appendChild(h), h.innerHTML = a.outerHTML, h = h.firstChild); | |
var l = h; | |
if ((!c.support.noCloneEvent || !c.support.noCloneChecked) && (1 === a.nodeType || 11 === a.nodeType) && !c.isXMLDoc(a)) { | |
ua(a, l); | |
h = u(a); | |
b = u(l); | |
for (e = 0; h[e]; ++e) b[e] && ua(h[e], b[e]) | |
} | |
if (d && (A(a, l), g)) { | |
h = u(a); | |
b = u(l); | |
for (e = 0; h[e]; ++e) A(h[e], b[e]) | |
} | |
return l | |
}, | |
clean: function (a, d, g, h) { | |
d = d || n; | |
"undefined" === typeof d.createElement && (d = d.ownerDocument || d[0] && d[0].ownerDocument || n); | |
for (var b = [], e, l = 0, f; null != (f = a[l]); l++) if ("number" === typeof f && (f += ""), f) { | |
if ("string" === typeof f) if (Aa.test(f)) { | |
f = f.replace(aa, "<$1></$2>"); | |
e = (fa.exec(f) || ["", ""])[1].toLowerCase(); | |
var k = W[e] || W._default, | |
p = k[0], | |
i = d.createElement("div"); | |
d === n ? ib.appendChild(i) : o(d).appendChild(i); | |
for (i.innerHTML = k[1] + f + k[2]; p--;) i = i.lastChild; | |
if (!c.support.tbody) { | |
p = za.test(f); | |
k = "table" === e && !p ? i.firstChild && i.firstChild.childNodes : "<table>" === k[1] && !p ? i.childNodes : []; | |
for (e = k.length - 1; 0 <= e; --e) c.nodeName(k[e], "tbody") && !k[e].childNodes.length && k[e].parentNode.removeChild(k[e]) | |
}!c.support.leadingWhitespace && Y.test(f) && i.insertBefore(d.createTextNode(Y.exec(f)[0]), i.firstChild); | |
f = i.childNodes | |
} else f = d.createTextNode(f); | |
var r; | |
if (!c.support.appendChecked) if (f[0] && "number" === typeof (r = f.length)) for (e = 0; e < r; e++) H(f[e]); | |
else H(f); | |
f.nodeType ? b.push(f) : b = c.merge(b, f) | |
} | |
if (g) { | |
a = function (a) { | |
return !a.type || Da.test(a.type) | |
}; | |
for (l = 0; b[l]; l++) h && c.nodeName(b[l], "script") && (!b[l].type || "text/javascript" === b[l].type.toLowerCase()) ? h.push(b[l].parentNode ? b[l].parentNode.removeChild(b[l]) : b[l]) : (1 === b[l].nodeType && (d = c.grep(b[l].getElementsByTagName("script"), a), b.splice.apply(b, [l + 1, 0].concat(d))), g.appendChild(b[l])) | |
} | |
return b | |
}, | |
cleanData: function (a) { | |
for (var d, g, h = c.cache, b = c.event.special, e = c.support.deleteExpando, l = 0, f; null != (f = a[l]); l++) if (!f.nodeName || !c.noData[f.nodeName.toLowerCase()]) if (g = f[c.expando]) { | |
if ((d = h[g]) && d.events) { | |
for (var k in d.events) d.events.hasOwnProperty(k) && (b[k] ? c.event.remove(f, k) : c.removeEvent(f, k, d.handle)); | |
if (d.handle) d.handle.elem = null | |
} | |
e ? delete f[c.expando] : f.removeAttribute && f.removeAttribute(c.expando); | |
delete h[g] | |
} | |
} | |
}); | |
var Xa = /alpha\([^)]*\)/i, | |
Fa = /opacity=([^)]*)/, | |
Ga = /([A-Z]|^ms)/g, | |
jb = /^-?\d+(?:px)?$/i, | |
Ha = /^-?\d/, | |
Ia = /^([\-+])=([\-+.\de]+)/, | |
Ja = { | |
position: "absolute", | |
visibility: "hidden", | |
display: "block" | |
}, | |
Ka = ["Left", "Right"], | |
La = ["Top", "Bottom"], | |
la, kb, lb; | |
c.fn.css = function (a, d, g) { | |
if (2 === arguments.length && d === f) return this; | |
"object" === typeof a && 2 === arguments.length && (g = !! d); | |
return c.access(this, a, d, !0, function (a, d, b) { | |
return b !== f ? c.style(a, d, b, { | |
notImportant: !g | |
}) : c.css(a, d) | |
}) | |
}; | |
c.extend({ | |
cssHooks: { | |
opacity: { | |
get: function (a, d) { | |
if (d) { | |
var c = la(a, "opacity", "opacity"); | |
return "" === c ? "1" : c | |
} | |
return a.style.opacity | |
} | |
} | |
}, | |
cssNumber: { | |
fillOpacity: !0, | |
fontWeight: !0, | |
lineHeight: !0, | |
opacity: !0, | |
orphans: !0, | |
widows: !0, | |
zIndex: !0, | |
zoom: !0 | |
}, | |
cssProps: { | |
"float": c.support.cssFloat ? "cssFloat" : "styleFloat" | |
}, | |
style: function (a, d, g, h) { | |
if (a && !(3 === a.nodeType || 8 === a.nodeType || !a.style)) { | |
var b = d, | |
e, l, k = c.camelCase(d), | |
p = a.style, | |
n = c.cssHooks[k], | |
d = c.cssProps[k] || k; | |
if (g !== f) { | |
l = typeof g; | |
if ("string" === l && (e = Ia.exec(g))) g = +(e[1] + 1) * +e[2] + parseFloat(c.css(a, d)), l = "number"; | |
if (!(null == g || "number" === l && isNaN(g))) if ("number" === l && !c.cssNumber[k] && (g += "px"), "number" === l && "opacity" === k && (g += ""), !n || !("set" in n) || (g = n.set(a, g)) !== f) try { | |
if (h && h.notImportant) p[d] = g; | |
else if (p.setProperty) p.setProperty(b, g, "important"); | |
else { | |
"display" === b && !g && (g = P(a.nodeName)); | |
var i = RegExp("((?:^|;)\\s*" + b + ")\\s*:\\s*.+?(?:\\s*!important)?(?:;|$)", "gi"); | |
p.cssText = i.test(p.cssText) ? p.cssText.replace(i, "$1: " + g + " !important;") : p.cssText + (";" + b + ": " + g + " !important;") | |
} | |
} catch (r) {} | |
} else return n && "get" in n && (e = n.get(a, !1, h)) !== f ? e : p[d] | |
} | |
}, | |
css: function (a, d, g) { | |
var h, b, d = c.camelCase(d); | |
b = c.cssHooks[d]; | |
d = c.cssProps[d] || d; | |
"cssFloat" === d && (d = "float"); | |
if (b && "get" in b && (h = b.get(a, !0, g)) !== f) return h; | |
if (la) return la(a, d) | |
}, | |
swap: function (a, d, c) { | |
var h = {}, | |
b; | |
for (b in d) h[b] = a.style[b], a.style[b] = d[b]; | |
c.call(a); | |
for (b in d) a.style[b] = h[b] | |
} | |
}); | |
c.curCSS = c.css; | |
c.each(["height", "width"], function (a, d) { | |
c.cssHooks[d] = { | |
get: function (a, h, b) { | |
var e; | |
if (h) { | |
if (0 !== a.offsetWidth) return z(a, d, b); | |
c.swap(a, Ja, function () { | |
e = z(a, d, b) | |
}); | |
return e | |
} | |
}, | |
set: function (a, d) { | |
if (jb.test(d)) { | |
if (d = parseFloat(d), 0 <= d) return d + "px" | |
} else return d | |
} | |
} | |
}); | |
if (!c.support.opacity) c.cssHooks.opacity = { | |
get: function (a, d) { | |
return Fa.test((d && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : d ? "1" : "" | |
}, | |
set: function (a, d) { | |
var g = a.style, | |
b = a.currentStyle, | |
e = c.isNumeric(d) ? "alpha(opacity=" + 100 * d + ")" : "", | |
l = b && b.filter || g.filter || ""; | |
g.zoom = 1; | |
if (1 <= d && "" === c.trim(l.replace(Xa, "")) && (g.removeAttribute("filter"), b && !b.filter)) return; | |
c.style(a, "filter", Xa.test(l) ? l.replace(Xa, e) : l + " " + e) | |
} | |
}; | |
c(function () { | |
if (!c.support.reliableMarginRight) c.cssHooks.marginRight = { | |
get: function (a, d) { | |
var g; | |
c.swap(a, { | |
display: "inline-block" | |
}, function () { | |
g = d ? la(a, "margin-right", "marginRight") : a.style.marginRight | |
}); | |
return g | |
} | |
} | |
}); | |
n.defaultView && n.defaultView.getComputedStyle && (kb = function (a, d) { | |
if ("string" === typeof d) { | |
var g, b, e, d = d.replace(Ga, "-$1").toLowerCase(); | |
if ((b = a.ownerDocument.defaultView) && (e = b.getComputedStyle(a, null))) g = e.getPropertyValue(d), "" === g && !c.contains(a.ownerDocument.documentElement, a) && (g = c.style(a, d)); | |
return g | |
} | |
}); | |
n.documentElement.currentStyle && (lb = function (a, d) { | |
var c, b, e = a.currentStyle && a.currentStyle[d], | |
l = a.style; | |
if (null === e && l && (c = l[d])) e = c; | |
if (!jb.test(e) && Ha.test(e)) { | |
c = l.left; | |
if (b = a.runtimeStyle && a.runtimeStyle.left) a.runtimeStyle.left = a.currentStyle.left; | |
l.left = "fontSize" === d ? "1em" : e || 0; | |
e = l.pixelLeft + "px"; | |
l.left = c; | |
if (b) a.runtimeStyle.left = b | |
} | |
return "" === e ? "auto" : e | |
}); | |
la = kb || lb; | |
if (c.expr && c.expr.filters) c.expr.filters.hidden = function (a) { | |
var d = a.offsetHeight; | |
return 0 === a.offsetWidth && 0 === d || !c.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || c.css(a, "display")) | |
}, c.expr.filters.visible = function (a) { | |
return !c.expr.filters.hidden(a) | |
}; | |
var Ma = /%20/g, | |
Na = /\[\]$/, | |
mb = /\r?\n/g, | |
Oa = /#.*$/, | |
Za = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, | |
yb = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, | |
zb = /^(?:GET|HEAD)$/, | |
Ab = /^\/\//, | |
nb = /\?/, | |
Bb = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, | |
Cb = /^(?:select|textarea)/i, | |
bb = /\s+/, | |
Db = /([?&])_=[^&]*/, | |
ob = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, | |
pb = c.fn.load, | |
Qa = {}, | |
qb = {}, | |
ja, ka, rb = ["*/"] + ["*"]; | |
try { | |
ja = na.href | |
} catch (Jb) { | |
ja = n.createElement("a"), ja.href = "", ja = ja.href | |
} | |
ka = ob.exec(ja.toLowerCase()) || []; | |
c.fn.extend({ | |
load: function (a, d, g) { | |
if ("string" !== typeof a && pb) return pb.apply(this, arguments); | |
if (!this.length) return this; | |
var b = a.indexOf(" "); | |
if (0 <= b) var e = a.slice(b, a.length), | |
a = a.slice(0, b); | |
b = "GET"; | |
d && (c.isFunction(d) ? (g = d, d = f) : "object" === typeof d && (d = c.param(d, c.ajaxSettings.traditional), b = "POST")); | |
var l = this; | |
c.ajax({ | |
url: a, | |
type: b, | |
dataType: "html", | |
data: d, | |
complete: function (a, d, b) { | |
b = a.responseText; | |
a.isResolved() && (a.done(function (a) { | |
b = a | |
}), l.html(e ? c("<div>").append(b.replace(Bb, "")).find(e) : b)); | |
g && l.each(g, [b, d, a]) | |
} | |
}); | |
return this | |
}, | |
serialize: function () { | |
return c.param(this.serializeArray()) | |
}, | |
serializeArray: function () { | |
return this.map(function () { | |
return this.elements ? c.makeArray(this.elements) : this | |
}).filter(function () { | |
return this.name && !this.disabled && (this.checked || Cb.test(this.nodeName) || yb.test(this.type)) | |
}).map(function (a, d) { | |
var g = c(this).val(); | |
return null == g ? null : c.isArray(g) ? c.map(g, function (a) { | |
return { | |
name: d.name, | |
value: a.replace(mb, "\r\n") | |
} | |
}) : { | |
name: d.name, | |
value: g.replace(mb, "\r\n") | |
} | |
}).get() | |
} | |
}); | |
c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, d) { | |
c.fn[d] = function (a) { | |
return this.on(d, a) | |
} | |
}); | |
c.each(["get", "post"], function (a, d) { | |
c[d] = function (a, b, e, l) { | |
c.isFunction(b) && (l = l || e, e = b, b = f); | |
return c.ajax({ | |
type: d, | |
url: a, | |
data: b, | |
success: e, | |
dataType: l | |
}) | |
} | |
}); | |
c.extend({ | |
getScript: function (a, d) { | |
return c.get(a, f, d, "script") | |
}, | |
getJSON: function (a, d, g) { | |
return c.get(a, d, g, "json") | |
}, | |
ajaxSetup: function (a, d) { | |
d ? F(a, c.ajaxSettings) : (d = a, a = c.ajaxSettings); | |
F(a, d); | |
return a | |
}, | |
ajaxSettings: { | |
url: ja, | |
isLocal: /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ka[1]), | |
global: !0, | |
type: "GET", | |
contentType: "application/x-www-form-urlencoded", | |
processData: !0, | |
async: !0, | |
accepts: { | |
xml: "application/xml, text/xml", | |
html: "text/html", | |
text: "text/plain", | |
json: "application/json, text/javascript", | |
"*": rb | |
}, | |
contents: { | |
xml: /xml/, | |
html: /html/, | |
json: /json/ | |
}, | |
responseFields: { | |
xml: "responseXML", | |
text: "responseText" | |
}, | |
converters: { | |
"* text": j.String, | |
"text html": !0, | |
"text json": c.parseJSON, | |
"text xml": c.parseXML | |
}, | |
flatOptions: { | |
context: !0, | |
url: !0 | |
} | |
}, | |
ajaxPrefilter: B(Qa), | |
ajaxTransport: B(qb), | |
ajax: function (a, d) { | |
function g(a, d, g, r) { | |
if (2 !== L) { | |
L = 2; | |
S && clearTimeout(S); | |
o = f; | |
s = r || ""; | |
G.readyState = 0 < a ? 4 : 0; | |
var y, j, w, r = d; | |
if (g) { | |
var q = b, | |
u = G, | |
E = q.contents, | |
v = q.dataTypes, | |
A = q.responseFields, | |
R, Q, B, N; | |
for (Q in A) Q in g && (u[A[Q]] = g[Q]); | |
for (; | |
"*" === v[0];) v.shift(), R === f && (R = q.mimeType || u.getResponseHeader("content-type")); | |
if (R) for (Q in E) if (E[Q] && E[Q].test(R)) { | |
v.unshift(Q); | |
break | |
} | |
if (v[0] in g) B = v[0]; | |
else { | |
for (Q in g) { | |
if (!v[0] || q.converters[Q + " " + v[0]]) { | |
B = Q; | |
break | |
} | |
N || (N = Q) | |
} | |
B = B || N | |
} | |
B ? (B !== v[0] && v.unshift(B), g = g[B]) : g = void 0 | |
} else g = f; | |
if (200 <= a && 300 > a || 304 === a) { | |
if (b.ifModified) { | |
if (R = G.getResponseHeader("Last-Modified")) c.lastModified[i] = R; | |
if (R = G.getResponseHeader("Etag")) c.etag[i] = R | |
} | |
if (304 === a) r = "notmodified", y = !0; | |
else try { | |
R = b; | |
R.dataFilter && (g = R.dataFilter(g, R.dataType)); | |
var z = R.dataTypes; | |
Q = {}; | |
var ia, na, M = z.length, | |
P, T = z[0], | |
ga, t, D, ea, H; | |
for (ia = 1; ia < M; ia++) { | |
if (1 === ia) for (na in R.converters) "string" === typeof na && (Q[na.toLowerCase()] = R.converters[na]); | |
ga = T; | |
T = z[ia]; | |
if ("*" === T) T = ga; | |
else if ("*" !== ga && ga !== T) { | |
t = ga + " " + T; | |
D = Q[t] || Q["* " + T]; | |
if (!D) for (ea in H = f, Q) if (P = ea.split(" "), P[0] === ga || "*" === P[0]) if (H = Q[P[1] + " " + T]) { | |
ea = Q[ea]; | |
!0 === ea ? D = H : !0 === H && (D = ea); | |
break | |
}!D && !H && c.error("No conversion from " + t.replace(" ", " to ")); | |
!0 !== D && (g = D ? D(g) : H(ea(g))) | |
} | |
} | |
j = g; | |
r = "success"; | |
y = !0 | |
} catch (Va) { | |
r = "parsererror", w = Va | |
} | |
} else if (w = r, !r || a) r = "error", 0 > a && (a = 0); | |
G.status = a; | |
G.statusText = "" + (d || r); | |
y ? k.resolveWith(e, [j, r, G]) : k.rejectWith(e, [G, r, w]); | |
G.statusCode(n); | |
n = f; | |
J && l.trigger("ajax" + (y ? "Success" : "Error"), [G, b, y ? j : w]); | |
p.fireWith(e, [G, r]); | |
J && (l.trigger("ajaxComplete", [G, b]), --c.active || c.event.trigger("ajaxStop")) | |
} | |
} | |
"object" === typeof a && (d = a, a = f); | |
var d = d || {}, | |
b = c.ajaxSetup({}, d), | |
e = b.context || b, | |
l = e !== b && (e.nodeType || e instanceof c) ? c(e) : c.event, | |
k = c.Deferred(), | |
p = c.Callbacks("once memory"), | |
n = b.statusCode || {}, | |
i, r = {}, | |
y = {}, | |
s, j, o, S, w, L = 0, | |
J, q, G = { | |
readyState: 0, | |
setRequestHeader: function (a, d) { | |
if (!L) { | |
var c = a.toLowerCase(), | |
a = y[c] = y[c] || a; | |
r[a] = d | |
} | |
return this | |
}, | |
getAllResponseHeaders: function () { | |
return 2 === L ? s : null | |
}, | |
getResponseHeader: function (a) { | |
var d; | |
if (2 === L) { | |
if (!j) for (j = {}; d = Za.exec(s);) j[d[1].toLowerCase()] = d[2]; | |
d = j[a.toLowerCase()] | |
} | |
return d === f ? null : d | |
}, | |
overrideMimeType: function (a) { | |
if (!L) b.mimeType = a; | |
return this | |
}, | |
abort: function (a) { | |
a = a || "abort"; | |
o && o.abort(a); | |
g(0, a); | |
return this | |
} | |
}; | |
k.promise(G); | |
G.success = G.done; | |
G.error = G.fail; | |
G.complete = p.add; | |
G.statusCode = function (a) { | |
if (a) { | |
var d; | |
if (2 > L) for (d in a) n[d] = [n[d], a[d]]; | |
else d = a[G.status], G.then(d, d) | |
} | |
return this | |
}; | |
b.url = ((a || b.url) + "").replace(Oa, "").replace(Ab, ka[1] + "//"); | |
b.dataTypes = c.trim(b.dataType || "*").toLowerCase().split(bb); | |
if (null == b.crossDomain) w = ob.exec(b.url.toLowerCase()), b.crossDomain = !(!w || !(w[1] != ka[1] || w[2] != ka[2] || (w[3] || ("http:" === w[1] ? 80 : 443)) != (ka[3] || ("http:" === ka[1] ? 80 : 443)))); | |
if (b.data && b.processData && "string" !== typeof b.data) b.data = c.param(b.data, b.traditional); | |
N(Qa, b, d, G); | |
if (2 === L) return !1; | |
J = b.global; | |
b.type = b.type.toUpperCase(); | |
b.hasContent = !zb.test(b.type); | |
J && 0 === c.active++ && c.event.trigger("ajaxStart"); | |
if (!b.hasContent && (b.data && (b.url += (nb.test(b.url) ? "&" : "?") + b.data, delete b.data), i = b.url, !1 === b.cache)) { | |
w = c.now(); | |
var u = b.url.replace(Db, "$1_=" + w); | |
b.url = u + (u === b.url ? (nb.test(b.url) ? "&" : "?") + "_=" + w : "") | |
}(b.data && b.hasContent && !1 !== b.contentType || d.contentType) && G.setRequestHeader("Content-Type", b.contentType); | |
b.ifModified && (i = i || b.url, c.lastModified[i] && G.setRequestHeader("If-Modified-Since", c.lastModified[i]), c.etag[i] && G.setRequestHeader("If-None-Match", c.etag[i])); | |
G.setRequestHeader("Accept", b.dataTypes[0] && b.accepts[b.dataTypes[0]] ? b.accepts[b.dataTypes[0]] + ("*" !== b.dataTypes[0] ? ", " + rb + "; q=0.01" : "") : b.accepts["*"]); | |
for (q in b.headers) G.setRequestHeader(q, b.headers[q]); | |
if (b.beforeSend && (!1 === b.beforeSend.call(e, G, b) || 2 === L)) return G.abort(), !1; | |
for (q in { | |
success: 1, | |
error: 1, | |
complete: 1 | |
}) G[q](b[q]); | |
if (o = N(qb, b, d, G)) { | |
G.readyState = 1; | |
J && l.trigger("ajaxSend", [G, b]); | |
b.async && 0 < b.timeout && (S = setTimeout(function () { | |
G.abort("timeout") | |
}, b.timeout)); | |
try { | |
L = 1, o.send(r, g) | |
} catch (E) { | |
if (2 > L) g(-1, E); | |
else throw E; | |
} | |
} else g(-1, "No Transport"); | |
return G | |
}, | |
param: function (a, d) { | |
var b = [], | |
h = function (a, d) { | |
d = c.isFunction(d) ? d() : d; | |
b[b.length] = encodeURIComponent(a) + "=" + encodeURIComponent(d) | |
}; | |
if (d === f) d = c.ajaxSettings.traditional; | |
if (c.isArray(a) || a.jquery && !c.isPlainObject(a)) c.each(a, function () { | |
h(this.name, this.value) | |
}); | |
else for (var e in a) Ra(e, a[e], d, h); | |
return b.join("&").replace(Ma, "+") | |
} | |
}); | |
c.extend({ | |
active: 0, | |
lastModified: {}, | |
etag: {} | |
}); | |
var Eb = c.now(), | |
xa = /(\=)\?(&|$)|\?\?/i; | |
c.ajaxSetup({ | |
jsonp: "callback", | |
jsonpCallback: function () { | |
return c.expando + "_" + Eb++ | |
} | |
}); | |
c.ajaxPrefilter("json jsonp", function (a, d, b) { | |
d = "application/x-www-form-urlencoded" === a.contentType && "string" === typeof a.data; | |
if ("jsonp" === a.dataTypes[0] || !1 !== a.jsonp && (xa.test(a.url) || d && xa.test(a.data))) { | |
var h, e = a.jsonpCallback = c.isFunction(a.jsonpCallback) ? a.jsonpCallback() : a.jsonpCallback, | |
l = j[e], | |
f = a.url, | |
k = a.data, | |
p = "$1" + e + "$2"; | |
!1 !== a.jsonp && (f = f.replace(xa, p), a.url === f && (d && (k = k.replace(xa, p)), a.data === k && (f += (/\?/.test(f) ? "&" : "?") + a.jsonp + "=" + e))); | |
a.url = f; | |
a.data = k; | |
j[e] = function (a) { | |
h = [a] | |
}; | |
b.always(function () { | |
j[e] = l; | |
if (h && c.isFunction(l)) j[e](h[0]) | |
}); | |
a.converters["script json"] = function () { | |
h || c.error(e + " was not called"); | |
return h[0] | |
}; | |
a.dataTypes[0] = "json"; | |
return "script" | |
} | |
}); | |
c.ajaxSetup({ | |
accepts: { | |
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" | |
}, | |
contents: { | |
script: /javascript|ecmascript/ | |
}, | |
converters: { | |
"text script": function (a) { | |
c.globalEval(a); | |
return a | |
} | |
} | |
}); | |
c.ajaxPrefilter("script", function (a) { | |
if (a.cache === f) a.cache = !1; | |
if (a.crossDomain) a.type = "GET", a.global = !1 | |
}); | |
c.ajaxTransport("script", function (a) { | |
if (a.crossDomain) { | |
var d, c = n.head || n.getElementsByTagName("head")[0] || n.documentElement; | |
return { | |
send: function (b, e) { | |
d = n.createElement("script"); | |
d.async = "async"; | |
if (a.scriptCharset) d.charset = a.scriptCharset; | |
d.src = a.url; | |
d.onload = d.onreadystatechange = function (a, b) { | |
if (b || !d.readyState || /loaded|complete/.test(d.readyState)) d.onload = d.onreadystatechange = null, c && d.parentNode && c.removeChild(d), d = f, b || e(200, "success") | |
}; | |
c.insertBefore(d, c.firstChild) | |
}, | |
abort: function () { | |
if (d) d.onload(0, 1) | |
} | |
} | |
} | |
}); | |
var Ya = j.ActiveXObject ? | |
function () { | |
for (var a in sa) sa[a](0, 1) | |
} : !1, Fb = 0, sa; | |
c.ajaxSettings.xhr = j.ActiveXObject ? | |
function () { | |
var a; | |
if (!(a = !this.isLocal && p())) a: { | |
try { | |
a = new j.ActiveXObject("Microsoft.XMLHTTP"); | |
break a | |
} catch (d) {} | |
a = void 0 | |
} | |
return a | |
} : p; | |
(function (a) { | |
c.extend(c.support, { | |
ajax: !! a, | |
cors: !! a && "withCredentials" in a | |
}) | |
})(c.ajaxSettings.xhr()); | |
c.support.ajax && c.ajaxTransport(function (a) { | |
if (!a.crossDomain || c.support.cors) { | |
var d; | |
return { | |
send: function (b, h) { | |
var e = a.xhr(), | |
l, k; | |
a.username ? e.open(a.type, a.url, a.async, a.username, a.password) : e.open(a.type, a.url, a.async); | |
if (a.xhrFields) for (k in a.xhrFields) e[k] = a.xhrFields[k]; | |
a.mimeType && e.overrideMimeType && e.overrideMimeType(a.mimeType); | |
!a.crossDomain && !b["X-Requested-With"] && (b["X-Requested-With"] = "XMLHttpRequest"); | |
try { | |
for (k in b) e.setRequestHeader(k, b[k]) | |
} catch (p) {} | |
e.send(a.hasContent && a.data || null); | |
d = function (b, g) { | |
var k, p, n, i, r; | |
try { | |
if (d && (g || 4 === e.readyState)) { | |
d = f; | |
if (l) e.onreadystatechange = c.noop, Ya && delete sa[l]; | |
if (g) 4 !== e.readyState && e.abort(); | |
else { | |
k = e.status; | |
n = e.getAllResponseHeaders(); | |
i = {}; | |
if ((r = e.responseXML) && r.documentElement) i.xml = r; | |
i.text = e.responseText; | |
try { | |
p = e.statusText | |
} catch (y) { | |
p = "" | |
}!k && a.isLocal && !a.crossDomain ? k = i.text ? 200 : 404 : 1223 === k && (k = 204) | |
} | |
} | |
} catch (j) { | |
g || h(-1, j) | |
} | |
i && h(k, p, i, n) | |
}; | |
!a.async || 4 === e.readyState ? d() : (l = ++Fb, Ya && (sa || (sa = {}, c(j).unload(Ya)), sa[l] = d), e.onreadystatechange = d) | |
}, | |
abort: function () { | |
d && d(0, 1) | |
} | |
} | |
} | |
}); | |
var Sa = {}, | |
da, ma, Gb = /^(?:toggle|show|hide)$/, | |
Hb = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, | |
ya, cb = [ | |
["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], | |
["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], | |
["opacity"] | |
], | |
va; | |
c.fn.extend({ | |
show: function (a, d, b) { | |
if (a || 0 === a) return this.animate(J("show", 3), a, d, b); | |
for (var b = 0, h = this.length; b < h; b++) a = this[b], a.style && (d = c.css(a, "display"), !c._data(a, "olddisplay") && "none" === d && (c.style(a, "display", ""), d = ""), "" === d && "none" === c.css(a, "display") && c._data(a, "olddisplay", P(a.nodeName))); | |
for (b = 0; b < h; b++) if (a = this[b], a.style && (d = c.css(a, "display"), "" === d || "none" === d)) c.style(a, "display", c._data(a, "olddisplay") || ""); | |
return this | |
}, | |
hide: function (a, d, b) { | |
if (a || 0 === a) return this.animate(J("hide", 3), a, d, b); | |
for (var b = 0, h = this.length; b < h; b++) a = this[b], a.style && (d = c.css(a, "display"), "none" !== d && !c._data(a, "olddisplay") && c._data(a, "olddisplay", d)); | |
for (b = 0; b < h; b++) this[b].style && c.style(this[b], "display", "none"); | |
return this | |
}, | |
_toggle: c.fn.toggle, | |
toggle: function (a, d, b) { | |
var h = "boolean" === typeof a; | |
c.isFunction(a) && c.isFunction(d) ? this._toggle.apply(this, arguments) : null == a || h ? this.each(function () { | |
var d = h ? a : c(this).is(":hidden"); | |
c(this)[d ? "show" : "hide"]() | |
}) : this.animate(J("toggle", 3), a, d, b); | |
return this | |
}, | |
fadeTo: function (a, d, c, b) { | |
return this.filter(":hidden").css("opacity", 0).show().end().animate({ | |
opacity: d | |
}, a, c, b) | |
}, | |
animate: function (a, d, b, h) { | |
function e() { | |
var t; | |
!1 === l.queue && c._mark(this); | |
var d = c.extend({}, l), | |
b = 1 === this.nodeType, | |
g = b && c(this).is(":hidden"), | |
h, f, k, m, p; | |
d.animatedProperties = {}; | |
for (k in a) { | |
h = c.camelCase(k); | |
k !== h && (a[h] = a[k], delete a[k]); | |
f = a[h]; | |
c.isArray(f) ? (d.animatedProperties[h] = f[1], t = a[h] = f[0], f = t) : d.animatedProperties[h] = d.specialEasing && d.specialEasing[h] || d.easing || "swing"; | |
if ("hide" === f && g || "show" === f && !g) return d.complete.call(this); | |
if (b && ("height" === h || "width" === h)) d.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], "inline" === c.css(this, "display") && "none" === c.css(this, "float") && (!c.support.inlineBlockNeedsLayout || "inline" === P(this.nodeName) ? c.style(this, "display", "inline-block") : c.style(this, "zoom", 1)) | |
} | |
null != d.overflow && c.style(this, "overflow", "hidden"); | |
for (k in a) if (b = new c.fx(this, d, k), f = a[k], Gb.test(f)) if (h = c._data(this, "toggle" + k) || ("toggle" === f ? g ? "show" : "hide" : 0)) c._data(this, "toggle" + k, "show" === h ? "hide" : "show"), b[h](); | |
else b[f](); | |
else h = Hb.exec(f), m = b.cur(), h ? (f = parseFloat(h[2]), p = h[3] || (c.cssNumber[k] ? "" : "px"), "px" !== p && (c.style(this, k, (f || 1) + p), m *= (f || 1) / b.cur(), c.style(this, k, m + p)), h[1] && (f = ("-=" === h[1] ? -1 : 1) * f + m), b.custom(m, f, p)) : b.custom(m, f, ""); | |
return !0 | |
} | |
var l = c.speed(d, b, h); | |
if (c.isEmptyObject(a)) return this.each(l.complete, [!1]); | |
a = c.extend({}, a); | |
return !1 === l.queue ? this.each(e) : this.queue(l.queue, e) | |
}, | |
stop: function (a, d, b) { | |
"string" !== typeof a && (b = d, d = a, a = f); | |
d && !1 !== a && this.queue(a || "fx", []); | |
return this.each(function () { | |
var d, e = !1, | |
l = c.timers, | |
f = c._data(this); | |
b || c._unmark(!0, this); | |
if (null == a) for (d in f) { | |
if (f[d] && f[d].stop && d.indexOf(".run") === d.length - 4) { | |
var k = f[d]; | |
c.removeData(this, d, !0); | |
k.stop(b) | |
} | |
} else if (f[d = a + ".run"] && f[d].stop) f = f[d], c.removeData(this, d, !0), f.stop(b); | |
for (d = l.length; d--;) if (l[d].elem === this && (null == a || l[d].queue === a)) { | |
if (b) l[d](!0); | |
else l[d].saveState(); | |
e = !0; | |
l.splice(d, 1) | |
}(!b || !e) && c.dequeue(this, a) | |
}) | |
} | |
}); | |
c.each({ | |
slideDown: J("show", 1), | |
slideUp: J("hide", 1), | |
slideToggle: J("toggle", 1), | |
fadeIn: { | |
opacity: "show" | |
}, | |
fadeOut: { | |
opacity: "hide" | |
}, | |
fadeToggle: { | |
opacity: "toggle" | |
} | |
}, function (a, d) { | |
c.fn[a] = function (a, c, b) { | |
return this.animate(d, a, c, b) | |
} | |
}); | |
c.extend({ | |
speed: function (a, d, b) { | |
var h = a && "object" === typeof a ? c.extend({}, a) : { | |
complete: b || !b && d || c.isFunction(a) && a, | |
duration: a, | |
easing: b && d || d && !c.isFunction(d) && d | |
}; | |
h.duration = c.fx.off ? 0 : "number" === typeof h.duration ? h.duration : h.duration in c.fx.speeds ? c.fx.speeds[h.duration] : c.fx.speeds._default; | |
if (null == h.queue || !0 === h.queue) h.queue = "fx"; | |
h.old = h.complete; | |
h.complete = function (a) { | |
c.isFunction(h.old) && h.old.call(this); | |
h.queue ? c.dequeue(this, h.queue) : !1 !== a && c._unmark(this) | |
}; | |
return h | |
}, | |
easing: { | |
linear: function (a, d, c, b) { | |
return c + b * a | |
}, | |
swing: function (a, d, c, b) { | |
return (-Math.cos(a * Math.PI) / 2 + 0.5) * b + c | |
} | |
}, | |
timers: [], | |
fx: function (a, d, c) { | |
this.options = d; | |
this.elem = a; | |
this.prop = c; | |
d.orig = d.orig || {} | |
} | |
}); | |
c.fx.prototype = { | |
update: function () { | |
this.options.step && this.options.step.call(this.elem, this.now, this); | |
(c.fx.step[this.prop] || c.fx.step._default)(this) | |
}, | |
cur: function () { | |
if (null != this.elem[this.prop] && (!this.elem.style || null == this.elem.style[this.prop])) return this.elem[this.prop]; | |
var a, d = c.css(this.elem, this.prop); | |
return isNaN(a = parseFloat(d)) ? !d || "auto" === d ? 0 : d : a | |
}, | |
custom: function (a, d, b) { | |
function h(a) { | |
return e.step(a) | |
} | |
var e = this, | |
l = c.fx; | |
this.startTime = va || S(); | |
this.end = d; | |
this.now = this.start = a; | |
this.pos = this.state = 0; | |
this.unit = b || this.unit || (c.cssNumber[this.prop] ? "" : "px"); | |
h.queue = this.options.queue; | |
h.elem = this.elem; | |
h.saveState = function () { | |
e.options.hide && c._data(e.elem, "fxshow" + e.prop) === f && c._data(e.elem, "fxshow" + e.prop, e.start) | |
}; | |
h() && c.timers.push(h) && !ya && (ya = setInterval(l.tick, l.interval)) | |
}, | |
show: function () { | |
var a = c._data(this.elem, "fxshow" + this.prop); | |
this.options.orig[this.prop] = a || c.style(this.elem, this.prop); | |
this.options.show = !0; | |
a !== f ? this.custom(this.cur(), a) : this.custom("width" === this.prop || "height" === this.prop ? 1 : 0, this.cur()); | |
c(this.elem).show() | |
}, | |
hide: function () { | |
this.options.orig[this.prop] = c._data(this.elem, "fxshow" + this.prop) || c.style(this.elem, this.prop); | |
this.options.hide = !0; | |
this.custom(this.cur(), 0) | |
}, | |
step: function (a) { | |
var d, b = va || S(), | |
h = !0, | |
e = this.elem, | |
l = this.options; | |
if (a || b >= l.duration + this.startTime) { | |
this.now = this.end; | |
this.pos = this.state = 1; | |
this.update(); | |
l.animatedProperties[this.prop] = !0; | |
for (d in l.animatedProperties)!0 !== l.animatedProperties[d] && (h = !1); | |
if (h) { | |
null != l.overflow && !c.support.shrinkWrapBlocks && c.each(["", "X", "Y"], function (a, d) { | |
c.style(e, "overflow" + d, l.overflow[a]) | |
}); | |
l.hide && c(e).hide(); | |
if (l.hide || l.show) for (d in l.animatedProperties) c.style(e, d, l.orig[d]), c.removeData(e, "fxshow" + d, !0), c.removeData(e, "toggle" + d, !0); | |
if (a = l.complete) l.complete = !1, a.call(e) | |
} | |
return !1 | |
} | |
Infinity == l.duration ? this.now = b : (a = b - this.startTime, this.state = a / l.duration, this.pos = c.easing[l.animatedProperties[this.prop]](this.state, a, 0, 1, l.duration), this.now = this.start + (this.end - this.start) * this.pos); | |
this.update(); | |
return !0 | |
} | |
}; | |
c.extend(c.fx, { | |
tick: function () { | |
for (var a, d = c.timers, b = 0; b < d.length; b++) a = d[b], !a() && d[b] === a && d.splice(b--, 1); | |
d.length || c.fx.stop() | |
}, | |
interval: 13, | |
stop: function () { | |
clearInterval(ya); | |
ya = null | |
}, | |
speeds: { | |
slow: 600, | |
fast: 200, | |
_default: 400 | |
}, | |
step: { | |
opacity: function (a) { | |
c.style(a.elem, "opacity", a.now) | |
}, | |
_default: function (a) { | |
a.elem.style && null != c.css(a.elem, a.prop) ? c.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now | |
} | |
} | |
}); | |
c.each(["width", "height"], function (a, d) { | |
c.fx.step[d] = function (a) { | |
c.style(a.elem, d, Math.max(0, a.now) + a.unit) | |
} | |
}); | |
if (c.expr && c.expr.filters) c.expr.filters.animated = function (a) { | |
return c.grep(c.timers, function (d) { | |
return a === d.elem | |
}).length | |
}; | |
var Ib = /^t(?:able|d|h)$/i, | |
sb = /^(?:body|html)$/i; | |
c.fn.offset = "getBoundingClientRect" in n.documentElement ? | |
function (a) { | |
var d = this[0], | |
b; | |
if (a) return this.each(function (d) { | |
c.offset.setOffset(this, a, d) | |
}); | |
if (!d || !d.ownerDocument) return null; | |
if (d === d.ownerDocument.body) return c.offset.bodyOffset(d); | |
try { | |
b = d.getBoundingClientRect() | |
} catch (h) {} | |
var e = d.ownerDocument, | |
l = e.documentElement; | |
if (!b || !c.contains(l, d)) return b ? { | |
top: b.top, | |
left: b.left | |
} : { | |
top: 0, | |
left: 0 | |
}; | |
d = e.body; | |
e = Ta(e); | |
return { | |
top: b.top + (e.pageYOffset || c.support.boxModel && l.scrollTop || d.scrollTop) - (l.clientTop || d.clientTop || 0), | |
left: b.left + (e.pageXOffset || c.support.boxModel && l.scrollLeft || d.scrollLeft) - (l.clientLeft || d.clientLeft || 0) | |
} | |
} : function (a) { | |
var d = this[0]; | |
if (a) return this.each(function (d) { | |
c.offset.setOffset(this, a, d) | |
}); | |
if (!d || !d.ownerDocument) return null; | |
if (d === d.ownerDocument.body) return c.offset.bodyOffset(d); | |
var b, h = d.offsetParent, | |
e = d.ownerDocument, | |
l = e.documentElement, | |
f = e.body; | |
b = (e = e.defaultView) ? e.getComputedStyle(d, null) : d.currentStyle; | |
for (var k = d.offsetTop, p = d.offsetLeft; | |
(d = d.parentNode) && d !== f && d !== l && !(c.support.fixedPosition && "fixed" === b.position);) { | |
b = e ? e.getComputedStyle(d, null) : d.currentStyle; | |
k -= d.scrollTop; | |
p -= d.scrollLeft; | |
if (d === h) { | |
k += d.offsetTop; | |
p += d.offsetLeft; | |
if (c.support.doesNotAddBorder && (!c.support.doesAddBorderForTableAndCells || !Ib.test(d.nodeName))) k += parseFloat(b.borderTopWidth) || 0, p += parseFloat(b.borderLeftWidth) || 0; | |
h = d.offsetParent | |
} | |
c.support.subtractsBorderForOverflowNotVisible && "visible" !== b.overflow && (k += parseFloat(b.borderTopWidth) || 0, p += parseFloat(b.borderLeftWidth) || 0) | |
} | |
if ("relative" === b.position || "static" === b.position) k += f.offsetTop, p += f.offsetLeft; | |
c.support.fixedPosition && "fixed" === b.position && (k += Math.max(l.scrollTop, f.scrollTop), p += Math.max(l.scrollLeft, f.scrollLeft)); | |
return { | |
top: k, | |
left: p | |
} | |
}; | |
c.offset = { | |
bodyOffset: function (a) { | |
var d = a.offsetTop, | |
b = a.offsetLeft; | |
c.support.doesNotIncludeMarginInBodyOffset && (d += parseFloat(c.css(a, "marginTop")) || 0, b += parseFloat(c.css(a, "marginLeft")) || 0); | |
return { | |
top: d, | |
left: b | |
} | |
}, | |
setOffset: function (a, d, b) { | |
var e = c.css(a, "position"); | |
if ("static" === e) a.style.position = "relative"; | |
var l = c(a), | |
f = l.offset(), | |
k = c.css(a, "top"), | |
p = c.css(a, "left"), | |
i = {}, | |
n = {}; | |
("absolute" === e || "fixed" === e) && -1 < c.inArray("auto", [k, p]) ? (n = l.position(), e = n.top, p = n.left) : (e = parseFloat(k) || 0, p = parseFloat(p) || 0); | |
c.isFunction(d) && (d = d.call(a, b, f)); | |
if (null != d.top) i.top = d.top - f.top + e; | |
if (null != d.left) i.left = d.left - f.left + p; | |
"using" in d ? d.using.call(a, i) : l.css(i) | |
} | |
}; | |
c.fn.extend({ | |
position: function () { | |
if (!this[0]) return null; | |
var a = this[0], | |
d = this.offsetParent(), | |
b = this.offset(), | |
e = sb.test(d[0].nodeName) ? { | |
top: 0, | |
left: 0 | |
} : d.offset(); | |
b.top -= parseFloat(c.css(a, "marginTop")) || 0; | |
b.left -= parseFloat(c.css(a, "marginLeft")) || 0; | |
e.top += parseFloat(c.css(d[0], "borderTopWidth")) || 0; | |
e.left += parseFloat(c.css(d[0], "borderLeftWidth")) || 0; | |
return { | |
top: b.top - e.top, | |
left: b.left - e.left | |
} | |
}, | |
offsetParent: function () { | |
return this.map(function () { | |
for (var a = this.offsetParent || n.body; a && !sb.test(a.nodeName) && "static" === c.css(a, "position");) a = a.offsetParent; | |
return a | |
}) | |
} | |
}); | |
c.each(["Left", "Top"], function (a, d) { | |
var b = "scroll" + d; | |
c.fn[b] = function (d) { | |
var e, l; | |
if (d === f) { | |
e = this[0]; | |
return !e ? null : (l = Ta(e)) ? "pageXOffset" in l ? l[a ? "pageYOffset" : "pageXOffset"] : c.support.boxModel && l.document.documentElement[b] || l.document.body[b] : e[b] | |
} | |
return this.each(function () { | |
(l = Ta(this)) ? l.scrollTo(!a ? d : c(l).scrollLeft(), a ? d : c(l).scrollTop()) : this[b] = d | |
}) | |
} | |
}); | |
c.each(["Height", "Width"], function (a, d) { | |
var b = d.toLowerCase(); | |
c.fn["inner" + d] = function () { | |
var a = this[0]; | |
return a ? a.style ? parseFloat(c.css(a, b, "padding")) : this[b]() : null | |
}; | |
c.fn["outer" + d] = function (a) { | |
var d = this[0]; | |
return d ? d.style ? parseFloat(c.css(d, b, a ? "margin" : "border")) : this[b]() : null | |
}; | |
c.fn[b] = function (a) { | |
var e = this[0]; | |
if (!e) return null == a ? null : this; | |
if (c.isFunction(a)) return this.each(function (d) { | |
var e = c(this); | |
e[b](a.call(this, d, e[b]())) | |
}); | |
if (c.isWindow(e)) { | |
var l = e.document.documentElement["client" + d], | |
k = e.document.body; | |
return "CSS1Compat" === e.document.compatMode && l || k && k["client" + d] || l | |
} | |
if (9 === e.nodeType) return Math.max(e.documentElement["client" + d], e.body["scroll" + d], e.documentElement["scroll" + d], e.body["offset" + d], e.documentElement["offset" + d]); | |
return a === f ? (e = c.css(e, b), l = parseFloat(e), c.isNumeric(l) ? l : e) : this.css(b, "string" === typeof a ? a : a + "px", !0) | |
} | |
}); | |
j.jQuery = j.$ = c; | |
"function" === typeof define && define.amd && define.amd.jQuery && define("jquery", [], function () { | |
return c | |
}) | |
})(F) | |
})(); | |
if (this.env.iHatePrototype.stupidFuckingPrototype) this.document.getElementsByClassName = this.env.iHatePrototype.getElementsByClassName; | |
var j = this.$ = i.$ = F.jQuery.noConflict(!0); | |
this.baseData = i.baseData = Na(this.$); | |
this.bodyOffset = i.bodyOffset = Ka(this.$); | |
(function () { | |
function i(f) { | |
var b = function (b, e) { | |
return b << e | b >>> 32 - e | |
}, | |
k = function (b) { | |
var e = "", | |
f, k; | |
for (f = 7; 0 <= f; f--) k = b >>> 4 * f & 15, e += k.toString(16); | |
return e | |
}, | |
e, r, j = Array(80), | |
q = 1732584193, | |
M = 4023233417, | |
o = 2562383102, | |
A = 271733878, | |
t = 3285377520, | |
u, v, H, D, z, f = this.utf8_encode(f); | |
u = f.length; | |
var B = []; | |
for (e = 0; e < u - 3; e += 4) r = f.charCodeAt(e) << 24 | f.charCodeAt(e + 1) << 16 | f.charCodeAt(e + 2) << 8 | f.charCodeAt(e + 3), B.push(r); | |
switch (u % 4) { | |
case 0: | |
e = 2147483648; | |
break; | |
case 1: | |
e = f.charCodeAt(u - 1) << 24 | 8388608; | |
break; | |
case 2: | |
e = f.charCodeAt(u - 2) << 24 | f.charCodeAt(u - 1) << 16 | 32768; | |
break; | |
case 3: | |
e = f.charCodeAt(u - 3) << 24 | f.charCodeAt(u - 2) << 16 | f.charCodeAt(u - 1) << 8 | 128 | |
} | |
for (B.push(e); 14 != B.length % 16;) B.push(0); | |
B.push(u >>> 29); | |
B.push(u << 3 & 4294967295); | |
for (f = 0; f < B.length; f += 16) { | |
for (e = 0; 16 > e; e++) j[e] = B[f + e]; | |
for (e = 16; 79 >= e; e++) j[e] = b(j[e - 3] ^ j[e - 8] ^ j[e - 14] ^ j[e - 16], 1); | |
r = q; | |
u = M; | |
v = o; | |
H = A; | |
D = t; | |
for (e = 0; 19 >= e; e++) z = b(r, 5) + (u & v | ~u & H) + D + j[e] + 1518500249 & 4294967295, D = H, H = v, v = b(u, 30), u = r, r = z; | |
for (e = 20; 39 >= e; e++) z = b(r, 5) + (u ^ v ^ H) + D + j[e] + 1859775393 & 4294967295, D = H, H = v, v = b(u, 30), u = r, r = z; | |
for (e = 40; 59 >= e; e++) z = b(r, 5) + (u & v | u & H | v & H) + D + j[e] + 2400959708 & 4294967295, D = H, H = v, v = b(u, 30), u = r, r = z; | |
for (e = 60; 79 >= e; e++) z = b(r, 5) + (u ^ v ^ H) + D + j[e] + 3395469782 & 4294967295, D = H, H = v, v = b(u, 30), u = r, r = z; | |
q = q + r & 4294967295; | |
M = M + u & 4294967295; | |
o = o + v & 4294967295; | |
A = A + H & 4294967295; | |
t = t + D & 4294967295 | |
} | |
z = k(q) + k(M) + k(o) + k(A) + k(t); | |
return z.toLowerCase() | |
}(function (f) { | |
var b; | |
if (!f) b = F.CLIPBOARD = F.CLIPBOARD || {}, f = b.common = b.common || {}; | |
f.pad = function (b, e, f) { | |
if (!b.length || !e) return b; | |
for (var f = f - b.length, i = "", j = 0; j < f; ++j) i += e; | |
return i + b | |
}; | |
f.guid = function (b) { | |
function e() { | |
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1) | |
} | |
var f = e() + e() + "-" + e() + "-" + e() + "-" + e() + "-" + e() + e() + e(); | |
b && (f = f.replace(/-/g, "")); | |
return f | |
}; | |
f.randInt = function (b, e) { | |
return Math.floor(Math.random() * (e - b) + b) | |
}; | |
f.caseInsensitiveCompare = function (b, e) { | |
var f = b.toLowerCase(), | |
i = e.toLowerCase(); | |
return f < i ? -1 : f > i ? 1 : 0 | |
}; | |
f.isValidUsername = function (b) { | |
return b && b.match(/^[A-Za-z]\w{1,19}$/) && !(b.toLowerCase() in f.loginBlacklist) | |
}; | |
f.isValidEmail = function (b) { | |
return !b || 100 < b.length ? !1 : b.match(/^[a-z0-9.\-_+%]+@[a-z0-9-_+%]+\.[a-z0-9.\-_+%]+$/i) | |
}; | |
f.loginBlacklist = { | |
about: 1, | |
account: 1, | |
activate: 1, | |
add: 1, | |
addons: 1, | |
admin: 1, | |
administrator: 1, | |
all: 1, | |
api: 1, | |
app: 1, | |
apps: 1, | |
archive: 1, | |
archives: 1, | |
avatar: 1, | |
avatarupload: 1, | |
auth: 1, | |
better: 1, | |
blob: 1, | |
blobloader: 1, | |
block: 1, | |
blog: 1, | |
cache: 1, | |
cancel: 1, | |
careers: 1, | |
cart: 1, | |
cat: 1, | |
cats: 1, | |
category: 1, | |
categories: 1, | |
changelog: 1, | |
checkout: 1, | |
chrome: 1, | |
chromeapp: 1, | |
chromeextversion: 1, | |
codereview: 1, | |
clip: 1, | |
clipper: 1, | |
clips: 1, | |
common: 1, | |
compare: 1, | |
config: 1, | |
configuration: 1, | |
connect: 1, | |
contact: 1, | |
create: 1, | |
css: 1, | |
"delete": 1, | |
direct_messages: 1, | |
documentation: 1, | |
download: 1, | |
downloads: 1, | |
edit: 1, | |
editor: 1, | |
email: 1, | |
emailverify: 1, | |
embed: 1, | |
employment: 1, | |
enterprise: 1, | |
error: 1, | |
extension: 1, | |
extensions: 1, | |
facebook: 1, | |
faq: 1, | |
favorites: 1, | |
feed: 1, | |
feedback: 1, | |
feeds: 1, | |
fleet: 1, | |
fleets: 1, | |
follow: 1, | |
followers: 1, | |
following: 1, | |
friend: 1, | |
friends: 1, | |
gist: 1, | |
group: 1, | |
groups: 1, | |
help: 1, | |
home: 1, | |
hosting: 1, | |
hostmaster: 1, | |
idea: 1, | |
ideas: 1, | |
index: 1, | |
info: 1, | |
invitations: 1, | |
invite: 1, | |
is: 1, | |
it: 1, | |
job: 1, | |
jobs: 1, | |
js: 1, | |
json: 1, | |
landing: 1, | |
lib: 1, | |
lists: 1, | |
login: 1, | |
logout: 1, | |
logoutredirect: 1, | |
log: 1, | |
logs: 1, | |
mail: 1, | |
manage: 1, | |
map: 1, | |
maps: 1, | |
mine: 1, | |
mis: 1, | |
news: 1, | |
notification: 1, | |
notifications: 1, | |
oauth: 1, | |
oauth_clients: 1, | |
offers: 1, | |
openid: 1, | |
order: 1, | |
orders: 1, | |
organizations: 1, | |
pass: 1, | |
people: 1, | |
plans: 1, | |
popular: 1, | |
post: 1, | |
privacy: 1, | |
profile: 1, | |
projects: 1, | |
put: 1, | |
recruitment: 1, | |
redeem: 1, | |
register: 1, | |
remove: 1, | |
replies: 1, | |
root: 1, | |
rss: 1, | |
sales: 1, | |
save: 1, | |
search: 1, | |
security: 1, | |
session: 1, | |
sessions: 1, | |
settings: 1, | |
shared: 1, | |
site: 1, | |
sites: 1, | |
shop: 1, | |
signup: 1, | |
sitemap: 1, | |
socialclipper: 1, | |
ssl: 1, | |
ssladmin: 1, | |
ssladministrator: 1, | |
sslwebmaster: 1, | |
start: 1, | |
"static": 1, | |
status: 1, | |
stories: 1, | |
styleguide: 1, | |
subscribe: 1, | |
subscriptions: 1, | |
support: 1, | |
sysadmin: 1, | |
sysadministrator: 1, | |
tag: 1, | |
tags: 1, | |
terms: 1, | |
token: 1, | |
tools: 1, | |
tour: 1, | |
translations: 1, | |
trends: 1, | |
twitter: 1, | |
twittr: 1, | |
unfollow: 1, | |
unsubscribe: 1, | |
update: 1, | |
url: 1, | |
user: 1, | |
users: 1, | |
utils: 1, | |
verifyemail: 1, | |
w3c: 1, | |
weather: 1, | |
welcome: 1, | |
widget: 1, | |
widgets: 1, | |
wiki: 1, | |
ww: 1, | |
www: 1, | |
wwww: 1, | |
xfn: 1, | |
xml: 1, | |
xmpp: 1, | |
yaml: 1, | |
yml: 1 | |
}; | |
f.merge = function (b, e, f) { | |
for (var i in e) if (e.hasOwnProperty(i) && (f || !b.hasOwnProperty(i))) b[i] = e[i]; | |
return b | |
}; | |
f.createAvatarUrl = function (b, e, f) { | |
return f ? b.cdnUser + f + "_" + e : b.staticBaseUrl + "/images/missing-avatar.jpg" | |
}; | |
f.getBestThumbnailPath = function (b, e, i, j, q) { | |
if ("help" === b.type) return f.getThumbnailPathForLevel(b, 8); | |
q = Math.max(j, q); | |
j = Math.ceil(f.logBase(q, 2)); | |
e = Math.max(e, i); | |
i = Math.ceil(f.logBase(e, 2)); | |
q /= Math.pow(2, j - i); | |
i = Math.max(8, i); | |
1.15 < e / q && (i = Math.min(i + 1, j)); | |
return f.getThumbnailPathForLevel(b, i) | |
}; | |
f.getThumbnailPathForLevel = function (b, e) { | |
return b.thumbnailId ? b.thumbnailId + "_" + e : b.blobId + "_" + e | |
}; | |
f.logBase = function (b, e) { | |
return Math.log(b) / Math.log(e) | |
}; | |
f.inviteTypes = { | |
Facebook: "Facebook", | |
Twitter: "Twitter", | |
Linkedin: "Linkedin", | |
Email: "Email" | |
}; | |
f.arrayRemove = function (b, e, f) { | |
f = b.slice((f || e) + 1 || b.length); | |
b.length = 0 > e ? b.length + e : e; | |
b.push.apply(b, f) | |
}; | |
f.arrayRemoveByVal = function (b) { | |
for (var e = 1; e < arguments.length; ++e) for (var f; 0 <= (f = b.indexOf(arguments[e]));) b.splice(f, 1) | |
}; | |
f.arrayInsertIfUnique = function (b) { | |
for (var e = 1; e < arguments.length; ++e) 0 > b.indexOf(arguments[e]) && b.push(arguments[e]) | |
} | |
})("undefined" === typeof process || !process.versions ? null : exports); | |
(function (f) { | |
if (!f) f = F.CLIPBOARD = F.CLIPBOARD || {}, f.common = f.common || {}, f = f.common.blobSanitization = {}; | |
var b = f.tagCloseType = { | |
normal: 1, | |
selfClosing: 2 | |
}; | |
f.unsafeTags = { | |
base: b.selfClosing, | |
basefont: b.selfClosing, | |
body: b.normal, | |
form: b.normal, | |
frame: b.normal, | |
frameset: b.normal, | |
head: b.normal, | |
html: b.normal, | |
isindex: b.normal, | |
link: b.selfClosing, | |
meta: b.selfClosing, | |
script: b.normal, | |
title: b.normal | |
}; | |
f.unsafeAttributes = { | |
id: 1, | |
hidden: 1, | |
name: 1 | |
} | |
})("undefined" === typeof process || !process.versions ? null : exports); | |
(function (f, b, k, e) { | |
function j() { | |
if (null != u) return u; | |
var b = CLIPBOARD.time, | |
e = (new Date).getTime(); | |
return u = parseInt(b) - e | |
} | |
function w(b) { | |
var e = []; | |
k.each(b, function (b, f) { | |
e.push(encodeURIComponent(b) + "=" + encodeURIComponent(f)) | |
}); | |
return e.sort().join("&") | |
} | |
function q(b, e) { | |
var f = b.sign || !1, | |
i = b.verb || null, | |
w = b.path || null, | |
q = b.cache || !1, | |
n = b.raw || null, | |
u = b.jsonp || !1, | |
v = b.jsonpCallbackName || null; | |
if (i && w && !(u && "GET" != i)) { | |
var c = "", | |
c = /^\/\//.test(w) ? w : ua + w, | |
A = (new Date).getTime() + j(), | |
B = function (c) { | |
e && e(c.error, c.result, c.requestBody) | |
}, | |
z = function (c) { | |
e && (500 <= c.status ? e({ | |
noConnection: !0, | |
statusCode: c.status | |
}, null) : e({ | |
unknown: !0, | |
statusCode: c.status | |
}, null)) | |
}, | |
N = "GET" === i; | |
M.log && M.log.net(w); | |
if (N) if (f && (f = o.guid(), w = o.secret(), n = o.signMessage(c, null, A, f, w), c = -1 === c.indexOf("?") ? c + ("?" + n.msg) : c + ("&" + n.msg)), u) { | |
i = { | |
type: i, | |
dataType: "jsonp", | |
url: c, | |
cache: q, | |
async: !0, | |
success: B, | |
error: z | |
}; | |
if (v) i.jsonp = !1, i.jsonpCallback = v; | |
k.ajax(i) | |
} else k.ajax({ | |
type: i, | |
url: c, | |
cache: q, | |
async: !0, | |
success: B, | |
error: z | |
}); | |
else { | |
v = n; | |
if (f) f = o.guid(), w = o.secret(), n = o.signMessage(c, n, A, f, w), v = n.msg; | |
k.ajax({ | |
type: i, | |
url: c, | |
data: v, | |
cache: q, | |
async: !0, | |
success: B, | |
error: z | |
}) | |
} | |
} | |
} | |
var M = f.CLIPBOARD = f.CLIPBOARD || {}, | |
o = M.data = M.data || {}, | |
A = M.store = M.store || {}, | |
f = f.location, | |
ua = f.protocol + "//" + f.host, | |
u = null; | |
o.signMessage = function (b, e, f, j, r) { | |
b = w(k.extend({ | |
hmac_url: encodeURIComponent(b), | |
hmac_time: encodeURIComponent(f), | |
hmac_guid: encodeURIComponent(j), | |
hmac_nonce: i(b + (new Date).getTime() + r) | |
}, e)); | |
r = i(b + r); | |
return { | |
msg: b + "&hmac_sig=" + r, | |
sig: r | |
} | |
}; | |
var v = o.localSignPost = function (b, e, f) { | |
q({ | |
sign: !0, | |
verb: "POST", | |
path: b, | |
raw: e | |
}, f) | |
}, | |
H = o.localPost = function (b, e, f) { | |
q({ | |
verb: "POST", | |
path: b, | |
raw: e | |
}, f) | |
}, | |
D = o.localSignPut = function (b, e, f) { | |
q({ | |
sign: !0, | |
verb: "PUT", | |
path: b, | |
raw: e | |
}, f) | |
}, | |
z = o.localSignGet = function (b, e) { | |
q({ | |
sign: !0, | |
verb: "GET", | |
path: b | |
}, e) | |
}, | |
B = o.localGet = function (b, e, f) { | |
q({ | |
verb: "GET", | |
path: b, | |
cache: e | |
}, f) | |
}, | |
N = o.localSignDelete = function (b, e, f) { | |
q({ | |
sign: !0, | |
verb: "DELETE", | |
path: b, | |
raw: e | |
}, f) | |
}, | |
F = function (b, e, f, k) { | |
q({ | |
verb: "GET", | |
path: b, | |
cache: e, | |
jsonp: !0, | |
jsonpCallbackName: f | |
}, k) | |
}; | |
o.secret = function () { | |
return A.get("secret") | |
}; | |
o.login = function () { | |
return A.get("login") | |
}; | |
o.guid = function () { | |
return A.get("guid") | |
}; | |
o.getTrackingId = function () { | |
return null != A.get("trackingId") ? A.get("trackingId") : mixpanel && mixpanel.get_property ? mixpanel.get_property("distinct_id") : null | |
}; | |
o.searchPrivate = function (b, e, f, k, i) { | |
b = { | |
scope: JSON.stringify(b) | |
}; | |
if (e) b.query = e; | |
if (f) b.beforeTime = f; | |
if (k) b.rows = k; | |
v("/api/v1/searchPrivate", b, function (b, e) { | |
i.apply(this, arguments) | |
}) | |
}; | |
o.searchPublic = function (b, e, f, k, i) { | |
b = { | |
scope: JSON.stringify(b) | |
}; | |
if (e) b.query = e; | |
if (f) b.beforeTime = f; | |
if (k) b.rows = k; | |
H("/api/v1/searchPublic", b, i) | |
}; | |
o.searchUsers = function (b, e, f, k) { | |
z("/api/v1/users/search?q=" + b + "&start=" + e + "&rows=" + f, k) | |
}; | |
o.getPopularUsers = function (b) { | |
z("/api/v1/users/popular", b) | |
}; | |
o.getClip = function (b, e) { | |
B("/api/v1/clips/" + b, !1, function (b, f) { | |
e(b, f) | |
}) | |
}; | |
o.getTop = function (b, e, f) { | |
B("/api/v1/top/" + b + "/" + e, !1, f) | |
}; | |
o.getRecommendedTags = function (b) { | |
B("/api/v1/recommendedTags", !0, b) | |
}; | |
var x = {}; | |
o.getBlob = function (b, e) { | |
var f, k; | |
f = "/api/v2/blobs/" + b; | |
M.config.staticBaseUrl ? (k = "getBlobJsonPCallback_" + b, x[k] ? x[k].push(e) : (x[k] = [e], f = M.config.staticBaseUrl + f + "/" + k, F(f, !0, k, function (b, e) { | |
var f, i; | |
i = x[k]; | |
for (f = 0; f < i.length; ++f) i[f](b, e); | |
delete x[k] | |
}))) : B(f, !0, function (b, f) { | |
e(b, f) | |
}) | |
}; | |
o.setClipAsPublic = function (b, e, f) { | |
D("/api/v1/clips/" + b, { | |
isPrivate: !e | |
}, function (b) { | |
f(b) | |
}) | |
}; | |
o.setClipAnnotation = function (b, e, f) { | |
D("/api/v1/clips/" + b, { | |
annote: e | |
}, function (b) { | |
f(b) | |
}) | |
}; | |
o.setClipTitle = function (b, e, f) { | |
D("/api/v1/clips/" + b, { | |
title: e | |
}, function (b) { | |
f(b) | |
}) | |
}; | |
o.reclip = function (b, e) { | |
v("/api/v1/clips/" + b, { | |
reclip: !0 | |
}, function (b) { | |
e(b) | |
}) | |
}; | |
o.getLikedClips = function (b, e, f, k) { | |
!k && "function" == typeof f && (k = f, f = null); | |
f ? B("/api/v1/likes/clips?start=" + b + "&rows=" + e + "&user=" + f, !1, k) : z("/api/v1/likes/clips?start=" + b + "&rows=" + e, k) | |
}; | |
o.like = function (b, e, f) { | |
D("/api/v1/likes/" + b, { | |
addOrRemove: e | |
}, function (b) { | |
f(b) | |
}) | |
}; | |
o.addOpenAction = function (b, e) { | |
H("/api/v1/actions/open/" + b, e) | |
}; | |
o.getActions = function (b, e, f) { | |
if (!b || 0 >= b.length) f("need at least one clip id to fetch actions for"); | |
else { | |
var k = ""; | |
"string" == typeof b ? k = b : b.join && (k = b.join(",")); | |
b = "/api/v1/actions/" + k; | |
e ? z(b, f) : B(b, !1, function (b, e) { | |
f && f(b, e) | |
}) | |
} | |
}; | |
o.getHotClips = function (b, e, f, k) { | |
z("/api/v1/hot?start=" + b + "&rows=" + e + "&type=" + f, k) | |
}; | |
o.getComments = function (b, e) { | |
if (!b || 0 >= b.length) e("need at least one clip id to fetch comments for"); | |
else { | |
var f = ""; | |
"string" == typeof b ? f = b : b.join && (f = b.join(",")); | |
B("/api/v1/comments/" + f, !1, function (b, f) { | |
e(b, f) | |
}) | |
} | |
}; | |
o.addComment = function (b, e, f) { | |
D("/api/v1/comments/" + b, { | |
text: e | |
}, function (b, e) { | |
f(b, e) | |
}) | |
}; | |
o.deleteComment = function (b, e, f) { | |
N("/api/v1/comments/" + b, { | |
clipId: e | |
}, function (b, e) { | |
f(b, e) | |
}) | |
}; | |
o.getCounts = function (b, e) { | |
z("/api/v1/users/" + b + "/counts", function (b, f) { | |
e(b, f) | |
}) | |
}; | |
o.getMessage = function (b) { | |
B("/api/v1/message", !1, function (e, f) { | |
b(e, f) | |
}) | |
}; | |
o.updateUserProfile = function (b, e) { | |
D("/api/v1/users/", b, e) | |
}; | |
o.emailClip = function (b, e, f) { | |
v("/api/v1/share/emailClip", { | |
clipId: b, | |
toEmail: e | |
}, f) | |
}; | |
o.getFacebookFriendList = function (b) { | |
z("/api/v1/secure/fb/friendsList", b) | |
}; | |
o.getEmailContacts = function (b) { | |
z("/api/v1/secure/emailContacts", b) | |
}; | |
o.connectFacebookAccount = function (b, e, f, k) { | |
v("/api/v1/secure/fb/connect/", { | |
fbId: b, | |
fbAccessToken: e, | |
fetchAvatar: f | |
}, k) | |
}; | |
o.disconnectFacebookAccount = function (b) { | |
N("/api/v1/secure/fb/connect/", {}, b) | |
}; | |
o.disconnectFbTimeline = function (b) { | |
N("/api/v1/fb/timeline/", {}, b) | |
}; | |
o.disconnectFbStream = function (b) { | |
N("/api/v1/fb/stream/", {}, b) | |
}; | |
o.connectGoogleAccount = function (b, e) { | |
v("/api/v1/secure/google/connect", { | |
code: b | |
}, e) | |
}; | |
o.connectYahooAccount = function (b, e, f, k) { | |
v("/api/v1/secure/yahoo/connect", { | |
token: b, | |
tokenSecret: e, | |
verifier: f | |
}, k) | |
}; | |
o.connectTwitterAccount = function (b, e, f, k) { | |
v("/api/v1/secure/twitter/connect", { | |
token: b, | |
tokenSecret: e, | |
verifier: f | |
}, k) | |
}; | |
o.disconnectTwitterAccount = function (b) { | |
N("/api/v1/secure/twitter/connect/", {}, b) | |
}; | |
o.getTwitterFriends = function (b) { | |
z("/api/v1/secure/twitter/friends", b) | |
}; | |
o.getTwitterIds = function (b, e) { | |
v("/api/v1/secure/twitter/ids", { | |
method: b | |
}, e) | |
}; | |
o.getTwitterData = function (b, e) { | |
v("/api/v1/secure/twitter/data", { | |
ids: b | |
}, e) | |
}; | |
o.postTweet = function (b, e) { | |
v("/api/v1/secure/twitter/tweet", { | |
tweet: b | |
}, e) | |
}; | |
o.connectLinkedinAccount = function (b, e, f, k) { | |
v("/api/v1/secure/linkedin/connect", { | |
token: b, | |
tokenSecret: e, | |
verifier: f | |
}, k) | |
}; | |
o.disconnectLinkedinAccount = function (b) { | |
N("/api/v1/secure/linkedin/connect", {}, b) | |
}; | |
o.getLinkedinContacts = function (b) { | |
z("/api/v1/secure/linkedin/contacts", b) | |
}; | |
o.sendLinkedinMessage = function (b, e, f, k) { | |
v("/api/v1/secure/linkedin/sendmessage", { | |
msgSubject: b, | |
msgBody: e, | |
personUrl: f | |
}, k) | |
}; | |
o.lookupUser = function (b, e) { | |
B("/api/v1/users/lookup?" + w(b), !1, e) | |
}; | |
o.getConnections = function (b, f) { | |
"function" === typeof b && !f && (f = b, b = e); | |
z("/api/v1/connections" + (b ? "?refreshIfOlderThan=" + b : ""), f) | |
}; | |
o.getAutocompleteDict = function (b) { | |
o.localSignGet("/api/v1/autocomplete", function (e, f) { | |
b && b(e, f) | |
}) | |
}; | |
o.getNotifications = function (b) { | |
z("/api/v1/notifications?markRead=1", b) | |
}; | |
o.getUnreadNotificationCount = function (b) { | |
z("/api/v1/notifications/unreadCount", b) | |
}; | |
o.sendInvite = function (b, e) { | |
v("/api/v1/invites/sendInvite", { | |
email: b | |
}, e) | |
}; | |
o.trackInvite = function (b, e, f) { | |
b = { | |
type: b, | |
to: e | |
}; | |
if (f) b.fbRequestId = f; | |
v("/api/v1/invites/trackInvite", b) | |
}; | |
o.sendFeedback = function (b, e) { | |
v("/api/v1/feedback", { | |
message: b | |
}, function (b) { | |
e(b) | |
}) | |
}; | |
o.addFollow = function (b, e) { | |
v("/api/v1/follow", { | |
item: b | |
}, function (b) { | |
e(b) | |
}) | |
}; | |
o.deleteFollow = function (b, e) { | |
N("/api/v1/follow/" + encodeURIComponent(encodeURIComponent(b)), {}, function (b) { | |
e(b) | |
}) | |
}; | |
o.testFollow = function (b, e) { | |
z("/api/v1/follows/" + b.join(","), function (b, f) { | |
e(b, f) | |
}) | |
}; | |
o.getFollowers = function (b, e) { | |
B("/api/v1/followers/" + b, !0, function (b, f) { | |
e(b, f) | |
}) | |
}; | |
o.getFollowing = function (b, e) { | |
B("/api/v1/following/" + b, !0, function (b, f) { | |
e(b, f) | |
}) | |
}; | |
o.updateUserTag = function (b, e, f, k) { | |
D("/api/v1/users/" + b + "/tags/" + encodeURIComponent(encodeURIComponent(e)), { | |
description: f | |
}, function (b) { | |
k(b) | |
}) | |
}; | |
o.getUserTag = function (b, e, f) { | |
z("/api/v1/users/" + b + "/tags/" + encodeURIComponent(encodeURIComponent(e)), function (b, e) { | |
f(b, e) | |
}) | |
}; | |
o.getSession = function (b) { | |
z("/api/v1/sessions", function (e, f) { | |
b(e, f) | |
}) | |
}; | |
o.setAsFrozen = function (b, e, f) { | |
D("/api/v1/clips/" + b, { | |
frozen: e | |
}, function (b) { | |
f(b) | |
}) | |
}; | |
o.requestEmailVerification = function (b, e) { | |
var f = "/api/v1/validateemail"; | |
e && (f += "/" + e); | |
v(f, {}, function (e, f) { | |
b(e, f) | |
}) | |
}; | |
o.getEmailVerification = function (b) { | |
z("/api/v1/validateemail", function (e, f) { | |
b(e, f) | |
}) | |
}; | |
o.uploadAvatar = function (b, e) { | |
v("/api/v1/secure/users/avatar", { | |
facebookId: b | |
}, e) | |
}; | |
(function (b) { | |
function e(b, f, k) { | |
D("/api/v1/clips/" + b, { | |
broken: f ? !0 : !1 | |
}, function (b, e) { | |
k(b, e) | |
}) | |
} | |
b.flagAsBroken = function (b, f) { | |
e(b, !0, f) | |
}; | |
b.flagAsNotBroken = function (b, f) { | |
e(b, !1, f) | |
} | |
})(o); | |
o.flagAsInappropriate = function (b, e, f) { | |
D("/api/v1/clips/" + b, { | |
_cb_action: "flagInappropriate", | |
reason: e || "[none]" | |
}, f) | |
}; | |
o.linkAmplify = function (b, e, f, k) { | |
H("/api/v1/amplify", { | |
source: f, | |
clipboardLogin: e, | |
amplifyLogin: b | |
}, k) | |
} | |
})(F, document, j); | |
(function (f, b, k) { | |
function e(b, e) { | |
var f = k("<" + b + "/>"); | |
f.applyBlockStyles && ("block" === e ? f.applyBlockStyles() : f.applyInlineStyles()); | |
return f | |
} | |
var i = f.CLIPBOARD, | |
j = i.common = i.common || {}; | |
i.autocomplete = {}; | |
var q = null, | |
M = "autocomplete-me-value"; | |
i.autocomplete.setData = function (b) { | |
function f(b) { | |
return e("li", "block").data(M, b).text(b) | |
} | |
function k(b) { | |
var f = j.createAvatarUrl(i.config, "s", b.login); | |
return function () { | |
return e("li", "block").addClass("autocomplete_user_314159265").data(M, "@" + b.login).append(e("img", "inline").attr({ | |
src: f | |
}).showPlaceholderOnError()).append(e("div", "block").append("@" + b.login, e("span", "inline").addClass("autocomplete_userRealName_314159265").text(b.name || ""))) | |
} | |
} | |
function u(b) { | |
return RegExp("^" + b.split("").join("[\\w\\s]*?"), "i") | |
} | |
function v(b) { | |
return function (e) { | |
if ("#" !== e.charAt(0)) return 0; | |
return "#" === e ? 100 : (e = u(e.substring(1)).exec(b)) ? 100 - e[0].length : 0 | |
} | |
} | |
function t(b) { | |
return function (e) { | |
function f(b, i) { | |
var j = k.exec(b), | |
n = 0; | |
j && (n = i - j[0].length, j[0].toLowerCase() === e && (n += 1E4)); | |
return n | |
} | |
if ("@" !== e.charAt(0)) return 0; | |
var e = e.substring(1).toLowerCase(), | |
k = u(e), | |
i = f(b.login, 1E3); | |
if (b.name) { | |
var j = b.name.split(" "), | |
r = 1 < j.length ? j[j.length - 1] : "", | |
i = i + f(j[0], 100); | |
r && (i += f(r, 50)) | |
} | |
return i | |
} | |
} | |
q = { | |
items: [] | |
}; | |
for (var D in b.tags) b.tags.hasOwnProperty(D) && q.items.push({ | |
name: "#" + b.tags[D], | |
matches: v(D), | |
render: f | |
}); | |
for (var z in b.users) b.users.hasOwnProperty(z) && (D = b.users[z], q.items.push({ | |
name: "@" + D.login, | |
matches: t(D), | |
render: k(D) | |
})) | |
}; | |
i.autocomplete.getData = function () { | |
return q | |
}; | |
k.fn.autocompletify = function (b) { | |
b = k.extend({}, { | |
trigger: "[#@\\w]", | |
maxResults: 8 | |
}, b); | |
return this.autocompleteMe(function () { | |
return q | |
}, b) | |
} | |
})(F, document, j); | |
(function (f, b, k) { | |
function e() { | |
function b() { | |
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1) | |
} | |
return b() + b() + "-" + b() + "-" + b() + "-" + b() + "-" + b() + b() + b() | |
} | |
function i(b, e) { | |
var f = e.createElement; | |
s = f("div").addClass(P + "wrapper" + e.classSuffix).append(f("ul")).hide().appendTo("body").on("mouseover", "li", function () { | |
k(this).addClass(P + "selected").siblings().removeClass(P + "selected") | |
}).on("click", "li", function () { | |
H(b) | |
}); | |
e.setCss(s, "position", e.fixed ? "fixed" : "absolute"); | |
return s | |
} | |
function j(b, e) { | |
return p[b.attr("id")][e] | |
} | |
function q(b, e, f) { | |
p[b.attr("id")][e] = f | |
} | |
function M(b) { | |
var e = b.val().substring(0, b.caret().end), | |
f = j(b, "options").trigger, | |
b = j(b, "options").matcher; | |
return (RegExp(f + b + "*$").exec(e) || [])[0] || "" | |
} | |
function o() { | |
return s && s.is(":visible") | |
} | |
function A(b, i, r) { | |
function c(b) { | |
for (var c in x) if (x.hasOwnProperty(c) && b === x[c]) return !0; | |
return !1 | |
} | |
var s = b.attr("id") || b.attr("name"); | |
s || (s = P + e(), b.attr("id", s)); | |
p[s] = { | |
options: r, | |
data: i, | |
attach: r.attach || b, | |
query: "", | |
shouldHide: !0, | |
timeoutId: null | |
}; | |
b.on("keyup." + J, function (e) { | |
if (e.ctrlKey || e.altKey || !e.shiftKey) { | |
var f = e.which; | |
if (c(f)) { | |
if (!o()) return; | |
if (f === x.ENTER || f === x.TAB) { | |
H(b, f === x.TAB) && (e.preventDefault(), e.stopImmediatePropagation()); | |
return | |
} | |
e.preventDefault(); | |
e.stopImmediatePropagation(); | |
if (f === x.ESC) { | |
B(b); | |
return | |
} | |
if (f === x.UP || f === x.DOWN) return | |
} | |
e.stopPropagation(); | |
(e = M(b)) ? z(b, e) : B(b) | |
} | |
}); | |
b.on("keydown." + J, function (c) { | |
if (o()) { | |
var e = c.keyCode; | |
if (e === x.UP || e === x.DOWN) { | |
var f = t(b), | |
c = v(b).length; | |
0 !== c && (null === f ? D(b, e === x.UP ? c - 1 : 0) : (e = f + (e === x.UP ? -1 : 1), D(b, (e + c) % c))) | |
} | |
} | |
}); | |
b.on("keydown." + J + " keypress." + J, function (e) { | |
var f = e.which || e.keyCode; | |
if (o() && (e.ctrlKey || e.altKey || !e.shiftKey) && c(f) && !(f === x.ENTER && !u(b).length && !j(b, "options").autocompleteIfUnselected)) e.preventDefault(), e.stopImmediatePropagation() | |
}); | |
b.on("blur." + J, function () { | |
q(b, "shouldHide", !0); | |
var c = f.setTimeout(function () { | |
j(b, "shouldHide") && B(b); | |
q(b, "shouldHide", !0) | |
}, 250); | |
q(b, "timeoutId", c) | |
}); | |
b.on("focus." + J, function () { | |
j(b, "shouldHide") && q(b, "shouldHide", !1); | |
var c = M(b); | |
c && z(b, c) | |
}); | |
k(f).on("resize." + J + s, function () { | |
o() && N(b) | |
}) | |
} | |
function t(b) { | |
var e = j(b, "options").classSuffix, | |
f = null; | |
v(b).each(function (b, i) { | |
if (k(i).hasClass(P + "selected" + e)) return f = b, !1 | |
}); | |
return f | |
} | |
function u(b, e) { | |
var f = j(b, "options").classSuffix, | |
f = v(b).filter("li." + P + "selected" + f); | |
return !f.length && (e || j(b, "options").autocompleteIfUnselected) ? s.hasClass(P + "inverted") ? v(b).last() : v(b).first() : f | |
} | |
function v() { | |
return s ? s.find("li") : [] | |
} | |
function H(b, e) { | |
if (!o()) return !1; | |
var f = u(b, e); | |
if (!f.length) return !1; | |
var c = j(b, "query"), | |
k = b.val(), | |
i = b.caret(), | |
f = f.data(P + "value"), | |
c = i.start - c.length, | |
k = k.substring(0, c) + f + " " + k.substring(i.start); | |
b.val(k); | |
k = c + f.length + 1; | |
b.caret(k, k); | |
B(b); | |
return !0 | |
} | |
function D(b, e) { | |
var f = v(b); | |
if (o() && !(0 >= f.length || e >= f.length)) { | |
var c = j(b, "options").classSuffix; | |
f.removeClass(P + "selected" + c); | |
f.eq(e).addClass(P + "selected" + c) | |
} | |
} | |
function z(e, p, u) { | |
if (!u) u = j(e, "options").maxResults; | |
var c = j(e, "data"); | |
"function" === typeof c && (c = c(), q(e, "data", c)); | |
if (c) if (c.filter || F(c), u = c.filter(p, u), u.length) { | |
s || i(e, j(e, "options")); | |
var c = s.find("ul"), | |
v = j(e, "attach"), | |
A = v.offset(), | |
v = A.top - k(b).scrollTop() + v.outerHeight() + I; | |
o() || (v >= k(f).height() ? !s.hasClass(K) && A.top - k(b).scrollTop() > I && s.addClass(K) : s.removeClass(K)); | |
c.empty(); | |
for (var A = s.hasClass(K), v = 0, z; v < u.length; v++) z = A ? u.length - 1 - v : v, c.append(u[z].render(u[z].name)); | |
q(e, "query", p); | |
N(e); | |
j(e, "options").autoSelect && D(e, A ? u.length - 1 : 0) | |
} else B(e) | |
} | |
function B() { | |
s && s.remove(); | |
s = null | |
} | |
function N(e) { | |
if (0 !== v(e).length) { | |
var f = j(e, "attach"), | |
p = j(e, "options"), | |
c = f.offset(); | |
p.fixed && (c.top -= k(b).scrollTop(), c.left -= k(b).scrollLeft()); | |
s || i(e, j(e, "options")); | |
o() ? e = s.outerHeight() : (s.css("visibility", "hidden").show(), e = s.outerHeight(), s.hide().css("visibility", "visible")); | |
p.setCss(s, "left", c.left); | |
p.setCss(s, "top", c.top + (!s.hasClass(K) ? f.outerHeight() : -e)); | |
p.setCss(s, "width", f.outerWidth() - 2); | |
s.show() | |
} | |
} | |
function F(b) { | |
b.filter = function (e, f) { | |
for (var c = [], k, i = 0, j; i < b.items.length; i++) j = b.items[i], (k = j.matches(e)) && c.push({ | |
name: j.name, | |
render: j.render, | |
score: k | |
}); | |
c.sort(function (b, c) { | |
if (b.score === c.score) { | |
var e = b.name.toLowerCase(), | |
f = c.name.toLowerCase(); | |
return e === f ? 0 : e < f ? -1 : 1 | |
} | |
return b.score > c.score ? -1 : 1 | |
}); | |
return c = c.slice(0, f) | |
} | |
} | |
var x = { | |
TAB: 9, | |
ENTER: 13, | |
ESC: 27, | |
UP: 38, | |
DOWN: 40 | |
}, | |
p = {}, | |
I = 360, | |
s, J = "autocomplete-me", | |
P = J + "-", | |
K = P + "inverted"; | |
k.fn.autocompleteMe = function () { | |
var b = { | |
classSuffix: "", | |
maxResults: 10, | |
autocompleteIfUnselected: !1, | |
autoSelect: !1, | |
attach: null, | |
trigger: "\\w", | |
matcher: "\\w", | |
fixed: !1, | |
setCss: function (b, e, c) { | |
b.css(e, c) | |
}, | |
createElement: function (b) { | |
return k("<" + b + "/>") | |
} | |
}; | |
return function (e, i) { | |
if ("string" === typeof e) { | |
var c = this.attr("id"), | |
j = p[c]; | |
if (!j) return this; | |
switch (e) { | |
case "destroy": | |
(j = j.timeoutId) && f.clearTimeout(j), B(), p[c] = null, this.off("." + J), k(f).off("." + J + c) | |
} | |
return this | |
} | |
i = k.extend(!0, {}, b, i); | |
this.filter("input,textarea").each(function () { | |
A(k(this), e, i) | |
}); | |
return this | |
} | |
}() | |
})(F, document, j); | |
(function (f, b) { | |
b.fn.showPlaceholderOnError = function (k) { | |
var e = f.CLIPBOARD, | |
i = e.common.createAvatarUrl(e.config, k); | |
b(this).error(function () { | |
b(this).attr("src") !== i && b(this).attr("src", i) | |
}); | |
return this | |
} | |
})(F, j); | |
(function (f, b) { | |
b.fn.placeholder = function (f, e) { | |
this.each(function () { | |
var i = b(this), | |
j = i.attr("placeholder"); | |
if (j) { | |
i.removeAttr("placeholder"); | |
var q = i.attr("id") || i.attr("name"); | |
q || (q = "input_" + Math.round(1E5 * Math.random()), i.attr("id", q)); | |
var M = i.position(), | |
o = f ? "cssImportant" : "css", | |
A = b("<label/>"); | |
f && A.applyInlineStyles(); | |
A[o](b.extend({ | |
position: "absolute", | |
left: M.left + parseInt(i.css("padding-left")) + 4, | |
top: M.top + parseInt(i.css("padding-top")) + 1, | |
"font-size": i.css("font-size"), | |
"font-family": i.css("font-family"), | |
"line-height": i.css("line-height"), | |
color: i.css("color") | |
}, e || {})).attr({ | |
"for": q, | |
tabindex: -1 | |
}).text(j); | |
if (b.support.opacity) A[o]("opacity", 0.5); | |
else A[o]("color", "#999999"); | |
i.val() && A.hide(); | |
A.insertAfter(i); | |
i.keydown(function (b) { | |
(46 <= b.which && 90 >= b.which || 96 <= b.which && 111 >= b.which || 186 <= b.which && 222 >= b.which) && A.hide() | |
}).keyup(function () { | |
A["" === i.val() ? "show" : "hide"]() | |
}).focus(function () { | |
"" !== i.val() && A.hide() | |
}) | |
} | |
}); | |
return this | |
} | |
})(F, j); | |
j.easing.jswing = j.easing.swing; | |
j.extend(j.easing, { | |
def: "easeOutQuad", | |
swing: function (f, b, k, e, i) { | |
return j.easing[j.easing.def](f, b, k, e, i) | |
}, | |
easeInQuad: function (f, b, k, e, i) { | |
return e * (b /= i) * b + k | |
}, | |
easeOutQuad: function (f, b, k, e, i) { | |
return -e * (b /= i) * (b - 2) + k | |
}, | |
easeInOutQuad: function (f, b, k, e, i) { | |
return 1 > (b /= i / 2) ? e / 2 * b * b + k : -e / 2 * (--b * (b - 2) - 1) + k | |
}, | |
easeInCubic: function (f, b, k, e, i) { | |
return e * (b /= i) * b * b + k | |
}, | |
easeOutCubic: function (f, b, k, e, i) { | |
return e * ((b = b / i - 1) * b * b + 1) + k | |
}, | |
easeInOutCubic: function (f, b, k, e, i) { | |
return 1 > (b /= i / 2) ? e / 2 * b * b * b + k : e / 2 * ((b -= 2) * b * b + 2) + k | |
}, | |
easeInQuart: function (f, b, k, e, i) { | |
return e * (b /= i) * b * b * b + k | |
}, | |
easeOutQuart: function (f, b, k, e, i) { | |
return -e * ((b = b / i - 1) * b * b * b - 1) + k | |
}, | |
easeInOutQuart: function (f, b, k, e, i) { | |
return 1 > (b /= i / 2) ? e / 2 * b * b * b * b + k : -e / 2 * ((b -= 2) * b * b * b - 2) + k | |
}, | |
easeInQuint: function (f, b, k, e, i) { | |
return e * (b /= i) * b * b * b * b + k | |
}, | |
easeOutQuint: function (f, b, k, e, i) { | |
return e * ((b = b / i - 1) * b * b * b * b + 1) + k | |
}, | |
easeInOutQuint: function (f, b, k, e, i) { | |
return 1 > (b /= i / 2) ? e / 2 * b * b * b * b * b + k : e / 2 * ((b -= 2) * b * b * b * b + 2) + k | |
}, | |
easeInSine: function (f, b, k, e, i) { | |
return -e * Math.cos(b / i * (Math.PI / 2)) + e + k | |
}, | |
easeOutSine: function (f, b, k, e, i) { | |
return e * Math.sin(b / i * (Math.PI / 2)) + k | |
}, | |
easeInOutSine: function (f, b, k, e, i) { | |
return -e / 2 * (Math.cos(Math.PI * b / i) - 1) + k | |
}, | |
easeInExpo: function (f, b, k, e, i) { | |
return 0 == b ? k : e * Math.pow(2, 10 * (b / i - 1)) + k | |
}, | |
easeOutExpo: function (f, b, k, e, i) { | |
return b == i ? k + e : e * (-Math.pow(2, -10 * b / i) + 1) + k | |
}, | |
easeInOutExpo: function (f, b, k, e, i) { | |
return 0 == b ? k : b == i ? k + e : 1 > (b /= i / 2) ? e / 2 * Math.pow(2, 10 * (b - 1)) + k : e / 2 * (-Math.pow(2, -10 * --b) + 2) + k | |
}, | |
easeInCirc: function (f, b, k, e, i) { | |
return -e * (Math.sqrt(1 - (b /= i) * b) - 1) + k | |
}, | |
easeOutCirc: function (f, b, k, e, i) { | |
return e * Math.sqrt(1 - (b = b / i - 1) * b) + k | |
}, | |
easeInOutCirc: function (f, b, k, e, i) { | |
return 1 > (b /= i / 2) ? -e / 2 * (Math.sqrt(1 - b * b) - 1) + k : e / 2 * (Math.sqrt(1 - (b -= 2) * b) + 1) + k | |
}, | |
easeInElastic: function (f, b, k, e, i) { | |
var f = 1.70158, | |
j = 0, | |
q = e; | |
if (0 == b) return k; | |
if (1 == (b /= i)) return k + e; | |
j || (j = 0.3 * i); | |
q < Math.abs(e) ? (q = e, f = j / 4) : f = j / (2 * Math.PI) * Math.asin(e / q); | |
return -(q * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * i - f) * 2 * Math.PI / j)) + k | |
}, | |
easeOutElastic: function (f, b, k, e, i) { | |
var f = 1.70158, | |
j = 0, | |
q = e; | |
if (0 == b) return k; | |
if (1 == (b /= i)) return k + e; | |
j || (j = 0.3 * i); | |
q < Math.abs(e) ? (q = e, f = j / 4) : f = j / (2 * Math.PI) * Math.asin(e / q); | |
return q * Math.pow(2, -10 * b) * Math.sin((b * i - f) * 2 * Math.PI / j) + e + k | |
}, | |
easeInOutElastic: function (f, b, k, e, i) { | |
var f = 1.70158, | |
j = 0, | |
q = e; | |
if (0 == b) return k; | |
if (2 == (b /= i / 2)) return k + e; | |
j || (j = i * 0.3 * 1.5); | |
q < Math.abs(e) ? (q = e, f = j / 4) : f = j / (2 * Math.PI) * Math.asin(e / q); | |
return 1 > b ? -0.5 * q * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * i - f) * 2 * Math.PI / j) + k : 0.5 * q * Math.pow(2, -10 * (b -= 1)) * Math.sin((b * i - f) * 2 * Math.PI / j) + e + k | |
}, | |
easeInBack: function (f, b, i, e, j, w) { | |
void 0 == w && (w = 1.70158); | |
return e * (b /= j) * b * ((w + 1) * b - w) + i | |
}, | |
easeOutBack: function (f, b, i, e, j, w) { | |
void 0 == w && (w = 1.70158); | |
return e * ((b = b / j - 1) * b * ((w + 1) * b + w) + 1) + i | |
}, | |
easeInOutBack: function (f, b, i, e, j, w) { | |
void 0 == w && (w = 1.70158); | |
return 1 > (b /= j / 2) ? e / 2 * b * b * (((w *= 1.525) + 1) * b - w) + i : e / 2 * ((b -= 2) * b * (((w *= 1.525) + 1) * b + w) + 2) + i | |
}, | |
easeInBounce: function (f, b, i, e, r) { | |
return e - j.easing.easeOutBounce(f, r - b, 0, e, r) + i | |
}, | |
easeOutBounce: function (f, b, i, e, j) { | |
return (b /= j) < 1 / 2.75 ? e * 7.5625 * b * b + i : b < 2 / 2.75 ? e * (7.5625 * (b -= 1.5 / 2.75) * b + 0.75) + i : b < 2.5 / 2.75 ? e * (7.5625 * (b -= 2.25 / 2.75) * b + 0.9375) + i : e * (7.5625 * (b -= 2.625 / 2.75) * b + 0.984375) + i | |
}, | |
easeInOutBounce: function (f, b, i, e, r) { | |
return b < r / 2 ? 0.5 * j.easing.easeInBounce(f, 2 * b, 0, e, r) + i : 0.5 * j.easing.easeOutBounce(f, 2 * b - r, 0, e, r) + 0.5 * e + i | |
} | |
}); | |
(function (f) { | |
function b(b) { | |
var e = b || F.event, | |
i = [].slice.call(arguments, 1), | |
k = 0, | |
j = 0, | |
A = 0, | |
b = f.event.fix(e); | |
b.type = "mousewheel"; | |
e.wheelDelta && (k = e.wheelDelta / 120); | |
e.detail && (k = -e.detail / 3); | |
A = k; | |
void 0 !== e.axis && e.axis === e.HORIZONTAL_AXIS && (A = 0, j = -1 * k); | |
void 0 !== e.wheelDeltaY && (A = e.wheelDeltaY / 120); | |
void 0 !== e.wheelDeltaX && (j = -1 * e.wheelDeltaX / 120); | |
i.unshift(b, k, j, A); | |
return (f.event.dispatch || f.event.handle).apply(this, i) | |
} | |
var i = ["DOMMouseScroll", "mousewheel"]; | |
if (f.event.fixHooks) for (var e = i.length; e;) f.event.fixHooks[i[--e]] = f.event.mouseHooks; | |
f.event.special.mousewheel = { | |
setup: function () { | |
if (this.addEventListener) for (var e = i.length; e;) this.addEventListener(i[--e], b, !1); | |
else this.onmousewheel = b | |
}, | |
teardown: function () { | |
if (this.removeEventListener) for (var e = i.length; e;) this.removeEventListener(i[--e], b, !1); | |
else this.onmousewheel = null | |
} | |
}; | |
f.fn.extend({ | |
mousewheel: function (b) { | |
return b ? this.bind("mousewheel", b) : this.trigger("mousewheel") | |
}, | |
unmousewheel: function (b) { | |
return this.unbind("mousewheel", b) | |
} | |
}) | |
})(j); | |
(function (f, b, i, e, j, w) { | |
function q(b, c) { | |
var e = typeof b[c]; | |
return "function" == e || !! ("object" == e && b[c]) || "unknown" == e | |
} | |
function t() { | |
try { | |
var b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); | |
X = Array.prototype.slice.call(b.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/), 1); | |
$ = 9 < parseInt(X[0], 10) && 0 < parseInt(X[1], 10); | |
return !0 | |
} catch (c) { | |
return !1 | |
} | |
} | |
function o() { | |
if (!ha) { | |
ha = !0; | |
for (var b = 0; b < Z.length; b++) Z[b](); | |
Z.length = 0 | |
} | |
} | |
function A(b, c) { | |
ha ? b.call(c) : Z.push(function () { | |
b.call(c) | |
}) | |
} | |
function x() { | |
var b = parent; | |
if ("" !== n) for (var c = 0, e = n.split("."); c < e.length; c++) b = b[e[c]]; | |
return b.easyXDM | |
} | |
function u(b) { | |
var c = b.toLowerCase().match(J), | |
b = c[2], | |
e = c[3], | |
c = c[4] || ""; | |
if ("http:" == b && ":80" == c || "https:" == b && ":443" == c) c = ""; | |
return b + "//" + e + c | |
} | |
function v(b) { | |
b = b.replace(ba, "$1/"); | |
if (!b.match(/^(http||https):\/\//)) { | |
var c = "/" === b.substring(0, 1) ? "" : i.pathname; | |
"/" !== c.substring(c.length - 1) && (c = c.substring(0, c.lastIndexOf("/") + 1)); | |
b = i.protocol + "//" + i.host + c + b | |
} | |
for (; P.test(b);) b = b.replace(P, ""); | |
return b | |
} | |
function H(b, c) { | |
var e = "", | |
f = b.indexOf("#"); - 1 !== f && (e = b.substring(f), b = b.substring(0, f)); | |
var f = [], | |
i; | |
for (i in c) c.hasOwnProperty(i) && f.push(i + "=" + w(c[i])); | |
return b + (T ? "#" : -1 == b.indexOf("?") ? "?" : "&") + f.join("&") + e | |
} | |
function D(b) { | |
return "undefined" === typeof b | |
} | |
function z(b, c, e) { | |
var f, i; | |
for (i in c) c.hasOwnProperty(i) && (i in b ? (f = c[i], "object" === typeof f ? z(b[i], f, e) : e || (b[i] = c[i])) : b[i] = c[i]); | |
return b | |
} | |
function B(e) { | |
if (D(Y)) { | |
var f = b.body.appendChild(b.createElement("form")), | |
i = f.appendChild(b.createElement("input")); | |
i.name = c + "TEST" + K; | |
Y = i !== f.elements[i.name]; | |
b.body.removeChild(f) | |
} | |
Y ? f = b.createElement('<iframe name="' + e.props.name + '"/>') : (f = b.createElement("IFRAME"), f.name = e.props.name); | |
f.id = f.name = e.props.name; | |
delete e.props.name; | |
e.onLoad && V(f, "load", e.onLoad); | |
if ("string" == typeof e.container) e.container = b.getElementById(e.container); | |
if (!e.container) z(f.style, { | |
position: "absolute", | |
top: "-2000px" | |
}), e.container = b.body; | |
i = e.props.src; | |
delete e.props.src; | |
z(f, e.props); | |
f.border = f.frameBorder = 0; | |
f.allowTransparency = !0; | |
e.container.appendChild(f); | |
f.src = i; | |
e.props.src = i; | |
return f | |
} | |
function N(c) { | |
var e = c.protocol, | |
j; | |
c.isHost = c.isHost || D(U.xdm_p); | |
T = c.hash || !1; | |
if (!c.props) c.props = {}; | |
if (c.isHost) { | |
if (c.remote = v(c.remote), c.channel = c.channel || "default" + K++, c.secret = Math.random().toString(16).substring(2), D(e)) u(i.href) == u(c.remote) ? e = "4" : q(f, "postMessage") || q(b, "postMessage") ? e = "1" : c.swf && q(f, "ActiveXObject") && t() ? e = "6" : "Gecko" === navigator.product && "frameElement" in f && -1 == navigator.userAgent.indexOf("WebKit") ? e = "5" : c.remoteHelper ? (c.remoteHelper = v(c.remoteHelper), e = "2") : e = "0" | |
} else { | |
c.channel = U.xdm_c; | |
c.secret = U.xdm_s; | |
c.remote = U.xdm_e; | |
var e = U.xdm_p, | |
n; | |
if (n = c.acl) { | |
a: { | |
n = c.acl; | |
var o = c.remote; | |
"string" == typeof n && (n = [n]); | |
for (var p, r = n.length; r--;) if (p = n[r], p = RegExp("^" == p.substr(0, 1) ? p : "^" + p.replace(/(\*)/g, ".$1").replace(/\?/g, ".") + "$"), p.test(o)) { | |
n = !0; | |
break a | |
} | |
n = !1 | |
} | |
n = !n | |
} | |
if (n) throw Error("Access denied for " + c.remote); | |
} | |
c.protocol = e; | |
switch (e) { | |
case "0": | |
z(c, { | |
interval: 100, | |
delay: 2E3, | |
useResize: !0, | |
useParent: !1, | |
usePolling: !1 | |
}, !0); | |
if (c.isHost) { | |
if (!c.local) { | |
e = i.protocol + "//" + i.host; | |
j = b.body.getElementsByTagName("img"); | |
for (o = j.length; o--;) if (n = j[o], n.src.substring(0, e.length) === e) { | |
c.local = n.src; | |
break | |
} | |
if (!c.local) c.local = f | |
} | |
e = { | |
xdm_c: c.channel, | |
xdm_p: 0 | |
}; | |
c.local === f ? (c.usePolling = !0, c.useParent = !0, c.local = i.protocol + "//" + i.host + i.pathname + i.search, e.xdm_e = c.local, e.xdm_pa = 1) : e.xdm_e = v(c.local); | |
if (c.container) c.useResize = !1, e.xdm_po = 1; | |
c.remote = H(c.remote, e) | |
} else z(c, { | |
channel: U.xdm_c, | |
remote: U.xdm_e, | |
useParent: !D(U.xdm_pa), | |
usePolling: !D(U.xdm_po), | |
useResize: c.useParent ? !1 : c.useResize | |
}); | |
j = [new E.stack.HashTransport(c), new E.stack.ReliableBehavior({}), new E.stack.QueueBehavior({ | |
encode: !0, | |
maxLength: 4E3 - c.remote.length | |
}), new E.stack.VerifyBehavior({ | |
initiate: c.isHost | |
})]; | |
break; | |
case "1": | |
j = [new E.stack.PostMessageTransport(c)]; | |
break; | |
case "2": | |
j = [new E.stack.NameTransport(c), new E.stack.QueueBehavior, new E.stack.VerifyBehavior({ | |
initiate: c.isHost | |
})]; | |
break; | |
case "3": | |
j = [new E.stack.NixTransport(c)]; | |
break; | |
case "4": | |
j = [new E.stack.SameOriginTransport(c)]; | |
break; | |
case "5": | |
j = [new E.stack.FrameElementTransport(c)]; | |
break; | |
case "6": | |
X || t(), j = [new E.stack.FlashTransport(c)] | |
} | |
j.push(new E.stack.QueueBehavior({ | |
lazy: c.lazy, | |
remove: !0 | |
})); | |
return j | |
} | |
function F(b) { | |
for (var c, e = { | |
incoming: function (b, c) { | |
this.up.incoming(b, c) | |
}, | |
outgoing: function (b, c) { | |
this.down.outgoing(b, c) | |
}, | |
callback: function (b) { | |
this.up.callback(b) | |
}, | |
init: function () { | |
this.down.init() | |
}, | |
destroy: function () { | |
this.down.destroy() | |
} | |
}, f = 0, i = b.length; f < i; f++) { | |
c = b[f]; | |
z(c, e, !0); | |
if (0 !== f) c.down = b[f - 1]; | |
if (f !== i - 1) c.up = b[f + 1] | |
} | |
return c | |
} | |
function I(b) { | |
b.up.down = b.down; | |
b.down.up = b.up; | |
b.up = b.down = null | |
} | |
var p = this, | |
K = Math.floor(1E4 * Math.random()), | |
s = Function.prototype, | |
J = /^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/, | |
P = /[\-\w]+\/\.\.\//, | |
ba = /([^:])\/\//g, | |
n = "", | |
E = {}, | |
ca = f.easyXDM, | |
c = "easyXDM_", | |
Y, T = !1, | |
X, $, V, qa; | |
if (q(f, "addEventListener")) V = function (b, c, e) { | |
b.addEventListener(c, e, !1) | |
}, qa = function (b, c, e) { | |
b.removeEventListener(c, e, !1) | |
}; | |
else if (q(f, "attachEvent")) V = function (b, c, e) { | |
b.attachEvent("on" + c, e) | |
}, qa = function (b, c, e) { | |
b.detachEvent("on" + c, e) | |
}; | |
else throw Error("Browser not supported"); | |
var ha = !1, | |
Z = [], | |
aa; | |
"readyState" in b ? (aa = b.readyState, ha = "complete" == aa || ~navigator.userAgent.indexOf("AppleWebKit/") && ("loaded" == aa || "interactive" == aa)) : ha = !! b.body; | |
if (!ha) { | |
if (q(f, "addEventListener")) V(b, "DOMContentLoaded", o); | |
else if (V(b, "readystatechange", function () { | |
"complete" == b.readyState && o() | |
}), b.documentElement.doScroll && f === top) { | |
var fa = function () { | |
if (!ha) { | |
try { | |
b.documentElement.doScroll("left") | |
} catch (c) { | |
e(fa, 1); | |
return | |
} | |
o() | |
} | |
}; | |
fa() | |
} | |
V(f, "load", o) | |
} | |
var U = function (b) { | |
for (var b = b.substring(1).split("&"), c = {}, e, f = b.length; f--;) e = b[f].split("="), c[e[0]] = j(e[1]); | |
return c | |
}(/xdm_e=/.test(i.search) ? i.search : i.hash), | |
ra = function () { | |
var b = {}, | |
c = { | |
a: [1, 2, 3] | |
}; | |
if ("undefined" != typeof JSON && "function" === typeof JSON.stringify && '{"a":[1,2,3]}' === JSON.stringify(c).replace(/\s/g, "")) return JSON; | |
if (Object.toJSON && '{"a":[1,2,3]}' === Object.toJSON(c).replace(/\s/g, "")) b.stringify = Object.toJSON; | |
if ("function" === typeof String.prototype.evalJSON && (c = '{"a":[1,2,3]}'.evalJSON(), c.a && 3 === c.a.length && 3 === c.a[2])) b.parse = function (b) { | |
return b.evalJSON() | |
}; | |
return b.stringify && b.parse ? (ra = function () { | |
return b | |
}, b) : null | |
}; | |
z(E, { | |
version: "2.4.15.118", | |
query: U, | |
stack: {}, | |
apply: z, | |
getJSONObject: ra, | |
whenReady: A, | |
noConflict: function (b) { | |
f.easyXDM = ca; | |
(n = b) && (c = "easyXDM_" + n.replace(".", "_") + "_"); | |
return E | |
} | |
}); | |
E.DomHelper = { | |
on: V, | |
un: qa, | |
requiresJSON: function (c) { | |
"object" == typeof f.JSON && f.JSON || b.write('<script type="text/javascript" src="' + c + '"><\/script>') | |
} | |
}; | |
(function () { | |
var b = {}; | |
E.Fn = { | |
set: function (c, e) { | |
b[c] = e | |
}, | |
get: function (c, e) { | |
var f = b[c]; | |
e && delete b[c]; | |
return f | |
} | |
} | |
})(); | |
E.Socket = function (b) { | |
var c = F(N(b).concat([{ | |
incoming: function (c, e) { | |
b.onMessage(c, e) | |
}, | |
callback: function (c) { | |
if (b.onReady) b.onReady(c) | |
} | |
}])), | |
e = u(b.remote); | |
this.origin = u(b.remote); | |
this.destroy = function () { | |
c.destroy() | |
}; | |
this.postMessage = function (b) { | |
c.outgoing(b, e) | |
}; | |
c.init() | |
}; | |
E.Rpc = function (b, c) { | |
if (c.local) for (var e in c.local) if (c.local.hasOwnProperty(e)) { | |
var f = c.local[e]; | |
"function" === typeof f && (c.local[e] = { | |
method: f | |
}) | |
} | |
var i = F(N(b).concat([new E.stack.RpcBehavior(this, c), | |
{ | |
callback: function (c) { | |
if (b.onReady) b.onReady(c) | |
} | |
}])); | |
this.origin = u(b.remote); | |
this.destroy = function () { | |
i.destroy() | |
}; | |
i.init() | |
}; | |
E.stack.SameOriginTransport = function (b) { | |
var f, j, n, o; | |
return f = { | |
outgoing: function (b, c, e) { | |
n(b); | |
e && e() | |
}, | |
destroy: function () { | |
j && (j.parentNode.removeChild(j), j = null) | |
}, | |
onDOMReady: function () { | |
o = u(b.remote); | |
b.isHost ? (z(b.props, { | |
src: H(b.remote, { | |
xdm_e: i.protocol + "//" + i.host + i.pathname, | |
xdm_c: b.channel, | |
xdm_p: 4 | |
}), | |
name: c + b.channel + "_provider" | |
}), j = B(b), E.Fn.set(b.channel, function (b) { | |
n = b; | |
e(function () { | |
f.up.callback(!0) | |
}, 0); | |
return function (b) { | |
f.up.incoming(b, o) | |
} | |
})) : (n = x().Fn.get(b.channel, !0)(function (b) { | |
f.up.incoming(b, o) | |
}), e(function () { | |
f.up.callback(!0) | |
}, 0)) | |
}, | |
init: function () { | |
A(f.onDOMReady, f) | |
} | |
} | |
}; | |
E.stack.FlashTransport = function (f) { | |
function j(b) { | |
e(function () { | |
r.up.incoming(b, s) | |
}, 0) | |
} | |
function o(c) { | |
var e = f.swf + "?host=" + f.isHost, | |
i = "easyXDM_swf_" + Math.floor(1E4 * Math.random()); | |
E.Fn.set("flash_loaded" + c.replace(/[\-.]/g, "_"), function () { | |
E.stack.FlashTransport[c].swf = w = t.firstChild; | |
for (var b = E.stack.FlashTransport[c].queue, e = 0; e < b.length; e++) b[e](); | |
b.length = 0 | |
}); | |
f.swfContainer ? t = "string" == typeof f.swfContainer ? b.getElementById(f.swfContainer) : f.swfContainer : (t = b.createElement("div"), z(t.style, $ && f.swfNoThrottle ? { | |
height: "20px", | |
width: "20px", | |
position: "fixed", | |
right: 0, | |
top: 0 | |
} : { | |
height: "1px", | |
width: "1px", | |
position: "absolute", | |
overflow: "hidden", | |
right: 0, | |
top: 0 | |
}), b.body.appendChild(t)); | |
var k = "callback=flash_loaded" + c.replace(/[\-.]/g, "_") + "&proto=" + p.location.protocol + "&domain=" + p.location.href.match(J)[3] + "&port=" + (p.location.href.match(J)[4] || "") + "&ns=" + n; | |
t.innerHTML = "<object height='20' width='20' type='application/x-shockwave-flash' id='" + i + "' data='" + e + "'><param name='allowScriptAccess' value='always'></param><param name='wmode' value='transparent'><param name='movie' value='" + e + "'></param><param name='flashvars' value='" + k + "'></param><embed type='application/x-shockwave-flash' FlashVars='" + k + "' allowScriptAccess='always' wmode='transparent' src='" + e + "' height='1' width='1'></embed></object>" | |
} | |
var r, q, s, w, t; | |
return r = { | |
outgoing: function (b, c, e) { | |
w.postMessage(f.channel, b.toString()); | |
e && e() | |
}, | |
destroy: function () { | |
try { | |
w.destroyChannel(f.channel) | |
} catch (b) {} | |
w = null; | |
q && (q.parentNode.removeChild(q), q = null) | |
}, | |
onDOMReady: function () { | |
s = f.remote; | |
E.Fn.set("flash_" + f.channel + "_init", function () { | |
e(function () { | |
r.up.callback(!0) | |
}) | |
}); | |
E.Fn.set("flash_" + f.channel + "_onMessage", j); | |
f.swf = v(f.swf); | |
var b = f.swf.match(J)[3], | |
n = function () { | |
E.stack.FlashTransport[b].init = !0; | |
w = E.stack.FlashTransport[b].swf; | |
w.createChannel(f.channel, f.secret, u(f.remote), f.isHost); | |
f.isHost && ($ && f.swfNoThrottle && z(f.props, { | |
position: "fixed", | |
right: 0, | |
top: 0, | |
height: "20px", | |
width: "20px" | |
}), z(f.props, { | |
src: H(f.remote, { | |
xdm_e: u(i.href), | |
xdm_c: f.channel, | |
xdm_p: 6, | |
xdm_s: f.secret | |
}), | |
name: c + f.channel + "_provider" | |
}), q = B(f)) | |
}; | |
E.stack.FlashTransport[b] && E.stack.FlashTransport[b].init ? n() : E.stack.FlashTransport[b] ? E.stack.FlashTransport[b].queue.push(n) : (E.stack.FlashTransport[b] = { | |
queue: [n] | |
}, o(b)) | |
}, | |
init: function () { | |
A(r.onDOMReady, r) | |
} | |
} | |
}; | |
E.stack.PostMessageTransport = function (b) { | |
function j(c) { | |
var e; | |
if (c.origin) e = u(c.origin); | |
else if (c.uri) e = u(c.uri); | |
else if (c.domain) e = i.protocol + "//" + c.domain; | |
else throw "Unable to retrieve the origin of the event"; | |
e == r && c.data.substring(0, b.channel.length + 1) == b.channel + " " && n.up.incoming(c.data.substring(b.channel.length + 1), e) | |
} | |
var n, o, p, r; | |
return n = { | |
outgoing: function (c, e, f) { | |
p.postMessage(b.channel + " " + c, e || r); | |
f && f() | |
}, | |
destroy: function () { | |
qa(f, "message", j); | |
o && (p = null, o.parentNode.removeChild(o), o = null) | |
}, | |
onDOMReady: function () { | |
r = u(b.remote); | |
if (b.isHost) { | |
var q = function (c) { | |
c.data == b.channel + "-ready" && (p = "postMessage" in o.contentWindow ? o.contentWindow : o.contentWindow.document, qa(f, "message", q), V(f, "message", j), e(function () { | |
n.up.callback(!0) | |
}, 0)) | |
}; | |
V(f, "message", q); | |
z(b.props, { | |
src: H(b.remote, { | |
xdm_e: u(i.href), | |
xdm_c: b.channel, | |
xdm_p: 1 | |
}), | |
name: c + b.channel + "_provider" | |
}); | |
o = B(b) | |
} else V(f, "message", j), p = "postMessage" in f.parent ? f.parent : f.parent.document, p.postMessage(b.channel + "-ready", r), e(function () { | |
n.up.callback(!0) | |
}, 0) | |
}, | |
init: function () { | |
A(n.onDOMReady, n) | |
} | |
} | |
}; | |
E.stack.FrameElementTransport = function (l) { | |
var j, n, o, p; | |
return j = { | |
outgoing: function (b, c, e) { | |
o.call(this, b); | |
e && e() | |
}, | |
destroy: function () { | |
n && (n.parentNode.removeChild(n), n = null) | |
}, | |
onDOMReady: function () { | |
p = u(l.remote); | |
if (l.isHost) z(l.props, { | |
src: H(l.remote, { | |
xdm_e: u(i.href), | |
xdm_c: l.channel, | |
xdm_p: 5 | |
}), | |
name: c + l.channel + "_provider" | |
}), n = B(l), n.fn = function (b) { | |
delete n.fn; | |
o = b; | |
e(function () { | |
j.up.callback(!0) | |
}, 0); | |
return function (b) { | |
j.up.incoming(b, p) | |
} | |
}; | |
else { | |
if (b.referrer && u(b.referrer) != U.xdm_e) f.top.location = U.xdm_e; | |
o = f.frameElement.fn(function (b) { | |
j.up.incoming(b, p) | |
}); | |
j.up.callback(!0) | |
} | |
}, | |
init: function () { | |
A(j.onDOMReady, j) | |
} | |
} | |
}; | |
E.stack.NameTransport = function (b) { | |
function f(c) { | |
p.contentWindow.sendMessage(c, b.remoteHelper + (o ? "#_3" : "#_2") + b.channel) | |
} | |
function i() { | |
o ? (2 === ++q || !o) && n.up.callback(!0) : (f("ready"), n.up.callback(!0)) | |
} | |
function k(b) { | |
n.up.incoming(b, w) | |
} | |
function j() { | |
s && e(function () { | |
s(!0) | |
}, 0) | |
} | |
var n, o, p, r, q, s, w, t; | |
return n = { | |
outgoing: function (b, c, e) { | |
s = e; | |
f(b) | |
}, | |
destroy: function () { | |
p.parentNode.removeChild(p); | |
p = null; | |
o && (r.parentNode.removeChild(r), r = null) | |
}, | |
onDOMReady: function () { | |
o = b.isHost; | |
q = 0; | |
w = u(b.remote); | |
b.local = v(b.local); | |
o ? (E.Fn.set(b.channel, function (c) { | |
o && "ready" === c && (E.Fn.set(b.channel, k), i()) | |
}), t = H(b.remote, { | |
xdm_e: b.local, | |
xdm_c: b.channel, | |
xdm_p: 2 | |
}), z(b.props, { | |
src: t + "#" + b.channel, | |
name: c + b.channel + "_provider" | |
}), r = B(b)) : (b.remoteHelper = b.remote, E.Fn.set(b.channel, k)); | |
p = B({ | |
props: { | |
src: b.local + "#_4" + b.channel | |
}, | |
onLoad: function Wa() { | |
var c = p || this; | |
qa(c, "load", Wa); | |
E.Fn.set(b.channel + "_load", j); | |
(function wa() { | |
"function" == typeof c.contentWindow.sendMessage ? i() : e(wa, 50) | |
})() | |
} | |
}) | |
}, | |
init: function () { | |
A(n.onDOMReady, n) | |
} | |
} | |
}; | |
E.stack.HashTransport = function (b) { | |
function i() { | |
if (q) { | |
var b = q.location.href, | |
c = "", | |
e = b.indexOf("#"); - 1 != e && (c = b.substring(e)); | |
c && c != p && (p = c, k.up.incoming(p.substring(p.indexOf("_") + 1), w)) | |
} | |
} | |
var k, j, n, o, p, r, q, v, s, w; | |
return k = { | |
outgoing: function (c) { | |
if (v) c = b.remote + "#" + r+++"_" + c, (j || !s ? v.contentWindow : v).location = c | |
}, | |
destroy: function () { | |
f.clearInterval(n); | |
(j || !s) && v.parentNode.removeChild(v); | |
v = null | |
}, | |
onDOMReady: function () { | |
j = b.isHost; | |
o = b.interval; | |
p = "#" + b.channel; | |
r = 0; | |
s = b.useParent; | |
w = u(b.remote); | |
if (j) { | |
b.props = { | |
src: b.remote, | |
name: c + b.channel + "_provider" | |
}; | |
if (s) b.onLoad = function () { | |
q = f; | |
n = setInterval(i, o); | |
k.up.callback(!0) | |
}; | |
else { | |
var A = 0, | |
t = b.delay / 50; | |
(function Pa() { | |
if (++A > t) throw Error("Unable to reference listenerwindow"); | |
try { | |
q = v.contentWindow.frames[c + b.channel + "_consumer"] | |
} catch (f) {} | |
q ? (n = setInterval(i, o), k.up.callback(!0)) : e(Pa, 50) | |
})() | |
} | |
v = B(b) | |
} else q = f, n = setInterval(i, o), s ? (v = parent, k.up.callback(!0)) : (z(b, { | |
props: { | |
src: b.remote + "#" + b.channel + new Date, | |
name: c + b.channel + "_consumer" | |
}, | |
onLoad: function () { | |
k.up.callback(!0) | |
} | |
}), v = B(b)) | |
}, | |
init: function () { | |
A(k.onDOMReady, k) | |
} | |
} | |
}; | |
E.stack.ReliableBehavior = function () { | |
var b, c, e = 0, | |
f = 0, | |
i = ""; | |
return b = { | |
incoming: function (k, j) { | |
var n = k.indexOf("_"), | |
o = k.substring(0, n).split(","), | |
k = k.substring(n + 1); | |
o[0] == e && (i = "", c && c(!0)); | |
0 < k.length && (b.down.outgoing(o[1] + "," + e + "_" + i, j), f != o[1] && (f = o[1], b.up.incoming(k, j))) | |
}, | |
outgoing: function (k, j, n) { | |
i = k; | |
c = n; | |
b.down.outgoing(f + "," + ++e + "_" + k, j) | |
} | |
} | |
}; | |
E.stack.QueueBehavior = function (b) { | |
function c() { | |
if (b.remove && 0 === i.length) I(f); | |
else if (!k && !(0 === i.length || o)) { | |
k = !0; | |
var j = i.shift(); | |
f.down.outgoing(j.data, j.origin, function (b) { | |
k = !1; | |
j.callback && e(function () { | |
j.callback(b) | |
}, 0); | |
c() | |
}) | |
} | |
} | |
var f, i = [], | |
k = !0, | |
n = "", | |
o, p = 0, | |
q = !1, | |
u = !1; | |
return f = { | |
init: function () { | |
D(b) && (b = {}); | |
if (b.maxLength) p = b.maxLength, u = !0; | |
b.lazy ? q = !0 : f.down.init() | |
}, | |
callback: function (b) { | |
k = !1; | |
var e = f.up; | |
c(); | |
e.callback(b) | |
}, | |
incoming: function (c, e) { | |
if (u) { | |
var i = c.indexOf("_"), | |
k = parseInt(c.substring(0, i), 10); | |
n += c.substring(i + 1); | |
0 === k && (b.encode && (n = j(n)), f.up.incoming(n, e), n = "") | |
} else f.up.incoming(c, e) | |
}, | |
outgoing: function (e, k, j) { | |
b.encode && (e = w(e)); | |
var n = [], | |
o; | |
if (u) { | |
for (; 0 !== e.length;) o = e.substring(0, p), e = e.substring(o.length), n.push(o); | |
for (; o = n.shift();) i.push({ | |
data: n.length + "_" + o, | |
origin: k, | |
callback: 0 === n.length ? j : null | |
}) | |
} else i.push({ | |
data: e, | |
origin: k, | |
callback: j | |
}); | |
q ? f.down.init() : c() | |
}, | |
destroy: function () { | |
o = !0; | |
f.down.destroy() | |
} | |
} | |
}; | |
E.stack.VerifyBehavior = function (b) { | |
function c() { | |
f = Math.random().toString(16).substring(2); | |
e.down.outgoing(f) | |
} | |
var e, f, i; | |
return e = { | |
incoming: function (k, j) { | |
var n = k.indexOf("_"); - 1 === n ? k === f ? e.up.callback(!0) : i || (i = k, b.initiate || c(), e.down.outgoing(k)) : k.substring(0, n) === i && e.up.incoming(k.substring(n + 1), j) | |
}, | |
outgoing: function (b, c, i) { | |
e.down.outgoing(f + "_" + b, c, i) | |
}, | |
callback: function () { | |
b.initiate && c() | |
} | |
} | |
}; | |
E.stack.RpcBehavior = function (b, c) { | |
function e(b) { | |
b.jsonrpc = "2.0"; | |
k.down.outgoing(j.stringify(b)) | |
} | |
function f(b, c) { | |
var i = Array.prototype.slice; | |
return function () { | |
var f = arguments.length, | |
k, j = { | |
method: c | |
}; | |
0 < f && "function" === typeof arguments[f - 1] ? (1 < f && "function" === typeof arguments[f - 2] ? (k = { | |
success: arguments[f - 2], | |
error: arguments[f - 1] | |
}, j.params = i.call(arguments, 0, f - 2)) : (k = { | |
success: arguments[f - 1] | |
}, j.params = i.call(arguments, 0, f - 1)), o["" + ++n] = k, j.id = n) : j.params = i.call(arguments, 0); | |
if (b.namedParams && 1 === j.params.length) j.params = j.params[0]; | |
e(j) | |
} | |
} | |
function i(b, c, f, k) { | |
if (f) { | |
var j, l; | |
c ? (j = function (b) { | |
j = s; | |
e({ | |
id: c, | |
result: b | |
}) | |
}, l = function (b, f) { | |
l = s; | |
var i = { | |
id: c, | |
error: { | |
code: -32099, | |
message: b | |
} | |
}; | |
if (f) i.error.data = f; | |
e(i) | |
}) : j = l = s; | |
"[object Array]" === Object.prototype.toString.call(k) || (k = [k]); | |
try { | |
var n = f.method.apply(f.scope, k.concat([j, l])); | |
D(n) || j(n) | |
} catch (o) { | |
l(o.message) | |
} | |
} else c && e({ | |
id: c, | |
error: { | |
code: -32601, | |
message: "Procedure not found." | |
} | |
}) | |
} | |
var k, j = c.serializer || ra(), | |
n = 0, | |
o = {}; | |
return k = { | |
incoming: function (b) { | |
b = j.parse(b); | |
if (b.method) c.handle ? c.handle(b, e) : i(b.method, b.id, c.local[b.method], b.params); | |
else { | |
var f = o[b.id]; | |
b.error ? f.error && f.error(b.error) : f.success && f.success(b.result); | |
delete o[b.id] | |
} | |
}, | |
init: function () { | |
if (c.remote) for (var e in c.remote) c.remote.hasOwnProperty(e) && (b[e] = f(c.remote[e], e)); | |
k.down.init() | |
}, | |
destroy: function () { | |
for (var e in c.remote) c.remote.hasOwnProperty(e) && b.hasOwnProperty(e) && delete b[e]; | |
k.down.destroy() | |
} | |
} | |
}; | |
p.easyXDM = E | |
})(F, document, location, F.setTimeout, decodeURIComponent, encodeURIComponent); | |
(function (f, b, i, e) { | |
f.fn.caret = function (j, w) { | |
var q, t, o = this[0], | |
A = f.browser.msie; | |
if ("object" === typeof j && "number" === typeof j.start && "number" === typeof j.end) q = j.start, t = j.end; | |
else if ("number" === typeof j && "number" === typeof w) q = j, t = w; | |
else if ("string" === typeof j) - 1 < (q = o.value.indexOf(j)) ? t = q + j[b] : q = null; | |
else if ("[object RegExp]" === Object.prototype.toString.call(j)) { | |
var x = j.exec(o.value); | |
if (null != x) q = x.index, t = q + x[0][b] | |
} | |
if ("undefined" != typeof q) return A ? (A = this[0].createTextRange(), A.collapse(!0), A.moveStart("character", q), A.moveEnd("character", t - q), A.select()) : (this[0].selectionStart = q, this[0].selectionEnd = t), this[0].focus(), this; | |
if (A) { | |
t = document.selection; | |
var u, v; | |
"textarea" != this[0].tagName.toLowerCase() ? (A = this.val(), q = t[i]()[e](), q.moveEnd("character", A[b]), u = "" == q.text ? A[b] : A.lastIndexOf(q.text), q = t[i]()[e](), q.moveStart("character", -A[b]), v = q.text[b]) : (q = t[i](), t = q[e](), t.moveToElementText(this[0]), t.setEndPoint("EndToEnd", q), u = t.text[b] - q.text[b], v = u + q.text[b]) | |
} else u = o.selectionStart, v = o.selectionEnd; | |
q = o.value.substring(u, v); | |
return { | |
start: u, | |
end: v, | |
text: q, | |
replace: function (e) { | |
return o.value.substring(0, u) + e + o.value.substring(v, o.value[b]) | |
} | |
} | |
} | |
})(j, "length", "createRange", "duplicate"); | |
(function (f, b) { | |
f.fn.allParents = function () { | |
if (!this.length) return f([]); | |
for (var i = f(this[0]), e = i.parents(), i = i[0].ownerDocument; i !== b;) i = (i.parentWindow || i.defaultView).frameElement, e.push(i), Array.prototype.push.apply(e, f(i).parents().toArray()), i = i.ownerDocument; | |
return e | |
} | |
})(j, document); | |
(function (f, b) { | |
f.fn.bgPosition = function () { | |
return b.defaultView && b.defaultView.getComputedStyle ? this.css("background-position") : !this[0] || !this[0].currentStyle ? "0 0" : this[0].currentStyle.backgroundPositionX + " " + this[0].currentStyle.backgroundPositionY | |
} | |
})(j, document); | |
(function (f, b) { | |
function i(b, e, f) { | |
for (var k = b.constructor, f = { | |
notImportant: !f | |
}, j = 0; j < b.length; j++) for (var q in e) e.hasOwnProperty(q) && k.style(b[j], q, e[q], f) | |
} | |
b.reset = { | |
shared: { | |
"background-image": "none", | |
"background-origin": "padding-box", | |
"background-size": "auto", | |
"border-spacing": "0", | |
border: "0 solid black", | |
"border-image": "none", | |
bottom: "auto", | |
clear: "none", | |
color: "#CFCFCF", | |
content: "normal", | |
crop: "auto", | |
cursor: "auto", | |
direction: "ltr", | |
"float": "none", | |
"font-family": '"Lucida Grande", Arial, sans-serif', | |
"font-size": "13px", | |
"font-size-adjust": "none", | |
"font-stretch": "normal", | |
"font-style": "normal", | |
"font-variant": "normal", | |
"font-weight": "normal", | |
height: "auto", | |
left: "auto", | |
"letter-spacing": "normal", | |
"line-break": "auto", | |
"line-height": "normal", | |
"margin-bottom": "0", | |
"margin-left": "0", | |
"margin-right": "0", | |
"margin-top": "0", | |
"max-height": "none", | |
"max-width": "none", | |
"min-height": "none", | |
"min-width": "none", | |
"outline-color": "invert", | |
"outline-style": "none", | |
"outline-width": "medium", | |
"overflow-wrap": "normal", | |
"padding-bottom": "0", | |
"padding-left": "0", | |
"padding-right": "0", | |
"padding-top": "0", | |
position: "static", | |
quotes: "none", | |
right: "auto", | |
"text-autospace": "none", | |
"text-decoration": "none", | |
"text-outline": "none", | |
"text-overflow": "clip", | |
"text-shadow": "none", | |
"text-transform": "none", | |
"text-wrap": "none", | |
top: "auto", | |
"unicode-bidi": "normal", | |
visibility: "visible", | |
"white-space": "normal", | |
width: "auto", | |
"word-break": "normal", | |
"word-spacing": "normal", | |
"z-index": "auto" | |
}, | |
block: { | |
display: "block", | |
overflow: "visible", | |
"overflow-clip": "auto", | |
"overflow-style": "auto", | |
"overflow-x": "visible", | |
"overflow-y": "visible", | |
"text-align": "left", | |
"text-indent": "0", | |
widows: "2" | |
}, | |
inline: { | |
display: "inline", | |
"vertical-align": "baseline" | |
}, | |
table: { | |
"border-collapse": "separate", | |
"table-layout": "auto", | |
display: "table" | |
}, | |
tableCell: { | |
"empty-cells": "show", | |
"vertical-align": "baseline", | |
display: "table-cell" | |
}, | |
tableRow: { | |
display: "table-row" | |
}, | |
list: { | |
"list-style-image": "none", | |
"list-style-position": "outside", | |
"list-style-type": "disc" | |
}, | |
link: { | |
cursor: "pointer" | |
}, | |
listItem: { | |
display: "list-item" | |
}, | |
textInput: { | |
cursor: "text" | |
} | |
}; | |
var e = ["moz", "webkit", "o", "ms"], | |
j = { | |
"border-top-left-radius": 0, | |
"border-top-right-radius": 0, | |
"border-bottom-left-radius": 0, | |
"border-bottom-right-radius": 0, | |
"box-shadow": "none" | |
}, | |
w; | |
for (w in j) { | |
b.reset.shared[w] = j[w]; | |
for (var q = 0; q < e.length; q++) j.hasOwnProperty(w) && (b.reset.shared["-" + e[q] + "-" + w] = j[w]) | |
} | |
if (b.support.opacity) b.reset.shared.opacity = "1", b.reset.shared["background-color"] = "transparent", b.reset.shared["background-attachment"] = "scroll", b.reset.shared["background-position"] = "0 0", b.reset.shared["background-image"] = "none", b.reset.shared["background-repeat"] = "repeat"; | |
b.fn.applyBlockStyles = function () { | |
var e = b.extend({}, b.reset.shared, b.reset.block); | |
i(this, e, !1); | |
return this | |
}; | |
b.fn.applyInlineStyles = function () { | |
var e = b.extend({}, b.reset.shared, b.reset.inline); | |
i(this, e, !1); | |
return this | |
}; | |
b.fn.applyTableStyles = function () { | |
this.applyBlockStyles(); | |
i(this, b.reset.table, !1); | |
return this | |
}; | |
b.fn.applyTableCellStyles = function () { | |
this.applyBlockStyles(); | |
i(this, b.reset.tableCell, !1); | |
return this | |
}; | |
b.fn.applyTableRowStyles = function () { | |
this.applyBlockStyles(); | |
i(this, b.reset.tableRow, !1); | |
return this | |
}; | |
b.fn.applyListStyles = function () { | |
this.applyBlockStyles(); | |
i(this, b.reset.list, !1); | |
return this | |
}; | |
b.fn.applyLinkStyles = function () { | |
this.applyInlineStyles(); | |
i(this, b.reset.link, !1); | |
return this | |
}; | |
b.fn.applyListItemStyles = function () { | |
this.applyBlockStyles(); | |
i(this, b.reset.listItem, !1); | |
return this | |
}; | |
b.fn.applyTextInputStyles = function () { | |
this.applyInlineStyles(); | |
i(this, b.reset.textInput, !1); | |
return this | |
}; | |
b.fn.cssImportant = function (b, e) { | |
return this.css(b, e, !0) | |
} | |
})(F, j); | |
(function (f, b) { | |
b.htmlEncode = function (f) { | |
return b("<div/>").text(f || "").html() | |
}; | |
b.htmlDecode = function (f) { | |
return b("<div/>").html(f || "").text() | |
} | |
})(F, j); | |
(function (f) { | |
f.fn.trueCoordinates = function (b) { | |
if (!b) return { | |
left: parseFloat(this.attr("clipboard_left")), | |
top: parseFloat(this.attr("clipboard_top")) | |
}; | |
this.attr("clipboard_left", b.left).attr("clipboard_top", b.top); | |
return this | |
}; | |
f.fn.removeTrueCoordinates = function () { | |
return this.removeAttr("clipboard_left").removeAttr("clipboard_top") | |
} | |
})(j); | |
(function (f, b) { | |
f.fn.trueOffset = function () { | |
for (var i = this.offset(), e = this[0].ownerDocument; e !== b;) { | |
var e = (e.parentWindow || e.defaultView).frameElement, | |
j = f(e).offset(); | |
i.left += j.left; | |
i.top += j.top; | |
e = e.ownerDocument | |
} | |
return i | |
} | |
})(j, document); | |
(function () { | |
function f(b) { | |
return 10 > b ? "0" + b : b | |
} | |
function b(b) { | |
j.lastIndex = 0; | |
return j.test(b) ? '"' + b.replace(j, function (b) { | |
var e = t[b]; | |
return "string" === typeof e ? e : "\\u" + ("0000" + b.charCodeAt(0).toString(16)).slice(-4) | |
}) + '"' : '"' + b + '"' | |
} | |
function i(e, f) { | |
var j, r, t, D, z = w, | |
B, x = f[e]; | |
x && "object" === typeof x && "function" === typeof x.toJSON && (x = x.toJSON(e)); | |
"function" === typeof o && (x = o.call(f, e, x)); | |
switch (typeof x) { | |
case "string": | |
return b(x); | |
case "number": | |
return isFinite(x) ? "" + x : "null"; | |
case "boolean": | |
case "null": | |
return "" + x; | |
case "object": | |
if (!x) return "null"; | |
w += q; | |
B = []; | |
if ("[object Array]" === Object.prototype.toString.apply(x)) { | |
D = x.length; | |
for (j = 0; j < D; j += 1) B[j] = i(j, x) || "null"; | |
t = 0 === B.length ? "[]" : w ? "[\n" + w + B.join(",\n" + w) + "\n" + z + "]" : "[" + B.join(",") + "]"; | |
w = z; | |
return t | |
} | |
if (o && "object" === typeof o) { | |
D = o.length; | |
for (j = 0; j < D; j += 1) r = o[j], "string" === typeof r && (t = i(r, x)) && B.push(b(r) + (w ? ": " : ":") + t) | |
} else for (r in x) Object.hasOwnProperty.call(x, r) && (t = i(r, x)) && B.push(b(r) + (w ? ": " : ":") + t); | |
t = 0 === B.length ? "{}" : w ? "{\n" + w + B.join(",\n" + w) + "\n" + z + "}" : "{" + B.join(",") + "}"; | |
w = z; | |
return t | |
} | |
} | |
if ("function" !== typeof Date.prototype.toJSON) Date.prototype.toJSON = function () { | |
return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null | |
}, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () { | |
return this.valueOf() | |
}; | |
var e = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, | |
j = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, | |
w, q, t = { | |
"\u0008": "\\b", | |
"\t": "\\t", | |
"\n": "\\n", | |
"\u000c": "\\f", | |
"\r": "\\r", | |
'"': '\\"', | |
"\\": "\\\\" | |
}, | |
o; | |
if ("function" !== typeof F.CLIPBOARD.JSON.stringify) F.CLIPBOARD.JSON.stringify = function (b, e, f) { | |
var j; | |
q = w = ""; | |
if ("number" === typeof f) for (j = 0; j < f; j += 1) q += " "; | |
else "string" === typeof f && (q = f); | |
if ((o = e) && "function" !== typeof e && ("object" !== typeof e || "number" !== typeof e.length)) throw Error("JSON.stringify"); | |
return i("", { | |
"": b | |
}) | |
}; | |
if ("function" !== typeof F.CLIPBOARD.JSON.parse) F.CLIPBOARD.JSON.parse = function (b, f) { | |
function i(b, e) { | |
var j, k, o = b[e]; | |
if (o && "object" === typeof o) for (j in o) Object.hasOwnProperty.call(o, j) && (k = i(o, j), void 0 !== k ? o[j] = k : delete o[j]); | |
return f.call(b, e, o) | |
} | |
var j, b = "" + b; | |
e.lastIndex = 0; | |
e.test(b) && (b = b.replace(e, function (b) { | |
return "\\u" + ("0000" + b.charCodeAt(0).toString(16)).slice(-4) | |
})); | |
if (/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + b + ")"), "function" === typeof f ? i({ | |
"": j | |
}, "") : j; | |
throw new SyntaxError("JSON.parse"); | |
} | |
})() | |
})(); | |
this.xdm = i.xdm = F.easyXDM; | |
if (this.domain !== F.location.host) this.xdm = this.xdm.noConflict(x.util.idSuffix); | |
this.$("head").append(this.$("<link/>").attr({ | |
type: "text/css", | |
rel: "stylesheet", | |
href: this.staticBaseUrl + "/css/1.1.17/clipper.css" | |
})); | |
this.trigger("initialized"); | |
return !0 | |
} | |
function K(i, j) { | |
j = x.util.merge(x.util.merge({}, Za), j); | |
this.scope = i || F.document.documentElement; | |
this.document = this.scope.ownerDocument; | |
this.documentId = Ja(this.document); | |
this.preferences = {}; | |
this.allowedMetrics = j.allowedMetrics; | |
this.baseUri = F.location.protocol + "//" + F.CLIPBOARD.config.baseUrl + "/"; | |
this.staticBaseUrl = F.CLIPBOARD.config.staticBaseUrl; | |
this.domain = F.CLIPBOARD.config.baseUrl; | |
this.instanceId = j.instanceId; | |
this.origin = j.origin || "default"; | |
this.bookmarkletVersion = j.bookmarkletVersion; | |
if (0 > this.documentId) ba.push(this.document), this.documentId = ba.length - 1; | |
this.user = { | |
guid: "", | |
sessionId: "" | |
}; | |
var t; | |
if (t = /^(https?):\/\/www\.clipboard\.com\//.exec(this.baseUri)) this.baseUri = t[1] + "://clipboard.com/"; | |
if (!/^http/.test(this.staticBaseUrl)) this.staticBaseUrl = F.location.protocol + this.staticBaseUrl; | |
ca[this.documentId] || (ca[this.documentId] = { | |
env: { | |
iHatePrototype: za(this.document) | |
}, | |
baseData: {}, | |
$: null, | |
bodyOffset: {} | |
}); | |
this.$ = ca[this.documentId].$; | |
this.env = ca[this.documentId].env; | |
this.baseData = ca[this.documentId].baseData; | |
this.support = Z; | |
this.defaultTitle = x.util.trim(this.document.title) || this.document.location.href; | |
Oa.call(this); | |
if (!this.support) this.support = Z = { | |
rgba: La(this.$), | |
dpi: Ma(this.$), | |
regexSplit: 3 === "x y".split(/(\s)/).length | |
}; | |
t = { | |
$: this.$, | |
xdm: this.xdm, | |
document: this.document, | |
baseUri: this.baseUri, | |
baseData: this.baseData, | |
bodyOffset: this.bodyOffset, | |
support: this.support, | |
preferences: this.preferences, | |
staticBaseUrl: this.staticBaseUrl, | |
domain: this.domain, | |
origin: this.origin | |
}; | |
this.ui = j.createUiThunk(t); | |
this.dao = new x.DataAccess(this.baseUri, this.$.ajax, this.xdm); | |
this.controls = [this.ui]; | |
this.selectors = j.populateSelectorsThunk(t); | |
this.extractors = {}; | |
for (var f in this.selectors) this.selectors.hasOwnProperty(f) && (this.extractors[f] = this.selectors[f].getExtractor()); | |
if (x.extractors.BookmarkExtractor) this.extractors.bookmark = new x.extractors.BookmarkExtractor(t); | |
Ia.call(this); | |
this.on("activated", function () { | |
this.activeSelector ? X.call(this, this.activeSelector.type, !0) : this.dao.fetchUserData() | |
}); | |
this.env.iHatePrototype.stupidFuckingPrototype && I.call(this, "info", { | |
data: "badPrototypeVersion" | |
}); | |
K.instances[this.origin] || (K.instances[this.origin] = {}); | |
K.instances[this.origin][this.instanceId] = this; | |
"function" === typeof j.debug && j.debug(this) | |
} | |
Z = void 0; | |
var ca = {}, | |
ba = [], | |
x = F.CLIPBOARD.client, | |
Y = "rectangle", | |
Za = { | |
populateSelectorsThunk: function (i) { | |
return { | |
text: new x.selectors.TextSelector(i), | |
rectangle: new x.selectors.RectangleSelector(i) | |
} | |
}, | |
createUiThunk: function (i) { | |
return new x.ui.WidgetUiController(i) | |
}, | |
allowedMetrics: null | |
}; | |
K.instances = {}; | |
K.checkedLoginStatus = !1; | |
x.util.inherit(K, new x.ActivatableControl, new x.EventEmitter); | |
K.prototype.constructor = K; | |
K.prototype.createClip = function () { | |
var i = { | |
source: F.location.href, | |
date: (new Date).toString(), | |
type: "clip", | |
version: "0.1", | |
title: "", | |
html: "", | |
text: "", | |
annotation: "", | |
width: 0, | |
height: 0, | |
top: null, | |
left: null, | |
"private": !0 | |
}; | |
return function (j) { | |
return x.util.merge(x.util.merge({}, x.util.merge(i, { | |
title: this.defaultTitle | |
})), j) | |
} | |
}(); | |
K.prototype.shouldLogMetric = function (i) { | |
return !this.allowedMetrics || this.allowedMetrics[i] | |
}; | |
K.prototype.setActiveSelectorByContext = function () { | |
for (var i in this.selectors) if (this.selectors.hasOwnProperty(i) && this.selectors[i].shouldUseAsDefault()) { | |
this.setActiveSelector(i); | |
break | |
} | |
}; | |
K.prototype.setActiveSelector = function (i) { | |
if (this.selectors[i] && this.activeSelector !== this.selectors[i]) this.activeSelector && (this.activeSelector.deactivate(), this.removeControl(this.activeSelector)), this.activeSelector = this.selectors[i], this.controls.push(this.activeSelector) | |
}; | |
K.prototype.doActivate = function () { | |
var i = !0; | |
return function () { | |
i ? i = !1 : this.trigger("reloaded") | |
} | |
}(); | |
x.Clipper = K | |
})(window); | |
/* | |
clipboard.com JS | |
This is the clipboard.com bookmarklet - don't f with this | |
//= require clipper/Clipper.js | |
//= require clipper/extractors/HtmlExtractor.js | |
//= require clipper/extractors/TextExtractor.js | |
//= require clipper/extractors/bookmarkExtractor.js | |
//= require clipper/selectors/RectangleSelector.js | |
//= require clipper/selectors/TextSelector.js | |
//= require clipper/ui/WidgetUiController.js | |
//= require clipper/ui/NoOpUiController.js | |
@@ end */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment