Free javascript Hosting


jobs2-min.js

Uploaded on Jan 18 2022 12:43 by tpack

(function () { var widgetVersion = "1"; var baseUrl = "//apps.jobadder.com/widgets"; var minjQueryVersion = "1.9.1"; var widgetSettings = { key: "", showLoadingImage: true, enablePushState: true, jobSearchSettings: { showSearchForm: false, classificationsToExclude: [], showLabels: true, optionText: "", showKeywordSearch: true, autoSearch: false, showSearchButton: true, searchButtonText: "Search" }, jobListSettings: { jobsPerPage: 5, showHotJobsOnly: false, titleIsLink: true, showDatePosted: true, datePostedFormat: "{0}", dateFormat: "d/M/yyyy", showClassifications: true, classificationsToExclude: [], showSalary: false, salaryFormat: "{0}", includeSalaryText: false, showJobReference: false, jobReferenceFormat: "{0}", alwaysShowPager: false, showPagerSummary: true, pagerGroupSize: 4, scrollOnPageChange: true, animateScrollOnPageChange: false, readMoreText: "More..", noJobsContent: "There are no jobs matching your criteria. Please try a broader search." }, jobDetailsSettings: { jobID: null, showDatePosted: true, datePostedFormat: "{0}", dateFormat: "d/M/yyyy", showClassifications: true, classificationsToExclude: [], showSalary: false, salaryFormat: "{0}", includeSalaryText: false, showJobReference: false, jobReferenceFormat: "{0}", showBulletPoints: true, applyButtonText: "Apply Now", backLinkText: "Back to search results" }, applicationFormSettings: { jobID: null, useExternalApplicationForm: false, showExternalApplicationFormInNewWindow: true, pageTitle: "Apply Now", showJobTitle: true, showJobSummary: false, formFields: "firstName,lastName,email,phone,mobile,resume,coverLetter,coverNote", formFieldLabels: "First name,Last name,Email address,Phone,Mobile,Resume,Cover letter,Cover note", showLabels: true, applyButtonText: "Apply Now", backLinkText: "Cancel", showLoadingImage: true, submittedContent: "Thank you - your application has been successfully submitted.", submittedRedirectUrl: "" } }; var loadingImage = document.createElement("img"); loadingImage.className = "ja-loading left"; loadingImage.setAttribute("src", window._jaJobsSettings.loadingImageUrl || baseUrl + "/V" + widgetVersion + "/loading.gif"); loadingImage.setAttribute("alt", "Loading.."); if (window._jaJobsSettings.showLoadingImage !== false) { document.getElementById("ja-jobs-widget").appendChild(loadingImage) } var jQuery; if (window.jQuery === undefined || window.jQuery.fn.jquery < minjQueryVersion) { var scriptTag = document.createElement("script"); scriptTag.setAttribute("type", "text/javascript"); scriptTag.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/" + minjQueryVersion + "/jquery.min.js"); if (scriptTag.readyState) { scriptTag.onreadystatechange = function () { if (this.readyState === "complete" || this.readyState === "loaded") { scriptLoadHandler() } } } else { scriptTag.onload = scriptLoadHandler } (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(scriptTag) } else { jQuery = window.jQuery; main() } function scriptLoadHandler() { jQuery = window.jQuery.noConflict(true); main() } function main() { jQuery(document).ready(function ($) { $.extend(true, widgetSettings, window._jaJobsSettings); widgetSettings.loadingImageUrl = widgetSettings.loadingImageUrl || baseUrl + "/V" + widgetVersion + "/loading.gif"; var renderSearchFormRequest = { key: widgetSettings.key, classificationsToExclude: widgetSettings.jobSearchSettings.classificationsToExclude ? widgetSettings.jobSearchSettings.classificationsToExclude.join(",") : "", showLabels: widgetSettings.jobSearchSettings.showLabels, optionText: widgetSettings.jobSearchSettings.optionText, showKeywordSearch: widgetSettings.jobSearchSettings.showKeywordSearch, autoSearch: widgetSettings.jobSearchSettings.autoSearch, showSearchButton: widgetSettings.jobSearchSettings.showSearchButton, searchButtonText: widgetSettings.jobSearchSettings.searchButtonText }; var renderJobListRequest = { key: widgetSettings.key, jobsPerPage: widgetSettings.jobListSettings.jobsPerPage, showHotJobsOnly: widgetSettings.jobListSettings.showHotJobsOnly, titleIsLink: widgetSettings.jobListSettings.titleIsLink, showDatePosted: widgetSettings.jobListSettings.showDatePosted, datePostedFormat: widgetSettings.jobListSettings.datePostedFormat, dateFormat: widgetSettings.jobListSettings.dateFormat, showClassifications: widgetSettings.jobListSettings.showClassifications, classificationsToExclude: widgetSettings.jobListSettings.classificationsToExclude ? widgetSettings.jobListSettings.classificationsToExclude.join(",") : "", showSalary: widgetSettings.jobListSettings.showSalary, salaryFormat: widgetSettings.jobListSettings.salaryFormat, includeSalaryText: widgetSettings.jobListSettings.includeSalaryText, showJobReference: widgetSettings.jobListSettings.showJobReference, jobReferenceFormat: widgetSettings.jobListSettings.jobReferenceFormat, alwaysShowPager: widgetSettings.jobListSettings.alwaysShowPager, showPagerSummary: widgetSettings.jobListSettings.showPagerSummary, pagerGroupSize: widgetSettings.jobListSettings.pagerGroupSize, scrollOnPageChange: widgetSettings.jobListSettings.scrollOnPageChange, animateScrollOnPageChange: widgetSettings.jobListSettings.animateScrollOnPageChange, readMoreText: widgetSettings.jobListSettings.readMoreText, noJobsContent: widgetSettings.jobListSettings.noJobsContent, renderPoweredByJobAdder: true }; var renderJobDetailsRequest = { key: widgetSettings.key, showDatePosted: widgetSettings.jobDetailsSettings.showDatePosted, datePostedFormat: widgetSettings.jobDetailsSettings.datePostedFormat, dateFormat: widgetSettings.jobDetailsSettings.dateFormat, showClassifications: widgetSettings.jobDetailsSettings.showClassifications, classificationsToExclude: widgetSettings.jobDetailsSettings.classificationsToExclude ? widgetSettings.jobDetailsSettings.classificationsToExclude.join(",") : "", showSalary: widgetSettings.jobDetailsSettings.showSalary, salaryFormat: widgetSettings.jobDetailsSettings.salaryFormat, includeSalaryText: widgetSettings.jobDetailsSettings.includeSalaryText, showJobReference: widgetSettings.jobDetailsSettings.showJobReference, jobReferenceFormat: widgetSettings.jobDetailsSettings.jobReferenceFormat, showBulletPoints: widgetSettings.jobDetailsSettings.showBulletPoints, applyButtonText: widgetSettings.jobDetailsSettings.applyButtonText, backLinkText: widgetSettings.jobDetailsSettings.backLinkText, useExternalApplicationForm: widgetSettings.applicationFormSettings.useExternalApplicationForm, showExternalApplicationFormInNewWindow: widgetSettings.applicationFormSettings.showExternalApplicationFormInNewWindow }; var renderApplicationFormRequest = { key: widgetSettings.key, ajaxSubmit: true, formUrl: [location.protocol, "//", location.host, location.pathname].join(""), useExternalApplicationForm: widgetSettings.applicationFormSettings.useExternalApplicationForm, showExternalApplicationFormInNewWindow: widgetSettings.applicationFormSettings.showExternalApplicationFormInNewWindow, pageTitle: widgetSettings.applicationFormSettings.pageTitle, showJobTitle: widgetSettings.applicationFormSettings.showJobTitle, showJobSummary: widgetSettings.applicationFormSettings.showJobSummary, formFields: widgetSettings.applicationFormSettings.formFields, formFieldLabels: widgetSettings.applicationFormSettings.formFieldLabels, showLabels: widgetSettings.applicationFormSettings.showLabels, applyButtonText: widgetSettings.applicationFormSettings.applyButtonText, backLinkText: widgetSettings.applicationFormSettings.backLinkText, submittedRedirectUrl: widgetSettings.applicationFormSettings.submittedRedirectUrl }; if (renderApplicationFormRequest.formFields === "") { renderApplicationFormRequest.formFields = "firstName,lastName,email,resume"; renderApplicationFormRequest.formFieldLabels = "First name,Last name,Email address,Resume" } var renderSubmittedRequest = { content: widgetSettings.applicationFormSettings.submittedContent }; if (widgetSettings.key === "") { alert("Error: invalid/missing key"); return } var $widgetContainer = $("#ja-jobs-widget"); var $loadingImage = $(loadingImage).hide().removeClass("left"); var $jobSearchState = ""; var searchParams = { classificationIDs: [], keywords: "", pageNumber: 1 }; var queryStringParams = { jobID: getParameterByName("ja-job"), classificationIDs: getParameterByName("ja-classifications"), keywords: getParameterByName("ja-keywords"), applyID: getParameterByName("ja-apply"), submitted: getParameterByName("ja-submitted"), jobUnavailable: getParameterByName("ja-job-unavailable") }; if (widgetSettings.jobDetailsSettings.jobID && !isNaN(widgetSettings.jobDetailsSettings.jobID)) { queryStringParams.jobID = widgetSettings.jobDetailsSettings.jobID } if (widgetSettings.applicationFormSettings.jobID && !isNaN(widgetSettings.applicationFormSettings.jobID)) { queryStringParams.applyID = widgetSettings.applicationFormSettings.jobID } function init(pop) { queryStringParams = { jobID: getParameterByName("ja-job"), classificationIDs: getParameterByName("ja-classifications"), keywords: getParameterByName("ja-keywords"), applyID: getParameterByName("ja-apply"), submitted: getParameterByName("ja-submitted"), jobUnavailable: getParameterByName("ja-job-unavailable") }; if (queryStringParams.jobUnavailable) { loadHtml("Jobs/RenderUnavailable", null, render) } else { if (queryStringParams.submitted) { loadHtml("Jobs/RenderSubmitted", renderSubmittedRequest, render) } else { if ((queryStringParams.applyID && !isNaN(queryStringParams.applyID))) { renderApplicationForm(queryStringParams.applyID) } else { if ((queryStringParams.jobID && !isNaN(queryStringParams.jobID))) { renderJobDetailsRequest.jobID = queryStringParams.jobID; loadHtml("Jobs/RenderJobDetails", renderJobDetailsRequest, render) } else { if (queryStringParams.classificationIDs || queryStringParams.keywords) { var classificationIDs = []; var temp = queryStringParams.classificationIDs.split(","); for (var i = 0; i < temp.length; i++) { if (!isNaN(temp[i])) { classificationIDs.push(temp[i]) } } searchParams.classificationIDs = classificationIDs; searchParams.keywords = queryStringParams.keywords; renderJobListRequest.classificationIDs = searchParams.classificationIDs.join(","); renderJobListRequest.keywords = queryStringParams.keywords; renderJobListRequest.pageNumber = 1; if (widgetSettings.jobSearchSettings.showSearchForm) { loadHtml("Jobs/RenderSearchForm", renderSearchFormRequest, function (renderSearchFormResponse) { $widgetContainer.html(renderSearchFormResponse); loadHtml("Jobs/RenderJobList", renderJobListRequest, function (renderJobListResponse) { $widgetContainer.append(renderJobListResponse); refreshSearchForm() }) }) } else { loadHtml("Jobs/RenderJobList", renderJobListRequest, function (renderJobListResponse) { $widgetContainer.append(renderJobListResponse) }) } pushJobListState(pop) } else { renderDefaultWidget(pop) } } } } } } init(); if (widgetSettings.enablePushState && history.pushState) { window.onpopstate = function (event) { var s = event.state; if (!s || !s.url) { return } if (s.url.indexOf("Jobs/RenderJobList") > -1) { init(true) } else { if (s.url.indexOf("Jobs/RenderJobDetails") > -1 && s.jobID) { renderJobDetailsPage(s.jobID, true) } else { if (s.url.indexOf("Jobs/RenderApplicationForm") > -1 && s.jobID) { renderApplicationForm(s.jobID, true) } } } } } $widgetContainer.on("change", ".ja-job-search select", function () { getChildClassifications($(this), function ($child) { $child.val("0") }); if (widgetSettings.jobSearchSettings.autoSearch) { searchJobs() } }); $widgetContainer.on("click", ".ja-job-search .ja-button", function () { searchJobs(); return false }); function searchJobs() { var classificationIDs = []; var $selects = $(".ja-job-search select", $widgetContainer); $.each($selects, function (index, item) { var id = item.value; if (id !== "0" && !isNaN(id)) { classificationIDs.push(id) } }); searchParams.classificationIDs = classificationIDs; var $txtKeywords = $("#ja-keywords"); if ($txtKeywords.length) { searchParams.keywords = $txtKeywords.val() } renderJobListRequest.classificationIDs = classificationIDs.join(","); renderJobListRequest.keywords = searchParams.keywords; renderJobListRequest.renderPoweredByJobAdder = false; renderJobListRequest.pageNumber = 1; loadHtml("Jobs/RenderJobList", renderJobListRequest, function (renderJobListResponse) { $widgetContainer.find(".ja-job-list-container").replaceWith(renderJobListResponse) }) } $widgetContainer.on("click", ".ja-pager a", function () { var pageNumber = $(this).data("page"); if (pageNumber === "undefined" || pageNumber === null || isNaN(pageNumber)) { return false } searchParams.pageNumber = pageNumber; renderJobListRequest.classificationIDs = searchParams.classificationIDs.join(","); renderJobListRequest.keywords = searchParams.keywords; renderJobListRequest.pageNumber = searchParams.pageNumber; renderJobListRequest.renderPoweredByJobAdder = false; loadHtml("Jobs/RenderJobList", renderJobListRequest, function (renderJobListResponse) { $widgetContainer.find(".ja-job-list-container").replaceWith(renderJobListResponse); if (widgetSettings.jobListSettings.scrollOnPageChange) { if (widgetSettings.jobListSettings.animateScrollOnPageChange) { $("html, body").animate({ scrollTop: $(".ja-job-list-container", $widgetContainer).offset().top }, 1000) } else { window.scrollTo(0, $widgetContainer.offset().top) } } }); return false }); $widgetContainer.on("click", ".ja-job-list .title a, .ja-job-list .view-details", function (e) { e.preventDefault(); var jobID = $(this).data("job-id"); if (!jobID || isNaN(jobID)) { return false } renderJobDetailsPage(jobID) }); function renderJobDetailsPage(jobID, pop) { saveJobSearchState(); renderJobDetailsRequest.jobID = jobID; loadHtml("Jobs/RenderJobDetails", renderJobDetailsRequest, function (renderJobDetailsResponse) { $widgetContainer.html(renderJobDetailsResponse); window.scrollTo(0, $widgetContainer.offset().top); if (widgetSettings.enablePushState && history.pushState && !pop) { history.pushState({ jobID: jobID, url: "Jobs/RenderJobDetails" }, "Jobs/RenderJobDetails", "?ja-job=" + jobID) } }); return false } $widgetContainer.on("click", ".ja-job-details .apply input", function () { var $this = $(this); var url = $this.data("apply-url"); if (url && url.length) { if ($this.data("new-window")) { window.open(url) } else { loadHtml("Jobs/RenderApplicationFormIframe", { Url: url }, function (renderApplicationFormIframeResponse) { $widgetContainer.html(renderApplicationFormIframeResponse); $(".ja-apply-iframe").find("iframe").iFrameResize({ checkOrigin: false, heightCalculationMethod: "bodyScroll" }); window.scrollTo(0, $widgetContainer.offset().top) }) } return false } var jobID = $(this).data("job-id"); if (!jobID || isNaN(jobID)) { return false } renderApplicationForm(jobID); return false }); $widgetContainer.on("click", ".ja-job-details .back-link", function (e) { e.preventDefault(); restoreJobSearchState(); return false }); $widgetContainer.on("click", ".ja-job-unavailable .back-link", function () { restoreJobSearchState(); return false }); function renderApplicationForm(jobID, pop) { window.scrollTo(0, $widgetContainer.offset().top); renderApplicationFormRequest.jobID = jobID; if ($.support.cors) { loadHtml("Jobs/RenderApplicationForm", renderApplicationFormRequest, function (renderApplicationFormResponse) { $widgetContainer.html(renderApplicationFormResponse); $widgetContainer.find(".ja-job-apply .ja-submit .ja-button").removeAttr("disabled") }) } else { renderApplicationFormRequest.ajaxSubmit = false; renderApplicationFormRequest.errorMessage = getParameterByName("error"); renderApplicationFormRequest.errorRequired = getParameterByName("error-required"); renderApplicationFormRequest.errorEmail = getParameterByName("error-email"); loadHtml("Jobs/RenderApplicationForm", renderApplicationFormRequest, function (renderApplicationFormResponse) { $widgetContainer.html(renderApplicationFormResponse); $.each(location.search.substr(1).split("&"), function (index, item) { var arr = item.split("="); if (arr.length == 2 && arr[0].indexOf("Candidate") === 0) { $("#" + arr[0]).val(decodeURIComponent(arr[1])) } }); $widgetContainer.find(".ja-job-apply .ja-submit .ja-button").removeAttr("disabled") }) } if (widgetSettings.enablePushState && history.pushState && !pop) { history.pushState({ jobID: jobID, url: "Jobs/RenderApplicationForm" }, "Jobs/RenderApplicationForm", "?ja-apply=" + jobID) } } $widgetContainer.one("click", ".ja-job-apply .ja-submit .ja-button", function () { submitApplicationForm(); return false }); function submitApplicationForm() { var $form = $widgetContainer.find(".ja-job-apply form"); var $btnSubmit = $form.find(".ja-submit .ja-button"); var $linkBack = $form.find(".ja-submit .back-link"); var $errorContainer = $form.find(".ja-error-container"); var $errorMessage = $errorContainer.find(".ja-error-message"); $btnSubmit.attr("disabled", "disabled"); $linkBack.hide(); if (widgetSettings.applicationFormSettings.showLoadingImage) { $loadingImage.show(); $form.find(".ja-submit").append($loadingImage) } if ($.support.cors) { $form.ajaxSubmit({ type: "POST", dataType: "json", iframe: false, success: function (response, statusText, xhr) { var $errorFields = $form.find("input.error, select.error, textarea.error"); $errorFields.removeClass("error").parents("form").find(".validation-error").remove(); if (!response.Success) { $errorMessage.text(response.ErrorMessage); $errorContainer.show(); if (response.ValidationErrors) { $.each(response.ValidationErrors, function (index, item) { var $field = $("#" + item.FieldName); var $span = $("<span></span>", { "class": "validation-error", text: item.ErrorMessage }); $field.addClass("error").parent(".ja-field").append($span); $field.parent(".checkbox").append($span) }) } if (response.Unavailable) { loadHtml("Jobs/RenderUnavailable", null, function (renderUnavailableResponse) { $widgetContainer.html(renderUnavailableResponse) }) } } else { $errorMessage.text(""); $errorContainer.hide(); if (widgetSettings.applicationFormSettings.submittedRedirectUrl) { window.location.href = widgetSettings.applicationFormSettings.submittedRedirectUrl } else { loadHtml("Jobs/RenderSubmitted", renderSubmittedRequest, function (renderSubmittedResponse) { $widgetContainer.html(renderSubmittedResponse) }) } } }, error: function (jqXHR, textStatus, errorThrown) { $errorMessage.text("Failed to submit your application. Please try again."); $errorContainer.show() }, complete: function (jqXHR, textStatus) { $loadingImage.remove(); $linkBack.show(); $btnSubmit.one("click", function () { submitApplicationForm(); return false }).removeAttr("disabled") } }) } else { $form.submit() } return false } $widgetContainer.on("click", ".ja-job-apply .back-link", function () { if (confirm("Are you sure you want to cancel?")) { restoreJobSearchState() } return false }); $widgetContainer.on("click", ".ja-apply-iframe .back-link", function () { var src = $widgetContainer.find("iframe").attr("src"); if (src && (src.toLowerCase().indexOf("submitted") !== -1) || src.toLowerCase().indexOf("closed") !== -1) { restoreJobSearchState() } else { if (confirm("Are you sure you want to cancel?")) { restoreJobSearchState() } } return false }); $widgetContainer.on("click", ".ja-application-submitted .back-link", function () { restoreJobSearchState(); return false }); function loadHtml(url, request, successCallback, errorCallback, completeCallback) { if (!url) { return } $.ajax({ type: "GET", url: baseUrl + "/V" + widgetVersion + "/" + url, data: request, dataType: "jsonp", contentType: "application/json; charset=utf-8", beforeSend: function () { if (widgetSettings.showLoadingImage) { $widgetContainer.append($loadingImage) } }, success: function (response, textStatus, jqXHR) { if (successCallback && typeof (successCallback) === "function") { successCallback(response, textStatus, jqXHR) } }, error: function (jqXHR, textStatus, errorThrown) { if (errorCallback && typeof (errorCallback) === "function") { errorCallback(jqXHR, textStatus, errorThrown) } else { logError("loadHtml error: " + errorThrown + ". Board reference: " + widgetSettings.key) } }, complete: function (jqXHR, textStatus) { if (widgetSettings.showLoadingImage) { $loadingImage.remove() } if (completeCallback && typeof (completeCallback) === "function") { completeCallback(jqXHR, textStatus) } } }) } function saveJobSearchState() { $jobSearchState = $widgetContainer.html() } function restoreJobSearchState(pop) { window.scrollTo(0, $widgetContainer.offset().top); if ($jobSearchState.length === 0) { renderDefaultWidget(pop); return } $widgetContainer.html($jobSearchState); refreshSearchForm(); if (widgetSettings.enablePushState && history.pushState && !pop) { history.back() } } function renderDefaultWidget(pop) { if (widgetSettings.jobSearchSettings.showSearchForm) { loadHtml("Jobs/RenderSearchForm", renderSearchFormRequest, function (renderSearchFormResponse) { $widgetContainer.html(renderSearchFormResponse); loadHtml("Jobs/RenderJobList", renderJobListRequest, function (renderJobListResponse) { $widgetContainer.append(renderJobListResponse) }) }) } else { loadHtml("Jobs/RenderJobList", renderJobListRequest, render) } pushJobListState(pop) } function render(res) { $widgetContainer.html(res) } function pushJobListState(pop) { if (widgetSettings.enablePushState && history.pushState && !pop) { history.pushState({ url: "Jobs/RenderJobList" }, "Jobs/RenderJobList", "") } } function refreshSearchForm() { var $selects = $(".ja-job-search select[data-child]", $widgetContainer); $.each($selects, function (index, item) { var $select = $(item); $.each(searchParams.classificationIDs, function (innerIndex, classificationID) { if ($select.find('option[value="' + classificationID + '"]').length > 0) { $select.val(classificationID); return } }); if ($select.val()) { getChildClassifications($select, function ($childElement) { $.each(searchParams.classificationIDs, function (innerIndex, classificationID) { if ($childElement.find('option[value="' + classificationID + '"]').length > 0) { $childElement.val(classificationID); return } else { $childElement.val("0") } }) }) } }); $("#ja-keywords", $widgetContainer).val(searchParams.keywords) } function getChildClassifications(selectElement, successCallback) { var childID = selectElement.data("child"); if (childID === "undefined") { return } var $child = $("#" + childID); if ($child.length === 0) { return } var firstItemText = $child.find("option").first().text(); $child.find("option").remove(); $child.append($("<option></option>").attr("value", "0").text("Loading..")); var getClassificationsRequest = { key: widgetSettings.key, parentID: selectElement.val() }; loadHtml("Jobs/GetClassifications", getClassificationsRequest, function (getClassificationsResponse) { $child.find("option").remove(); if (getClassificationsResponse.Success !== true) { $child.append($("<option></option>").attr("value", "0").text(getClassificationsResponse.ErrorMessage !== "" ? getClassificationsResponse.ErrorMessage : "Failed to load classifications")) } else { if (selectElement.val() > 0) { $.each(getClassificationsResponse.Items, function (index, item) { $child.append($("<option></option>").attr("value", item.Value).text(item.Text)) }) } $child.prepend($("<option></option>").attr("value", "0").text(firstItemText)) } if (successCallback && typeof (successCallback) === "function") { successCallback($child) } }, function (jqXHR, textStatus, errorThrown) { $child.find("option").remove(); $child.append($("<option></option>").attr("value", "0").text("Error - " + errorThrown)) }) } function logError(errorMessage) { if (!errorMessage) { return } var error = { errorMessage: errorMessage }; $.ajax({ type: "GET", url: baseUrl + "/V" + widgetVersion + "/Error/LogError", data: error, dataType: "json", contentType: "application/json; charset=utf-8" }) } function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")) } var JSON; if (!JSON) { JSON = {} } (function () { function f(n) { return n < 10 ? "0" + n : n } if (typeof Date.prototype.toJSON !== "function") { Date.prototype.toJSON = function (key) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) { return this.valueOf() } } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, rep; function quote(string) { escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + string + '"' } function str(key, holder) { var i, k, v, length, mind = gap, partial, value = holder[key]; if (value && typeof value === "object" && typeof value.toJSON === "function") { value = value.toJSON(key) } if (typeof rep === "function") { value = rep.call(holder, key, value) } switch (typeof value) { case "string": return quote(value); case "number": return isFinite(value) ? String(value) : "null"; case "boolean": case "null": return String(value); case "object": if (!value) { return "null" } gap += indent; partial = []; if (Object.prototype.toString.apply(value) === "[object Array]") { length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || "null" } v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]"; gap = mind; return v } if (rep && typeof rep === "object") { length = rep.length; for (i = 0; i < length; i += 1) { if (typeof rep[i] === "string") { k = rep[i]; v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v) } } } } else { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v) } } } } v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}"; gap = mind; return v } } if (typeof JSON.stringify !== "function") { JSON.stringify = function (value, replacer, space) { var i; gap = ""; indent = ""; if (typeof space === "number") { for (i = 0; i < space; i += 1) { indent += " " } } else { if (typeof space === "string") { indent = space } } rep = replacer; if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) { throw new Error("JSON.stringify") } return str("", { "": value }) } } if (typeof JSON.parse !== "function") { JSON.parse = function (text, reviver) { var j; function walk(holder, key) { var k, v, value = holder[key]; if (value && typeof value === "object") { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v } else { delete value[k] } } } } return reviver.call(holder, key, value) } text = String(text); cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) } if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { j = eval("(" + text + ")"); return typeof reviver === "function" ? walk({ "": j }, "") : j } throw new SyntaxError("JSON.parse") } } }()); (function (a) { var d = {}; d.fileapi = a("<input type='file'/>").get(0).files !== undefined; d.formdata = window.FormData !== undefined; var e = !!a.fn.prop; a.fn.attr2 = function () { if (!e) { return this.attr.apply(this, arguments) } var g = this.prop.apply(this, arguments); if ((g && g.jquery) || typeof g === "string") { return g } return this.attr.apply(this, arguments) }; a.fn.ajaxSubmit = function (B) { if (!this.length) { f("ajaxSubmit: skipping submit process - no element selected"); return this } var v, i, G, g = this; if (typeof B == "function") { B = { success: B } } v = this.attr2("method"); i = this.attr2("action"); G = (typeof i === "string") ? a.trim(i) : ""; G = G || window.location.href || ""; if (G) { G = (G.match(/^([^#]+)/) || [])[1] } B = a.extend(true, { url: G, success: a.ajaxSettings.success, type: v || "GET", iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank" }, B); var H = {}; this.trigger("form-pre-serialize", [this, B, H]); if (H.veto) { f("ajaxSubmit: submit vetoed via form-pre-serialize trigger"); return this } if (B.beforeSerialize && B.beforeSerialize(this, B) === false) { f("ajaxSubmit: submit aborted via beforeSerialize callback"); return this } var F = B.traditional; if (F === undefined) { F = a.ajaxSettings.traditional } var m = []; var D, h = this.formToArray(B.semantic, m); if (B.data) { B.extraData = B.data; D = a.param(B.data, F) } if (B.beforeSubmit && B.beforeSubmit(h, this, B) === false) { f("ajaxSubmit: submit aborted via beforeSubmit callback"); return this } this.trigger("form-submit-validate", [h, this, B, H]); if (H.veto) { f("ajaxSubmit: submit vetoed via form-submit-validate trigger"); return this } var C = a.param(h, F); if (D) { C = (C ? (C + "&" + D) : D) } if (B.type.toUpperCase() == "GET") { B.url += (B.url.indexOf("?") >= 0 ? "&" : "?") + C; B.data = null } else { B.data = C } var j = []; if (B.resetForm) { j.push(function () { g.resetForm() }) } if (B.clearForm) { j.push(function () { g.clearForm(B.includeHidden) }) } if (!B.dataType && B.target) { var A = B.success || function () { }; j.push(function (k) { var q = B.replaceTarget ? "replaceWith" : "html"; a(B.target)[q](k).each(A, arguments) }) } else { if (B.success) { j.push(B.success) } } B.success = function (q, K, L) { var k = B.context || this; for (var I = 0, J = j.length; I < J; I++) { j[I].apply(k, [q, K, L || g, g]) } }; if (B.error) { var z = B.error; B.error = function (J, I, q) { var k = B.context || this; z.apply(k, [J, I, q, g]) } } if (B.complete) { var y = B.complete; B.complete = function (I, q) { var k = B.context || this; y.apply(k, [I, q, g]) } } var o = a('input[type=file]:enabled[value!=""]', this); var s = o.length > 0; var w = "multipart/form-data"; var x = (g.attr("enctype") == w || g.attr("encoding") == w); var n = d.fileapi && d.formdata; f("fileAPI :" + n); var E = (s || x) && !n; var t; if (B.iframe !== false && (B.iframe || E)) { if (B.closeKeepAlive) { a.get(B.closeKeepAlive, function () { t = p(h) }) } else { t = p(h) } } else { if ((s || x) && n) { t = r(h) } else { t = a.ajax(B) } } g.removeData("jqxhr").data("jqxhr", t); for (var u = 0; u < m.length; u++) { m[u] = null } this.trigger("form-submit-notify", [this, B]); return this; function l(k) { var L = a.param(k).split("&"); var I = L.length; var K = []; var q, J; for (q = 0; q < I; q++) { L[q] = L[q].replace(/\+/g, " "); J = L[q].split("="); K.push([decodeURIComponent(J[0]), decodeURIComponent(J[1])]) } return K } function r(k) { var I = new FormData(); for (var J = 0; J < k.length; J++) { I.append(k[J].name, k[J].value) } if (B.extraData) { var L = l(B.extraData); for (J = 0; J < L.length; J++) { if (L[J]) { I.append(L[J][0], L[J][1]) } } } B.data = null; var K = a.extend(true, {}, a.ajaxSettings, B, { contentType: false, processData: false, cache: false, type: v || "POST" }); if (B.uploadProgress) { K.xhr = function () { var M = jQuery.ajaxSettings.xhr(); if (M.upload) { M.upload.addEventListener("progress", function (N) { var O = 0; var P = N.loaded || N.position; var Q = N.total; if (N.lengthComputable) { O = Math.ceil(P / Q * 100) } B.uploadProgress(N, P, Q, O) }, false) } return M } } K.data = null; var q = K.beforeSend; K.beforeSend = function (N, M) { M.data = I; if (q) { q.call(this, N, M) } }; return a.ajax(K) } function p(q) { var T = g[0], S, X, ac, U, Y, k, Z, ai, ae, aa, af, ag; var O = a.Deferred(); if (q) { for (X = 0; X < m.length; X++) { S = a(m[X]); if (e) { S.prop("disabled", false) } else { S.removeAttr("disabled") } } } ac = a.extend(true, {}, a.ajaxSettings, B); ac.context = ac.context || ac; Y = "jqFormIO" + (new Date().getTime()); if (ac.iframeTarget) { k = a(ac.iframeTarget); aa = k.attr2("name"); if (!aa) { k.attr2("name", Y) } else { Y = aa } } else { k = a('<iframe name="' + Y + '" src="' + ac.iframeSrc + '" />'); k.css({ position: "absolute", top: "-1000px", left: "-1000px" }) } Z = k[0]; ai = { aborted: 0, responseText: null, responseXML: null, status: 0, statusText: "n/a", getAllResponseHeaders: function () { }, getResponseHeader: function () { }, setRequestHeader: function () { }, abort: function (al) { var aj = (al === "timeout" ? "timeout" : "aborted"); f("aborting upload... " + aj); this.aborted = 1; try { if (Z.contentWindow.document.execCommand) { Z.contentWindow.document.execCommand("Stop") } } catch (ak) { } k.attr("src", ac.iframeSrc); ai.error = aj; if (ac.error) { ac.error.call(ac.context, ai, aj, al) } if (U) { a.event.trigger("ajaxError", [ai, ac, aj]) } if (ac.complete) { ac.complete.call(ac.context, ai, aj) } } }; U = ac.global; if (U && 0 === a.active++) { a.event.trigger("ajaxStart") } if (U) { a.event.trigger("ajaxSend", [ai, ac]) } if (ac.beforeSend && ac.beforeSend.call(ac.context, ai, ac) === false) { if (ac.global) { a.active-- } O.reject(); return O } if (ai.aborted) { O.reject(); return O } ae = T.clk; if (ae) { aa = ae.name; if (aa && !ae.disabled) { ac.extraData = ac.extraData || {}; ac.extraData[aa] = ae.value; if (ae.type == "image") { ac.extraData[aa + ".x"] = T.clk_x; ac.extraData[aa + ".y"] = T.clk_y } } } var K = 1; var ad = 2; function V(al) { var aj = null; try { if (al.contentWindow) { aj = al.contentWindow.document } } catch (ak) { f("cannot get iframe.contentWindow document: " + ak) } if (aj) { return aj } try { aj = al.contentDocument ? al.contentDocument : al.document } catch (ak) { f("cannot get iframe.contentDocument: " + ak); aj = al.document } return aj } var M = a("meta[name=csrf-token]").attr("content"); var L = a("meta[name=csrf-param]").attr("content"); if (L && M) { ac.extraData = ac.extraData || {}; ac.extraData[L] = M } function R() { var ap = g.attr2("target"), aj = g.attr2("action"); T.setAttribute("target", Y); if (!v) { T.setAttribute("method", "POST") } if (aj != ac.url) { T.setAttribute("action", ac.url) } if (!ac.skipEncodingOverride && (!v || /post/i.test(v))) { g.attr({ encoding: "multipart/form-data", enctype: "multipart/form-data" }) } if (ac.timeout) { ag = setTimeout(function () { af = true; J(K) }, ac.timeout) } function ak() { try { var ar = V(Z).readyState; f("state = " + ar); if (ar && ar.toLowerCase() == "uninitialized") { setTimeout(ak, 50) } } catch (aq) { f("Server abort: ", aq, " (", aq.name, ")"); J(ad); if (ag) { clearTimeout(ag) } ag = undefined } } var am = []; try { if (ac.extraData) { for (var an in ac.extraData) { if (ac.extraData.hasOwnProperty(an)) { if (a.isPlainObject(ac.extraData[an]) && ac.extraData[an].hasOwnProperty("name") && ac.extraData[an].hasOwnProperty("value")) { am.push(a('<input type="hidden" name="' + ac.extraData[an].name + '">').val(ac.extraData[an].value).appendTo(T)[0]) } else { am.push(a('<input type="hidden" name="' + an + '">').val(ac.extraData[an]).appendTo(T)[0]) } } } } if (!ac.iframeTarget) { k.appendTo("body"); if (Z.attachEvent) { Z.attachEvent("onload", J) } else { Z.addEventListener("load", J, false) } } setTimeout(ak, 15); try { T.submit() } catch (al) { var ao = document.createElement("form").submit; ao.apply(T) } } finally { T.setAttribute("action", aj); if (ap) { T.setAttribute("target", ap) } else { g.removeAttr("target") } a(am).remove() } } if (ac.forceSync) { R() } else { setTimeout(R, 10) } var N, P, Q = 50, I; function J(am) { if (ai.aborted || I) { return } P = V(Z); if (!P) { f("cannot access response document"); am = ad } if (am === K && ai) { ai.abort("timeout"); O.reject(ai, "timeout"); return } else { if (am == ad && ai) { ai.abort("server abort"); O.reject(ai, "error", "server abort"); return } } if (!P || P.location.href == ac.iframeSrc) { if (!af) { return } } if (Z.detachEvent) { Z.detachEvent("onload", J) } else { Z.removeEventListener("load", J, false) } var at = "success", ao; try { if (af) { throw "timeout" } var ap = ac.dataType == "xml" || P.XMLDocument || a.isXMLDoc(P); f("isXml=" + ap); if (!ap && window.opera && (P.body === null || !P.body.innerHTML)) { if (--Q) { f("requeing onLoad callback, DOM not available"); setTimeout(J, 250); return } } var ak = P.body ? P.body : P.documentElement; ai.responseText = ak ? ak.innerHTML : null; ai.responseXML = P.XMLDocument ? P.XMLDocument : P; if (ap) { ac.dataType = "xml" } ai.getResponseHeader = function (av) { var aw = { "content-type": ac.dataType }; return aw[av] }; if (ak) { ai.status = Number(ak.getAttribute("status")) || ai.status; ai.statusText = ak.getAttribute("statusText") || ai.statusText } var al = (ac.dataType || "").toLowerCase(); var ar = /(json|script|text)/.test(al); if (ar || ac.textarea) { var au = P.getElementsByTagName("textarea")[0]; if (au) { ai.responseText = au.value; ai.status = Number(au.getAttribute("status")) || ai.status; ai.statusText = au.getAttribute("statusText") || ai.statusText } else { if (ar) { var aq = P.getElementsByTagName("pre")[0]; var aj = P.getElementsByTagName("body")[0]; if (aq) { ai.responseText = aq.textContent ? aq.textContent : aq.innerText } else { if (aj) { ai.responseText = aj.textContent ? aj.textContent : aj.innerText } } } } } else { if (al == "xml" && !ai.responseXML && ai.responseText) { ai.responseXML = ah(ai.responseText) } } try { N = W(ai, al, ac) } catch (an) { at = "parsererror"; ai.error = ao = (an || at) } } catch (an) { f("error caught: ", an); at = "error"; ai.error = ao = (an || at) } if (ai.aborted) { f("upload aborted"); at = null } if (ai.status) { at = (ai.status >= 200 && ai.status < 300 || ai.status === 304) ? "success" : "error" } if (at === "success") { if (ac.success) { ac.success.call(ac.context, N, "success", ai) } O.resolve(ai.responseText, "success", ai); if (U) { a.event.trigger("ajaxSuccess", [ai, ac]) } } else { if (at) { if (ao === undefined) { ao = ai.statusText } if (ac.error) { ac.error.call(ac.context, ai, at, ao) } O.reject(ai, "error", ao); if (U) { a.event.trigger("ajaxError", [ai, ac, ao]) } } } if (U) { a.event.trigger("ajaxComplete", [ai, ac]) } if (U && !--a.active) { a.event.trigger("ajaxStop") } if (ac.complete) { ac.complete.call(ac.context, ai, at) } I = true; if (ac.timeout) { clearTimeout(ag) } setTimeout(function () { if (!ac.iframeTarget) { k.remove() } ai.responseXML = null }, 100) } var ah = a.parseXML || function (ak, aj) { if (window.ActiveXObject) { aj = new ActiveXObject("Microsoft.XMLDOM"); aj.async = "false"; aj.loadXML(ak) } else { aj = (new DOMParser()).parseFromString(ak, "text/xml") } return (aj && aj.documentElement && aj.documentElement.nodeName != "parsererror") ? aj : null }; var ab = a.parseJSON || function (aj) { return window["eval"]("(" + aj + ")") }; var W = function (an, am, al) { var aj = an.getResponseHeader("content-type") || "", ao = am === "xml" || !am && aj.indexOf("xml") >= 0, ak = ao ? an.responseXML : an.responseText; if (ao && ak.documentElement.nodeName === "parsererror") { if (a.error) { a.error("parsererror") } } if (al && al.dataFilter) { ak = al.dataFilter(ak, am) } if (typeof ak === "string") { if (am === "json" || !am && aj.indexOf("json") >= 0) { ak = ab(ak) } else { if (am === "script" || !am && aj.indexOf("javascript") >= 0) { a.globalEval(ak) } } } return ak }; return O } }; a.fn.ajaxForm = function (h) { h = h || {}; h.delegation = h.delegation && a.isFunction(a.fn.on); if (!h.delegation && this.length === 0) { var g = { s: this.selector, c: this.context }; if (!a.isReady && g.s) { f("DOM not ready, queuing ajaxForm"); a(function () { a(g.s, g.c).ajaxForm(h) }); return this } f("terminating; zero elements found by selector" + (a.isReady ? "" : " (DOM not ready)")); return this } if (h.delegation) { a(document).off("submit.form-plugin", this.selector, c).off("click.form-plugin", this.selector, b).on("submit.form-plugin", this.selector, h, c).on("click.form-plugin", this.selector, h, b); return this } return this.ajaxFormUnbind().bind("submit.form-plugin", h, c).bind("click.form-plugin", h, b) }; function c(g) { var h = g.data; if (!g.isDefaultPrevented()) { g.preventDefault(); a(this).ajaxSubmit(h) } } function b(h) { var l = h.target; var g = a(l); if (!(g.is("[type=submit],[type=image]"))) { var k = g.closest("[type=submit]"); if (k.length === 0) { return } l = k[0] } var i = this; i.clk = l; if (l.type == "image") { if (h.offsetX !== undefined) { i.clk_x = h.offsetX; i.clk_y = h.offsetY } else { if (typeof a.fn.offset == "function") { var j = g.offset(); i.clk_x = h.pageX - j.left; i.clk_y = h.pageY - j.top } else { i.clk_x = h.pageX - l.offsetLeft; i.clk_y = h.pageY - l.offsetTop } } } setTimeout(function () { i.clk = i.clk_x = i.clk_y = null }, 100) } a.fn.ajaxFormUnbind = function () { return this.unbind("submit.form-plugin click.form-plugin") }; a.fn.formToArray = function (x, l) { var h = []; if (this.length === 0) { return h } var p = this[0]; var m = x ? p.getElementsByTagName("*") : p.elements; if (!m) { return h } var q, s, w, y, k, u, t; for (q = 0, u = m.length; q < u; q++) { k = m[q]; w = k.name; if (!w || k.disabled) { continue } if (x && p.clk && k.type == "image") { if (p.clk == k) { h.push({ name: w, value: a(k).val(), type: k.type }); h.push({ name: w + ".x", value: p.clk_x }, { name: w + ".y", value: p.clk_y }) } continue } y = a.fieldValue(k, true); if (y && y.constructor == Array) { if (l) { l.push(k) } for (s = 0, t = y.length; s < t; s++) { h.push({ name: w, value: y[s] }) } } else { if (d.fileapi && k.type == "file") { if (l) { l.push(k) } var o = k.files; if (o.length) { for (s = 0; s < o.length; s++) { h.push({ name: w, value: o[s], type: k.type }) } } else { h.push({ name: w, value: "", type: k.type }) } } else { if (y !== null && typeof y != "undefined") { if (l) { l.push(k) } h.push({ name: w, value: y, type: k.type, required: k.required }) } } } } if (!x && p.clk) { var g = a(p.clk), r = g[0]; w = r.name; if (w && !r.disabled && r.type == "image") { h.push({ name: w, value: g.val() }); h.push({ name: w + ".x", value: p.clk_x }, { name: w + ".y", value: p.clk_y }) } } return h }; a.fn.formSerialize = function (g) { return a.param(this.formToArray(g)) }; a.fn.fieldSerialize = function (h) { var g = []; this.each(function () { var l = this.name; if (!l) { return } var m = a.fieldValue(this, h); if (m && m.constructor == Array) { for (var j = 0, k = m.length; j < k; j++) { g.push({ name: l, value: m[j] }) } } else { if (m !== null && typeof m != "undefined") { g.push({ name: this.name, value: m }) } } }); return a.param(g) }; a.fn.fieldValue = function (k) { for (var m = [], h = 0, j = this.length; h < j; h++) { var g = this[h]; var l = a.fieldValue(g, k); if (l === null || typeof l == "undefined" || (l.constructor == Array && !l.length)) { continue } if (l.constructor == Array) { a.merge(m, l) } else { m.push(l) } } return m }; a.fieldValue = function (h, r) { var m = h.name, s = h.type, u = h.tagName.toLowerCase(); if (r === undefined) { r = true } if (r && (!m || h.disabled || s == "reset" || s == "button" || (s == "checkbox" || s == "radio") && !h.checked || (s == "submit" || s == "image") && h.form && h.form.clk != h || u == "select" && h.selectedIndex == -1)) { return null } if (u == "select") { var k = h.selectedIndex; if (k < 0) { return null } var g = [], q = h.options; var o = (s == "select-one"); var l = (o ? k + 1 : q.length); for (var j = (o ? k : 0); j < l; j++) { var p = q[j]; if (p.selected) { var w = p.value; if (!w) { w = (p.attributes && p.attributes.value && !(p.attributes.value.specified)) ? p.text : p.value } if (o) { return w } g.push(w) } } return g } return a(h).val() }; a.fn.clearForm = function (g) { return this.each(function () { a("input,select,textarea", this).clearFields(g) }) }; a.fn.clearFields = a.fn.clearInputs = function (g) { var h = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; return this.each(function () { var i = this.type, j = this.tagName.toLowerCase(); if (h.test(i) || j == "textarea") { this.value = "" } else { if (i == "checkbox" || i == "radio") { this.checked = false } else { if (j == "select") { this.selectedIndex = -1 } else { if (i == "file") { if (/MSIE/.test(navigator.userAgent)) { a(this).replaceWith(a(this).clone(true)) } else { a(this).val("") } } else { if (g) { if ((g === true && /hidden/.test(i)) || (typeof g == "string" && a(this).is(g))) { this.value = "" } } } } } } }) }; a.fn.resetForm = function () { return this.each(function () { if (typeof this.reset == "function" || (typeof this.reset == "object" && !this.reset.nodeType)) { this.reset() } }) }; a.fn.enable = function (g) { if (g === undefined) { g = true } return this.each(function () { this.disabled = !g }) }; a.fn.selected = function (g) { if (g === undefined) { g = true } return this.each(function () { var i = this.type; if (i == "checkbox" || i == "radio") { this.checked = g } else { if (this.tagName.toLowerCase() == "option") { var h = a(this).parent("select"); if (g && h[0] && h[0].type == "select-one") { h.find("option").selected(false) } this.selected = g } } }) }; a.fn.ajaxSubmit.debug = false; function f() { if (!a.fn.ajaxSubmit.debug) { return } var g = "[jquery.form] " + Array.prototype.join.call(arguments, ""); if (window.console && window.console.log) { window.console.log(g) } else { if (window.opera && window.opera.postError) { window.opera.postError(g) } } } })($); !function () { function a(a, b, c) { "addEventListener" in window ? a.addEventListener(b, c, !1) : "attachEvent" in window && a.attachEvent("on" + b, c) } function b() { var a, b = ["moz", "webkit", "o", "ms"]; for (a = 0; a < b.length && !w; a += 1) { w = window[b[a] + "RequestAnimationFrame"] } w || c(" RequestAnimationFrame not supported") } function c(a) { y.log && "object" == typeof console && console.log(s + "[Host page" + u + "]" + a) } function d(a) { function b() { function a() { h(z), f(), y.resizedCallback(z) } i(a, z, "resetPage") } function d(a) { var b = a.id; c(" Removing iFrame: " + b), a.parentNode.removeChild(a), y.closedCallback(b), c(" --") } function e() { var a = x.substr(t).split(":"); return { iframe: document.getElementById(a[0]), id: a[0], height: a[1], width: a[2], type: a[3] } } function j(a) { var b = Number(y["max" + a]), d = Number(y["min" + a]), e = a.toLowerCase(), f = Number(z[e]); if (d > b) { throw new Error("Value for min" + a + " can not be greater than max" + a) } c(" Checking " + e + " is in range " + d + "-" + b), d > f && (f = d, c(" Set " + e + " to min value")), f > b && (f = b, c(" Set " + e + " to max value")), z[e] = "" + f } function k() { var b = a.origin, d = z.iframe.src.split("/").slice(0, 3).join("/"); if (y.checkOrigin && (c(" Checking connection is from: " + d), "" + b != "null" && b !== d)) { throw new Error("Unexpected message received from: " + b + " for " + z.iframe.id + ". Message was: " + a.data + ". This error can be disabled by adding the checkOrigin: false option.") } return !0 } function l() { return s === ("" + x).substr(0, t) } function m() { var a = z.type in { "true": 1, "false": 1 }; return a && c(" Ignoring init message from meta parent page"), a } function n() { var a = x.substr(x.indexOf(":") + r + 6); c(" MessageCallback passed: {iframe: " + z.iframe.id + ", message: " + a + "}"), y.messageCallback({ iframe: z.iframe, message: a }), c(" --") } function o() { if (null === z.iframe) { throw new Error("iFrame (" + z.id + ") does not exist on " + u) } return !0 } function q() { c(" Reposition requested from iFrame"), v = { x: z.width, y: z.height }, f() } function w() { switch (z.type) { case "close": d(z.iframe), y.resizedCallback(z); break; case "message": n(); break; case "scrollTo": q(); break; case "reset": g(z); break; case "init": b(), y.initCallback(z.iframe); break; default: b() } } var x = a.data, z = {}; l() && (c(" Received: " + x), z = e(), j("Height"), j("Width"), !m() && o() && k() && (w(), p = !1)) } function e() { null === v && (v = { x: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, y: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop }, c(" Get position: " + v.x + "," + v.y)) } function f() { null !== v && (window.scrollTo(v.x, v.y), c(" Set position: " + v.x + "," + v.y), v = null) } function g(a) { function b() { h(a), j("reset", "reset", a.iframe) } c(" Size reset requested by " + ("init" === a.type ? "host page" : "iFrame")), e(), i(b, a, "init") } function h(a) { function b(b) { a.iframe.style[b] = a[b] + "px", c(" IFrame (" + a.iframe.id + ") " + b + " set to " + a[b] + "px") } y.sizeHeight && b("height"), y.sizeWidth && b("width") } function i(a, b, d) { d !== b.type && w ? (c(" Requesting animation frame"), w(a)) : a() } function j(a, b, d) { c("[" + a + "] Sending msg to iframe (" + b + ")"), d.contentWindow.postMessage(s + b, "*") } function k() { function b() { function a(a) { 1 / 0 !== y[a] && 0 !== y[a] && (k.style[a] = y[a] + "px", c(" Set " + a + " = " + y[a] + "px")) } a("maxHeight"), a("minHeight"), a("maxWidth"), a("minWidth") } function d(a) { return "" === a && (k.id = a = "iFrameResizer" + o++ , c(" Added missing iframe ID: " + a + " (" + k.src + ")")), a } function e() { c(" IFrame scrolling " + (y.scrolling ? "enabled" : "disabled") + " for " + l), k.style.overflow = !1 === y.scrolling ? "hidden" : "auto", k.scrolling = !1 === y.scrolling ? "no" : "yes" } function f() { ("number" == typeof y.bodyMargin || "0" === y.bodyMargin) && (y.bodyMarginV1 = y.bodyMargin, y.bodyMargin = "" + y.bodyMargin + "px") } function h() { return l + ":" + y.bodyMarginV1 + ":" + y.sizeWidth + ":" + y.log + ":" + y.interval + ":" + y.enablePublicMethods + ":" + y.autoResize + ":" + y.bodyMargin + ":" + y.heightCalculationMethod + ":" + y.bodyBackground + ":" + y.bodyPadding + ":" + y.tolerance } function i(b) { a(k, "load", function () { var a = p; j("iFrame.onload", b, k), !a && y.heightCalculationMethod in x && g({ iframe: k, height: 0, width: 0, type: "init" }) }), j("init", b, k) } var k = this, l = d(k.id); e(), b(), f(), i(h()) } function l(a) { if ("object" != typeof a) { throw new TypeError("Options is not an object.") } } function m() { function a(a) { if ("IFRAME" !== a.tagName.toUpperCase()) { throw new TypeError("Expected <IFRAME> tag, found <" + a.tagName + ">.") } k.call(a) } function b(a) { a = a || {}, l(a); for (var b in z) { z.hasOwnProperty(b) && (y[b] = a.hasOwnProperty(b) ? a[b] : z[b]) } } return function (c, d) { b(c), Array.prototype.forEach.call(document.querySelectorAll(d || "iframe"), a) } } function n(a) { a.fn.iFrameResize = function (b) { return l(b), y = a.extend({}, z, b), this.filter("iframe").each(k).end() } } var o = 0, p = !0, q = "message", r = q.length, s = "[iFrameSizer]", t = s.length, u = "", v = null, w = window.requestAnimationFrame, x = { max: 1, scroll: 1, bodyScroll: 1, documentElementScroll: 1 }, y = {}, z = { autoResize: !0, bodyBackground: null, bodyMargin: null, bodyMarginV1: 8, bodyPadding: null, checkOrigin: !0, enablePublicMethods: !1, heightCalculationMethod: "offset", interval: 32, log: !1, maxHeight: 1 / 0, maxWidth: 1 / 0, minHeight: 0, minWidth: 0, scrolling: !1, sizeHeight: !0, sizeWidth: !1, tolerance: 0, closedCallback: function () { }, initCallback: function () { }, messageCallback: function () { }, resizedCallback: function () { } }; b(), a(window, "message", d), "jQuery" in window && n(jQuery), "function" == typeof define && define.amd ? define(function () { return m() }) : window.iFrameResize = m() }() }) } })();

Back to list