Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dropFunction(n) {
- n.stopPropagation();
- n.preventDefault();
- var i = n.dataTransfer.getData("text/html"),
- t;
- t = $(i).children().length > 0 ? $(i).attr("href") : $(i).attr("href");
- t != null ? window.location.replace("/submit?linkpost=true&url=" + t) : (t = $(i).attr("src"), t != null && window.location.replace("/submit?linkpost=true&url=" + t));
- $("#share-a-link-overlay").hide()
- }
- function click_voting() {
- $(this).toggleClass("arrow upmod login-required")
- }
- function mustLogin() {
- $("#mustbeloggedinModal").modal()
- }
- function notEnoughCCP() {
- $("#notenoughccp").modal()
- }
- function notEnoughCCPUpVote() {
- $("#notenoughccpupvote").modal()
- }
- function firstTimeVisitorWelcome() {
- $("#firsttimevisitorwelcomemessage").toggle()
- }
- function voteSubmission(n, t) {
- submissionVoteLock == null && (submissionVoteLock = {}, t = t == -1 ? -1 : 1, $.ajax({
- type: "POST",
- url: "/vote/" + n + "/" + t.toString(),
- complete: function() {
- submissionVoteLock = null
- },
- error: function() {
- var i = $(".submission.id-" + n),
- t = i.children(".entry");
- t.children("span").remove();
- t.prepend('<span class="vote-error">An Error Occured :(<\/span>')
- },
- success: function(i) {
- var u = $(".submission.id-" + n),
- o;
- if (u.children(".entry").children("span").remove(), !i.successfull) {
- i.message.indexOf("2.2", 0) > 0 ? notEnoughCCP() : (i.message.indexOf("4.0", 0) > 0 || i.message.indexOf("2.1", 0) > 0) && notEnoughCCPUpVote();
- o = u.children(".entry");
- o.children("span").remove();
- o.prepend('<span class="vote-error">' + i.message + "<\/span>");
- return
- }
- var r = u.children(".midcol"),
- f = +u.find(".score.likes").html(),
- e = +u.find(".score.dislikes").html();
- t == 1 ? r.is(".unvoted") ? (r.toggleClass("likes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-upvote").toggleClass("arrow-upvoted", !0), r.children(".arrow-upvote").toggleClass("arrow-upvote", !1), f++, u.find(".score.likes").html(f)) : r.is(".likes") ? (r.toggleClass("unvoted", !0), r.toggleClass("likes", !1), r.children(".arrow-upvoted").toggleClass("arrow-upvote", !0), r.children(".arrow-upvoted").toggleClass("arrow-upvoted", !1), f--, u.find(".score.likes").html(f), u.find(".score.unvoted").html(f)) : r.is(".dislikes") && (r.toggleClass("dislikes", !1), r.toggleClass("likes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-downvoted").toggleClass("arrow-downvote", !0), r.children(".arrow-downvoted").toggleClass("arrow-downvoted", !1), r.children(".arrow-upvote").toggleClass("arrow-upvoted", !0), e--, f++, u.find(".score.dislikes").html(e), u.find(".score.likes").html(f)) : r.is(".unvoted") ? (r.toggleClass("dislikes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-downvote").toggleClass("arrow-downvoted", !0), r.children(".arrow-downvote").toggleClass("arrow-downvote", !1), e++, u.find(".score.dislikes").html(e)) : r.is(".dislikes") ? (r.toggleClass("unvoted", !0), r.toggleClass("dislikes", !1), r.children(".arrow-downvoted").toggleClass("arrow-downvote", !0), r.children(".arrow-downvoted").toggleClass("arrow-downvoted", !1), e--, u.find(".score.dislikes").html(e), u.find(".score.unvoted").html(f)) : r.is(".likes") && (r.toggleClass("likes", !1), r.toggleClass("dislikes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-upvoted").toggleClass("arrow-upvote", !0), r.children(".arrow-upvoted").toggleClass("arrow-upvoted", !1), r.children(".arrow-downvote").toggleClass("arrow-downvoted", !0), e++, f--, u.find(".score.dislikes").html(e), u.find(".score.likes").html(f))
- }
- }))
- }
- function voteComment(n, t) {
- commentVoteLock == null && (commentVoteLock = {}, t = t == -1 ? -1 : 1, $.ajax({
- type: "POST",
- url: "/votecomment/" + n + "/" + t.toString(),
- complete: function() {
- commentVoteLock = null
- },
- error: function() {
- var i = $(".comment.id-" + n),
- t = i.children(".entry");
- t.children("span").remove();
- t.prepend('<span class="vote-error">An Error Occured :(<\/span>')
- },
- success: function(i) {
- var u = $(".comment.id-" + n),
- o;
- if (u.children(".entry").children("span").remove(), !i.successfull) {
- i.message.indexOf("2.2", 0) > 0 ? notEnoughCCP() : (i.message.indexOf("4.0", 0) > 0 || i.message.indexOf("2.1", 0) > 0) && notEnoughCCPUpVote();
- o = u.children(".entry");
- o.children("span").remove();
- o.prepend('<span class="vote-error">' + i.message + "<\/span>");
- return
- }
- var r = u.children(".midcol"),
- f = +u.find(".post_upvotes").filter(":first").html(),
- e = -u.find(".post_downvotes").filter(":first").html();
- t == 1 ? (r.is(".unvoted") ? (r.toggleClass("likes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-upvote").toggleClass("arrow-upvoted", !0), r.children(".arrow-upvote").toggleClass("arrow-upvote", !1), f++) : r.is(".likes") ? (r.toggleClass("likes", !1), r.toggleClass("unvoted", !0), r.children(".arrow-upvoted").toggleClass("arrow-upvote", !0), r.children(".arrow-upvoted").toggleClass("arrow-upvoted", !1), f--) : r.is(".dislikes") && (r.toggleClass("dislikes", !1), r.toggleClass("likes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-downvoted").toggleClass("arrow-downvote", !0), r.children(".arrow-downvoted").toggleClass("arrow-downvoted", !1), r.children(".arrow-upvote").toggleClass("arrow-upvoted", !0), f++, e--, u.find(".post_downvotes").filter(":first").html("-" + e)), u.find(".post_upvotes").filter(":first").html("+" + f), u.find(".score.unvoted").filter(":first").html(f - e + " points"), u.find(".score.onlycollapsed").filter(":first").html(f - e + " points")) : (r.is(".unvoted") ? (r.toggleClass("dislikes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-downvote").toggleClass("arrow-downvoted", !0), r.children(".arrow-downvote").toggleClass("arrow-downvote", !1), e++) : r.is(".dislikes") ? (r.toggleClass("unvoted", !0), r.toggleClass("dislikes", !1), r.children(".arrow-downvoted").toggleClass("arrow-downvote", !0), r.children(".arrow-downvoted").toggleClass("arrow-downvoted", !1), e--) : r.is(".likes") && (r.toggleClass("likes", !1), r.toggleClass("dislikes", !0), r.toggleClass("unvoted", !1), r.children(".arrow-upvoted").toggleClass("arrow-upvote", !0), r.children(".arrow-upvoted").toggleClass("arrow-upvoted", !1), r.children(".arrow-downvote").toggleClass("arrow-downvoted", !0), f--, e++, u.find(".post_upvotes").filter(":first").html("+" + f)), u.find(".post_downvotes").filter(":first").html("-" + e), u.find(".score.unvoted").filter(":first").html(f - e + " points"), u.find(".score.onlycollapsed").filter(":first").html(f - e + " points"))
- }
- }))
- }
- function reply(n, t) {
- var r, i;
- $("#commentreplyform-" + n).exists() || replyCommentFormRequest || (r = $("input[name='__RequestVerificationToken']").val(), replyCommentFormRequest = $.ajax({
- url: "/ajaxhelpers/commentreplyform/" + n + "/" + t,
- success: function(t) {
- $("#" + n).append(t);
- $("#commentreplyform-" + n).find("#Content").focus()
- },
- complete: function() {
- replyCommentFormRequest = null
- }
- }), i = $("#commentreplyform-" + n).removeData("validator").removeData("unobtrusiveValidation"), $.validator.unobtrusive.parse(i))
- }
- function replyprivatemessage(n, t, i) {
- var u, r;
- $("#privatemessagereplyform-" + n).exists() || replyFormPMRequest || (u = $("input[name='__RequestVerificationToken']").val(), replyFormPMRequest = $.ajax({
- url: "/ajaxhelpers/privatemessagereplyform/" + n + "?recipient=" + t + "&subject=" + i,
- success: function(t) {
- $("#messageContainer-" + n).append(t);
- $("#privatemessagereplyform-" + n).find("#Body").focus()
- },
- complete: function() {
- replyFormPMRequest = null
- }
- }), r = $("#privatemessagereplyform-" + n).removeData("validator").removeData("unobtrusiveValidation"), $.validator.unobtrusive.parse(r))
- }
- function replyToCommentNotification(n, t) {
- var r, i;
- $("#commentreplyform-" + n).exists() || replyToCommentFormRequest || (r = $("input[name='__RequestVerificationToken']").val(), replyToCommentFormRequest = $.ajax({
- url: "/ajaxhelpers/commentreplyform/" + n + "/" + t,
- success: function(t) {
- $("#commentContainer-" + n).append(t);
- $("#commentreplyform-" + n).find("#Content").focus()
- },
- complete: function() {
- replyToCommentFormRequest = null
- }
- }), i = $("#commentreplyform-" + n).removeData("validator").removeData("unobtrusiveValidation"), $.validator.unobtrusive.parse(i))
- }
- function postCommentReplyAjax(n, t, i, r) {
- var u = $(n).parents("form");
- if (u.find("#errorMessage").toggle(!1), u.find("#Content").val().length > 0) return u.find("#submitbutton").val("Please wait..."), u.find("#submitbutton").prop("disabled", !0), $.ajax({
- type: "POST",
- url: u.attr("action"),
- data: u.serialize(),
- error: function() {
- u.find("#submitbutton").val("Submit reply");
- u.find("#submitbutton").prop("disabled", !1);
- u.find("#errorMessage").html("You are doing that too fast. Please wait 30 seconds before trying again.");
- u.find("#errorMessage").toggle(!0)
- },
- success: function(n) {
- removereplyform(r);
- $(".id-" + r).append(n);
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", $(".id-" + r).last("div"))
- })
- }
- }), !1;
- u.find("#errorMessage").toggle(!0)
- }
- function postCommentAjax(n) {
- var t = $(n).parents("form");
- if (t.find("#errorMessage").toggle(!1), t.find("#Content").val().length > 0) return t.find("#submitbutton").val("Doing the magic..."), t.find("#submitbutton").prop("disabled", !0), $.ajax({
- type: "POST",
- url: t.attr("action"),
- data: t.serialize(),
- error: function(n, i, r) {
- t.find("#submitbutton").val("Submit comment");
- t.find("#submitbutton").prop("disabled", !1);
- t.find("#errorMessage").html(r.length > 0 && r != "Bad Request" && r != "Internal Server Error" ? r : "You are doing that too fast. Please wait 30 seconds before trying again.");
- t.find("#errorMessage").toggle(!0)
- },
- success: function(n) {
- $(".sitetable.nestedlisting").prepend(n);
- t.find("#submitbutton").val("Submit comment");
- t.find("#submitbutton").prop("disabled", !1);
- t.find("#Content").val("");
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", $(".sitetable.nestedlisting").first())
- })
- }
- }), !1;
- t.find("#errorMessage").toggle(!0)
- }
- function postPrivateMessageReplyAjax(n, t) {
- var i = $(n).parents("form");
- if (i.find("#errorMessage").toggle(!1), i.find("#Body").val().length > 0) return i.find("#submitbutton").val("Please wait..."), i.find("#submitbutton").prop("disabled", !0), $.ajax({
- type: "POST",
- url: i.attr("action"),
- data: i.serialize(),
- error: function() {
- i.find("#submitbutton").val("Submit reply");
- i.find("#submitbutton").prop("disabled", !1);
- i.find("#errorMessage").html("You are doing that too fast. Please wait 30 seconds before trying again.");
- i.find("#errorMessage").toggle(!0)
- },
- success: function() {
- removereplyform(t);
- $("#messageContainer-" + t).find("#replyPrivateMessage").html("Reply sent.");
- $("#messageContainer-" + t).find("#replyPrivateMessage").addClass("disabled")
- }
- }), !1;
- i.find("#errorMessage").toggle(!0)
- }
- function edit(n) {
- $("#commentContent-" + n).toggle(1);
- $("#" + n).find(".usertext-edit").toggle(1);
- $("#commenteditform-" + n).find("#Content").focus();
- var t = $("#commenteditform-" + n).removeData("validator").removeData("unobtrusiveValidation");
- $.validator.unobtrusive.parse(t)
- }
- function editsubmission(n) {
- $("#submissionid-" + n).find(".original").toggle(1);
- $("#submissionid-" + n).find(".usertext-edit").toggle(1);
- var t = $("#submissioneditform-" + n).removeData("validator").removeData("unobtrusiveValidation");
- $.validator.unobtrusive.parse(t)
- }
- function removesubmissioneditform(n) {
- $("#submissionid-" + n).find(".usertext-body").toggle(1);
- $("#submissionid-" + n).find(".usertext-edit").toggle(1)
- }
- function editmessagesubmit(n) {
- var t = $("#submissionid-" + n).find(".form-control").val(),
- i = {
- SubmissionId: n,
- SubmissionContent: t
- };
- return $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(i),
- url: "/editsubmission",
- datatype: "json",
- success: function(t) {
- $("#submissionid-" + n).find(".md").html(t.response);
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", $("#submissionid-" + n))
- })
- }
- }), removesubmissioneditform(n), !1
- }
- function removereplyform(n) {
- $("#replyform-" + n).remove()
- }
- function removeeditform(n) {
- $("#" + n).find(".usertext-body").show();
- $("#" + n).find(".usertext-edit").hide()
- }
- function showcomment(n) {
- return $("#" + n).closest(".noncollapsed").toggle(1), $("#" + n).prev().toggle(1), $("#" + n).parent().parent().find(".midcol").filter(":first").toggle(1), $("#" + n).parent().parent().find("> .child").toggle(1), !1
- }
- function hidecomment(n) {
- return $("#" + n).closest(".noncollapsed").toggle(1), $("#" + n).prev().toggle(1), $("#" + n).parent().parent().find(".midcol").filter(":first").toggle(1), $("#" + n).parent().parent().find("> .child").toggle(1), !1
- }
- function editcommentsubmit(n) {
- var t = $("#" + n).find(".form-control").val(),
- i = {
- ID: n,
- Content: t
- };
- return $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(i),
- url: "/editcomment",
- datatype: "json",
- error: function(t, i, r) {
- var u = r.length > 0 && r != "Bad Request" && r != "Internal Server Error" ? r : "You are doing that too fast. Please wait 30 seconds before trying again.";
- $("#commenteditform-" + n + " span.field-validation-error").html(u)
- },
- success: function(t) {
- $("#" + n).find(".md").html(t.response);
- removeeditform(n);
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", $("#" + n))
- })
- }
- }), !1
- }
- function deletecomment(n) {
- $("#" + n).find(".flat-list").html("");
- $("#" + n).find(".md").html("[deleted]");
- $("#" + n).find(".md").css("color", "gray");
- $("#" + n).find(".author").replaceWith(function() {
- return $("<em>[deleted]<\/em>")
- });
- $("#" + n).find(".userattrs").html("");
- toggleback(n);
- removeeditform(n);
- deletecommentsubmit(n)
- }
- function deletecommentsubmit(n) {
- var t = {
- commentid: n
- };
- return $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(t),
- url: "/deletecomment",
- datatype: "json"
- }), removeeditform(n), !1
- }
- function deletesubmission(n, t) {
- var r = $(n).parents("form"),
- i;
- r.find("#deletestatusmesssage").html("please wait...");
- i = {
- submissionid: t
- };
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(i),
- url: "/deletesubmission",
- datatype: "json"
- });
- $("body").load($(location).attr("href"))
- }
- function toggle(n) {
- return $(n).parent().parent().find(".option, .main").toggleClass("active"), !1
- }
- function toggleblocksubverse(n) {
- return $(n).parent().parent().find(".option, .error").toggleClass("active"), !1
- }
- function togglereport(n) {
- return $("#" + n).find(".report").toggleClass("active"), !1
- }
- function reportcomment(n, t) {
- return $(n).parent().parent().find(".togglebutton").attr("onclick", "javascript:void(0)"), $(n).parent().parent().find(".option, .main").toggleClass("active"), $(n).parent().parent().find(".togglebutton").html("please wait..."), $.ajax({
- type: "POST",
- url: "/reportcomment/" + t,
- success: function() {
- $(n).parent().parent().find(".togglebutton").html("thank you!")
- },
- error: function() {
- $(n).parent().parent().find(".togglebutton").html("report failed")
- }
- }), !1
- }
- function toggleback(n) {
- return $(n).parent().parent().find(".option, .error").toggleClass("active"), !1
- }
- function togglesubmission(n) {
- return $(n).parent().parent().find(".option, .main").toggleClass("active"), !1
- }
- function togglesubmissionback(n) {
- return $(n).parent().parent().find(".option, .error").toggleClass("active"), !1
- }
- function subscribe(n, t) {
- $(n).attr("onclick", "unsubscribe(this)");
- $(n).html("unsubscribe");
- $(n).toggleClass("btn-sub btn-unsub");
- $.ajax({
- type: "POST",
- url: "/subscribe/" + t,
- success: function() {
- var n = +$("#subscriberCount").html();
- n++;
- $("#subscriberCount").html(n)
- },
- error: function() {
- alert("Something went wrong while sending a subscription request.")
- }
- })
- }
- function unsubscribe(n, t) {
- $(n).attr("onclick", "subscribe(this)");
- $(n).html("subscribe");
- $(n).toggleClass("btn-sub btn-unsub");
- $.ajax({
- type: "POST",
- url: "/unsubscribe/" + t,
- success: function() {
- var n = +$("#subscriberCount").html();
- n--;
- $("#subscriberCount").html(n)
- },
- error: function() {
- alert("Something went wrong while sending unsubscription request.")
- }
- })
- }
- function subscribeToSet(n, t) {
- $(n).attr("onclick", "unsubscribe(this)");
- $(n).html("unsubscribe");
- $.ajax({
- type: "POST",
- url: "/subscribetoset/" + t,
- success: function() {
- var n = +$("#subscribercount").html();
- n++;
- $("#subscribercount").html(n)
- },
- error: function() {
- alert("Something went wrong while sending a set subscription request.")
- }
- })
- }
- function unsubscribeFromSet(n, t) {
- $(n).attr("onclick", "subscribe(this)");
- $(n).html("subscribe");
- $.ajax({
- type: "POST",
- url: "/unsubscribefromset/" + t,
- success: function() {
- var n = +$("#subscriberCount").html();
- n--;
- $("#subscriberCount").html(n)
- },
- error: function() {
- alert("Something went wrong while sending unsubscription request.")
- }
- })
- }
- function removeSubFromSet(n, t, i) {
- $(n).html("Hold on...");
- $.ajax({
- type: "POST",
- url: "/sets/removesubverse/" + t + "/" + i,
- success: function() {
- $("#subverse-" + i).remove()
- },
- error: function() {
- $(n).html("Something went wrong.")
- }
- })
- }
- function addSubToSet(n, t) {
- $(n).html("Hold on...");
- var i = $("#Subverse").val();
- if (!i) {
- $(n).html("Add this subverse to set");
- $("#status").html("please enter a subverse name to add");
- $("#status").show();
- return
- }
- $.ajax({
- type: "POST",
- url: "/sets/addsubverse/" + t + "/" + i,
- success: function() {
- var r = $.get("/ajaxhelpers/setsubverseinfo/" + t + "/" + i, null, function(t) {
- $("#subverselisting").append(t);
- $("#status").hide();
- $(n).html("Add this subverse to set")
- })
- },
- error: function() {
- $("#status").html("Subverse probably does not exist.");
- $("#status").show();
- $(n).html("Add this subverse to set")
- }
- })
- }
- function loadSelfText(n, t) {
- var i;
- $(n).hasClass("collapsed") && (i = $.get("/ajaxhelpers/messagecontent/" + t, null, function(t) {
- $(n).parent().find(".expando").find(".md").html(t);
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", $(n).parent().find(".expando"))
- })
- }));
- $(n).toggleClass("collapsed");
- $(n).toggleClass("expanded");
- $(n).parent().find(".expando").toggle()
- }
- function loadVideoPlayer(n, t) {
- $(n).toggleClass("collapsed");
- $(n).toggleClass("expanded");
- var i = $.get("/ajaxhelpers/videoplayer/" + t, null, function(t) {
- $(n).parent().find(".expando").nextAll().find(".videoplayer").html(t);
- window.setTimeout(function() {
- UI.Notifications.raise("iFrameLoaded", $(n).parent().find(".expando").nextAll().find(".videoplayer"))
- })
- });
- $(n).parent().find(".expando").next().next().next().toggle()
- }
- function deletePrivateMessage(n, t) {
- var i = {
- privateMessageId: t
- };
- return $(n).html("please wait..."), $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(i),
- success: function() {
- $("#messageContainer-" + t).remove()
- },
- url: "/messaging/delete",
- datatype: "json"
- }), !1
- }
- function deletePrivateMessageFromSent(n, t) {
- var i = {
- privateMessageId: t
- };
- return $(n).html("please wait..."), $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(i),
- success: function() {
- $("#messageContainer-" + t).remove()
- },
- url: "/messaging/deletesent",
- datatype: "json"
- }), !1
- }
- function selectflair(n, t) {
- var i = $.get("/ajaxhelpers/linkflairselectdialog/" + t + "/" + n, null, function(n) {
- $("#linkFlairSelectModal").html(n);
- $("#linkFlairSelectModal").modal()
- })
- }
- function applyflair(n, t, i, r) {
- $.ajax({
- type: "POST",
- url: "/submissions/applylinkflair/" + n + "/" + t,
- success: function() {
- $("#linkFlairSelectModal").modal("hide");
- $("#linkflair").attr("class", "flair " + r);
- $("#linkflair").attr("title", i);
- $("#linkflair").html(i)
- },
- error: function() {
- alert("Unable to apply link flair.")
- }
- })
- }
- function clearflair(n) {
- $.ajax({
- type: "POST",
- url: "/submissions/clearlinkflair/" + n,
- success: function() {
- $("#linkFlairSelectModal").modal("hide");
- $("#linkflair").attr("class", "");
- $("#linkflair").attr("title", "");
- $("#linkflair").html("")
- },
- error: function() {
- alert("Unable to clear link flair.")
- }
- })
- }
- function distinguish(n, t) {
- $(t).html("please wait...");
- $.ajax({
- type: "POST",
- url: "/comments/distinguish/" + n,
- success: function() {
- $(t).html("done")
- },
- error: function() {
- $(t).html("unable to comply")
- }
- })
- }
- function suggestTitle() {
- $("#suggest-title").off("click", suggestTitle);
- $("#suggest-title").text("Please wait...");
- var n = $("#Content").val(),
- t = $.get("/ajaxhelpers/titlefromuri?uri=" + n, null, function(n) {
- $("#LinkDescription").val(n);
- $("#suggest-title").text("Enter the URL above, then click here to suggest a title");
- $("#suggest-title").on("click", suggestTitle)
- }).fail(function() {
- $("#LinkDescription").val("We were unable to suggest a title.");
- $("#suggest-title").text("Enter the URL above, then click here to suggest a title");
- $("#suggest-title").on("click", suggestTitle)
- })
- }
- function toggleSticky(n) {
- $.ajax({
- type: "POST",
- url: "/submissions/togglesticky/" + n,
- success: function() {
- $("#togglesticky").html("toggled")
- },
- error: function() {
- alert("Something went wrong while sending a sticky toggle request.")
- }
- })
- }
- function showMessagePreview(n, t, i) {
- var u = $(t).val(),
- r;
- return !u.length > 0 ? ($(i).find("#submission-preview-area-container").html("Please enter some text in order to get a preview."), $(i).show(), !1) : ($(n).val("Please wait"), r = {
- MessageContent: $(t).val()
- }, $.ajax({
- url: "/ajaxhelpers/rendersubmission/",
- type: "post",
- dataType: "html",
- success: function(n) {
- $(i).find("#submission-preview-area-container").html(n);
- UI.ExpandoManager.execute()
- },
- data: r
- }), $(i).show(), $(n).val("Preview"), !1)
- }
- function loadMoreSetItems(n, t) {
- if (!loadMoreSetRequest) {
- $(n).html("Sit tight...");
- var i = $("#set-" + t + "-page").html();
- i == null ? i = 1 : i++;
- loadMoreSetRequest = $.ajax({
- url: "/set/" + t + "/" + i + "/",
- success: function(i) {
- $("#set-" + t + "-page").remove();
- $("#set-" + t + "-container").append(i);
- $(n).html("load more ▼")
- },
- error: function() {
- $(n).html("That's it. There was nothing else to show.")
- },
- complete: function() {
- loadMoreSetRequest = null
- }
- })
- }
- }
- function toggleSource(n) {
- $(n.parentElement.parentElement.parentElement).find("#sourceDisplay").toggle();
- n.text = n.text == "source" ? "hide source" : "source"
- }
- function changeSetName() {
- $("#setName").removeAttr("onclick");
- $("#setName").hide();
- $("#newSetName").show();
- $("#newSetNameEditBox").focus();
- $("#newSetNameEditBox").on("keypress", function(n) {
- n.keyCode === 13 && ($("#setName").html($("#newSetNameEditBox").val()), $("#setName").bind("click", changeSetName), $("#newSetName").hide(), $("#setName").show())
- })
- }
- function cancelSetTitleChange() {
- $("#setName").bind("click", changeSetName);
- $("#newSetName").hide();
- $("#setName").show()
- }
- function saveSetTitle(n, t) {
- $(n).html("Please wait...");
- $.ajax({
- type: "POST",
- url: "/sets/modify/" + t + "/" + $("#newSetNameEditBox").val(),
- success: function() {
- $("#setName").html($("#newSetNameEditBox").val());
- $("#setName").bind("click", changeSetName);
- $("#newSetName").hide();
- $("#setName").show();
- $(n).html("Save")
- },
- error: function() {
- $(n).html("Max 20 characters")
- }
- })
- }
- function deleteSet(n, t) {
- return $(n).html("Are you sure?"), $(n).bind({
- click: function() {
- deleteSetExecute(n, t)
- }
- }), !1
- }
- function deleteSetExecute(n, t) {
- $(n).html("Please wait...");
- $.ajax({
- type: "POST",
- url: "/sets/delete/" + t,
- success: function() {
- $("#set-" + t).remove()
- },
- error: function() {
- $(n).html("Nope.")
- }
- })
- }
- function loadMoreComments2(n, t, i, r, u, f, e) {
- var o, s, h;
- loadCommentsRequest2 || (n.html("Sit tight..."), o = $("#comments-" + i + "-page").html(), o == null ? o = 1 : o++, s = "xxxx".replace(/[xy]/g, function() {
- var n = Math.random() * 16 | 0;
- return n.toString(16)
- }), h = "/comments/" + i + "/" + (r == null ? "null" : r) + "/" + u + "/" + f + "/" + e + "?nocache=" + s, loadCommentsRequest2 = $.ajax({
- url: h,
- success: function(i) {
- t.append(i);
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", t)
- });
- n.parent().remove()
- },
- error: function() {
- n.html("A problem happened.")
- },
- complete: function() {
- loadCommentsRequest2 = null
- }
- }))
- }
- function loadMoreComments(n, t) {
- if (!loadCommentsRequest) {
- $(n).html("Sit tight...");
- var i = $("#comments-" + t + "-page").html();
- i == null ? i = 1 : i++;
- loadCommentsRequest = $.ajax({
- url: "/comments/" + t + "/" + i + "/",
- success: function(i) {
- $("#comments-" + t + "-page").remove();
- $(n).before(i);
- window.setTimeout(function() {
- UI.Notifications.raise("DOM", $(n).parent())
- });
- $(n).html("load more ▼")
- },
- error: function() {
- $(n).html("That's it. There was nothing else to show. Phew. This was hard.")
- },
- complete: function() {
- loadCommentsRequest = null
- }
- })
- }
- }
- function goToParent(n, t) {
- $("#" + t).exists() && (n.preventDefault(), window.location.hash = "#" + t)
- }
- function scrollChatToBottom() {
- var n = document.getElementById("subverseChatRoom");
- n.scrollTop = n.scrollHeight
- }
- function sendChatMessage(n, t) {
- if ($.connection != null) {
- var i = $("#chatInputBox").val(),
- r = $.connection.messagingHub;
- r.server.sendChatMessage(n, i, t);
- scrollChatToBottom();
- $("#chatInputBox").val("")
- }
- }
- function joinSubverseChatRoom(n) {
- $.connection != null && $.connection.hub.start().done(function() {
- var t = $.connection.messagingHub;
- t.server.joinSubverseChatRoom(n)
- })
- }
- function toggleNightMode() {
- $.ajax({
- type: "POST",
- url: "/account/togglenightmode/",
- complete: function() {
- window.location.reload()
- }
- })
- }
- function toggleSaveSubmission(n) {
- var t = $(".submission.id-" + n + " .savelink");
- t.exists() && (t.text() === "save" ? t.text("unsave") : t.text("save"), $.ajax({
- type: "POST",
- url: "/save/" + n
- }))
- }
- function toggleSaveComment(n) {
- var t = $(".comment.id-" + n + " .savelink").first();
- t.exists() && (t.text() === "save" ? t.text("unsave") : t.text("save"), $.ajax({
- type: "POST",
- url: "/savecomment/" + n
- }))
- }
- function toggleBlockSubverse(n, t) {
- $(n).toggleClass("btn-blocksubverse btn-unblocksubverse");
- var i = $(n);
- i.exists() && (i.text() === "block" ? i.text("unblock") : i.text("block"), postBlockSubverse(t))
- }
- function toggleBlockSubverseFLButton(n, t) {
- var i = $(n);
- i.exists() && (i.text() === "block subverse" ? i.text("undo") : i.text("block subverse"), postBlockSubverse(t))
- }
- function postBlockSubverse(n) {
- $.ajax({
- type: "POST",
- url: "/subverses/block/" + n
- })
- }
- function checkUsernameAvailability(n) {
- if ($(n).val().length > 1 && !/\s/g.test($(n).val())) var t = $.ajax({
- type: "POST",
- url: "/account/CheckUsernameAvailability",
- data: {
- userName: $(n).val()
- },
- success: function(n) {
- n.available ? $("#usernameAvailabilityStatus").hide() : $("#usernameAvailabilityStatus").show()
- }
- })
- }
- function markAsRead(n, t, i, r) {
- var u, f;
- $(n).attr("onclick", "");
- i != null && r === !1 ? u = $.ajax({
- type: "GET",
- url: "/messaging/markasread",
- data: {
- itemType: t,
- itemId: i,
- markAll: r
- },
- success: function() {
- $(n).text("marked.")
- },
- error: function() {
- $(n).text("something went wrong.")
- }
- }) : f = $.ajax({
- type: "GET",
- url: "/messaging/markasread",
- data: {
- itemType: t,
- markAll: r
- },
- success: function() {
- $(n).text("marked.")
- },
- error: function() {
- $(n).text("something went wrong.")
- }
- })
- }
- function previewStylesheet(n, t) {
- var i = $(n);
- i.html("Hold on...");
- i.prop("disabled", !0);
- $.ajax({
- type: "GET",
- url: "/ajaxhelpers/previewstylesheet?subversetoshow=" + t + "&previewMode=true",
- dataType: "html",
- success: function(n) {
- var t, u, r;
- $("#stylesheetpreviewarea").html(n);
- i.html("Preview");
- i.prop("disabled", !1);
- t = document.getElementById("custom_css");
- u = t.parentNode;
- u.removeChild(t);
- r = document.createElement("style");
- r.innerHTML = $("#Stylesheet").val();
- document.body.appendChild(r)
- }
- })
- }
- function addTagsToEachSelectedTextLine(n, t, r) {
- var u = getSelectionArray(n),
- e = u[1].split("\n"),
- f;
- for (n.value = u[0], i = 0; i < e.length; i++) n.value += addTagsToText(e[i], t, r) + "\n";
- n.value += u[2];
- f = n.value.length - r.length - u[2].length;
- setSelectionRange(n, f, f)
- }
- function addTagsToSelectedText(n, t, i) {
- var r = getSelectionArray(n),
- u;
- n.value = r[0];
- n.value += addTagsToText(r[1], t, i);
- n.value += r[2];
- u = n.value.length - i.length - r[2].length;
- setSelectionRange(n, u, u)
- }
- function addTagsToText(n, t, i) {
- return t + n + i
- }
- function getSelectionArray(n) {
- var t = [n.value, "", ""],
- i, r;
- return n.selectionStart != undefined && (i = n.selectionStart, r = n.selectionEnd, t[0] = n.value.substring(0, i), t[1] = n.value.substring(i, r), t[2] = n.value.substring(r, n.value.length)), t
- }
- function setSelectionRange(n, t, i) {
- if (n.setSelectionRange) n.focus(), n.setSelectionRange(t, i);
- else if (n.createTextRange) {
- var r = n.createTextRange();
- r.collapse(!0);
- r.moveEnd("character", i);
- r.moveStart("character", t);
- r.select()
- }
- }
- function incColumns(n, t) {
- n.value++;
- updateNumColumnsDisplay(n, t)
- }
- function decColumns(n, t) {
- n.value > 1 && n.value--;
- updateNumColumnsDisplay(n, t)
- }
- function updateNumColumnsDisplay(n, t) {
- t.innerHTML = n.value
- }
- function incRows(n, t) {
- n.value++;
- updateNumRowsDisplay(n, t)
- }
- function decRows(n, t) {
- n.value > 1 && n.value--;
- updateNumRowsDisplay(n, t)
- }
- function updateNumRowsDisplay(n, t) {
- t.innerHTML = n.value
- }
- function createTable(n, t, i) {
- var u = getSelectionArray(n),
- f;
- if (t >= 1 && i >= 1) {
- for (n.value = u[0], c = 0; c < t; c++) n.value += "Title |";
- for (n.value += "\n", c = 0; c < t; c++) n.value += "--- |";
- for (n.value += "\n", r = 0; r < i; r++) {
- for (c = 0; c < t; c++) n.value += "Text |";
- n.value += "\n"
- }
- n.value += u[2];
- f = n.value.length - u[2].length;
- setSelectionRange(n, f, f)
- } else alert("Error: Unable to create table! Invalid number of columns/rows.")
- }
- function addHyperlink(n, t) {
- t != "" && t !== null && (getSelectionArray(n)[1] == "" ? addTagsToSelectedText(n, "[Title Here", "](" + t + ")") : addTagsToSelectedText(n, "[", "](" + t + ")"));
- n.focus()
- }
- function addCode(n) {
- var t = getSelectionArray(n),
- r, i;
- n.value = t[0];
- r = /\r|\n/.exec(t[1]) || t[1].length == 0;
- n.value += r ? addTagsToText(t[1], "~~~\n", "\n~~~") : addTagsToText(t[1], "`", "`");
- n.value += t[2];
- i = n.value.length - rightTag.length - t[2].length;
- setSelectionRange(n, i, i)
- }
- var UI, LinkExpando, ImageLinkExpando, VideoLinkExpando, GfycatExpando, ImgurGifvExpando, WebMExpando, MP4Expando, IFrameEmbedderExpando, YouTubeExpando, ImgurAlbumExpando, VimeoExpando, CoubExpando, SoundCloudExpando, submissionVoteLock, commentVoteLock, replyCommentFormRequest, replyFormPMRequest, replyToCommentFormRequest, loadMoreSetRequest, loadCommentsRequest2, loadCommentsRequest;
- ! function(n, t) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = n.document ? t(n, !0) : function(n) {
- if (!n.document) throw new Error("jQuery requires a window with a document");
- return t(n)
- } : t(n)
- }("undefined" != typeof window ? window : this, function(n, t) {
- function ri(n) {
- var t = "length" in n && n.length,
- r = i.type(n);
- return "function" === r || i.isWindow(n) ? !1 : 1 === n.nodeType && t ? !0 : "array" === r || 0 === t || "number" == typeof t && t > 0 && t - 1 in n
- }
- function ui(n, t, r) {
- if (i.isFunction(t)) return i.grep(n, function(n, i) {
- return !!t.call(n, i, n) !== r
- });
- if (t.nodeType) return i.grep(n, function(n) {
- return n === t !== r
- });
- if ("string" == typeof t) {
- if (ef.test(t)) return i.filter(t, n, r);
- t = i.filter(t, n)
- }
- return i.grep(n, function(n) {
- return ft.call(t, n) >= 0 !== r
- })
- }
- function ur(n, t) {
- while ((n = n[t]) && 1 !== n.nodeType);
- return n
- }
- function of(n) {
- var t = fi[n] = {};
- return i.each(n.match(c) || [], function(n, i) {
- t[i] = !0
- }), t
- }
- function ht() {
- u.removeEventListener("DOMContentLoaded", ht, !1);
- n.removeEventListener("load", ht, !1);
- i.ready()
- }
- function v() {
- Object.defineProperty(this.cache = {}, 0, {
- get: function() {
- return {}
- }
- });
- this.expando = i.expando + v.uid++
- }
- function fr(n, t, r) {
- var u;
- if (void 0 === r && 1 === n.nodeType)
- if (u = "data-" + t.replace(hf, "-$1").toLowerCase(), r = n.getAttribute(u), "string" == typeof r) {
- try {
- r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : sf.test(r) ? i.parseJSON(r) : r
- } catch (f) {}
- e.set(n, t, r)
- } else r = void 0;
- return r
- }
- function lt() {
- return !0
- }
- function k() {
- return !1
- }
- function hr() {
- try {
- return u.activeElement
- } catch (n) {}
- }
- function vr(n, t) {
- return i.nodeName(n, "table") && i.nodeName(11 !== t.nodeType ? t : t.firstChild, "tr") ? n.getElementsByTagName("tbody")[0] || n.appendChild(n.ownerDocument.createElement("tbody")) : n
- }
- function bf(n) {
- return n.type = (null !== n.getAttribute("type")) + "/" + n.type, n
- }
- function kf(n) {
- var t = pf.exec(n.type);
- return t ? n.type = t[1] : n.removeAttribute("type"), n
- }
- function ei(n, t) {
- for (var i = 0, u = n.length; u > i; i++) r.set(n[i], "globalEval", !t || r.get(t[i], "globalEval"))
- }
- function yr(n, t) {
- var u, c, f, s, h, l, a, o;
- if (1 === t.nodeType) {
- if (r.hasData(n) && (s = r.access(n), h = r.set(t, s), o = s.events)) {
- delete h.handle;
- h.events = {};
- for (f in o)
- for (u = 0, c = o[f].length; c > u; u++) i.event.add(t, f, o[f][u])
- }
- e.hasData(n) && (l = e.access(n), a = i.extend({}, l), e.set(t, a))
- }
- }
- function o(n, t) {
- var r = n.getElementsByTagName ? n.getElementsByTagName(t || "*") : n.querySelectorAll ? n.querySelectorAll(t || "*") : [];
- return void 0 === t || t && i.nodeName(n, t) ? i.merge([n], r) : r
- }
- function df(n, t) {
- var i = t.nodeName.toLowerCase();
- "input" === i && er.test(n.type) ? t.checked = n.checked : ("input" === i || "textarea" === i) && (t.defaultValue = n.defaultValue)
- }
- function pr(t, r) {
- var f, u = i(r.createElement(t)).appendTo(r.body),
- e = n.getDefaultComputedStyle && (f = n.getDefaultComputedStyle(u[0])) ? f.display : i.css(u[0], "display");
- return u.detach(), e
- }
- function si(n) {
- var r = u,
- t = oi[n];
- return t || (t = pr(n, r), "none" !== t && t || (at = (at || i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement), r = at[0].contentDocument, r.write(), r.close(), t = pr(n, r), at.detach()), oi[n] = t), t
- }
- function it(n, t, r) {
- var e, o, s, u, f = n.style;
- return r = r || vt(n), r && (u = r.getPropertyValue(t) || r[t]), r && ("" !== u || i.contains(n.ownerDocument, n) || (u = i.style(n, t)), hi.test(u) && wr.test(t) && (e = f.width, o = f.minWidth, s = f.maxWidth, f.minWidth = f.maxWidth = f.width = u, u = r.width, f.width = e, f.minWidth = o, f.maxWidth = s)), void 0 !== u ? u + "" : u
- }
- function br(n, t) {
- return {
- get: function() {
- return n() ? void delete this.get : (this.get = t).apply(this, arguments)
- }
- }
- }
- function gr(n, t) {
- if (t in n) return t;
- for (var r = t[0].toUpperCase() + t.slice(1), u = t, i = dr.length; i--;)
- if (t = dr[i] + r, t in n) return t;
- return u
- }
- function nu(n, t, i) {
- var r = ne.exec(t);
- return r ? Math.max(0, r[1] - (i || 0)) + (r[2] || "px") : t
- }
- function tu(n, t, r, u, f) {
- for (var e = r === (u ? "border" : "content") ? 4 : "width" === t ? 1 : 0, o = 0; 4 > e; e += 2) "margin" === r && (o += i.css(n, r + p[e], !0, f)), u ? ("content" === r && (o -= i.css(n, "padding" + p[e], !0, f)), "margin" !== r && (o -= i.css(n, "border" + p[e] + "Width", !0, f))) : (o += i.css(n, "padding" + p[e], !0, f), "padding" !== r && (o += i.css(n, "border" + p[e] + "Width", !0, f)));
- return o
- }
- function iu(n, t, r) {
- var o = !0,
- u = "width" === t ? n.offsetWidth : n.offsetHeight,
- e = vt(n),
- s = "border-box" === i.css(n, "boxSizing", !1, e);
- if (0 >= u || null == u) {
- if (u = it(n, t, e), (0 > u || null == u) && (u = n.style[t]), hi.test(u)) return u;
- o = s && (f.boxSizingReliable() || u === n.style[t]);
- u = parseFloat(u) || 0
- }
- return u + tu(n, t, r || (s ? "border" : "content"), o, e) + "px"
- }
- function ru(n, t) {
- for (var e, u, s, o = [], f = 0, h = n.length; h > f; f++) u = n[f], u.style && (o[f] = r.get(u, "olddisplay"), e = u.style.display, t ? (o[f] || "none" !== e || (u.style.display = ""), "" === u.style.display && tt(u) && (o[f] = r.access(u, "olddisplay", si(u.nodeName)))) : (s = tt(u), "none" === e && s || r.set(u, "olddisplay", s ? e : i.css(u, "display"))));
- for (f = 0; h > f; f++) u = n[f], u.style && (t && "none" !== u.style.display && "" !== u.style.display || (u.style.display = t ? o[f] || "" : "none"));
- return n
- }
- function s(n, t, i, r, u) {
- return new s.prototype.init(n, t, i, r, u)
- }
- function fu() {
- return setTimeout(function() {
- d = void 0
- }), d = i.now()
- }
- function wt(n, t) {
- var r, u = 0,
- i = {
- height: n
- };
- for (t = t ? 1 : 0; 4 > u; u += 2 - t) r = p[u], i["margin" + r] = i["padding" + r] = n;
- return t && (i.opacity = i.width = n), i
- }
- function eu(n, t, i) {
- for (var u, f = (rt[t] || []).concat(rt["*"]), r = 0, e = f.length; e > r; r++)
- if (u = f[r].call(i, t, n)) return u
- }
- function fe(n, t, u) {
- var f, a, p, v, o, w, h, b, l = this,
- y = {},
- s = n.style,
- c = n.nodeType && tt(n),
- e = r.get(n, "fxshow");
- u.queue || (o = i._queueHooks(n, "fx"), null == o.unqueued && (o.unqueued = 0, w = o.empty.fire, o.empty.fire = function() {
- o.unqueued || w()
- }), o.unqueued++, l.always(function() {
- l.always(function() {
- o.unqueued--;
- i.queue(n, "fx").length || o.empty.fire()
- })
- }));
- 1 === n.nodeType && ("height" in t || "width" in t) && (u.overflow = [s.overflow, s.overflowX, s.overflowY], h = i.css(n, "display"), b = "none" === h ? r.get(n, "olddisplay") || si(n.nodeName) : h, "inline" === b && "none" === i.css(n, "float") && (s.display = "inline-block"));
- u.overflow && (s.overflow = "hidden", l.always(function() {
- s.overflow = u.overflow[0];
- s.overflowX = u.overflow[1];
- s.overflowY = u.overflow[2]
- }));
- for (f in t)
- if (a = t[f], re.exec(a)) {
- if (delete t[f], p = p || "toggle" === a, a === (c ? "hide" : "show")) {
- if ("show" !== a || !e || void 0 === e[f]) continue;
- c = !0
- }
- y[f] = e && e[f] || i.style(n, f)
- } else h = void 0;
- if (i.isEmptyObject(y)) "inline" === ("none" === h ? si(n.nodeName) : h) && (s.display = h);
- else {
- e ? "hidden" in e && (c = e.hidden) : e = r.access(n, "fxshow", {});
- p && (e.hidden = !c);
- c ? i(n).show() : l.done(function() {
- i(n).hide()
- });
- l.done(function() {
- var t;
- r.remove(n, "fxshow");
- for (t in y) i.style(n, t, y[t])
- });
- for (f in y) v = eu(c ? e[f] : 0, f, l), f in e || (e[f] = v.start, c && (v.end = v.start, v.start = "width" === f || "height" === f ? 1 : 0))
- }
- }
- function ee(n, t) {
- var r, f, e, u, o;
- for (r in n)
- if (f = i.camelCase(r), e = t[f], u = n[r], i.isArray(u) && (e = u[1], u = n[r] = u[0]), r !== f && (n[f] = u, delete n[r]), o = i.cssHooks[f], o && "expand" in o) {
- u = o.expand(u);
- delete n[f];
- for (r in u) r in n || (n[r] = u[r], t[r] = e)
- } else t[f] = e
- }
- function ou(n, t, r) {
- var h, e, o = 0,
- l = pt.length,
- f = i.Deferred().always(function() {
- delete c.elem
- }),
- c = function() {
- if (e) return !1;
- for (var s = d || fu(), t = Math.max(0, u.startTime + u.duration - s), h = t / u.duration || 0, i = 1 - h, r = 0, o = u.tweens.length; o > r; r++) u.tweens[r].run(i);
- return f.notifyWith(n, [u, i, t]), 1 > i && o ? t : (f.resolveWith(n, [u]), !1)
- },
- u = f.promise({
- elem: n,
- props: i.extend({}, t),
- opts: i.extend(!0, {
- specialEasing: {}
- }, r),
- originalProperties: t,
- originalOptions: r,
- startTime: d || fu(),
- duration: r.duration,
- tweens: [],
- createTween: function(t, r) {
- var f = i.Tween(n, u.opts, t, r, u.opts.specialEasing[t] || u.opts.easing);
- return u.tweens.push(f), f
- },
- stop: function(t) {
- var i = 0,
- r = t ? u.tweens.length : 0;
- if (e) return this;
- for (e = !0; r > i; i++) u.tweens[i].run(1);
- return t ? f.resolveWith(n, [u, t]) : f.rejectWith(n, [u, t]), this
- }
- }),
- s = u.props;
- for (ee(s, u.opts.specialEasing); l > o; o++)
- if (h = pt[o].call(u, n, s, u.opts)) return h;
- return i.map(s, eu, u), i.isFunction(u.opts.start) && u.opts.start.call(n, u), i.fx.timer(i.extend(c, {
- elem: n,
- anim: u,
- queue: u.opts.queue
- })), u.progress(u.opts.progress).done(u.opts.done, u.opts.complete).fail(u.opts.fail).always(u.opts.always)
- }
- function pu(n) {
- return function(t, r) {
- "string" != typeof t && (r = t, t = "*");
- var u, f = 0,
- e = t.toLowerCase().match(c) || [];
- if (i.isFunction(r))
- while (u = e[f++]) "+" === u[0] ? (u = u.slice(1) || "*", (n[u] = n[u] || []).unshift(r)) : (n[u] = n[u] || []).push(r)
- }
- }
- function wu(n, t, r, u) {
- function e(s) {
- var h;
- return f[s] = !0, i.each(n[s] || [], function(n, i) {
- var s = i(t, r, u);
- return "string" != typeof s || o || f[s] ? o ? !(h = s) : void 0 : (t.dataTypes.unshift(s), e(s), !1)
- }), h
- }
- var f = {},
- o = n === ci;
- return e(t.dataTypes[0]) || !f["*"] && e("*")
- }
- function ai(n, t) {
- var r, u, f = i.ajaxSettings.flatOptions || {};
- for (r in t) void 0 !== t[r] && ((f[r] ? n : u || (u = {}))[r] = t[r]);
- return u && i.extend(!0, n, u), n
- }
- function ae(n, t, i) {
- for (var e, u, f, o, s = n.contents, r = n.dataTypes;
- "*" === r[0];) r.shift(), void 0 === e && (e = n.mimeType || t.getResponseHeader("Content-Type"));
- if (e)
- for (u in s)
- if (s[u] && s[u].test(e)) {
- r.unshift(u);
- break
- }
- if (r[0] in i) f = r[0];
- else {
- for (u in i) {
- if (!r[0] || n.converters[u + " " + r[0]]) {
- f = u;
- break
- }
- o || (o = u)
- }
- f = f || o
- }
- if (f) return (f !== r[0] && r.unshift(f), i[f])
- }
- function ve(n, t, i, r) {
- var h, u, f, s, e, o = {},
- c = n.dataTypes.slice();
- if (c[1])
- for (f in n.converters) o[f.toLowerCase()] = n.converters[f];
- for (u = c.shift(); u;)
- if (n.responseFields[u] && (i[n.responseFields[u]] = t), !e && r && n.dataFilter && (t = n.dataFilter(t, n.dataType)), e = u, u = c.shift())
- if ("*" === u) u = e;
- else if ("*" !== e && e !== u) {
- if (f = o[e + " " + u] || o["* " + u], !f)
- for (h in o)
- if (s = h.split(" "), s[1] === u && (f = o[e + " " + s[0]] || o["* " + s[0]])) {
- f === !0 ? f = o[h] : o[h] !== !0 && (u = s[0], c.unshift(s[1]));
- break
- }
- if (f !== !0)
- if (f && n.throws) t = f(t);
- else try {
- t = f(t)
- } catch (l) {
- return {
- state: "parsererror",
- error: f ? l : "No conversion from " + e + " to " + u
- }
- }
- }
- return {
- state: "success",
- data: t
- }
- }
- function vi(n, t, r, u) {
- var f;
- if (i.isArray(t)) i.each(t, function(t, i) {
- r || pe.test(n) ? u(n, i) : vi(n + "[" + ("object" == typeof i ? t : "") + "]", i, r, u)
- });
- else if (r || "object" !== i.type(t)) u(n, t);
- else
- for (f in t) vi(n + "[" + f + "]", t[f], r, u)
- }
- function ku(n) {
- return i.isWindow(n) ? n : 9 === n.nodeType && n.defaultView
- }
- var w = [],
- a = w.slice,
- bi = w.concat,
- ti = w.push,
- ft = w.indexOf,
- et = {},
- nf = et.toString,
- ii = et.hasOwnProperty,
- f = {},
- u = n.document,
- ki = "2.1.4",
- i = function(n, t) {
- return new i.fn.init(n, t)
- },
- tf = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
- rf = /^-ms-/,
- uf = /-([\da-z])/gi,
- ff = function(n, t) {
- return t.toUpperCase()
- },
- y, ot, nr, tr, ir, rr, c, fi, st, l, b, at, oi, oe, su, g, hu, bt, cu, kt, dt, yi, ni, pi, wi, du, gu;
- i.fn = i.prototype = {
- jquery: ki,
- constructor: i,
- selector: "",
- length: 0,
- toArray: function() {
- return a.call(this)
- },
- get: function(n) {
- return null != n ? 0 > n ? this[n + this.length] : this[n] : a.call(this)
- },
- pushStack: function(n) {
- var t = i.merge(this.constructor(), n);
- return t.prevObject = this, t.context = this.context, t
- },
- each: function(n, t) {
- return i.each(this, n, t)
- },
- map: function(n) {
- return this.pushStack(i.map(this, function(t, i) {
- return n.call(t, i, t)
- }))
- },
- slice: function() {
- return this.pushStack(a.apply(this, arguments))
- },
- first: function() {
- return this.eq(0)
- },
- last: function() {
- return this.eq(-1)
- },
- eq: function(n) {
- var i = this.length,
- t = +n + (0 > n ? i : 0);
- return this.pushStack(t >= 0 && i > t ? [this[t]] : [])
- },
- end: function() {
- return this.prevObject || this.constructor(null)
- },
- push: ti,
- sort: w.sort,
- splice: w.splice
- };
- i.extend = i.fn.extend = function() {
- var e, f, r, t, o, s, n = arguments[0] || {},
- u = 1,
- c = arguments.length,
- h = !1;
- for ("boolean" == typeof n && (h = n, n = arguments[u] || {}, u++), "object" == typeof n || i.isFunction(n) || (n = {}), u === c && (n = this, u--); c > u; u++)
- if (null != (e = arguments[u]))
- for (f in e) r = n[f], t = e[f], n !== t && (h && t && (i.isPlainObject(t) || (o = i.isArray(t))) ? (o ? (o = !1, s = r && i.isArray(r) ? r : []) : s = r && i.isPlainObject(r) ? r : {}, n[f] = i.extend(h, s, t)) : void 0 !== t && (n[f] = t));
- return n
- };
- i.extend({
- expando: "jQuery" + (ki + Math.random()).replace(/\D/g, ""),
- isReady: !0,
- error: function(n) {
- throw new Error(n);
- },
- noop: function() {},
- isFunction: function(n) {
- return "function" === i.type(n)
- },
- isArray: Array.isArray,
- isWindow: function(n) {
- return null != n && n === n.window
- },
- isNumeric: function(n) {
- return !i.isArray(n) && n - parseFloat(n) + 1 >= 0
- },
- isPlainObject: function(n) {
- return "object" !== i.type(n) || n.nodeType || i.isWindow(n) ? !1 : n.constructor && !ii.call(n.constructor.prototype, "isPrototypeOf") ? !1 : !0
- },
- isEmptyObject: function(n) {
- for (var t in n) return !1;
- return !0
- },
- type: function(n) {
- return null == n ? n + "" : "object" == typeof n || "function" == typeof n ? et[nf.call(n)] || "object" : typeof n
- },
- globalEval: function(n) {
- var t, r = eval;
- n = i.trim(n);
- n && (1 === n.indexOf("use strict") ? (t = u.createElement("script"), t.text = n, u.head.appendChild(t).parentNode.removeChild(t)) : r(n))
- },
- camelCase: function(n) {
- return n.replace(rf, "ms-").replace(uf, ff)
- },
- nodeName: function(n, t) {
- return n.nodeName && n.nodeName.toLowerCase() === t.toLowerCase()
- },
- each: function(n, t, i) {
- var u, r = 0,
- f = n.length,
- e = ri(n);
- if (i) {
- if (e) {
- for (; f > r; r++)
- if (u = t.apply(n[r], i), u === !1) break
- } else
- for (r in n)
- if (u = t.apply(n[r], i), u === !1) break
- } else if (e) {
- for (; f > r; r++)
- if (u = t.call(n[r], r, n[r]), u === !1) break
- } else
- for (r in n)
- if (u = t.call(n[r], r, n[r]), u === !1) break; return n
- },
- trim: function(n) {
- return null == n ? "" : (n + "").replace(tf, "")
- },
- makeArray: function(n, t) {
- var r = t || [];
- return null != n && (ri(Object(n)) ? i.merge(r, "string" == typeof n ? [n] : n) : ti.call(r, n)), r
- },
- inArray: function(n, t, i) {
- return null == t ? -1 : ft.call(t, n, i)
- },
- merge: function(n, t) {
- for (var u = +t.length, i = 0, r = n.length; u > i; i++) n[r++] = t[i];
- return n.length = r, n
- },
- grep: function(n, t, i) {
- for (var u, f = [], r = 0, e = n.length, o = !i; e > r; r++) u = !t(n[r], r), u !== o && f.push(n[r]);
- return f
- },
- map: function(n, t, i) {
- var u, r = 0,
- e = n.length,
- o = ri(n),
- f = [];
- if (o)
- for (; e > r; r++) u = t(n[r], r, i), null != u && f.push(u);
- else
- for (r in n) u = t(n[r], r, i), null != u && f.push(u);
- return bi.apply([], f)
- },
- guid: 1,
- proxy: function(n, t) {
- var u, f, r;
- return "string" == typeof t && (u = n[t], t = n, n = u), i.isFunction(n) ? (f = a.call(arguments, 2), r = function() {
- return n.apply(t || this, f.concat(a.call(arguments)))
- }, r.guid = n.guid = n.guid || i.guid++, r) : void 0
- },
- now: Date.now,
- support: f
- });
- i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(n, t) {
- et["[object " + t + "]"] = t.toLowerCase()
- });
- y = function(n) {
- function r(n, t, i, r) {
- var p, s, a, c, w, y, d, v, nt, g;
- if ((t ? t.ownerDocument || t : h) !== o && k(t), t = t || o, i = i || [], c = t.nodeType, "string" != typeof n || !n || 1 !== c && 9 !== c && 11 !== c) return i;
- if (!r && l) {
- if (11 !== c && (p = hr.exec(n)))
- if (a = p[1]) {
- if (9 === c) {
- if (s = t.getElementById(a), !s || !s.parentNode) return i;
- if (s.id === a) return i.push(s), i
- } else if (t.ownerDocument && (s = t.ownerDocument.getElementById(a)) && et(t, s) && s.id === a) return i.push(s), i
- } else {
- if (p[2]) return b.apply(i, t.getElementsByTagName(n)), i;
- if ((a = p[3]) && u.getElementsByClassName) return b.apply(i, t.getElementsByClassName(a)), i
- }
- if (u.qsa && (!e || !e.test(n))) {
- if (v = d = f, nt = t, g = 1 !== c && n, 1 === c && "object" !== t.nodeName.toLowerCase()) {
- for (y = ft(n), (d = t.getAttribute("id")) ? v = d.replace(cr, "\\$&") : t.setAttribute("id", v), v = "[id='" + v + "'] ", w = y.length; w--;) y[w] = v + vt(y[w]);
- nt = dt.test(n) && ti(t.parentNode) || t;
- g = y.join(",")
- }
- if (g) try {
- return b.apply(i, nt.querySelectorAll(g)), i
- } catch (tt) {} finally {
- d || t.removeAttribute("id")
- }
- }
- }
- return oi(n.replace(lt, "$1"), t, i, r)
- }
- function gt() {
- function n(r, u) {
- return i.push(r + " ") > t.cacheLength && delete n[i.shift()], n[r + " "] = u
- }
- var i = [];
- return n
- }
- function c(n) {
- return n[f] = !0, n
- }
- function v(n) {
- var t = o.createElement("div");
- try {
- return !!n(t)
- } catch (i) {
- return !1
- } finally {
- t.parentNode && t.parentNode.removeChild(t);
- t = null
- }
- }
- function ni(n, i) {
- for (var u = n.split("|"), r = n.length; r--;) t.attrHandle[u[r]] = i
- }
- function wi(n, t) {
- var i = t && n,
- r = i && 1 === n.nodeType && 1 === t.nodeType && (~t.sourceIndex || li) - (~n.sourceIndex || li);
- if (r) return r;
- if (i)
- while (i = i.nextSibling)
- if (i === t) return -1;
- return n ? 1 : -1
- }
- function lr(n) {
- return function(t) {
- var i = t.nodeName.toLowerCase();
- return "input" === i && t.type === n
- }
- }
- function ar(n) {
- return function(t) {
- var i = t.nodeName.toLowerCase();
- return ("input" === i || "button" === i) && t.type === n
- }
- }
- function tt(n) {
- return c(function(t) {
- return t = +t, c(function(i, r) {
- for (var u, f = n([], i.length, t), e = f.length; e--;) i[u = f[e]] && (i[u] = !(r[u] = i[u]))
- })
- })
- }
- function ti(n) {
- return n && "undefined" != typeof n.getElementsByTagName && n
- }
- function bi() {}
- function vt(n) {
- for (var t = 0, r = n.length, i = ""; r > t; t++) i += n[t].value;
- return i
- }
- function ii(n, t, i) {
- var r = t.dir,
- u = i && "parentNode" === r,
- e = ki++;
- return t.first ? function(t, i, f) {
- while (t = t[r])
- if (1 === t.nodeType || u) return n(t, i, f)
- } : function(t, i, o) {
- var s, h, c = [a, e];
- if (o) {
- while (t = t[r])
- if ((1 === t.nodeType || u) && n(t, i, o)) return !0
- } else
- while (t = t[r])
- if (1 === t.nodeType || u) {
- if (h = t[f] || (t[f] = {}), (s = h[r]) && s[0] === a && s[1] === e) return c[2] = s[2];
- if (h[r] = c, c[2] = n(t, i, o)) return !0
- }
- }
- }
- function ri(n) {
- return n.length > 1 ? function(t, i, r) {
- for (var u = n.length; u--;)
- if (!n[u](t, i, r)) return !1;
- return !0
- } : n[0]
- }
- function vr(n, t, i) {
- for (var u = 0, f = t.length; f > u; u++) r(n, t[u], i);
- return i
- }
- function yt(n, t, i, r, u) {
- for (var e, o = [], f = 0, s = n.length, h = null != t; s > f; f++)(e = n[f]) && (!i || i(e, r, u)) && (o.push(e), h && t.push(f));
- return o
- }
- function ui(n, t, i, r, u, e) {
- return r && !r[f] && (r = ui(r)), u && !u[f] && (u = ui(u, e)), c(function(f, e, o, s) {
- var l, c, a, p = [],
- y = [],
- w = e.length,
- k = f || vr(t || "*", o.nodeType ? [o] : o, []),
- v = !n || !f && t ? k : yt(k, p, n, o, s),
- h = i ? u || (f ? n : w || r) ? [] : e : v;
- if (i && i(v, h, o, s), r)
- for (l = yt(h, y), r(l, [], o, s), c = l.length; c--;)(a = l[c]) && (h[y[c]] = !(v[y[c]] = a));
- if (f) {
- if (u || n) {
- if (u) {
- for (l = [], c = h.length; c--;)(a = h[c]) && l.push(v[c] = a);
- u(null, h = [], l, s)
- }
- for (c = h.length; c--;)(a = h[c]) && (l = u ? nt(f, a) : p[c]) > -1 && (f[l] = !(e[l] = a))
- }
- } else h = yt(h === e ? h.splice(w, h.length) : h), u ? u(null, e, h, s) : b.apply(e, h)
- })
- }
- function fi(n) {
- for (var o, u, r, s = n.length, h = t.relative[n[0].type], c = h || t.relative[" "], i = h ? 1 : 0, l = ii(function(n) {
- return n === o
- }, c, !0), a = ii(function(n) {
- return nt(o, n) > -1
- }, c, !0), e = [function(n, t, i) {
- var r = !h && (i || t !== ht) || ((o = t).nodeType ? l(n, t, i) : a(n, t, i));
- return o = null, r
- }]; s > i; i++)
- if (u = t.relative[n[i].type]) e = [ii(ri(e), u)];
- else {
- if (u = t.filter[n[i].type].apply(null, n[i].matches), u[f]) {
- for (r = ++i; s > r; r++)
- if (t.relative[n[r].type]) break;
- return ui(i > 1 && ri(e), i > 1 && vt(n.slice(0, i - 1).concat({
- value: " " === n[i - 2].type ? "*" : ""
- })).replace(lt, "$1"), u, r > i && fi(n.slice(i, r)), s > r && fi(n = n.slice(r)), s > r && vt(n))
- }
- e.push(u)
- }
- return ri(e)
- }
- function yr(n, i) {
- var u = i.length > 0,
- f = n.length > 0,
- e = function(e, s, h, c, l) {
- var y, d, w, k = 0,
- v = "0",
- g = e && [],
- p = [],
- nt = ht,
- tt = e || f && t.find.TAG("*", l),
- it = a += null == nt ? 1 : Math.random() || .1,
- rt = tt.length;
- for (l && (ht = s !== o && s); v !== rt && null != (y = tt[v]); v++) {
- if (f && y) {
- for (d = 0; w = n[d++];)
- if (w(y, s, h)) {
- c.push(y);
- break
- }
- l && (a = it)
- }
- u && ((y = !w && y) && k--, e && g.push(y))
- }
- if (k += v, u && v !== k) {
- for (d = 0; w = i[d++];) w(g, p, s, h);
- if (e) {
- if (k > 0)
- while (v--) g[v] || p[v] || (p[v] = gi.call(c));
- p = yt(p)
- }
- b.apply(c, p);
- l && !e && p.length > 0 && k + i.length > 1 && r.uniqueSort(c)
- }
- return l && (a = it, ht = nt), g
- };
- return u ? c(e) : e
- }
- var it, u, t, st, ei, ft, pt, oi, ht, w, rt, k, o, s, l, e, d, ct, et, f = "sizzle" + 1 * new Date,
- h = n.document,
- a = 0,
- ki = 0,
- si = gt(),
- hi = gt(),
- ci = gt(),
- wt = function(n, t) {
- return n === t && (rt = !0), 0
- },
- li = -2147483648,
- di = {}.hasOwnProperty,
- g = [],
- gi = g.pop,
- nr = g.push,
- b = g.push,
- ai = g.slice,
- nt = function(n, t) {
- for (var i = 0, r = n.length; r > i; i++)
- if (n[i] === t) return i;
- return -1
- },
- bt = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
- i = "[\\x20\\t\\r\\n\\f]",
- ut = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
- vi = ut.replace("w", "w#"),
- yi = "\\[" + i + "*(" + ut + ")(?:" + i + "*([*^$|!~]?=)" + i + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + vi + "))|)" + i + "*\\]",
- kt = ":(" + ut + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + yi + ")*)|.*)\\)|)",
- tr = new RegExp(i + "+", "g"),
- lt = new RegExp("^" + i + "+|((?:^|[^\\\\])(?:\\\\.)*)" + i + "+$", "g"),
- ir = new RegExp("^" + i + "*," + i + "*"),
- rr = new RegExp("^" + i + "*([>+~]|" + i + ")" + i + "*"),
- ur = new RegExp("=" + i + "*([^\\]'\"]*?)" + i + "*\\]", "g"),
- fr = new RegExp(kt),
- er = new RegExp("^" + vi + "$"),
- at = {
- ID: new RegExp("^#(" + ut + ")"),
- CLASS: new RegExp("^\\.(" + ut + ")"),
- TAG: new RegExp("^(" + ut.replace("w", "w*") + ")"),
- ATTR: new RegExp("^" + yi),
- PSEUDO: new RegExp("^" + kt),
- CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + i + "*(even|odd|(([+-]|)(\\d*)n|)" + i + "*(?:([+-]|)" + i + "*(\\d+)|))" + i + "*\\)|)", "i"),
- bool: new RegExp("^(?:" + bt + ")$", "i"),
- needsContext: new RegExp("^" + i + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + i + "*((?:-\\d)?\\d*)" + i + "*\\)|)(?=[^-]|$)", "i")
- },
- or = /^(?:input|select|textarea|button)$/i,
- sr = /^h\d$/i,
- ot = /^[^{]+\{\s*\[native \w/,
- hr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
- dt = /[+~]/,
- cr = /'|\\/g,
- y = new RegExp("\\\\([\\da-f]{1,6}" + i + "?|(" + i + ")|.)", "ig"),
- p = function(n, t, i) {
- var r = "0x" + t - 65536;
- return r !== r || i ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320)
- },
- pi = function() {
- k()
- };
- try {
- b.apply(g = ai.call(h.childNodes), h.childNodes);
- g[h.childNodes.length].nodeType
- } catch (pr) {
- b = {
- apply: g.length ? function(n, t) {
- nr.apply(n, ai.call(t))
- } : function(n, t) {
- for (var i = n.length, r = 0; n[i++] = t[r++];);
- n.length = i - 1
- }
- }
- }
- u = r.support = {};
- ei = r.isXML = function(n) {
- var t = n && (n.ownerDocument || n).documentElement;
- return t ? "HTML" !== t.nodeName : !1
- };
- k = r.setDocument = function(n) {
- var a, c, r = n ? n.ownerDocument || n : h;
- return r !== o && 9 === r.nodeType && r.documentElement ? (o = r, s = r.documentElement, c = r.defaultView, c && c !== c.top && (c.addEventListener ? c.addEventListener("unload", pi, !1) : c.attachEvent && c.attachEvent("onunload", pi)), l = !ei(r), u.attributes = v(function(n) {
- return n.className = "i", !n.getAttribute("className")
- }), u.getElementsByTagName = v(function(n) {
- return n.appendChild(r.createComment("")), !n.getElementsByTagName("*").length
- }), u.getElementsByClassName = ot.test(r.getElementsByClassName), u.getById = v(function(n) {
- return s.appendChild(n).id = f, !r.getElementsByName || !r.getElementsByName(f).length
- }), u.getById ? (t.find.ID = function(n, t) {
- if ("undefined" != typeof t.getElementById && l) {
- var i = t.getElementById(n);
- return i && i.parentNode ? [i] : []
- }
- }, t.filter.ID = function(n) {
- var t = n.replace(y, p);
- return function(n) {
- return n.getAttribute("id") === t
- }
- }) : (delete t.find.ID, t.filter.ID = function(n) {
- var t = n.replace(y, p);
- return function(n) {
- var i = "undefined" != typeof n.getAttributeNode && n.getAttributeNode("id");
- return i && i.value === t
- }
- }), t.find.TAG = u.getElementsByTagName ? function(n, t) {
- return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(n) : u.qsa ? t.querySelectorAll(n) : void 0
- } : function(n, t) {
- var i, r = [],
- f = 0,
- u = t.getElementsByTagName(n);
- if ("*" === n) {
- while (i = u[f++]) 1 === i.nodeType && r.push(i);
- return r
- }
- return u
- }, t.find.CLASS = u.getElementsByClassName && function(n, t) {
- if (l) return t.getElementsByClassName(n)
- }, d = [], e = [], (u.qsa = ot.test(r.querySelectorAll)) && (v(function(n) {
- s.appendChild(n).innerHTML = "<a id='" + f + "'><\/a><select id='" + f + "-\f]' msallowcapture=''><option selected=''><\/option><\/select>";
- n.querySelectorAll("[msallowcapture^='']").length && e.push("[*^$]=" + i + "*(?:''|\"\")");
- n.querySelectorAll("[selected]").length || e.push("\\[" + i + "*(?:value|" + bt + ")");
- n.querySelectorAll("[id~=" + f + "-]").length || e.push("~=");
- n.querySelectorAll(":checked").length || e.push(":checked");
- n.querySelectorAll("a#" + f + "+*").length || e.push(".#.+[+~]")
- }), v(function(n) {
- var t = r.createElement("input");
- t.setAttribute("type", "hidden");
- n.appendChild(t).setAttribute("name", "D");
- n.querySelectorAll("[name=d]").length && e.push("name" + i + "*[*^$|!~]?=");
- n.querySelectorAll(":enabled").length || e.push(":enabled", ":disabled");
- n.querySelectorAll("*,:x");
- e.push(",.*:")
- })), (u.matchesSelector = ot.test(ct = s.matches || s.webkitMatchesSelector || s.mozMatchesSelector || s.oMatchesSelector || s.msMatchesSelector)) && v(function(n) {
- u.disconnectedMatch = ct.call(n, "div");
- ct.call(n, "[s!='']:x");
- d.push("!=", kt)
- }), e = e.length && new RegExp(e.join("|")), d = d.length && new RegExp(d.join("|")), a = ot.test(s.compareDocumentPosition), et = a || ot.test(s.contains) ? function(n, t) {
- var r = 9 === n.nodeType ? n.documentElement : n,
- i = t && t.parentNode;
- return n === i || !(!i || 1 !== i.nodeType || !(r.contains ? r.contains(i) : n.compareDocumentPosition && 16 & n.compareDocumentPosition(i)))
- } : function(n, t) {
- if (t)
- while (t = t.parentNode)
- if (t === n) return !0;
- return !1
- }, wt = a ? function(n, t) {
- if (n === t) return rt = !0, 0;
- var i = !n.compareDocumentPosition - !t.compareDocumentPosition;
- return i ? i : (i = (n.ownerDocument || n) === (t.ownerDocument || t) ? n.compareDocumentPosition(t) : 1, 1 & i || !u.sortDetached && t.compareDocumentPosition(n) === i ? n === r || n.ownerDocument === h && et(h, n) ? -1 : t === r || t.ownerDocument === h && et(h, t) ? 1 : w ? nt(w, n) - nt(w, t) : 0 : 4 & i ? -1 : 1)
- } : function(n, t) {
- if (n === t) return rt = !0, 0;
- var i, u = 0,
- o = n.parentNode,
- s = t.parentNode,
- f = [n],
- e = [t];
- if (!o || !s) return n === r ? -1 : t === r ? 1 : o ? -1 : s ? 1 : w ? nt(w, n) - nt(w, t) : 0;
- if (o === s) return wi(n, t);
- for (i = n; i = i.parentNode;) f.unshift(i);
- for (i = t; i = i.parentNode;) e.unshift(i);
- while (f[u] === e[u]) u++;
- return u ? wi(f[u], e[u]) : f[u] === h ? -1 : e[u] === h ? 1 : 0
- }, r) : o
- };
- r.matches = function(n, t) {
- return r(n, null, null, t)
- };
- r.matchesSelector = function(n, t) {
- if ((n.ownerDocument || n) !== o && k(n), t = t.replace(ur, "='$1']"), !(!u.matchesSelector || !l || d && d.test(t) || e && e.test(t))) try {
- var i = ct.call(n, t);
- if (i || u.disconnectedMatch || n.document && 11 !== n.document.nodeType) return i
- } catch (f) {}
- return r(t, o, null, [n]).length > 0
- };
- r.contains = function(n, t) {
- return (n.ownerDocument || n) !== o && k(n), et(n, t)
- };
- r.attr = function(n, i) {
- (n.ownerDocument || n) !== o && k(n);
- var f = t.attrHandle[i.toLowerCase()],
- r = f && di.call(t.attrHandle, i.toLowerCase()) ? f(n, i, !l) : void 0;
- return void 0 !== r ? r : u.attributes || !l ? n.getAttribute(i) : (r = n.getAttributeNode(i)) && r.specified ? r.value : null
- };
- r.error = function(n) {
- throw new Error("Syntax error, unrecognized expression: " + n);
- };
- r.uniqueSort = function(n) {
- var r, f = [],
- t = 0,
- i = 0;
- if (rt = !u.detectDuplicates, w = !u.sortStable && n.slice(0), n.sort(wt), rt) {
- while (r = n[i++]) r === n[i] && (t = f.push(i));
- while (t--) n.splice(f[t], 1)
- }
- return w = null, n
- };
- st = r.getText = function(n) {
- var r, i = "",
- u = 0,
- t = n.nodeType;
- if (t) {
- if (1 === t || 9 === t || 11 === t) {
- if ("string" == typeof n.textContent) return n.textContent;
- for (n = n.firstChild; n; n = n.nextSibling) i += st(n)
- } else if (3 === t || 4 === t) return n.nodeValue
- } else
- while (r = n[u++]) i += st(r);
- return i
- };
- t = r.selectors = {
- cacheLength: 50,
- createPseudo: c,
- match: at,
- attrHandle: {},
- find: {},
- relative: {
- ">": {
- dir: "parentNode",
- first: !0
- },
- " ": {
- dir: "parentNode"
- },
- "+": {
- dir: "previousSibling",
- first: !0
- },
- "~": {
- dir: "previousSibling"
- }
- },
- preFilter: {
- ATTR: function(n) {
- return n[1] = n[1].replace(y, p), n[3] = (n[3] || n[4] || n[5] || "").replace(y, p), "~=" === n[2] && (n[3] = " " + n[3] + " "), n.slice(0, 4)
- },
- CHILD: function(n) {
- return n[1] = n[1].toLowerCase(), "nth" === n[1].slice(0, 3) ? (n[3] || r.error(n[0]), n[4] = +(n[4] ? n[5] + (n[6] || 1) : 2 * ("even" === n[3] || "odd" === n[3])), n[5] = +(n[7] + n[8] || "odd" === n[3])) : n[3] && r.error(n[0]), n
- },
- PSEUDO: function(n) {
- var i, t = !n[6] && n[2];
- return at.CHILD.test(n[0]) ? null : (n[3] ? n[2] = n[4] || n[5] || "" : t && fr.test(t) && (i = ft(t, !0)) && (i = t.indexOf(")", t.length - i) - t.length) && (n[0] = n[0].slice(0, i), n[2] = t.slice(0, i)), n.slice(0, 3))
- }
- },
- filter: {
- TAG: function(n) {
- var t = n.replace(y, p).toLowerCase();
- return "*" === n ? function() {
- return !0
- } : function(n) {
- return n.nodeName && n.nodeName.toLowerCase() === t
- }
- },
- CLASS: function(n) {
- var t = si[n + " "];
- return t || (t = new RegExp("(^|" + i + ")" + n + "(" + i + "|$)")) && si(n, function(n) {
- return t.test("string" == typeof n.className && n.className || "undefined" != typeof n.getAttribute && n.getAttribute("class") || "")
- })
- },
- ATTR: function(n, t, i) {
- return function(u) {
- var f = r.attr(u, n);
- return null == f ? "!=" === t : t ? (f += "", "=" === t ? f === i : "!=" === t ? f !== i : "^=" === t ? i && 0 === f.indexOf(i) : "*=" === t ? i && f.indexOf(i) > -1 : "$=" === t ? i && f.slice(-i.length) === i : "~=" === t ? (" " + f.replace(tr, " ") + " ").indexOf(i) > -1 : "|=" === t ? f === i || f.slice(0, i.length + 1) === i + "-" : !1) : !0
- }
- },
- CHILD: function(n, t, i, r, u) {
- var s = "nth" !== n.slice(0, 3),
- o = "last" !== n.slice(-4),
- e = "of-type" === t;
- return 1 === r && 0 === u ? function(n) {
- return !!n.parentNode
- } : function(t, i, h) {
- var v, k, c, l, y, w, b = s !== o ? "nextSibling" : "previousSibling",
- p = t.parentNode,
- g = e && t.nodeName.toLowerCase(),
- d = !h && !e;
- if (p) {
- if (s) {
- while (b) {
- for (c = t; c = c[b];)
- if (e ? c.nodeName.toLowerCase() === g : 1 === c.nodeType) return !1;
- w = b = "only" === n && !w && "nextSibling"
- }
- return !0
- }
- if (w = [o ? p.firstChild : p.lastChild], o && d) {
- for (k = p[f] || (p[f] = {}), v = k[n] || [], y = v[0] === a && v[1], l = v[0] === a && v[2], c = y && p.childNodes[y]; c = ++y && c && c[b] || (l = y = 0) || w.pop();)
- if (1 === c.nodeType && ++l && c === t) {
- k[n] = [a, y, l];
- break
- }
- } else if (d && (v = (t[f] || (t[f] = {}))[n]) && v[0] === a) l = v[1];
- else
- while (c = ++y && c && c[b] || (l = y = 0) || w.pop())
- if ((e ? c.nodeName.toLowerCase() === g : 1 === c.nodeType) && ++l && (d && ((c[f] || (c[f] = {}))[n] = [a, l]), c === t)) break; return l -= u, l === r || l % r == 0 && l / r >= 0
- }
- }
- },
- PSEUDO: function(n, i) {
- var e, u = t.pseudos[n] || t.setFilters[n.toLowerCase()] || r.error("unsupported pseudo: " + n);
- return u[f] ? u(i) : u.length > 1 ? (e = [n, n, "", i], t.setFilters.hasOwnProperty(n.toLowerCase()) ? c(function(n, t) {
- for (var r, f = u(n, i), e = f.length; e--;) r = nt(n, f[e]), n[r] = !(t[r] = f[e])
- }) : function(n) {
- return u(n, 0, e)
- }) : u
- }
- },
- pseudos: {
- not: c(function(n) {
- var t = [],
- r = [],
- i = pt(n.replace(lt, "$1"));
- return i[f] ? c(function(n, t, r, u) {
- for (var e, o = i(n, null, u, []), f = n.length; f--;)(e = o[f]) && (n[f] = !(t[f] = e))
- }) : function(n, u, f) {
- return t[0] = n, i(t, null, f, r), t[0] = null, !r.pop()
- }
- }),
- has: c(function(n) {
- return function(t) {
- return r(n, t).length > 0
- }
- }),
- contains: c(function(n) {
- return n = n.replace(y, p),
- function(t) {
- return (t.textContent || t.innerText || st(t)).indexOf(n) > -1
- }
- }),
- lang: c(function(n) {
- return er.test(n || "") || r.error("unsupported lang: " + n), n = n.replace(y, p).toLowerCase(),
- function(t) {
- var i;
- do
- if (i = l ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return i = i.toLowerCase(), i === n || 0 === i.indexOf(n + "-");
- while ((t = t.parentNode) && 1 === t.nodeType);
- return !1
- }
- }),
- target: function(t) {
- var i = n.location && n.location.hash;
- return i && i.slice(1) === t.id
- },
- root: function(n) {
- return n === s
- },
- focus: function(n) {
- return n === o.activeElement && (!o.hasFocus || o.hasFocus()) && !!(n.type || n.href || ~n.tabIndex)
- },
- enabled: function(n) {
- return n.disabled === !1
- },
- disabled: function(n) {
- return n.disabled === !0
- },
- checked: function(n) {
- var t = n.nodeName.toLowerCase();
- return "input" === t && !!n.checked || "option" === t && !!n.selected
- },
- selected: function(n) {
- return n.parentNode && n.parentNode.selectedIndex, n.selected === !0
- },
- empty: function(n) {
- for (n = n.firstChild; n; n = n.nextSibling)
- if (n.nodeType < 6) return !1;
- return !0
- },
- parent: function(n) {
- return !t.pseudos.empty(n)
- },
- header: function(n) {
- return sr.test(n.nodeName)
- },
- input: function(n) {
- return or.test(n.nodeName)
- },
- button: function(n) {
- var t = n.nodeName.toLowerCase();
- return "input" === t && "button" === n.type || "button" === t
- },
- text: function(n) {
- var t;
- return "input" === n.nodeName.toLowerCase() && "text" === n.type && (null == (t = n.getAttribute("type")) || "text" === t.toLowerCase())
- },
- first: tt(function() {
- return [0]
- }),
- last: tt(function(n, t) {
- return [t - 1]
- }),
- eq: tt(function(n, t, i) {
- return [0 > i ? i + t : i]
- }),
- even: tt(function(n, t) {
- for (var i = 0; t > i; i += 2) n.push(i);
- return n
- }),
- odd: tt(function(n, t) {
- for (var i = 1; t > i; i += 2) n.push(i);
- return n
- }),
- lt: tt(function(n, t, i) {
- for (var r = 0 > i ? i + t : i; --r >= 0;) n.push(r);
- return n
- }),
- gt: tt(function(n, t, i) {
- for (var r = 0 > i ? i + t : i; ++r < t;) n.push(r);
- return n
- })
- }
- };
- t.pseudos.nth = t.pseudos.eq;
- for (it in {
- radio: !0,
- checkbox: !0,
- file: !0,
- password: !0,
- image: !0
- }) t.pseudos[it] = lr(it);
- for (it in {
- submit: !0,
- reset: !0
- }) t.pseudos[it] = ar(it);
- return bi.prototype = t.filters = t.pseudos, t.setFilters = new bi, ft = r.tokenize = function(n, i) {
- var e, f, s, o, u, h, c, l = hi[n + " "];
- if (l) return i ? 0 : l.slice(0);
- for (u = n, h = [], c = t.preFilter; u;) {
- (!e || (f = ir.exec(u))) && (f && (u = u.slice(f[0].length) || u), h.push(s = []));
- e = !1;
- (f = rr.exec(u)) && (e = f.shift(), s.push({
- value: e,
- type: f[0].replace(lt, " ")
- }), u = u.slice(e.length));
- for (o in t.filter)(f = at[o].exec(u)) && (!c[o] || (f = c[o](f))) && (e = f.shift(), s.push({
- value: e,
- type: o,
- matches: f
- }), u = u.slice(e.length));
- if (!e) break
- }
- return i ? u.length : u ? r.error(n) : hi(n, h).slice(0)
- }, pt = r.compile = function(n, t) {
- var r, u = [],
- e = [],
- i = ci[n + " "];
- if (!i) {
- for (t || (t = ft(n)), r = t.length; r--;) i = fi(t[r]), i[f] ? u.push(i) : e.push(i);
- i = ci(n, yr(e, u));
- i.selector = n
- }
- return i
- }, oi = r.select = function(n, i, r, f) {
- var s, e, o, a, v, c = "function" == typeof n && n,
- h = !f && ft(n = c.selector || n);
- if (r = r || [], 1 === h.length) {
- if (e = h[0] = h[0].slice(0), e.length > 2 && "ID" === (o = e[0]).type && u.getById && 9 === i.nodeType && l && t.relative[e[1].type]) {
- if (i = (t.find.ID(o.matches[0].replace(y, p), i) || [])[0], !i) return r;
- c && (i = i.parentNode);
- n = n.slice(e.shift().value.length)
- }
- for (s = at.needsContext.test(n) ? 0 : e.length; s--;) {
- if (o = e[s], t.relative[a = o.type]) break;
- if ((v = t.find[a]) && (f = v(o.matches[0].replace(y, p), dt.test(e[0].type) && ti(i.parentNode) || i))) {
- if (e.splice(s, 1), n = f.length && vt(e), !n) return b.apply(r, f), r;
- break
- }
- }
- }
- return (c || pt(n, h))(f, i, !l, r, dt.test(n) && ti(i.parentNode) || i), r
- }, u.sortStable = f.split("").sort(wt).join("") === f, u.detectDuplicates = !!rt, k(), u.sortDetached = v(function(n) {
- return 1 & n.compareDocumentPosition(o.createElement("div"))
- }), v(function(n) {
- return n.innerHTML = "<a href='#'><\/a>", "#" === n.firstChild.getAttribute("href")
- }) || ni("type|href|height|width", function(n, t, i) {
- if (!i) return n.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
- }), u.attributes && v(function(n) {
- return n.innerHTML = "<input/>", n.firstChild.setAttribute("value", ""), "" === n.firstChild.getAttribute("value")
- }) || ni("value", function(n, t, i) {
- if (!i && "input" === n.nodeName.toLowerCase()) return n.defaultValue
- }), v(function(n) {
- return null == n.getAttribute("disabled")
- }) || ni(bt, function(n, t, i) {
- var r;
- if (!i) return n[t] === !0 ? t.toLowerCase() : (r = n.getAttributeNode(t)) && r.specified ? r.value : null
- }), r
- }(n);
- i.find = y;
- i.expr = y.selectors;
- i.expr[":"] = i.expr.pseudos;
- i.unique = y.uniqueSort;
- i.text = y.getText;
- i.isXMLDoc = y.isXML;
- i.contains = y.contains;
- var di = i.expr.match.needsContext,
- gi = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
- ef = /^.[^:#\[\.,]*$/;
- i.filter = function(n, t, r) {
- var u = t[0];
- return r && (n = ":not(" + n + ")"), 1 === t.length && 1 === u.nodeType ? i.find.matchesSelector(u, n) ? [u] : [] : i.find.matches(n, i.grep(t, function(n) {
- return 1 === n.nodeType
- }))
- };
- i.fn.extend({
- find: function(n) {
- var t, u = this.length,
- r = [],
- f = this;
- if ("string" != typeof n) return this.pushStack(i(n).filter(function() {
- for (t = 0; u > t; t++)
- if (i.contains(f[t], this)) return !0
- }));
- for (t = 0; u > t; t++) i.find(n, f[t], r);
- return r = this.pushStack(u > 1 ? i.unique(r) : r), r.selector = this.selector ? this.selector + " " + n : n, r
- },
- filter: function(n) {
- return this.pushStack(ui(this, n || [], !1))
- },
- not: function(n) {
- return this.pushStack(ui(this, n || [], !0))
- },
- is: function(n) {
- return !!ui(this, "string" == typeof n && di.test(n) ? i(n) : n || [], !1).length
- }
- });
- nr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
- tr = i.fn.init = function(n, t) {
- var r, f;
- if (!n) return this;
- if ("string" == typeof n) {
- if (r = "<" === n[0] && ">" === n[n.length - 1] && n.length >= 3 ? [null, n, null] : nr.exec(n), !r || !r[1] && t) return !t || t.jquery ? (t || ot).find(n) : this.constructor(t).find(n);
- if (r[1]) {
- if (t = t instanceof i ? t[0] : t, i.merge(this, i.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : u, !0)), gi.test(r[1]) && i.isPlainObject(t))
- for (r in t) i.isFunction(this[r]) ? this[r](t[r]) : this.attr(r, t[r]);
- return this
- }
- return f = u.getElementById(r[2]), f && f.parentNode && (this.length = 1, this[0] = f), this.context = u, this.selector = n, this
- }
- return n.nodeType ? (this.context = this[0] = n, this.length = 1, this) : i.isFunction(n) ? "undefined" != typeof ot.ready ? ot.ready(n) : n(i) : (void 0 !== n.selector && (this.selector = n.selector, this.context = n.context), i.makeArray(n, this))
- };
- tr.prototype = i.fn;
- ot = i(u);
- ir = /^(?:parents|prev(?:Until|All))/;
- rr = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- i.extend({
- dir: function(n, t, r) {
- for (var u = [], f = void 0 !== r;
- (n = n[t]) && 9 !== n.nodeType;)
- if (1 === n.nodeType) {
- if (f && i(n).is(r)) break;
- u.push(n)
- }
- return u
- },
- sibling: function(n, t) {
- for (var i = []; n; n = n.nextSibling) 1 === n.nodeType && n !== t && i.push(n);
- return i
- }
- });
- i.fn.extend({
- has: function(n) {
- var t = i(n, this),
- r = t.length;
- return this.filter(function() {
- for (var n = 0; r > n; n++)
- if (i.contains(this, t[n])) return !0
- })
- },
- closest: function(n, t) {
- for (var r, f = 0, o = this.length, u = [], e = di.test(n) || "string" != typeof n ? i(n, t || this.context) : 0; o > f; f++)
- for (r = this[f]; r && r !== t; r = r.parentNode)
- if (r.nodeType < 11 && (e ? e.index(r) > -1 : 1 === r.nodeType && i.find.matchesSelector(r, n))) {
- u.push(r);
- break
- }
- return this.pushStack(u.length > 1 ? i.unique(u) : u)
- },
- index: function(n) {
- return n ? "string" == typeof n ? ft.call(i(n), this[0]) : ft.call(this, n.jquery ? n[0] : n) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
- },
- add: function(n, t) {
- return this.pushStack(i.unique(i.merge(this.get(), i(n, t))))
- },
- addBack: function(n) {
- return this.add(null == n ? this.prevObject : this.prevObject.filter(n))
- }
- });
- i.each({
- parent: function(n) {
- var t = n.parentNode;
- return t && 11 !== t.nodeType ? t : null
- },
- parents: function(n) {
- return i.dir(n, "parentNode")
- },
- parentsUntil: function(n, t, r) {
- return i.dir(n, "parentNode", r)
- },
- next: function(n) {
- return ur(n, "nextSibling")
- },
- prev: function(n) {
- return ur(n, "previousSibling")
- },
- nextAll: function(n) {
- return i.dir(n, "nextSibling")
- },
- prevAll: function(n) {
- return i.dir(n, "previousSibling")
- },
- nextUntil: function(n, t, r) {
- return i.dir(n, "nextSibling", r)
- },
- prevUntil: function(n, t, r) {
- return i.dir(n, "previousSibling", r)
- },
- siblings: function(n) {
- return i.sibling((n.parentNode || {}).firstChild, n)
- },
- children: function(n) {
- return i.sibling(n.firstChild)
- },
- contents: function(n) {
- return n.contentDocument || i.merge([], n.childNodes)
- }
- }, function(n, t) {
- i.fn[n] = function(r, u) {
- var f = i.map(this, t, r);
- return "Until" !== n.slice(-5) && (u = r), u && "string" == typeof u && (f = i.filter(u, f)), this.length > 1 && (rr[n] || i.unique(f), ir.test(n) && f.reverse()), this.pushStack(f)
- }
- });
- c = /\S+/g;
- fi = {};
- i.Callbacks = function(n) {
- n = "string" == typeof n ? fi[n] || of(n) : i.extend({}, n);
- var u, h, o, c, f, e, t = [],
- r = !n.once && [],
- l = function(i) {
- for (u = n.memory && i, h = !0, e = c || 0, c = 0, f = t.length, o = !0; t && f > e; e++)
- if (t[e].apply(i[0], i[1]) === !1 && n.stopOnFalse) {
- u = !1;
- break
- }
- o = !1;
- t && (r ? r.length && l(r.shift()) : u ? t = [] : s.disable())
- },
- s = {
- add: function() {
- if (t) {
- var r = t.length;
- ! function e(r) {
- i.each(r, function(r, u) {
- var f = i.type(u);
- "function" === f ? n.unique && s.has(u) || t.push(u) : u && u.length && "string" !== f && e(u)
- })
- }(arguments);
- o ? f = t.length : u && (c = r, l(u))
- }
- return this
- },
- remove: function() {
- return t && i.each(arguments, function(n, r) {
- for (var u;
- (u = i.inArray(r, t, u)) > -1;) t.splice(u, 1), o && (f >= u && f--, e >= u && e--)
- }), this
- },
- has: function(n) {
- return n ? i.inArray(n, t) > -1 : !(!t || !t.length)
- },
- empty: function() {
- return t = [], f = 0, this
- },
- disable: function() {
- return t = r = u = void 0, this
- },
- disabled: function() {
- return !t
- },
- lock: function() {
- return r = void 0, u || s.disable(), this
- },
- locked: function() {
- return !r
- },
- fireWith: function(n, i) {
- return !t || h && !r || (i = i || [], i = [n, i.slice ? i.slice() : i], o ? r.push(i) : l(i)), this
- },
- fire: function() {
- return s.fireWith(this, arguments), this
- },
- fired: function() {
- return !!h
- }
- };
- return s
- };
- i.extend({
- Deferred: function(n) {
- var u = [
- ["resolve", "done", i.Callbacks("once memory"), "resolved"],
- ["reject", "fail", i.Callbacks("once memory"), "rejected"],
- ["notify", "progress", i.Callbacks("memory")]
- ],
- f = "pending",
- r = {
- state: function() {
- return f
- },
- always: function() {
- return t.done(arguments).fail(arguments), this
- },
- then: function() {
- var n = arguments;
- return i.Deferred(function(f) {
- i.each(u, function(u, e) {
- var o = i.isFunction(n[u]) && n[u];
- t[e[1]](function() {
- var n = o && o.apply(this, arguments);
- n && i.isFunction(n.promise) ? n.promise().done(f.resolve).fail(f.reject).progress(f.notify) : f[e[0] + "With"](this === r ? f.promise() : this, o ? [n] : arguments)
- })
- });
- n = null
- }).promise()
- },
- promise: function(n) {
- return null != n ? i.extend(n, r) : r
- }
- },
- t = {};
- return r.pipe = r.then, i.each(u, function(n, i) {
- var e = i[2],
- o = i[3];
- r[i[1]] = e.add;
- o && e.add(function() {
- f = o
- }, u[1 ^ n][2].disable, u[2][2].lock);
- t[i[0]] = function() {
- return t[i[0] + "With"](this === t ? r : this, arguments), this
- };
- t[i[0] + "With"] = e.fireWith
- }), r.promise(t), n && n.call(t, t), t
- },
- when: function(n) {
- var t = 0,
- u = a.call(arguments),
- r = u.length,
- e = 1 !== r || n && i.isFunction(n.promise) ? r : 0,
- f = 1 === e ? n : i.Deferred(),
- h = function(n, t, i) {
- return function(r) {
- t[n] = this;
- i[n] = arguments.length > 1 ? a.call(arguments) : r;
- i === o ? f.notifyWith(t, i) : --e || f.resolveWith(t, i)
- }
- },
- o, c, s;
- if (r > 1)
- for (o = new Array(r), c = new Array(r), s = new Array(r); r > t; t++) u[t] && i.isFunction(u[t].promise) ? u[t].promise().done(h(t, s, u)).fail(f.reject).progress(h(t, c, o)) : --e;
- return e || f.resolveWith(s, u), f.promise()
- }
- });
- i.fn.ready = function(n) {
- return i.ready.promise().done(n), this
- };
- i.extend({
- isReady: !1,
- readyWait: 1,
- holdReady: function(n) {
- n ? i.readyWait++ : i.ready(!0)
- },
- ready: function(n) {
- (n === !0 ? --i.readyWait : i.isReady) || (i.isReady = !0, n !== !0 && --i.readyWait > 0 || (st.resolveWith(u, [i]), i.fn.triggerHandler && (i(u).triggerHandler("ready"), i(u).off("ready"))))
- }
- });
- i.ready.promise = function(t) {
- return st || (st = i.Deferred(), "complete" === u.readyState ? setTimeout(i.ready) : (u.addEventListener("DOMContentLoaded", ht, !1), n.addEventListener("load", ht, !1))), st.promise(t)
- };
- i.ready.promise();
- l = i.access = function(n, t, r, u, f, e, o) {
- var s = 0,
- c = n.length,
- h = null == r;
- if ("object" === i.type(r)) {
- f = !0;
- for (s in r) i.access(n, t, s, r[s], !0, e, o)
- } else if (void 0 !== u && (f = !0, i.isFunction(u) || (o = !0), h && (o ? (t.call(n, u), t = null) : (h = t, t = function(n, t, r) {
- return h.call(i(n), r)
- })), t))
- for (; c > s; s++) t(n[s], r, o ? u : u.call(n[s], s, t(n[s], r)));
- return f ? n : h ? t.call(n) : c ? t(n[0], r) : e
- };
- i.acceptData = function(n) {
- return 1 === n.nodeType || 9 === n.nodeType || !+n.nodeType
- };
- v.uid = 1;
- v.accepts = i.acceptData;
- v.prototype = {
- key: function(n) {
- if (!v.accepts(n)) return 0;
- var r = {},
- t = n[this.expando];
- if (!t) {
- t = v.uid++;
- try {
- r[this.expando] = {
- value: t
- };
- Object.defineProperties(n, r)
- } catch (u) {
- r[this.expando] = t;
- i.extend(n, r)
- }
- }
- return this.cache[t] || (this.cache[t] = {}), t
- },
- set: function(n, t, r) {
- var f, e = this.key(n),
- u = this.cache[e];
- if ("string" == typeof t) u[t] = r;
- else if (i.isEmptyObject(u)) i.extend(this.cache[e], t);
- else
- for (f in t) u[f] = t[f];
- return u
- },
- get: function(n, t) {
- var i = this.cache[this.key(n)];
- return void 0 === t ? i : i[t]
- },
- access: function(n, t, r) {
- var u;
- return void 0 === t || t && "string" == typeof t && void 0 === r ? (u = this.get(n, t), void 0 !== u ? u : this.get(n, i.camelCase(t))) : (this.set(n, t, r), void 0 !== r ? r : t)
- },
- remove: function(n, t) {
- var u, r, f, o = this.key(n),
- e = this.cache[o];
- if (void 0 === t) this.cache[o] = {};
- else
- for (i.isArray(t) ? r = t.concat(t.map(i.camelCase)) : (f = i.camelCase(t), (t in e) ? r = [t, f] : (r = f, r = (r in e) ? [r] : r.match(c) || [])), u = r.length; u--;) delete e[r[u]]
- },
- hasData: function(n) {
- return !i.isEmptyObject(this.cache[n[this.expando]] || {})
- },
- discard: function(n) {
- n[this.expando] && delete this.cache[n[this.expando]]
- }
- };
- var r = new v,
- e = new v,
- sf = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- hf = /([A-Z])/g;
- i.extend({
- hasData: function(n) {
- return e.hasData(n) || r.hasData(n)
- },
- data: function(n, t, i) {
- return e.access(n, t, i)
- },
- removeData: function(n, t) {
- e.remove(n, t)
- },
- _data: function(n, t, i) {
- return r.access(n, t, i)
- },
- _removeData: function(n, t) {
- r.remove(n, t)
- }
- });
- i.fn.extend({
- data: function(n, t) {
- var o, f, s, u = this[0],
- h = u && u.attributes;
- if (void 0 === n) {
- if (this.length && (s = e.get(u), 1 === u.nodeType && !r.get(u, "hasDataAttrs"))) {
- for (o = h.length; o--;) h[o] && (f = h[o].name, 0 === f.indexOf("data-") && (f = i.camelCase(f.slice(5)), fr(u, f, s[f])));
- r.set(u, "hasDataAttrs", !0)
- }
- return s
- }
- return "object" == typeof n ? this.each(function() {
- e.set(this, n)
- }) : l(this, function(t) {
- var r, f = i.camelCase(n);
- if (u && void 0 === t) {
- if ((r = e.get(u, n), void 0 !== r) || (r = e.get(u, f), void 0 !== r) || (r = fr(u, f, void 0), void 0 !== r)) return r
- } else this.each(function() {
- var i = e.get(this, f);
- e.set(this, f, t); - 1 !== n.indexOf("-") && void 0 !== i && e.set(this, n, t)
- })
- }, null, t, arguments.length > 1, null, !0)
- },
- removeData: function(n) {
- return this.each(function() {
- e.remove(this, n)
- })
- }
- });
- i.extend({
- queue: function(n, t, u) {
- var f;
- if (n) return (t = (t || "fx") + "queue", f = r.get(n, t), u && (!f || i.isArray(u) ? f = r.access(n, t, i.makeArray(u)) : f.push(u)), f || [])
- },
- dequeue: function(n, t) {
- t = t || "fx";
- var r = i.queue(n, t),
- e = r.length,
- u = r.shift(),
- f = i._queueHooks(n, t),
- o = function() {
- i.dequeue(n, t)
- };
- "inprogress" === u && (u = r.shift(), e--);
- u && ("fx" === t && r.unshift("inprogress"), delete f.stop, u.call(n, o, f));
- !e && f && f.empty.fire()
- },
- _queueHooks: function(n, t) {
- var u = t + "queueHooks";
- return r.get(n, u) || r.access(n, u, {
- empty: i.Callbacks("once memory").add(function() {
- r.remove(n, [t + "queue", u])
- })
- })
- }
- });
- i.fn.extend({
- queue: function(n, t) {
- var r = 2;
- return "string" != typeof n && (t = n, n = "fx", r--), arguments.length < r ? i.queue(this[0], n) : void 0 === t ? this : this.each(function() {
- var r = i.queue(this, n, t);
- i._queueHooks(this, n);
- "fx" === n && "inprogress" !== r[0] && i.dequeue(this, n)
- })
- },
- dequeue: function(n) {
- return this.each(function() {
- i.dequeue(this, n)
- })
- },
- clearQueue: function(n) {
- return this.queue(n || "fx", [])
- },
- promise: function(n, t) {
- var u, e = 1,
- o = i.Deferred(),
- f = this,
- s = this.length,
- h = function() {
- --e || o.resolveWith(f, [f])
- };
- for ("string" != typeof n && (t = n, n = void 0), n = n || "fx"; s--;) u = r.get(f[s], n + "queueHooks"), u && u.empty && (e++, u.empty.add(h));
- return h(), o.promise(t)
- }
- });
- var ct = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
- p = ["Top", "Right", "Bottom", "Left"],
- tt = function(n, t) {
- return n = t || n, "none" === i.css(n, "display") || !i.contains(n.ownerDocument, n)
- },
- er = /^(?:checkbox|radio)$/i;
- ! function() {
- var i = u.createDocumentFragment(),
- n = i.appendChild(u.createElement("div")),
- t = u.createElement("input");
- t.setAttribute("type", "radio");
- t.setAttribute("checked", "checked");
- t.setAttribute("name", "t");
- n.appendChild(t);
- f.checkClone = n.cloneNode(!0).cloneNode(!0).lastChild.checked;
- n.innerHTML = "<textarea>x<\/textarea>";
- f.noCloneChecked = !!n.cloneNode(!0).lastChild.defaultValue
- }();
- b = "undefined";
- f.focusinBubbles = "onfocusin" in n;
- var cf = /^key/,
- lf = /^(?:mouse|pointer|contextmenu)|click/,
- or = /^(?:focusinfocus|focusoutblur)$/,
- sr = /^([^.]*)(?:\.(.+)|)$/;
- i.event = {
- global: {},
- add: function(n, t, u, f, e) {
- var v, y, w, p, k, h, s, l, o, d, g, a = r.get(n);
- if (a)
- for (u.handler && (v = u, u = v.handler, e = v.selector), u.guid || (u.guid = i.guid++), (p = a.events) || (p = a.events = {}), (y = a.handle) || (y = a.handle = function(t) {
- if (typeof i !== b && i.event.triggered !== t.type) return i.event.dispatch.apply(n, arguments)
- }), t = (t || "").match(c) || [""], k = t.length; k--;) w = sr.exec(t[k]) || [], o = g = w[1], d = (w[2] || "").split(".").sort(), o && (s = i.event.special[o] || {}, o = (e ? s.delegateType : s.bindType) || o, s = i.event.special[o] || {}, h = i.extend({
- type: o,
- origType: g,
- data: f,
- handler: u,
- guid: u.guid,
- selector: e,
- needsContext: e && i.expr.match.needsContext.test(e),
- namespace: d.join(".")
- }, v), (l = p[o]) || (l = p[o] = [], l.delegateCount = 0, s.setup && s.setup.call(n, f, d, y) !== !1 || n.addEventListener && n.addEventListener(o, y, !1)), s.add && (s.add.call(n, h), h.handler.guid || (h.handler.guid = u.guid)), e ? l.splice(l.delegateCount++, 0, h) : l.push(h), i.event.global[o] = !0)
- },
- remove: function(n, t, u, f, e) {
- var p, k, h, v, w, s, l, a, o, b, d, y = r.hasData(n) && r.get(n);
- if (y && (v = y.events)) {
- for (t = (t || "").match(c) || [""], w = t.length; w--;)
- if (h = sr.exec(t[w]) || [], o = d = h[1], b = (h[2] || "").split(".").sort(), o) {
- for (l = i.event.special[o] || {}, o = (f ? l.delegateType : l.bindType) || o, a = v[o] || [], h = h[2] && new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)"), k = p = a.length; p--;) s = a[p], !e && d !== s.origType || u && u.guid !== s.guid || h && !h.test(s.namespace) || f && f !== s.selector && ("**" !== f || !s.selector) || (a.splice(p, 1), s.selector && a.delegateCount--, l.remove && l.remove.call(n, s));
- k && !a.length && (l.teardown && l.teardown.call(n, b, y.handle) !== !1 || i.removeEvent(n, o, y.handle), delete v[o])
- } else
- for (o in v) i.event.remove(n, o + t[w], u, f, !0);
- i.isEmptyObject(v) && (delete y.handle, r.remove(n, "events"))
- }
- },
- trigger: function(t, f, e, o) {
- var w, s, c, b, a, v, l, p = [e || u],
- h = ii.call(t, "type") ? t.type : t,
- y = ii.call(t, "namespace") ? t.namespace.split(".") : [];
- if (s = c = e = e || u, 3 !== e.nodeType && 8 !== e.nodeType && !or.test(h + i.event.triggered) && (h.indexOf(".") >= 0 && (y = h.split("."), h = y.shift(), y.sort()), a = h.indexOf(":") < 0 && "on" + h, t = t[i.expando] ? t : new i.Event(h, "object" == typeof t && t), t.isTrigger = o ? 2 : 3, t.namespace = y.join("."), t.namespace_re = t.namespace ? new RegExp("(^|\\.)" + y.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = e), f = null == f ? [t] : i.makeArray(f, [t]), l = i.event.special[h] || {}, o || !l.trigger || l.trigger.apply(e, f) !== !1)) {
- if (!o && !l.noBubble && !i.isWindow(e)) {
- for (b = l.delegateType || h, or.test(b + h) || (s = s.parentNode); s; s = s.parentNode) p.push(s), c = s;
- c === (e.ownerDocument || u) && p.push(c.defaultView || c.parentWindow || n)
- }
- for (w = 0;
- (s = p[w++]) && !t.isPropagationStopped();) t.type = w > 1 ? b : l.bindType || h, v = (r.get(s, "events") || {})[t.type] && r.get(s, "handle"), v && v.apply(s, f), v = a && s[a], v && v.apply && i.acceptData(s) && (t.result = v.apply(s, f), t.result === !1 && t.preventDefault());
- return t.type = h, o || t.isDefaultPrevented() || l._default && l._default.apply(p.pop(), f) !== !1 || !i.acceptData(e) || a && i.isFunction(e[h]) && !i.isWindow(e) && (c = e[a], c && (e[a] = null), i.event.triggered = h, e[h](), i.event.triggered = void 0, c && (e[a] = c)), t.result
- }
- },
- dispatch: function(n) {
- n = i.event.fix(n);
- var o, s, e, u, t, h = [],
- c = a.call(arguments),
- l = (r.get(this, "events") || {})[n.type] || [],
- f = i.event.special[n.type] || {};
- if (c[0] = n, n.delegateTarget = this, !f.preDispatch || f.preDispatch.call(this, n) !== !1) {
- for (h = i.event.handlers.call(this, n, l), o = 0;
- (u = h[o++]) && !n.isPropagationStopped();)
- for (n.currentTarget = u.elem, s = 0;
- (t = u.handlers[s++]) && !n.isImmediatePropagationStopped();)(!n.namespace_re || n.namespace_re.test(t.namespace)) && (n.handleObj = t, n.data = t.data, e = ((i.event.special[t.origType] || {}).handle || t.handler).apply(u.elem, c), void 0 !== e && (n.result = e) === !1 && (n.preventDefault(), n.stopPropagation()));
- return f.postDispatch && f.postDispatch.call(this, n), n.result
- }
- },
- handlers: function(n, t) {
- var e, u, f, o, h = [],
- s = t.delegateCount,
- r = n.target;
- if (s && r.nodeType && (!n.button || "click" !== n.type))
- for (; r !== this; r = r.parentNode || this)
- if (r.disabled !== !0 || "click" !== n.type) {
- for (u = [], e = 0; s > e; e++) o = t[e], f = o.selector + " ", void 0 === u[f] && (u[f] = o.needsContext ? i(f, this).index(r) >= 0 : i.find(f, this, null, [r]).length), u[f] && u.push(o);
- u.length && h.push({
- elem: r,
- handlers: u
- })
- }
- return s < t.length && h.push({
- elem: this,
- handlers: t.slice(s)
- }), h
- },
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks: {},
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function(n, t) {
- return null == n.which && (n.which = null != t.charCode ? t.charCode : t.keyCode), n
- }
- },
- mouseHooks: {
- props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function(n, t) {
- var e, i, r, f = t.button;
- return null == n.pageX && null != t.clientX && (e = n.target.ownerDocument || u, i = e.documentElement, r = e.body, n.pageX = t.clientX + (i && i.scrollLeft || r && r.scrollLeft || 0) - (i && i.clientLeft || r && r.clientLeft || 0), n.pageY = t.clientY + (i && i.scrollTop || r && r.scrollTop || 0) - (i && i.clientTop || r && r.clientTop || 0)), n.which || void 0 === f || (n.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), n
- }
- },
- fix: function(n) {
- if (n[i.expando]) return n;
- var f, e, o, r = n.type,
- s = n,
- t = this.fixHooks[r];
- for (t || (this.fixHooks[r] = t = lf.test(r) ? this.mouseHooks : cf.test(r) ? this.keyHooks : {}), o = t.props ? this.props.concat(t.props) : this.props, n = new i.Event(s), f = o.length; f--;) e = o[f], n[e] = s[e];
- return n.target || (n.target = u), 3 === n.target.nodeType && (n.target = n.target.parentNode), t.filter ? t.filter(n, s) : n
- },
- special: {
- load: {
- noBubble: !0
- },
- focus: {
- trigger: function() {
- if (this !== hr() && this.focus) return (this.focus(), !1)
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- if (this === hr() && this.blur) return (this.blur(), !1)
- },
- delegateType: "focusout"
- },
- click: {
- trigger: function() {
- if ("checkbox" === this.type && this.click && i.nodeName(this, "input")) return (this.click(), !1)
- },
- _default: function(n) {
- return i.nodeName(n.target, "a")
- }
- },
- beforeunload: {
- postDispatch: function(n) {
- void 0 !== n.result && n.originalEvent && (n.originalEvent.returnValue = n.result)
- }
- }
- },
- simulate: function(n, t, r, u) {
- var f = i.extend(new i.Event, r, {
- type: n,
- isSimulated: !0,
- originalEvent: {}
- });
- u ? i.event.trigger(f, null, t) : i.event.dispatch.call(t, f);
- f.isDefaultPrevented() && r.preventDefault()
- }
- };
- i.removeEvent = function(n, t, i) {
- n.removeEventListener && n.removeEventListener(t, i, !1)
- };
- i.Event = function(n, t) {
- return this instanceof i.Event ? (n && n.type ? (this.originalEvent = n, this.type = n.type, this.isDefaultPrevented = n.defaultPrevented || void 0 === n.defaultPrevented && n.returnValue === !1 ? lt : k) : this.type = n, t && i.extend(this, t), this.timeStamp = n && n.timeStamp || i.now(), void(this[i.expando] = !0)) : new i.Event(n, t)
- };
- i.Event.prototype = {
- isDefaultPrevented: k,
- isPropagationStopped: k,
- isImmediatePropagationStopped: k,
- preventDefault: function() {
- var n = this.originalEvent;
- this.isDefaultPrevented = lt;
- n && n.preventDefault && n.preventDefault()
- },
- stopPropagation: function() {
- var n = this.originalEvent;
- this.isPropagationStopped = lt;
- n && n.stopPropagation && n.stopPropagation()
- },
- stopImmediatePropagation: function() {
- var n = this.originalEvent;
- this.isImmediatePropagationStopped = lt;
- n && n.stopImmediatePropagation && n.stopImmediatePropagation();
- this.stopPropagation()
- }
- };
- i.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function(n, t) {
- i.event.special[n] = {
- delegateType: t,
- bindType: t,
- handle: function(n) {
- var u, f = this,
- r = n.relatedTarget,
- e = n.handleObj;
- return (!r || r !== f && !i.contains(f, r)) && (n.type = e.origType, u = e.handler.apply(this, arguments), n.type = t), u
- }
- }
- });
- f.focusinBubbles || i.each({
- focus: "focusin",
- blur: "focusout"
- }, function(n, t) {
- var u = function(n) {
- i.event.simulate(t, n.target, i.event.fix(n), !0)
- };
- i.event.special[t] = {
- setup: function() {
- var i = this.ownerDocument || this,
- f = r.access(i, t);
- f || i.addEventListener(n, u, !0);
- r.access(i, t, (f || 0) + 1)
- },
- teardown: function() {
- var i = this.ownerDocument || this,
- f = r.access(i, t) - 1;
- f ? r.access(i, t, f) : (i.removeEventListener(n, u, !0), r.remove(i, t))
- }
- }
- });
- i.fn.extend({
- on: function(n, t, r, u, f) {
- var e, o;
- if ("object" == typeof n) {
- "string" != typeof t && (r = r || t, t = void 0);
- for (o in n) this.on(o, t, r, n[o], f);
- return this
- }
- if (null == r && null == u ? (u = t, r = t = void 0) : null == u && ("string" == typeof t ? (u = r, r = void 0) : (u = r, r = t, t = void 0)), u === !1) u = k;
- else if (!u) return this;
- return 1 === f && (e = u, u = function(n) {
- return i().off(n), e.apply(this, arguments)
- }, u.guid = e.guid || (e.guid = i.guid++)), this.each(function() {
- i.event.add(this, n, u, r, t)
- })
- },
- one: function(n, t, i, r) {
- return this.on(n, t, i, r, 1)
- },
- off: function(n, t, r) {
- var u, f;
- if (n && n.preventDefault && n.handleObj) return u = n.handleObj, i(n.delegateTarget).off(u.namespace ? u.origType + "." + u.namespace : u.origType, u.selector, u.handler), this;
- if ("object" == typeof n) {
- for (f in n) this.off(f, t, n[f]);
- return this
- }
- return (t === !1 || "function" == typeof t) && (r = t, t = void 0), r === !1 && (r = k), this.each(function() {
- i.event.remove(this, n, r, t)
- })
- },
- trigger: function(n, t) {
- return this.each(function() {
- i.event.trigger(n, t, this)
- })
- },
- triggerHandler: function(n, t) {
- var r = this[0];
- if (r) return i.event.trigger(n, t, r, !0)
- }
- });
- var cr = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- lr = /<([\w:]+)/,
- af = /<|&#?\w+;/,
- vf = /<(?:script|style|link)/i,
- yf = /checked\s*(?:[^=]|=\s*.checked.)/i,
- ar = /^$|\/(?:java|ecma)script/i,
- pf = /^true\/(.*)/,
- wf = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
- h = {
- option: [1, "<select multiple='multiple'>", "<\/select>"],
- thead: [1, "<table>", "<\/table>"],
- col: [2, "<table><colgroup>", "<\/colgroup><\/table>"],
- tr: [2, "<table><tbody>", "<\/tbody><\/table>"],
- td: [3, "<table><tbody><tr>", "<\/tr><\/tbody><\/table>"],
- _default: [0, "", ""]
- };
- h.optgroup = h.option;
- h.tbody = h.tfoot = h.colgroup = h.caption = h.thead;
- h.th = h.td;
- i.extend({
- clone: function(n, t, r) {
- var u, c, s, e, h = n.cloneNode(!0),
- l = i.contains(n.ownerDocument, n);
- if (!(f.noCloneChecked || 1 !== n.nodeType && 11 !== n.nodeType || i.isXMLDoc(n)))
- for (e = o(h), s = o(n), u = 0, c = s.length; c > u; u++) df(s[u], e[u]);
- if (t)
- if (r)
- for (s = s || o(n), e = e || o(h), u = 0, c = s.length; c > u; u++) yr(s[u], e[u]);
- else yr(n, h);
- return e = o(h, "script"), e.length > 0 && ei(e, !l && o(n, "script")), h
- },
- buildFragment: function(n, t, r, u) {
- for (var f, e, y, l, p, a, s = t.createDocumentFragment(), v = [], c = 0, w = n.length; w > c; c++)
- if (f = n[c], f || 0 === f)
- if ("object" === i.type(f)) i.merge(v, f.nodeType ? [f] : f);
- else if (af.test(f)) {
- for (e = e || s.appendChild(t.createElement("div")), y = (lr.exec(f) || ["", ""])[1].toLowerCase(), l = h[y] || h._default, e.innerHTML = l[1] + f.replace(cr, "<$1><\/$2>") + l[2], a = l[0]; a--;) e = e.lastChild;
- i.merge(v, e.childNodes);
- e = s.firstChild;
- e.textContent = ""
- } else v.push(t.createTextNode(f));
- for (s.textContent = "", c = 0; f = v[c++];)
- if ((!u || -1 === i.inArray(f, u)) && (p = i.contains(f.ownerDocument, f), e = o(s.appendChild(f), "script"), p && ei(e), r))
- for (a = 0; f = e[a++];) ar.test(f.type || "") && r.push(f);
- return s
- },
- cleanData: function(n) {
- for (var f, t, o, u, h = i.event.special, s = 0; void 0 !== (t = n[s]); s++) {
- if (i.acceptData(t) && (u = t[r.expando], u && (f = r.cache[u]))) {
- if (f.events)
- for (o in f.events) h[o] ? i.event.remove(t, o) : i.removeEvent(t, o, f.handle);
- r.cache[u] && delete r.cache[u]
- }
- delete e.cache[t[e.expando]]
- }
- }
- });
- i.fn.extend({
- text: function(n) {
- return l(this, function(n) {
- return void 0 === n ? i.text(this) : this.empty().each(function() {
- (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = n)
- })
- }, null, n, arguments.length)
- },
- append: function() {
- return this.domManip(arguments, function(n) {
- if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
- var t = vr(this, n);
- t.appendChild(n)
- }
- })
- },
- prepend: function() {
- return this.domManip(arguments, function(n) {
- if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
- var t = vr(this, n);
- t.insertBefore(n, t.firstChild)
- }
- })
- },
- before: function() {
- return this.domManip(arguments, function(n) {
- this.parentNode && this.parentNode.insertBefore(n, this)
- })
- },
- after: function() {
- return this.domManip(arguments, function(n) {
- this.parentNode && this.parentNode.insertBefore(n, this.nextSibling)
- })
- },
- remove: function(n, t) {
- for (var r, f = n ? i.filter(n, this) : this, u = 0; null != (r = f[u]); u++) t || 1 !== r.nodeType || i.cleanData(o(r)), r.parentNode && (t && i.contains(r.ownerDocument, r) && ei(o(r, "script")), r.parentNode.removeChild(r));
- return this
- },
- empty: function() {
- for (var n, t = 0; null != (n = this[t]); t++) 1 === n.nodeType && (i.cleanData(o(n, !1)), n.textContent = "");
- return this
- },
- clone: function(n, t) {
- return n = null == n ? !1 : n, t = null == t ? n : t, this.map(function() {
- return i.clone(this, n, t)
- })
- },
- html: function(n) {
- return l(this, function(n) {
- var t = this[0] || {},
- r = 0,
- u = this.length;
- if (void 0 === n && 1 === t.nodeType) return t.innerHTML;
- if ("string" == typeof n && !vf.test(n) && !h[(lr.exec(n) || ["", ""])[1].toLowerCase()]) {
- n = n.replace(cr, "<$1><\/$2>");
- try {
- for (; u > r; r++) t = this[r] || {}, 1 === t.nodeType && (i.cleanData(o(t, !1)), t.innerHTML = n);
- t = 0
- } catch (f) {}
- }
- t && this.empty().append(n)
- }, null, n, arguments.length)
- },
- replaceWith: function() {
- var n = arguments[0];
- return this.domManip(arguments, function(t) {
- n = this.parentNode;
- i.cleanData(o(this));
- n && n.replaceChild(t, this)
- }), n && (n.length || n.nodeType) ? this : this.remove()
- },
- detach: function(n) {
- return this.remove(n, !0)
- },
- domManip: function(n, t) {
- n = bi.apply([], n);
- var h, v, s, c, u, y, e = 0,
- l = this.length,
- w = this,
- b = l - 1,
- a = n[0],
- p = i.isFunction(a);
- if (p || l > 1 && "string" == typeof a && !f.checkClone && yf.test(a)) return this.each(function(i) {
- var r = w.eq(i);
- p && (n[0] = a.call(this, i, r.html()));
- r.domManip(n, t)
- });
- if (l && (h = i.buildFragment(n, this[0].ownerDocument, !1, this), v = h.firstChild, 1 === h.childNodes.length && (h = v), v)) {
- for (s = i.map(o(h, "script"), bf), c = s.length; l > e; e++) u = h, e !== b && (u = i.clone(u, !0, !0), c && i.merge(s, o(u, "script"))), t.call(this[e], u, e);
- if (c)
- for (y = s[s.length - 1].ownerDocument, i.map(s, kf), e = 0; c > e; e++) u = s[e], ar.test(u.type || "") && !r.access(u, "globalEval") && i.contains(y, u) && (u.src ? i._evalUrl && i._evalUrl(u.src) : i.globalEval(u.textContent.replace(wf, "")))
- }
- return this
- }
- });
- i.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function(n, t) {
- i.fn[n] = function(n) {
- for (var u, f = [], e = i(n), o = e.length - 1, r = 0; o >= r; r++) u = r === o ? this : this.clone(!0), i(e[r])[t](u), ti.apply(f, u.get());
- return this.pushStack(f)
- }
- });
- oi = {};
- var wr = /^margin/,
- hi = new RegExp("^(" + ct + ")(?!px)[a-z%]+$", "i"),
- vt = function(t) {
- return t.ownerDocument.defaultView.opener ? t.ownerDocument.defaultView.getComputedStyle(t, null) : n.getComputedStyle(t, null)
- };
- ! function() {
- var s, o, e = u.documentElement,
- r = u.createElement("div"),
- t = u.createElement("div");
- if (t.style) {
- t.style.backgroundClip = "content-box";
- t.cloneNode(!0).style.backgroundClip = "";
- f.clearCloneStyle = "content-box" === t.style.backgroundClip;
- r.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute";
- r.appendChild(t);
- function h() {
- t.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";
- t.innerHTML = "";
- e.appendChild(r);
- var i = n.getComputedStyle(t, null);
- s = "1%" !== i.top;
- o = "4px" === i.width;
- e.removeChild(r)
- }
- n.getComputedStyle && i.extend(f, {
- pixelPosition: function() {
- return h(), s
- },
- boxSizingReliable: function() {
- return null == o && h(), o
- },
- reliableMarginRight: function() {
- var f, i = t.appendChild(u.createElement("div"));
- return i.style.cssText = t.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", i.style.marginRight = i.style.width = "0", t.style.width = "1px", e.appendChild(r), f = !parseFloat(n.getComputedStyle(i, null).marginRight), e.removeChild(r), t.removeChild(i), f
- }
- })
- }
- }();
- i.swap = function(n, t, i, r) {
- var f, u, e = {};
- for (u in t) e[u] = n.style[u], n.style[u] = t[u];
- f = i.apply(n, r || []);
- for (u in t) n.style[u] = e[u];
- return f
- };
- var gf = /^(none|table(?!-c[ea]).+)/,
- ne = new RegExp("^(" + ct + ")(.*)$", "i"),
- te = new RegExp("^([+-])=(" + ct + ")", "i"),
- ie = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- },
- kr = {
- letterSpacing: "0",
- fontWeight: "400"
- },
- dr = ["Webkit", "O", "Moz", "ms"];
- i.extend({
- cssHooks: {
- opacity: {
- get: function(n, t) {
- if (t) {
- var i = it(n, "opacity");
- return "" === i ? "1" : i
- }
- }
- }
- },
- cssNumber: {
- columnCount: !0,
- fillOpacity: !0,
- flexGrow: !0,
- flexShrink: !0,
- fontWeight: !0,
- lineHeight: !0,
- opacity: !0,
- order: !0,
- orphans: !0,
- widows: !0,
- zIndex: !0,
- zoom: !0
- },
- cssProps: {
- float: "cssFloat"
- },
- style: function(n, t, r, u) {
- if (n && 3 !== n.nodeType && 8 !== n.nodeType && n.style) {
- var o, h, e, s = i.camelCase(t),
- c = n.style;
- return t = i.cssProps[s] || (i.cssProps[s] = gr(c, s)), e = i.cssHooks[t] || i.cssHooks[s], void 0 === r ? e && "get" in e && void 0 !== (o = e.get(n, !1, u)) ? o : c[t] : (h = typeof r, "string" === h && (o = te.exec(r)) && (r = (o[1] + 1) * o[2] + parseFloat(i.css(n, t)), h = "number"), null != r && r === r && ("number" !== h || i.cssNumber[s] || (r += "px"), f.clearCloneStyle || "" !== r || 0 !== t.indexOf("background") || (c[t] = "inherit"), e && "set" in e && void 0 === (r = e.set(n, r, u)) || (c[t] = r)), void 0)
- }
- },
- css: function(n, t, r, u) {
- var f, s, e, o = i.camelCase(t);
- return t = i.cssProps[o] || (i.cssProps[o] = gr(n.style, o)), e = i.cssHooks[t] || i.cssHooks[o], e && "get" in e && (f = e.get(n, !0, r)), void 0 === f && (f = it(n, t, u)), "normal" === f && t in kr && (f = kr[t]), "" === r || r ? (s = parseFloat(f), r === !0 || i.isNumeric(s) ? s || 0 : f) : f
- }
- });
- i.each(["height", "width"], function(n, t) {
- i.cssHooks[t] = {
- get: function(n, r, u) {
- if (r) return gf.test(i.css(n, "display")) && 0 === n.offsetWidth ? i.swap(n, ie, function() {
- return iu(n, t, u)
- }) : iu(n, t, u)
- },
- set: function(n, r, u) {
- var f = u && vt(n);
- return nu(n, r, u ? tu(n, t, u, "border-box" === i.css(n, "boxSizing", !1, f), f) : 0)
- }
- }
- });
- i.cssHooks.marginRight = br(f.reliableMarginRight, function(n, t) {
- if (t) return i.swap(n, {
- display: "inline-block"
- }, it, [n, "marginRight"])
- });
- i.each({
- margin: "",
- padding: "",
- border: "Width"
- }, function(n, t) {
- i.cssHooks[n + t] = {
- expand: function(i) {
- for (var r = 0, f = {}, u = "string" == typeof i ? i.split(" ") : [i]; 4 > r; r++) f[n + p[r] + t] = u[r] || u[r - 2] || u[0];
- return f
- }
- };
- wr.test(n) || (i.cssHooks[n + t].set = nu)
- });
- i.fn.extend({
- css: function(n, t) {
- return l(this, function(n, t, r) {
- var f, e, o = {},
- u = 0;
- if (i.isArray(t)) {
- for (f = vt(n), e = t.length; e > u; u++) o[t[u]] = i.css(n, t[u], !1, f);
- return o
- }
- return void 0 !== r ? i.style(n, t, r) : i.css(n, t)
- }, n, t, arguments.length > 1)
- },
- show: function() {
- return ru(this, !0)
- },
- hide: function() {
- return ru(this)
- },
- toggle: function(n) {
- return "boolean" == typeof n ? n ? this.show() : this.hide() : this.each(function() {
- tt(this) ? i(this).show() : i(this).hide()
- })
- }
- });
- i.Tween = s;
- s.prototype = {
- constructor: s,
- init: function(n, t, r, u, f, e) {
- this.elem = n;
- this.prop = r;
- this.easing = f || "swing";
- this.options = t;
- this.start = this.now = this.cur();
- this.end = u;
- this.unit = e || (i.cssNumber[r] ? "" : "px")
- },
- cur: function() {
- var n = s.propHooks[this.prop];
- return n && n.get ? n.get(this) : s.propHooks._default.get(this)
- },
- run: function(n) {
- var t, r = s.propHooks[this.prop];
- return this.pos = this.options.duration ? t = i.easing[this.easing](n, this.options.duration * n, 0, 1, this.options.duration) : t = n, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), r && r.set ? r.set(this) : s.propHooks._default.set(this), this
- }
- };
- s.prototype.init.prototype = s.prototype;
- s.propHooks = {
- _default: {
- get: function(n) {
- var t;
- return null == n.elem[n.prop] || n.elem.style && null != n.elem.style[n.prop] ? (t = i.css(n.elem, n.prop, ""), t && "auto" !== t ? t : 0) : n.elem[n.prop]
- },
- set: function(n) {
- i.fx.step[n.prop] ? i.fx.step[n.prop](n) : n.elem.style && (null != n.elem.style[i.cssProps[n.prop]] || i.cssHooks[n.prop]) ? i.style(n.elem, n.prop, n.now + n.unit) : n.elem[n.prop] = n.now
- }
- }
- };
- s.propHooks.scrollTop = s.propHooks.scrollLeft = {
- set: function(n) {
- n.elem.nodeType && n.elem.parentNode && (n.elem[n.prop] = n.now)
- }
- };
- i.easing = {
- linear: function(n) {
- return n
- },
- swing: function(n) {
- return .5 - Math.cos(n * Math.PI) / 2
- }
- };
- i.fx = s.prototype.init;
- i.fx.step = {};
- var d, yt, re = /^(?:toggle|show|hide)$/,
- uu = new RegExp("^(?:([+-])=|)(" + ct + ")([a-z%]*)$", "i"),
- ue = /queueHooks$/,
- pt = [fe],
- rt = {
- "*": [function(n, t) {
- var f = this.createTween(n, t),
- s = f.cur(),
- r = uu.exec(t),
- e = r && r[3] || (i.cssNumber[n] ? "" : "px"),
- u = (i.cssNumber[n] || "px" !== e && +s) && uu.exec(i.css(f.elem, n)),
- o = 1,
- h = 20;
- if (u && u[3] !== e) {
- e = e || u[3];
- r = r || [];
- u = +s || 1;
- do o = o || ".5", u /= o, i.style(f.elem, n, u + e); while (o !== (o = f.cur() / s) && 1 !== o && --h)
- }
- return r && (u = f.start = +u || +s || 0, f.unit = e, f.end = r[1] ? u + (r[1] + 1) * r[2] : +r[2]), f
- }]
- };
- i.Animation = i.extend(ou, {
- tweener: function(n, t) {
- i.isFunction(n) ? (t = n, n = ["*"]) : n = n.split(" ");
- for (var r, u = 0, f = n.length; f > u; u++) r = n[u], rt[r] = rt[r] || [], rt[r].unshift(t)
- },
- prefilter: function(n, t) {
- t ? pt.unshift(n) : pt.push(n)
- }
- });
- i.speed = function(n, t, r) {
- var u = n && "object" == typeof n ? i.extend({}, n) : {
- complete: r || !r && t || i.isFunction(n) && n,
- duration: n,
- easing: r && t || t && !i.isFunction(t) && t
- };
- return u.duration = i.fx.off ? 0 : "number" == typeof u.duration ? u.duration : u.duration in i.fx.speeds ? i.fx.speeds[u.duration] : i.fx.speeds._default, (null == u.queue || u.queue === !0) && (u.queue = "fx"), u.old = u.complete, u.complete = function() {
- i.isFunction(u.old) && u.old.call(this);
- u.queue && i.dequeue(this, u.queue)
- }, u
- };
- i.fn.extend({
- fadeTo: function(n, t, i, r) {
- return this.filter(tt).css("opacity", 0).show().end().animate({
- opacity: t
- }, n, i, r)
- },
- animate: function(n, t, u, f) {
- var s = i.isEmptyObject(n),
- o = i.speed(t, u, f),
- e = function() {
- var t = ou(this, i.extend({}, n), o);
- (s || r.get(this, "finish")) && t.stop(!0)
- };
- return e.finish = e, s || o.queue === !1 ? this.each(e) : this.queue(o.queue, e)
- },
- stop: function(n, t, u) {
- var f = function(n) {
- var t = n.stop;
- delete n.stop;
- t(u)
- };
- return "string" != typeof n && (u = t, t = n, n = void 0), t && n !== !1 && this.queue(n || "fx", []), this.each(function() {
- var s = !0,
- t = null != n && n + "queueHooks",
- o = i.timers,
- e = r.get(this);
- if (t) e[t] && e[t].stop && f(e[t]);
- else
- for (t in e) e[t] && e[t].stop && ue.test(t) && f(e[t]);
- for (t = o.length; t--;) o[t].elem !== this || null != n && o[t].queue !== n || (o[t].anim.stop(u), s = !1, o.splice(t, 1));
- (s || !u) && i.dequeue(this, n)
- })
- },
- finish: function(n) {
- return n !== !1 && (n = n || "fx"), this.each(function() {
- var t, e = r.get(this),
- u = e[n + "queue"],
- o = e[n + "queueHooks"],
- f = i.timers,
- s = u ? u.length : 0;
- for (e.finish = !0, i.queue(this, n, []), o && o.stop && o.stop.call(this, !0), t = f.length; t--;) f[t].elem === this && f[t].queue === n && (f[t].anim.stop(!0), f.splice(t, 1));
- for (t = 0; s > t; t++) u[t] && u[t].finish && u[t].finish.call(this);
- delete e.finish
- })
- }
- });
- i.each(["toggle", "show", "hide"], function(n, t) {
- var r = i.fn[t];
- i.fn[t] = function(n, i, u) {
- return null == n || "boolean" == typeof n ? r.apply(this, arguments) : this.animate(wt(t, !0), n, i, u)
- }
- });
- i.each({
- slideDown: wt("show"),
- slideUp: wt("hide"),
- slideToggle: wt("toggle"),
- fadeIn: {
- opacity: "show"
- },
- fadeOut: {
- opacity: "hide"
- },
- fadeToggle: {
- opacity: "toggle"
- }
- }, function(n, t) {
- i.fn[n] = function(n, i, r) {
- return this.animate(t, n, i, r)
- }
- });
- i.timers = [];
- i.fx.tick = function() {
- var r, n = 0,
- t = i.timers;
- for (d = i.now(); n < t.length; n++) r = t[n], r() || t[n] !== r || t.splice(n--, 1);
- t.length || i.fx.stop();
- d = void 0
- };
- i.fx.timer = function(n) {
- i.timers.push(n);
- n() ? i.fx.start() : i.timers.pop()
- };
- i.fx.interval = 13;
- i.fx.start = function() {
- yt || (yt = setInterval(i.fx.tick, i.fx.interval))
- };
- i.fx.stop = function() {
- clearInterval(yt);
- yt = null
- };
- i.fx.speeds = {
- slow: 600,
- fast: 200,
- _default: 400
- };
- i.fn.delay = function(n, t) {
- return n = i.fx ? i.fx.speeds[n] || n : n, t = t || "fx", this.queue(t, function(t, i) {
- var r = setTimeout(t, n);
- i.stop = function() {
- clearTimeout(r)
- }
- })
- },
- function() {
- var n = u.createElement("input"),
- t = u.createElement("select"),
- i = t.appendChild(u.createElement("option"));
- n.type = "checkbox";
- f.checkOn = "" !== n.value;
- f.optSelected = i.selected;
- t.disabled = !0;
- f.optDisabled = !i.disabled;
- n = u.createElement("input");
- n.value = "t";
- n.type = "radio";
- f.radioValue = "t" === n.value
- }();
- g = i.expr.attrHandle;
- i.fn.extend({
- attr: function(n, t) {
- return l(this, i.attr, n, t, arguments.length > 1)
- },
- removeAttr: function(n) {
- return this.each(function() {
- i.removeAttr(this, n)
- })
- }
- });
- i.extend({
- attr: function(n, t, r) {
- var u, f, e = n.nodeType;
- if (n && 3 !== e && 8 !== e && 2 !== e) return typeof n.getAttribute === b ? i.prop(n, t, r) : (1 === e && i.isXMLDoc(n) || (t = t.toLowerCase(), u = i.attrHooks[t] || (i.expr.match.bool.test(t) ? su : oe)), void 0 === r ? u && "get" in u && null !== (f = u.get(n, t)) ? f : (f = i.find.attr(n, t), null == f ? void 0 : f) : null !== r ? u && "set" in u && void 0 !== (f = u.set(n, r, t)) ? f : (n.setAttribute(t, r + ""), r) : void i.removeAttr(n, t))
- },
- removeAttr: function(n, t) {
- var r, u, e = 0,
- f = t && t.match(c);
- if (f && 1 === n.nodeType)
- while (r = f[e++]) u = i.propFix[r] || r, i.expr.match.bool.test(r) && (n[u] = !1), n.removeAttribute(r)
- },
- attrHooks: {
- type: {
- set: function(n, t) {
- if (!f.radioValue && "radio" === t && i.nodeName(n, "input")) {
- var r = n.value;
- return n.setAttribute("type", t), r && (n.value = r), t
- }
- }
- }
- }
- });
- su = {
- set: function(n, t, r) {
- return t === !1 ? i.removeAttr(n, r) : n.setAttribute(r, r), r
- }
- };
- i.each(i.expr.match.bool.source.match(/\w+/g), function(n, t) {
- var r = g[t] || i.find.attr;
- g[t] = function(n, t, i) {
- var u, f;
- return i || (f = g[t], g[t] = u, u = null != r(n, t, i) ? t.toLowerCase() : null, g[t] = f), u
- }
- });
- hu = /^(?:input|select|textarea|button)$/i;
- i.fn.extend({
- prop: function(n, t) {
- return l(this, i.prop, n, t, arguments.length > 1)
- },
- removeProp: function(n) {
- return this.each(function() {
- delete this[i.propFix[n] || n]
- })
- }
- });
- i.extend({
- propFix: {
- "for": "htmlFor",
- "class": "className"
- },
- prop: function(n, t, r) {
- var f, u, o, e = n.nodeType;
- if (n && 3 !== e && 8 !== e && 2 !== e) return o = 1 !== e || !i.isXMLDoc(n), o && (t = i.propFix[t] || t, u = i.propHooks[t]), void 0 !== r ? u && "set" in u && void 0 !== (f = u.set(n, r, t)) ? f : n[t] = r : u && "get" in u && null !== (f = u.get(n, t)) ? f : n[t]
- },
- propHooks: {
- tabIndex: {
- get: function(n) {
- return n.hasAttribute("tabindex") || hu.test(n.nodeName) || n.href ? n.tabIndex : -1
- }
- }
- }
- });
- f.optSelected || (i.propHooks.selected = {
- get: function(n) {
- var t = n.parentNode;
- return t && t.parentNode && t.parentNode.selectedIndex, null
- }
- });
- i.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
- i.propFix[this.toLowerCase()] = this
- });
- bt = /[\t\r\n\f]/g;
- i.fn.extend({
- addClass: function(n) {
- var o, t, r, u, s, f, h = "string" == typeof n && n,
- e = 0,
- l = this.length;
- if (i.isFunction(n)) return this.each(function(t) {
- i(this).addClass(n.call(this, t, this.className))
- });
- if (h)
- for (o = (n || "").match(c) || []; l > e; e++)
- if (t = this[e], r = 1 === t.nodeType && (t.className ? (" " + t.className + " ").replace(bt, " ") : " ")) {
- for (s = 0; u = o[s++];) r.indexOf(" " + u + " ") < 0 && (r += u + " ");
- f = i.trim(r);
- t.className !== f && (t.className = f)
- }
- return this
- },
- removeClass: function(n) {
- var o, t, r, u, s, f, h = 0 === arguments.length || "string" == typeof n && n,
- e = 0,
- l = this.length;
- if (i.isFunction(n)) return this.each(function(t) {
- i(this).removeClass(n.call(this, t, this.className))
- });
- if (h)
- for (o = (n || "").match(c) || []; l > e; e++)
- if (t = this[e], r = 1 === t.nodeType && (t.className ? (" " + t.className + " ").replace(bt, " ") : "")) {
- for (s = 0; u = o[s++];)
- while (r.indexOf(" " + u + " ") >= 0) r = r.replace(" " + u + " ", " ");
- f = n ? i.trim(r) : "";
- t.className !== f && (t.className = f)
- }
- return this
- },
- toggleClass: function(n, t) {
- var u = typeof n;
- return "boolean" == typeof t && "string" === u ? t ? this.addClass(n) : this.removeClass(n) : this.each(i.isFunction(n) ? function(r) {
- i(this).toggleClass(n.call(this, r, this.className, t), t)
- } : function() {
- if ("string" === u)
- for (var t, e = 0, f = i(this), o = n.match(c) || []; t = o[e++];) f.hasClass(t) ? f.removeClass(t) : f.addClass(t);
- else(u === b || "boolean" === u) && (this.className && r.set(this, "__className__", this.className), this.className = this.className || n === !1 ? "" : r.get(this, "__className__") || "")
- })
- },
- hasClass: function(n) {
- for (var i = " " + n + " ", t = 0, r = this.length; r > t; t++)
- if (1 === this[t].nodeType && (" " + this[t].className + " ").replace(bt, " ").indexOf(i) >= 0) return !0;
- return !1
- }
- });
- cu = /\r/g;
- i.fn.extend({
- val: function(n) {
- var t, r, f, u = this[0];
- return arguments.length ? (f = i.isFunction(n), this.each(function(r) {
- var u;
- 1 === this.nodeType && (u = f ? n.call(this, r, i(this).val()) : n, null == u ? u = "" : "number" == typeof u ? u += "" : i.isArray(u) && (u = i.map(u, function(n) {
- return null == n ? "" : n + ""
- })), t = i.valHooks[this.type] || i.valHooks[this.nodeName.toLowerCase()], t && "set" in t && void 0 !== t.set(this, u, "value") || (this.value = u))
- })) : u ? (t = i.valHooks[u.type] || i.valHooks[u.nodeName.toLowerCase()], t && "get" in t && void 0 !== (r = t.get(u, "value")) ? r : (r = u.value, "string" == typeof r ? r.replace(cu, "") : null == r ? "" : r)) : void 0
- }
- });
- i.extend({
- valHooks: {
- option: {
- get: function(n) {
- var t = i.find.attr(n, "value");
- return null != t ? t : i.trim(i.text(n))
- }
- },
- select: {
- get: function(n) {
- for (var o, t, s = n.options, r = n.selectedIndex, u = "select-one" === n.type || 0 > r, h = u ? null : [], c = u ? r + 1 : s.length, e = 0 > r ? c : u ? r : 0; c > e; e++)
- if (t = s[e], !(!t.selected && e !== r || (f.optDisabled ? t.disabled : null !== t.getAttribute("disabled")) || t.parentNode.disabled && i.nodeName(t.parentNode, "optgroup"))) {
- if (o = i(t).val(), u) return o;
- h.push(o)
- }
- return h
- },
- set: function(n, t) {
- for (var u, r, f = n.options, e = i.makeArray(t), o = f.length; o--;) r = f[o], (r.selected = i.inArray(r.value, e) >= 0) && (u = !0);
- return u || (n.selectedIndex = -1), e
- }
- }
- }
- });
- i.each(["radio", "checkbox"], function() {
- i.valHooks[this] = {
- set: function(n, t) {
- if (i.isArray(t)) return n.checked = i.inArray(i(n).val(), t) >= 0
- }
- };
- f.checkOn || (i.valHooks[this].get = function(n) {
- return null === n.getAttribute("value") ? "on" : n.value
- })
- });
- i.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(n, t) {
- i.fn[t] = function(n, i) {
- return arguments.length > 0 ? this.on(t, null, n, i) : this.trigger(t)
- }
- });
- i.fn.extend({
- hover: function(n, t) {
- return this.mouseenter(n).mouseleave(t || n)
- },
- bind: function(n, t, i) {
- return this.on(n, null, t, i)
- },
- unbind: function(n, t) {
- return this.off(n, null, t)
- },
- delegate: function(n, t, i, r) {
- return this.on(t, n, i, r)
- },
- undelegate: function(n, t, i) {
- return 1 === arguments.length ? this.off(n, "**") : this.off(t, n || "**", i)
- }
- });
- kt = i.now();
- dt = /\?/;
- i.parseJSON = function(n) {
- return JSON.parse(n + "")
- };
- i.parseXML = function(n) {
- var t, r;
- if (!n || "string" != typeof n) return null;
- try {
- r = new DOMParser;
- t = r.parseFromString(n, "text/xml")
- } catch (u) {
- t = void 0
- }
- return (!t || t.getElementsByTagName("parsererror").length) && i.error("Invalid XML: " + n), t
- };
- var se = /#.*$/,
- lu = /([?&])_=[^&]*/,
- he = /^(.*?):[ \t]*([^\r\n]*)$/gm,
- ce = /^(?:GET|HEAD)$/,
- le = /^\/\//,
- au = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
- vu = {},
- ci = {},
- yu = "*/".concat("*"),
- li = n.location.href,
- nt = au.exec(li.toLowerCase()) || [];
- i.extend({
- active: 0,
- lastModified: {},
- etag: {},
- ajaxSettings: {
- url: li,
- type: "GET",
- isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(nt[1]),
- global: !0,
- processData: !0,
- async: !0,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- accepts: {
- "*": yu,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
- converters: {
- "* text": String,
- "text html": !0,
- "text json": i.parseJSON,
- "text xml": i.parseXML
- },
- flatOptions: {
- url: !0,
- context: !0
- }
- },
- ajaxSetup: function(n, t) {
- return t ? ai(ai(n, i.ajaxSettings), t) : ai(i.ajaxSettings, n)
- },
- ajaxPrefilter: pu(vu),
- ajaxTransport: pu(ci),
- ajax: function(n, t) {
- function p(n, t, s, h) {
- var v, it, tt, p, nt, c = t;
- 2 !== e && (e = 2, b && clearTimeout(b), l = void 0, w = h || "", u.readyState = n > 0 ? 4 : 0, v = n >= 200 && 300 > n || 304 === n, s && (p = ae(r, u, s)), p = ve(r, p, u, v), v ? (r.ifModified && (nt = u.getResponseHeader("Last-Modified"), nt && (i.lastModified[f] = nt), nt = u.getResponseHeader("etag"), nt && (i.etag[f] = nt)), 204 === n || "HEAD" === r.type ? c = "nocontent" : 304 === n ? c = "notmodified" : (c = p.state, it = p.data, tt = p.error, v = !tt)) : (tt = c, (n || !c) && (c = "error", 0 > n && (n = 0))), u.status = n, u.statusText = (t || c) + "", v ? d.resolveWith(o, [it, c, u]) : d.rejectWith(o, [u, c, tt]), u.statusCode(y), y = void 0, a && k.trigger(v ? "ajaxSuccess" : "ajaxError", [u, r, v ? it : tt]), g.fireWith(o, [u, c]), a && (k.trigger("ajaxComplete", [u, r]), --i.active || i.event.trigger("ajaxStop")))
- }
- "object" == typeof n && (t = n, n = void 0);
- t = t || {};
- var l, f, w, v, b, s, a, h, r = i.ajaxSetup({}, t),
- o = r.context || r,
- k = r.context && (o.nodeType || o.jquery) ? i(o) : i.event,
- d = i.Deferred(),
- g = i.Callbacks("once memory"),
- y = r.statusCode || {},
- tt = {},
- it = {},
- e = 0,
- rt = "canceled",
- u = {
- readyState: 0,
- getResponseHeader: function(n) {
- var t;
- if (2 === e) {
- if (!v)
- for (v = {}; t = he.exec(w);) v[t[1].toLowerCase()] = t[2];
- t = v[n.toLowerCase()]
- }
- return null == t ? null : t
- },
- getAllResponseHeaders: function() {
- return 2 === e ? w : null
- },
- setRequestHeader: function(n, t) {
- var i = n.toLowerCase();
- return e || (n = it[i] = it[i] || n, tt[n] = t), this
- },
- overrideMimeType: function(n) {
- return e || (r.mimeType = n), this
- },
- statusCode: function(n) {
- var t;
- if (n)
- if (2 > e)
- for (t in n) y[t] = [y[t], n[t]];
- else u.always(n[u.status]);
- return this
- },
- abort: function(n) {
- var t = n || rt;
- return l && l.abort(t), p(0, t), this
- }
- };
- if (d.promise(u).complete = g.add, u.success = u.done, u.error = u.fail, r.url = ((n || r.url || li) + "").replace(se, "").replace(le, nt[1] + "//"), r.type = t.method || t.type || r.method || r.type, r.dataTypes = i.trim(r.dataType || "*").toLowerCase().match(c) || [""], null == r.crossDomain && (s = au.exec(r.url.toLowerCase()), r.crossDomain = !(!s || s[1] === nt[1] && s[2] === nt[2] && (s[3] || ("http:" === s[1] ? "80" : "443")) === (nt[3] || ("http:" === nt[1] ? "80" : "443")))), r.data && r.processData && "string" != typeof r.data && (r.data = i.param(r.data, r.traditional)), wu(vu, r, t, u), 2 === e) return u;
- a = i.event && r.global;
- a && 0 == i.active++ && i.event.trigger("ajaxStart");
- r.type = r.type.toUpperCase();
- r.hasContent = !ce.test(r.type);
- f = r.url;
- r.hasContent || (r.data && (f = r.url += (dt.test(f) ? "&" : "?") + r.data, delete r.data), r.cache === !1 && (r.url = lu.test(f) ? f.replace(lu, "$1_=" + kt++) : f + (dt.test(f) ? "&" : "?") + "_=" + kt++));
- r.ifModified && (i.lastModified[f] && u.setRequestHeader("If-Modified-Since", i.lastModified[f]), i.etag[f] && u.setRequestHeader("If-None-Match", i.etag[f]));
- (r.data && r.hasContent && r.contentType !== !1 || t.contentType) && u.setRequestHeader("Content-Type", r.contentType);
- u.setRequestHeader("Accept", r.dataTypes[0] && r.accepts[r.dataTypes[0]] ? r.accepts[r.dataTypes[0]] + ("*" !== r.dataTypes[0] ? ", " + yu + "; q=0.01" : "") : r.accepts["*"]);
- for (h in r.headers) u.setRequestHeader(h, r.headers[h]);
- if (r.beforeSend && (r.beforeSend.call(o, u, r) === !1 || 2 === e)) return u.abort();
- rt = "abort";
- for (h in {
- success: 1,
- error: 1,
- complete: 1
- }) u[h](r[h]);
- if (l = wu(ci, r, t, u)) {
- u.readyState = 1;
- a && k.trigger("ajaxSend", [u, r]);
- r.async && r.timeout > 0 && (b = setTimeout(function() {
- u.abort("timeout")
- }, r.timeout));
- try {
- e = 1;
- l.send(tt, p)
- } catch (ut) {
- if (!(2 > e)) throw ut;
- p(-1, ut)
- }
- } else p(-1, "No Transport");
- return u
- },
- getJSON: function(n, t, r) {
- return i.get(n, t, r, "json")
- },
- getScript: function(n, t) {
- return i.get(n, void 0, t, "script")
- }
- });
- i.each(["get", "post"], function(n, t) {
- i[t] = function(n, r, u, f) {
- return i.isFunction(r) && (f = f || u, u = r, r = void 0), i.ajax({
- url: n,
- type: t,
- dataType: f,
- data: r,
- success: u
- })
- }
- });
- i._evalUrl = function(n) {
- return i.ajax({
- url: n,
- type: "GET",
- dataType: "script",
- async: !1,
- global: !1,
- throws: !0
- })
- };
- i.fn.extend({
- wrapAll: function(n) {
- var t;
- return i.isFunction(n) ? this.each(function(t) {
- i(this).wrapAll(n.call(this, t))
- }) : (this[0] && (t = i(n, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
- for (var n = this; n.firstElementChild;) n = n.firstElementChild;
- return n
- }).append(this)), this)
- },
- wrapInner: function(n) {
- return this.each(i.isFunction(n) ? function(t) {
- i(this).wrapInner(n.call(this, t))
- } : function() {
- var t = i(this),
- r = t.contents();
- r.length ? r.wrapAll(n) : t.append(n)
- })
- },
- wrap: function(n) {
- var t = i.isFunction(n);
- return this.each(function(r) {
- i(this).wrapAll(t ? n.call(this, r) : n)
- })
- },
- unwrap: function() {
- return this.parent().each(function() {
- i.nodeName(this, "body") || i(this).replaceWith(this.childNodes)
- }).end()
- }
- });
- i.expr.filters.hidden = function(n) {
- return n.offsetWidth <= 0 && n.offsetHeight <= 0
- };
- i.expr.filters.visible = function(n) {
- return !i.expr.filters.hidden(n)
- };
- var ye = /%20/g,
- pe = /\[\]$/,
- bu = /\r?\n/g,
- we = /^(?:submit|button|image|reset|file)$/i,
- be = /^(?:input|select|textarea|keygen)/i;
- i.param = function(n, t) {
- var r, u = [],
- f = function(n, t) {
- t = i.isFunction(t) ? t() : null == t ? "" : t;
- u[u.length] = encodeURIComponent(n) + "=" + encodeURIComponent(t)
- };
- if (void 0 === t && (t = i.ajaxSettings && i.ajaxSettings.traditional), i.isArray(n) || n.jquery && !i.isPlainObject(n)) i.each(n, function() {
- f(this.name, this.value)
- });
- else
- for (r in n) vi(r, n[r], t, f);
- return u.join("&").replace(ye, "+")
- };
- i.fn.extend({
- serialize: function() {
- return i.param(this.serializeArray())
- },
- serializeArray: function() {
- return this.map(function() {
- var n = i.prop(this, "elements");
- return n ? i.makeArray(n) : this
- }).filter(function() {
- var n = this.type;
- return this.name && !i(this).is(":disabled") && be.test(this.nodeName) && !we.test(n) && (this.checked || !er.test(n))
- }).map(function(n, t) {
- var r = i(this).val();
- return null == r ? null : i.isArray(r) ? i.map(r, function(n) {
- return {
- name: t.name,
- value: n.replace(bu, "\r\n")
- }
- }) : {
- name: t.name,
- value: r.replace(bu, "\r\n")
- }
- }).get()
- }
- });
- i.ajaxSettings.xhr = function() {
- try {
- return new XMLHttpRequest
- } catch (n) {}
- };
- var ke = 0,
- gt = {},
- de = {
- 0: 200,
- 1223: 204
- },
- ut = i.ajaxSettings.xhr();
- return n.attachEvent && n.attachEvent("onunload", function() {
- for (var n in gt) gt[n]()
- }), f.cors = !!ut && "withCredentials" in ut, f.ajax = ut = !!ut, i.ajaxTransport(function(n) {
- var t;
- if (f.cors || ut && !n.crossDomain) return {
- send: function(i, r) {
- var f, u = n.xhr(),
- e = ++ke;
- if (u.open(n.type, n.url, n.async, n.username, n.password), n.xhrFields)
- for (f in n.xhrFields) u[f] = n.xhrFields[f];
- n.mimeType && u.overrideMimeType && u.overrideMimeType(n.mimeType);
- n.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
- for (f in i) u.setRequestHeader(f, i[f]);
- t = function(n) {
- return function() {
- t && (delete gt[e], t = u.onload = u.onerror = null, "abort" === n ? u.abort() : "error" === n ? r(u.status, u.statusText) : r(de[u.status] || u.status, u.statusText, "string" == typeof u.responseText ? {
- text: u.responseText
- } : void 0, u.getAllResponseHeaders()))
- }
- };
- u.onload = t();
- u.onerror = t("error");
- t = gt[e] = t("abort");
- try {
- u.send(n.hasContent && n.data || null)
- } catch (o) {
- if (t) throw o;
- }
- },
- abort: function() {
- t && t()
- }
- }
- }), i.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- "text script": function(n) {
- return i.globalEval(n), n
- }
- }
- }), i.ajaxPrefilter("script", function(n) {
- void 0 === n.cache && (n.cache = !1);
- n.crossDomain && (n.type = "GET")
- }), i.ajaxTransport("script", function(n) {
- if (n.crossDomain) {
- var r, t;
- return {
- send: function(f, e) {
- r = i("<script>").prop({
- async: !0,
- charset: n.scriptCharset,
- src: n.url
- }).on("load error", t = function(n) {
- r.remove();
- t = null;
- n && e("error" === n.type ? 404 : 200, n.type)
- });
- u.head.appendChild(r[0])
- },
- abort: function() {
- t && t()
- }
- }
- }
- }), yi = [], ni = /(=)\?(?=&|$)|\?\?/, i.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var n = yi.pop() || i.expando + "_" + kt++;
- return this[n] = !0, n
- }
- }), i.ajaxPrefilter("json jsonp", function(t, r, u) {
- var f, o, e, s = t.jsonp !== !1 && (ni.test(t.url) ? "url" : "string" == typeof t.data && !(t.contentType || "").indexOf("application/x-www-form-urlencoded") && ni.test(t.data) && "data");
- if (s || "jsonp" === t.dataTypes[0]) return (f = t.jsonpCallback = i.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, s ? t[s] = t[s].replace(ni, "$1" + f) : t.jsonp !== !1 && (t.url += (dt.test(t.url) ? "&" : "?") + t.jsonp + "=" + f), t.converters["script json"] = function() {
- return e || i.error(f + " was not called"), e[0]
- }, t.dataTypes[0] = "json", o = n[f], n[f] = function() {
- e = arguments
- }, u.always(function() {
- n[f] = o;
- t[f] && (t.jsonpCallback = r.jsonpCallback, yi.push(f));
- e && i.isFunction(o) && o(e[0]);
- e = o = void 0
- }), "script")
- }), i.parseHTML = function(n, t, r) {
- if (!n || "string" != typeof n) return null;
- "boolean" == typeof t && (r = t, t = !1);
- t = t || u;
- var f = gi.exec(n),
- e = !r && [];
- return f ? [t.createElement(f[1])] : (f = i.buildFragment([n], t, e), e && e.length && i(e).remove(), i.merge([], f.childNodes))
- }, pi = i.fn.load, i.fn.load = function(n, t, r) {
- if ("string" != typeof n && pi) return pi.apply(this, arguments);
- var u, o, s, f = this,
- e = n.indexOf(" ");
- return e >= 0 && (u = i.trim(n.slice(e)), n = n.slice(0, e)), i.isFunction(t) ? (r = t, t = void 0) : t && "object" == typeof t && (o = "POST"), f.length > 0 && i.ajax({
- url: n,
- type: o,
- dataType: "html",
- data: t
- }).done(function(n) {
- s = arguments;
- f.html(u ? i("<div>").append(i.parseHTML(n)).find(u) : n)
- }).complete(r && function(n, t) {
- f.each(r, s || [n.responseText, t, n])
- }), this
- }, i.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(n, t) {
- i.fn[t] = function(n) {
- return this.on(t, n)
- }
- }), i.expr.filters.animated = function(n) {
- return i.grep(i.timers, function(t) {
- return n === t.elem
- }).length
- }, wi = n.document.documentElement, i.offset = {
- setOffset: function(n, t, r) {
- var e, o, s, h, u, c, v, l = i.css(n, "position"),
- a = i(n),
- f = {};
- "static" === l && (n.style.position = "relative");
- u = a.offset();
- s = i.css(n, "top");
- c = i.css(n, "left");
- v = ("absolute" === l || "fixed" === l) && (s + c).indexOf("auto") > -1;
- v ? (e = a.position(), h = e.top, o = e.left) : (h = parseFloat(s) || 0, o = parseFloat(c) || 0);
- i.isFunction(t) && (t = t.call(n, r, u));
- null != t.top && (f.top = t.top - u.top + h);
- null != t.left && (f.left = t.left - u.left + o);
- "using" in t ? t.using.call(n, f) : a.css(f)
- }
- }, i.fn.extend({
- offset: function(n) {
- if (arguments.length) return void 0 === n ? this : this.each(function(t) {
- i.offset.setOffset(this, n, t)
- });
- var r, f, t = this[0],
- u = {
- top: 0,
- left: 0
- },
- e = t && t.ownerDocument;
- if (e) return r = e.documentElement, i.contains(r, t) ? (typeof t.getBoundingClientRect !== b && (u = t.getBoundingClientRect()), f = ku(e), {
- top: u.top + f.pageYOffset - r.clientTop,
- left: u.left + f.pageXOffset - r.clientLeft
- }) : u
- },
- position: function() {
- if (this[0]) {
- var n, r, u = this[0],
- t = {
- top: 0,
- left: 0
- };
- return "fixed" === i.css(u, "position") ? r = u.getBoundingClientRect() : (n = this.offsetParent(), r = this.offset(), i.nodeName(n[0], "html") || (t = n.offset()), t.top += i.css(n[0], "borderTopWidth", !0), t.left += i.css(n[0], "borderLeftWidth", !0)), {
- top: r.top - t.top - i.css(u, "marginTop", !0),
- left: r.left - t.left - i.css(u, "marginLeft", !0)
- }
- }
- },
- offsetParent: function() {
- return this.map(function() {
- for (var n = this.offsetParent || wi; n && !i.nodeName(n, "html") && "static" === i.css(n, "position");) n = n.offsetParent;
- return n || wi
- })
- }
- }), i.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
- }, function(t, r) {
- var u = "pageYOffset" === r;
- i.fn[t] = function(i) {
- return l(this, function(t, i, f) {
- var e = ku(t);
- return void 0 === f ? e ? e[r] : t[i] : void(e ? e.scrollTo(u ? n.pageXOffset : f, u ? f : n.pageYOffset) : t[i] = f)
- }, t, i, arguments.length, null)
- }
- }), i.each(["top", "left"], function(n, t) {
- i.cssHooks[t] = br(f.pixelPosition, function(n, r) {
- if (r) return (r = it(n, t), hi.test(r) ? i(n).position()[t] + "px" : r)
- })
- }), i.each({
- Height: "height",
- Width: "width"
- }, function(n, t) {
- i.each({
- padding: "inner" + n,
- content: t,
- "": "outer" + n
- }, function(r, u) {
- i.fn[u] = function(u, f) {
- var e = arguments.length && (r || "boolean" != typeof u),
- o = r || (u === !0 || f === !0 ? "margin" : "border");
- return l(this, function(t, r, u) {
- var f;
- return i.isWindow(t) ? t.document.documentElement["client" + n] : 9 === t.nodeType ? (f = t.documentElement, Math.max(t.body["scroll" + n], f["scroll" + n], t.body["offset" + n], f["offset" + n], f["client" + n])) : void 0 === u ? i.css(t, r, o) : i.style(t, r, u, o)
- }, t, e ? u : void 0, e, null)
- }
- })
- }), i.fn.size = function() {
- return this.length
- }, i.fn.andSelf = i.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function() {
- return i
- }), du = n.jQuery, gu = n.$, i.noConflict = function(t) {
- return n.$ === i && (n.$ = gu), t && n.jQuery === i && (n.jQuery = du), i
- }, typeof t === b && (n.jQuery = n.$ = i), i
- }),
- function(n) {
- "function" == typeof define && define.amd ? define(["jquery"], n) : n(jQuery)
- }(function(n) {
- function t(t, r) {
- var u, f, e, o = t.nodeName.toLowerCase();
- return "area" === o ? (u = t.parentNode, f = u.name, t.href && f && "map" === u.nodeName.toLowerCase() ? (e = n("img[usemap='#" + f + "']")[0], !!e && i(e)) : !1) : (/^(input|select|textarea|button|object)$/.test(o) ? !t.disabled : "a" === o ? t.href || r : r) && i(t)
- }
- function i(t) {
- return n.expr.filters.visible(t) && !n(t).parents().addBack().filter(function() {
- return "hidden" === n.css(this, "visibility")
- }).length
- }
- n.ui = n.ui || {};
- n.extend(n.ui, {
- version: "1.11.4",
- keyCode: {
- BACKSPACE: 8,
- COMMA: 188,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- LEFT: 37,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
- });
- n.fn.extend({
- scrollParent: function(t) {
- var i = this.css("position"),
- u = "absolute" === i,
- f = t ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
- r = this.parents().filter(function() {
- var t = n(this);
- return u && "static" === t.css("position") ? !1 : f.test(t.css("overflow") + t.css("overflow-y") + t.css("overflow-x"))
- }).eq(0);
- return "fixed" !== i && r.length ? r : n(this[0].ownerDocument || document)
- },
- uniqueId: function() {
- var n = 0;
- return function() {
- return this.each(function() {
- this.id || (this.id = "ui-id-" + ++n)
- })
- }
- }(),
- removeUniqueId: function() {
- return this.each(function() {
- /^ui-id-\d+$/.test(this.id) && n(this).removeAttr("id")
- })
- }
- });
- n.extend(n.expr[":"], {
- data: n.expr.createPseudo ? n.expr.createPseudo(function(t) {
- return function(i) {
- return !!n.data(i, t)
- }
- }) : function(t, i, r) {
- return !!n.data(t, r[3])
- },
- focusable: function(i) {
- return t(i, !isNaN(n.attr(i, "tabindex")))
- },
- tabbable: function(i) {
- var r = n.attr(i, "tabindex"),
- u = isNaN(r);
- return (u || r >= 0) && t(i, !u)
- }
- });
- n("<a>").outerWidth(1).jquery || n.each(["Width", "Height"], function(t, i) {
- function r(t, i, r, u) {
- return n.each(e, function() {
- i -= parseFloat(n.css(t, "padding" + this)) || 0;
- r && (i -= parseFloat(n.css(t, "border" + this + "Width")) || 0);
- u && (i -= parseFloat(n.css(t, "margin" + this)) || 0)
- }), i
- }
- var e = "Width" === i ? ["Left", "Right"] : ["Top", "Bottom"],
- u = i.toLowerCase(),
- f = {
- innerWidth: n.fn.innerWidth,
- innerHeight: n.fn.innerHeight,
- outerWidth: n.fn.outerWidth,
- outerHeight: n.fn.outerHeight
- };
- n.fn["inner" + i] = function(t) {
- return void 0 === t ? f["inner" + i].call(this) : this.each(function() {
- n(this).css(u, r(this, t) + "px")
- })
- };
- n.fn["outer" + i] = function(t, e) {
- return "number" != typeof t ? f["outer" + i].call(this, t) : this.each(function() {
- n(this).css(u, r(this, t, !0, e) + "px")
- })
- }
- });
- n.fn.addBack || (n.fn.addBack = function(n) {
- return this.add(null == n ? this.prevObject : this.prevObject.filter(n))
- });
- n("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (n.fn.removeData = function(t) {
- return function(i) {
- return arguments.length ? t.call(this, n.camelCase(i)) : t.call(this)
- }
- }(n.fn.removeData));
- n.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());
- n.fn.extend({
- focus: function(t) {
- return function(i, r) {
- return "number" == typeof i ? this.each(function() {
- var t = this;
- setTimeout(function() {
- n(t).focus();
- r && r.call(t)
- }, i)
- }) : t.apply(this, arguments)
- }
- }(n.fn.focus),
- disableSelection: function() {
- var n = "onselectstart" in document.createElement("div") ? "selectstart" : "mousedown";
- return function() {
- return this.bind(n + ".ui-disableSelection", function(n) {
- n.preventDefault()
- })
- }
- }(),
- enableSelection: function() {
- return this.unbind(".ui-disableSelection")
- },
- zIndex: function(t) {
- if (void 0 !== t) return this.css("zIndex", t);
- if (this.length)
- for (var r, u, i = n(this[0]); i.length && i[0] !== document;) {
- if (r = i.css("position"), ("absolute" === r || "relative" === r || "fixed" === r) && (u = parseInt(i.css("zIndex"), 10), !isNaN(u) && 0 !== u)) return u;
- i = i.parent()
- }
- return 0
- }
- });
- n.ui.plugin = {
- add: function(t, i, r) {
- var u, f = n.ui[t].prototype;
- for (u in r) f.plugins[u] = f.plugins[u] || [], f.plugins[u].push([i, r[u]])
- },
- call: function(n, t, i, r) {
- var u, f = n.plugins[t];
- if (f && (r || n.element[0].parentNode && 11 !== n.element[0].parentNode.nodeType))
- for (u = 0; f.length > u; u++) n.options[f[u][0]] && f[u][1].apply(n.element, i)
- }
- };
- var u = 0,
- r = Array.prototype.slice;
- n.cleanData = function(t) {
- return function(i) {
- for (var r, u, f = 0; null != (u = i[f]); f++) try {
- r = n._data(u, "events");
- r && r.remove && n(u).triggerHandler("remove")
- } catch (e) {}
- t(i)
- }
- }(n.cleanData);
- n.widget = function(t, i, r) {
- var s, f, u, o, h = {},
- e = t.split(".")[0];
- return t = t.split(".")[1], s = e + "-" + t, r || (r = i, i = n.Widget), n.expr[":"][s.toLowerCase()] = function(t) {
- return !!n.data(t, s)
- }, n[e] = n[e] || {}, f = n[e][t], u = n[e][t] = function(n, t) {
- return this._createWidget ? (arguments.length && this._createWidget(n, t), void 0) : new u(n, t)
- }, n.extend(u, f, {
- version: r.version,
- _proto: n.extend({}, r),
- _childConstructors: []
- }), o = new i, o.options = n.widget.extend({}, o.options), n.each(r, function(t, r) {
- return n.isFunction(r) ? (h[t] = function() {
- var n = function() {
- return i.prototype[t].apply(this, arguments)
- },
- u = function(n) {
- return i.prototype[t].apply(this, n)
- };
- return function() {
- var t, i = this._super,
- f = this._superApply;
- return this._super = n, this._superApply = u, t = r.apply(this, arguments), this._super = i, this._superApply = f, t
- }
- }(), void 0) : (h[t] = r, void 0)
- }), u.prototype = n.widget.extend(o, {
- widgetEventPrefix: f ? o.widgetEventPrefix || t : t
- }, h, {
- constructor: u,
- namespace: e,
- widgetName: t,
- widgetFullName: s
- }), f ? (n.each(f._childConstructors, function(t, i) {
- var r = i.prototype;
- n.widget(r.namespace + "." + r.widgetName, u, i._proto)
- }), delete f._childConstructors) : i._childConstructors.push(u), n.widget.bridge(t, u), u
- };
- n.widget.extend = function(t) {
- for (var i, u, e = r.call(arguments, 1), f = 0, o = e.length; o > f; f++)
- for (i in e[f]) u = e[f][i], e[f].hasOwnProperty(i) && void 0 !== u && (t[i] = n.isPlainObject(u) ? n.isPlainObject(t[i]) ? n.widget.extend({}, t[i], u) : n.widget.extend({}, u) : u);
- return t
- };
- n.widget.bridge = function(t, i) {
- var u = i.prototype.widgetFullName || t;
- n.fn[t] = function(f) {
- var s = "string" == typeof f,
- o = r.call(arguments, 1),
- e = this;
- return s ? this.each(function() {
- var i, r = n.data(this, u);
- return "instance" === f ? (e = r, !1) : r ? n.isFunction(r[f]) && "_" !== f.charAt(0) ? (i = r[f].apply(r, o), i !== r && void 0 !== i ? (e = i && i.jquery ? e.pushStack(i.get()) : i, !1) : void 0) : n.error("no such method '" + f + "' for " + t + " widget instance") : n.error("cannot call methods on " + t + " prior to initialization; attempted to call method '" + f + "'")
- }) : (o.length && (f = n.widget.extend.apply(null, [f].concat(o))), this.each(function() {
- var t = n.data(this, u);
- t ? (t.option(f || {}), t._init && t._init()) : n.data(this, u, new i(f, this))
- })), e
- }
- };
- n.Widget = function() {};
- n.Widget._childConstructors = [];
- n.Widget.prototype = {
- widgetName: "widget",
- widgetEventPrefix: "",
- defaultElement: "<div>",
- options: {
- disabled: !1,
- create: null
- },
- _createWidget: function(t, i) {
- i = n(i || this.defaultElement || this)[0];
- this.element = n(i);
- this.uuid = u++;
- this.eventNamespace = "." + this.widgetName + this.uuid;
- this.bindings = n();
- this.hoverable = n();
- this.focusable = n();
- i !== this && (n.data(i, this.widgetFullName, this), this._on(!0, this.element, {
- remove: function(n) {
- n.target === i && this.destroy()
- }
- }), this.document = n(i.style ? i.ownerDocument : i.document || i), this.window = n(this.document[0].defaultView || this.document[0].parentWindow));
- this.options = n.widget.extend({}, this.options, this._getCreateOptions(), t);
- this._create();
- this._trigger("create", null, this._getCreateEventData());
- this._init()
- },
- _getCreateOptions: n.noop,
- _getCreateEventData: n.noop,
- _create: n.noop,
- _init: n.noop,
- destroy: function() {
- this._destroy();
- this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(n.camelCase(this.widgetFullName));
- this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled ui-state-disabled");
- this.bindings.unbind(this.eventNamespace);
- this.hoverable.removeClass("ui-state-hover");
- this.focusable.removeClass("ui-state-focus")
- },
- _destroy: n.noop,
- widget: function() {
- return this.element
- },
- option: function(t, i) {
- var r, u, f, e = t;
- if (0 === arguments.length) return n.widget.extend({}, this.options);
- if ("string" == typeof t)
- if (e = {}, r = t.split("."), t = r.shift(), r.length) {
- for (u = e[t] = n.widget.extend({}, this.options[t]), f = 0; r.length - 1 > f; f++) u[r[f]] = u[r[f]] || {}, u = u[r[f]];
- if (t = r.pop(), 1 === arguments.length) return void 0 === u[t] ? null : u[t];
- u[t] = i
- } else {
- if (1 === arguments.length) return void 0 === this.options[t] ? null : this.options[t];
- e[t] = i
- }
- return this._setOptions(e), this
- },
- _setOptions: function(n) {
- for (var t in n) this._setOption(t, n[t]);
- return this
- },
- _setOption: function(n, t) {
- return this.options[n] = t, "disabled" === n && (this.widget().toggleClass(this.widgetFullName + "-disabled", !!t), t && (this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus"))), this
- },
- enable: function() {
- return this._setOptions({
- disabled: !1
- })
- },
- disable: function() {
- return this._setOptions({
- disabled: !0
- })
- },
- _on: function(t, i, r) {
- var f, u = this;
- "boolean" != typeof t && (r = i, i = t, t = !1);
- r ? (i = f = n(i), this.bindings = this.bindings.add(i)) : (r = i, i = this.element, f = this.widget());
- n.each(r, function(r, e) {
- function o() {
- if (t || u.options.disabled !== !0 && !n(this).hasClass("ui-state-disabled")) return ("string" == typeof e ? u[e] : e).apply(u, arguments)
- }
- "string" != typeof e && (o.guid = e.guid = e.guid || o.guid || n.guid++);
- var s = r.match(/^([\w:-]*)\s*(.*)$/),
- h = s[1] + u.eventNamespace,
- c = s[2];
- c ? f.delegate(c, h, o) : i.bind(h, o)
- })
- },
- _off: function(t, i) {
- i = (i || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
- t.unbind(i).undelegate(i);
- this.bindings = n(this.bindings.not(t).get());
- this.focusable = n(this.focusable.not(t).get());
- this.hoverable = n(this.hoverable.not(t).get())
- },
- _delay: function(n, t) {
- function r() {
- return ("string" == typeof n ? i[n] : n).apply(i, arguments)
- }
- var i = this;
- return setTimeout(r, t || 0)
- },
- _hoverable: function(t) {
- this.hoverable = this.hoverable.add(t);
- this._on(t, {
- mouseenter: function(t) {
- n(t.currentTarget).addClass("ui-state-hover")
- },
- mouseleave: function(t) {
- n(t.currentTarget).removeClass("ui-state-hover")
- }
- })
- },
- _focusable: function(t) {
- this.focusable = this.focusable.add(t);
- this._on(t, {
- focusin: function(t) {
- n(t.currentTarget).addClass("ui-state-focus")
- },
- focusout: function(t) {
- n(t.currentTarget).removeClass("ui-state-focus")
- }
- })
- },
- _trigger: function(t, i, r) {
- var u, f, e = this.options[t];
- if (r = r || {}, i = n.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], f = i.originalEvent)
- for (u in f) u in i || (i[u] = f[u]);
- return this.element.trigger(i, r), !(n.isFunction(e) && e.apply(this.element[0], [i].concat(r)) === !1 || i.isDefaultPrevented())
- }
- };
- n.each({
- show: "fadeIn",
- hide: "fadeOut"
- }, function(t, i) {
- n.Widget.prototype["_" + t] = function(r, u, f) {
- "string" == typeof u && (u = {
- effect: u
- });
- var o, e = u ? u === !0 || "number" == typeof u ? i : u.effect || i : t;
- u = u || {};
- "number" == typeof u && (u = {
- duration: u
- });
- o = !n.isEmptyObject(u);
- u.complete = f;
- u.delay && r.delay(u.delay);
- o && n.effects && n.effects.effect[e] ? r[t](u) : e !== t && r[e] ? r[e](u.duration, u.easing, f) : r.queue(function(i) {
- n(this)[t]();
- f && f.call(r[0]);
- i()
- })
- }
- });
- n.widget,
- function() {
- function f(n, t, i) {
- return [parseFloat(n[0]) * (a.test(n[0]) ? t / 100 : 1), parseFloat(n[1]) * (a.test(n[1]) ? i / 100 : 1)]
- }
- function i(t, i) {
- return parseInt(n.css(t, i), 10) || 0
- }
- function v(t) {
- var i = t[0];
- return 9 === i.nodeType ? {
- width: t.width(),
- height: t.height(),
- offset: {
- top: 0,
- left: 0
- }
- } : n.isWindow(i) ? {
- width: t.width(),
- height: t.height(),
- offset: {
- top: t.scrollTop(),
- left: t.scrollLeft()
- }
- } : i.preventDefault ? {
- width: 0,
- height: 0,
- offset: {
- top: i.pageY,
- left: i.pageX
- }
- } : {
- width: t.outerWidth(),
- height: t.outerHeight(),
- offset: t.offset()
- }
- }
- n.ui = n.ui || {};
- var u, e, r = Math.max,
- t = Math.abs,
- o = Math.round,
- s = /left|center|right/,
- h = /top|center|bottom/,
- c = /[\+\-]\d+(\.[\d]+)?%?/,
- l = /^\w+/,
- a = /%$/,
- y = n.fn.position;
- n.position = {
- scrollbarWidth: function() {
- if (void 0 !== u) return u;
- var r, i, t = n("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'><\/div><\/div>"),
- f = t.children()[0];
- return n("body").append(t), r = f.offsetWidth, t.css("overflow", "scroll"), i = f.offsetWidth, r === i && (i = t[0].clientWidth), t.remove(), u = r - i
- },
- getScrollInfo: function(t) {
- var i = t.isWindow || t.isDocument ? "" : t.element.css("overflow-x"),
- r = t.isWindow || t.isDocument ? "" : t.element.css("overflow-y"),
- u = "scroll" === i || "auto" === i && t.width < t.element[0].scrollWidth,
- f = "scroll" === r || "auto" === r && t.height < t.element[0].scrollHeight;
- return {
- width: f ? n.position.scrollbarWidth() : 0,
- height: u ? n.position.scrollbarWidth() : 0
- }
- },
- getWithinInfo: function(t) {
- var i = n(t || window),
- r = n.isWindow(i[0]),
- u = !!i[0] && 9 === i[0].nodeType;
- return {
- element: i,
- isWindow: r,
- isDocument: u,
- offset: i.offset() || {
- left: 0,
- top: 0
- },
- scrollLeft: i.scrollLeft(),
- scrollTop: i.scrollTop(),
- width: r || u ? i.width() : i.outerWidth(),
- height: r || u ? i.height() : i.outerHeight()
- }
- }
- };
- n.fn.position = function(u) {
- if (!u || !u.of) return y.apply(this, arguments);
- u = n.extend({}, u);
- var k, a, p, b, w, g, nt = n(u.of),
- it = n.position.getWithinInfo(u.within),
- rt = n.position.getScrollInfo(it),
- d = (u.collision || "flip").split(" "),
- tt = {};
- return g = v(nt), nt[0].preventDefault && (u.at = "left top"), a = g.width, p = g.height, b = g.offset, w = n.extend({}, b), n.each(["my", "at"], function() {
- var t, i, n = (u[this] || "").split(" ");
- 1 === n.length && (n = s.test(n[0]) ? n.concat(["center"]) : h.test(n[0]) ? ["center"].concat(n) : ["center", "center"]);
- n[0] = s.test(n[0]) ? n[0] : "center";
- n[1] = h.test(n[1]) ? n[1] : "center";
- t = c.exec(n[0]);
- i = c.exec(n[1]);
- tt[this] = [t ? t[0] : 0, i ? i[0] : 0];
- u[this] = [l.exec(n[0])[0], l.exec(n[1])[0]]
- }), 1 === d.length && (d[1] = d[0]), "right" === u.at[0] ? w.left += a : "center" === u.at[0] && (w.left += a / 2), "bottom" === u.at[1] ? w.top += p : "center" === u.at[1] && (w.top += p / 2), k = f(tt.at, a, p), w.left += k[0], w.top += k[1], this.each(function() {
- var y, g, h = n(this),
- c = h.outerWidth(),
- l = h.outerHeight(),
- ut = i(this, "marginLeft"),
- ft = i(this, "marginTop"),
- et = c + ut + i(this, "marginRight") + rt.width,
- ot = l + ft + i(this, "marginBottom") + rt.height,
- s = n.extend({}, w),
- v = f(tt.my, h.outerWidth(), h.outerHeight());
- "right" === u.my[0] ? s.left -= c : "center" === u.my[0] && (s.left -= c / 2);
- "bottom" === u.my[1] ? s.top -= l : "center" === u.my[1] && (s.top -= l / 2);
- s.left += v[0];
- s.top += v[1];
- e || (s.left = o(s.left), s.top = o(s.top));
- y = {
- marginLeft: ut,
- marginTop: ft
- };
- n.each(["left", "top"], function(t, i) {
- n.ui.position[d[t]] && n.ui.position[d[t]][i](s, {
- targetWidth: a,
- targetHeight: p,
- elemWidth: c,
- elemHeight: l,
- collisionPosition: y,
- collisionWidth: et,
- collisionHeight: ot,
- offset: [k[0] + v[0], k[1] + v[1]],
- my: u.my,
- at: u.at,
- within: it,
- elem: h
- })
- });
- u.using && (g = function(n) {
- var i = b.left - s.left,
- o = i + a - c,
- f = b.top - s.top,
- v = f + p - l,
- e = {
- target: {
- element: nt,
- left: b.left,
- top: b.top,
- width: a,
- height: p
- },
- element: {
- element: h,
- left: s.left,
- top: s.top,
- width: c,
- height: l
- },
- horizontal: 0 > o ? "left" : i > 0 ? "right" : "center",
- vertical: 0 > v ? "top" : f > 0 ? "bottom" : "middle"
- };
- c > a && a > t(i + o) && (e.horizontal = "center");
- l > p && p > t(f + v) && (e.vertical = "middle");
- e.important = r(t(i), t(o)) > r(t(f), t(v)) ? "horizontal" : "vertical";
- u.using.call(this, n, e)
- });
- h.offset(n.extend(s, {
- using: g
- }))
- })
- };
- n.ui.position = {
- fit: {
- left: function(n, t) {
- var h, e = t.within,
- u = e.isWindow ? e.scrollLeft : e.offset.left,
- o = e.width,
- s = n.left - t.collisionPosition.marginLeft,
- i = u - s,
- f = s + t.collisionWidth - o - u;
- t.collisionWidth > o ? i > 0 && 0 >= f ? (h = n.left + i + t.collisionWidth - o - u, n.left += i - h) : n.left = f > 0 && 0 >= i ? u : i > f ? u + o - t.collisionWidth : u : i > 0 ? n.left += i : f > 0 ? n.left -= f : n.left = r(n.left - s, n.left)
- },
- top: function(n, t) {
- var h, o = t.within,
- u = o.isWindow ? o.scrollTop : o.offset.top,
- e = t.within.height,
- s = n.top - t.collisionPosition.marginTop,
- i = u - s,
- f = s + t.collisionHeight - e - u;
- t.collisionHeight > e ? i > 0 && 0 >= f ? (h = n.top + i + t.collisionHeight - e - u, n.top += i - h) : n.top = f > 0 && 0 >= i ? u : i > f ? u + e - t.collisionHeight : u : i > 0 ? n.top += i : f > 0 ? n.top -= f : n.top = r(n.top - s, n.top)
- }
- },
- flip: {
- left: function(n, i) {
- var o, s, r = i.within,
- y = r.offset.left + r.scrollLeft,
- c = r.width,
- h = r.isWindow ? r.scrollLeft : r.offset.left,
- l = n.left - i.collisionPosition.marginLeft,
- a = l - h,
- v = l + i.collisionWidth - c - h,
- u = "left" === i.my[0] ? -i.elemWidth : "right" === i.my[0] ? i.elemWidth : 0,
- f = "left" === i.at[0] ? i.targetWidth : "right" === i.at[0] ? -i.targetWidth : 0,
- e = -2 * i.offset[0];
- 0 > a ? (o = n.left + u + f + e + i.collisionWidth - c - y, (0 > o || t(a) > o) && (n.left += u + f + e)) : v > 0 && (s = n.left - i.collisionPosition.marginLeft + u + f + e - h, (s > 0 || v > t(s)) && (n.left += u + f + e))
- },
- top: function(n, i) {
- var o, s, r = i.within,
- y = r.offset.top + r.scrollTop,
- c = r.height,
- h = r.isWindow ? r.scrollTop : r.offset.top,
- l = n.top - i.collisionPosition.marginTop,
- a = l - h,
- v = l + i.collisionHeight - c - h,
- p = "top" === i.my[1],
- u = p ? -i.elemHeight : "bottom" === i.my[1] ? i.elemHeight : 0,
- f = "top" === i.at[1] ? i.targetHeight : "bottom" === i.at[1] ? -i.targetHeight : 0,
- e = -2 * i.offset[1];
- 0 > a ? (s = n.top + u + f + e + i.collisionHeight - c - y, (0 > s || t(a) > s) && (n.top += u + f + e)) : v > 0 && (o = n.top - i.collisionPosition.marginTop + u + f + e - h, (o > 0 || v > t(o)) && (n.top += u + f + e))
- }
- },
- flipfit: {
- left: function() {
- n.ui.position.flip.left.apply(this, arguments);
- n.ui.position.fit.left.apply(this, arguments)
- },
- top: function() {
- n.ui.position.flip.top.apply(this, arguments);
- n.ui.position.fit.top.apply(this, arguments)
- }
- }
- },
- function() {
- var t, i, r, u, f, o = document.getElementsByTagName("body")[0],
- s = document.createElement("div");
- t = document.createElement(o ? "div" : "body");
- r = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- o && n.extend(r, {
- position: "absolute",
- left: "-1000px",
- top: "-1000px"
- });
- for (f in r) t.style[f] = r[f];
- t.appendChild(s);
- i = o || document.documentElement;
- i.insertBefore(t, i.firstChild);
- s.style.cssText = "position: absolute; left: 10.7432222px;";
- u = n(s).offset().left;
- e = u > 10 && 11 > u;
- t.innerHTML = "";
- i.removeChild(t)
- }()
- }();
- n.ui.position;
- n.widget("ui.menu", {
- version: "1.11.4",
- defaultElement: "<ul>",
- delay: 300,
- options: {
- icons: {
- submenu: "ui-icon-carat-1-e"
- },
- items: "> *",
- menus: "ul",
- position: {
- my: "left-1 top",
- at: "right top"
- },
- role: "menu",
- blur: null,
- focus: null,
- select: null
- },
- _create: function() {
- this.activeMenu = this.element;
- this.mouseHandled = !1;
- this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length).attr({
- role: this.options.role,
- tabIndex: 0
- });
- this.options.disabled && this.element.addClass("ui-state-disabled").attr("aria-disabled", "true");
- this._on({
- "mousedown .ui-menu-item": function(n) {
- n.preventDefault()
- },
- "click .ui-menu-item": function(t) {
- var i = n(t.target);
- !this.mouseHandled && i.not(".ui-state-disabled").length && (this.select(t), t.isPropagationStopped() || (this.mouseHandled = !0), i.has(".ui-menu").length ? this.expand(t) : !this.element.is(":focus") && n(this.document[0].activeElement).closest(".ui-menu").length && (this.element.trigger("focus", [!0]), this.active && 1 === this.active.parents(".ui-menu").length && clearTimeout(this.timer)))
- },
- "mouseenter .ui-menu-item": function(t) {
- if (!this.previousFilter) {
- var i = n(t.currentTarget);
- i.siblings(".ui-state-active").removeClass("ui-state-active");
- this.focus(t, i)
- }
- },
- mouseleave: "collapseAll",
- "mouseleave .ui-menu": "collapseAll",
- focus: function(n, t) {
- var i = this.active || this.element.find(this.options.items).eq(0);
- t || this.focus(n, i)
- },
- blur: function(t) {
- this._delay(function() {
- n.contains(this.element[0], this.document[0].activeElement) || this.collapseAll(t)
- })
- },
- keydown: "_keydown"
- });
- this.refresh();
- this._on(this.document, {
- click: function(n) {
- this._closeOnDocumentClick(n) && this.collapseAll(n);
- this.mouseHandled = !1
- }
- })
- },
- _destroy: function() {
- this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();
- this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function() {
- var t = n(this);
- t.data("ui-menu-submenu-carat") && t.remove()
- });
- this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")
- },
- _keydown: function(t) {
- var i, u, r, f, e = !0;
- switch (t.keyCode) {
- case n.ui.keyCode.PAGE_UP:
- this.previousPage(t);
- break;
- case n.ui.keyCode.PAGE_DOWN:
- this.nextPage(t);
- break;
- case n.ui.keyCode.HOME:
- this._move("first", "first", t);
- break;
- case n.ui.keyCode.END:
- this._move("last", "last", t);
- break;
- case n.ui.keyCode.UP:
- this.previous(t);
- break;
- case n.ui.keyCode.DOWN:
- this.next(t);
- break;
- case n.ui.keyCode.LEFT:
- this.collapse(t);
- break;
- case n.ui.keyCode.RIGHT:
- this.active && !this.active.is(".ui-state-disabled") && this.expand(t);
- break;
- case n.ui.keyCode.ENTER:
- case n.ui.keyCode.SPACE:
- this._activate(t);
- break;
- case n.ui.keyCode.ESCAPE:
- this.collapse(t);
- break;
- default:
- e = !1;
- u = this.previousFilter || "";
- r = String.fromCharCode(t.keyCode);
- f = !1;
- clearTimeout(this.filterTimer);
- r === u ? f = !0 : r = u + r;
- i = this._filterMenuItems(r);
- i = f && -1 !== i.index(this.active.next()) ? this.active.nextAll(".ui-menu-item") : i;
- i.length || (r = String.fromCharCode(t.keyCode), i = this._filterMenuItems(r));
- i.length ? (this.focus(t, i), this.previousFilter = r, this.filterTimer = this._delay(function() {
- delete this.previousFilter
- }, 1e3)) : delete this.previousFilter
- }
- e && t.preventDefault()
- },
- _activate: function(n) {
- this.active.is(".ui-state-disabled") || (this.active.is("[aria-haspopup='true']") ? this.expand(n) : this.select(n))
- },
- refresh: function() {
- var i, t, u = this,
- f = this.options.icons.submenu,
- r = this.element.find(this.options.menus);
- this.element.toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length);
- r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({
- role: this.options.role,
- "aria-hidden": "true",
- "aria-expanded": "false"
- }).each(function() {
- var t = n(this),
- i = t.parent(),
- r = n("<span>").addClass("ui-menu-icon ui-icon " + f).data("ui-menu-submenu-carat", !0);
- i.attr("aria-haspopup", "true").prepend(r);
- t.attr("aria-labelledby", i.attr("id"))
- });
- i = r.add(this.element);
- t = i.find(this.options.items);
- t.not(".ui-menu-item").each(function() {
- var t = n(this);
- u._isDivider(t) && t.addClass("ui-widget-content ui-menu-divider")
- });
- t.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({
- tabIndex: -1,
- role: this._itemRole()
- });
- t.filter(".ui-state-disabled").attr("aria-disabled", "true");
- this.active && !n.contains(this.element[0], this.active[0]) && this.blur()
- },
- _itemRole: function() {
- return {
- menu: "menuitem",
- listbox: "option"
- }[this.options.role]
- },
- _setOption: function(n, t) {
- "icons" === n && this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu);
- "disabled" === n && this.element.toggleClass("ui-state-disabled", !!t).attr("aria-disabled", t);
- this._super(n, t)
- },
- focus: function(n, t) {
- var i, r;
- this.blur(n, n && "focus" === n.type);
- this._scrollIntoView(t);
- this.active = t.first();
- r = this.active.addClass("ui-state-focus").removeClass("ui-state-active");
- this.options.role && this.element.attr("aria-activedescendant", r.attr("id"));
- this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");
- n && "keydown" === n.type ? this._close() : this.timer = this._delay(function() {
- this._close()
- }, this.delay);
- i = t.children(".ui-menu");
- i.length && n && /^mouse/.test(n.type) && this._startOpening(i);
- this.activeMenu = t.parent();
- this._trigger("focus", n, {
- item: t
- })
- },
- _scrollIntoView: function(t) {
- var e, o, i, r, u, f;
- this._hasScroll() && (e = parseFloat(n.css(this.activeMenu[0], "borderTopWidth")) || 0, o = parseFloat(n.css(this.activeMenu[0], "paddingTop")) || 0, i = t.offset().top - this.activeMenu.offset().top - e - o, r = this.activeMenu.scrollTop(), u = this.activeMenu.height(), f = t.outerHeight(), 0 > i ? this.activeMenu.scrollTop(r + i) : i + f > u && this.activeMenu.scrollTop(r + i - u + f))
- },
- blur: function(n, t) {
- t || clearTimeout(this.timer);
- this.active && (this.active.removeClass("ui-state-focus"), this.active = null, this._trigger("blur", n, {
- item: this.active
- }))
- },
- _startOpening: function(n) {
- clearTimeout(this.timer);
- "true" === n.attr("aria-hidden") && (this.timer = this._delay(function() {
- this._close();
- this._open(n)
- }, this.delay))
- },
- _open: function(t) {
- var i = n.extend({
- of: this.active
- }, this.options.position);
- clearTimeout(this.timer);
- this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden", "true");
- t.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(i)
- },
- collapseAll: function(t, i) {
- clearTimeout(this.timer);
- this.timer = this._delay(function() {
- var r = i ? this.element : n(t && t.target).closest(this.element.find(".ui-menu"));
- r.length || (r = this.element);
- this._close(r);
- this.blur(t);
- this.activeMenu = r
- }, this.delay)
- },
- _close: function(n) {
- n || (n = this.active ? this.active.parent() : this.element);
- n.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")
- },
- _closeOnDocumentClick: function(t) {
- return !n(t.target).closest(".ui-menu").length
- },
- _isDivider: function(n) {
- return !/[^\-\u2014\u2013\s]/.test(n.text())
- },
- collapse: function(n) {
- var t = this.active && this.active.parent().closest(".ui-menu-item", this.element);
- t && t.length && (this._close(), this.focus(n, t))
- },
- expand: function(n) {
- var t = this.active && this.active.children(".ui-menu ").find(this.options.items).first();
- t && t.length && (this._open(t.parent()), this._delay(function() {
- this.focus(n, t)
- }))
- },
- next: function(n) {
- this._move("next", "first", n)
- },
- previous: function(n) {
- this._move("prev", "last", n)
- },
- isFirstItem: function() {
- return this.active && !this.active.prevAll(".ui-menu-item").length
- },
- isLastItem: function() {
- return this.active && !this.active.nextAll(".ui-menu-item").length
- },
- _move: function(n, t, i) {
- var r;
- this.active && (r = "first" === n || "last" === n ? this.active["first" === n ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) : this.active[n + "All"](".ui-menu-item").eq(0));
- r && r.length && this.active || (r = this.activeMenu.find(this.options.items)[t]());
- this.focus(i, r)
- },
- nextPage: function(t) {
- var i, r, u;
- return this.active ? (this.isLastItem() || (this._hasScroll() ? (r = this.active.offset().top, u = this.element.height(), this.active.nextAll(".ui-menu-item").each(function() {
- return i = n(this), 0 > i.offset().top - r - u
- }), this.focus(t, i)) : this.focus(t, this.activeMenu.find(this.options.items)[this.active ? "last" : "first"]())), void 0) : (this.next(t), void 0)
- },
- previousPage: function(t) {
- var i, r, u;
- return this.active ? (this.isFirstItem() || (this._hasScroll() ? (r = this.active.offset().top, u = this.element.height(), this.active.prevAll(".ui-menu-item").each(function() {
- return i = n(this), i.offset().top - r + u > 0
- }), this.focus(t, i)) : this.focus(t, this.activeMenu.find(this.options.items).first())), void 0) : (this.next(t), void 0)
- },
- _hasScroll: function() {
- return this.element.outerHeight() < this.element.prop("scrollHeight")
- },
- select: function(t) {
- this.active = this.active || n(t.target).closest(".ui-menu-item");
- var i = {
- item: this.active
- };
- this.active.has(".ui-menu").length || this.collapseAll(t, !0);
- this._trigger("select", t, i)
- },
- _filterMenuItems: function(t) {
- var i = t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"),
- r = RegExp("^" + i, "i");
- return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function() {
- return r.test(n.trim(n(this).text()))
- })
- }
- });
- n.widget("ui.autocomplete", {
- version: "1.11.4",
- defaultElement: "<input>",
- options: {
- appendTo: null,
- autoFocus: !1,
- delay: 300,
- minLength: 1,
- position: {
- my: "left top",
- at: "left bottom",
- collision: "none"
- },
- source: null,
- change: null,
- close: null,
- focus: null,
- open: null,
- response: null,
- search: null,
- select: null
- },
- requestIndex: 0,
- pending: 0,
- _create: function() {
- var t, i, r, u = this.element[0].nodeName.toLowerCase(),
- f = "textarea" === u,
- e = "input" === u;
- this.isMultiLine = f ? !0 : e ? !1 : this.element.prop("isContentEditable");
- this.valueMethod = this.element[f || e ? "val" : "text"];
- this.isNewMenu = !0;
- this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off");
- this._on(this.element, {
- keydown: function(u) {
- if (this.element.prop("readOnly")) return t = !0, r = !0, i = !0, void 0;
- t = !1;
- r = !1;
- i = !1;
- var f = n.ui.keyCode;
- switch (u.keyCode) {
- case f.PAGE_UP:
- t = !0;
- this._move("previousPage", u);
- break;
- case f.PAGE_DOWN:
- t = !0;
- this._move("nextPage", u);
- break;
- case f.UP:
- t = !0;
- this._keyEvent("previous", u);
- break;
- case f.DOWN:
- t = !0;
- this._keyEvent("next", u);
- break;
- case f.ENTER:
- this.menu.active && (t = !0, u.preventDefault(), this.menu.select(u));
- break;
- case f.TAB:
- this.menu.active && this.menu.select(u);
- break;
- case f.ESCAPE:
- this.menu.element.is(":visible") && (this.isMultiLine || this._value(this.term), this.close(u), u.preventDefault());
- break;
- default:
- i = !0;
- this._searchTimeout(u)
- }
- },
- keypress: function(r) {
- if (t) return t = !1, (!this.isMultiLine || this.menu.element.is(":visible")) && r.preventDefault(), void 0;
- if (!i) {
- var u = n.ui.keyCode;
- switch (r.keyCode) {
- case u.PAGE_UP:
- this._move("previousPage", r);
- break;
- case u.PAGE_DOWN:
- this._move("nextPage", r);
- break;
- case u.UP:
- this._keyEvent("previous", r);
- break;
- case u.DOWN:
- this._keyEvent("next", r)
- }
- }
- },
- input: function(n) {
- return r ? (r = !1, n.preventDefault(), void 0) : (this._searchTimeout(n), void 0)
- },
- focus: function() {
- this.selectedItem = null;
- this.previous = this._value()
- },
- blur: function(n) {
- return this.cancelBlur ? (delete this.cancelBlur, void 0) : (clearTimeout(this.searching), this.close(n), this._change(n), void 0)
- }
- });
- this._initSource();
- this.menu = n("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({
- role: null
- }).hide().menu("instance");
- this._on(this.menu.element, {
- mousedown: function(t) {
- t.preventDefault();
- this.cancelBlur = !0;
- this._delay(function() {
- delete this.cancelBlur
- });
- var i = this.menu.element[0];
- n(t.target).closest(".ui-menu-item").length || this._delay(function() {
- var t = this;
- this.document.one("mousedown", function(r) {
- r.target === t.element[0] || r.target === i || n.contains(i, r.target) || t.close()
- })
- })
- },
- menufocus: function(t, i) {
- var r, u;
- return this.isNewMenu && (this.isNewMenu = !1, t.originalEvent && /^mouse/.test(t.originalEvent.type)) ? (this.menu.blur(), this.document.one("mousemove", function() {
- n(t.target).trigger(t.originalEvent)
- }), void 0) : (u = i.item.data("ui-autocomplete-item"), !1 !== this._trigger("focus", t, {
- item: u
- }) && t.originalEvent && /^key/.test(t.originalEvent.type) && this._value(u.value), r = i.item.attr("aria-label") || u.value, r && n.trim(r).length && (this.liveRegion.children().hide(), n("<div>").text(r).appendTo(this.liveRegion)), void 0)
- },
- menuselect: function(n, t) {
- var i = t.item.data("ui-autocomplete-item"),
- r = this.previous;
- this.element[0] !== this.document[0].activeElement && (this.element.focus(), this.previous = r, this._delay(function() {
- this.previous = r;
- this.selectedItem = i
- }));
- !1 !== this._trigger("select", n, {
- item: i
- }) && this._value(i.value);
- this.term = this._value();
- this.close(n);
- this.selectedItem = i
- }
- });
- this.liveRegion = n("<span>", {
- role: "status",
- "aria-live": "assertive",
- "aria-relevant": "additions"
- }).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);
- this._on(this.window, {
- beforeunload: function() {
- this.element.removeAttr("autocomplete")
- }
- })
- },
- _destroy: function() {
- clearTimeout(this.searching);
- this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");
- this.menu.element.remove();
- this.liveRegion.remove()
- },
- _setOption: function(n, t) {
- this._super(n, t);
- "source" === n && this._initSource();
- "appendTo" === n && this.menu.element.appendTo(this._appendTo());
- "disabled" === n && t && this.xhr && this.xhr.abort()
- },
- _appendTo: function() {
- var t = this.options.appendTo;
- return t && (t = t.jquery || t.nodeType ? n(t) : this.document.find(t).eq(0)), t && t[0] || (t = this.element.closest(".ui-front")), t.length || (t = this.document[0].body), t
- },
- _initSource: function() {
- var i, r, t = this;
- n.isArray(this.options.source) ? (i = this.options.source, this.source = function(t, r) {
- r(n.ui.autocomplete.filter(i, t.term))
- }) : "string" == typeof this.options.source ? (r = this.options.source, this.source = function(i, u) {
- t.xhr && t.xhr.abort();
- t.xhr = n.ajax({
- url: r,
- data: i,
- dataType: "json",
- success: function(n) {
- u(n)
- },
- error: function() {
- u([])
- }
- })
- }) : this.source = this.options.source
- },
- _searchTimeout: function(n) {
- clearTimeout(this.searching);
- this.searching = this._delay(function() {
- var t = this.term === this._value(),
- i = this.menu.element.is(":visible"),
- r = n.altKey || n.ctrlKey || n.metaKey || n.shiftKey;
- t && (!t || i || r) || (this.selectedItem = null, this.search(null, n))
- }, this.options.delay)
- },
- search: function(n, t) {
- return n = null != n ? n : this._value(), this.term = this._value(), n.length < this.options.minLength ? this.close(t) : this._trigger("search", t) !== !1 ? this._search(n) : void 0
- },
- _search: function(n) {
- this.pending++;
- this.element.addClass("ui-autocomplete-loading");
- this.cancelSearch = !1;
- this.source({
- term: n
- }, this._response())
- },
- _response: function() {
- var t = ++this.requestIndex;
- return n.proxy(function(n) {
- t === this.requestIndex && this.__response(n);
- this.pending--;
- this.pending || this.element.removeClass("ui-autocomplete-loading")
- }, this)
- },
- __response: function(n) {
- n && (n = this._normalize(n));
- this._trigger("response", null, {
- content: n
- });
- !this.options.disabled && n && n.length && !this.cancelSearch ? (this._suggest(n), this._trigger("open")) : this._close()
- },
- close: function(n) {
- this.cancelSearch = !0;
- this._close(n)
- },
- _close: function(n) {
- this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger("close", n))
- },
- _change: function(n) {
- this.previous !== this._value() && this._trigger("change", n, {
- item: this.selectedItem
- })
- },
- _normalize: function(t) {
- return t.length && t[0].label && t[0].value ? t : n.map(t, function(t) {
- return "string" == typeof t ? {
- label: t,
- value: t
- } : n.extend({}, t, {
- label: t.label || t.value,
- value: t.value || t.label
- })
- })
- },
- _suggest: function(t) {
- var i = this.menu.element.empty();
- this._renderMenu(i, t);
- this.isNewMenu = !0;
- this.menu.refresh();
- i.show();
- this._resizeMenu();
- i.position(n.extend({
- of: this.element
- }, this.options.position));
- this.options.autoFocus && this.menu.next()
- },
- _resizeMenu: function() {
- var n = this.menu.element;
- n.outerWidth(Math.max(n.width("").outerWidth() + 1, this.element.outerWidth()))
- },
- _renderMenu: function(t, i) {
- var r = this;
- n.each(i, function(n, i) {
- r._renderItemData(t, i)
- })
- },
- _renderItemData: function(n, t) {
- return this._renderItem(n, t).data("ui-autocomplete-item", t)
- },
- _renderItem: function(t, i) {
- return n("<li>").text(i.label).appendTo(t)
- },
- _move: function(n, t) {
- return this.menu.element.is(":visible") ? this.menu.isFirstItem() && /^previous/.test(n) || this.menu.isLastItem() && /^next/.test(n) ? (this.isMultiLine || this._value(this.term), this.menu.blur(), void 0) : (this.menu[n](t), void 0) : (this.search(null, t), void 0)
- },
- widget: function() {
- return this.menu.element
- },
- _value: function() {
- return this.valueMethod.apply(this.element, arguments)
- },
- _keyEvent: function(n, t) {
- (!this.isMultiLine || this.menu.element.is(":visible")) && (this._move(n, t), t.preventDefault())
- }
- });
- n.extend(n.ui.autocomplete, {
- escapeRegex: function(n) {
- return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
- },
- filter: function(t, i) {
- var r = RegExp(n.ui.autocomplete.escapeRegex(i), "i");
- return n.grep(t, function(n) {
- return r.test(n.label || n.value || n)
- })
- }
- });
- n.widget("ui.autocomplete", n.ui.autocomplete, {
- options: {
- messages: {
- noResults: "No search results.",
- results: function(n) {
- return n + (n > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate."
- }
- }
- },
- __response: function(t) {
- var i;
- this._superApply(arguments);
- this.options.disabled || this.cancelSearch || (i = t && t.length ? this.options.messages.results(t.length) : this.options.messages.noResults, this.liveRegion.children().hide(), n("<div>").text(i).appendTo(this.liveRegion))
- }
- });
- n.ui.autocomplete
- }),
- function(n) {
- function i(n, t) {
- for (var i = window, r = (n || "").split("."); i && r.length;) i = i[r.shift()];
- return typeof i == "function" ? i : (t.push(n), Function.constructor.apply(null, t))
- }
- function u(n) {
- return n === "GET" || n === "POST"
- }
- function o(n, t) {
- u(t) || n.setRequestHeader("X-HTTP-Method-Override", t)
- }
- function s(t, i, r) {
- var u;
- r.indexOf("application/x-javascript") === -1 && (u = (t.getAttribute("data-ajax-mode") || "").toUpperCase(), n(t.getAttribute("data-ajax-update")).each(function(t, r) {
- var f;
- switch (u) {
- case "BEFORE":
- f = r.firstChild;
- n("<div />").html(i).contents().each(function() {
- r.insertBefore(this, f)
- });
- break;
- case "AFTER":
- n("<div />").html(i).contents().each(function() {
- r.appendChild(this)
- });
- break;
- case "REPLACE-WITH":
- n(r).replaceWith(i);
- break;
- default:
- n(r).html(i)
- }
- }))
- }
- function f(t, r) {
- var e, h, f, c;
- (e = t.getAttribute("data-ajax-confirm"), !e || window.confirm(e)) && (h = n(t.getAttribute("data-ajax-loading")), c = parseInt(t.getAttribute("data-ajax-loading-duration"), 10) || 0, n.extend(r, {
- type: t.getAttribute("data-ajax-method") || undefined,
- url: t.getAttribute("data-ajax-url") || undefined,
- cache: !!t.getAttribute("data-ajax-cache"),
- beforeSend: function(n) {
- var r;
- return o(n, f), r = i(t.getAttribute("data-ajax-begin"), ["xhr"]).apply(t, arguments), r !== !1 && h.show(c), r
- },
- complete: function() {
- h.hide(c);
- i(t.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(t, arguments)
- },
- success: function(n, r, u) {
- s(t, n, u.getResponseHeader("Content-Type") || "text/html");
- i(t.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(t, arguments)
- },
- error: function() {
- i(t.getAttribute("data-ajax-failure"), ["xhr", "status", "error"]).apply(t, arguments)
- }
- }), r.data.push({
- name: "X-Requested-With",
- value: "XMLHttpRequest"
- }), f = r.type.toUpperCase(), u(f) || (r.type = "POST", r.data.push({
- name: "X-HTTP-Method-Override",
- value: f
- })), n.ajax(r))
- }
- function h(t) {
- var i = n(t).data(e);
- return !i || !i.validate || i.validate()
- }
- var t = "unobtrusiveAjaxClick",
- r = "unobtrusiveAjaxClickTarget",
- e = "unobtrusiveValidation";
- n(document).on("click", "a[data-ajax=true]", function(n) {
- n.preventDefault();
- f(this, {
- url: this.href,
- type: "GET",
- data: []
- })
- });
- n(document).on("click", "form[data-ajax=true] input[type=image]", function(i) {
- var r = i.target.name,
- u = n(i.target),
- f = n(u.parents("form")[0]),
- e = u.offset();
- f.data(t, [{
- name: r + ".x",
- value: Math.round(i.pageX - e.left)
- }, {
- name: r + ".y",
- value: Math.round(i.pageY - e.top)
- }]);
- setTimeout(function() {
- f.removeData(t)
- }, 0)
- });
- n(document).on("click", "form[data-ajax=true] :submit", function(i) {
- var f = i.currentTarget.name,
- e = n(i.target),
- u = n(e.parents("form")[0]);
- u.data(t, f ? [{
- name: f,
- value: i.currentTarget.value
- }] : []);
- u.data(r, e);
- setTimeout(function() {
- u.removeData(t);
- u.removeData(r)
- }, 0)
- });
- n(document).on("submit", "form[data-ajax=true]", function(i) {
- var e = n(this).data(t) || [],
- u = n(this).data(r),
- o = u && u.hasClass("cancel");
- (i.preventDefault(), o || h(this)) && f(this, {
- url: this.action,
- type: this.method || "GET",
- data: e.concat(n(this).serializeArray())
- })
- })
- }(jQuery);
- ! function(n) {
- "function" == typeof define && define.amd ? define(["jquery"], n) : n(jQuery)
- }(function(n) {
- n.extend(n.fn, {
- validate: function(t) {
- if (!this.length) return void(t && t.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing."));
- var i = n.data(this[0], "validator");
- return i ? i : (this.attr("novalidate", "novalidate"), i = new n.validator(t, this[0]), n.data(this[0], "validator", i), i.settings.onsubmit && (this.validateDelegate(":submit", "click", function(t) {
- i.settings.submitHandler && (i.submitButton = t.target);
- n(t.target).hasClass("cancel") && (i.cancelSubmit = !0);
- void 0 !== n(t.target).attr("formnovalidate") && (i.cancelSubmit = !0)
- }), this.submit(function(t) {
- function r() {
- var u, r;
- return i.settings.submitHandler ? (i.submitButton && (u = n("<input type='hidden'/>").attr("name", i.submitButton.name).val(n(i.submitButton).val()).appendTo(i.currentForm)), r = i.settings.submitHandler.call(i, i.currentForm, t), i.submitButton && u.remove(), void 0 !== r ? r : !1) : !0
- }
- return i.settings.debug && t.preventDefault(), i.cancelSubmit ? (i.cancelSubmit = !1, r()) : i.form() ? i.pendingRequest ? (i.formSubmitted = !0, !1) : r() : (i.focusInvalid(), !1)
- })), i)
- },
- valid: function() {
- var t, i;
- return n(this[0]).is("form") ? t = this.validate().form() : (t = !0, i = n(this[0].form).validate(), this.each(function() {
- t = i.element(this) && t
- })), t
- },
- removeAttrs: function(t) {
- var i = {},
- r = this;
- return n.each(t.split(/\s/), function(n, t) {
- i[t] = r.attr(t);
- r.removeAttr(t)
- }), i
- },
- rules: function(t, i) {
- var e, s, f, u, o, h, r = this[0];
- if (t) switch (e = n.data(r.form, "validator").settings, s = e.rules, f = n.validator.staticRules(r), t) {
- case "add":
- n.extend(f, n.validator.normalizeRule(i));
- delete f.messages;
- s[r.name] = f;
- i.messages && (e.messages[r.name] = n.extend(e.messages[r.name], i.messages));
- break;
- case "remove":
- return i ? (h = {}, n.each(i.split(/\s/), function(t, i) {
- h[i] = f[i];
- delete f[i];
- "required" === i && n(r).removeAttr("aria-required")
- }), h) : (delete s[r.name], f)
- }
- return u = n.validator.normalizeRules(n.extend({}, n.validator.classRules(r), n.validator.attributeRules(r), n.validator.dataRules(r), n.validator.staticRules(r)), r), u.required && (o = u.required, delete u.required, u = n.extend({
- required: o
- }, u), n(r).attr("aria-required", "true")), u.remote && (o = u.remote, delete u.remote, u = n.extend(u, {
- remote: o
- })), u
- }
- });
- n.extend(n.expr[":"], {
- blank: function(t) {
- return !n.trim("" + n(t).val())
- },
- filled: function(t) {
- return !!n.trim("" + n(t).val())
- },
- unchecked: function(t) {
- return !n(t).prop("checked")
- }
- });
- n.validator = function(t, i) {
- this.settings = n.extend(!0, {}, n.validator.defaults, t);
- this.currentForm = i;
- this.init()
- };
- n.validator.format = function(t, i) {
- return 1 === arguments.length ? function() {
- var i = n.makeArray(arguments);
- return i.unshift(t), n.validator.format.apply(this, i)
- } : (arguments.length > 2 && i.constructor !== Array && (i = n.makeArray(arguments).slice(1)), i.constructor !== Array && (i = [i]), n.each(i, function(n, i) {
- t = t.replace(new RegExp("\\{" + n + "\\}", "g"), function() {
- return i
- })
- }), t)
- };
- n.extend(n.validator, {
- defaults: {
- messages: {},
- groups: {},
- rules: {},
- errorClass: "error",
- validClass: "valid",
- errorElement: "label",
- focusCleanup: !1,
- focusInvalid: !0,
- errorContainer: n([]),
- errorLabelContainer: n([]),
- onsubmit: !0,
- ignore: ":hidden",
- ignoreTitle: !1,
- onfocusin: function(n) {
- this.lastActive = n;
- this.settings.focusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, n, this.settings.errorClass, this.settings.validClass), this.hideThese(this.errorsFor(n)))
- },
- onfocusout: function(n) {
- !this.checkable(n) && (n.name in this.submitted || !this.optional(n)) && this.element(n)
- },
- onkeyup: function(n, t) {
- (9 !== t.which || "" !== this.elementValue(n)) && (n.name in this.submitted || n === this.lastElement) && this.element(n)
- },
- onclick: function(n) {
- n.name in this.submitted ? this.element(n) : n.parentNode.name in this.submitted && this.element(n.parentNode)
- },
- highlight: function(t, i, r) {
- "radio" === t.type ? this.findByName(t.name).addClass(i).removeClass(r) : n(t).addClass(i).removeClass(r)
- },
- unhighlight: function(t, i, r) {
- "radio" === t.type ? this.findByName(t.name).removeClass(i).addClass(r) : n(t).removeClass(i).addClass(r)
- }
- },
- setDefaults: function(t) {
- n.extend(n.validator.defaults, t)
- },
- messages: {
- required: "This field is required.",
- remote: "Please fix this field.",
- email: "Please enter a valid email address.",
- url: "Please enter a valid URL.",
- date: "Please enter a valid date.",
- dateISO: "Please enter a valid date ( ISO ).",
- number: "Please enter a valid number.",
- digits: "Please enter only digits.",
- creditcard: "Please enter a valid credit card number.",
- equalTo: "Please enter the same value again.",
- maxlength: n.validator.format("Please enter no more than {0} characters."),
- minlength: n.validator.format("Please enter at least {0} characters."),
- rangelength: n.validator.format("Please enter a value between {0} and {1} characters long."),
- range: n.validator.format("Please enter a value between {0} and {1}."),
- max: n.validator.format("Please enter a value less than or equal to {0}."),
- min: n.validator.format("Please enter a value greater than or equal to {0}.")
- },
- autoCreateRanges: !1,
- prototype: {
- init: function() {
- function i(t) {
- var r = n.data(this[0].form, "validator"),
- u = "on" + t.type.replace(/^validate/, ""),
- i = r.settings;
- i[u] && !this.is(i.ignore) && i[u].call(r, this[0], t)
- }
- this.labelContainer = n(this.settings.errorLabelContainer);
- this.errorContext = this.labelContainer.length && this.labelContainer || n(this.currentForm);
- this.containers = n(this.settings.errorContainer).add(this.settings.errorLabelContainer);
- this.submitted = {};
- this.valueCache = {};
- this.pendingRequest = 0;
- this.pending = {};
- this.invalid = {};
- this.reset();
- var t, r = this.groups = {};
- n.each(this.settings.groups, function(t, i) {
- "string" == typeof i && (i = i.split(/\s/));
- n.each(i, function(n, i) {
- r[i] = t
- })
- });
- t = this.settings.rules;
- n.each(t, function(i, r) {
- t[i] = n.validator.normalizeRule(r)
- });
- n(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']", "focusin focusout keyup", i).validateDelegate("select, option, [type='radio'], [type='checkbox']", "click", i);
- this.settings.invalidHandler && n(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler);
- n(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true")
- },
- form: function() {
- return this.checkForm(), n.extend(this.submitted, this.errorMap), this.invalid = n.extend({}, this.errorMap), this.valid() || n(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid()
- },
- checkForm: function() {
- this.prepareForm();
- for (var n = 0, t = this.currentElements = this.elements(); t[n]; n++) this.check(t[n]);
- return this.valid()
- },
- element: function(t) {
- var u = this.clean(t),
- i = this.validationTargetFor(u),
- r = !0;
- return this.lastElement = i, void 0 === i ? delete this.invalid[u.name] : (this.prepareElement(i), this.currentElements = n(i), r = this.check(i) !== !1, r ? delete this.invalid[i.name] : this.invalid[i.name] = !0), n(t).attr("aria-invalid", !r), this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), r
- },
- showErrors: function(t) {
- if (t) {
- n.extend(this.errorMap, t);
- this.errorList = [];
- for (var i in t) this.errorList.push({
- message: t[i],
- element: this.findByName(i)[0]
- });
- this.successList = n.grep(this.successList, function(n) {
- return !(n.name in t)
- })
- }
- this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
- },
- resetForm: function() {
- n.fn.resetForm && n(this.currentForm).resetForm();
- this.submitted = {};
- this.lastElement = null;
- this.prepareForm();
- this.hideErrors();
- this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")
- },
- numberOfInvalids: function() {
- return this.objectLength(this.invalid)
- },
- objectLength: function(n) {
- var i, t = 0;
- for (i in n) t++;
- return t
- },
- hideErrors: function() {
- this.hideThese(this.toHide)
- },
- hideThese: function(n) {
- n.not(this.containers).text("");
- this.addWrapper(n).hide()
- },
- valid: function() {
- return 0 === this.size()
- },
- size: function() {
- return this.errorList.length
- },
- focusInvalid: function() {
- if (this.settings.focusInvalid) try {
- n(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
- } catch (t) {}
- },
- findLastActive: function() {
- var t = this.lastActive;
- return t && 1 === n.grep(this.errorList, function(n) {
- return n.element.name === t.name
- }).length && t
- },
- elements: function() {
- var t = this,
- i = {};
- return n(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function() {
- return !this.name && t.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in i || !t.objectLength(n(this).rules()) ? !1 : (i[this.name] = !0, !0)
- })
- },
- clean: function(t) {
- return n(t)[0]
- },
- errors: function() {
- var t = this.settings.errorClass.split(" ").join(".");
- return n(this.settings.errorElement + "." + t, this.errorContext)
- },
- reset: function() {
- this.successList = [];
- this.errorList = [];
- this.errorMap = {};
- this.toShow = n([]);
- this.toHide = n([]);
- this.currentElements = n([])
- },
- prepareForm: function() {
- this.reset();
- this.toHide = this.errors().add(this.containers)
- },
- prepareElement: function(n) {
- this.reset();
- this.toHide = this.errorsFor(n)
- },
- elementValue: function(t) {
- var i, u = n(t),
- r = t.type;
- return "radio" === r || "checkbox" === r ? n("input[name='" + t.name + "']:checked").val() : "number" === r && "undefined" != typeof t.validity ? t.validity.badInput ? !1 : u.val() : (i = u.val(), "string" == typeof i ? i.replace(/\r/g, "") : i)
- },
- check: function(t) {
- t = this.validationTargetFor(this.clean(t));
- var i, r, u, f = n(t).rules(),
- s = n.map(f, function(n, t) {
- return t
- }).length,
- e = !1,
- h = this.elementValue(t);
- for (r in f) {
- u = {
- method: r,
- parameters: f[r]
- };
- try {
- if (i = n.validator.methods[r].call(this, h, t, u.parameters), "dependency-mismatch" === i && 1 === s) {
- e = !0;
- continue
- }
- if (e = !1, "pending" === i) return void(this.toHide = this.toHide.not(this.errorsFor(t)));
- if (!i) return this.formatAndAdd(t, u), !1
- } catch (o) {
- throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + t.id + ", check the '" + u.method + "' method.", o), o;
- }
- }
- if (!e) return this.objectLength(f) && this.successList.push(t), !0
- },
- customDataMessage: function(t, i) {
- return n(t).data("msg" + i.charAt(0).toUpperCase() + i.substring(1).toLowerCase()) || n(t).data("msg")
- },
- customMessage: function(n, t) {
- var i = this.settings.messages[n];
- return i && (i.constructor === String ? i : i[t])
- },
- findDefined: function() {
- for (var n = 0; n < arguments.length; n++)
- if (void 0 !== arguments[n]) return arguments[n];
- return void 0
- },
- defaultMessage: function(t, i) {
- return this.findDefined(this.customMessage(t.name, i), this.customDataMessage(t, i), !this.settings.ignoreTitle && t.title || void 0, n.validator.messages[i], "<strong>Warning: No message defined for " + t.name + "<\/strong>")
- },
- formatAndAdd: function(t, i) {
- var r = this.defaultMessage(t, i.method),
- u = /\$?\{(\d+)\}/g;
- "function" == typeof r ? r = r.call(this, i.parameters, t) : u.test(r) && (r = n.validator.format(r.replace(u, "{$1}"), i.parameters));
- this.errorList.push({
- message: r,
- element: t,
- method: i.method
- });
- this.errorMap[t.name] = r;
- this.submitted[t.name] = r
- },
- addWrapper: function(n) {
- return this.settings.wrapper && (n = n.add(n.parent(this.settings.wrapper))), n
- },
- defaultShowErrors: function() {
- for (var i, t, n = 0; this.errorList[n]; n++) t = this.errorList[n], this.settings.highlight && this.settings.highlight.call(this, t.element, this.settings.errorClass, this.settings.validClass), this.showLabel(t.element, t.message);
- if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success)
- for (n = 0; this.successList[n]; n++) this.showLabel(this.successList[n]);
- if (this.settings.unhighlight)
- for (n = 0, i = this.validElements(); i[n]; n++) this.settings.unhighlight.call(this, i[n], this.settings.errorClass, this.settings.validClass);
- this.toHide = this.toHide.not(this.toShow);
- this.hideErrors();
- this.addWrapper(this.toShow).show()
- },
- validElements: function() {
- return this.currentElements.not(this.invalidElements())
- },
- invalidElements: function() {
- return n(this.errorList).map(function() {
- return this.element
- })
- },
- showLabel: function(t, i) {
- var u, o, e, r = this.errorsFor(t),
- s = this.idOrName(t),
- f = n(t).attr("aria-describedby");
- r.length ? (r.removeClass(this.settings.validClass).addClass(this.settings.errorClass), r.html(i)) : (r = n("<" + this.settings.errorElement + ">").attr("id", s + "-error").addClass(this.settings.errorClass).html(i || ""), u = r, this.settings.wrapper && (u = r.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.length ? this.labelContainer.append(u) : this.settings.errorPlacement ? this.settings.errorPlacement(u, n(t)) : u.insertAfter(t), r.is("label") ? r.attr("for", s) : 0 === r.parents("label[for='" + s + "']").length && (e = r.attr("id").replace(/(:|\.|\[|\])/g, "\\$1"), f ? f.match(new RegExp("\\b" + e + "\\b")) || (f += " " + e) : f = e, n(t).attr("aria-describedby", f), o = this.groups[t.name], o && n.each(this.groups, function(t, i) {
- i === o && n("[name='" + t + "']", this.currentForm).attr("aria-describedby", r.attr("id"))
- })));
- !i && this.settings.success && (r.text(""), "string" == typeof this.settings.success ? r.addClass(this.settings.success) : this.settings.success(r, t));
- this.toShow = this.toShow.add(r)
- },
- errorsFor: function(t) {
- var r = this.idOrName(t),
- u = n(t).attr("aria-describedby"),
- i = "label[for='" + r + "'], label[for='" + r + "'] *";
- return u && (i = i + ", #" + u.replace(/\s+/g, ", #")), this.errors().filter(i)
- },
- idOrName: function(n) {
- return this.groups[n.name] || (this.checkable(n) ? n.name : n.id || n.name)
- },
- validationTargetFor: function(t) {
- return this.checkable(t) && (t = this.findByName(t.name)), n(t).not(this.settings.ignore)[0]
- },
- checkable: function(n) {
- return /radio|checkbox/i.test(n.type)
- },
- findByName: function(t) {
- return n(this.currentForm).find("[name='" + t + "']")
- },
- getLength: function(t, i) {
- switch (i.nodeName.toLowerCase()) {
- case "select":
- return n("option:selected", i).length;
- case "input":
- if (this.checkable(i)) return this.findByName(i.name).filter(":checked").length
- }
- return t.length
- },
- depend: function(n, t) {
- return this.dependTypes[typeof n] ? this.dependTypes[typeof n](n, t) : !0
- },
- dependTypes: {
- boolean: function(n) {
- return n
- },
- string: function(t, i) {
- return !!n(t, i.form).length
- },
- "function": function(n, t) {
- return n(t)
- }
- },
- optional: function(t) {
- var i = this.elementValue(t);
- return !n.validator.methods.required.call(this, i, t) && "dependency-mismatch"
- },
- startRequest: function(n) {
- this.pending[n.name] || (this.pendingRequest++, this.pending[n.name] = !0)
- },
- stopRequest: function(t, i) {
- this.pendingRequest--;
- this.pendingRequest < 0 && (this.pendingRequest = 0);
- delete this.pending[t.name];
- i && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (n(this.currentForm).submit(), this.formSubmitted = !1) : !i && 0 === this.pendingRequest && this.formSubmitted && (n(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1)
- },
- previousValue: function(t) {
- return n.data(t, "previousValue") || n.data(t, "previousValue", {
- old: null,
- valid: !0,
- message: this.defaultMessage(t, "remote")
- })
- }
- },
- classRuleSettings: {
- required: {
- required: !0
- },
- email: {
- email: !0
- },
- url: {
- url: !0
- },
- date: {
- date: !0
- },
- dateISO: {
- dateISO: !0
- },
- number: {
- number: !0
- },
- digits: {
- digits: !0
- },
- creditcard: {
- creditcard: !0
- }
- },
- addClassRules: function(t, i) {
- t.constructor === String ? this.classRuleSettings[t] = i : n.extend(this.classRuleSettings, t)
- },
- classRules: function(t) {
- var i = {},
- r = n(t).attr("class");
- return r && n.each(r.split(" "), function() {
- this in n.validator.classRuleSettings && n.extend(i, n.validator.classRuleSettings[this])
- }), i
- },
- attributeRules: function(t) {
- var r, i, u = {},
- e = n(t),
- f = t.getAttribute("type");
- for (r in n.validator.methods) "required" === r ? (i = t.getAttribute(r), "" === i && (i = !0), i = !!i) : i = e.attr(r), /min|max/.test(r) && (null === f || /number|range|text/.test(f)) && (i = Number(i)), i || 0 === i ? u[r] = i : f === r && "range" !== f && (u[r] = !0);
- return u.maxlength && /-1|2147483647|524288/.test(u.maxlength) && delete u.maxlength, u
- },
- dataRules: function(t) {
- var i, r, u = {},
- f = n(t);
- for (i in n.validator.methods) r = f.data("rule" + i.charAt(0).toUpperCase() + i.substring(1).toLowerCase()), void 0 !== r && (u[i] = r);
- return u
- },
- staticRules: function(t) {
- var i = {},
- r = n.data(t.form, "validator");
- return r.settings.rules && (i = n.validator.normalizeRule(r.settings.rules[t.name]) || {}), i
- },
- normalizeRules: function(t, i) {
- return n.each(t, function(r, u) {
- if (u === !1) return void delete t[r];
- if (u.param || u.depends) {
- var f = !0;
- switch (typeof u.depends) {
- case "string":
- f = !!n(u.depends, i.form).length;
- break;
- case "function":
- f = u.depends.call(i, i)
- }
- f ? t[r] = void 0 !== u.param ? u.param : !0 : delete t[r]
- }
- }), n.each(t, function(r, u) {
- t[r] = n.isFunction(u) ? u(i) : u
- }), n.each(["minlength", "maxlength"], function() {
- t[this] && (t[this] = Number(t[this]))
- }), n.each(["rangelength", "range"], function() {
- var i;
- t[this] && (n.isArray(t[this]) ? t[this] = [Number(t[this][0]), Number(t[this][1])] : "string" == typeof t[this] && (i = t[this].replace(/[\[\]]/g, "").split(/[\s,]+/), t[this] = [Number(i[0]), Number(i[1])]))
- }), n.validator.autoCreateRanges && (null != t.min && null != t.max && (t.range = [t.min, t.max], delete t.min, delete t.max), null != t.minlength && null != t.maxlength && (t.rangelength = [t.minlength, t.maxlength], delete t.minlength, delete t.maxlength)), t
- },
- normalizeRule: function(t) {
- if ("string" == typeof t) {
- var i = {};
- n.each(t.split(/\s/), function() {
- i[this] = !0
- });
- t = i
- }
- return t
- },
- addMethod: function(t, i, r) {
- n.validator.methods[t] = i;
- n.validator.messages[t] = void 0 !== r ? r : n.validator.messages[t];
- i.length < 3 && n.validator.addClassRules(t, n.validator.normalizeRule(t))
- },
- methods: {
- required: function(t, i, r) {
- if (!this.depend(r, i)) return "dependency-mismatch";
- if ("select" === i.nodeName.toLowerCase()) {
- var u = n(i).val();
- return u && u.length > 0
- }
- return this.checkable(i) ? this.getLength(t, i) > 0 : n.trim(t).length > 0
- },
- email: function(n, t) {
- return this.optional(t) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(n)
- },
- url: function(n, t) {
- return this.optional(t) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n)
- },
- date: function(n, t) {
- return this.optional(t) || !/Invalid|NaN/.test(new Date(n).toString())
- },
- dateISO: function(n, t) {
- return this.optional(t) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(n)
- },
- number: function(n, t) {
- return this.optional(t) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n)
- },
- digits: function(n, t) {
- return this.optional(t) || /^\d+$/.test(n)
- },
- creditcard: function(n, t) {
- if (this.optional(t)) return "dependency-mismatch";
- if (/[^0-9 \-]+/.test(n)) return !1;
- var i, f, e = 0,
- r = 0,
- u = !1;
- if (n = n.replace(/\D/g, ""), n.length < 13 || n.length > 19) return !1;
- for (i = n.length - 1; i >= 0; i--) f = n.charAt(i), r = parseInt(f, 10), u && (r *= 2) > 9 && (r -= 9), e += r, u = !u;
- return e % 10 == 0
- },
- minlength: function(t, i, r) {
- var u = n.isArray(t) ? t.length : this.getLength(t, i);
- return this.optional(i) || u >= r
- },
- maxlength: function(t, i, r) {
- var u = n.isArray(t) ? t.length : this.getLength(t, i);
- return this.optional(i) || r >= u
- },
- rangelength: function(t, i, r) {
- var u = n.isArray(t) ? t.length : this.getLength(t, i);
- return this.optional(i) || u >= r[0] && u <= r[1]
- },
- min: function(n, t, i) {
- return this.optional(t) || n >= i
- },
- max: function(n, t, i) {
- return this.optional(t) || i >= n
- },
- range: function(n, t, i) {
- return this.optional(t) || n >= i[0] && n <= i[1]
- },
- equalTo: function(t, i, r) {
- var u = n(r);
- return this.settings.onfocusout && u.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
- n(i).valid()
- }), t === u.val()
- },
- remote: function(t, i, r) {
- if (this.optional(i)) return "dependency-mismatch";
- var u, e, f = this.previousValue(i);
- return this.settings.messages[i.name] || (this.settings.messages[i.name] = {}), f.originalMessage = this.settings.messages[i.name].remote, this.settings.messages[i.name].remote = f.message, r = "string" == typeof r && {
- url: r
- } || r, f.old === t ? f.valid : (f.old = t, u = this, this.startRequest(i), e = {}, e[i.name] = t, n.ajax(n.extend(!0, {
- url: r,
- mode: "abort",
- port: "validate" + i.name,
- dataType: "json",
- data: e,
- context: u.currentForm,
- success: function(r) {
- var o, e, h, s = r === !0 || "true" === r;
- u.settings.messages[i.name].remote = f.originalMessage;
- s ? (h = u.formSubmitted, u.prepareElement(i), u.formSubmitted = h, u.successList.push(i), delete u.invalid[i.name], u.showErrors()) : (o = {}, e = r || u.defaultMessage(i, "remote"), o[i.name] = f.message = n.isFunction(e) ? e(t) : e, u.invalid[i.name] = !0, u.showErrors(o));
- f.valid = s;
- u.stopRequest(i, s)
- }
- }, r)), "pending")
- }
- }
- });
- n.format = function() {
- throw "$.format has been deprecated. Please use $.validator.format instead.";
- };
- var i, t = {};
- n.ajaxPrefilter ? n.ajaxPrefilter(function(n, i, r) {
- var u = n.port;
- "abort" === n.mode && (t[u] && t[u].abort(), t[u] = r)
- }) : (i = n.ajax, n.ajax = function(r) {
- var f = ("mode" in r ? r : n.ajaxSettings).mode,
- u = ("port" in r ? r : n.ajaxSettings).port;
- return "abort" === f ? (t[u] && t[u].abort(), t[u] = i.apply(this, arguments), t[u]) : i.apply(this, arguments)
- });
- n.extend(n.fn, {
- validateDelegate: function(t, i, r) {
- return this.bind(i, function(i) {
- var u = n(i.target);
- if (u.is(t)) return r.apply(u, arguments)
- })
- }
- })
- }),
- function(n) {
- function i(n, t, i) {
- n.rules[t] = i;
- n.message && (n.messages[t] = n.message)
- }
- function h(n) {
- return n.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g)
- }
- function f(n) {
- return n.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1")
- }
- function e(n) {
- return n.substr(0, n.lastIndexOf(".") + 1)
- }
- function o(n, t) {
- return n.indexOf("*.") === 0 && (n = n.replace("*.", t)), n
- }
- function c(t, i) {
- var r = n(this).find("[data-valmsg-for='" + f(i[0].name) + "']"),
- u = r.attr("data-valmsg-replace"),
- e = u ? n.parseJSON(u) !== !1 : null;
- r.removeClass("field-validation-valid").addClass("field-validation-error");
- t.data("unobtrusiveContainer", r);
- e ? (r.empty(), t.removeClass("input-validation-error").appendTo(r)) : t.hide()
- }
- function l(t, i) {
- var u = n(this).find("[data-valmsg-summary=true]"),
- r = u.find("ul");
- r && r.length && i.errorList.length && (r.empty(), u.addClass("validation-summary-errors").removeClass("validation-summary-valid"), n.each(i.errorList, function() {
- n("<li />").html(this.message).appendTo(r)
- }))
- }
- function a(t) {
- var i = t.data("unobtrusiveContainer"),
- r = i.attr("data-valmsg-replace"),
- u = r ? n.parseJSON(r) : null;
- i && (i.addClass("field-validation-valid").removeClass("field-validation-error"), t.removeData("unobtrusiveContainer"), u && i.empty())
- }
- function v() {
- var t = n(this),
- i = "__jquery_unobtrusive_validation_form_reset";
- if (!t.data(i)) {
- t.data(i, !0);
- try {
- t.data("validator").resetForm()
- } finally {
- t.removeData(i)
- }
- t.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");
- t.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")
- }
- }
- function s(t) {
- var i = n(t),
- f = i.data(u),
- s = n.proxy(v, t),
- e = r.unobtrusive.options || {},
- o = function(i, r) {
- var u = e[i];
- u && n.isFunction(u) && u.apply(t, r)
- };
- return f || (f = {
- options: {
- errorClass: e.errorClass || "input-validation-error",
- errorElement: e.errorElement || "span",
- errorPlacement: function() {
- c.apply(t, arguments);
- o("errorPlacement", arguments)
- },
- invalidHandler: function() {
- l.apply(t, arguments);
- o("invalidHandler", arguments)
- },
- messages: {},
- rules: {},
- success: function() {
- a.apply(t, arguments);
- o("success", arguments)
- }
- },
- attachValidation: function() {
- i.off("reset." + u, s).on("reset." + u, s).validate(this.options)
- },
- validate: function() {
- return i.validate(), i.valid()
- }
- }, i.data(u, f)), f
- }
- var r = n.validator,
- t, u = "unobtrusiveValidation";
- r.unobtrusive = {
- adapters: [],
- parseElement: function(t, i) {
- var u = n(t),
- f = u.parents("form")[0],
- r, e, o;
- f && (r = s(f), r.options.rules[t.name] = e = {}, r.options.messages[t.name] = o = {}, n.each(this.adapters, function() {
- var i = "data-val-" + this.name,
- r = u.attr(i),
- s = {};
- r !== undefined && (i += "-", n.each(this.params, function() {
- s[this] = u.attr(i + this)
- }), this.adapt({
- element: t,
- form: f,
- message: r,
- params: s,
- rules: e,
- messages: o
- }))
- }), n.extend(e, {
- __dummy__: !0
- }), i || r.attachValidation())
- },
- parse: function(t) {
- var i = n(t),
- u = i.parents().addBack().filter("form").add(i.find("form")).has("[data-val=true]");
- i.find("[data-val=true]").each(function() {
- r.unobtrusive.parseElement(this, !0)
- });
- u.each(function() {
- var n = s(this);
- n && n.attachValidation()
- })
- }
- };
- t = r.unobtrusive.adapters;
- t.add = function(n, t, i) {
- return i || (i = t, t = []), this.push({
- name: n,
- params: t,
- adapt: i
- }), this
- };
- t.addBool = function(n, t) {
- return this.add(n, function(r) {
- i(r, t || n, !0)
- })
- };
- t.addMinMax = function(n, t, r, u, f, e) {
- return this.add(n, [f || "min", e || "max"], function(n) {
- var f = n.params.min,
- e = n.params.max;
- f && e ? i(n, u, [f, e]) : f ? i(n, t, f) : e && i(n, r, e)
- })
- };
- t.addSingleVal = function(n, t, r) {
- return this.add(n, [t || "val"], function(u) {
- i(u, r || n, u.params[t])
- })
- };
- r.addMethod("__dummy__", function() {
- return !0
- });
- r.addMethod("regex", function(n, t, i) {
- var r;
- return this.optional(t) ? !0 : (r = new RegExp(i).exec(n), r && r.index === 0 && r[0].length === n.length)
- });
- r.addMethod("nonalphamin", function(n, t, i) {
- var r;
- return i && (r = n.match(/\W/g), r = r && r.length >= i), r
- });
- r.methods.extension ? (t.addSingleVal("accept", "mimtype"), t.addSingleVal("extension", "extension")) : t.addSingleVal("extension", "extension", "accept");
- t.addSingleVal("regex", "pattern");
- t.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
- t.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
- t.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
- t.add("equalto", ["other"], function(t) {
- var r = e(t.element.name),
- u = t.params.other,
- s = o(u, r),
- h = n(t.form).find(":input").filter("[name='" + f(s) + "']")[0];
- i(t, "equalTo", h)
- });
- t.add("required", function(n) {
- (n.element.tagName.toUpperCase() !== "INPUT" || n.element.type.toUpperCase() !== "CHECKBOX") && i(n, "required", !0)
- });
- t.add("remote", ["url", "type", "additionalfields"], function(t) {
- var r = {
- url: t.params.url,
- type: t.params.type || "GET",
- data: {}
- },
- u = e(t.element.name);
- n.each(h(t.params.additionalfields || t.element.name), function(i, e) {
- var s = o(e, u);
- r.data[s] = function() {
- var i = n(t.form).find(":input").filter("[name='" + f(s) + "']");
- return i.is(":checkbox") ? i.filter(":checked").val() || i.filter(":hidden").val() || "" : i.is(":radio") ? i.filter(":checked").val() || "" : i.val()
- }
- });
- i(t, "remote", r)
- });
- t.add("password", ["min", "nonalphamin", "regex"], function(n) {
- n.params.min && i(n, "minlength", n.params.min);
- n.params.nonalphamin && i(n, "nonalphamin", n.params.nonalphamin);
- n.params.regex && i(n, "regex", n.params.regex)
- });
- n(function() {
- r.unobtrusive.parse(document)
- })
- }(jQuery);
- window.Modernizr = function(n, t, i) {
- function a(n) {
- c.cssText = n
- }
- function vt(n, t) {
- return a(y.join(n + ";") + (t || ""))
- }
- function h(n, t) {
- return typeof n === t
- }
- function v(n, t) {
- return !!~("" + n).indexOf(t)
- }
- function lt(n, t) {
- var u, r;
- for (u in n)
- if (r = n[u], !v(r, "-") && c[r] !== i) return t == "pfx" ? r : !0;
- return !1
- }
- function yt(n, t, r) {
- var f, u;
- for (f in n)
- if (u = t[n[f]], u !== i) return r === !1 ? n[f] : h(u, "function") ? u.bind(r || t) : u;
- return !1
- }
- function f(n, t, i) {
- var r = n.charAt(0).toUpperCase() + n.slice(1),
- u = (n + " " + ot.join(r + " ") + r).split(" ");
- return h(t, "string") || h(t, "undefined") ? lt(u, t) : (u = (n + " " + st.join(r + " ") + r).split(" "), yt(u, t, i))
- }
- function pt() {
- u.input = function(i) {
- for (var r = 0, u = i.length; r < u; r++) w[i[r]] = !!(i[r] in o);
- return w.list && (w.list = !!(t.createElement("datalist") && n.HTMLDataListElement)), w
- }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));
- u.inputtypes = function(n) {
- for (var u = 0, r, f, e, h = n.length; u < h; u++) o.setAttribute("type", f = n[u]), r = o.type !== "text", r && (o.value = g, o.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(f) && o.style.WebkitAppearance !== i ? (s.appendChild(o), e = t.defaultView, r = e.getComputedStyle && e.getComputedStyle(o, null).WebkitAppearance !== "textfield" && o.offsetHeight !== 0, s.removeChild(o)) : /^(search|tel)$/.test(f) || (r = /^(url|email)$/.test(f) ? o.checkValidity && o.checkValidity() === !1 : o.value != g)), ht[n[u]] = !!r;
- return ht
- }("search tel url email datetime date month week time datetime-local number range color".split(" "))
- }
- var u = {},
- d = !0,
- s = t.documentElement,
- e = "modernizr",
- ut = t.createElement(e),
- c = ut.style,
- o = t.createElement("input"),
- g = ":)",
- ft = {}.toString,
- y = " -webkit- -moz- -o- -ms- ".split(" "),
- et = "Webkit Moz O ms",
- ot = et.split(" "),
- st = et.toLowerCase().split(" "),
- p = {
- svg: "http://www.w3.org/2000/svg"
- },
- r = {},
- ht = {},
- w = {},
- nt = [],
- tt = nt.slice,
- b, l = function(n, i, r, u) {
- var l, a, c, v, f = t.createElement("div"),
- h = t.body,
- o = h || t.createElement("body");
- if (parseInt(r, 10))
- while (r--) c = t.createElement("div"), c.id = u ? u[r] : e + (r + 1), f.appendChild(c);
- return l = ["­", '<style id="s', e, '">', n, "<\/style>"].join(""), f.id = e, (h ? f : o).innerHTML += l, o.appendChild(f), h || (o.style.background = "", o.style.overflow = "hidden", v = s.style.overflow, s.style.overflow = "hidden", s.appendChild(o)), a = i(f, n), h ? f.parentNode.removeChild(f) : (o.parentNode.removeChild(o), s.style.overflow = v), !!a
- },
- at = function(t) {
- var i = n.matchMedia || n.msMatchMedia,
- r;
- return i ? i(t) && i(t).matches || !1 : (l("@media " + t + " { #" + e + " { position: absolute; } }", function(t) {
- r = (n.getComputedStyle ? getComputedStyle(t, null) : t.currentStyle).position == "absolute"
- }), r)
- },
- ct = function() {
- function r(r, u) {
- u = u || t.createElement(n[r] || "div");
- r = "on" + r;
- var f = r in u;
- return f || (u.setAttribute || (u = t.createElement("div")), u.setAttribute && u.removeAttribute && (u.setAttribute(r, ""), f = h(u[r], "function"), h(u[r], "undefined") || (u[r] = i), u.removeAttribute(r))), u = null, f
- }
- var n = {
- select: "input",
- change: "input",
- submit: "form",
- reset: "form",
- error: "img",
- load: "img",
- abort: "img"
- };
- return r
- }(),
- it = {}.hasOwnProperty,
- rt, k;
- rt = h(it, "undefined") || h(it.call, "undefined") ? function(n, t) {
- return t in n && h(n.constructor.prototype[t], "undefined")
- } : function(n, t) {
- return it.call(n, t)
- };
- Function.prototype.bind || (Function.prototype.bind = function(n) {
- var t = this,
- i, r;
- if (typeof t != "function") throw new TypeError;
- return i = tt.call(arguments, 1), r = function() {
- var f, e, u;
- return this instanceof r ? (f = function() {}, f.prototype = t.prototype, e = new f, u = t.apply(e, i.concat(tt.call(arguments))), Object(u) === u) ? u : e : t.apply(n, i.concat(tt.call(arguments)))
- }, r
- });
- r.flexbox = function() {
- return f("flexWrap")
- };
- r.flexboxlegacy = function() {
- return f("boxDirection")
- };
- r.canvas = function() {
- var n = t.createElement("canvas");
- return !!(n.getContext && n.getContext("2d"))
- };
- r.canvastext = function() {
- return !!(u.canvas && h(t.createElement("canvas").getContext("2d").fillText, "function"))
- };
- r.webgl = function() {
- return !!n.WebGLRenderingContext
- };
- r.touch = function() {
- var i;
- return "ontouchstart" in n || n.DocumentTouch && t instanceof DocumentTouch ? i = !0 : l(["@media (", y.join("touch-enabled),("), e, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function(n) {
- i = n.offsetTop === 9
- }), i
- };
- r.geolocation = function() {
- return "geolocation" in navigator
- };
- r.postmessage = function() {
- return !!n.postMessage
- };
- r.websqldatabase = function() {
- return !!n.openDatabase
- };
- r.indexedDB = function() {
- return !!f("indexedDB", n)
- };
- r.hashchange = function() {
- return ct("hashchange", n) && (t.documentMode === i || t.documentMode > 7)
- };
- r.history = function() {
- return !!(n.history && history.pushState)
- };
- r.draganddrop = function() {
- var n = t.createElement("div");
- return "draggable" in n || "ondragstart" in n && "ondrop" in n
- };
- r.websockets = function() {
- return "WebSocket" in n || "MozWebSocket" in n
- };
- r.rgba = function() {
- return a("background-color:rgba(150,255,150,.5)"), v(c.backgroundColor, "rgba")
- };
- r.hsla = function() {
- return a("background-color:hsla(120,40%,100%,.5)"), v(c.backgroundColor, "rgba") || v(c.backgroundColor, "hsla")
- };
- r.multiplebgs = function() {
- return a("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(c.background)
- };
- r.backgroundsize = function() {
- return f("backgroundSize")
- };
- r.borderimage = function() {
- return f("borderImage")
- };
- r.borderradius = function() {
- return f("borderRadius")
- };
- r.boxshadow = function() {
- return f("boxShadow")
- };
- r.textshadow = function() {
- return t.createElement("div").style.textShadow === ""
- };
- r.opacity = function() {
- return vt("opacity:.55"), /^0.55$/.test(c.opacity)
- };
- r.cssanimations = function() {
- return f("animationName")
- };
- r.csscolumns = function() {
- return f("columnCount")
- };
- r.cssgradients = function() {
- var n = "background-image:";
- return a((n + "-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));" + n) + y.join("linear-gradient(left top,#9f9, white);" + n)).slice(0, -n.length)), v(c.backgroundImage, "gradient")
- };
- r.cssreflections = function() {
- return f("boxReflect")
- };
- r.csstransforms = function() {
- return !!f("transform")
- };
- r.csstransforms3d = function() {
- var n = !!f("perspective");
- return n && "webkitPerspective" in s.style && l("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function(t) {
- n = t.offsetLeft === 9 && t.offsetHeight === 3
- }), n
- };
- r.csstransitions = function() {
- return f("transition")
- };
- r.fontface = function() {
- var n;
- return l('@font-face {font-family:"font";src:url("https://")}', function(i, r) {
- var f = t.getElementById("smodernizr"),
- u = f.sheet || f.styleSheet,
- e = u ? u.cssRules && u.cssRules[0] ? u.cssRules[0].cssText : u.cssText || "" : "";
- n = /src/i.test(e) && e.indexOf(r.split(" ")[0]) === 0
- }), n
- };
- r.generatedcontent = function() {
- var n;
- return l(["#", e, "{font:0/0 a}#", e, ':after{content:"', g, '";visibility:hidden;font:3px/1 a}'].join(""), function(t) {
- n = t.offsetHeight >= 3
- }), n
- };
- r.video = function() {
- var i = t.createElement("video"),
- n = !1;
- try {
- (n = !!i.canPlayType) && (n = new Boolean(n), n.ogg = i.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""), n.h264 = i.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), n.webm = i.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, ""))
- } catch (r) {}
- return n
- };
- r.audio = function() {
- var i = t.createElement("audio"),
- n = !1;
- try {
- (n = !!i.canPlayType) && (n = new Boolean(n), n.ogg = i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), n.mp3 = i.canPlayType("audio/mpeg;").replace(/^no$/, ""), n.wav = i.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""), n.m4a = (i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/aac;")).replace(/^no$/, ""))
- } catch (r) {}
- return n
- };
- r.localstorage = function() {
- try {
- return localStorage.setItem(e, e), localStorage.removeItem(e), !0
- } catch (n) {
- return !1
- }
- };
- r.sessionstorage = function() {
- try {
- return sessionStorage.setItem(e, e), sessionStorage.removeItem(e), !0
- } catch (n) {
- return !1
- }
- };
- r.webworkers = function() {
- return !!n.Worker
- };
- r.applicationcache = function() {
- return !!n.applicationCache
- };
- r.svg = function() {
- return !!t.createElementNS && !!t.createElementNS(p.svg, "svg").createSVGRect
- };
- r.inlinesvg = function() {
- var n = t.createElement("div");
- return n.innerHTML = "<svg/>", (n.firstChild && n.firstChild.namespaceURI) == p.svg
- };
- r.smil = function() {
- return !!t.createElementNS && /SVGAnimate/.test(ft.call(t.createElementNS(p.svg, "animate")))
- };
- r.svgclippaths = function() {
- return !!t.createElementNS && /SVGClipPath/.test(ft.call(t.createElementNS(p.svg, "clipPath")))
- };
- for (k in r) rt(r, k) && (b = k.toLowerCase(), u[b] = r[k](), nt.push((u[b] ? "" : "no-") + b));
- return u.input || pt(), u.addTest = function(n, t) {
- if (typeof n == "object")
- for (var r in n) rt(n, r) && u.addTest(r, n[r]);
- else {
- if (n = n.toLowerCase(), u[n] !== i) return u;
- t = typeof t == "function" ? t() : t;
- typeof d != "undefined" && d && (s.className += " " + (t ? "" : "no-") + n);
- u[n] = t
- }
- return u
- }, a(""), ut = o = null,
- function(n, t) {
- function p(n, t) {
- var i = n.createElement("p"),
- r = n.getElementsByTagName("head")[0] || n.documentElement;
- return i.innerHTML = "x<style>" + t + "<\/style>", r.insertBefore(i.lastChild, r.firstChild)
- }
- function c() {
- var n = r.elements;
- return typeof n == "string" ? n.split(" ") : n
- }
- function o(n) {
- var t = h[n[s]];
- return t || (t = {}, e++, n[s] = e, h[e] = t), t
- }
- function l(n, r, u) {
- if (r || (r = t), i) return r.createElement(n);
- u || (u = o(r));
- var f;
- return f = u.cache[n] ? u.cache[n].cloneNode() : y.test(n) ? (u.cache[n] = u.createElem(n)).cloneNode() : u.createElem(n), f.canHaveChildren && !v.test(n) && !f.tagUrn ? u.frag.appendChild(f) : f
- }
- function w(n, r) {
- if (n || (n = t), i) return n.createDocumentFragment();
- r = r || o(n);
- for (var f = r.frag.cloneNode(), u = 0, e = c(), s = e.length; u < s; u++) f.createElement(e[u]);
- return f
- }
- function b(n, t) {
- t.cache || (t.cache = {}, t.createElem = n.createElement, t.createFrag = n.createDocumentFragment, t.frag = t.createFrag());
- n.createElement = function(i) {
- return r.shivMethods ? l(i, n, t) : t.createElem(i)
- };
- n.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + c().join().replace(/[\w\-]+/g, function(n) {
- return t.createElem(n), t.frag.createElement(n), 'c("' + n + '")'
- }) + ");return n}")(r, t.frag)
- }
- function a(n) {
- n || (n = t);
- var u = o(n);
- return !r.shivCSS || f || u.hasCSS || (u.hasCSS = !!p(n, "article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")), i || b(n, u), n
- }
- var u = n.html5 || {},
- v = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
- y = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
- f, s = "_html5shiv",
- e = 0,
- h = {},
- i, r;
- (function() {
- try {
- var n = t.createElement("a");
- n.innerHTML = "<xyz><\/xyz>";
- f = "hidden" in n;
- i = n.childNodes.length == 1 || function() {
- t.createElement("a");
- var n = t.createDocumentFragment();
- return typeof n.cloneNode == "undefined" || typeof n.createDocumentFragment == "undefined" || typeof n.createElement == "undefined"
- }()
- } catch (r) {
- f = !0;
- i = !0
- }
- })();
- r = {
- elements: u.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",
- version: "3.7.0",
- shivCSS: u.shivCSS !== !1,
- supportsUnknownElements: i,
- shivMethods: u.shivMethods !== !1,
- type: "default",
- shivDocument: a,
- createElement: l,
- createDocumentFragment: w
- };
- n.html5 = r;
- a(t)
- }(this, t), u._version = "2.8.3", u._prefixes = y, u._domPrefixes = st, u._cssomPrefixes = ot, u.mq = at, u.hasEvent = ct, u.testProp = function(n) {
- return lt([n])
- }, u.testAllProps = f, u.testStyles = l, u.prefixed = function(n, t, i) {
- return t ? f(n, t, i) : f(n, "pfx")
- }, s.className = s.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (d ? " js " + nt.join(" ") : ""), u
- }(this, this.document),
- function(n, t, i) {
- function h(t, i) {
- this.bodyOverflowX;
- this.callbacks = {
- hide: [],
- show: []
- };
- this.checkInterval = null;
- this.Content;
- this.$el = n(t);
- this.$elProxy;
- this.elProxyPosition;
- this.enabled = !0;
- this.options = n.extend({}, f, i);
- this.mouseIsOverProxy = !1;
- this.namespace = "tooltipster-" + Math.round(Math.random() * 1e5);
- this.Status = "hidden";
- this.timerHide = null;
- this.timerShow = null;
- this.$tooltip;
- this.options.iconTheme = this.options.iconTheme.replace(".", "");
- this.options.theme = this.options.theme.replace(".", "");
- this._init()
- }
- function e(t, i) {
- var r = !0;
- return n.each(t, function(n) {
- if (typeof i[n] == "undefined" || t[n] !== i[n]) return r = !1, !1
- }), r
- }
- function o() {
- return !s && r
- }
- function u() {
- var u = i.body || i.documentElement,
- r = u.style,
- n = "transition",
- t;
- if (typeof r[n] == "string") return !0;
- for (v = ["Moz", "Webkit", "Khtml", "O", "ms"], n = n.charAt(0).toUpperCase() + n.substr(1), t = 0; t < v.length; t++)
- if (typeof r[v[t] + n] == "string") return !0;
- return !1
- }
- var f = {
- animation: "fade",
- arrow: !0,
- arrowColor: "",
- autoClose: !0,
- content: null,
- contentAsHTML: !1,
- contentCloning: !0,
- debug: !0,
- delay: 200,
- minWidth: 0,
- maxWidth: null,
- functionInit: function() {},
- functionBefore: function(n, t) {
- t()
- },
- functionReady: function() {},
- functionAfter: function() {},
- hideOnClick: !1,
- icon: "(?)",
- iconCloning: !0,
- iconDesktop: !1,
- iconTouch: !1,
- iconTheme: "tooltipster-icon",
- interactive: !1,
- interactiveTolerance: 350,
- multiple: !1,
- offsetX: 0,
- offsetY: 0,
- onlyOne: !1,
- position: "top",
- positionTracker: !1,
- positionTrackerCallback: function() {
- this.option("trigger") == "hover" && this.option("autoClose") && this.hide()
- },
- restoration: "current",
- speed: 350,
- timer: 0,
- theme: "tooltipster-default",
- touchDevices: !0,
- trigger: "hover",
- updateAnimation: !0
- },
- r, s;
- h.prototype = {
- _init: function() {
- var t = this,
- u, f;
- if (i.querySelector)
- if (u = null, t.$el.data("tooltipster-initialTitle") === undefined && (u = t.$el.attr("title"), u === undefined && (u = null), t.$el.data("tooltipster-initialTitle", u)), t.options.content !== null ? t._content_set(t.options.content) : t._content_set(u), f = t.options.functionInit.call(t.$el, t.$el, t.Content), typeof f != "undefined" && t._content_set(f), t.$el.removeAttr("title").addClass("tooltipstered"), !r && t.options.iconDesktop || r && t.options.iconTouch ? (typeof t.options.icon == "string" ? (t.$elProxy = n('<span class="' + t.options.iconTheme + '"><\/span>'), t.$elProxy.text(t.options.icon)) : t.$elProxy = t.options.iconCloning ? t.options.icon.clone(!0) : t.options.icon, t.$elProxy.insertAfter(t.$el)) : t.$elProxy = t.$el, t.options.trigger == "hover") {
- t.$elProxy.on("mouseenter." + t.namespace, function() {
- (!o() || t.options.touchDevices) && (t.mouseIsOverProxy = !0, t._show())
- }).on("mouseleave." + t.namespace, function() {
- (!o() || t.options.touchDevices) && (t.mouseIsOverProxy = !1)
- });
- if (r && t.options.touchDevices) t.$elProxy.on("touchstart." + t.namespace, function() {
- t._showNow()
- })
- } else if (t.options.trigger == "click") t.$elProxy.on("click." + t.namespace, function() {
- (!o() || t.options.touchDevices) && t._show()
- })
- },
- _show: function() {
- var n = this;
- n.Status != "shown" && n.Status != "appearing" && (n.options.delay ? n.timerShow = setTimeout(function() {
- (n.options.trigger == "click" || n.options.trigger == "hover" && n.mouseIsOverProxy) && n._showNow()
- }, n.options.delay) : n._showNow())
- },
- _showNow: function(i) {
- var f = this;
- f.options.functionBefore.call(f.$el, f.$el, function() {
- var e, s, o;
- if (f.enabled && f.Content !== null) {
- if (i && f.callbacks.show.push(i), f.callbacks.hide = [], clearTimeout(f.timerShow), f.timerShow = null, clearTimeout(f.timerHide), f.timerHide = null, f.options.onlyOne && n(".tooltipstered").not(f.$el).each(function(t, i) {
- var r = n(i),
- u = r.data("tooltipster-ns");
- n.each(u, function(n, t) {
- var i = r.data(t),
- u = i.status(),
- f = i.option("autoClose");
- u !== "hidden" && u !== "disappearing" && f && i.hide()
- })
- }), e = function() {
- f.Status = "shown";
- n.each(f.callbacks.show, function(n, t) {
- t.call(f.$el)
- });
- f.callbacks.show = []
- }, f.Status !== "hidden") s = 0, f.Status === "disappearing" ? (f.Status = "appearing", u() ? (f.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-" + f.options.animation + "-show"), f.options.speed > 0 && f.$tooltip.delay(f.options.speed), f.$tooltip.queue(e)) : f.$tooltip.stop().fadeIn(e)) : f.Status === "shown" && e();
- else {
- f.Status = "appearing";
- s = f.options.speed;
- f.bodyOverflowX = n("body").css("overflow-x");
- n("body").css("overflow-x", "hidden");
- var h = "tooltipster-" + f.options.animation,
- c = "-webkit-transition-duration: " + f.options.speed + "ms; -webkit-animation-duration: " + f.options.speed + "ms; -moz-transition-duration: " + f.options.speed + "ms; -moz-animation-duration: " + f.options.speed + "ms; -o-transition-duration: " + f.options.speed + "ms; -o-animation-duration: " + f.options.speed + "ms; -ms-transition-duration: " + f.options.speed + "ms; -ms-animation-duration: " + f.options.speed + "ms; transition-duration: " + f.options.speed + "ms; animation-duration: " + f.options.speed + "ms;",
- l = f.options.minWidth ? "min-width:" + Math.round(f.options.minWidth) + "px;" : "",
- a = f.options.maxWidth ? "max-width:" + Math.round(f.options.maxWidth) + "px;" : "",
- v = f.options.interactive ? "pointer-events: auto;" : "";
- f.$tooltip = n('<div class="tooltipster-base ' + f.options.theme + '" style="' + l + " " + a + " " + v + " " + c + '"><div class="tooltipster-content"><\/div><\/div>');
- u() && f.$tooltip.addClass(h);
- f._content_insert();
- f.$tooltip.appendTo("body");
- f.reposition();
- f.options.functionReady.call(f.$el, f.$el, f.$tooltip);
- u() ? (f.$tooltip.addClass(h + "-show"), f.options.speed > 0 && f.$tooltip.delay(f.options.speed), f.$tooltip.queue(e)) : f.$tooltip.css("display", "none").fadeIn(f.options.speed, e);
- f._interval_set();
- n(t).on("scroll." + f.namespace + " resize." + f.namespace, function() {
- f.reposition()
- });
- if (f.options.autoClose)
- if (n("body").off("." + f.namespace), f.options.trigger == "hover") {
- if (r && setTimeout(function() {
- n("body").on("touchstart." + f.namespace, function() {
- f.hide()
- })
- }, 0), f.options.interactive) {
- if (r) f.$tooltip.on("touchstart." + f.namespace, function(n) {
- n.stopPropagation()
- });
- o = null;
- f.$elProxy.add(f.$tooltip).on("mouseleave." + f.namespace + "-autoClose", function() {
- clearTimeout(o);
- o = setTimeout(function() {
- f.hide()
- }, f.options.interactiveTolerance)
- }).on("mouseenter." + f.namespace + "-autoClose", function() {
- clearTimeout(o)
- })
- } else f.$elProxy.on("mouseleave." + f.namespace + "-autoClose", function() {
- f.hide()
- });
- if (f.options.hideOnClick) f.$elProxy.on("click." + f.namespace + "-autoClose", function() {
- f.hide()
- })
- } else if (f.options.trigger == "click" && (setTimeout(function() {
- n("body").on("click." + f.namespace + " touchstart." + f.namespace, function() {
- f.hide()
- })
- }, 0), f.options.interactive)) f.$tooltip.on("click." + f.namespace + " touchstart." + f.namespace, function(n) {
- n.stopPropagation()
- })
- }
- f.options.timer > 0 && (f.timerHide = setTimeout(function() {
- f.timerHide = null;
- f.hide()
- }, f.options.timer + s))
- }
- })
- },
- _interval_set: function() {
- var t = this;
- t.checkInterval = setInterval(function() {
- if (n("body").find(t.$el).length === 0 || n("body").find(t.$elProxy).length === 0 || t.Status == "hidden" || n("body").find(t.$tooltip).length === 0)(t.Status == "shown" || t.Status == "appearing") && t.hide(), t._interval_cancel();
- else if (t.options.positionTracker) {
- var i = t._repositionInfo(t.$elProxy),
- r = !1;
- e(i.dimension, t.elProxyPosition.dimension) && (t.$elProxy.css("position") === "fixed" ? e(i.position, t.elProxyPosition.position) && (r = !0) : e(i.offset, t.elProxyPosition.offset) && (r = !0));
- r || (t.reposition(), t.options.positionTrackerCallback.call(t, t.$el))
- }
- }, 200)
- },
- _interval_cancel: function() {
- clearInterval(this.checkInterval);
- this.checkInterval = null
- },
- _content_set: function(n) {
- typeof n == "object" && n !== null && this.options.contentCloning && (n = n.clone(!0));
- this.Content = n
- },
- _content_insert: function() {
- var n = this,
- t = this.$tooltip.find(".tooltipster-content");
- typeof n.Content != "string" || n.options.contentAsHTML ? t.empty().append(n.Content) : t.text(n.Content)
- },
- _update: function(n) {
- var t = this;
- t._content_set(n);
- t.Content !== null ? t.Status !== "hidden" && (t._content_insert(), t.reposition(), t.options.updateAnimation && (u() ? (t.$tooltip.css({
- width: "",
- "-webkit-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- "-moz-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- "-o-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- "-ms-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- transition: "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms"
- }).addClass("tooltipster-content-changing"), setTimeout(function() {
- t.Status != "hidden" && (t.$tooltip.removeClass("tooltipster-content-changing"), setTimeout(function() {
- t.Status !== "hidden" && t.$tooltip.css({
- "-webkit-transition": t.options.speed + "ms",
- "-moz-transition": t.options.speed + "ms",
- "-o-transition": t.options.speed + "ms",
- "-ms-transition": t.options.speed + "ms",
- transition: t.options.speed + "ms"
- })
- }, t.options.speed))
- }, t.options.speed)) : t.$tooltip.fadeTo(t.options.speed, .5, function() {
- t.Status != "hidden" && t.$tooltip.fadeTo(t.options.speed, 1)
- }))) : t.hide()
- },
- _repositionInfo: function(n) {
- return {
- dimension: {
- height: n.outerHeight(!1),
- width: n.outerWidth(!1)
- },
- offset: n.offset(),
- position: {
- left: parseInt(n.css("left")),
- top: parseInt(n.css("top"))
- }
- }
- },
- hide: function(i) {
- var r = this,
- f, e;
- return i && r.callbacks.hide.push(i), r.callbacks.show = [], clearTimeout(r.timerShow), r.timerShow = null, clearTimeout(r.timerHide), r.timerHide = null, f = function() {
- n.each(r.callbacks.hide, function(n, t) {
- t.call(r.$el)
- });
- r.callbacks.hide = []
- }, r.Status == "shown" || r.Status == "appearing" ? (r.Status = "disappearing", e = function() {
- r.Status = "hidden";
- typeof r.Content == "object" && r.Content !== null && r.Content.detach();
- r.$tooltip.remove();
- r.$tooltip = null;
- n(t).off("." + r.namespace);
- n("body").off("." + r.namespace).css("overflow-x", r.bodyOverflowX);
- n("body").off("." + r.namespace);
- r.$elProxy.off("." + r.namespace + "-autoClose");
- r.options.functionAfter.call(r.$el, r.$el);
- f()
- }, u() ? (r.$tooltip.clearQueue().removeClass("tooltipster-" + r.options.animation + "-show").addClass("tooltipster-dying"), r.options.speed > 0 && r.$tooltip.delay(r.options.speed), r.$tooltip.queue(e)) : r.$tooltip.stop().fadeOut(r.options.speed, e)) : r.Status == "hidden" && f(), r
- },
- show: function(n) {
- return this._showNow(n), this
- },
- update: function(n) {
- return this.content(n)
- },
- content: function(n) {
- return typeof n == "undefined" ? this.Content : (this._update(n), this)
- },
- reposition: function() {
- var r = this,
- k, y, vt, p, ut, ft, w, dt, a, nt, kt, tt, gt, ni;
- if (n("body").find(r.$tooltip).length !== 0) {
- r.$tooltip.css("width", "");
- r.elProxyPosition = r._repositionInfo(r.$elProxy);
- var o = null,
- b = n(t).width(),
- i = r.elProxyPosition,
- e = r.$tooltip.outerWidth(!1),
- ui = r.$tooltip.innerWidth() + 1,
- c = r.$tooltip.outerHeight(!1);
- if (r.$elProxy.is("area")) {
- var yt = r.$elProxy.attr("shape"),
- ti = r.$elProxy.parent().attr("name"),
- et = n('img[usemap="#' + ti + '"]'),
- ot = et.offset().left,
- st = et.offset().top,
- v = r.$elProxy.attr("coords") !== undefined ? r.$elProxy.attr("coords").split(",") : undefined;
- if (yt == "circle") {
- var pt = parseInt(v[0]),
- wt = parseInt(v[1]),
- ht = parseInt(v[2]);
- i.dimension.height = ht * 2;
- i.dimension.width = ht * 2;
- i.offset.top = st + wt - ht;
- i.offset.left = ot + pt - ht
- } else if (yt == "rect") {
- var pt = parseInt(v[0]),
- wt = parseInt(v[1]),
- ii = parseInt(v[2]),
- ri = parseInt(v[3]);
- i.dimension.height = ri - wt;
- i.dimension.width = ii - pt;
- i.offset.top = st + wt;
- i.offset.left = ot + pt
- } else if (yt == "poly") {
- var it = 0,
- rt = 0,
- ct = 0,
- lt = 0,
- bt = "even";
- for (k = 0; k < v.length; k++) y = parseInt(v[k]), bt == "even" ? (y > ct && (ct = y, k === 0 && (it = ct)), y < it && (it = y), bt = "odd") : (y > lt && (lt = y, k == 1 && (rt = lt)), y < rt && (rt = y), bt = "even");
- i.dimension.height = lt - rt;
- i.dimension.width = ct - it;
- i.offset.top = st + rt;
- i.offset.left = ot + it
- } else i.dimension.height = et.outerHeight(!1), i.dimension.width = et.outerWidth(!1), i.offset.top = st, i.offset.left = ot
- }
- var u = 0,
- at = 0,
- l = 0,
- s = parseInt(r.options.offsetY),
- h = parseInt(r.options.offsetX),
- f = r.options.position;
- function d() {
- var i = n(t).scrollLeft();
- u - i < 0 && (o = u - i, u = i);
- u + e - i > b && (o = u - (b + i - e), u = b + i - e)
- }
- function g(r, u) {
- i.offset.top - n(t).scrollTop() - c - s - 12 < 0 && u.indexOf("top") > -1 && (f = r);
- i.offset.top + i.dimension.height + c + 12 + s > n(t).scrollTop() + n(t).height() && u.indexOf("bottom") > -1 && (f = r, l = i.offset.top - c - s - 12)
- }
- f == "top" && (vt = i.offset.left + e - (i.offset.left + i.dimension.width), u = i.offset.left + h - vt / 2, l = i.offset.top - c - s - 12, d(), g("bottom", "top"));
- f == "top-left" && (u = i.offset.left + h, l = i.offset.top - c - s - 12, d(), g("bottom-left", "top-left"));
- f == "top-right" && (u = i.offset.left + i.dimension.width + h - e, l = i.offset.top - c - s - 12, d(), g("bottom-right", "top-right"));
- f == "bottom" && (vt = i.offset.left + e - (i.offset.left + i.dimension.width), u = i.offset.left - vt / 2 + h, l = i.offset.top + i.dimension.height + s + 12, d(), g("top", "bottom"));
- f == "bottom-left" && (u = i.offset.left + h, l = i.offset.top + i.dimension.height + s + 12, d(), g("top-left", "bottom-left"));
- f == "bottom-right" && (u = i.offset.left + i.dimension.width + h - e, l = i.offset.top + i.dimension.height + s + 12, d(), g("top-right", "bottom-right"));
- f == "left" && (u = i.offset.left - h - e - 12, at = i.offset.left + h + i.dimension.width + 12, p = i.offset.top + c - (i.offset.top + i.dimension.height), l = i.offset.top - p / 2 - s, u < 0 && at + e > b ? (ut = parseFloat(r.$tooltip.css("border-width")) * 2, ft = e + u - ut, r.$tooltip.css("width", ft + "px"), c = r.$tooltip.outerHeight(!1), u = i.offset.left - h - ft - 12 - ut, p = i.offset.top + c - (i.offset.top + i.dimension.height), l = i.offset.top - p / 2 - s) : u < 0 && (u = i.offset.left + h + i.dimension.width + 12, o = "left"));
- f == "right" && (u = i.offset.left + h + i.dimension.width + 12, at = i.offset.left - h - e - 12, p = i.offset.top + c - (i.offset.top + i.dimension.height), l = i.offset.top - p / 2 - s, u + e > b && at < 0 ? (ut = parseFloat(r.$tooltip.css("border-width")) * 2, ft = b - u - ut, r.$tooltip.css("width", ft + "px"), c = r.$tooltip.outerHeight(!1), p = i.offset.top + c - (i.offset.top + i.dimension.height), l = i.offset.top - p / 2 - s) : u + e > b && (u = i.offset.left - h - e - 12, o = "right"));
- r.options.arrow && (w = "tooltipster-arrow-" + f, dt = r.options.arrowColor.length < 1 ? r.$tooltip.css("background-color") : r.options.arrowColor, o ? o == "left" ? (w = "tooltipster-arrow-right", o = "") : o == "right" ? (w = "tooltipster-arrow-left", o = "") : o = "left:" + Math.round(o) + "px;" : o = "", f == "top" || f == "top-left" || f == "top-right" ? (a = parseFloat(r.$tooltip.css("border-bottom-width")), nt = r.$tooltip.css("border-bottom-color")) : f == "bottom" || f == "bottom-left" || f == "bottom-right" ? (a = parseFloat(r.$tooltip.css("border-top-width")), nt = r.$tooltip.css("border-top-color")) : f == "left" ? (a = parseFloat(r.$tooltip.css("border-right-width")), nt = r.$tooltip.css("border-right-color")) : f == "right" ? (a = parseFloat(r.$tooltip.css("border-left-width")), nt = r.$tooltip.css("border-left-color")) : (a = parseFloat(r.$tooltip.css("border-bottom-width")), nt = r.$tooltip.css("border-bottom-color")), a > 1 && a++, kt = "", a !== 0 && (tt = "", gt = "border-color: " + nt + ";", w.indexOf("bottom") !== -1 ? tt = "margin-top: -" + Math.round(a) + "px;" : w.indexOf("top") !== -1 ? tt = "margin-bottom: -" + Math.round(a) + "px;" : w.indexOf("left") !== -1 ? tt = "margin-right: -" + Math.round(a) + "px;" : w.indexOf("right") !== -1 && (tt = "margin-left: -" + Math.round(a) + "px;"), kt = '<span class="tooltipster-arrow-border" style="' + tt + " " + gt + ';"><\/span>'), r.$tooltip.find(".tooltipster-arrow").remove(), ni = '<div class="' + w + ' tooltipster-arrow" style="' + o + '">' + kt + '<span style="border-color:' + dt + ';"><\/span><\/div>', r.$tooltip.append(ni));
- r.$tooltip.css({
- top: Math.round(l) + "px",
- left: Math.round(u) + "px"
- })
- }
- return r
- },
- enable: function() {
- return this.enabled = !0, this
- },
- disable: function() {
- return this.hide(), this.enabled = !1, this
- },
- destroy: function() {
- var t = this,
- i, r;
- return t.hide(), t.$el[0] !== t.$elProxy[0] && t.$elProxy.remove(), t.$el.removeData(t.namespace).off("." + t.namespace), i = t.$el.data("tooltipster-ns"), i.length === 1 ? (r = null, t.options.restoration === "previous" ? r = t.$el.data("tooltipster-initialTitle") : t.options.restoration === "current" && (r = typeof t.Content == "string" ? t.Content : n("<div><\/div>").append(t.Content).html()), r && t.$el.attr("title", r), t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")) : (i = n.grep(i, function(n) {
- return n !== t.namespace
- }), t.$el.data("tooltipster-ns", i)), t
- },
- elementIcon: function() {
- return this.$el[0] !== this.$elProxy[0] ? this.$elProxy[0] : undefined
- },
- elementTooltip: function() {
- return this.$tooltip ? this.$tooltip[0] : undefined
- },
- option: function(n, t) {
- return typeof t == "undefined" ? this.options[n] : (this.options[n] = t, this)
- },
- status: function() {
- return this.Status
- }
- };
- n.fn["tooltipster"] = function() {
- var t = arguments,
- r, i;
- if (this.length === 0) {
- if (typeof t[0] == "string") {
- r = !0;
- switch (t[0]) {
- case "setDefaults":
- n.extend(f, t[1]);
- break;
- default:
- r = !1
- }
- return r ? !0 : this
- }
- return this
- }
- if (typeof t[0] == "string") return i = "#*$~&", this.each(function() {
- var f = n(this).data("tooltipster-ns"),
- r = f ? n(this).data(f[0]) : null,
- u;
- if (r) {
- if (typeof r[t[0]] == "function") u = r[t[0]](t[1], t[2]);
- else throw new Error('Unknown method .tooltipster("' + t[0] + '")');
- if (u !== r) return i = u, !1
- } else throw new Error("You called Tooltipster's \"" + t[0] + '" method on an uninitialized element');
- }), i !== "#*$~&" ? i : this;
- var u = [],
- e = t[0] && typeof t[0].multiple != "undefined",
- o = e && t[0].multiple || !e && f.multiple,
- s = t[0] && typeof t[0].debug != "undefined",
- c = s && t[0].debug || !s && f.debug;
- return this.each(function() {
- var f = !1,
- i = n(this).data("tooltipster-ns"),
- r = null;
- i ? o ? f = !0 : c && console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.') : f = !0;
- f && (r = new h(this, t[0]), i || (i = []), i.push(r.namespace), n(this).data("tooltipster-ns", i), n(this).data(r.namespace, r));
- u.push(r)
- }), o ? u : this
- };
- r = !!("ontouchstart" in t);
- s = !1;
- n("body").one("mousemove", function() {
- s = !0
- })
- }(jQuery, window, document);
- UI = window.UI || {};
- UI.Notifications = function() {
- function t(t, i) {
- n.forEach(function(n) {
- n.event == t && n.callback(i)
- })
- }
- var n = [];
- return {
- subscribe: function(t, i) {
- n.push({
- event: t,
- callback: i
- })
- },
- unSubscribe: function(t, i) {
- n = n.filter(function(n) {
- if (n.event != t || n.callback != i) return n
- })
- },
- clear: function(t) {
- n = n.filter(function(n) {
- if (n.event !== t) return n
- })
- },
- raise: function(n, i) {
- t(n, i)
- }
- }
- }();
- UI.Common = {
- debug: !1,
- availableWidth: function(n) {
- return $(n).innerWidth()
- },
- htmlEscape: function(n) {
- return String(n).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">")
- },
- isMobile: function() {
- return !1
- },
- isCommentPage: function() {
- return /\/comments\//i.test(window.location.href)
- },
- isMessagePage: function() {
- return /\/messaging\//i.test(window.location.href)
- },
- fileExtension: function(n, t) {
- if (n) try {
- var i = /\.+\w+$/i.exec(n);
- if (i && i.length > 0) return t ? i[0] : i[0].replace(".", "")
- } catch (r) {
- return ""
- }
- return ""
- },
- getDomainName: function() {
- return "notdone.com"
- },
- currentDomainRoot: function() {
- return location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "")
- },
- currentProtocol: function() {
- return location.protocol
- },
- resolveUrl: function(n) {
- return n ? n.indexOf("http") == 0 || n.indexOf("ftp") == 0 ? n : n.indexOf("~/") == 0 ? UI.Common.currentDomainRoot().concat("/", n.replace("~/", "")) : n.indexOf("/") == 0 ? UI.Common.currentDomainRoot().concat(n) : UI.Common.currentDomainRoot().concat("/", n) : n
- },
- queryString: function(n, t) {
- var r, e, i, u;
- if (t && t.length != 0 || (t = location.href), t.indexOf("?") > 0) {
- for (var o = t.split("?")[1], s = o.split("&"), f = []; i < s.length; i++) r = kv.split("="), e = r[1], f.push({
- key: r[0],
- value: unescape(e)
- });
- for (i = 0; i < keypairs.length; i++)
- if (u = f[i], u.key == n) return u.value
- }
- return null
- },
- resizeTarget: function(n, t, i) {
- try {
- var e = !1,
- u = n.prop("width"),
- f = n.prop("height");
- (u == 0 || f == 0) && (u = parseInt(n.css("width")), f = parseInt(n.css("height")), e = !0);
- var o = u / f,
- s = typeof i == "object" ? i : n.parent(),
- r = UI.Common.availableWidth(s);
- (r < u || t && r > u) && (e ? (n.css("width", r), n.css("height", r / o)) : (n.prop("width", r), n.prop("height", r / o)))
- } catch (h) {
- if (UI.Common.debug) throw h;
- }
- }
- };
- UI.ExpandoManager = function() {
- UI.Notifications.subscribe("DOM", function(n) {
- UI.ExpandoManager.execute(n)
- });
- var n = [];
- return {
- addExpando: function(t, i) {
- var r = n.filter(function(n) {
- if (n.selector == t) return n
- });
- r.length > 0 ? i instanceof Array ? r[0].group = r[0].group.concat(i) : r[0].group.push(i) : i instanceof Array ? n.push({
- selector: t,
- group: i
- }) : n.push({
- selector: t,
- group: [i]
- })
- },
- reset: function() {
- n = []
- },
- execute: function(t) {
- n && n.length > 0 && n.forEach(function(n) {
- var i = t == undefined ? $(n.selector) : $(n.selector, t);
- i.length > 0 && n.group.forEach(function(n) {
- i.filter(function() {
- if (!n.preConditionMet || n.preConditionMet && n.preConditionMet()) try {
- return n.getFilter().test(this.href)
- } catch (t) {}
- return !1
- }).each(function(t, i) {
- n.process(i)
- })
- })
- })
- }
- }
- }();
- LinkExpando = function(n, t) {
- var i = n;
- this.options = t;
- this.getFilter = function() {
- return i
- };
- this.getId = function(n) {
- var t = undefined;
- try {
- t = this.getFilter().exec(n)[1]
- } catch (i) {}
- return t
- }
- };
- LinkExpando.prototype = {
- process: function() {
- UI.Common.debug && alert("Class LinkExpando.process(target) method must be overridden in derived class.")
- }
- };
- LinkExpando.setDirectLink = function(n, t, i) {
- var r = $("<span/>", {
- "class": "tagline"
- }).html(t + " ").append($("<a/>", {
- "class": "link-expando-direct",
- target: "_blank",
- href: i
- }).text("Open"));
- n.append(r)
- };
- LinkExpando.setTag = function(n, t) {
- n.data("text") === undefined && n.data("text", n.text());
- t ? n.html(UI.Common.htmlEscape(n.data("text")).concat("<span class='link-expando-type'>", t, "<\/span>")) : n.text(UI.Common.htmlEscape(n.data("text")))
- };
- LinkExpando.dataProp = function(n, t, i) {
- return i != null && $(n).data(t, i), $(n).data(t)
- };
- LinkExpando.isLoaded = function(n, t) {
- return LinkExpando.dataProp(n, "loaded", t)
- };
- LinkExpando.isVisible = function(n, t) {
- return LinkExpando.dataProp(n, "visible", t)
- };
- LinkExpando.isHooked = function(n, t) {
- return LinkExpando.dataProp(n, "hooked", t)
- };
- LinkExpando.toggle = function(n) {
- n.slideToggle()
- };
- ImageLinkExpando = function() {
- var n = 0;
- return function(t) {
- LinkExpando.call(this, /^([^\?]+(\.(jpg|jpeg|gif|giff|png)))$/i, t);
- this.autoLoadedCount = function() {
- return n
- };
- this.process = function(n) {
- var i = this.options.targetFunc ? this.options.targetFunc($(n)) : $(n),
- n = $(n),
- u, r;
- if (!LinkExpando.isHooked(i)) {
- u = this;
- i.on("click", function(n) {
- u.onClick(n)
- });
- LinkExpando.isHooked(i, !0);
- r = UI.Common.fileExtension(n.prop("href")).toUpperCase();
- i.prop("title", r);
- t.setTags && LinkExpando.setTag(i, r);
- LinkExpando.dataProp(i, "src", n.prop("href"));
- UI.ImageExpandoSettings.autoLoad ? this.loadImage(i, n.prop("href")) : UI.ImageExpandoSettings.autoShow && i.click()
- }
- };
- this.onClick = function(n) {
- n.preventDefault();
- var t = this.options.targetFunc($(n.target));
- LinkExpando.isVisible(t) ? (LinkExpando.toggle(this.options.destinationFunc(t), !1), this.options.toggle && this.options.toggle(t), LinkExpando.isVisible(t, !1)) : LinkExpando.isLoaded(t) ? (LinkExpando.isVisible(t, !0), LinkExpando.toggle(this.options.destinationFunc(t), !0), this.options.toggle && this.options.toggle(t)) : this.loadImage(t, LinkExpando.dataProp(t, "src"))
- };
- this.loadImage = function(n, t, i) {
- var u, r;
- this.options.loading && this.options.loading(n);
- this.options.setTags && LinkExpando.setTag(n, "loading");
- LinkExpando.dataProp(n, "src", t);
- n.off();
- n.on("click", function(n) {
- n.preventDefault()
- });
- u = new Image;
- u.onerror = function() {
- u.src = UI.Common.resolveUrl(UI.ImageExpandoSettings.errorImageUrl)
- };
- r = this;
- u.onload = function() {
- var o, s, h, c;
- if (this.complete) {
- var v = n.parent(),
- l = r.options.destinationFunc(n),
- e = l,
- u = $(this),
- f = this.width,
- a = this.height;
- e.html(u);
- o = UI.Common.fileExtension(t).toUpperCase().concat(" · ", f.toString(), " x ", a.toString());
- LinkExpando.setDirectLink(e, o, t);
- n.prop("title", o);
- this.removeAttribute("width");
- this.removeAttribute("height");
- u.css("min-width", Math.min(f, 68));
- u.css("max-width", f);
- u.data("nwidth", f);
- u.attr("draggable", !1);
- u.attr("oncontextmenu", "return false");
- u.on("mousedown", function(n) {
- if (n.which === 3) {
- u.css("width", f);
- n.preventDefault();
- return
- }
- s = {
- x: n.pageX,
- origWidth: u.width()
- };
- $("body").on("mousemove", h);
- $("body").on("mouseup", c)
- });
- h = function(n) {
- var t = n.pageX - s.x;
- u.css("width", s.origWidth + t);
- u.css("max-width", "")
- };
- c = function() {
- $("body").off("mousemove", h);
- $("body").off("mouseup", c)
- };
- LinkExpando.isLoaded(n, !0);
- n.off();
- n.on("click", function(t) {
- LinkExpando.isVisible(n) || (u.css("max-width", f), u.css("width", ""));
- r.onClick(t)
- });
- r.options.setTags && LinkExpando.setTag(n, UI.Common.fileExtension(t).toUpperCase());
- i || (LinkExpando.isVisible(n, !0), r.options.toggle && r.options.toggle(n), LinkExpando.toggle(e, !0));
- i && UI.ImageExpandoSettings.autoShow && n.click()
- }
- };
- u.src = t
- }
- }
- }();
- ImageLinkExpando.prototype = new LinkExpando;
- ImageLinkExpando.prototype.constructor = ImageLinkExpando;
- VideoLinkExpando = function() {
- var n = document.createElement("video");
- return function(t) {
- LinkExpando.call(this, t);
- this.isMP4Supported = function() {
- return this.isSupported("video/mp4", "avc1.42E01E,mp4a.40.2")
- };
- this.isWEBMSupported = function() {
- return this.isSupported("video/webm", "vp8.0,vorbis")
- };
- this.isSupported = function(t, i) {
- if (n.canPlayType) {
- var r = n.canPlayType(t + ";" + (i ? ' codecs="' + i + '"' : ""));
- return ["probably", "maybe"].indexOf(r) >= 0
- }
- return !1
- };
- this.isVideoSupported = function() {
- return this.isMP4Supported() || this.isWEBMSupported()
- };
- this.embedVideo = function(n, t, i, r) {
- var f = $("<video/>", t),
- e = this.options.targetFunc(n),
- o, u;
- if (e.prop("title", r), i.length > 0)
- for (o = 0; o < i.length; o++) f.append($("<source/>", i[o]));
- else return;
- return u = this.options.destinationFunc(e), UI.Common.resizeTarget(f, !1, u.parent()), t.muted && $(f).prop("muted", !0), u.empty().append(f), this.options.setTags && LinkExpando.setTag(e, r), LinkExpando.setDirectLink(u, r, n.prop("href")), LinkExpando.isLoaded(e, !0), u
- };
- this.PausePlayToggle = function(n) {
- this.options.toggle(n);
- var t = this;
- this.options.destinationFunc(n).slideToggle(400, function() {
- var r = LinkExpando.isVisible(n),
- u = LinkExpando.isLoaded(n),
- i = t.options.destinationFunc(n).find("video").get(0);
- i != null && (r && u ? i.play() : i.pause())
- })
- }
- }
- }();
- VideoLinkExpando.prototype = new LinkExpando;
- VideoLinkExpando.prototype.constructor = VideoLinkExpando;
- GfycatExpando = function(n) {
- LinkExpando.call(this, /gfycat\.com\/([A-Z]{1}[a-z]+[A-Z]{1}[a-z]+[A-Z]{1}[a-z]+)/, n);
- this.hook = function(n) {
- var t = this.options.targetFunc(n),
- i;
- if (t.prop("title", "Gfycat"), !LinkExpando.isHooked(t)) {
- LinkExpando.isHooked(t, !0);
- LinkExpando.dataProp(t, "id", this.getId(n.prop("href")));
- i = this;
- t.on("click", function(r) {
- if (r.preventDefault(), LinkExpando.isLoaded(t)) LinkExpando.isVisible(t, !LinkExpando.isVisible(t));
- else {
- i.options.loading && i.options.loading(t);
- i.options.setTags && LinkExpando.setTag(t, "loading");
- function u() {
- i.options.setTags && LinkExpando.setTag(t, "Error");
- t.off("click")
- }
- i.getSourceInfo(LinkExpando.dataProp(t, "id"), function(r) {
- if (!r.gfyItem) {
- u();
- return
- }
- if (i.isVideoSupported()) {
- var f = i.embedVideo(n, {
- width: r.gfyItem.width,
- height: r.gfyItem.height,
- autoplay: 1,
- loop: 1,
- muted: 1
- }, [{
- id: "mp4gfycat",
- src: r.gfyItem.mp4Url,
- type: "video/mp4"
- }, {
- id: "webmgfycat",
- src: r.gfyItem.webm,
- type: "video/webm"
- }], "Gfycat Video");
- LinkExpando.isLoaded(t, !0);
- LinkExpando.isVisible(t, !0)
- } else ImageLinkExpando.loadImage(t, r.gfyItem.gifUrl)
- }, u)
- }
- i.PausePlayToggle(t)
- });
- i.options.setTags && LinkExpando.setTag($(t), "Gfycat")
- }
- };
- this.getSourceInfo = function(n, t, i) {
- try {
- $.ajax({
- url: UI.Common.currentProtocol() + "//gfycat.com/cajax/get/" + n,
- type: "GET"
- }).done(t).fail(i)
- } catch (r) {
- i()
- }
- }
- };
- GfycatExpando.prototype = new VideoLinkExpando;
- GfycatExpando.prototype.constructor = GfycatExpando;
- GfycatExpando.prototype.process = function(n) {
- this.hook($(n))
- };
- ImgurGifvExpando = function(n) {
- LinkExpando.call(this, /i\.imgur\.com\/([^"&?\/\.]*)\.gifv/i, n);
- this.getSrcUrl = function(n, t) {
- return "http://i.imgur.com/".concat(n, t)
- };
- this.hook = function(n) {
- var t = this.options.targetFunc(n),
- i;
- if (t.prop("title", "Gifv"), !LinkExpando.isHooked(t)) {
- LinkExpando.isHooked(t, !0);
- LinkExpando.dataProp(t, "id", this.getId(n.prop("href")));
- i = this;
- t.on("click", function(r) {
- var u, f;
- r.preventDefault();
- u = i.getId(n.prop("href"));
- LinkExpando.isLoaded(t) ? LinkExpando.isVisible(t, !LinkExpando.isVisible(t)) : (i.options.setTags && LinkExpando.setTag(t, "loading"), i.isVideoSupported() ? (f = i.embedVideo(n, {
- width: "100%",
- height: "auto",
- autoplay: 1,
- loop: 1,
- muted: 1
- }, [{
- id: "mp4source",
- src: i.getSrcUrl(u, ".mp4"),
- type: "video/mp4"
- }, {
- id: "webmsource",
- src: i.getSrcUrl(u, ".webm"),
- type: "video/webm"
- }], "Gifv Video"), LinkExpando.isLoaded(t, !0), LinkExpando.isVisible(t, !0)) : (t.off("click"), LinkExpando.setTag(t)));
- i.PausePlayToggle(t)
- });
- i.options.setTags && LinkExpando.setTag($(t), "Gifv")
- }
- }
- };
- ImgurGifvExpando.prototype = new VideoLinkExpando;
- ImgurGifvExpando.prototype.constructor = ImgurGifvExpando;
- ImgurGifvExpando.prototype.process = function(n) {
- this.hook($(n))
- };
- WebMExpando = function(n) {
- LinkExpando.call(this, /(.+\.webm)/i, n);
- this.preConditionMet = function() {
- return this.isWEBMSupported()
- };
- this.hook = function(n) {
- var t = this.options.targetFunc(n),
- i;
- if (t.prop("title", "WebM"), !LinkExpando.isHooked(t)) {
- LinkExpando.isHooked(t, !0);
- LinkExpando.dataProp(t, "id", this.getId(n.prop("href")));
- i = this;
- t.on("click", function(r) {
- var u, f;
- r.preventDefault();
- u = n.prop("href");
- LinkExpando.isLoaded(t) ? LinkExpando.isVisible(t, !LinkExpando.isVisible(t)) : (i.options.setTags && LinkExpando.setTag(t, "loading"), i.isWEBMSupported() ? (f = i.embedVideo(n, {
- width: "100%",
- height: "auto",
- autoplay: 1,
- loop: 1,
- muted: 1
- }, [{
- id: "webmsource",
- src: u,
- type: "video/webm"
- }], "WebM Video"), LinkExpando.isLoaded(t, !0), LinkExpando.isVisible(t, !0)) : (t.off("click"), LinkExpando.setTag(t)));
- i.PausePlayToggle(t)
- });
- i.options.setTags && LinkExpando.setTag($(t), "WebM")
- }
- }
- };
- WebMExpando.prototype = new VideoLinkExpando;
- WebMExpando.prototype.constructor = WebMExpando;
- WebMExpando.prototype.process = function(n) {
- this.hook($(n))
- };
- MP4Expando = function(n) {
- LinkExpando.call(this, /(.+\.mp4)/i, n);
- this.preConditionMet = function() {
- return this.isMP4Supported()
- };
- this.hook = function(n) {
- var t = this.options.targetFunc(n),
- i;
- if (t.prop("title", "MP4"), !LinkExpando.isHooked(t)) {
- LinkExpando.isHooked(t, !0);
- LinkExpando.dataProp(t, "id", this.getId(n.prop("href")));
- i = this;
- t.on("click", function(r) {
- var u, f;
- r.preventDefault();
- u = n.prop("href");
- LinkExpando.isLoaded(t) ? LinkExpando.isVisible(t, !LinkExpando.isVisible(t)) : (i.options.setTags && LinkExpando.setTag(t, "loading"), i.isMP4Supported() ? (f = i.embedVideo(n, {
- width: "100%",
- height: "auto",
- autoplay: 1,
- loop: 1,
- muted: 1
- }, [{
- id: "mp4source",
- src: u,
- type: "video/mp4"
- }], "MP4 Video"), LinkExpando.isLoaded(t, !0), LinkExpando.isVisible(t, !0)) : (t.off("click"), LinkExpando.setTag(t)));
- i.PausePlayToggle(t)
- });
- i.options.setTags && LinkExpando.setTag($(t), "MP4")
- }
- }
- };
- MP4Expando.prototype = new VideoLinkExpando;
- MP4Expando.prototype.constructor = WebMExpando;
- MP4Expando.prototype.process = function(n) {
- this.hook($(n))
- };
- IFrameEmbedderExpando = function(n, t) {
- LinkExpando.call(this, n, t);
- this.defaultRatio = .5625;
- this.hook = function(n, t, i) {
- var u = this.options.targetFunc(n),
- f, r;
- if (!LinkExpando.isHooked(u) && (LinkExpando.isHooked(u, !0), f = this.getId(n.prop("href")), f)) {
- u.prop("title", t);
- r = this;
- u.on("click", function(u) {
- var e, o, s, h;
- u.preventDefault();
- e = r.options.targetFunc($(u.target));
- o = r.options.destinationFunc(e);
- LinkExpando.isLoaded(e) || (r.options.loading && r.options.loading(e), s = function() {
- r.options.setTags && LinkExpando.setTag(e, "Error");
- e.off("click")
- }, h = function(r) {
- LinkExpando.dataProp(e, "source", r);
- i.src = LinkExpando.dataProp(e, "source");
- var u = $("<iframe/>", i);
- o.empty().html(u);
- LinkExpando.setDirectLink(o, t, n.prop("href"));
- LinkExpando.isLoaded(e, !0);
- UI.Common.resizeTarget($("iframe", o), !1, e.parent())
- }, r.getSrcUrl(f, h, s));
- LinkExpando.isVisible(e, !LinkExpando.isVisible(e));
- r.options.toggle(e);
- r.options.destinationFunc(e).slideToggle(400, function() {
- !LinkExpando.isVisible(e) && LinkExpando.isLoaded(e) && (o.empty(), LinkExpando.isLoaded(e, !1))
- })
- });
- r.options.setTags && LinkExpando.setTag(u, t)
- }
- }
- };
- IFrameEmbedderExpando.prototype = new LinkExpando;
- IFrameEmbedderExpando.prototype.constructor = IFrameEmbedderExpando;
- YouTubeExpando = function(n) {
- IFrameEmbedderExpando.call(this, /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i, n);
- this.getSrcUrl = function(n, t) {
- t("//www.youtube.com/embed/" + n)
- }
- };
- YouTubeExpando.prototype = new IFrameEmbedderExpando;
- YouTubeExpando.prototype.constructor = YouTubeExpando;
- YouTubeExpando.prototype.process = function(n) {
- var i = this.options.targetFunc($(n)),
- t = Math.min(560, UI.Common.availableWidth(i.parent()));
- this.hook($(n), "YouTube", {
- width: t.toString(),
- height: (t * this.defaultRatio).toString(),
- frameborder: "0",
- allowfullscreen: !0
- })
- };
- ImgurAlbumExpando = function(n) {
- IFrameEmbedderExpando.call(this, /imgur\.com\/a\/(\w+)\/?/i, n);
- this.getSrcUrl = function(n, t) {
- t("//imgur.com/a/" + n + "/embed")
- }
- };
- ImgurAlbumExpando.prototype = new IFrameEmbedderExpando;
- ImgurAlbumExpando.prototype.constructor = ImgurAlbumExpando;
- ImgurAlbumExpando.prototype.process = function(n) {
- var t = Math.min(560, UI.Common.availableWidth($(n).parent()));
- this.hook($(n), "Imgur Album", {
- width: t.toString(),
- height: (t * .8).toString(),
- frameborder: "0"
- })
- };
- VimeoExpando = function(n) {
- IFrameEmbedderExpando.call(this, /vimeo\.com\/(?:.\*|.*\/)?([\d]+)\/?/i, n);
- this.getSrcUrl = function(n, t) {
- t("//player.vimeo.com/video/" + n)
- }
- };
- VimeoExpando.prototype = new IFrameEmbedderExpando;
- VimeoExpando.prototype.constructor = VimeoExpando;
- VimeoExpando.prototype.process = function(n) {
- var t = Math.min(560, UI.Common.availableWidth($(n).parent()));
- this.hook($(n), "Vimeo", {
- width: t.toString(),
- height: t * this.defaultRatio,
- frameborder: "0",
- webkitallowfullscreen: 1,
- mozallowfullscreen: 1,
- allowfullscreen: 1
- })
- };
- CoubExpando = function(n) {
- IFrameEmbedderExpando.call(this, /coub\.com\/(?:v|view|embed)\/(\w+)/i, n);
- this.getSrcUrl = function(n, t) {
- t("//coub.com/embed/" + n)
- }
- };
- CoubExpando.prototype = new IFrameEmbedderExpando;
- CoubExpando.prototype.constructor = CoubExpando;
- CoubExpando.prototype.process = function(n) {
- var t = Math.min(560, UI.Common.availableWidth($(n).parent()));
- this.hook($(n), "Coub", {
- width: t.toString(),
- height: t * this.defaultRatio,
- frameborder: "0",
- webkitallowfullscreen: 1,
- mozallowfullscreen: 1,
- allowfullscreen: 1
- })
- };
- SoundCloudExpando = function(n) {
- IFrameEmbedderExpando.call(this, /http(?:s{0,1}):\/\/(?:soundcloud\.com|snd\.sc)\/(.*)\/?/i, n);
- this.getSrcUrl = function(n, t, i) {
- this.getSourceInfo = function(n, r, u) {
- $.getJSON(UI.Common.currentProtocol() + "//soundcloud.com/oembed", {
- format: "json",
- url: "https://soundcloud.com/" + n,
- iframe: "true"
- }).done(function(n) {
- n.html || (u(), i());
- var r = /<iframe.*?src="(.*?)"/.exec(n.html)[1];
- t(r + "&auto_play=true")
- }).fail(function() {
- i()
- })
- };
- this.getSourceInfo(n, t, i)
- }
- };
- SoundCloudExpando.prototype = new IFrameEmbedderExpando;
- SoundCloudExpando.prototype.constructor = SoundCloudExpando;
- SoundCloudExpando.prototype.process = function(n) {
- var t = Math.min(560, UI.Common.availableWidth($(n).parent()));
- this.hook($(n), "SoundCloud", {
- width: t.toString(),
- height: t * this.defaultRatio,
- frameborder: "0"
- })
- };
- UI.ImageExpandoSettings = function() {
- return {
- autoLoad: !1,
- autoShow: !1,
- initialSize: 0,
- errorImageUrl: "~/Graphics/missing_image.png"
- }
- }();
- UI.SidebarHandler = function() {
- function u() {
- t.toggleClass("show-mobile-sidebar", !1);
- n.toggleClass("show-mobile-sidebar", !1);
- i.toggleClass("show-mobile-sidebar", !1);
- r.toggleClass("show-mobile-sidebar", !1)
- }
- function e(n) {
- n.matches && u()
- }
- var f;
- if (!$(".side").exists()) {
- $("#show-menu-button").hide();
- return
- }
- var i = $(".side"),
- n = $("#show-menu-button"),
- t = $("#modal-background"),
- r = $("body");
- n.on("click", function() {
- t.toggleClass("show-mobile-sidebar");
- n.toggleClass("show-mobile-sidebar");
- i.toggleClass("show-mobile-sidebar");
- r.toggleClass("show-mobile-sidebar")
- });
- t.on("click", function() {
- u()
- });
- f = window.matchMedia("(min-width: 870px)");
- f.addListener(e)
- };
- $(document).ready(function() {
- var n, t;
- UI.Common.debug = !1;
- n = {
- targetFunc: function(n) {
- var t = n;
- return t.is("span") && (t = n.parent()), t
- },
- destinationFunc: function(n) {
- var r = this.targetFunc(n),
- t = n.next(".link-expando"),
- i;
- return t.length == 0 && (i = $("<div/>", {
- "class": "link-expando",
- style: "display:none;"
- }), i.insertAfter(n), t = n.next(".link-expando")), t
- },
- toggle: function() {},
- setTags: !0
- };
- UI.ExpandoManager.addExpando(".usertext-body > .md a:not(.link-expando-direct), .panel-message-body a:not(.link-expando-direct)", [new ImageLinkExpando(n), new YouTubeExpando(n), new VimeoExpando(n), new CoubExpando(n), new GfycatExpando(n), new SoundCloudExpando(n), new ImgurAlbumExpando(n), new ImgurGifvExpando(n), new WebMExpando(n), new MP4Expando(n)]);
- t = {
- targetFunc: function(n) {
- var t = n.parent().parent().find(".expando-button"),
- i;
- return t.length == 0 && (i = $("<div/>", {
- "class": "expando-button collapsed selftext"
- }), i.insertAfter(n.parent()), t = n.parent().parent().find(".expando-button")), t
- },
- destinationFunc: function(n) {
- var t = n.parent().find(".expando"),
- i;
- return t.length == 0 && (i = $("<div/>", {
- "class": "expando collapsed link-expando",
- style: "display:none;"
- }), n.parent().append(i), t = n.parent().find(".expando")), t.hasClass("link-expando") || t.addClass("link-expando"), t
- },
- toggle: function(n) {
- n.hasClass("loading") ? (n.addClass("expanded"), n.removeClass("loading"), n.removeClass("collapsed")) : n.hasClass("collapsed") ? (n.removeClass("collapsed"), n.addClass("expanded")) : (n.removeClass("expanded"), n.addClass("collapsed"))
- },
- loading: function(n) {
- n.addClass("loading");
- n.removeClass("collapsed");
- n.removeClass("expanded")
- },
- setTags: !1
- };
- UI.ExpandoManager.addExpando(".submission .entry .title a:not(.link-expando-direct)", [new ImageLinkExpando(t), new YouTubeExpando(t), new VimeoExpando(t), new CoubExpando(t), new GfycatExpando(t), new SoundCloudExpando(t), new ImgurAlbumExpando(t), new ImgurGifvExpando(t), new WebMExpando(t), new MP4Expando(t)]);
- UI.ExpandoManager.execute();
- UI.Notifications.subscribe("iFrameLoaded", function(n) {
- var t = $("iframe", n);
- t && UI.Common.resizeTarget(t, !1, t.parent())
- });
- $(window).on("resize", function() {
- $(".link-expando img").each(function() {
- var n = $(this).data("nwidth");
- $(this).css({
- width: "",
- "max-width": n
- })
- })
- });
- UI.SidebarHandler()
- });
- $(document).ready(function() {
- function n() {
- $(this).find("ul").css("visibility", "visible")
- }
- function t() {
- $(this).find("ul").css("visibility", "hidden")
- }
- $('[data-toggle="popover"]').popover({
- trigger: "hover",
- placement: "top"
- });
- securityToken = $("[name=__RequestVerificationToken]").val();
- $("body").bind("ajaxSend", function(n, t, i) {
- i.type == "POST" && typeof securityToken != "undefined" && (i.data.length > 0 ? i.data += "&__RequestVerificationToken=" + encodeURIComponent(securityToken) : i.data = "__RequestVerificationToken=" + encodeURIComponent(securityToken))
- });
- $(".whoaSubscriptionMenu > li").bind("mouseover", n);
- $(".whoaSubscriptionMenu > li").bind("mouseout", t);
- $("#Subverse").autocomplete({
- source: "/ajaxhelpers/autocompletesubversename"
- });
- $(document).on("click", 'a[href="#s"]', function(n) {
- n.preventDefault()
- });
- $("#share-a-link-overlay").on("dragleave", function(n) {
- (n.originalEvent.pageX < 10 || n.originalEvent.pageY < 10 || $(window).width() - n.originalEvent.pageX < 10 || $(window).height - n.originalEvent.pageY < 10) && $("#share-a-link-overlay").hide()
- });
- $("#share-a-link-overlay").on("dragover", function(n) {
- n.stopPropagation();
- n.preventDefault()
- });
- $(".userinfo").tooltipster({
- content: "Loading user info...",
- contentAsHTML: "true",
- functionBefore: function(n, t) {
- t();
- n.data("ajax") !== "cached" && $.ajax({
- type: "GET",
- url: "/ajaxhelpers/userinfo/" + n.attr("data-username"),
- success: function(t) {
- n.tooltipster("content", t).data("ajax", "cached")
- }
- })
- }
- });
- $(function() {
- if ($.connection != null) {
- var n = $.connection.messagingHub;
- n != null && (n.client.setNotificationsPending = function(n) {
- var t = $('meta[property="og:title"]').attr("content");
- n > 0 ? ($("#mail").hasClass("nohavemail") && $("#mail").removeClass("nohavemail").addClass("havemail"), $("#mail").prop("title", "your have " + n + " unread notifications"), $("#mailcounter").show(), $("#mailcounter").html(n), document.title = "(" + n + ") " + t) : ($("#mail").hasClass("havemail") && $("#mail").removeClass("havemail").addClass("nohavemail"), $("#mail").prop("title", "no new messages"), $("#mailcounter").html(0), $("#mailcounter").hide(), document.title = t)
- }, n.client.voteChange = function(n, t) {
- var i = 0;
- n == 2 ? (i = $("#ccp").html(), i = i + t, $("#ccp").html(i)) : (i = $("#scp").html(), i = i + t, $("#scp").html(i))
- }, n.client.appendChatMessage = function(n, t) {
- $("#subverseChatRoom").append("<p><b>" + n + "<\/b>: " + t + "<\/p>");
- scrollChatToBottom()
- }, $.connection.hub.start({
- transport: "webSockets"
- }).done(function() {}))
- }
- });
- $(function() {
- var n = $(window);
- n.scroll(function() {
- n.height() + n.scrollTop() == $(document).height() && $("#loadmorebutton").trigger("click")
- })
- })
- });
- submissionVoteLock = null;
- commentVoteLock = null;
- $.fn.exists = function() {
- return this.length !== 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement