Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toggleTableBoxes() {
- var n = $("table.grid :checkbox");
- $(this).is(":checked") ? (n.next().addClass("on"), n.prop("checked", !0)) : (n.next().removeClass("on"), n.prop("checked", !1));
- n.first().trigger("change")
- }
- function emptyImage(n, t) {
- var i = $(n);
- i.attr("src", containerPrefix + "/content/images/1.gif");
- i.css("border", "1px solid #ccc");
- t && t.length > 0 ? i.height(t) : i.css("width", "158px")
- }
- function enableAjaxSorting() {
- constrainCheckboxWidth();
- $('table.grid[paginationUrl][paginationAjax="true"]').each(function() {
- var n = $(this),
- i = n.attr("paginationUrl"),
- t = n.attr("paginationContainer");
- $("th a", n).each(function() {
- var u = $(this),
- o = u.attr("href"),
- r = $.deparam.querystring(o),
- f, e;
- !r.sort || (u.attr("href", "javascript:void(0);"), f = {
- sort: r.sort
- }, !r.sort || (f.sortdir = r.sortdir), e = $.param.querystring(i, f), u.click(function() {
- $.get(e, function(i) {
- if (!t) {
- var r = $(n).parent();
- $(n).replaceWith(i);
- r.trigger("onsort")
- } else $(t).html(i).trigger("onsort");
- enableAjaxSorting();
- enablePagination();
- initInfoHovers()
- }).error(function() {
- showErrorMessage(null, wr.G_Error)
- })
- }))
- })
- })
- }
- function enablePagination() {
- constrainCheckboxWidth();
- $("table.grid:not([alreadypaginated])").each(function() {
- var n = $(this),
- r = n.attr("paginationTotalPages"),
- u = n.attr("paginationCurrentPage"),
- i = n.attr("paginationUrl"),
- t = !r ? 0 : parseInt(r),
- f, e = $.trim($("tfoot", n).text()),
- c, o, s, h;
- e.length > 1 && (r == null && (t = 0, $("tfoot a", n).each(function() {
- var s = $(this),
- u = s.attr("href"),
- e = u.lastIndexOf("page="),
- o = parseInt(u.substring(e + 5)),
- r, f;
- t = t > o ? t : o;
- i == null ? (i = u.substring(0, e), n.attr("paginationUrl", i)) : i.indexOf("sort=") < 0 && (r = $.deparam.querystring(u), !r.sort || (f = {
- sort: r.sort
- }, !r.sort || (f.sortdir = r.sortdir), i = $.param.querystring(i, f), n.attr("paginationUrl", i)))
- })), u == null && (c = e.indexOf("<"), o = e.indexOf(">", c), o = o == -1 ? e.length : o, u = $.trim(e.substring(c + 1, o)), n.attr("paginationCurrentPage", u)), f = parseInt(u), t = f < t ? t : f, r = t.toString(), s = $("#pagHolder").children().first().clone(), s.attr("id", "pagCont"), $("tfoot tr:not(.empty) td", n).empty().append(s), h = $("#pagBox", n), h.val(u), h.focusout(gridPaginate), h.keypress(new onEnterPressExecute(gridPaginate).eventHandler), $("#totalPag", n).text(r), $("#pagCont a", n).click(function() {
- var t = $("#pagBox", n),
- i = $(this).attr("increment");
- t.val((parseInt(n.attr("paginationCurrentPage")) + parseInt(i)).toString());
- gridPaginate.call(t)
- }), f == t ? $("#pagNext", n).hide() : f == 1 && $("#pagPrev", n).hide(), t > 1 && s.show(), n.attr("alreadypaginated", "true"))
- })
- }
- function gridPaginate() {
- var u = $(this),
- r = u.val(),
- t = $(this).parents("table.grid"),
- f = t.parent(),
- e = t.attr("paginationAjax"),
- o = t.attr("paginationUrl"),
- s = t.attr("paginationCurrentPage"),
- i = t.attr("paginationContainer"),
- n;
- r != s && (showActivityIndicator(!0), n = o, n[n.length - 1] != "&" && (n = n + "&"), n = n + "page=" + r, e ? $.get(n, function(n) {
- i ? $(i).html(n) : t.replaceWith(n);
- enablePagination();
- initInfoHovers();
- enableAjaxSorting();
- showActivityIndicator(!1);
- scrollToTop();
- i ? $(i).parent().animate({
- scrollTop: 0
- }, "fast") : f.animate({
- scrollTop: 0
- }, "fast")
- }) : window.location.href = n)
- }
- function validatorSetup() {
- function n(n, t) {
- for (var r, u, e, f = [], i = 2; i < arguments.length; i++) f[i - 2] = arguments[i];
- r = $.trim(n).split("\n");
- for (u in r)
- if ($.trim(r[u]).length > 0 && (e = $.validator.methods.url.call(this, r[u], t, f), !e)) return !1;
- return !0
- }
- function t(n, t) {
- for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
- return isValueSameAsPalceHolder(n, t) ? !1 : $.validator.methods.required.call(this, n, t, r)
- }
- function i(n, t) {
- for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
- return isValueSameAsPalceHolder(n, t) ? !0 : $.validator.methods.url.call(this, n, t, r)
- }
- function r(n, t) {
- for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
- return isValueSameAsPalceHolder(n, t) ? !0 : $.validator.methods.email.call(this, n, t, r)
- }
- function f(n, t) {
- for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
- return isValueSameAsPalceHolder(n, t) ? !0 : u.test($.trim(n))
- }
- var u = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
- $.validator.addMethod("urlListValidation", n);
- $.validator.addMethod("requiredNoWatermark", t, $.validator.messages.required);
- $.validator.addMethod("urlNoWatermark", i, $.validator.messages.url);
- $.validator.addMethod("emailNoWatermark", r, $.validator.messages.email);
- $.validator.addMethod("elementWithZeroOrEmptyValue", function(n) {
- return !(n == "" || n == "0")
- });
- $.validator.addMethod("ipNoWatermark", f, $.validator.messages.ip);
- $.validator.addClassRules({
- wmMaxLength60: {
- maxlength: 60
- },
- wmMaxLength500: {
- maxlength: 500
- },
- wmMaxLength100: {
- maxlength: 100
- },
- wmRequired: {
- requiredNoWatermark: !0
- },
- wmUrl: {
- urlNoWatermark: !0
- },
- wmEmail: {
- emailNoWatermark: !0
- },
- urlValidation: {
- requiredNoWatermark: !0,
- urlNoWatermark: !0
- },
- emailValidation: {
- requiredNoWatermark: !0,
- emailNoWatermark: !0
- },
- urlListValidation: {
- requiredNoWatermark: !0,
- urlListValidation: !0,
- minlength: 10
- },
- requiredIfValueZeroOrEmpty: {
- elementWithZeroOrEmptyValue: !0
- },
- wmIp: {
- ipNoWatermark: !0
- }
- })
- }
- function validationErrorPlacement(n, t) {
- var i = t.attr("id");
- i !== undefined && $('.validationErrorPlaceholder[for~="' + i + '"]').html(n)
- }
- function onEnterPressExecute(n, t, i) {
- var r = function(r) {
- t != null && i != null && ($.trim($(this).val()) == "" ? t.removeClass(i) : t.addClass(i));
- r.which == 13 && n.call(this)
- };
- this.eventHandler = r
- }
- function clickButtonOnEnter(n, t) {
- var r = $(n),
- u = function() {
- r.click()
- },
- f, i;
- if (t.constructor.toString().indexOf("Array") == -1) i = $(t), i.keyup(new onEnterPressExecute(u, r, "orangeBorder").eventHandler);
- else
- for (f in t) i = $(t[f]), $(i).keyup(new onEnterPressExecute(u, r, "orangeBorder").eventHandler)
- }
- function getCheckedItemsInTable(n) {
- var t = [];
- return $("table.grid :checked").each(function() {
- var i = $(this);
- t.push(i.attr(n))
- }), t
- }
- function enableHintText() {
- hasPlaceholderSupport() || $("input[placeholder], textarea[placeholder]").each(function() {
- var n = $(this);
- n.Watermark(n.attr("placeholder"))
- })
- }
- function isValueSameAsPalceHolder(n, t) {
- return hasPlaceholderSupport() ? !1 : $(t).attr("placeholder") == undefined ? !1 : n == $(t).attr("placeholder")
- }
- function enableAutofocus() {
- hasAutofocusSupport() || $("input[autofocus], textarea[autofocus]").each(function() {
- var n = $(this);
- n.focus()
- })
- }
- function hasAutofocusSupport() {
- var n = document.createElement("input");
- return "autofocus" in n
- }
- function triggerCheckboxChange() {
- var n = $("table.grid :checkbox");
- n.first().trigger("change");
- constrainCheckboxWidth()
- }
- function setupGridCheckButtonEnabler(n, t) {
- var i = function() {
- var i = $("input[type=checkbox]", n),
- r = i.length,
- u = i.filter(":checked").length,
- e = u > 0,
- f;
- e ? $(t).removeAttr("disabled") : $(t).attr("disabled", "disabled");
- f = r - u > 0 || r == 0;
- f ? ($("#toggleAll").removeAttr("checked"), $("#toggleAllL").removeClass("on")) : ($("#toggleAll").attr("checked", "checked"), $("#toggleAllL").addClass("on"))
- };
- return $(n).bind("update", i), i
- }
- function setupGridCheckboxChangeEnalber(n, t) {
- var i = function() {
- var i = $("input[value=false]:checked", n).length > 0 || $("input[value=true]:not(input:checked)", n).length > 0;
- i ? $(t).removeAttr("disabled") : $(t).attr("disabled", "disabled");
- $("tbody tr", n).each(function() {
- $(this).removeClass("row-selected")
- });
- $("input[value=false]:checked", n).each(function() {
- $(this).closest("tr").addClass("row-selected")
- });
- $("input[value=true]:not(input:checked)", n).each(function() {
- $(this).closest("tr").addClass("row-selected")
- })
- };
- return $(n).bind("update", i), i
- }
- function setupGridCheckButtonEnablerDisableFor2OrMore(n, t) {
- var i = function() {
- var i = $("input:checked", n).length == 1;
- i ? $(t).removeAttr("disabled") : $(t).attr("disabled", "disabled")
- };
- return $(n).bind("update", i), i
- }
- function turnOnCheckboxes() {
- $(document).on("click", "input[type='checkbox'] + label, input[type='checkbox'] + label + label", function() {
- var n = $(this),
- t = n.prev("input[type=checkbox]");
- (t.length == 0 && (n = n.prev("label"), t = n.prev("input[type=checkbox]")), t.attr("readonly")) || (n.toggleClass("on"), n.attr("for") || (t.prop("checked", n.hasClass("on")), t.trigger("change")))
- });
- constrainCheckboxWidth()
- }
- function constrainCheckboxWidth() {
- $("table.grid td input[type='checkbox'] + label").first().parent().addClass("width20")
- }
- function initTreeView() {
- var n = $("#site-nav-minor");
- $("li[expand] > button.tree-toggle-button.collapsed", n).each(function() {
- $(this).click()
- })
- }
- function calcPercentageChange(n, t) {
- return t == 0 ? 0 : Math.round((n / t - 1) * 100)
- }
- function reportError(n, t) {
- if (t != "abort" && t != "No Transport" && (n.status != 0 || n.readyState != 0)) {
- var i = null;
- n.Message != null && (i = n.Message);
- showErrorMessage(i, wr.G_Error)
- }
- }
- function unsetModalAndReportErrorHandler(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function setupDeveloperConsole() {
- window.console || (console = {}, console.log = console.log || function() {}, console.warn = console.warn || function() {}, console.error = console.error || function() {}, console.info = console.info || function() {})
- }
- function handleAjaxError(n, t, i) {
- if (n.readyState == 4) {
- if (n.responseText) {
- var r;
- try {
- r = JSON.parse(n.responseText)
- } catch (u) {
- r = n.responseText
- }
- r ? t(r) : t({
- Message: null
- })
- }
- } else n.statusText == "timeout" && (i != null ? i() : showErrorMessage(wr.G_TimeoutError, wr.G_TimeoutErrorTitle))
- }
- function $id(n) {
- return $(document.getElementById(n))
- }
- function showActivityIndicator(n) {
- n != null && n && (activityIndicatorModal = !0);
- activityIndicatorInitialized || activityIndicatorModal && $("#activityIndicator").jqm({
- overlay: 20,
- modal: !0,
- overlayClass: "jqmLoadingOverlay"
- });
- activityIndicatorModal ? $("#activityIndicator").jqmShow() : $("#activityIndicator").show()
- }
- function hideActivityIndicator() {
- activityIndicatorModal ? $("#activityIndicator").jqmHide() : $("#activityIndicator").hide()
- }
- function unsetModalActivityIndicator() {
- activityIndicatorModal = !1
- }
- function showHtmlMessage(n, t) {
- n != null && t != null && ($("#dgExErrorTitle").text(t), $("#dgExErrorMessage").html(n), $("#dgExError").jqm({
- overlay: 5,
- modal: !0
- }), $("#dgExError").jqmShow())
- }
- function showErrorMessageMarkUpBusy() {
- $("#dgExErrorMessage").text(wr.G_Throttling);
- $("#dgExErrorTitle").text(wr.G_UnknownError);
- $("#dgExError").jqm({
- overlay: 5,
- modal: !0
- });
- $("#dgExError").jqmShow()
- }
- function closeMessage() {
- $("#dgExError").jqmHide()
- }
- function showErrorMessage(n, t, i) {
- $("#dgExErrorMessage").empty();
- t != null ? $("#dgExErrorTitle").text(t) : $("#dgExErrorTitle").text(wr.G_UnknownError);
- n != null ? i ? $("#dgExErrorMessage").html(n) : $("#dgExErrorMessage").text(n) : $("#dgExErrorMessage").text(wr.G_UnkownErrorDetails);
- $("#dgExError").jqm({
- overlay: 5,
- modal: !0
- });
- $("#dgExError").jqmShow()
- }
- function genKpiMarkup(n, t, i) {
- if (n == null) return wr.G_NotAvailable;
- if (t == null) return r = $.validator.format('<img src="{0}/content/images/arrowunknown.png"><\/img>', containerPrefix), $.validator.format(kpiFormat, "0", r);
- var u = calcPercentageChange(n[i], t[i]),
- r = "";
- return r = u > 0 ? $.validator.format('<img src="{0}/content/images/arrowincreasing.png"><\/img>', containerPrefix) : u < 0 ? $.validator.format('<img src="{0}/content/images/arrowdecreasing.png"><\/img>', containerPrefix) : $.validator.format('<img src="{0}/content/images/arrowunknown.png"><\/img>', containerPrefix), $.validator.format(kpiFormat, u.toString(), r)
- }
- function setupKpi(n, t) {
- n.html(t)
- }
- function swapQueryString(n, t, i) {
- var r = $.deparam.querystring(n);
- return r[t] = i, $.param.querystring(n, r)
- }
- function appendUrlParameter(n, t, i) {
- return n == null || n.length == 0 ? n : n.indexOf("?") > -1 ? $.validator.format("{0}&{1}={2}", n, t, i) : $.validator.format("{0}?{1}={2}", n, t, i)
- }
- function showSparklines(n) {
- n || (n = "60px");
- $(".sparkline:not(.sparkline-drawn)").show().sparkline("html", {
- width: n,
- fillColor: ""
- }).addClass("sparkline-drawn")
- }
- function disableFormSubmit() {
- $("form.disable-submit").submit(function() {
- return !1
- })
- }
- function showPopupModalDialog(n, t, i) {
- $(n).remove();
- var r = $(t);
- r.hide();
- $("body").append(r);
- enablePagination();
- $(n).jqm($.extend({
- overlay: 10,
- modal: !0
- }, i || {})).jqmShow()
- }
- function autoSelect(n) {
- var t, i, r;
- n != null && (n.childNodes.length == 1 && n.childNodes[0].nodeName == "#text" || n.tagName == "INPUT" && n.type == "text") && (n.tagName == "TEXTAREA" || n.tagName == "INPUT" && n.type == "text" ? n.select() : window.getSelection ? (t = window.getSelection(), i = document.createRange(), i.selectNode(n.firstChild), t.removeAllRanges(), t.addRange(i)) : (document.selection.empty(), r = document.body.createTextRange(), r.moveToElementText(n), r.select()))
- }
- function initInfoHovers() {
- $("img.info-pop-up:not([done])").each(function() {
- var t = $(this),
- n = t.next();
- t.mouseover(function() {
- var i, e;
- $("img.info-pop-up").next().hide();
- i = isRTL;
- isRTL ? t.offset().left - n.width() - 20 < 0 && (i = !i) : t.offset().left + n.width() + 20 > $(window).width() && (i = !i);
- n.removeClass("flipped");
- $("img[flipped]", n).each(function() {
- var n = $(this);
- n.attr("src", n.attr("src").replace("-fli.png", ".png")).removeAttr("flipped")
- });
- i && (n.addClass("flipped"), $("img:not([flipped])", n).each(function() {
- var n = $(this);
- n.attr("src", n.attr("src").replace(".png", "-fli.png")).attr("flipped", "y")
- }));
- var r = t.offsetParent(),
- u = t.position(),
- f = u.left + (i ? -n.width() + 12 : -15) + r.scrollLeft() - (isRTL ? 18 : 0),
- o = u.top - 12 + r.scrollTop();
- t.offset().top + n.height() > $(window).height() - 20 ? (e = u.top + r.scrollTop() - n.height(), e > 10 ? (f = f + (i ? -35 : 25), o = e, n.find(".box-caption-bottom").show(), n.find(".box-caption").hide()) : (n.find(".box-caption-bottom").hide(), n.find(".box-caption").show())) : (n.find(".box-caption-bottom").hide(), n.find(".box-caption").show());
- n.css({
- top: o,
- left: f
- }).show()
- });
- n.mouseleave(function() {
- n.hide()
- });
- t.attr("done", "done")
- })
- }
- function cancelEvent(n) {
- n.stopPropagation()
- }
- function initHeader() {
- $("#account-name").click(function(n) {
- n.stopPropagation();
- var i = $(this).width(),
- t = $("#signoutHover");
- t.width(i);
- t.toggle()
- });
- $("body").click(function() {
- $("#signoutHover").hide()
- })
- }
- function getCalendarName(n) {
- var t = {
- GregorianCalendar: "gregorian",
- UmAlQuraCalendar: "islamic",
- HijriCalendar: "islamic",
- ThaiBuddhistCalendar: "thai"
- };
- return t[n] ? t[n] : "gregorian"
- }
- function initCalendars() {
- var r = getCalendarName(window.calendarName),
- t = calendar.ShortDatePattern,
- n, i;
- t = t.replace(/M/g, "m");
- n = "local";
- $.calendars.picker.regional[n] = {
- renderer: $.calendars.picker.defaultRenderer,
- prevText: "",
- prevStatus: wr.G_Prev,
- prevJumpText: "",
- prevJumpStatus: "",
- nextText: "",
- nextStatus: wr.G_Next,
- nextJumpText: "",
- nextJumpStatus: "",
- currentText: "",
- currentStatus: "",
- todayText: "",
- todayStatus: "",
- clearText: "",
- clearStatus: "",
- closeText: "",
- closeStatus: "",
- yearStatus: "",
- monthStatus: "",
- weekText: "",
- weekStatus: "",
- dayStatus: "",
- defaultStatus: "",
- isRTL: calendar.IsRightToLeft
- };
- $.calendars.picker.setDefaults($.calendars.picker.regional[n]);
- $.calendars.calendars[r].prototype.regional[n] = {
- epochs: ["BCE", "CE"],
- monthNames: calendar.MonthNames,
- monthNamesShort: calendar.AbbreviatedMonthGenitiveNames,
- dayNames: calendar.DayNames,
- dayNamesShort: calendar.AbbreviatedDayNames,
- dayNamesMin: calendar.ShortestDayNames,
- dateFormat: t,
- firstDay: calendar.FirstDayOfWeek,
- isRTL: calendar.IsRightToLeft
- };
- i = $.calendars.instance(r, n);
- window.calendarObject = i;
- $('.calendar-input input[type="text"]').each(function() {
- var n = $(this).attr("minvalue"),
- t = $(this).attr("maxvalue");
- n == "" && (n = null);
- t == "" && (t = null);
- $(this).calendarsPicker({
- calendar: i,
- onSelect: function(n) {
- $(this).trigger("inputDateChanged", n)
- },
- changeMonth: !1,
- showAnim: "fade",
- showSpeed: "fast",
- minDate: n,
- maxDate: t
- })
- });
- $(".calendar-date-range-picker").calendarRangeSelector({})
- }
- function initEmptyTables() {
- $('table[emptytable]:not([emptytablesetup="true"])').each(function() {
- var o, n, t;
- $(this).attr("emptytablesetup", "true");
- o = $(this).find("thead>tr:first-child th").length;
- n = $(this).children("tfoot");
- n.length == 0 && (n = $("<tfoot/>").appendTo($(this)));
- var i = $(this),
- l = i.attr("emptytable") == "true",
- a = $(this).attr("emptycompact") == "true",
- r = $("<tr />", {
- "class": "empty " + (l ? "" : " none") + (a ? " compact" : "")
- }).appendTo(n),
- s = $("<td />", {
- colspan: o
- }).appendTo(r),
- h = $.trim($(this).attr("emptytitle")),
- c = $.trim($(this).attr("emptybutton")),
- u = $.trim($(this).attr("emptyurl")),
- f = $.trim($(this).attr("emptyfocus")),
- e = $.trim($(this).attr("emptyevent"));
- h.length > 0 && $("<div />").appendTo(s).html(h);
- c.length > 0 && (u.length > 0 || f.length > 0 || e.length > 0) && (t = $("<input />", {
- type: "button",
- value: c,
- disabled: readOnlyMode ? "disabled" : null
- }).appendTo(s), readOnlyMode || (f.length > 0 ? t.click(function() {
- $(f).focus()
- }) : u.length > 0 ? t.click(function() {
- window.location.href = u
- }) : e.length > 0 && t.click(function() {
- i.trigger(e)
- })));
- i.bind("update", function() {
- var n = $(this).find("tbody>tr").length;
- n > 0 ? r.hide() : r.show()
- })
- })
- }
- function loadShared() {
- $.ajaxSetup({
- error: function(n) {
- handleAjaxError(n, reportError)
- }
- });
- $(document).ajaxStart(function() {
- showActivityIndicator()
- }).ajaxStop(function() {
- hideActivityIndicator()
- });
- $("#toggleAll").change(toggleTableBoxes);
- initTreeView();
- validatorSetup();
- turnOnCheckboxes();
- enableHintText();
- enableAutofocus();
- enablePagination();
- enableAjaxSorting();
- showSparklines();
- $.fn.addSite.userProfileFormInit("#profileDialogForm", "#saveProfile");
- disableFormSubmit();
- initInfoHovers();
- initHeader();
- initCalendars();
- initEmptyTables();
- $("input.urlValidation, input.wmUrl").urlInputBox();
- fixIeSelectWidth()
- }
- function textAreaWithLineLimit(n) {
- return function(t) {
- var i = $(this).val().split("\n").length;
- if (t.keyCode == 13 && i >= n) return !1
- }
- }
- function formatNumber(n) {
- return n == 0 ? "0" : $.formatNumber(n, {
- format: formattingNumberFormat,
- locale: locale
- })
- }
- function formatRealNumber(n) {
- return n == 0 ? "0" : $.formatNumber(n, {
- format: formattingRealNumberFormat,
- locale: locale
- })
- }
- function scrollToTop() {
- $("#page-content").animate({
- scrollTop: 0
- }, "fast")
- }
- function fixPlaceholdersBeforeInFormSubmit(n) {
- if (!hasPlaceholderSupport()) {
- var t = n.find("input[placeholder], textarea[placeholder]");
- t.each(function() {
- $(this).attr("placeholder") != undefined && $(this).attr("placeholder") == $(this).val() && $(this).val("")
- })
- }
- }
- function getLocalTimezoneOffset(n) {
- var t = n.getTimezoneOffset();
- return Math.floor(t / 60)
- }
- function formatXaxis(n) {
- var t = new Date(n),
- i = monthDayPattern.replace(/M+/g, function(n) {
- return n.length > 1 ? "M" : "m"
- });
- return calendarObject.formatDate(i, calendarObject.newDate(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate()))
- }
- function getStandartChartOptions() {
- var n, t, i;
- return monthDayPattern = calendar.MonthDayPattern, n = {
- mode: "time",
- minTickSize: [1, "day"],
- monthNames: calendar.AbbreviatedMonthGenitiveNames
- }, monthDayPattern.length > 1 && monthDayPattern.indexOf("MMM") == -1 && (n.tickFormatter = formatXaxis), t = isRTL && $.browser.msie && parseFloat($.browser.version) < 9, i = {
- colors: ["#215dd3", "#009bda", "#339a00", "#ef2a24", "#727272"],
- xaxis: n,
- yaxis: {
- minTickSize: 1,
- tickFormatter: function(n) {
- return formatNumber(n).replace(" ", " ")
- }
- },
- grid: {
- hoverable: !0,
- autoHighlight: !1,
- color: "#949596",
- tickColor: "#eaecee",
- borderWidth: 1
- },
- series: {
- lines: {
- show: !0,
- lineWidth: 2
- },
- points: {
- show: !1,
- radius: 2.5,
- symbol: function(n, t, i, r) {
- n.arc(t, i, r, 0, 2 * Math.PI, !1);
- n.closePath();
- n.fillStyle = "#e66400";
- n.fill();
- n.beginPath()
- }
- },
- shadowSize: 2
- },
- legend: {
- show: !1
- },
- crosshair: {
- mode: t ? "" : "x",
- color: "#f6c5a1"
- },
- webmasterlegend: {
- enabled: !0,
- showPoints: !t
- },
- webmastergrid: {
- show: !0,
- color: "#ffffff",
- lineWidth: 3
- }
- }, i
- }
- function splitChartData(n, t, i) {
- var f, u, e, r;
- for (f in n)
- for (u = n[f], e = u[0] * 1e3, r = 0; r < i; ++r) u[r + 1] !== null && t[r].push([e, u[r + 1]])
- }
- function setupChart(n, t, i, r, u, f, e, o) {
- var a, c = function() {
- var e = 0,
- o = 0,
- v, y, p, s;
- try {
- v = calendarObject.parseDate(calendarObject.local.dateFormat, $(u).val()).toJSDate();
- y = calendarObject.parseDate(calendarObject.local.dateFormat, $(f).val()).toJSDate();
- e = v.getTime();
- o = y.getTime()
- } catch (d) {}
- e > o && (p = o, o = e, e = p);
- var h = null,
- c = null,
- l = 1,
- w = !1,
- b = [{}, {}, {}, {}, {}],
- k = i.filter(":checked");
- k.each(function() {
- var n = parseInt($(this).attr("index")),
- t, u, i, f, s;
- b[n] = {
- data: r[n],
- label: $(this).parent().find("span").text()
- };
- r[n].length > 0 && (h = Math.max(h, r[n][0][0]), c = Math.max(h, r[n][r[n].length - 1][0]));
- for (t in r[n]) t = parseInt(t), u = r[n][t], i = u[0] >= e && u[0] <= o, !i && t + 1 < r[n].length && (f = r[n][t + 1], i = f[0] >= e && f[0] <= o), !i && t > 0 && (s = r[n][t - 1], i = s[0] >= e && s[0] <= o), i && (l = Math.max(l, u[1]), w = !0)
- });
- e < h && (e = h);
- o > c && (o = c);
- s = $.extend({}, t);
- s.xaxis.min = e;
- s.xaxis.max = o;
- s.yaxis.min = 0;
- s.yaxis.max = l * 1.05;
- w ? (n.html(""), a = $.plot(n, b, s)) : n.html($.validator.format('<div class="charts-na"><div>{0}<\/div><\/div>', wr.G_NA))
- },
- s, l, h;
- return c(), s = null, l = function(n) {
- s && clearTimeout(s);
- s = setTimeout(function() {
- s = null;
- c()
- }, n)
- }, $(window).resize(function() {
- l(10)
- }), $(o).click(function() {
- n.html("");
- l(500)
- }), h = null, i.change(function() {
- h && clearTimeout(h);
- h = setTimeout(function() {
- h = null;
- c()
- }, 10)
- }), $(e).bind("dateChanged", function() {
- c()
- }), a
- }
- function fixIeSelectWidth() {
- !$.browser.msie || parseFloat($.browser.version) >= 9 || $(".line-item .half-width select, .line-item .auto-size-width select").bind("focus mouseover", function() {
- $(this).addClass("autowidth").removeClass("clicked");
- $(this).parent().addClass("autosize")
- }).bind("click", function() {
- $(this).toggleClass("clicked")
- }).bind("mouseout", function() {
- $(this).hasClass("clicked") || ($(this).removeClass("autowidth"), $(this).parent().removeClass("autosize"))
- }).bind("blur", function() {
- $(this).removeClass("autowidth clicked");
- $(this).parent().removeClass("autosize")
- })
- }
- function showAdCenterPopup(n, t) {
- showHtmlMessage(n, t)
- }
- function getRequestVerificationToken(n) {
- return $(n).find('input[type="hidden"][name="__RequestVerificationToken"]').val()
- }
- function createExternalUrl(n) {
- return $("<a>", {
- target: "_blank",
- "class": "url-text",
- href: n
- }).text(n).append($("<span>", {
- "class": "trend-icon blink-icon-popup"
- }))
- }
- function startPostRequestWithJson(n, t, i, r, u, f, e) {
- n = $.extend(n, {
- __RequestVerificationToken: getRequestVerificationToken(u)
- });
- var o = $.extend({
- url: t,
- data: n,
- type: "POST",
- success: i,
- error: function(n) {
- if (!r) {
- handleAjaxError(n, reportError, f);
- return
- }
- handleAjaxError(n, r, f);
- return
- }
- }, e || {});
- $.ajax(o)
- }
- function startGetRequestWithJson(n, t, i, r, u, f) {
- $.ajax({
- url: t,
- data: n,
- type: "GET",
- success: i,
- error: function(n) {
- if (!r) {
- handleAjaxError(n, reportError, f);
- return
- }
- handleAjaxError(n, r, f);
- return
- }
- })
- }
- function unCheckAllCheckBoxes(n, t) {
- var i;
- t ? $(t + " :checkbox:checked").each(function() {
- var n = $(this);
- n.attr("checked", !1);
- n.parent().find("label").removeClass("on")
- }) : $("table.wmtable :checkbox:checked").each(function() {
- var n = $(this);
- n.attr("checked", !1);
- n.parent().find("label").removeClass("on")
- });
- n && (i = $(n + ":checked"), i.attr("checked", !1), i.parent().find("label").removeClass("on"));
- triggerCheckboxChange()
- }
- function getGuid() {
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(n) {
- var t = Math.random() * 16 | 0,
- i = n == "x" ? t : t & 3 | 8;
- return i.toString(16)
- })
- }
- function htmlEncodeJQuery(n) {
- return $("<div/>").text(n).html()
- }
- function htmlDecodeJQuery(n) {
- return $("<div/>").html(n).text()
- }
- function selectAllTextAreaContent() {
- var n = $(this);
- n.select();
- n.mouseup(function() {
- return n.unbind("mouseup"), !1
- })
- }
- function generateString(n) {
- for (var t = "abcdefghijklmnopqrstuvwxyz0123456789", i = [], r = 0; r < n; ++r) i.push(t.charAt(Math.floor(Math.random() * t.length)));
- return i.join("")
- }
- function appendParameter(n, t, i) {
- return n + (n.indexOf("?") >= 0 ? "&" : "?") + t + "=" + i
- }
- function createHip(n) {
- var t;
- return t = {
- error: 0,
- left: "10",
- showInstruction: !1,
- showMenu: !0,
- showError: !1,
- instructionsInside: !1,
- inputWidth: 250,
- done: !1,
- holder: "ispHIPHIP",
- scriptHolder: "ispHIPScript",
- count: 0,
- type: "visual",
- cssSet: {
- cssCdHIPMenu: "hip-menu",
- cssCdHIPInput: "hip-input",
- cssCdHIPLink: "hip-link",
- cssCdHIPError: "hip-error",
- cssCdHIPErrorImg: "hip-error-img"
- },
- postLoad: function() {
- var i, r;
- $("input.hip-input").css({
- "border-width": "1px",
- padding: "5px 2px 3px 2px"
- });
- $("input.hip-input").closest("table").css({
- "margin-right": "6px"
- });
- i = $("div.hip-menu div :nth-child(3)");
- $("div.hip-menu div :first-child").text(n.refresh).attr("title", n.refreshTooltip);
- i.length == 1 && (t.type == "audio" ? (i.text(n.visual).attr("title", n.visualTooltip), $(".cssWLSPHIPAudio").attr("title", n.audioTooltip)) : t.type == "visual" && i.text(n.audio).attr("title", n.audioTooltip));
- r = $("#serverCode").val();
- t.error != "0" || r != "0" ? ($("#idError").show(), $("input.hip-input").focus(), $("#serverCode").val("0")) : $("#idError").hide()
- },
- reloadHIP: function() {},
- hipVerify: function(n, i) {
- if (t.clientValidation(), t.error == "0") {
- $("#Solution").val(n);
- $("#Token").val(i);
- $("#Type").val(t.type);
- return
- }
- }
- }
- }
- function testForIE6() {
- var n, t;
- try {
- n = $.browser.msie && parseFloat($.browser.version) < 7;
- n && (t = $.validator.format(wr.Upgrade_Description, ['<a href="', apCfg.WebConfig.DownloadInternetExplorer, '">', wr.Upgrade_Link, "<\/a>"].join("")), showErrorMessage(t, wr.Upgrade_Title, !0))
- } catch (i) {
- console.log(i)
- }
- }
- var formValidateOptions, noCleanValidateOptions, hasPlaceholderSupport, activityIndicatorInitialized, activityIndicatorModal, kpiFormat, formattingNumberFormat, formattingRealNumberFormat, monthDayPattern, StringExtensions, Feedback, Home, Configure, MobileFriendliness, PublicTools;
- (function(n) {
- function i() {
- var i = n("#siteurl").val();
- n("#siteUrlSuggestion").hide();
- t = r(i);
- t != i && (n("#siteUrlSuggestion").html(n.validator.format(wr.AddSite_AddingPageWarning, t, "javascript:void(0);")), n("#siteUrlSuggestion").show())
- }
- function r(n) {
- var t = n.replace(/(.*\/)(([^\/]+.(htm|xml|html|xhtml|shtml|phtml|php|asp|aspx|jsp|cgi|pl|py)([\/?]|$))).*/i, function(n, t) {
- return t
- }),
- i = t.indexOf("?");
- return i >= 0 && (t = t.substring(0, i)), t
- }
- function u(t) {
- console.log("updateEmailOptInStatus private method called");
- n("#communicationsOptIn", t).is(":checked") ? (n("input", t + " .emailFrequencyRadioButtons").removeAttr("disabled"), n("input[name=emailFrequency]", t).is(":checked") == !1 && n("#emailFrequencyWeekly", t).prop("checked", !0)) : n("input", t + " .emailFrequencyRadioButtons").attr("disabled", "disabled")
- }
- var t = "";
- n.fn.addSite = function() {
- n("#offsetHours").val(getLocalTimezoneOffset(new Date));
- n.fn.addSite.userProfileFormInit("#addSiteForm", "#AddSite");
- n("#profileFormFields").length == 1 && n.fn.addSite.populateProfileForm("#addSiteForm");
- n("#siteurl").keyup(i);
- n("#siteUrlSuggestion a").live("click", function() {
- n("#siteUrlSuggestion").hide();
- n("#siteurl").val(t)
- });
- i()
- };
- n.fn.addSite.userProfileFormInit = function(t, i) {
- n(t).validate(formValidateOptions);
- n(i, t).click({
- parentFormId: t
- }, function(t) {
- n.fn.addSite.saveProfileForm(t.data.parentFormId)
- });
- n("#communicationsOptIn", t).click({
- parentFormId: t
- }, function(n) {
- u(n.data.parentFormId)
- })
- };
- n.fn.addSite.showProfileDialog = function() {
- n("#profileDialog").jqm({
- overlay: 10,
- modal: !0
- }).jqmShow();
- n.fn.addSite.populateProfileForm("#profileDialogForm")
- };
- n.fn.addSite.saveProfileForm = function(t) {
- var u, r, s, i, f, e, o, h, c;
- n(t).valid() ? (u = [], n("input[name=alert]:not(:checked)", t).each(function() {
- u.push(n(this).val())
- }), r = n("#siteurl").val(), s = u.join(","), n("input[name=alerts]", t).val(s), i = n(t).attr("action"), r != null && r.length > 0 && (i = appendUrlParameter(i, "url", encodeURIComponent(r))), f = n("#sitemapurl").val(), f != null && f.length > 0 && (i = appendUrlParameter(i, "hasSitemap", "1")), e = n("#sitetraffic").val(), e != null && e != 0 && (i = appendUrlParameter(i, "hasSiteTraffic", "1")), showActivityIndicator(!0), n.post(i, n(t).serialize(), function(i) {
- if (t == "#profileDialogForm") n("#profileDialog").jqmHide();
- else {
- var r = i.IsSiteAlreadyVerified ? "/home/mysites" : "/configure/verify/ownership/?url=" + i.SiteUrl;
- document.location = containerPrefix + r
- }
- showActivityIndicator(!1)
- })) : (o = n("select.error, input.error", t), o.length > 0 && (h = t == "#profileDialogForm" ? ".contentScroll" : "#page-content", c = o.first().offset().top, n(h).animate({
- scrollTop: c
- }, 1e3)))
- };
- n.fn.addSite.populateProfileForm = function(t) {
- n.getJSON(containerPrefix + "/Home/GetUserProfile", function(i) {
- var r, u, f, e;
- n("#sitemapurl", t).val("");
- n("#sitetraffic", t).val("");
- n("#firstName", t).val(i.FirstName);
- n("#lastName", t).val(i.LastName);
- n("#email", t).val(i.Email);
- n("#company", t).val(i.Company);
- n("#contactphone", t).val(i.ContactPhone);
- n("#jobrole", t).val(i.JobRole);
- n("#city", t).val(i.City);
- n("#state", t).val(i.State);
- n("#zip", t).val(i.Zip);
- n("#country", t).val(i.Country);
- n("#companysize", t).val(i.CompanySize);
- n("#industry", t).val(i.Industry);
- n("#isAgency", t).prop("checked", i.IsAgency);
- i.CommunicationsOptIn ? (n("#communicationsOptIn", t).prop("checked", !0), n("input", t + " .emailFrequencyRadioButtons").removeAttr("disabled")) : (n("#communicationsOptIn", t).prop("checked", !1), n("input", t + " .emailFrequencyRadioButtons").attr("disabled", "disabled"));
- n("input[value=" + i.EmailFrequency + "]", t).prop("checked", !0);
- i.Alerts == null && (i.Alerts = "");
- r = i.Alerts.split(",");
- u = n(t + " input[name=alert]");
- u.prop("checked", !0);
- for (f in r) e = u.filter("[value=" + r[f] + "]"), e.prop("checked", !1)
- })
- }
- })(jQuery);
- formValidateOptions = {
- onsubmit: !1,
- onfocusout: !1,
- focusCleanup: !0,
- errorPlacement: validationErrorPlacement
- };
- noCleanValidateOptions = $.extend(!0, {}, formValidateOptions);
- noCleanValidateOptions.focusCleanup = !1;
- hasPlaceholderSupport = function() {
- var n = document.createElement("input"),
- t = "placeholder" in n;
- return function() {
- return t
- }
- }();
- setupDeveloperConsole();
- activityIndicatorInitialized = !1;
- activityIndicatorModal = !1;
- kpiFormat = "<span>{0}<\/span>% {1}";
- formattingNumberFormat = "#,###";
- formattingRealNumberFormat = "#,##0.##";
- monthDayPattern = "";
- $(document).ready(loadShared),
- function(n) {
- n.fn.calendarRangeSelector = function() {
- var t = n(this),
- e = t.find(".calendar-end-date").val(),
- i = t.find(".calendar-preset"),
- r = t.find(".calendar-input-start-date"),
- u = t.find(".calendar-input-end-date"),
- f = function(t) {
- n.cookie("cp", t, {
- expires: 365,
- path: containerPrefix
- })
- },
- o = function(t, i) {
- n.cookie("ccs", t, {
- expires: 1,
- path: containerPrefix
- });
- n.cookie("cce", i, {
- expires: 1,
- path: containerPrefix
- })
- };
- i.change(function() {
- var i = n(this).find("option:selected").attr("period");
- f(i);
- n(this).val() != "" && (r.val(n(this).val()), u.val(e), t.trigger("dateChanged"))
- });
- t.find('.calendar-input input[type="text"]').bind("inputDateChanged", function() {
- i.val() != "" && (i.val(""), f(""));
- o(r.val(), u.val());
- t.trigger("dateChanged")
- })
- }
- }(jQuery),
- function(n) {
- function t(n) {
- return n == null || n.length === 0
- }
- n.isNullOrEmpty = t
- }(StringExtensions || (StringExtensions = {})),
- function(n) {
- var t;
- (function(n) {
- function t(n, t) {
- function s(n, t, r, u, e) {
- $.support.cors = !0;
- $.ajax({
- type: "POST",
- timeout: o,
- url: appendParameter(n, "c", t),
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify({
- i: r,
- t: u,
- o: !1,
- d: e
- }),
- success: function() {
- i.responses[r] = !0;
- f()
- },
- error: function() {
- i.responses[r] = !1;
- f()
- }
- })
- }
- function u(n, u) {
- var e = typeof u == "undefined" ? generateString(8) : u,
- v = typeof i == "undefined" || i.id != e ? 0 : i.retries + 1,
- o = encodeURIComponent(JSON.stringify(n)),
- h = Math.ceil(o.length / r),
- f, c, l, a;
- for (i = {
- id: e,
- payload: n,
- retries: v,
- responses: {},
- total: h
- }, f = 0; f < h; f++) c = f * r, l = Math.min(c + r, o.length), a = o.substring(c, l), s(t, e, f, h, a)
- }
- function f() {
- for (var r, t = !0, n = 0; n < i.total; n++) {
- if (typeof i.responses[n] == "undefined") break;
- t = t && i.responses[n]
- }
- n === i.total && t ? i = null : n !== i.total || t || (r = i.payload, i.retries < e ? u(r, i.id) : i = null)
- }
- var i, r = 195e3,
- e = 3,
- o = 1e4;
- return u(n)
- }
- n.SendToBackend = t
- })(t = n.Protocol || (n.Protocol = {}))
- }(Feedback || (Feedback = {})),
- function(n) {
- n.setupFeedbackForm = function(t) {
- function ot() {
- var n = document.doctype ? "<!DOCTYPE " + document.doctype.name + ' PUBLIC "' + document.doctype.publicId + '" "' + document.doctype.systemId + '">' : "";
- return n += document.compatMode ? "<!--COMPATMODE:" + document.compatMode + "-->" : "", n += document.documentMode ? "<!--DOCMODE:" + document.documentMode.toString(10) + "-->" : "", n + ("<html>" + document.getElementsByTagName("html")[0].innerHTML + "<\/html>")
- }
- function st() {
- jQuery.extend(jQuery.validator.messages, {
- maxlength: jQuery.validator.format(t.errorMessage.commentTooLong),
- requiredNoWatermark: t.errorMessage.emptyComment
- });
- n.validator.addClassRules({
- maxLength400: {
- maxlength: 400
- }
- })
- }
- function ht() {
- var r = n("input[type='radio'][name='feedbackType']:checked").val(),
- i;
- yt();
- i = {
- text: n("#feedbackComment").val(),
- original_html: ot(),
- width: n(window).outerWidth(),
- height: n(window).outerHeight(),
- type: r,
- source: t.source,
- url: window.location.href,
- vertical: t.vertical,
- send_mail: !0
- };
- g();
- Feedback.Protocol.SendToBackend(i, t.endpoint)
- }
- function l(t, i, u, f) {
- var o = 0,
- s = 0,
- e;
- do o += u, s += f, e = document.elementFromPoint(t + o, i + s); while (e !== null && n(e).is(r));
- return e
- }
- function ct(n, t) {
- var i = l(n, t, 0, -1),
- r = l(n, t, 1, 0),
- u = l(n, t, 0, 1),
- f = l(n, t, -1, 0);
- return i === r && i === u && i === f ? i : i !== r && r === u && r === f ? r : r !== u && u === f && u === i ? u : u !== f && f === i && f === r ? f : f !== i && i === r && i === u || i === r ? i : r === u ? r : u === f ? u : f === i ? f : null
- }
- function k(t) {
- r.css({
- left: t.pageX,
- top: t.pageY
- });
- c && clearTimeout(c);
- c = setTimeout(function() {
- c = null;
- s.hide();
- i = ct(t.clientX, t.clientY);
- s.show();
- i !== null && i !== b && (b = i, n(i).trigger(h))
- }, 5)
- }
- function lt() {
- var t = n(i);
- t.is(".highlightIgnore") || w(u, f, e, o, t, 2)
- }
- function at() {
- var t = n(i),
- s, r;
- if (t.is(".feedbackHighlighted") || t.is(".highlightIgnore")) t.is(".feedbackHighlighted") && (n("div.feedbackHighlightContainer[hlid='" + t.attr("hlid") + "']").remove(), t.removeClass("feedbackHighlighted").removeAttr("hlid"));
- else {
- var u = rt.clone(),
- f = ut.clone(),
- e = ft.clone(),
- o = et.clone();
- w(u, f, e, o, t);
- s = it.clone().append(u).append(f).append(e).append(o);
- r = generateString(5);
- n("body").append(s.attr("hlid", r));
- t.addClass("feedbackHighlighted").attr("hlid", r)
- }
- }
- function d() {
- n(".feedbackHighlighted").each(function() {
- var i = n(this).attr("hlid"),
- t = n(".feedbackHighlightContainer[hlid=" + i + "]"),
- r = t.find(".highlightLeftBorder"),
- u = t.find(".highlightRightBorder"),
- f = t.find(".highlightTopBorder"),
- e = t.find(".highlightBottomBorder");
- w(r, u, f, e, n(this))
- })
- }
- function w(n, t, i, r, u, f) {
- typeof f == "undefined" && (f = 0);
- var e = u.offset();
- n.css("height", u.outerHeight() + f * 2 + "px").css("top", e.top - f).css("left", e.left - f).show();
- t.css("height", u.outerHeight() + f * 2 + "px").css("top", e.top - f).css("left", e.left + u.outerWidth() + f).show();
- i.css("width", u.outerWidth() + f * 2 + "px").css("top", e.top - f).css("left", e.left - f).show();
- r.css("width", u.outerWidth() + f * 2 + "px").css("top", e.top + u.outerHeight() + f).css("left", e.left - f).show()
- }
- function g() {
- u.remove();
- f.remove();
- e.remove();
- o.remove();
- s.remove();
- r.remove();
- n(".feedbackHighlight").remove();
- n(".feedbackHighlightContainer").remove();
- n(".feedbackHighlighted").removeClass("borderHighlighted feedbackHighlighted");
- v.remove();
- y.remove();
- n(document).unbind("mousemove", k).unbind(h).unbind(p);
- n(window).unbind("resize", d)
- }
- function nt() {
- n("#feedbackBadge").toggle();
- n("#feedbackContent").toggle()
- }
- function vt() {
- var t = n("#feedbackContent"),
- i, c;
- t.after(u).after(f).after(e).after(o).after(s).after(r).on(h, function(n) {
- u.hide();
- f.hide();
- e.hide();
- o.hide();
- n.stopPropagation()
- });
- n(document).mousemove(k).on(h, lt).on(p, at);
- r.on("click", function(t) {
- t.stopPropagation();
- n(document).trigger(p)
- });
- n(window).resize(d);
- nt();
- i = 20;
- isRTL || (i = n(window).width() - t.outerWidth() - 20);
- c = n(window).height() - t.outerHeight();
- t.draggable({
- cursor: "move"
- }).css("left", i).css("top", c)
- }
- function tt() {
- g();
- n("#feedbackForm").show();
- n("#feedbackAcknowledge").hide();
- nt()
- }
- function yt() {
- v.text(userId);
- n("#user-nav > ul").prepend(v);
- y.text(url);
- n("#user-nav > ul").prepend(y);
- n(".feedbackHighlighted").addClass("borderHighlighted");
- n(".feedbackHighlight").remove();
- n(".feedbackHighlightContainer").remove();
- n(".feedbackHover").remove()
- }
- function pt() {
- if (n("#feedback-form").valid()) {
- var t = n("#feedbackContent");
- t.fadeOut({
- complete: function() {
- var r, i, u;
- ht();
- n("#feedbackForm").hide();
- r = n("#feedbackAcknowledge");
- r.show();
- i = 20;
- isRTL || (i = n(window).width() - t.outerWidth() - 20);
- u = n(window).height() - t.outerHeight();
- t.css("left", i).css("top", u).fadeIn(400)
- }
- })
- }
- }
- function wt() {
- var i = n("#feedbackComment").val().length,
- t = n("#characterCount");
- t.text(i + "/" + a);
- i >= a ? t.addClass("invalidCommentLength") : t.removeClass("invalidCommentLength")
- }
- function bt() {
- n("#feedbackBadge").click(function(n) {
- vt();
- n.stopPropagation()
- });
- n("#feedbackCloseCross").click(tt);
- n("#feedbackCloseButton").click(tt);
- n("#feedbackSend").click(pt);
- n("#characterCount").text("0/" + a);
- n("#feedbackComment").keyup(wt)
- }
- function kt() {
- bt();
- st()
- }
- var a = n("#feedbackComment").attr("maxlength"),
- v = n("<li id='feedbackUserId'><\/li>"),
- y = n("<li id='feedbackSiteUrl'><\/li>"),
- u = n("<div class='feedbackHover hoverLeftBorder highlightIgnore'><\/div>"),
- f = n("<div class='feedbackHover hoverRightBorder highlightIgnore'><\/div>"),
- e = n("<div class='feedbackHover hoverTopBorder highlightIgnore'><\/div>"),
- o = n("<div class='feedbackHover hoverBottomBorder highlightIgnore'><\/div>"),
- it = n("<div class='feedbackHighlightContainer highlightIgnore'>"),
- rt = n("<div class='feedbackHighlight highlightLeftBorder highlightIgnore'><\/div>"),
- ut = n("<div class='feedbackHighlight highlightRightBorder highlightIgnore'><\/div>"),
- ft = n("<div class='feedbackHighlight highlightTopBorder highlightIgnore'><\/div>"),
- et = n("<div class='feedbackHighlight highlightBottomBorder highlightIgnore'><\/div>"),
- s = n('<div id="feedbackScreen" class="highlightIgnore"><\/div>'),
- r = n('<div id="feedbackPxl" class="highlightIgnore"><\/div>'),
- h = "webmaster.feedback.elementChanged",
- p = "webmaster.feedback.elementSelected",
- c, b, i;
- kt()
- }
- }(jQuery),
- function(n) {
- function r(i) {
- function e(n) {
- for (var c = [], t, l = i.getData(), r, a, u = 0; u < l.length; ++u) {
- for (r = l[u], t = 0; t < r.data.length; ++t)
- if (r.data[t][0] > n.x) break;
- var o, s, h = 0,
- f = r.data[t - 1],
- e = r.data[t];
- f == null ? (o = e != null ? e[0] : 0, s = e != null ? e[1] : 0, h = t) : e == null ? (o = f[0], s = f[1], h = t - 1) : (o = f[0], s = f[1], h = t - 1);
- a = r.datapoints.pointsize;
- c[c.length] = {
- datapoint: [o, s],
- dataIndex: h,
- series: r,
- seriesIndex: u
- }
- }
- return c
- }
- var r = [],
- u = !1,
- f = !1;
- i.hooks.bindEvents.push(function(i, o) {
- function h(n) {
- var t = i.getAxes(),
- u = i.getPlotOffset(),
- f = o.offset(),
- r = {
- pageX: n.pageX,
- pageY: n.pageY
- },
- e = n.pageX - f.left - u.left,
- s = n.pageY - f.top - u.top;
- return t.xaxis.used && (r.x = t.xaxis.c2p(e)), t.yaxis.used && (r.y = t.yaxis.c2p(s)), r
- }
- function s(n) {
- return e(h(n))
- }
- function a() {
- if (document.onselectstart !== undefined && (document.onselectstart = t.onselectstart), document.ondrag !== undefined && (document.ondrag = t.ondrag), u = !1, f) {
- f = !1;
- var n = i.getData();
- i.getOptions().webmastercrawldelay.onChange(n[0].data)
- }
- return !1
- }
- function c(n, t) {
- var o, f, u, e;
- if (i.getOptions().webmastercrawldelay.highlightRadius != 0)
- for (o = i.getData(), f = 0; f < n.length; ++f) u = n[f], e = r[f], (e == null || e.seriesIndex != u.seriesIndex || e.dataIndex != u.dataIndex || t) && (e != null && i.unhighlight(e.series, e.datapoint), r[f] = u, u.series.highlightColor = i.getOptions().webmastercrawldelay.highlightColors[f], u.series.highlightRadius = i.getOptions().webmastercrawldelay.highlightRadius, i.highlight(u.series, u.datapoint))
- }
- function l(n, t) {
- var r = i.getData(),
- u, e, o, n;
- n.length == 1 && r.length > 0 && (u = n[0], u.dataIndex >= 0 && u.dataIndex < r[0].data.length && (e = h(t), o = Math.min(i.getOptions().webmastercrawldelay.max, Math.max(Math.floor(e.y + .5), i.getOptions().webmastercrawldelay.min)), r[0].data[u.dataIndex][1] = o, i.setData([r[0].data]), i.draw(), n = s(t), c(n, !0), f = !0))
- }
- i.getOptions().webmastercrawldelay != null && i.getOptions().webmastercrawldelay.enabled && (o.mousedown(function(r) {
- if (r.which == 1) {
- document.body.focus();
- document.onselectstart !== undefined && t.onselectstart == null && (t.onselectstart = document.onselectstart, document.onselectstart = function() {
- return !1
- });
- document.ondrag !== undefined && t.ondrag == null && (t.ondrag = document.ondrag, document.ondrag = function() {
- return !1
- });
- var f = s(r);
- l(f, r);
- u = !0;
- i.getOptions().webmastercrawldelay.onChangeBegin();
- n(document).one("mouseup", a)
- }
- }), o.mousemove(function(n) {
- var t = s(n);
- c(t);
- u && l(t, n)
- }), o.mouseout(function() {
- for (var t, n = 0; n < r.length; ++n) t = r[n], t != null && (i.unhighlight(t.series, t.datapoint), r[n] = null)
- }))
- })
- }
- var i = {
- webmastercrawldelay: {
- enabled: !1,
- autoHighlight: !0,
- highlightColors: ["#1b95ff", "#43f8f8"],
- highlightRadius: 2,
- onChange: function() {},
- onChangeBegin: function() {},
- min: 1,
- max: 10
- }
- },
- t = {};
- n.plot.plugins.push({
- init: r,
- options: i,
- name: "webmastercrawldelay",
- version: "1.0"
- })
- }(jQuery),
- function(n) {
- function t(n) {
- n.hooks.draw.push(function(n, t) {
- var i = n.getOptions().webmastergrid,
- r;
- i.show && (r = n.getPlotOffset(), t.save(), t.translate(r.left, r.top), t.strokeStyle = i.color, t.lineWidth = i.lineWidth, t.lineJoin = "round", t.beginPath(), t.moveTo(n.width(), 0), t.lineTo(n.width(), n.height()), t.moveTo(0, 0), t.lineTo(n.width(), 0), t.stroke(), t.restore())
- })
- }
- n.plot.plugins.push({
- init: t,
- options: {
- webmastergrid: {
- show: !1,
- color: "rgba(170, 0, 0, 0.80)",
- lineWidth: 1
- }
- },
- name: "webmastergrid",
- version: "1.0"
- })
- }(jQuery),
- function(n) {
- function t(t) {
- function e() {
- var s = t.getPlaceholder(),
- h = t.getData(),
- i, c, o, e, l;
- for (s.find(".legend").remove(), i = [], i.push('<tr><th class="dateLabel" colspan="2"> <\/td><\/tr>'), e = 0; e < h.length; ++e)(c = h[e], o = c.label, o) && i.push('<tr><td class="legendLabel">' + o + '<\/td><td class="legend-label-value" index="' + e + '"><\/td><\/tr>');
- i.length != 0 && (l = "<table>" + i.join("") + "<\/table>", r = n('<div class="legend">' + l + "<\/div>").appendTo(s), u = t.getPlaceholder().find(".legend-label-value"), f = t.getPlaceholder().find(".dateLabel"))
- }
- function o(n) {
- for (var s = [], i, c = t.getData(), r, u, f, e = 0; e < c.length; ++e) {
- for (r = c[e], i = 0; i < r.data.length; ++i)
- if (r.data[i][0] > n.x) break;
- var l = i < r.data.length,
- a = n.x,
- o = 0,
- h = 0;
- l && (u = r.data[i - 1], f = r.data[i], u == null ? (o = f != null ? f[1] : 0, h = i) : f == null ? (o = u[1], h = i - 1) : o = u[1] + (f[1] - u[1]) * (n.x - u[0]) / (f[0] - u[0]));
- s[s.length] = {
- datapoint: [a, o],
- dataIndex: h,
- series: r,
- seriesIndex: e,
- visible: l
- }
- }
- return s
- }
- var i = [],
- u, f, r;
- t.hooks.bindEvents.push(function(t, s) {
- if (t.getOptions().webmasterlegend != null && t.getOptions().webmasterlegend.enabled) {
- var h = t.getOptions().webmasterlegend.showPoints;
- e();
- r.hide();
- s.mousemove(function(e) {
- var v = t.getAxes(),
- b = t.getPlotOffset(),
- k = s.offset(),
- y = {
- pageX: e.pageX,
- pageY: e.pageY
- },
- d = e.pageX - k.left - b.left,
- g = e.pageY - k.top - b.top,
- p, a, c, l, w;
- for (v.xaxis.used && (y.x = v.xaxis.c2p(d)), v.yaxis.used && (y.y = v.yaxis.c2p(g)), p = o(y), a = 0; a < p.length; ++a) c = p[a], l = i[a], (l == null || l.seriesIndex != c.seriesIndex || l.visible != c.visible || l.dataIndex != c.dataIndex || l.datapoint[0] != c.datapoint[0]) && (l != null && (h && t.unhighlight(l.series, l.datapoint), i[a] = null), c.visible && (i[a] = c, h && t.highlight(c.series, c.datapoint), w = n.plot.formatDate(new Date(c.datapoint[0]), "%b %d ", t.getOptions().xaxis.monthNames), monthDayPattern.length > 1 && monthDayPattern.indexOf("MMM") == -1 && (w = formatXaxis(c.datapoint[0])), n(f).text(w), n(u).filter('[index="' + a + '"]').html(v.yaxis.tickFormatter(c.datapoint[1], v.yaxis))));
- r.css("position", "fixed").css("top", y.pageY + 10 + "px").css("left", y.pageX + 15 + "px")
- });
- s.mouseout(function() {
- for (var u, n = 0; n < i.length; ++n) u = i[n], u != null && (h && t.unhighlight(u.series, u.datapoint), i[n] = null);
- r.hide()
- });
- s.mouseover(function() {
- var n = t.getData(),
- i = !1;
- for (var u in n)
- if (n[u].data.length > 0) {
- i = !0;
- break
- }
- i && r.show()
- })
- }
- })
- }
- n.plot.plugins.push({
- init: t,
- options: {
- webmasterlegend: {
- enabled: !1,
- showPoints: !0
- }
- },
- name: "webmasterlegend",
- version: "1.0"
- })
- }(jQuery);
- $(document).ready(testForIE6),
- function(n) {
- var i = function(n, t, i) {
- return {
- SiteUrl: n,
- MessageType: t,
- MessageId: i
- }
- },
- t = function(n) {
- hideActivityIndicator();
- reportError(n)
- },
- u = function(n, r, u, f, e) {
- showActivityIndicator(!0);
- var o = i(r, u, f);
- startPostRequestWithJson({
- messages: JSON.stringify([o])
- }, n.DeleteUrl, function() {
- hideActivityIndicator();
- e(r, u, f)
- }, t, "#messageTokenContainer")
- },
- f = function(n, i, r) {
- showActivityIndicator(!0);
- startPostRequestWithJson({
- messages: JSON.stringify(i)
- }, n.DeleteUrl, function() {
- hideActivityIndicator();
- r(i)
- }, t, "#messageTokenContainer")
- },
- e = function(n, r, u, f, e) {
- showActivityIndicator(!0);
- var o = i(r, u, f);
- startPostRequestWithJson({
- messages: JSON.stringify([o])
- }, n.ArchiveUrl, function() {
- hideActivityIndicator();
- e(r, u, f)
- }, t, "#messageTokenContainer")
- },
- o = function(n, i, r) {
- showActivityIndicator(!0);
- startPostRequestWithJson({
- messages: JSON.stringify(i)
- }, n.ArchiveUrl, function() {
- hideActivityIndicator();
- r(i)
- }, t, "#messageTokenContainer")
- },
- s = function(n, r, u, f, e) {
- showActivityIndicator(!0);
- var o = i(r, u, f);
- startPostRequestWithJson({
- messages: JSON.stringify([o])
- }, n.DeleteArchivedUrl, function() {
- hideActivityIndicator();
- e(r, u, f)
- }, t, "#messageTokenContainer")
- },
- h = function(n, i, r) {
- showActivityIndicator(!0);
- startPostRequestWithJson({
- messages: JSON.stringify(i)
- }, n.DeleteArchivedUrl, function() {
- hideActivityIndicator();
- r(i)
- }, t, "#messageTokenContainer")
- },
- r = function(t, i, r, f, o, h) {
- showActivityIndicator(!0);
- n.post(n.validator.format(i.DialogUrl, encodeURI(r), encodeURI(f), encodeURI(o)), function(c) {
- showPopupModalDialog("#messageDialog", c);
- hideActivityIndicator();
- n("#messagearchive").click(function() {
- n("#messageDialog").jqmHide().remove();
- e(i, r, f, o, h)
- });
- n("#messagedelete").click(function() {
- n("#messageDialog").jqmHide().remove();
- t ? s(i, r, f, o, h) : u(i, r, f, o, h)
- })
- })
- };
- n.fn.messages = function(t) {
- var s = typeof t == "string",
- e = Array.prototype.slice.call(arguments, 1);
- s && t == "show" && (e.splice(0, 0, !1), r.apply(null, e));
- var c = setupGridCheckButtonEnabler("table.wmtable", "#removeParam"),
- l = setupGridCheckButtonEnabler("table.wmtable", "#archiveParam"),
- a = function() {
- n(this).removeClass("messages-unread");
- var i = n(this).parent().parent().find(":checkbox");
- r(t.archive, t, i.attr("siteurl"), i.attr("messagetype"), i.attr("messageid"), function() {
- i.parent().parent().remove();
- n("table.grid").trigger("update")
- })
- },
- u = function(t, r) {
- var u = [],
- f = n("table.wmtable :checked").parent().parent();
- n("table.wmtable :checked").each(function() {
- var t = n(this),
- r = i(t.attr("siteurl"), t.attr("messagetype"), t.attr("messageid"));
- u.push(r)
- });
- u.length > 0 && r(t, u, function() {
- n(f).remove();
- n("table.grid").trigger("update")
- })
- };
- n("table.wmtable tbody a").click(a);
- n("table.wmtable :checkbox").change(c).change(l);
- n("#filterSite").change(function() {
- n("#filters").submit()
- });
- n("#filterType").change(function() {
- n("#filters").submit()
- });
- t.archive ? n("#removeParam").click(function() {
- u(t, h)
- }) : (n("#removeParam").click(function() {
- u(t, f)
- }), n("#archiveParam").click(function() {
- u(t, o)
- }));
- t.showMessage != null && n.fn.messages("show", t, "", t.showMessage, "")
- }
- }(jQuery),
- function(n) {
- var t = function() {
- function n(n) {
- this.kpiRequestQueue = [];
- this.lastSearched = "";
- this.lastKeyedSearch = "";
- this.onGridCheck = setupGridCheckButtonEnabler("table.wmtable", "#removeParam");
- this.options = n
- }
- return n.prototype.Run = function() {
- var n = this,
- t;
- this.fixSiteVerificationSpacing();
- $("#addParamForm").validate(noCleanValidateOptions);
- $("#compactView").change(function() {
- return n.toggleThumbs()
- });
- $("#siteSearch, #siteSearch + button").keyup(function() {
- return n.searchSite()
- });
- $.setupSearchbox(".searchWrapper");
- this.addMySiteRowClick();
- $("#removeParam").click(function() {
- return n.removeSitesHandler()
- });
- $("#addParam").click(function() {
- return n.addSiteHandler()
- });
- $("#kpiPeriodSelectorContainer").bind("dateChanged", function() {
- return n.loadSiteKpis()
- });
- clickButtonOnEnter("#addParam", "#addSite");
- this.loadSiteKpis();
- t = $.deparam.querystring();
- t.profile == 1 && $.fn.addSite.showProfileDialog()
- }, n.prototype.loadSiteKpis = function() {
- for (var i = $('div.siteUrl[verified="True"]', $("tbody")), n = [], t = 0; t < i.length; t++) n.push(i[t].id), n.length >= 10 && (this.kpiRequestQueue.push(n), n = []);
- n.length > 0 && this.kpiRequestQueue.push(n);
- this.kpiRequestQueue.length > 0 && (this.kpiRequestQueue.reverse(), this.invokeKpiRequest())
- }, n.prototype.invokeKpiRequest = function() {
- var n = this,
- t = this.kpiRequestQueue.pop();
- $.ajax({
- url: this.options.KpiUrl,
- type: "POST",
- data: {
- siteUrls: t,
- startDate: $("#kpiPeriodSelectorFrom").val(),
- endDate: $("#kpiPeriodSelectorTo").val()
- },
- traditional: !0,
- timeout: 13500,
- success: function(t) {
- return n.reportSuccess(t)
- },
- error: reportError
- })
- }, n.prototype.reportSuccess = function(n) {
- this.showSiteKpi(n);
- this.kpiRequestQueue.length > 0 && this.invokeKpiRequest()
- }, n.prototype.showSiteKpi = function(n) {
- $("tr", $("<div/>").html(n)).each(function() {
- var n = $(this),
- i = n.attr("site"),
- t = $id(i).parent().parent();
- $("td:gt(3)", t).remove();
- t.append(n.children())
- });
- this.addMySiteRowClick()
- }, n.prototype.addMySiteRowClick = function() {
- var n = this,
- t = function(t) {
- return n.siteRowClicked(t)
- };
- $("a.cancelClick").click(cancelEvent);
- $("td:gt(0)", $("tr", "table.wmtable")).click(function() {
- t($(this))
- });
- $("table.wmtable :checkbox").change(this.onGridCheck)
- }, n.prototype.siteRowClicked = function(n) {
- var i = n.parent(),
- t = $(".siteUrl", i);
- return t.length > 0 && (showActivityIndicator(!0), window.location.href = t.attr("verified") === "True" ? containerPrefix + "/home/dashboard/?url=" + t.attr("id") : containerPrefix + "/configure/verify/ownership/?url=" + t.attr("id")), !1
- }, n.prototype.removeDataSuccess = function(n, t) {
- var r, i;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i]] = !0;
- $("table.wmtable :checkbox").each(function() {
- r[$(this).attr("site")] && $(this).parent().parent().remove()
- });
- triggerCheckboxChange();
- this.revertToOriginalEmptyMessage();
- $("table.grid").trigger("update")
- }, n.prototype.revertToOriginalEmptyMessage = function() {
- var n = $("#siteList table");
- n.attr("emptytitle", n.attr("oldemptytable")).attr("emptybutton", n.attr("oldemptybutton")).attr("emptytablesetup", "");
- $("tr.empty", n).remove();
- initEmptyTables()
- }, n.prototype.removeDataFailure = function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }, n.prototype.removeData = function(n) {
- var t = this;
- showActivityIndicator(!0);
- startPostRequestWithJson({
- url: n
- }, this.options.RemoveSitesUrl, function(i) {
- return t.removeDataSuccess(i, n)
- }, function(n) {
- return t.removeDataFailure(n)
- }, "#addParamForm", null, {
- traditional: !0
- })
- }, n.prototype.fixSiteVerificationSpacing = function() {
- var n = $("div.metabox").parent().parent();
- n.attr("colspan", "4");
- n.nextAll().detach()
- }, n.prototype.searchSite = function() {
- var n = this,
- t = $("#siteSearch").val();
- t != this.lastKeyedSearch && (this.lastKeyedSearch = t, setTimeout(function() {
- if (n.lastKeyedSearch != n.lastSearched) {
- n.lastSearched = n.lastKeyedSearch;
- var t = $("#siteList table");
- t.attr("oldemptytable") == null && t.attr("oldemptytable", t.attr("emptytitle")).attr("oldemptybutton", t.attr("emptybutton"));
- n.lastSearched.length > 0 ? (t.attr("emptytitle", $.validator.format(t.attr("nosearchresults"), $("<div/>").text(n.lastSearched).text())).attr("emptybutton", "").attr("emptytablesetup", ""), $("tr.empty", t).remove(), initEmptyTables()) : n.revertToOriginalEmptyMessage();
- n.searchXhr != null && n.searchXhr.abort();
- n.searchXhr = $.ajax({
- url: n.options.SiteSearchUrl,
- type: "POST",
- data: {
- partial: n.lastSearched,
- startDate: $("#kpiPeriodSelectorFrom").val(),
- endDate: $("#kpiPeriodSelectorTo").val()
- },
- timeout: 13500,
- success: function(t) {
- return n.showSearchedSites(t)
- },
- error: reportError
- })
- }
- }, 200))
- }, n.prototype.showSearchedSites = function(n) {
- this.searchXhr = null;
- $("#siteList table tbody").html(n);
- $("table.grid").trigger("update");
- $("#pagCont").hide();
- triggerCheckboxChange();
- this.addMySiteRowClick()
- }, n.prototype.toggleThumbs = function() {
- var n = $("#compactView:checked").length > 0;
- $.cookie("cv", n, {
- expires: 365,
- path: containerPrefix
- });
- n ? $("img.thumbnail").hide() : $("img.thumbnail").show()
- }, n.prototype.addSiteHandler = function() {
- var n = $("#addParamForm");
- n.valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(n), window.location.href = [Encoder.htmlDecode(this.options.AddSiteUrl), "&addurl=", encodeURIComponent($("#addSite").val())].join(""))
- }, n.prototype.removeSitesHandler = function() {
- var n = [];
- $("table.wmtable :checked").each(function() {
- var t = $(this),
- i = t.attr("site");
- n.push(i)
- });
- n.length > 0 && this.removeData(n)
- }, n
- }();
- n.MySites = t
- }(Home || (Home = {})),
- function(n) {
- n.setupSearchbox = function(t) {
- var i = n(t);
- return i.find("input[type=search], input[type=search] + button").focus(function() {
- return i.addClass("searchWrapperFocused")
- }).mouseenter(function() {
- return i.addClass("searchWrapperHover")
- }).focusout(function() {
- return i.removeClass("searchWrapperFocused")
- }).mouseout(function() {
- return i.removeClass("searchWrapperHover")
- }), i
- }
- }(jQuery),
- function(n) {
- function r(r, u) {
- var f, h, c, e, o, s, l;
- r.stopPropagation();
- f = n("#siteSelectorHover");
- h = u && u.callback;
- t != h && f.is(":visible") && i();
- c = n(this).width();
- u && u.width && (c = u.width);
- t = h;
- e = parseInt(c) + 70;
- o = parseInt(n("#siteGrid").css("max-width"));
- o > 0 && e > o && (e = o);
- e < 350 && (e = 350);
- f.css("min-width", e);
- f.toggle();
- u ? f.offset(u.offset) : (s = n("#siteSelector").offset(), l = s.top + n("#siteSelector").height(), isRTL ? f.offset({
- right: s.right,
- top: l
- }) : f.offset({
- left: s.left,
- top: l
- }));
- n("#siteSelectorSearch").focus()
- }
- function i() {
- n("#siteSelectorHover").hide()
- }
- function u(n) {
- n.stopPropagation()
- }
- function f() {
- var t = n("#siteSelectorSearch").val();
- n("#siteGrid div").each(function() {
- var i = n(this);
- i.text().indexOf(t) > -1 ? i.parent().parent().show() : i.parent().parent().hide()
- })
- }
- function e(r) {
- var f, u;
- u = n(this);
- t ? (r.stopPropagation(), i(), t(u.attr("url"), u.text())) : n("#existingSite").text() != u.text() && (showActivityIndicator(!0), f = u.attr("socialUrl") ? "socialUrl" : "url", window.location = swapQueryString(window.location.href, f, u.attr(f)))
- }
- function o() {
- var t = e;
- n("#siteSelector").click(r);
- n("body").click(i);
- n("#siteSelectorSearch").keyup(f).click(u);
- n("#searchIcon").click(u);
- n("#siteGrid div").click(t)
- }
- var t = null;
- n.fn.siteSelector = function(n, t, i) {
- i ? r(t, i) : o()
- }
- }(jQuery),
- function(n) {
- n.fn.runSnrHeaderFooterHacks = function(t) {
- n("#sb_help").attr("href", t);
- n("input[name='scope']").remove();
- sj_evt.bind("id:refreshed", function() {
- n('#b_idProviders a[href*="provider=facebook"]').remove()
- })
- };
- n.fn.microsoftTouBanner = function(t) {
- function l() {
- (i = new Date, i.setHours(0, 0, 0, 0), a()) || (v(), y())
- }
- function r() {
- return i.getTime() < h.getTime()
- }
- function a() {
- if (!PublicTools.SearchBlockShared.lsAvailable() || i > c) return !0;
- var n = localStorage.getItem(u),
- t = n ? new Date(n) : null;
- return t != null && t.getTime() == i.getTime() ? !0 : r() ? !!localStorage.getItem(f) : !!localStorage.getItem(e)
- }
- function v() {
- localStorage.setItem(u, i);
- var f = r() ? t.updatingString : t.updatedString;
- n("#msTOU .toumsg").text(f);
- n("#msTOU").css("display", "inline-block")
- }
- function o() {
- r() ? localStorage.setItem(f, 1) : localStorage.setItem(e, 1);
- n("#msTOU").css("display", "none")
- }
- function y() {
- n("#btnLearnMore").click(function() {
- var n = window.open(s, "_blank");
- n.focus();
- o()
- });
- n("#msTOU .tou_close").click(function() {
- o()
- })
- }
- var s = "http://go.microsoft.com/fwlink/?LinkID=536683",
- h = new Date(2015, 07, 1),
- c = new Date(2015, 07, 5),
- u = "MsaLastSeen",
- f = "MsaFirstDismissed",
- e = "MsaSecondDismissed",
- i = null;
- l()
- }
- }(jQuery),
- function(n) {
- var t = function(n) {
- var i, r, t;
- if (!n.match(/^https?:[\/]{2}/i) && n.length > 0) {
- for (i = !1, r = ["http://", "https://"], t = 0; t < r.length; t++)
- if (r[t].toUpperCase().indexOf(n.toUpperCase()) == 0) {
- i = !0;
- break
- }
- return i
- }
- return !0
- };
- n.fn.urlInputBox = function() {
- this.keyup(function() {
- var i = n(this);
- if (!t(i.val())) {
- if (isValueSameAsPalceHolder(i.val(), i)) return;
- i.val("http://" + i.val())
- }
- });
- this.focusout(function() {
- var t = n(this);
- t.val().match(/\s+$/) != null && t.val(n.trim(t.val()))
- })
- };
- n.fn.urlTextArea = function() {
- this.keyup(function() {
- var r = n(this),
- i, u, f, e;
- if (!isValueSameAsPalceHolder(r.val(), r)) {
- i = r.val().split("\n");
- u = !1;
- for (f in i) e = i[f], t(e) || (u = !0, i[f] = "http://" + e);
- u && r.val(i.join("\n"))
- }
- })
- }
- }(jQuery),
- function(n) {
- n.fn.webmasterApi = function(t) {
- function u(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n("#deleteKey").attr("disabled", !1);
- n("#apiKey").text(t)
- }
- function f() {
- showActivityIndicator(!0);
- startPostRequestWithJson({}, t.generateApiKey, u, r, i)
- }
- function e() {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n("#deleteKey").attr("disabled", !0);
- n("#apiKey").text(wr.Api_NotGenerated)
- }
- function o() {
- showActivityIndicator(!0);
- startPostRequestWithJson({}, t.deleteApiKey, e, r, i)
- }
- var i = "#apiForm",
- r = function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- };
- n("#generateKey").click(f);
- n("#deleteKey").click(o)
- }
- }(jQuery),
- function(n) {
- function t(t) {
- function i(t, i, r, u, f, e, o, s) {
- s = s || function() {};
- n(u).live("click", function() {
- n(i).show();
- n(u).hide();
- n(e).focus()
- });
- n(f).live("click", function() {
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
- var h = n.trim(n(e).val()),
- c = isValueSameAsPalceHolder(h, n(e));
- h.length > 0 && !c ? (n(f).attr("disabled", "disabled"), showActivityIndicator(!0), n.post(o, n(r).serialize(), function(i) {
- n(t).html(i);
- showActivityIndicator(!1);
- clickButtonOnEnter(f, e);
- initInfoHovers();
- disableFormSubmit();
- n("input.urlValidation, input.wmUrl").urlInputBox();
- n("#addIgnoredParameter").val("");
- s()
- })) : (n(i).hide(), n(u).show())
- }
- });
- clickButtonOnEnter(f, e);
- s()
- }
- function u() {
- var i = n("#diagnosticSubmit"),
- t = n("#diagnosticsSelector");
- t.val("");
- n("#diagnosticWidgetForm").validate(formValidateOptions);
- i.click(function() {
- var u = n("#diagnosticsUrl").val(),
- i = t.val(),
- r;
- n("#diagnosticWidgetForm").valid() && (r = "", r = i.indexOf("diagnostics/link/explorer") != -1 ? n.validator.format("{0}&targeturl={1}", i, encodeURI(u)) : n.validator.format("{0}¶murl={1}", i, encodeURI(u)), window.location = r)
- })
- }
- function f() {
- n("table.adCenterIntegration").adCenter({
- KeywordsUrl: t.AdCenterKeywordsUrl,
- TokenContainer: "#tokenContainer"
- });
- n("#periodSelectorContainer").bind("dateChanged", function() {
- showActivityIndicator(!1);
- n.post(t.keywordTableUrl, {
- startDate: n("#periodSelectorFrom").val(),
- endDate: n("#periodSelectorTo").val(),
- socialUrl: t.socialUrl
- }, function(i) {
- hideActivityIndicator();
- n("#searchKeywordWidget").replaceWith(i);
- n("table.adCenterIntegration").adCenter({
- KeywordsUrl: t.AdCenterKeywordsUrl,
- TokenContainer: "#tokenContainer"
- });
- initInfoHovers()
- })
- })
- }
- function e() {
- n("#messageswidget").click(function() {
- window.location = t.messagesUrl
- });
- n("#messageswidget a").click(function(i) {
- jQuery.browser.msie && (i.cancelBubble = !0);
- i.stopPropagation();
- n(this).removeClass("messages-unread");
- var r = n(this);
- n.fn.messages("show", t.messageOptions, n(this).attr("siteurl"), n(this).attr("messagetype"), n(this).attr("messageid"), function() {
- r.remove();
- n("#messageswidget a").length == 0 && n("#messageswidget").remove()
- })
- })
- }
- function o() {
- window.location = t.blockUrlLink
- }
- function s() {
- n("#periodSelectorContainer").bind("dateChanged", function() {
- n.post(t.siteActivityWidgetUrl, {
- startDate: n("#periodSelectorFrom").val(),
- endDate: n("#periodSelectorTo").val(),
- socialUrl: t.socialUrl
- }, function(t) {
- n("#siteactivitywidget").replaceWith(t);
- showSparklines();
- initInfoHovers()
- })
- })
- }
- function h() {
- n('#sitemapwidget table.grid a[si="0"]').each(function() {
- var i = n(this),
- r = n(":nth-child(3)", i.parent().parent().parent());
- n("body").sitemaps({
- IndexCountUrl: t.sitemapsIndexCountUrl
- }, "getSitemapIndexCount", i.text(), r)
- })
- }
- var r = {};
- return r.go = function() {
- n("#blockUrlsPageLoad").click(o);
- i("#sitemapwidget", "#weSitemap", "#addswform", "#weSitemapSubmit1", "#weSitemapSubmit2", "#addSitemap", containerPrefix + "/configure/sitemaps/addwidget?url=" + encodeURI(url), h);
- u();
- i("#ignoreTheseParameterswidget", "#weIgnoreTheseParameters", "#addqpform", "#weIgnoreParametersSubmit1", "#weIgnoreParametersSubmit2", "#addIgnoredParameter", containerPrefix + "/configure/ignore/addwidget?url=" + encodeURI(url));
- i("#submiturlswidget", "#weSubmitUrls", "#addsuwform", "#weSubmitUrlsSubmit1", "#weSubmitUrlsSubmit2", "#submitUrl", t.addSubmitUrlsWidget);
- e();
- f();
- s()
- }, r
- }
- n.widgetController = function(n) {
- return new t(n)
- }
- }(jQuery),
- function(n) {
- function t(t) {
- function f(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function a(n) {
- f(n)
- }
- function v(t) {
- var f, e, s;
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n("table.wmtable :checkbox").each(function() {
- n(this).attr("qp") == t.Url && n(this).parent().parent().remove()
- });
- f = "";
- e = "";
- e = t.EntityType == o ? wr.G_Directory : wr.G_Page;
- f = t.RequestType == i ? wr.BlockUrls_Cache : wr.BlockUrls_URLAndCache;
- s = n("<tr/>");
- s.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- qp: t.Url,
- et: t.EntityType,
- bt: t.RequestType
- })).append(n("<label/>"))).append(n('<td class="leftalign" />').append(createExternalUrl(t.Url))).append(n("<td/>").text(e)).append(n("<td/>").text(f)).append(n("<td/>").text(t.Email)).append(n("<td/>").text(apCfg.RemovedUrlsProcessor.UrlRemovalExpirationDeadline)).append(n("<td/>").text(t.DateFormatted));
- n("#urlRemovalList tbody").prepend(s);
- n("#inputBlockUrl").val("");
- triggerCheckboxChange();
- n("table.wmtable :checkbox").change(r);
- n("table.wmtable :checkbox").change(u);
- n("#urlRemovalList table.wmtable").trigger("update")
- }
- function h(n, r, u) {
- var e, f, o;
- console.log("blockUrl", n, r);
- e = s;
- f = l;
- u && (f = i);
- showActivityIndicator(!0);
- o = {
- Url: n,
- EntityType: r,
- RequestType: f,
- BlockTypePermOrTemp: e
- };
- startPostRequestWithJson({
- urlRemoval: JSON.stringify(o)
- }, t.AddUrl, v, a, "#blockUrlForm")
- }
- function y(t) {
- var e, f, s, h, c;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), e = {}, f = 0; f < t.length; ++f) e[t[f].Url] = !0;
- for (n("table.wmtable :checkbox").each(function() {
- e[n(this).attr("qp")] && n(this).parent().parent().remove()
- }), f = 0; f < t.length; f++) s = "", h = "", h = t[f].EntityType == o ? wr.G_Directory : wr.G_Page, s = t[f].RequestType == i ? wr.BlockUrls_Cache : wr.BlockUrls_URLAndCache, c = n("<tr/>"), c.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- qp: t[f].Url,
- et: t[f].EntityType,
- bt: t[f].RequestType
- })).append(n("<label/>"))).append(n('<td class="leftalign" />').append(createExternalUrl(t[f].Url))).append(n("<td/>").text(h)).append(n("<td/>").text(s)).append(n("<td/>").text(t[f].Email)).append(n("<td/>").text(apCfg.RemovedUrlsProcessor.UrlRemovalExpirationDeadline)).append(n("<td/>").text(t[f].DateFormatted)), n("#urlRemovalList tbody").prepend(c);
- n("table.wmtable :checkbox").change(r);
- n("table.wmtable :checkbox").change(u);
- triggerCheckboxChange();
- n("#urlRemovalList table.wmtable").trigger("update")
- }
- function p(t) {
- var r, i;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
- n("table.wmtable :checkbox").each(function() {
- r[n(this).attr("qp")] && n(this).parent().parent().remove()
- });
- triggerCheckboxChange();
- n("#urlRemovalList table.wmtable").trigger("update")
- }
- function w(n, i) {
- for (var e, u = [], r = 0; r < n.length; r++) e = {
- Url: n[r].urlBlocked,
- RequestType: n[r].blockType,
- EntityType: n[r].entityType,
- BlockTypePermOrTemp: s
- }, u.push(e);
- showActivityIndicator(!0);
- i ? startPostRequestWithJson({
- urlList: JSON.stringify(u)
- }, t.RemoveUrl, function() {
- p(u)
- }, f, "#blockUrlForm") : startPostRequestWithJson({
- urlList: JSON.stringify(u)
- }, t.ExtendUrl, y, f, "#blockUrlForm")
- }
- function c(t) {
- var i = [];
- n("table.wmtable :checked").each(function() {
- var t = n(this),
- r = t.attr("qp"),
- u = t.attr("et"),
- f = t.attr("bt"),
- e = {
- urlBlocked: r,
- entityType: u,
- blockType: f
- };
- i.push(e)
- });
- i.length > 0 && w(i, t)
- }
- var e = {},
- o = 1,
- l = 1,
- i = 0,
- s = 0,
- r = setupGridCheckButtonEnabler("table.wmtable", "#extendBlock"),
- u = setupGridCheckButtonEnabler("table.wmtable", "#stopBlocking");
- return e.go = function() {
- n("table.wmtable :checkbox").change(r);
- n("table.wmtable :checkbox").change(u);
- n("#submitBlockUrl").click(function() {
- if ($id("blockUrlForm").valid()) {
- var t = n("#entitySelected").val(),
- i = n("#inputBlockUrl").val();
- h(i, t, !1)
- }
- });
- n("#submitBlockUrlCache").click(function() {
- if ($id("blockUrlForm").valid()) {
- var t = n("#entitySelected").val(),
- i = n("#inputBlockUrl").val();
- h(i, t, !0)
- }
- });
- n("#stopBlocking").click(function() {
- c(!0)
- });
- n("#extendBlock").click(function() {
- c(!1)
- });
- $id("blockUrlForm").validate(formValidateOptions)
- }, e
- }
- n.blockUrlsController = function(n) {
- return new t(n)
- }
- }(jQuery),
- function(n) {
- function t() {
- function si() {
- var r, i, u, f;
- if (i = htmlDecodeJQuery(n(t).attr("url")), d(), !n(s).valid()) {
- n(l).addClass("error");
- n(l).removeClass("valid");
- return
- }
- i && (showActivityIndicator(!0), f = n(l).val(), r = at(i, f), u = [r], g(u))
- }
- function lt(n) {
- var t = "",
- i = n,
- r = "https://",
- u = "http://";
- return n.indexOf(r) == 0 ? (i = n.substring(r.length), t = r) : n.indexOf(u) == 0 && (i = n.substring(u.length), t = u), {
- Protocol: t,
- Rest: i
- }
- }
- function at(n, t) {
- var i = lt(n),
- r = lt(t);
- return r.Rest.indexOf(i.Rest) == 0 ? n + r.Rest.substring(i.Rest.length) : n + t
- }
- function d() {
- n(u).each(function() {
- var f, i, t, r, u;
- t = n(this);
- t.parent().parent().find("div.validationErrorPlaceholder>label").remove();
- r = t.closest(".socialSiteGroup");
- u = r.find(".socialPageHiddenUrl");
- u.removeClass("error");
- t.removeClass("error");
- i = htmlDecodeJQuery(r.find(".socialSiteUrl").attr("url"));
- i && (f = i + t.val(), u.val(f))
- })
- }
- function hi() {
- var t;
- d();
- n(p).valid() ? (t = [], n(st + " tr").each(function() {
- var r, i;
- i = n(this).find(u).val();
- i && (r = htmlDecodeJQuery(n(this).find("td > span").attr("url")), ut !== r && (i = at(r, i)), t.push(i))
- }), t.length > 0 && g(t)) : n(".socialPageHiddenUrl.error").each(function() {
- var t = n(this);
- t.closest(".socialSiteGroup").find(u).addClass("error");
- t.closest(".socialSiteGroup").find(u).addClass("valid")
- })
- }
- function vt() {
- n(s).length > 0 ? si() : hi()
- }
- function yt() {
- var t = [];
- return n.each(getCheckedItemsInTable("url"), function(n, i) {
- t.push(htmlDecodeJQuery(i))
- }), t
- }
- function ci() {
- g(yt())
- }
- function g(n) {
- var t = {
- connectedUrls: JSON.stringify(n)
- };
- startPostRequestWithJson(t, tt, vi, pt, h)
- }
- function w(t, i, r) {
- var u = {
- urls: r,
- startDate: t,
- endDate: i
- };
- n.ajax({
- url: ot,
- data: u,
- type: "GET",
- success: li,
- error: reportError,
- traditional: !0
- })
- }
- function li(t) {
- var i;
- i = n(t);
- i.find(" tr").each(function() {
- var i, r, t;
- i = n(this);
- t = nt(htmlDecodeJQuery(i.attr("url")));
- t && t.length == 1 && (r = n(t[0]), r.find("td:gt(2):lt(4)").remove(), r.find("td:eq(2)").after(i.find("td")))
- });
- showSparklines();
- ai()
- }
- function ai() {
- n(i + " tr").each(function() {
- var t = n(this);
- t.find(f + "[verified='1']").length > 0 && t.hover(function() {
- var t = n(this);
- t.css("background-color", "#efefef");
- t.css("cursor", "pointer")
- }, function() {
- var t = n(this);
- t.css("background-color", "#ffffff");
- t.css("cursor", "default")
- });
- n(this).find("td:gt(0)").click(function() {
- var t = n(this),
- i;
- t.parent().find(f + "[verified='1']").length > 0 && (i = htmlDecodeJQuery(t.parent().find(f + "[verified='1']").attr("url")), window.location.href = ft + "&socialUrl=" + encodeURIComponent(i))
- })
- })
- }
- function vi(r) {
- var u, e, f;
- if (hideActivityIndicator(), unsetModalActivityIndicator(), f = [], r)
- for (e = r.length, u = 0; u < e; u++) r[u].RequestId || f.push(r[u].Url);
- bt(r);
- dt();
- f.length > 0 && w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val(), f);
- n(t).append("<div class='blink-icon-selectdrop'/>");
- b(htmlDecodeJQuery(n(t).attr("url")));
- unCheckAllCheckBoxes("#toggleAll", i);
- k()
- }
- function pt(i) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(i);
- b(htmlDecodeJQuery(n(t).attr("url")))
- }
- function wt(n, t, i) {
- c[t] || (c[t] = 0);
- var r = {
- requestId: n,
- socialUrl: t,
- lastCall: i
- };
- startGetRequestWithJson(r, ct, function(i) {
- yi(i, n, t)
- }, pt)
- }
- function yi(t, i, r) {
- t ? (bt(t), w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val(), [r]), k()) : c[r]++ < 10 && window.setTimeout(function() {
- wt(i, r, c[r] === 10)
- }, 3e3)
- }
- function bt(t) {
- for (var u, s, c, o, h, l = t.length, e = 0; e < l; e++) h = htmlEncodeJQuery(t[e].Url), (t[e].RequestId || !t[e].IsVerified) && (s = n('<td class="socialSiteClicks"/>').append(n("<div class='metabox' style='margin:0'><span><\/span><\/div>")), s.find("span").append(t[e].StatusFormatted + " "), t[e].RequestId ? wt(t[e].RequestId, t[e].Url) : (c = ['<img class="info-pop-up" src="/webmaster/content/images/info.png" width="15">', '<div class="info-pop-up" style="top: 267px; left: 919px; display: none;"><div class="pop-up-pointer">', '<img class="box-caption" src="/webmaster/content/images/box-caption.png" height="15"><\/div><div class="pop-up-content"><span>', et, "<\/span><p>", t[e].FailureReason, '<\/div><div class="pop-up-pointer"><img class="box-caption-bottom" src="/webmaster/content/images/box-caption-down.png" height="15" style="display: none;">', "<\/div><\/div><\/td>"], s.find("span").append(n(c.join(""))))), u = nt(t[e].Url), u && u.length == 1 ? (o = n(u[0]), t[e].IsVerified ? o.find(f).attr("verified") == "0" ? (o.find(".socialSiteClicks").remove(), u.append('<td class = "socialSiteClicks">' + r + "<\/td>"), u.append('<td class = "socialSiteImpressionTrends">' + r + "<\/td>"), u.append('<td class = "socialSiteClicks">' + r + "<\/td>"), u.append('<td class = "socialSiteClickTrends">' + r + "<\/td>")) : (u.find(".socialSiteClicks").text(r), u.find(".socialSiteImpressionTrends").text(r), u.find(".socialSiteClicks").text(r), u.find(".socialSiteClickTrends").text(r)) : (o.find(".socialSiteClicks").remove(), o.find("td:gt(2):lt(5)").remove(), o.find("td:eq(2)").after(s)), o.find(f).attr("verified", t[e].IsVerified ? 1 : 0), o.find(f).attr("data-isApp", t[e].IsConnectedApp ? 1 : 0)) : (u = n("<tr/>"), u.append(n('<td class="width20"/>').append(n("<input/>", {
- type: "checkbox",
- url: h
- })).append("<label/>")).append(n("<td>").append(n("<span>", {
- "class": "addSocialSiteIdColumn",
- url: h,
- "data-isApp": t[e].IsConnectedApp,
- verified: t[e].IsVerified ? 1 : 0
- }))).append(n('<td class="socialSiteUrl url-text"/>').append("<span class = url-text><\/span>").text(t[e].Url)), t[e].requestId || !t[e].IsVerified ? u.append(s) : (u.append('<td class = "socialSiteClicks">' + r + "<\/td>"), u.append('<td class = "socialSiteImpressionTrends">' + r + "<\/td>"), u.append('<td class = "socialSiteClicks">' + r + "<\/td>"), u.append('<td class = "socialSiteClickTrends">' + r + "<\/td>")), n(i + " tbody").prepend(u), u.find(":checkbox").change(setupGridCheckButtonEnabler(i + " table", v)), u.find(":checkbox").change(setupGridCheckButtonEnabler(i + " table", a))), n(i + " table").trigger("update"), initInfoHovers(), ni(), kt()
- }
- function pi() {
- var n = yt();
- startPostRequestWithJson({
- connectedUrls: JSON.stringify(n)
- }, rt, wi, bi, h)
- }
- function kt() {
- n("table.grid div.info-pop-up a").addClass("connected-reason-url url-text")
- }
- function wi(i) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- ki(i);
- dt();
- n("tr>td>input[type='checkbox']").each(function() {
- var t = n(this).parent();
- t.hasClass("width20") || t.addClass("width20")
- });
- n(t).append("<div class='blink-icon-selectdrop'/>");
- unCheckAllCheckBoxes("#toggleAll");
- k()
- }
- function bi(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function ki(t) {
- n.each(t, function(t, i) {
- n(nt(i)).remove()
- });
- n(i + " table").trigger("update")
- }
- function nt(t) {
- var i = [f, "[url='", htmlEncodeJQuery(t), "']'"];
- return n(i.join("")).parent().parent()
- }
- function dt() {
- n("div.socialSiteGroup input[type='text']").each(function() {
- n(this).val("")
- });
- n("#socialSiteStartupTable input[type='text']").each(function() {
- n(this).val("")
- });
- n(t).text(it);
- n(t).attr("url", "")
- }
- function di() {
- n(u).keyup(new onEnterPressExecute(function() {
- n(this).blur();
- n(o).attr("disabled") || vt()
- }).eventHandler)
- }
- function gt(i) {
- var r;
- r = htmlDecodeJQuery(n(i).attr("url"));
- n(t).text(n(i).text());
- n(t).attr("url", htmlEncodeJQuery(r));
- n(e).hide();
- n(t).append(n('<div class="blink-icon-selectdrop"/>'));
- n(t).addClass("url-text");
- b(r)
- }
- function b(t) {
- var i = "";
- n(u).each(function() {
- i += n(this).val()
- });
- h === p && (t = "a");
- t && i && !ht ? n(o).removeAttr("disabled") : n(o).attr("disabled", "disabled")
- }
- function ni() {
- n(f + "[verified='0']").each(function() {
- n(this).parent().next().next().attr("colspan", "5")
- })
- }
- function k() {
- var t = n("span.addSocialSiteIdColumn[data-isapp=1][verified=1]", i + " table").length > 0;
- t ? n("div#appLinkingLink").show() : n("div#appLinkingLink").hide()
- }
- function gi(g, nt, lt, at, yt, pt, wt, bt, dt, si, hi, li, ai, vi, yi) {
- s = "#socialSiteForm";
- o = "#submitSocialSite";
- v = "#removeConnectedSite";
- a = "#verifyNowConnectedSite";
- l = "#inputSocialSite";
- ri = "#socialSiteTextBoxContainer";
- ii = "#socialSiteDropDown";
- i = "#socialSitesList";
- ut = "custom";
- t = "div.socialSiteSelected";
- e = "div.socialSiteDropList";
- y = "div.socialSiteDropElement";
- p = "#socialSiteFormStartup";
- st = "#socialSiteStartupTable";
- u = ".socialSiteExtensionInput";
- f = "span.addSocialSiteIdColumn";
- ti = g;
- tt = nt;
- rt = lt;
- ot = yt;
- ft = at;
- ct = pt;
- fi = wt;
- et = bt;
- ui = dt;
- oi = hi;
- ei = si;
- r = ai;
- it = li;
- h = n(s).length > 0 ? s : p;
- ht = yi === "True";
- c = {};
- w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val());
- ni();
- n(v).click(pi);
- n(o).click(vt);
- n(a).click(ci);
- n("#wmbody").css("min-width", "1100px");
- n(t).click(function(t) {
- t.stopPropagation();
- n(e).is(":visible") ? n(e).hide() : n(e).show()
- });
- n(y).click(function(n) {
- n.stopPropagation();
- gt(this)
- });
- n(t).keyup(function(t) {
- t.which == 40 && (n(e).show(), n(y)[0].focus())
- });
- n(y).keyup(function(t) {
- t.which == 40 && n("div.socialSiteDropElement:focus").next().focus();
- t.which == 38 && n("div.socialSiteDropElement:focus").prev().focus();
- t.which == 13 && gt(this)
- });
- formValidateOptions.ignore = "";
- formValidateOptions.messages = [];
- formValidateOptions.messages.inputSocialSiteHidden = vi;
- n(".socialPageExtension").each(function(n) {
- formValidateOptions.messages["inputSocialSiteHidden" + n] = vi
- });
- n(h).validate(formValidateOptions);
- n(o).attr("disabled", "disabled");
- n(i + " table :checkbox").change(setupGridCheckButtonEnabler(i + " table", v));
- n(i + " table :checkbox").change(setupGridCheckButtonEnabler(i + " table", a));
- di();
- n(document).click(function() {
- n(e).hide()
- });
- n(f).each(function() {
- var t = n(this);
- t.attr("verified") == "0" && t.parent().parent().find("td:gt(3)").remove()
- });
- n(u).focus(function() {
- d();
- n(u).addClass("valid");
- n("input.error").removeClass("error");
- n("div.validationErrorPlaceholder").children().remove();
- return
- });
- n(u).keyup(function() {
- var i = htmlDecodeJQuery(n(t).attr("url"));
- b(i)
- });
- n("#periodSelectorContainer").bind("dateChanged", function() {
- showActivityIndicator(!1);
- w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val())
- });
- kt();
- n("tr.connectedTableHeader>th:eq(0)").addClass("connectedCheckBoxHeader");
- n("tr.connectedTableHeader>th:eq(1)").addClass("width0");
- n("tr.connectedTableHeader>th:eq(2)").addClass("connectedUrlHeader");
- n("tr.connectedTableHeader>th:eq(3)").addClass("connectedRightAlignColumnHeader connectedStatHeader");
- n("tr.connectedTableHeader>th:eq(4)").addClass("connectedCenterAlignColumnHeader connectedStatHeader");
- n("tr.connectedTableHeader>th:eq(5)").addClass("connectedRightAlignColumnHeader connectedStatHeader");
- n("tr.connectedTableHeader>th:eq(6)").addClass("connectedCenterAlignColumnHeader connectedStatHeader");
- k()
- }
- var s, o, l, ti, tt, ii, i, a, it, v, rt, ri, ut, ft, et, ui, fi, ot, h, ei, oi, t, e, y, p, st, u, r, f, ht, ct, c;
- return {
- initialize: gi
- }
- }
- n.socialSiteController = function() {
- return new t
- }
- }(jQuery),
- function(n) {
- function t(t) {
- function u() {
- f()
- }
- function f() {
- n("#saveApps").click(o);
- e()
- }
- function e() {
- n("#connectedAppList table.wmtable :checkbox").change(r)
- }
- function o() {
- var t, i;
- showActivityIndicator(!0);
- t = [];
- n("tr.row-selected", "#connectedAppList table.wmtable tbody").each(function() {
- var i = n(this).find("span[data-field=appId]").text(),
- r = n(this).find("span[data-field=appType]").attr("data-appType"),
- u = n(this).find("span[data-field=isDeepLaunchSupported] input").attr("checked") == "checked",
- f = n(this).find("span[data-field=linked] input").attr("checked") == "checked",
- e = {
- Site: url,
- AppId: i,
- AppType: r,
- IsBlocked: !f,
- IsDeepLaunchSupported: u
- };
- t.push(e)
- });
- i = {
- viewModelApps: JSON.stringify(t)
- };
- s(i, h, unsetModalAndReportErrorHandler)
- }
- function s(n, i, r) {
- startPostRequestWithJson(n, t.UpdateUrl, i, r, "#connectedAppsForm")
- }
- function h(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n.each(t, function(t, i) {
- var r = n('tr:contains("' + i.AppId + '")');
- r.find("span[data-field=isDeepLaunchSupported] input").attr("value", i.IsDeepLaunchSupported);
- r.find("span[data-field=linked] input").attr("value", !i.IsBlocked);
- r.find("span[data-field=lastModified]").text(i.LastModifiedFormatted)
- });
- n("#connectedAppList table.wmtable").trigger("update")
- }
- var i = {},
- r = setupGridCheckboxChangeEnalber("#connectedAppList table.wmtable", "#saveApps");
- return i.initialize = u, i
- }
- n.connectedAppsController = function(n) {
- return new t(n)
- }
- }(jQuery),
- function(n) {
- n.fn.crawlControl = function(t) {
- function y(n) {
- r();
- reportError(n)
- }
- for (var o, u = new Date, f = (24 + getLocalTimezoneOffset(u)) % 24, s = n(".crawl-control-chart > div:first-child"), i = t.crawlRate, r = function() {
- window.readOnlyMode || n("#save").attr("disabled", !1)
- }, a = function() {
- n("#preset").val() != "" && n("#preset").val("");
- r()
- }, v = function(n) {
- if (n != null) {
- i = [];
- for (var t = 0; t < 24; ++t) i[t] = n[(24 + t - f) % 24][1];
- r()
- }
- }, h = function(i) {
- for (var o, e, c, l, y, h = [], r = 0; r < 24; ++r) h.push([parseInt(r), i[(r + f) % 24]]);
- for (o = [], r = 0; r < 11; ++r) o[r] = [r, ""];
- for (e = [], r = 0; r <= 24; ++r) c = r % (t.has24Hours ? 24 : 12), e[r] = [r, c.toString()];
- !t.has24Hours && t.AMDesignator.length > 0 && (e[0] = [0, '<span class="nowrap crawl-control-ampm">12 ' + t.AMDesignator + "<\/span>"], e[24] = [24, '<span class="nowrap crawl-control-ampm">12 ' + t.AMDesignator + "<\/span>"]);
- !t.has24Hours && t.PMDesignator.length > 0 && (e[12] = [12, '<span class="nowrap crawl-control-ampm">12 ' + t.PMDesignator + "<\/span>"]);
- l = function() {
- var n = [];
- return n.push({
- xaxis: {
- from: u.getHours(),
- to: u.getHours() + 1
- }
- }), n
- };
- y = {
- colors: [window.readOnlyMode ? "#adadad" : "#71ccee"],
- xaxis: {
- mode: "number",
- min: 0,
- max: 24,
- minTickSize: 1,
- tickSize: 1,
- tickFormatter: function(n) {
- return formatNumber(n)
- },
- ticks: e
- },
- yaxis: {
- mode: "number",
- min: 0,
- max: 10,
- minTickSize: 1,
- tickSize: 1,
- tickFormatter: function(n) {
- return formatNumber(n)
- },
- ticks: o
- },
- series: {
- lines: {
- show: !1,
- fill: !1
- },
- bars: {
- show: !0,
- lineWidth: 0,
- barWidth: 1,
- fill: !0,
- fillColor: window.readOnlyMode ? "#adadad" : "#00adee",
- align: "left"
- }
- },
- grid: {
- tickColor: "#ffffff",
- backgroundColor: "#e6e6e6",
- borderWidth: 0,
- markings: l,
- markingsColor: "rgba(100,100,100,0.2)",
- aboveData: !0
- },
- webmastercrawldelay: {
- enabled: !window.readOnlyMode && !t.widget,
- onChange: v,
- onChangeBegin: a,
- highlightRadius: 2,
- autoHighlight: !1
- }
- };
- n.plot(s, [h], y)
- }, c = function() {
- n("#save").attr("disabled", "disabled");
- var r = {
- Site: url,
- CrawlBoostAvailable: t.boostAvailable,
- CrawlBoostEnabled: !!n("#crawlboost").is(":checked"),
- CrawlRate: i
- };
- startPostRequestWithJson({
- settings: JSON.stringify(r)
- }, t.SaveUrl, function() {}, y, "#addParamForm")
- }, p = function() {
- var u, r, t;
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
- for (u = !1, r = [], t = 0; t < 24; ++t) r[t] = t < i.length && i[t] != null ? i[t] : 5, r[t] > 3 && (u = !0);
- if (i = r, !u) {
- n("#forceSaveDialog").jqm({
- overlay: 10,
- modal: !0
- }).jqmShow();
- return
- }
- c();
- n("#save").attr("disabled", "disabled")
- }
- }, w = function() {
- var e, u, t;
- if (n(this).val() != "") {
- for (e = n(this).val().split(","), u = [], t = 0; t < 24; ++t) u[t] = parseInt(e[(24 + t - f) % 24]);
- i = u;
- h(u);
- r()
- }
- }, l = [], e = 0; e < 24; ++e) l[e] = parseInt(t.crawlRate[(24 + e + f) % 24]);
- o = l.join(",");
- n("#preset").find("option").each(function() {
- n(this).val() == o && n("#preset").val(o)
- });
- n("#localtime").text(u.toLocaleTimeString());
- h(t.crawlRate);
- n("#preset").change(w);
- n("#crawlboost").change("change", r);
- n("#save").click(p);
- n("#forcesave").click(function() {
- n("#forceSaveDialog").jqmHide();
- c()
- });
- t.widget && s.click(function() {
- window.location = t.crawlControlUrl
- })
- }
- }(jQuery),
- function(n) {
- function t(t) {
- function h(n) {
- c();
- i.All = n
- }
- function c() {
- n("#submitDeepLinkBlock").click(l);
- n("#extendBlock").click(a);
- n("#removeBlock").click(v);
- n("#blockDeepLinkForm").validate(formValidateOptions);
- r()
- }
- function r() {
- n("table.wmtable :checkbox").change(o);
- n("table.wmtable :checkbox").change(s)
- }
- function l() {
- var u, t, e, o, r, s;
- fixPlaceholdersBeforeInFormSubmit(n("#blockDeepLinkForm"));
- n("#blockDeepLinkForm").valid() && (u = n("#inputDeepLink").val(), t = n("#inputParentLink").val(), e = n("#dropdownMarket").val(), t || (t = i.All), o = {
- DeepLinkUrl: u,
- SearchUrl: t,
- Market: e,
- ExpiryDate: new Date
- }, r = [], r.push(o), s = {
- deepLinks: JSON.stringify(r)
- }, f(s, p))
- }
- function a() {
- var n = u(),
- t = {
- deepLinks: JSON.stringify(n)
- };
- f(t, w)
- }
- function v() {
- var n = u(),
- t = {
- deepLinks: JSON.stringify(n)
- };
- y(t, b)
- }
- function u() {
- var t = [];
- return n("table.wmtable :checkbox:checked").each(function() {
- var i = {
- DeepLinkUrl: n(this).attr("dl"),
- SearchUrl: n(this).attr("bu"),
- Market: n(this).attr("bmc")
- };
- t.push(i)
- }), t
- }
- function f(n, i, r) {
- startPostRequestWithJson(n, t.AddUrl, i, r, "#blockDeepLinkForm")
- }
- function y(n, i, r) {
- startPostRequestWithJson(n, t.RemoveUrl, i, r, "#blockDeepLinkForm")
- }
- function p(t) {
- var u, f;
- hideActivityIndicator();
- unsetModalActivityIndicator();
- t && t.length == 1 && (u = t[0].SearchUrl, u = u && u !== i.All ? createExternalUrl(t[0].SearchUrl) : wr.G_All, f = n("<tr/>"), f.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- dl: t[0].DeepLinkUrl,
- bu: t[0].SearchUrl,
- bmc: t[0].Market
- })).append("<label>")).append(n('<td class="leftalign deepLinkUrl" />').append(createExternalUrl(t[0].DeepLinkUrl))).append(n('<td class="leftalign blockedUrl" />').append(u)).append(n('<td class="blockedMarket"/>').text(t[0].MarketFormatted)).append(n('<td class="daysToExpire"/>').text(t[0].DaysToExpireFormatted)).append(n('<td class="blockedDate"/>').text(t[0].SubmitDateFormatted)), n("#deepLinkBlockList tbody").prepend(f), k(), r(), n("#deepLinkBlockList table.wmtable").trigger("update"))
- }
- function w(t) {
- var i, f, u;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), f = t.length, i = 0; i < f; i++) u = e(t[i].DeepLinkUrl, t[i].SearchUrl, t[i].Market), n(u.find(".blockedDate")[0]).text(t[i].SubmitDateFormatted), n(u.find(".daysToExpire")[0]).text(t[i].DaysToExpireFormatted);
- r();
- unCheckAllCheckBoxes();
- n("#deepLinkBlockList table.wmtable").trigger("update")
- }
- function b(t) {
- var i, u, f;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), u = t.length, i = 0; i < u; i++) f = e(t[i].DeepLinkUrl, t[i].SearchUrl, t[i].Market), n(f).remove();
- r();
- unCheckAllCheckBoxes();
- n("#deepLinkBlockList table.wmtable").trigger("update")
- }
- function e(t, i, r) {
- var u = ["table.wmtable :checkbox[dl='", t, "'][bu='", i, "'][bmc='", r, "']"];
- return n(u.join("")).parent().parent()
- }
- function k() {
- var t = n("#inputDeepLink"),
- i = n("#inputParentLink");
- t.val("");
- i.val("");
- n("#dropdownMarket").val(0);
- hasPlaceholderSupport() || (t.focus(), t.blur(), i.focus(), i.blur())
- }
- var i = {
- All: "all"
- },
- o = setupGridCheckButtonEnabler("table.wmtable", "#extendBlock"),
- s = setupGridCheckButtonEnabler("table.wmtable", "#removeBlock");
- return i.initialize = h, i
- }
- n.blockDeepLinksController = function(n) {
- return new t(n)
- }
- }(jQuery),
- function(n) {
- n.fn.disavowSelector = function(t) {
- function i(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function o(t) {
- var i = {};
- i[t.DisavowedUrl] = !0;
- n("table.wmtable :checkbox").each(function() {
- i[n(this).attr("qp")] && t.EntityType == n(this).attr("et") && n(this).parent().parent().remove()
- })
- }
- function s(t) {
- var i, e;
- hideActivityIndicator();
- unsetModalActivityIndicator();
- o(t);
- i = "";
- t.EntityType == r ? i = wr.G_Page : t.EntityType == u ? i = wr.G_Directory : t.EntityType == f && (i = wr.G_Domain);
- e = "";
- e = readOnlyMode ? n.validator.format('<tr><td><span class="url-text">{0}<\/span><\/td><td>{1}<\/td><td>{2}<\/td><\/tr>', t.DisavowedUrl, i, t.DateFormatted) : n.validator.format('<tr><td><input type="checkbox" qp="{0}" et="{1}" ><label><\/label><\/td><td>{2}<\/td><td><span class="url-text">{3}<\/span><\/td><td>{4}<\/td><\/tr>', t.DisavowedUrl, t.EntityType, t.DisavowedUrl, i, t.DateFormatted);
- n("#urlDisavowList tbody").prepend(e);
- n("#inputDisavowUrl").val("");
- triggerCheckboxChange();
- n("#urlDisavowList table.grid").trigger("update")
- }
- function h(n, r) {
- showActivityIndicator(!0);
- startPostRequestWithJson({
- disavowUrl: n,
- entityType: r
- }, t.AddUrl, s, i, "#disavowUrlForm")
- }
- function c(t, i) {
- var u, f, r;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, f = {}, r = 0; r < t.length; ++r) f[t[r]] = !0, u[t[r]] = i[r];
- n("table.wmtable :checkbox").each(function() {
- f[n(this).attr("qp")] && u[n(this).attr("qp")] == n(this).attr("et") && n(this).parent().parent().remove()
- });
- triggerCheckboxChange();
- n("#urlDisavowList table.grid").trigger("update")
- }
- function l(n, r) {
- showActivityIndicator(!0);
- startPostRequestWithJson({
- urlsToProcess: n,
- entitiesToProcess: r
- }, t.RemoveUrl, function() {
- c(n, r)
- }, i, "#disavowUrlForm", null, {
- traditional: !0
- })
- }
- function a() {
- n("#urlDisavowList table.wmtable :checkbox").live("change", e);
- n("#disavowUrlButton").click(function() {
- if ($id("disavowUrlForm").valid()) {
- var t = n("#entitySelected").val(),
- i = n("#inputDisavowUrl").val();
- h(i, t)
- }
- });
- n("#stopDisavowing").click(function() {
- var t = [],
- i = [];
- n("table.wmtable :checked").each(function() {
- var r = n(this),
- u = r.attr("qp"),
- f = r.attr("et");
- t.push(u);
- i.push(f)
- });
- t.length > 0 && i.length > 0 && l(t, i)
- });
- $id("disavowUrlForm").validate(formValidateOptions);
- clickButtonOnEnter("#disavowUrlButton", "#inputDisavowUrl")
- }
- var r = 0,
- u = 1,
- f = 2,
- e = setupGridCheckButtonEnabler("#urlDisavowList table.wmtable", "#stopDisavowing");
- a()
- }
- }(jQuery),
- function(n) {
- var t = function() {
- function n(n) {
- this.onGridCheck = setupGridCheckButtonEnabler("#paramList table.wmtable", "#removeParam");
- this.options = n
- }
- return n.prototype.Run = function() {
- var n = this,
- t = function(t) {
- return n.addParam(t)
- },
- i = function(t) {
- return n.removeParams(t)
- },
- r = function(t) {
- return n.urlTypeChange(t)
- };
- $("#addParam").click(function() {
- t($(this))
- });
- $("#removeParam").click(function() {
- i($(this))
- });
- $("#addParamForm").validate(formValidateOptions);
- $(document).on("change", "#paramList table.wmtable :checkbox", this.onGridCheck);
- clickButtonOnEnter("#addParam", ["#url"]);
- $("#urltype").change(function() {
- r($(this))
- })
- }, n.prototype.enableControls = function() {
- $("#country").prop("disabled", !1);
- $("#url").prop("disabled", !1);
- $("#urltype").prop("disabled", !1);
- $("#addParam").prop("disabled", !1)
- }, n.prototype.disableControls = function() {
- $("#country").prop("disabled", !0);
- $("#url").prop("disabled", !0);
- $("#urltype").prop("disabled", !0);
- $("#addParam").prop("disabled", !0)
- }, n.prototype.addParam = function(n) {
- var t = this,
- i;
- n.attr("disabled") == "disabled" || readOnlyMode || $("#addParamForm").valid() && (i = {
- Url: $("#url").val(),
- Type: $("#urltype").val(),
- Region: $("#country").val()
- }, showActivityIndicator(!0), this.disableControls(), startPostRequestWithJson({
- settings: JSON.stringify(i)
- }, this.options.AddUrl, function(n) {
- return t.addParamSuccess(n)
- }, function(n) {
- return t.addParamFailure(n)
- }, "#addParamForm"))
- }, n.prototype.addParamSuccess = function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- this.enableControls();
- $("#url").val("");
- $("#url").prop("readonly", !1);
- $("#paramList table.wmtable input[type=checkbox]").each(function() {
- $(this).attr("url") == n.Url && $(this).attr("urltype") == n.Type && $(this).parent().parent().remove()
- });
- var t = $("<tr/>");
- t.append($("<td/>").append($("<input>", {
- type: "checkbox",
- url: n.Url,
- urltype: n.Type
- })).append($("<label/>"))).append($("<td/>").append($("<span>", {
- "class": "url-text"
- }).text(n.Url))).append($("<td/>").text(n.TypeFormatted)).append($("<td/>").text(n.Region)).append($("<td/>").text(n.DateFormatted));
- $("#paramList table.wmtable tbody").prepend(t);
- $("#paramList table.wmtable").trigger("update")
- }, n.prototype.addParamFailure = function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- this.enableControls();
- reportError(n)
- }, n.prototype.removeParams = function() {
- var t = this,
- n = [];
- $("#paramList table.wmtable :checked").each(function() {
- var t = $(this),
- i = {
- Url: t.attr("url"),
- Type: t.attr("urltype")
- };
- n.push(i)
- });
- n.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
- settings: JSON.stringify(n)
- }, this.options.RemoveUrl, function(i) {
- return t.removeParamsSuccess(i, n)
- }, function(n) {
- return t.removeParamsFailure(n)
- }, "#addParamForm"))
- }, n.prototype.removeParamsSuccess = function(n, t) {
- var r, i;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i].Url + "|" + t[i].Type] = !0;
- $("#paramList table.wmtable input[type=checkbox]").each(function() {
- var n = $(this).attr("url") + "|" + $(this).attr("urltype");
- r[n] && $(this).parent().parent().remove()
- });
- this.onGridCheck();
- $("#paramList table.wmtable").trigger("update")
- }, n.prototype.removeParamsFailure = function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }, n.prototype.urlTypeChange = function(n) {
- n.val() == "2" ? ($("#url").val(url), $("#url").prop("readonly", !0)) : n.val() == "3" && $('#urltype option[value="3"]').attr("locked") == "1" ? ($("#url").val(url), $("#url").prop("readonly", !0)) : $("#url").prop("readonly", !1)
- }, n
- }();
- n.GeoTargeting = t
- }(Configure || (Configure = {})),
- function(n) {
- function t(t) {
- function h(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i && ($id(t.Param).remove(), i = !1);
- var r = "";
- r = readOnlyMode ? n.validator.format("<tr><td>{0}<\/td><td>{1}<\/td><\/tr>", t.Param, t.DateFormatted) : n.validator.format('<tr><td><input type="checkbox" qp="{0}"><label><\/label><\/td><td>{1}<\/td><td>{2}<\/td><\/tr>', t.Param, t.Param, t.DateFormatted);
- n("#qpList tbody").prepend(r);
- n("#inputQueryParam").val("");
- n("#qpList table.grid").trigger("update");
- triggerCheckboxChange();
- n("table.wmtable :checkbox").change(u)
- }
- function c(n) {
- i = !1;
- o(n)
- }
- function e(i) {
- if (!(i.length < 1)) {
- if (i.length > f) {
- reportError({
- Message: n.validator.format(wr.QueryParam_CharLimit, f)
- });
- return
- }
- showActivityIndicator(!0);
- startPostRequestWithJson({
- queryParam: i
- }, t.AddUrl, h, c, "#ignoreParaForm")
- }
- }
- function l(t, i) {
- var u, r;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, r = 0; r < i.length; ++r) u[i[r]] = !0;
- n("table.wmtable :checkbox").each(function() {
- u[n(this).attr("qp")] && n(this).parent().parent().remove()
- });
- triggerCheckboxChange();
- n("#qpList table.grid").trigger("update")
- }
- function o(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function a(n) {
- o(n)
- }
- function v(n) {
- showActivityIndicator(!0);
- startPostRequestWithJson({
- queryParameters: n
- }, t.RemoveUrl, function(t) {
- l(t, n)
- }, a, "#ignoreParaForm", null, {
- traditional: !0
- })
- }
- function s(n) {
- i = !0;
- e(n)
- }
- function y(t) {
- jQuery.browser.msie && (t.cancelBubble = !0);
- t.stopPropagation();
- n("#moreLink").hasClass("opened") ? (n("#spanForDisabledQpHide").hide(), n("#moreLink").removeClass("opened")) : (n("#spanForDisabledQpHide").show(100), n("#moreLink").addClass("opened"))
- }
- var r = {},
- i = !1,
- u = setupGridCheckButtonEnabler("table.wmtable", "#removeParam"),
- f = 100;
- return r.go = function() {
- n("table.wmtable :checkbox").change(u);
- n("#more").click(y);
- n(document).click(function() {
- n("#spanForDisabledQpHide").hide();
- n("#moreLink").removeClass("opened")
- });
- n("#submitQueryParam").click(function() {
- if ($id("ignoreParaForm").valid()) {
- var t = n("#inputQueryParam").val();
- e(t)
- }
- });
- n("#spanForDisabledQp a").click(function() {
- var t = n(this).attr("id");
- s(t)
- });
- n("#spanForDisabledQpHide a").click(function() {
- var t = n(this).attr("id");
- s(t)
- });
- n("#removeParam").click(function() {
- var t = [];
- n("table.wmtable :checked").each(function() {
- var i = n(this),
- r = i.attr("qp");
- t.push(r)
- });
- t.length > 0 && v(t)
- });
- clickButtonOnEnter("#submitQueryParam", "#inputQueryParam");
- $id("ignoreParaForm").validate(formValidateOptions)
- }, r
- }
- n.ignoretheseparametersController = function(n) {
- return new t(n)
- }
- }(jQuery),
- function(n) {
- function t() {
- function st(i, r, u, f, e, o, s, h, c, l, a, v, y, p, w) {
- t.SiteUrl = i;
- t.FormId = r;
- t.ActionDictionary = u;
- t.BlockReasons = f;
- t.RefreshReasons = e;
- t.RemoveDetailsSection = at;
- t.SwitchFormButtons = vt;
- t.PageUpdateUrl = o;
- t.PageDetailsUrl = s;
- t.PageRemoveUrl = h;
- t.PageRefreshUrl = c;
- t.PreviewRequestUrl = l;
- t.PagePreviewSuccessMessage = a;
- t.PagePreviewLowQualityMessage = v;
- t.RefreshInProgressMessage = y.replace("{0}", "");
- t.InlineDetailsControl = n.previewDetailsController();
- t.InlineDetailsControl.initialize(t);
- t.BlockAtMaxWarning = n.format(p, w);
- t.ExpiryInDays = w;
- ht()
- }
- function ht() {
- n(e).click(g);
- n(h).click(ct);
- n(c).click(lt);
- n(u + " tr").each(function() {
- var u, f;
- u = n(this);
- f = u.find("input[type='checkbox']");
- f.length == 1 && (u.addClass(l), u.find("td").each(function(u) {
- u > 0 && n(this).click(f.attr(r), function(u) {
- var f = n(i);
- n(a).attr(r, u.data);
- n(i).removeAttr("readonly");
- f.val(u.data);
- n(i).attr("readonly", "");
- t.InlineDetailsControl.show(u)
- })
- }))
- });
- n(f).validate(formValidateOptions);
- n(i).keyup(new onEnterPressExecute(function() {
- n(this).blur();
- g()
- }).eventHandler);
- o()
- }
- function o() {
- n("table.wmtable :checkbox").change(et);
- n("table.wmtable :checkbox").change(ot)
- }
- function g() {
- if (n(t.FormId).valid()) {
- var r = n(i).val();
- t.InlineDetailsControl.show({
- data: r
- })
- }
- }
- function ct() {
- var n = nt(),
- i;
- if (n.length == 1 && n[0].Expiry === t.ExpiryInDays) {
- showErrorMessage(t.BlockAtMaxWarning, wr.G_Warning);
- return
- }
- i = {
- pagePreviews: JSON.stringify(n)
- };
- yt(i, function(n) {
- it(n, !0)
- })
- }
- function lt() {
- var i = nt(),
- r;
- n.each(i, function(n, i) {
- i.Action = t.ActionDictionary[y]
- });
- r = {
- pagePreviews: JSON.stringify(i)
- };
- pt(r, function(n) {
- rt(n, !0)
- })
- }
- function nt() {
- var t = [];
- return n("table.wmtable :checkbox:checked").each(function() {
- var i = n(this),
- u = {
- Url: i.attr(r),
- Expiry: i.parent().parent().find("td:eq(2)").text()
- };
- t.push(u)
- }), t
- }
- function at() {
- var i = n(t.InlineSelector).children();
- i && i.length > 0 && i.remove()
- }
- function vt() {
- tt(p);
- tt(w);
- n(i).removeAttr("readonly");
- n(b).hide();
- n(k).hide();
- n(e).show();
- n(d).hide()
- }
- function tt(t) {
- for (var i = n(t)[0]; i.options.length;) i.options[0] = null;
- n(i).attr("disabled")
- }
- function yt(n, i, r) {
- startPostRequestWithJson(n, t.PageUpdateUrl, i, r, f)
- }
- function pt(n, i, r) {
- startPostRequestWithJson(n, t.PageRemoveUrl, i, r, f)
- }
- function it(i, r) {
- var f, h, e;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), h = i.length, f = 0; f < h; f++) e = ut(i[f].Url, i[f].Action), n(e.find(".previewDateSubmitted")[0]).text(i[f].SubmitDateFormatted), n(e.find(".previewDaysToExpiry")[0]).text(i[f].DaysToExpireFormatted);
- o();
- unCheckAllCheckBoxes("#toggleAll");
- r && (t.InlineDetailsControl.hideDetailsAnimation(!0), s());
- n(u + " table.wmtable").trigger("update")
- }
- function rt(i, r) {
- var f, e, h;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), e = i.length, f = 0; f < e; f++) h = ut(i[f].Url, t.ActionDictionary[v]), n(h).remove();
- o();
- unCheckAllCheckBoxes("#toggleAll");
- n(u + " table.wmtable").trigger("update");
- r && (t.InlineDetailsControl.hideDetailsAnimation(!0), s())
- }
- function ut(t, i) {
- var u = n(["table.wmtable :checkbox[", r, "='", t, "'][action='", i, "']"].join(""));
- return u.parent().parent()
- }
- function s() {
- var t = n(i);
- t.val("");
- hasPlaceholderSupport() || (t.focus(), t.blur())
- }
- var e, h, c, u, l, r, i, a, v, y, f, p, w, b, k, d, ft;
- e = "#submitPreview";
- h = "#extendBlock";
- c = "#removeBlock";
- u = "#previewBlockList";
- l = "pagePreviewRow";
- r = "previewUrl";
- i = "#inputPagePreviewUrl";
- a = "div.pagePreviewStatus";
- f = "#pagePreviewForm";
- v = "block";
- y = "unblock";
- p = "#pagePreviewReasonDropDown";
- w = "#pagePreviewActionDropDown";
- b = "#submitPreviewAction";
- k = "#cancelPreviewAction";
- d = "label.pagePreviewDropDownField";
- ft = "#pagePreviewBlockAtMax";
- var t = {
- SiteUrl: "",
- FormId: "",
- ActionDictionary: [],
- BlockReasons: [],
- RefreshReasons: [],
- InlineSelector: "#pagePreviewDetailsInline"
- },
- et = setupGridCheckButtonEnabler("table.wmtable", "#extendBlock"),
- ot = setupGridCheckButtonEnabler("table.wmtable", "#removeBlock");
- return t.initialize = st, t.deletePreviewBlockSuccess = rt, t.extendPreviewBlockSuccess = it, t.ClearFormInput = s, t
- }
- n.blockPreviewController = function() {
- return new t
- }
- }(jQuery),
- function(n) {
- function t() {
- function yt(n) {
- i.SiteUrl = n.SiteUrl;
- t = n
- }
- function st(i) {
- var s = i.data;
- n.get(t.PageDetailsUrl + "&previewUrl=" + encodeURIComponent(s)).done(function(i) {
- var a, c = n(t.InlineSelector).children();
- c.length > 0 ? c.fadeOut(f, function() {
- t.RemoveDetailsSection();
- c = n(i);
- c.css({
- display: "none"
- });
- c.find(et).css({
- height: "200px",
- width: "360px"
- });
- c.find("div.line-item").css({
- height: "211px"
- });
- c.find(u).removeClass("none");
- n(t.InlineSelector).append(c);
- c.fadeIn(f);
- n(r).attr("readonly", "");
- n(h).hide();
- n(e).show();
- n(o).show();
- n(b).show();
- ht();
- hideActivityIndicator();
- k(n(l))
- }) : (c = n(i), n(t.InlineSelector).append(c), c.find(".line-item").animate({
- height: "211px"
- }, f), c.find("#pagePreviewImage").animate({
- height: "200px",
- width: "360px"
- }, f, function() {
- n(u).removeClass("none")
- }), n(r).attr("readonly", ""), n(h).hide(), n(e).show(), n(o).show(), n(b).show(), ht(), hideActivityIndicator(), k(n(l)));
- a = n(ft).attr("requestId");
- a !== "00000000-0000-0000-0000-000000000000" && window.setTimeout(function() {
- at(s);
- d(s, a, 1, !0)
- }, f + 100)
- }).fail(function(n) {
- showErrorMessage(JSON.parse(n.responseText).Message, wr.G_Error, !0)
- })
- }
- function ht() {
- i.Initialized || (n(e).click(wt), n(o).click(function() {
- n(r).val("");
- s(!0)
- }), n(l).change(pt), i.Initialized = !0)
- }
- function s(i) {
- i && t.SwitchFormButtons();
- n(u).remove();
- n(t.InlineSelector + " .line-item").animate({
- height: "0"
- }, 500);
- n("#pagePreviewImage").animate({
- height: "0",
- width: "0"
- }, 500, function() {
- t.RemoveDetailsSection()
- })
- }
- function pt() {
- k(n(this))
- }
- function k(i) {
- for (var u = i.val(), r = n(w)[0]; r.options.length;) r.options[0] = null;
- u === t.ActionDictionary[y].toString() ? (ct(r, t.BlockReasons), n(v).show()) : u === t.ActionDictionary[c].toString() ? (ct(r, t.RefreshReasons), n(v).show()) : n(v).hide()
- }
- function ct(n, t) {
- for (var r = t.length, i = 0; i < r; i++) n.options[n.options.length] = new Option(t[i][1], t[i][0])
- }
- function wt() {
- var o, f, i, r, e, s;
- n(p).valid() && (o = n(u).attr(a), f = n(w).val(), i = n(l).val(), r = {
- Url: o,
- SubmitDate: new Date,
- Action: i
- }, i == t.ActionDictionary[c] ? r.RefreshReason = f : i == t.ActionDictionary[y] && (r.BlockReason = f), e = [], e.push(r), s = {
- pagePreviews: JSON.stringify(e)
- }, lt(s, bt))
- }
- function lt(n, i, r) {
- startPostRequestWithJson(n, t.PageUpdateUrl, i, r, p)
- }
- function d(i, r, u, f) {
- var e = u;
- n.ajax({
- url: [t.PreviewRequestUrl, "&previewUrl=", encodeURIComponent(i), "&requestId=", encodeURIComponent(r), "&trial=", u].join(""),
- type: "GET",
- success: function(i) {
- var u = [],
- r;
- i.Preview ? (f ? (r = n(ot), r.children().remove(), r.append(["<img src='", i.Preview, "'id='pagePreviewImage'", " style='height: 200px; width: 360px; display: inline-block;'/>"].join(""))) : (hideActivityIndicator(), unsetModalActivityIndicator(), s(!0), t.ClearFormInput(), u.push(i), vt(u)), g(i.Url)) : i.RequestId !== "00000000-0000-0000-0000-000000000000" ? setTimeout(function() {
- d(i.Url, i.RequestId, e + 1, f)
- }, 4e3) : (showErrorMessage(i.ErrorString, wr.G_Error, !0), hideActivityIndicator(), unsetModalActivityIndicator(), s(!0), t.ClearFormInput(), g(i.Url))
- },
- error: function(n) {
- g();
- reportError(n)
- }
- })
- }
- function at(i) {
- n(e).attr("disabled", "disabled");
- n(o).attr("disabled", "disabled");
- n(h).attr("disabled", "disabled");
- i && n("<div class = pagePreviewRefreshInProgress>").text(t.RefreshInProgressMessage).insertAfter(n(ut))
- }
- function g(t) {
- n(e).removeAttr("disabled");
- n(o).removeAttr("disabled");
- n(h).removeAttr("disabled");
- t && n(u).find("div.pagePreviewRefreshInProgress").remove()
- }
- function bt(n) {
- if (n && n.length == 1 && n[0].Action == t.ActionDictionary[c] && n[0].RequestId) {
- at(n[0].Url);
- d(n[0].Url, n[0].RequestId, 1);
- return
- }
- hideActivityIndicator();
- unsetModalActivityIndicator();
- s(!0);
- t.ClearFormInput();
- vt(n)
- }
- function kt(i) {
- var h, f, e, c, l, o, u, r, a, v;
- e = i.RefreshBlocked ? "pagePreviewLowQImage" : "pagePreviewAcceptedImage";
- f = n("#" + e);
- h = f.parent();
- f.remove();
- c = ["<img src='", i.Preview, "'id=", e, "style='height: 200px; width: 360px;'/>"];
- h.append(n(c.join("")));
- i.RefreshBlocked ? (r = "#pagePreviewRefreshBlockedDialog", v = "#pagePreviewRefreshBlockedDialogTextContent", n(r).attr("url", i.Url), n(r).attr("reason", i.RefreshReason), n(n(r + " > .jqmClose")).each(function() {
- this.jqmHide = null
- }), n(v).html(n.validator.format(t.PagePreviewLowQualityMessage, ['<span class="url-text">', i.Url, "<\/span>"].join(""))), showPopupModalDialog(r, n(r)), n("#pagePreviewAcceptButton").click(function() {
- l = {
- Url: n(r).attr("url"),
- SubmitDate: new Date,
- RefreshReason: n(r).attr("reason"),
- Action: 1,
- BypassQualityCheck: !0
- };
- o = [];
- o.push(l);
- var i = {
- pagePreviews: JSON.stringify(o)
- };
- lt(i);
- n(r).jqmHide();
- hideActivityIndicator();
- unsetModalActivityIndicator();
- s(!0);
- t.ClearFormInput()
- })) : (u = "#pagePreviewRefreshSuccessDialog", a = "#pagePreviewRefreshSuccessDialogTextContent", n(n(u + " > .jqmClose")).each(function() {
- this.jqmHide = null
- }), n(a).html(n.validator.format(t.PagePreviewSuccessMessage, ['<span class="url-text">', i.Url, "<\/span>"].join(""))), showPopupModalDialog(u, n(u)))
- }
- function vt(i) {
- if (hideActivityIndicator(), unsetModalActivityIndicator(), i && i.length == 1) {
- if (i[0].Action == t.ActionDictionary[c]) {
- kt(i[0]);
- return
- }
- if (i[0].Action == t.ActionDictionary[rt]) {
- t.deletePreviewBlockSuccess(i);
- return
- }
- var f = n(["table.wmtable :checkbox[", a, "='", i[0].Url, "'][action='", i[0].Action, "']"].join("")).parent().parent();
- f.length > 0 ? (n(f.find(".previewDateSubmitted")[0]).text(i[0].SubmitDateFormatted), n(f.find(".previewDaysToExpiry")[0]).text(i[0].DaysToExpireFormatted)) : (f = n("<tr/>"), f.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- previewUrl: i[0].Url,
- action: i[0].Action
- })).append("<label>")).append(n('<td class="leftalign previewUrl" />').text(i[0].Url)).append(n('<td class="previewDaysToExpiry"/>').text(i[0].DaysToExpireFormatted)).append(n('<td class="previewDateSubmitted"/>').text(i[0].SubmitDateFormatted)), n("#previewBlockList tbody").prepend(f), f.find("td").each(function(t) {
- t > 0 && n(this).click(i[0].Url, function(t) {
- var i = n(r);
- n(u).attr(a, t.data);
- n(r).removeAttr("readonly");
- i.val(t.data);
- n(r).attr("readonly", "");
- st(t)
- })
- }), f.find(":checkbox").change(setupGridCheckButtonEnabler("table.wmtable", nt)), f.find(":checkbox").change(setupGridCheckButtonEnabler("table.wmtable", tt)), f.addClass(it), n("#previewBlockList table.wmtable").trigger("update"))
- }
- }
- var h, nt, tt, it, a, r, u, y, rt, ut, f, ft, c, p, w, l, e, o, b, v, et, ot, i, t;
- return h = "#submitPreview", nt = "#extendBlock", tt = "#removeBlock", it = "pagePreviewRow", a = "previewUrl", r = "#inputPagePreviewUrl", u = "div.pagePreviewStatus", p = "#pagePreviewForm", y = "block", rt = "unblock", c = "refresh", w = "#pagePreviewReasonDropDown", l = "#pagePreviewActionDropDown", e = "#submitPreviewAction", o = "#cancelPreviewAction", b = "label.pagePreviewDropDownField", v = "#pagePreviewReasonBlock", et = "#pagePreviewImage", ut = "div.previewDetailsTitle", ot = "#previewImageContainer", ft = "#pagePreviewDetailsSection", f = 500, i = {}, i.initialize = yt, i.show = st, i.hideDetailsAnimation = s, i
- }
- n.previewDetailsController = function() {
- return new t
- }
- }(jQuery),
- function(n) {
- n.fn.sitemaps = function(t, i) {
- function h(t) {
- for (var r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
- n("#sitemapsTable table.grid input[type=checkbox]").each(function() {
- r[n(this).attr("url")] && n(this).parent().parent().remove()
- });
- triggerCheckboxChange()
- }
- function o(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- u();
- reportError(n)
- }
- function b(t, i) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- u();
- h(n.map(i, function(n) {
- return {
- Url: n
- }
- }));
- n("table.grid").trigger("update")
- }
- function k(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n);
- u()
- }
- function s(i, r, u) {
- var f = {};
- f.updateEl = i;
- f.indexUrl = r;
- f.retryCount = u;
- n.ajax({
- url: [t.IndexCountUrl, "&indexUrl=", escape(r)].join(""),
- type: "GET",
- dataType: "text",
- timeout: 13500,
- context: f,
- success: g,
- error: d
- })
- }
- function d() {
- this.retryCount > 4 ? this.updateEl.html([wr.G_Unknown, '<span class="none">', 0, "<\/span>"].join("")) : (r.push([this.updateEl, this.indexUrl, this.retryCount + 1]), c())
- }
- function g(n) {
- if (n != null) {
- var t = JSON.parse(n);
- this.updateEl.html([t.Formatted, '<span class="none">', t.Count, "<\/span>"].join(""))
- }
- c()
- }
- function c() {
- if (r.length > 0) {
- var n = r.pop();
- s(n[0], n[1], n[2])
- } else e = 0
- }
- function nt() {
- var t, i, r;
- n(this).attr("disabled") == "disabled" || window.readOnlyMode || (t = n("#addParamForm"), t.valid() && (i = t.serialize(), showActivityIndicator(!0), f(), r = n("#addSitemap").val(), n.post(t.attr("target"), i, function(t) {
- n("div.tableheaderbox").replaceWith(t);
- showActivityIndicator(!1);
- a();
- var i = n("#submittedFeed tbody").html(),
- u = [];
- u.push({
- Url: r
- });
- i && u.push({
- Url: n("input[url]", i).attr("url")
- });
- h(u);
- n("#sitemapsTable table.grid tbody").prepend(i);
- n("#sitemapsTable table.grid").trigger("update");
- constrainCheckboxWidth()
- }).error(o)))
- }
- function tt() {
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
- var i = getCheckedItemsInTable("url");
- i.length > 0 && (showActivityIndicator(!0), f(), startPostRequestWithJson({
- feedUrls: i
- }, t.RemoveUrl, function(n) {
- b(n, i)
- }, k, "#addParamForm", null, {
- traditional: !0
- }))
- }
- }
- function it() {
- n(this).attr("disabled") == "disabled" || window.readOnlyMode || (showActivityIndicator(!0), startPostRequestWithJson({}, t.ResubmitIndexUrl, function(t) {
- n("#sitemapIndexTable").html(t);
- showActivityIndicator(!1)
- }, o, "#addParamForm", null, {
- traditional: !0
- }))
- }
- function rt() {
- var i, r;
- n(this).attr("disabled") == "disabled" || window.readOnlyMode || (i = getCheckedItemsInTable("url"), i.length > 0 && (f(), showActivityIndicator(!0), r = function(t) {
- n("#sitemapsTable").html(t);
- initInfoHovers();
- enablePagination();
- enableAjaxSorting();
- disableFormSubmit();
- n("input.urlValidation, input.wmUrl").urlInputBox();
- window.sitemapsController != null && window.sitemapsController.getAccurateSitemapIndexCounts();
- hideActivityIndicator();
- unsetModalActivityIndicator();
- u();
- n("table.grid").trigger("update")
- }, startPostRequestWithJson({
- feedUrls: i
- }, t.ResubmitUrl, r, o, "#addParamForm", null, {
- traditional: !0
- })))
- }
- function l() {
- n('#sitemapsTable table.grid span[si="0"]').each(function() {
- var i = n(this),
- f = t.Detail ? ":nth-child(3)" : ":nth-child(4)",
- u = n(f, i.parent().parent());
- e < 4 ? (s(u, i.attr("url"), 0), e++) : r.push([u, i.attr("url"), 0])
- })
- }
- function a() {
- clickButtonOnEnter("#addParam", "#addSitemap");
- n("#addParam").click(nt);
- n("#addParamForm").validate(noCleanValidateOptions);
- window.readOnlyMode && f();
- disableFormSubmit();
- n("input.urlValidation, input.wmUrl").urlInputBox()
- }
- function ut() {
- n("#removeParam").click(tt);
- n("#resubmitParam").click(rt);
- n("#resubmitIndex").click(it);
- n("#sitemapsTable table.grid :checkbox").live("change", p).live("change", w);
- n("#sitemapsTable table.grid").parent().bind("onsort", function() {
- initInfoHovers();
- l();
- initEmptyTables()
- });
- a()
- }
- var p = setupGridCheckButtonEnabler("#sitemapsTable table.grid", "#removeParam"),
- w = setupGridCheckButtonEnabler("#sitemapsTable table.grid", "#resubmitParam"),
- r = [],
- e = 0,
- u = function() {
- n("#addSitemap").attr("disabled", null);
- n("#addParam").attr("disabled", null);
- var t = n("#sitemapsTable table.grid :checked").length > 0;
- n("#resubmitParam").attr("disabled", t ? null : "disabled");
- n("#removeParam").attr("disabled", t ? null : "disabled")
- },
- f = function() {
- n("#addSitemap").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled");
- n("#resubmitParam").attr("disabled", "disabled");
- n("#removeParam").attr("disabled", "disabled")
- },
- v, y;
- return (this.getAccurateSitemapIndexCounts = l, i == "getSitemapIndexCount") ? (v = arguments[2], y = arguments[3], s(y, v, 0), this) : (ut(), this.getAccurateSitemapIndexCounts(), this)
- }
- }(jQuery),
- function(n) {
- n.fn.submiturls = function(t) {
- function u(t) {
- for (var r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
- n("#paramList table.wmtable input[type=checkbox]").each(function() {
- r[n(this).attr("url")] && n(this).parent().parent().remove()
- })
- }
- function f(t) {
- var e, r, f;
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- n("#urls").val("");
- u(t);
- for (e in t) r = t[e], f = n("<tr/>"), f.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- url: r.Url
- })).append(n("<label/>"))).append(n('<td class="leftalign" />').append(createExternalUrl(r.Url))).append(n("<td/>").text(r.DateFormatted)), n("#paramList table.wmtable tbody").prepend(f);
- n("#dailyQuota").text(parseInt(n("#dailyQuota").text()) - t.length);
- n("#monthlyQuota").text(parseInt(n("#monthlyQuota").text()) - t.length);
- n("#paramList table.wmtable").trigger("update")
- }
- function e(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- var t = null;
- n.Message != null && (t = n.Message.replace(/\n/g, "<br/>"));
- showErrorMessage(t, wr.G_Error, !0)
- }
- function h(t, r) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- u(n.map(r, function(n) {
- return {
- Url: n
- }
- }));
- n("#paramList table.wmtable").trigger("update")
- }
- function c(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n);
- i()
- }
- var o = setupGridCheckButtonEnabler("#paramList table.wmtable", "#removeParam"),
- s = setupGridCheckButtonEnabler("#paramList table.wmtable", "#resubmitParam"),
- i = function() {
- n("#urls").attr("disabled", null);
- n("#addParam").attr("disabled", null);
- var t = n("#paramList table.wmtable :checked").length > 0;
- n("#resubmitParam").attr("disabled", t ? null : "disabled");
- n("#removeParam").attr("disabled", t ? null : "disabled")
- },
- r = function() {
- n("#urls").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled");
- n("#resubmitParam").attr("disabled", "disabled");
- n("#removeParam").attr("disabled", "disabled")
- };
- n("#addParam").click(function() {
- var u, o, i, s;
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && n("#addParamForm").valid()) {
- for (u = n("#urls").val().split("\n"), o = [], i = 0; i < u.length; ++i) s = n.trim(u[i]), s != "" && o.push(s);
- showActivityIndicator(!0);
- r();
- startPostRequestWithJson({
- urlList: o
- }, t.AddUrl, f, e, "#addParamForm", null, {
- traditional: !0
- })
- }
- });
- n("#resubmitParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
- var i = getCheckedItemsInTable("url");
- i.length > 0 && (showActivityIndicator(!0), r(), startPostRequestWithJson({
- urlList: i
- }, t.AddUrl, f, e, "#addParamForm", null, {
- traditional: !0
- }))
- }
- });
- n("#removeParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
- var i = getCheckedItemsInTable("url");
- i.length > 0 && (showActivityIndicator(!0), r(), startPostRequestWithJson({
- urlList: i
- }, t.RemoveUrl, function(n) {
- h(n, i)
- }, c, "#addParamForm", null, {
- traditional: !0
- }))
- }
- });
- n("#addParamForm").validate(n.merge({
- onkeyup: !1,
- focusCleanup: !0,
- errorPlacement: function() {}
- }, formValidateOptions));
- n("#paramList table.wmtable :checkbox").live("change", o).live("change", s);
- window.readOnlyMode && r();
- n("#urls").urlTextArea()
- }
- }(jQuery),
- function(n) {
- n.fn.users = function(t, i, r) {
- function e(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- f();
- n("#email").val("");
- var r = t.Expired ? wr.G_Expired : t.DelegatorEmail == null ? wr.Users_AddedBySystem : t.DelegatorEmail,
- i = n("<tr/>");
- i.append(n("<td/>").append(n("<input>", {
- type: "checkbox",
- site: t.Site,
- email: t.Email
- })).append(n("<label/>"))).append(n("<td/>").text(t.Email)).append(n("<td/>").append(n("<span>", {
- "class": "url-text"
- }).text(t.Site))).append(n("<td/>").text(t.RolesFormatted)).append(n("<td/>").text(t.DateFormatted)).append(n("<td/>").text(r));
- n("#userList table.wmtable tbody").prepend(i)
- }
- function o(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- f();
- reportError(n)
- }
- function s(t, i) {
- var f, r;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), f = {}, r = 0; r < i.length; ++r) f[i[r].Site + "|" + i[r].Email] = !0;
- n("#userList table.wmtable input[type=checkbox]").each(function() {
- var t = n(this).attr("site") + "|" + n(this).attr("email");
- f[t] && n(this).parent().parent().remove()
- });
- u()
- }
- function h(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- var u = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
- f = function() {
- n("#email").attr("disabled", null);
- n("#url").attr("disabled", null);
- n("#role").attr("disabled", null);
- n("#key").attr("disabled", null);
- n("#addParam").attr("disabled", null)
- },
- c = function() {
- n("#email").attr("disabled", "disabled");
- n("#url").attr("disabled", "disabled");
- n("#role").attr("disabled", "disabled");
- n("#key").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled")
- };
- i && r && (n("#requestSiteAccessApprovalDialog").jqm({
- overlay: 5,
- modal: !0
- }).jqmShow(), n("#buttonApprove").click(function() {
- startPostRequestWithJson({
- userId: i,
- userEmail: r
- }, t.ApproveAccessUrl, e, o, "#addParamForm")
- }), n("#buttonReject").click(function() {
- startPostRequestWithJson({
- userId: i
- }, t.DenyAccessUrl, s, h, "#addParamForm")
- }));
- n("#addParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
- var r = n.trim(n("#email").val()),
- u = n.trim(n("#url").val()),
- i = n("#role").val(),
- f = n("#key").val(),
- s = i == "admin",
- h = i == "readonly";
- showActivityIndicator(!0);
- c();
- startPostRequestWithJson({
- delegatedUrl: u,
- userEmail: r,
- isAdministrator: s,
- isReadOnly: h,
- authenticationCode: f
- }, t.AddUrl, e, o, "#addParamForm")
- }
- });
- n("#removeParam").click(function() {
- var i = [];
- n("#userList table.wmtable :checked").each(function() {
- var t = n(this),
- r = {
- Site: t.attr("site"),
- Email: t.attr("email")
- };
- i.push(r)
- });
- i.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
- siteRoles: JSON.stringify(i)
- }, t.RemoveUrl, function(n) {
- s(n, i)
- }, h, "#addParamForm"))
- });
- n("#addParamForm").validate(formValidateOptions);
- n("#userList table.wmtable :checkbox").live("change", u);
- clickButtonOnEnter("#addParam", ["#url", "#email"])
- }
- }(jQuery),
- function(n) {
- n.fn.verify = function(t) {
- function w() {
- var i = n("#hosters").val();
- i != "0" && (i = "how+to+add+CNAME+record+to+" + i, window.open(n.validator.format(t.SerpFormat, i), "dns"))
- }
- function b() {
- s = 0;
- h = getGuid();
- showActivityIndicator(!0);
- r.hide();
- i.hide();
- u.hide();
- f.remove();
- e.hide();
- n.ajax({
- url: [t.VerifyUrl, "&cacheKey=", h].join(""),
- type: "POST",
- processData: !1,
- contentType: "application/json",
- timeout: 13500,
- success: v,
- error: function(n) {
- handleAjaxError(n, y, function() {
- a(!0)
- })
- }
- })
- }
- function a() {
- r.show();
- n.ajax({
- url: [t.QueryUrl, "&cacheKey=", h].join(""),
- type: "GET",
- timeout: 13500,
- success: k,
- error: function(n) {
- handleAjaxError(n, y);
- return
- }
- })
- }
- function k(n) {
- n ? v(n) : s < 15 ? (s++, window.setTimeout(function() {
- a()
- }, 2e3)) : (r.hide(), showErrorMessage(wr.G_TimeoutError, wr.G_TimeoutErrorTitle))
- }
- function v(o) {
- r.hide();
- hideActivityIndicator();
- unsetModalActivityIndicator();
- o.IsVerified && !t.IsVerified ? document.location.href = t.DashboardUrl : o.IsVerified ? (e.hide(), i.hide(), u.show(), f.hide()) : (e.show(), f.remove(), f = n("<div class='verificationDebugBox'>"), i.show(), d(f, o.DebugInfo), f.insertAfter(e))
- }
- function y(n) {
- r.hide();
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function d(n, t) {
- tt(n, t.Xml);
- nt(n, t.MetaTag);
- g(n, t.Dns)
- }
- function g(t, i) {
- var r = n("<div>"),
- u = i.CNames.length > 0 ? i.CNames.join(", ") : wr.G_NA;
- l(r, wr.Verify_Dns);
- c(r, wr.G_Url, i.HostName);
- c(r, wr.Verify_CNames, u);
- i.Success || o(r, i.Error);
- t.append(r)
- }
- function nt(t, i) {
- var r = n("<div>");
- l(r, wr.Verify_MetaTag);
- p(r, i.ConnectionInfo, !1);
- i.ConnectionInfo.Success && i.Error && o(r, i.Error);
- t.append(r)
- }
- function tt(t, i) {
- var r = n("<div>");
- l(r, wr.Verify_Xml);
- p(r, i.ConnectionInfo, !0);
- i.ConnectionInfo.Success && i.Error && o(r, i.Error);
- t.append(r)
- }
- function p(t, i) {
- var r, u;
- i && (r = n("<div>"), c(r, wr.G_Url, i.Url, !0), i.RedirectChain && i.RedirectChain && i.RedirectChain.length > 1 && (u = n("<span>"), n.each(i.RedirectChain, function(t, r) {
- u.append(n("<span class='url-text'>").text(r));
- t < i.RedirectChain.length - 1 && u.append(n("<span class='url-text'>").text(" => "))
- }), r.append(n("<div>").append(n("<span style='font-weight: bold'>").text(wr.Verify_RedirectChain + " ")).append(u))), i.Success || o(r, i.Error), t.append(r))
- }
- function c(t, i, r, u) {
- var f = n("<span>").text(r);
- u && f.addClass("url-text");
- t.append(n("<div>").append(n("<span style='font-weight: bold'>").text(i + " ")).append(f))
- }
- function l(t, i) {
- t.append(n("<div class='darkTitle verificationTypeTitle'>").text(i))
- }
- function o(t, i) {
- t.append(n("<div class='errorRed'>").text(i))
- }
- function it() {
- var o = n("#page-content>h1.page-name");
- n("#hosters").change(w);
- n("#metaSnippet").click(function() {
- autoSelect(this)
- });
- n("#verifySite").click(b);
- f = n("div.verificationDebugBox");
- i = n("#verificationFailIconLg");
- u = n("#verificationPassIconLg");
- r = n("<span class='verificationInProgress'>").text(wr.Verify_VerificationInProgress);
- e = n("#verificationHelp");
- r.hide();
- o.addClass("verificationHeader");
- i.length == 0 && (i = n("<img/>", {
- id: "verificationFailIconLg",
- src: "/webmaster/content/images/RedXLg.png",
- "class": "middlealign marginleft5"
- }), o.append(i), i = n("#verificationFailIconLg"), i.hide());
- u.length == 0 && (u = n("<img/>", {
- id: "verificationPassIconLg",
- src: "/webmaster/content/images/GreenCheckLg.png",
- "class": "middlealign marginleft5"
- }), o.append(u), u = n("#verificationPassIconLg"), t.IsVerified || u.hide());
- o.append(r);
- r = n("span.verificationInProgress")
- }
- var f, i, u, r, s, h, e;
- it()
- }
- }(jQuery),
- function(n) {
- n.fn.adCenter = function(t) {
- function o(t) {
- var r = [],
- e = 0,
- o = 0;
- n("td:first-child span.keyword:first-child", t).each(function() {
- var t = n.trim(n(this).text()),
- u = f(t);
- if (u != null) return e++, !0;
- o++;
- r.push(t);
- r.length >= 20 && (i.push(r), r = [])
- });
- r.length > 0 && i.push(r);
- i.length > 0 && (i.reverse(), u())
- }
- function u() {
- var n = i.pop();
- n != null && n.length > 0 && startPostRequestWithJson({
- keywords: n
- }, t.KeywordsUrl, s, h, t.TokenContainer, null, {
- traditional: !0
- })
- }
- function s(n) {
- for (var t = 0; t < n.length; t++) r.push(n[t]);
- i.length > 0 && u()
- }
- function h(t) {
- console.error(t);
- n("td:first-child span:nth-child(2)", this).hide()
- }
- function f(t) {
- var i = null;
- return n.each(r, function(n, r) {
- if (r.Keyword == t) return i = r, !1
- }), i
- }
- function c(t) {
- var i = f(t);
- if (i == null) {
- n(".adKpiContent span").text(e);
- return
- }
- n("#mlavgcpc").text(i.MainLineAds.AverageCpc);
- n("#mlavgbid").text(i.MainLineAds.AverageBid);
- n("#sbavgcpc").text(i.SidebarAds.AverageCpc);
- n("#sbavgbid").text(i.SidebarAds.AverageBid)
- }
- function l(t) {
- n("td:first-child span:nth-child(2)", t).each(function() {
- var t = n("#adCenterPop");
- n(this).mouseover(function() {
- var i = n(this).position(),
- r = i.left + 2,
- f = i.top + 23 + n("#page-content").scrollTop(),
- u, e;
- n(this).offset().top + t.height() > n(window).height() - 65 ? (u = i.top + n("#page-content").scrollTop() - t.height(), u > 10 && (r = r + 25, f = u, t.find(".box-arrow-bottom").show(), t.find(".box-arrow").hide())) : (t.find(".box-arrow-bottom").hide(), t.find(".box-arrow").show());
- t.css({
- top: f,
- left: r + "px"
- }).show();
- e = n(this).prev().text();
- c(e)
- }).mouseleave(function() {
- var n = t.position().top;
- setTimeout(function() {
- t.is(":hover") || n != t.position().top || t.hide()
- }, 100)
- });
- t.mouseleave(function() {
- t.hide()
- })
- })
- }
- function a(t) {
- var i = "<span class='graybox cursor-default'>$<\/span>";
- n("tbody td:first-child", t).each(function() {
- if (n(this).find("span.keyword").length == 0) {
- var t = n.validator.format("<span class='keyword'>{0}<\/span> {1}", n(this).html(), i);
- n(this).html(t)
- }
- })
- }
- var i = [],
- r = [],
- e = "$0.05";
- n("#adCenterPop").length == 1 && (a(this), l(this), o(this))
- };
- n.fn.adCenterCoupon = function(t) {
- var i = n(this);
- i && i.length && n.ajax({
- url: t.url,
- type: "POST",
- data: {},
- traditional: !0,
- timeout: 13500,
- success: function(t) {
- var r = n.trim(t);
- r && i.append(n(r))
- },
- error: reportError
- })
- }
- }(jQuery),
- function(n) {
- n.fn.crawlInformation = function(t) {
- function i() {
- if (n.trim(n(this).text()) != "0") {
- var i = n("a", n(this)).attr("issueType"),
- r = n.validator.format("{0}&issueType={1}", t.crawlInformationDetailUrl, i);
- document.location = r
- }
- }
- n("#crawlInfoWidget td.pointer").hover(function() {
- n(this).hasClass("orange-bottom-border") || n(this).addClass("grey-bottom-border")
- }, function() {
- n("#crawlInfoWidget .grey-bottom-border").removeClass("grey-bottom-border")
- });
- n("#" + t.selectedIssueType).addClass("orange-bottom-border");
- n("#crawlInfoWidget td.pointer").click(i)
- }
- }(jQuery),
- function(n) {
- n.fn.showInboundLinks = function(t) {
- showActivityIndicator(!0);
- n.post(inboundLinksDialogUrl + encodeURI(t), function(n) {
- showPopupModalDialog("#linksDialog", n);
- hideActivityIndicator()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.indexexplorer = function(t) {
- function f(n) {
- n.addClass("active");
- l()
- }
- var o = null,
- st = function() {
- n("#index-explorer-tree").hide();
- n("#index-explorer-folder").hide();
- n("#index-explorer-page").hide();
- n("#index-explorer-tree-default").show();
- n("#index-explorer-folder-default").show();
- n("#index-explorer-page-default").show();
- n("#status-no-data").hide();
- n("#status-loading").show();
- n("#status-error").hide()
- },
- e = function() {
- n("#index-explorer-page").hide();
- n("#index-explorer-page-default").show()
- },
- i = function() {
- var t = n("#folder").val();
- return t.length > 0 && !hasPlaceholderSupport() && n("#folder").attr("placeholder") != undefined && n("#folder").attr("placeholder") == n("#folder").val() && (t = ""), {
- httpCode: n("#httpCode").val(),
- discovery: n("#discovery").val(),
- crawlDate: n("#crawlDate").val(),
- itUrl: t,
- malware: n("#malware").is(":checked"),
- robotstxt: n("#robotstxt").is(":checked"),
- traffic: !1
- }
- },
- a = function() {
- n("#navigationContainer").hide();
- n("#navigationContainerDefault").show();
- n("#index-explorer-tree").hide();
- n("#index-explorer-tree-default").show();
- n("#status-no-data").show();
- n("#status-loading").hide();
- n("#status-error").hide()
- },
- v = function() {
- n("#navigationContainerDefault").hide();
- n("#navigationContainer").empty().show();
- n("#navigation").detach().appendTo(n("#navigationContainer"));
- n("#index-explorer-tree").show();
- n("#index-explorer-tree-default").hide();
- scrollToTop();
- var t = n(".index-explorer-tree-list > ul > li:not(.more)");
- t.length < 4 && t.each(function() {
- c(n(this))
- })
- },
- y = function(i) {
- var r = n.extend({}, i);
- n("#index-explorer-tree").load(t.treeUrl, r, function(t, i) {
- i == "success" ? n.trim(t).length == 0 ? a() : v() : (n("#index-explorer-tree").hide(), n("#index-explorer-tree-default").show(), n("#status-no-data").hide(), n("#status-loading").hide(), n("#status-error").show())
- })
- },
- r = function(r) {
- var u = i();
- u.itUrl.length == 0 && (u.itUrl = t.rootUrl);
- r && r.length > 0 && (u.itUrl = r);
- e();
- y(u);
- s(u);
- n("#index-explorer-page").empty()
- },
- p = function() {
- var u = i(),
- f, r;
- u.itUrl = n(this).attr("iturl");
- u.offset = n(this).attr("offset");
- u.level = n(this).attr("level");
- f = n(this);
- r = n(this).parent();
- f.text(wr.G_Loading);
- r.load(t.treeChildrenUrl, u, function(n, t) {
- t == "success" ? (r.children().appendTo(r.parent()), r.remove()) : f.text(wr.IndexExplorer_More)
- })
- },
- w = function() {
- n("#index-explorer-folder").hide();
- n("#index-explorer-folder-default").show()
- },
- b = function() {
- n("#index-explorer-folder").show();
- n("#index-explorer-folder-default").hide();
- scrollToTop()
- },
- s = function(i) {
- var r = n.extend({}, i);
- n("#index-explorer-folder").load(t.folderUrl, r, function(t, r) {
- r == "success" ? (o = i.itUrl, n.trim(t).length == 0 ? w() : b()) : (n("#index-explorer-folder").hide(), n("#index-explorer-folder-default").show())
- })
- },
- h = function(n) {
- if (e(), o != n) {
- var t = i();
- t.itUrl = n;
- s(t)
- }
- },
- k = function() {
- var u = i(),
- f, r;
- u.itUrl = n(this).attr("iturl");
- u.offset = n(this).attr("offset");
- f = n(this);
- r = n(this).parent();
- f.text(wr.G_Loading);
- r.load(t.folderNextUrl, u, function(n, t) {
- t == "success" ? (r.children().appendTo(r.parent()), r.remove()) : f.text(wr.IndexExplorer_More)
- })
- },
- d = function() {
- n("#index-explorer-page").hide();
- n("#index-explorer-page-default").show()
- },
- g = function() {
- n("#index-explorer-page").show();
- n("#index-explorer-page-default").hide();
- scrollToTop()
- },
- nt = function(i) {
- var r = n.extend({}, i);
- n("#index-explorer-page").load(t.pageUrl, r, function(t, i) {
- i == "success" ? n.trim(t).length == 0 ? d() : g() : (n("#index-explorer-page").hide(), n("#index-explorer-page-default").show())
- })
- },
- tt = function() {
- var t = i();
- t.itUrl = n(this).attr("iturl");
- nt(t)
- },
- c = function(r) {
- var f, e, u;
- r.data("loaded") ? r.hasClass("open") ? (r.data("empty") || r.next().hide(), r.removeClass("open")) : (r.data("empty") || r.next().show(), r.addClass("open")) : (f = i(), f.itUrl = r.attr("iturl"), f.offset = 0, f.level = 1, e = n("<ul />", {
- "class": "folders"
- }), u = n("<li />").hide(), u.append(e), r.after(u), e.load(t.treeChildrenUrl, f, function(t, i) {
- i == "success" ? (r.addClass("open"), r.data("loaded", !0), n.trim(t).length == 0 ? (r.data("empty", !0), u.remove()) : u.show()) : u.remove()
- }))
- },
- it = function() {
- var t = n(this);
- c(t);
- n("#index-explorer-tree").find(".active").removeClass("active");
- t.addClass("active");
- h(n(this).attr("iturl"))
- },
- rt = function() {
- var t = n(this);
- n("#index-explorer-tree").find(".active").removeClass("active");
- t.addClass("active");
- h(n(this).attr("iturl"))
- },
- ut = function() {
- e();
- r(n(this).attr("iturl"))
- },
- u = function() {
- n("#httpCode").val("Any");
- n("#discovery").val("Any");
- n("#crawlDate").val("Any");
- n("#folder").val("");
- n("#malware").prop("checked", !1).next().removeClass("on");
- n("#robotstxt").prop("checked", !1).next().removeClass("on");
- n(".index-explorer-preset").removeClass("active")
- },
- l = function() {
- n("#indexexplorerform").valid() && r()
- },
- ft = function() {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- showHtmlMessage(wr.IndexExplorer_RecrawlSuccess, wr.G_UrlsSubmitted)
- },
- et = function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- },
- ot = function() {
- var i = n(this).attr("iturl");
- showActivityIndicator(!0);
- startPostRequestWithJson({
- urlList: [i]
- }, t.submitUrl, ft, et, "#indexexplorerform", null, {
- traditional: !0
- })
- };
- n("#showCustomOptions").click(function() {
- n(this).hide();
- n("#hideCustomOptions").show();
- n("#customOptions").show()
- });
- n("#hideCustomOptions").click(function() {
- n(this).hide();
- n("#showCustomOptions").show();
- n("#customOptions").hide()
- });
- n("#resetfilters").click(function() {
- u();
- r()
- });
- n("#applyfilters").click(l);
- n("#preset301").click(function() {
- u();
- n("#httpCode").val("Code301");
- f(n(this))
- });
- n("#preset404").click(function() {
- u();
- n("#httpCode").val("Code4xx");
- f(n(this))
- });
- n("#presetMalware").click(function() {
- u();
- n("#malware").prop("checked", !0).next().addClass("on");
- f(n(this))
- });
- n("#presetRobot").click(function() {
- u();
- n("#robotstxt").prop("checked", !0).next().addClass("on");
- f(n(this))
- });
- n("#navigationContainerDefault a.index-explorer-navigational-link").click(function() {
- r(t.rootUrl)
- });
- n(".index-explorer-navigational-link").live("click", ut);
- clickButtonOnEnter("#applyfilters", "#folder");
- n("#index-explorer-tree .index-explorer-more").live("click", p);
- n(".index-explorer-expandable").live("click", it);
- n(".index-explorer-viewable").live("click", rt);
- n("#index-explorer-folder .index-explorer-more").live("click", k);
- n("#index-explorer-folder .index-explorer-page-link").live("click", tt);
- n("#index-explorer-page .index-explorer-recrawl").live("click", ot);
- clickButtonOnEnter("#applyfilters", ["#folder"]);
- n("#indexexplorerform").validate(formValidateOptions);
- n("#indexexplorerform select, #indexexplorerform input").change(function() {
- n(".index-explorer-preset").removeClass("active")
- });
- r()
- }
- }(jQuery),
- function(n) {
- n.fn.searchKeyword = function(t) {
- var i = n.extend({}, t);
- i.isKeyword = !0;
- i.Title = wr.Keyword_TrafficDetailsForTitle;
- i.Description = wr.Keyword_DetailsIntro;
- i.PageDetailsUrl = t.pagequerytrafficdetailsUrl;
- i.PopupDeatilsUrl = t.querypagedetailsUrl;
- i.TableContainer = "#keywordsTableContainer";
- i.DataRangeChanged = function() {
- showActivityIndicator(!1);
- n("#keywordsTableContainer").load(i.keywordTableUrl, {
- startDate: n("#keywordRangeFrom").val(),
- endDate: n("#keywordRangeTo").val()
- }, function() {
- hideActivityIndicator();
- n("table.adCenterIntegration").adCenter({
- KeywordsUrl: t.AdCenterKeywordsUrl,
- TokenContainer: "#tokenContainer"
- });
- initEmptyTables();
- initInfoHovers()
- })
- };
- n.fn.searchDetails(i)
- }
- }(jQuery),
- function(n) {
- n.fn.malware = function(t) {
- function i(n) {
- var t = JSON.parse(n.responseText);
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(t)
- }
- function r() {
- n("#reviewRequestContainer").remove();
- n.ajax({
- url: t.historyDataUrl,
- type: "GET",
- success: function(t) {
- n("#historyContainer").html(t);
- enablePagination();
- enableAjaxSorting()
- },
- error: i
- })
- }
- function u() {
- showActivityIndicator(!0);
- n.getJSON(t.requestReviewUrl, r).error(i)
- }
- n("#requestreview").click(u)
- }
- }(jQuery),
- function(n) {
- n.fn.pageTraffic = function(t) {
- var i = n.extend({}, t);
- i.isKeyword = !1;
- i.Title = wr.Page_TrafficDetailsForTitle;
- i.Description = wr.Page_PageDetailsIntro;
- i.PageDetailsUrl = t.PageQueryTrafficDetailsJsonUrl;
- i.PopupDeatilsUrl = t.PageTrafficDetailsTableUrl;
- i.TableContainer = "#pageTrafficTableContainer";
- i.DataRangeChanged = function() {
- showActivityIndicator(!1);
- n("#pageTrafficTableContainer").load(i.fullPageTrafficTableUrl, {
- startDate: n("#keywordRangeFrom").val(),
- endDate: n("#keywordRangeTo").val()
- }, function() {
- hideActivityIndicator();
- initInfoHovers()
- })
- };
- n.fn.searchDetails(i)
- }
- }(jQuery),
- function(n) {
- n.fn.reportsAndData = function(t) {
- n(this).pageTraffic(t);
- n(this).searchKeyword(t);
- n(this).seoReport(t);
- n(this).crawlInformation(t);
- n("#keywordRangeContainer").live("dateChanged", function() {
- initInfoHovers()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.seoReport = function(t) {
- function i() {
- var i = n(this).attr("for"),
- r = n.validator.format("{0}&ruleId={1}", t.seoRuleDetailUrl, i);
- document.location = r
- }
- function r() {
- var i = n(this).text(),
- r = n.validator.format("{0}¶mUrl={1}", t.seoAnalyzerUrl, encodeURIComponent(i));
- document.location = r
- }
- n("#seoRulesTableContainer a.ruleDetailLink").click(i);
- n("#failingPagesTableContainer td > a").click(r)
- }
- }(jQuery),
- function(n) {
- n.fn.searchDetails = function(t) {
- function r() {
- var r = n(this).attr("for"),
- t, f;
- n("#popupDialogTitleText").text(i.Title);
- n("#popupDialogTitleParameter").text(r);
- n("#popupDialogDescription").text(i.Description);
- n("#ptdDialog").jqm({
- overlay: 10,
- modal: !0
- }).jqmShow();
- t = {
- startDate: n("#keywordRangeFrom").val(),
- endDate: n("#keywordRangeTo").val()
- };
- i.isKeyword ? t.query = r : t.pageUrl = r;
- n("#dialogTableContainer").load(i.PopupDeatilsUrl, t, function() {
- hideActivityIndicator();
- initEmptyTables();
- n("#dialogTableContainer a.rowExpand").bind("click", u)
- });
- f = n(this);
- f.hasClass("viewClicked") || f.addClass("viewClicked")
- }
- function u() {
- var u = n("#popupDialogTitleParameter").text(),
- r = n(this).attr("for"),
- e = i.isKeyword ? u : r,
- o = i.isKeyword ? r : u,
- f = "#dialogTableContainer td[for='" + r + "']",
- t = n(f);
- t.length == 0 ? (n(this).parent().parent().after(['<tr><td><\/td><td colspan="4" for="', r, '"><\/td><td colspan="2"><\/td><tr>'].join("")), t = n(f), t.load(i.PageDetailsUrl, {
- query: e,
- pageUrl: o,
- startDate: n("#keywordRangeFrom").val(),
- endDate: n("#keywordRangeTo").val()
- }, function() {
- hideActivityIndicator()
- })) : t.is(":visible") ? t.parent().slideUp("fast") : t.parent().slideDown("fast")
- }
- var i = t;
- n("#keywordRangeContainer").live("dateChanged", i.DataRangeChanged);
- n("table.adCenterIntegration").adCenter({
- KeywordsUrl: t.AdCenterKeywordsUrl,
- TokenContainer: "#tokenContainer"
- });
- n(i.TableContainer + " a.viewtrafficDetails").live("click", r)
- }
- }(jQuery),
- function(n) {
- n.fn.siteActivityReports = function(t) {
- var e = getStandartChartOptions(),
- o = n("#chart"),
- s = n('.charts-legend input[type="checkbox"]'),
- i = [
- [],
- [],
- [],
- [],
- []
- ],
- h, r = "#keywordRangeFrom",
- u = "#keywordRangeTo",
- f = "#keywordRangeContainer";
- splitChartData(t.data, i, 5);
- t.dateFromSelector && (r = t.dateFromSelector);
- t.dateToSelector && (u = t.dateToSelector);
- t.datePickerContainer && (f = t.datePickerContainer);
- h = setupChart(o, e, s, i, r, u, f, "#site-nav-toggle-button")
- }
- }(jQuery),
- function(n) {
- n.fn.fetchasbot = function(t) {
- function y() {
- var i = n(this).attr("url");
- return showActivityIndicator(!1), n.post(t.detailsUrl, {
- fetchedUrl: i
- }, function(t) {
- hideActivityIndicator();
- n("#fetchedStatus").html(t);
- n(".prettyprint").length > 0 && prettyPrint()
- }), !1
- }
- function p(t) {
- for (var r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
- n("#paramList table.wmtable input[type=checkbox]").each(function() {
- r[n(this).attr("url")] && n(this).parent().parent().remove()
- })
- }
- function c(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n("#url").val("");
- p([t]);
- var r = n("<tr/>");
- r.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- url: t.Url
- })).append(n("<label/>"))).append(n('<td class="leftalign" />').append(createExternalUrl(t.Url))).append(t.Fetched ? n("<td/>").append(n("<a/>", {
- "class": "fetch-as-bot-completed",
- href: "javascript:void",
- url: t.Url
- }).text(wr.G_Completed)) : n("<td/>").text(t.Expired ? wr.G_TimeoutErrorTitle : wr.G_Pending));
- n("#paramList table.wmtable tbody").prepend(r);
- n("#paramList table.wmtable").trigger("update");
- --i;
- i == 0 && (o(), h())
- }
- function s(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n);
- --i;
- i == 0 && (o(), h())
- }
- function w(t) {
- for (var r, e, o = {}, i = 0; i < t.length; ++i) o[t[i].Url] = t[i];
- for (r = [], n("#paramList table.wmtable tbody tr").each(function() {
- var u = n(this).children("td:nth-child(3)"),
- f = n.trim(u.text()),
- t, i;
- f == wr.G_Pending && (t = n(this).find(":checkbox").attr("url"), i = o[t], t && i && (i.Expired ? u.text(wr.G_TimeoutErrorTitle) : i.Fetched && (u.html("").append(n("<a/>", {
- "class": "fetch-as-bot-completed",
- href: "javascript:void",
- url: t
- }).text(wr.G_Completed)), r.push(t))))
- }), e = !1, i = 0; i < t.length; ++i) t[i].Fetched || t[i].Expired || (e = !0);
- e ? (u != null && clearTimeout(u), u = setTimeout(function() {
- h()
- }, a)) : f == 1 && r.length > 0 && n("#paramList table.wmtable tbody tr").find('a[url="' + r[0] + '"]').trigger("click")
- }
- function h() {
- startPostRequestWithJson({}, t.getFetchedUrl, w, reportError, "#addParamForm")
- }
- function l(n) {
- showActivityIndicator(!0);
- r();
- i = 1;
- f = i;
- startPostRequestWithJson({
- urlToFetch: n
- }, t.fetchUrl, c, s, "#addParamForm")
- }
- function b(t) {
- var r, i;
- for (o(), hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i]] = !0;
- n("table.wmtable :checkbox").each(function() {
- r[n(this).attr("url")] && n(this).parent().parent().remove()
- });
- triggerCheckboxChange();
- n("#paramList table.wmtable").trigger("update")
- }
- var a = 2e3,
- u = null,
- i = 0,
- f = 0,
- e = setupGridCheckButtonEnabler("#paramList table.wmtable", "#removeParam"),
- v = setupGridCheckButtonEnabler("#paramList table.wmtable", "#resubmitParam"),
- o = function() {
- n("#url").attr("disabled", null);
- n("#addParam").attr("disabled", null);
- var t = n("#paramList table.wmtable :checked").length > 0;
- n("#resubmitParam").attr("disabled", t ? null : "disabled")
- },
- r = function() {
- n("#url").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled");
- n("#resubmitParam").attr("disabled", "disabled")
- };
- n("#addParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && n("#addParamForm").valid()) {
- var t = n.trim(n("#url").val());
- l(t)
- }
- });
- n("#removeParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
- var i = [];
- n("#paramList table.wmtable :checked").each(function() {
- var t = n(this);
- i.push(t.attr("url"))
- });
- console.log(i);
- i.length > 0 && (showActivityIndicator(!0), r(), startPostRequestWithJson({
- urlToRemove: i
- }, t.removeUrl, function() {
- b(i)
- }, s, "#addParamForm", null, {
- traditional: !0
- }))
- }
- });
- n("#resubmitParam").click(function() {
- var u, e;
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && (u = [], n("#paramList table.wmtable :checked").each(function() {
- var t = n(this);
- u.push(t.attr("url"))
- }), u.length > 0)) {
- showActivityIndicator(!0);
- r();
- i = u.length;
- f = i;
- for (e in u) startPostRequestWithJson({
- urlToFetch: u[e]
- }, t.fetchUrl, c, s, "#addParamForm")
- }
- });
- n("#addParamForm").validate(formValidateOptions);
- n("#paramList table.wmtable :checkbox").live("change", e).live("change", v);
- n("#paramList table.wmtable :checkbox").live("change", e).live("change", e);
- n("#paramList table.wmtable .fetch-as-bot-completed").live("click", y);
- window.readOnlyMode && r();
- clickButtonOnEnter("#addParam", "#url");
- t.paramUrl.length > 0 && l(t.paramUrl)
- }
- }(jQuery),
- function(n) {
- n.fn.keywordResearch = function(t) {
- function s(n, t) {
- var r, i;
- t.relatedKeywordSparklineData = n;
- r = {};
- for (i in n) r[n[i].Query] = t.strict ? n[i].BroadImpressionsSparkDataFormatted : n[i].ImpressionsSparkDataFormatted;
- t.relatedKeywordSparklineDataMap = r;
- l(t)
- }
- function h(n) {
- console.log("loadRelatedKeywordSparklineDataFailure", n);
- reportError(n)
- }
- function c(n) {
- console.log("loadRelatedKeywordSparklineDataTimeout", n);
- n.relatedKeywordSparklineDataTimeoutCount++;
- r(n)
- }
- function r(n) {
- startPostRequestWithJson({
- queries: n.relatedKeywordDataQueries,
- country: n.country,
- language: n.language,
- startDate: n.startDate,
- endDate: n.endDate
- }, t.sparklineUrl, function(t) {
- s(t, n)
- }, function(t) {
- h(t, n)
- }, "#tokenContainer", n.relatedKeywordSparklineDataTimeoutCount > 5 ? null : function() {
- c(n)
- }, {
- traditional: !0
- })
- }
- function u(n, t, i) {
- var f, r;
- if (!(i >= t.length)) {
- for (f = Math.min(i + 2, t.length), r = i; r < f; ++r) {
- var e = t[r],
- o = e.visualElement,
- s = e.value;
- o.text(s);
- o.sparkline("html", {
- width: "60px",
- fillColor: ""
- })
- }
- setTimeout(function() {
- u(n, t, f)
- }, 1)
- }
- }
- function l(t) {
- var i = t.relatedKeywordSparklineDataMap,
- r = [],
- f = n("table.grid.keywords-with-sparklines tbody tr");
- f.each(function() {
- var t = n(this).find("td"),
- u = n("a.keyword", t[0]).text(),
- f = n(t[2]),
- e = f.children("span"),
- o = i[u] || "";
- i[u] && r.push({
- visualElement: e,
- value: o
- })
- });
- u(t, r, 0)
- }
- var i = n("#searchform"),
- f = function() {
- var i = [];
- n("table.grid.keywords-with-sparklines tbody tr td:first-child").each(function() {
- i.push(n(this).text())
- });
- r({
- relatedKeywordDataQueries: i,
- strict: n("#strict").is(":checked"),
- startDate: n("#dateRangeFrom").val(),
- endDate: n("#dateRangeTo").val(),
- country: n("#country").val(),
- language: n("#language").val(),
- relatedKeywordSparklineDataTimeoutCount: 0
- });
- n("table.adCenterIntegration").adCenter({
- KeywordsUrl: t.AdCenterKeywordsUrl,
- TokenContainer: "#tokenContainer"
- })
- },
- a = function(t) {
- n("#keywordscontainer").html(t);
- showActivityIndicator(!1);
- enableAjaxSorting();
- initInfoHovers();
- f()
- },
- v = function(n, t, i, r, u) {
- t == "timeout" ? u < 5 ? e(r, u + 1) : showErrorMessage(wr.G_TimeoutError, wr.G_TimeoutErrorTitle) : handleAjaxError(n, reportError)
- },
- e = function(i, r) {
- n.ajax({
- type: "POST",
- url: t.dataUrl,
- data: i,
- success: a,
- error: function(n, t, u) {
- return v(n, t, u, i, r)
- },
- timeout: 13500
- })
- },
- o;
- n("#search").click(function() {
- n(this).attr("disabled") != "disabled" && i.valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(i), i.submit())
- });
- i.validate(formValidateOptions);
- n.trim(n("#keywords").val()).length > 0 && i.valid() && (showActivityIndicator(!0), o = i.serialize(), e(o, 0));
- n("#historyDialog").jqm({
- overlay: 10,
- modal: !0
- });
- n("#showhistory").click(function() {
- n("#historyDialog").jqmShow()
- });
- n("#historyContainer a").click(function() {
- n("#keywords").val(n(this).text());
- n("#search").trigger("click");
- n("#historyDialog").jqmHide()
- });
- n("a.keyword").live("click", function() {
- n("#keywords").val(n(this).text());
- n("#search").trigger("click")
- });
- n("#keywords").keydown(textAreaWithLineLimit(t.lineLimit));
- n("#keywordscontainer").bind("onsort", function() {
- console.log("on sort");
- f()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.linkexplorer = function() {
- n("#linkExplorerForm").validate(formValidateOptions);
- n("#exploreUrl").click(function() {
- n("#linkExplorerForm").valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(n("#linkExplorerForm")), n("#linkExplorerForm").submit())
- });
- clickButtonOnEnter("#exploreUrl", ["#targetUrl", "#filterBySite", "#anchorText", "#additionalQuery"]);
- n("#requery").live("click", function() {
- n("#targetUrl").val(n(this).text());
- n("#exploreUrl").trigger("click")
- });
- n("#historyDialog").jqm({
- overlay: 10,
- modal: !0
- });
- n("#showhistory").click(function() {
- n("#historyDialog").jqmShow()
- });
- n("#historyContainer a").click(function() {
- n("#targetUrl").val(n(this).text());
- n("#exploreUrl").trigger("click");
- n("#historyDialog").jqmHide()
- })
- }
- }(jQuery),
- function(n) {
- function t() {
- function u(t) {
- var i = t,
- r, u;
- if (i.length < 1) {
- $id("output").html(wr.MarkupValidation_NoUrlsEntered);
- return
- }
- return r = n.validator.format("{0}/diagnostics/markup/processor/?url={1}", containerPrefix, url), u = {
- SiteUrl: i
- }, showActivityIndicator(!0), n.ajax({
- url: r,
- type: "POST",
- data: u,
- dataType: "json",
- success: function(n) {
- if (n != null) {
- if (n.Throttling == "Error") return e(), !0;
- if (n.MarkupValidation_BadUrl) return f(n.MarkupValidation_BadUrl), !0;
- o(n)
- } else s()
- }
- }), !0
- }
- function f(n) {
- showErrorMessage(n, wr.G_Error)
- }
- function e() {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- showErrorMessageMarkUpBusy()
- }
- function o(i) {
- t = [];
- var f = !1,
- u = {};
- if (u[wr.MarkupValidation_FormatNameMicrodata] = apCfg.WebConfig.MarkUpValidationLinkHTMLMicrodata, u[wr.MarkupValidation_FormatNameHtmlMarkupMicroformat] = apCfg.WebConfig.MarkUpValidationLinkMicroformats, u[wr.MarkupValidation_FormatNameHtmlMarkupRDFa] = apCfg.WebConfig.MarkUpValidationLinkRDFa, u[wr.MarkupValidation_FormatNameHtmlMarkupSchemaDotOrg] = apCfg.WebConfig.MarkUpValidationLinkSchemadotorg, u[wr.MarkupValidation_FormatNameOpenGraphJsonHeader] = apCfg.WebConfig.MarkUpValidationLinkOpenGraph, n.each(i, function(n, i) {
- var o, e;
- if (i.length > 1 && (t.push('<div class="markup-validator-bold marginTop15">'), t.push('<a href="' + u[n] + '" target="_blank">'), t.push(n), t.push("<\/a>"), t.push("<\/div>")), i.length > 0)
- for (f = !0, o = JSON.parse(i), e = 0; e < o.Entities.length; e++) r(o.Entities[e])
- }), hideActivityIndicator(), unsetModalActivityIndicator(), !f) {
- $id("output").html(wr.MarkupValidation_NoDataGot);
- return
- }
- $id("output").html(t.join(""))
- }
- function r(n) {
- var o = n.Properties,
- h, f, i, s, u, e;
- if (typeof o != "undefined") {
- for (h = n.Type, t.push('<ul class="listStyleNone marginTop5 marginbottom5">'), t.push("<li>"), t.push('<span class="markup-validator-bold">'), t.push(wr.MarkupValidation_Entity), t.push(" "), t.push(h), t.push("<\/span>"), t.push("<\/li>"), f = 0; f < o.length; f++)
- if (i = o[f], !(i.Type.length < 0)) {
- if (s = i.Type, i.Entities != null && i.Entities.length > 0 && i.Value == null) {
- for (t.push("<li>"), t.push(s), t.push(":<\/li>"), t.push("<li>"), u = 0; u < i.Entities.length; u++)
- if (i.Entities[u] == null) continue;
- else r(i.Entities[u]);
- t.push("<\/li>")
- }
- if (i.Value != null)
- for (e = 0; e < i.Value.length; e++) t.push("<li>"), t.push(s), t.push(": " + i.Value[e] + "<\/li>")
- }
- t.push("<\/ul>")
- }
- }
- function s(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function h(n) {
- u(n)
- }
- var i = {},
- t = [];
- return i.go = function() {
- $id("markupValidateForm").validate(formValidateOptions);
- $id("markupValidate").click(function() {
- var n = $id("markupUrl").val();
- $id("markupValidateForm").valid() && h(n)
- });
- $id("markupUrl").val().length > 0 && !isValueSameAsPalceHolder(n("#markupUrl").val(), n("#markupUrl")) && $id("markupValidate").trigger("click");
- clickButtonOnEnter("#markupValidate", "#markupUrl")
- }, i
- }
- n.markupValidatorController = function() {
- return new t
- }
- }(jQuery),
- function(n) {
- n.fn.seoAnalyzer = function(t) {
- function i(t) {
- var r = t.data != null,
- u = n("#site-nav-minor").width(),
- i;
- (r && n("#site-nav").hasClass("on") || !r && !n("#site-nav").hasClass("on")) && (u = 0);
- i = n("#sandboxIframe").position();
- isRTL && (i.left = 0);
- var o = n(window).width(),
- s = n(window).height(),
- f = o - (i.left + u + 75),
- e = s - (i.top + 100);
- r ? n("#sandboxIframe").animate({
- width: f
- }, 400).height(e) : n("#sandboxIframe").width(f).height(e)
- }
- function r() {
- if (n("#analyzeButtonForm").valid()) {
- var i = n("#seoUrl").val();
- document.location = t.seoAnalyzerUrl + "¶mUrl=" + encodeURIComponent(i)
- }
- }
- function u() {
- n(window).width() < 1220 && t.autoHideLeftNav == "true" && n("#site-nav").hasClass("on") && n("#site-nav-toggle-button").click();
- n("#analyzeButtonForm").validate(formValidateOptions);
- n("body > article").css({
- "padding-bottom": "5px"
- });
- n("#site-nav-toggle-button").bind("click", {
- siteNavToggle: !0
- }, i);
- n(window).resize(i).trigger("resize");
- clickButtonOnEnter("#analyzeButton", "#seoUrl");
- n("#analyzeButton").click(r)
- }
- u()
- }
- }(jQuery),
- function(n) {
- n.fn.seoSandbox = function(t) {
- var r = {
- iframeContents: null,
- markerImages: null,
- seoFloatingPopup: null,
- lastActiveMarker: null,
- isIframeReady: !1,
- setupMarkers: function() {
- r.positionMarkerImages(!0)
- },
- positionMarkerImages: function(t) {
- r.iframeContents == null && (r.iframeContents = n("#analyzedPageIframe").contents());
- r.markerImages.each(function() {
- var e = n(this).attr("violationIndex"),
- o = n(this).attr("seoSeverity"),
- u, s, f;
- e != null && o != null && (u = n("#seo_" + e, r.iframeContents).filter(":visible"), u.length == 1 && (s = i.getMarkerSource("plus", o), f = u.offset(), f != null && n(this).attr("src", s).attr("state", "1").css({
- position: "absolute",
- top: f.top + u.height() / 2 - 12 + "px",
- left: f.left - 24 + "px"
- }), t && n(this).bind("mouseenter", {
- violatingElement: u
- }, r.markerMouseEnter).bind("mouseleave", {
- violatingElement: u
- }, r.markerMouseLeave).bind("click", {
- violatingElement: u
- }, r.markerClick)))
- });
- r.isIframeReady = !0
- },
- markerClick: function(t) {
- var f = t.data.violatingElement,
- u = n(this).attr("seoSeverity"),
- e = n(this).attr("state");
- e == "0" ? (i.setMarkerSourceAndState(n(this), "plus", u), f.removeClass(u + "ElemBorder"), r.seoFloatingPopup.hide("slow")) : (i.setMarkerSourceAndState(n(this), "minus", u), f.addClass(u + "ElemBorder"), r.seoFloatingPopup.show("slow"))
- },
- markerMouseLeave: function(n) {
- var t = n.data.violatingElement
- },
- markerMouseEnter: function(t) {
- var u = t.data.violatingElement,
- e = n(this).attr("seoSeverity"),
- l = n(this).attr("seorule"),
- h = n(this).attr("violationindex"),
- c, f, o, s;
- (r.lastActiveMarker != h || r.seoFloatingPopup.css("display") == "none") && (r.lastActiveMarker != null && (c = r.iframeContents.find("#seo_" + r.lastActiveMarker), f = r.iframeContents.find("#seoMarkerNodes img[violationindex='" + r.lastActiveMarker + "']"), f.length == 1 && (o = f.attr("seoSeverity"), c.removeClass(o + "ElemBorder"), i.setMarkerSourceAndState(f, "plus", o))), i.setMarkerSourceAndState(n(this), "minus", e), r.seoDetailsExpandCollapse(!1, !0), r.lastActiveMarker = h, u.addClass(e + "ElemBorder"), r.setupViolationPanel(r.seoFloatingPopup, r.iframeContents, l, e, u), r.seoFloatingPopup.show(), s = u.offset(), r.seoFloatingPopup.css({
- position: "absolute",
- top: s.top + 3 + u.height() + "px",
- left: s.left - 1 + "px"
- }))
- },
- setupViolationPanel: function(t, u, f, e, o) {
- var h, c;
- t.attr("class", "");
- t.attr("class", "seoAnalyzer seoViolationMarkerPanel " + e + "Severity");
- var y = n("#floatTitle", u),
- p = n("#floatruleDescription", u),
- l = n("#floatViolatingTag", u),
- w = n("#floatErrorMsg", u),
- a = n("#floatAction", u),
- v = n("#floatExplanation", u),
- s = "";
- switch (e) {
- case "high":
- s = wr.Seo_Severityhigh;
- break;
- case "moderate":
- s = wr.Seo_Severitymoderate;
- break;
- case "low":
- s = wr.Seo_Severitylow
- }
- y.text(s);
- i.seoPageFailureDetails != null && (p.text(i.seoPageFailureDetails[f].Description), w.text(r.htmlDecodeString(i.seoPageFailureDetails[f].ErrorMessage)), h = r.htmlDecodeString(i.seoPageFailureDetails[f].Action), c = r.htmlDecodeString(i.seoPageFailureDetails[f].SeoExplanation), h == null || h == "" ? a.closest("p").hide() : (a.closest("p").show(), a.text(h)), c == null || c == "" ? v.closest("p").hide() : (v.closest("p").show(), v.text(c)));
- o != null ? (l.show(), l.text(r.getViolatingTag(o))) : l.hide()
- },
- getViolatingTag: function(n) {
- var t = n.clone(),
- i, r, u;
- return t.removeAttr("id").removeAttr("class").removeAttr("seoRuleId"), i = t.attr("oldId"), i !== undefined && t.attr("id", i).removeAttr("oldId"), r = t.attr("oldClass"), r !== undefined && t.attr("class", r).removeAttr("oldClass"), u = t.wrap("<div>").parent().html(), Encoder.htmlDecode(u)
- },
- htmlDecodeString: function(t) {
- return n("<div/>").html(t).text()
- },
- collapsableLinkClickHander: function() {
- n(this).attr("state") == "0" ? r.seoDetailsExpandCollapse(!0, !1) : r.seoDetailsExpandCollapse(!1, !1)
- },
- seoDetailsExpandCollapse: function(n, t) {
- var u = r.iframeContents.find("#seoDetails"),
- i = r.iframeContents.find("#collapsableLink");
- n ? (i.text(wr.Seo_Collapse), i.attr("state", 1), u.show("slow")) : (i.text(wr.Seo_Expand), i.attr("state", 0), t ? u.hide() : u.hide("slow"))
- },
- filterMarkers: function(n) {
- if (r.seoFloatingPopup != null && r.seoFloatingPopup.hide(), r.markerImages != null) {
- r.markerImages.hide();
- r.iframeContents.find(".highElemBorder, .ModerateElemBorder, .lowElemBorder").removeClass("highElemBorder ModerateElemBorder lowElemBorder");
- var t = null;
- switch (n) {
- case "all":
- t = r.markerImages;
- break;
- case "high":
- t = r.markerImages.filter("img[seoseverity='High']");
- break;
- case "moderate":
- t = r.markerImages.filter("img[seoseverity='Moderate']");
- break;
- case "low":
- t = r.markerImages.filter("img[seoseverity='Low']");
- break;
- default:
- t = r.markerImages.filter("img[seorule='" + n + "']")
- }
- t.show()
- }
- },
- go: function() {
- r.iframeContents = n("#analyzedPageIframe").contents();
- n("#seoMarkerNodes", r.iframeContents).append(n("#seoFloat").clone());
- r.seoFloatingPopup = n("#seoFloat", r.iframeContents);
- r.markerImages = n("#seoMarkerNodes img", r.iframeContents);
- setTimeout(function() {
- r.setupMarkers();
- n("#collapsableLink", r.iframeContents).click(r.collapsableLinkClickHander);
- r.filterMarkers("all");
- n("#seoAnalyzerVeil", r.iframeContents).hide("slow");
- n("#renderWarning").show();
- console.log("Page analysis Iframe is ready")
- }, 1e3)
- }
- },
- u = {
- iframeContents: null,
- sourceSpanTags: null,
- filterMarkers: function(t) {
- var r, f;
- u.sourceSpanTags.css({
- background: "",
- border: "",
- outline: ""
- });
- r = null;
- switch (t) {
- case "all":
- r = u.sourceSpanTags;
- break;
- case "high":
- r = u.sourceSpanTags.filter("[seoseverity='High']");
- break;
- case "moderate":
- r = u.sourceSpanTags.filter("[seoseverity='Moderate']");
- break;
- case "low":
- r = u.sourceSpanTags.filter("[seoseverity='Low']");
- break;
- default:
- r = u.sourceSpanTags.filter("[seorule='" + t + "']")
- }
- r.css("background", "yellow").css("border", "1px solid red");
- f = n.map(r, function(t) {
- return parseInt(n(t).attr("violationindex"))
- });
- i.currentSourceTabMarkerIndex = -1;
- i.sourceTabMarkers = f
- },
- go: function() {
- "25" in i.seoPageFailureDetails || document.getElementById("pageSourceIframe").contentWindow.prettyPrint();
- u.iframeContents = n("#pageSourceIframe").contents();
- u.sourceSpanTags = n("span.seoSourceMarker", u.iframeContents);
- u.filterMarkers("all");
- console.log("Page Source Iframe is ready")
- }
- },
- i = {
- seoPageFailureDetails: null,
- updateTimer: null,
- updateInterval: 1e3,
- maxFetchAttempts: 15,
- fetchAttemptCounter: 0,
- sourceTabMarkers: null,
- currentSourceTabMarkerIndex: -1,
- analyzedPageIframeHeight: 0,
- pageSourceIframeHeight: 0,
- markerArrowsClicked: function() {
- var r = n(this).attr("action"),
- t;
- i.sourceTabMarkers.length > 0 && (r == "down" && i.currentSourceTabMarkerIndex < i.sourceTabMarkers.length - 1 ? i.currentSourceTabMarkerIndex++ : r == "up" && i.currentSourceTabMarkerIndex > 0 && i.currentSourceTabMarkerIndex--, t = n.validator.format("span.seoSourceMarker[violationindex='{0}']", i.sourceTabMarkers[i.currentSourceTabMarkerIndex]), i.scrollIframeContent(u.iframeContents, t), u.sourceSpanTags.css({
- border: "",
- outline: ""
- }), n(t, u.iframeContents).css("outline", "1px solid red"))
- },
- scrollIframeContent: function(n, t) {
- var i = n.find(t).offset();
- n.find("html,body").stop().animate({
- scrollTop: i.top - 50,
- scrollLeft: i.left
- }, 1e3)
- },
- showHideRuleDetail: function() {
- var u = n(this).attr("seoSeverity"),
- f = n(this).attr("state"),
- e = n(this).attr("seorule"),
- t = n("#seoFloat");
- f == "0" ? i.hideSeoFloat(n(this), !0) : (r.setupViolationPanel(t, n("body"), e, u, null), i.setMarkerSourceAndState(n(this), "minus", u), t.stop().show("slow"), t.position({
- my: "left top",
- at: "left bottom",
- of: n(this),
- offset: "-1 3"
- }))
- },
- hideSeoFloat: function(t, r) {
- var f = t.attr("seoSeverity"),
- u = n("#seoFloat");
- i.setMarkerSourceAndState(t, "plus", f);
- r ? u.hide("slow") : u.hide()
- },
- getMarkerSource: function(t, i) {
- var r = window.location.protocol + "//" + window.location.host;
- return n.validator.format("{0}/webmaster/content/images/{1}_{2}_severity.png", r, t, i)
- },
- setMarkerSourceAndState: function(n, t, r) {
- var f = i.getMarkerSource(t, r),
- u = 1;
- t == "minus" && (u = 0);
- n.attr("src", f).attr("state", u)
- },
- rowClicked: function() {
- var t = n(this).attr("id").split("_")[1],
- o = n(this).attr("seoseverity"),
- e;
- n("input[name='violationFilter']").removeAttr("checked");
- n("tr", n(this).parent()).removeClass("selectedRow");
- n(this).addClass("selectedRow");
- n("#clearSelection").show();
- var a = n("#analyzedPageMessage td"),
- v = n("#sourcePageMessage td"),
- y = i.getMarkerSource("plus", o);
- n("img.analyzedPageImgTag", "#iFrametabContainer").attr("src", y).attr("state", "1").attr("seorule", t).attr("seoseverity", o);
- n("#seoFloat").hide();
- var f = Encoder.htmlEncode(n("td", n(this)).filter(":nth-child(2)").text()),
- s = f,
- h = f,
- c = n.validator.format("[seorule='{0}']", t),
- l = !0;
- r.markerImages.filter(c).length > 0 && n("[seoruleid=" + t + "]:visible", r.iframeContents).length > 0 && (l = !1);
- r.markerImages != null && l && (s = n.validator.format("{0} <b>{1}<\/b>", f, wr.Seo_RuleNotVisible));
- u.sourceSpanTags != null && u.sourceSpanTags.filter(c).length == 0 && (h = n.validator.format("{0} <b>{1}<\/b>", f, wr.Seo_RuleNotVisible));
- a.last().html(s);
- v.last().html(h);
- r.filterMarkers(t);
- u.filterMarkers(t);
- n("#iFrametabContainer .selected-rule-box").is(":visible") || (e = !1, n("#iFrametabContainer .selected-rule-box").slideDown("slow", function() {
- if (!e) {
- var t = n("#analyzedPageRuleBox").outerHeight(!0) > n("#pageSourceRuleBox").outerHeight(!0) ? n("#analyzedPageRuleBox").outerHeight(!0) : n("#pageSourceRuleBox").outerHeight(!0);
- i.analyzedPageIframeHeight = n("#analyzedPageIframe").outerHeight();
- i.pageSourceIframeHeight = n("#pageSourceIframe").outerHeight();
- n("#analyzedPageIframe").outerHeight(i.analyzedPageIframeHeight - t + 5);
- n("#pageSourceIframe").outerHeight(i.pageSourceIframeHeight - t + 5);
- e = !0
- }
- }))
- },
- clearFilter: function() {
- n("#rulesTable tbody tr").removeClass("selectedRow");
- n("#seoFloat").hide();
- n("#iFrametabContainer .selected-rule-box").each(function() {
- var t = n(this);
- t.is(":visible") ? t.slideUp("slow") : t.css({
- display: "none"
- })
- });
- i.analyzedPageIframeHeight > 0 && n("#analyzedPageIframe").outerHeight(i.analyzedPageIframeHeight);
- i.pageSourceIframeHeight > 0 && n("#pageSourceIframe").outerHeight(i.pageSourceIframeHeight);
- var t = "all";
- r.filterMarkers(t);
- u.filterMarkers(t);
- n("#clearSelection").hide()
- },
- resizeIframeWindows: function() {
- var f = n("#iFrametabContainer .tabs-body").offset(),
- t = n(window).width() - 310,
- u = n(window).height() - f.top;
- n(".tab_text").width(t + 5);
- n("#analyzedPageIframe").width(t).height(u - 20);
- n("#pageSourceIframe").width(t).height(u);
- n("#actualPageIframe").width(t).height(u);
- r.isIframeReady && r.positionMarkerImages(!1);
- i.resizeRedirectsTableContainer()
- },
- resizeRedirectsTableContainer: function() {
- var t = n("#redirectsTableContainer").offset(),
- i = n(window).height() - t.top;
- n("#redirectsTableContainer").height(i)
- },
- setIframeSources: function(i) {
- var r = n.validator.format("{0}&id={1}", t.renderedAnalyzedPageUrl, i),
- u = n.validator.format("{0}&id={1}", t.renderedSourcePageUrl, i);
- n("#analyzedPageIframe").attr("src", r);
- n("#pageSourceIframe").attr("src", u)
- },
- setOriginaliFrameSrc: function() {
- n("#actualPageIframe").attr("url") != n("#actualPageIframe").attr("src") && n("#actualPageIframe").attr("src", n("#actualPageIframe").attr("url"))
- },
- resetIframeSources: function() {
- n("#analyzedPageIframe").attr("src", "");
- n("#actualPageIframe").attr("src", "");
- n("#pageSourceIframe").attr("src", "")
- },
- analyzeUrlPoll: function(f) {
- i.updateTimer = setTimeout(function() {
- n.get(t.pageAnalysisResultUrl, {
- id: f
- }, function(t) {
- if (t.Status == "Success") console.log(i.fetchAttemptCounter), i.seoPageFailureDetails = t.AnalysisDetails, i.populateRulesFilterTable(), n("#rulesFilterContainer").show(), n("#seoResultTable").show(), t.redirectChain != null && t.redirectChain.length > 1 && (n("#redirectsContainer").show(), i.populateRedirectsTable(t.redirectChain)), n(window).resize(i.resizeIframeWindows).trigger("resize"), n("#redirectsContainer").is(":visible") && n("#redirectsContainer").height() < 100 && n("#suggestionsShow").show(), i.setIframeSources(f), n("#analyzedPageIframe").load(r.go), n("#pageSourceIframe").load(u.go), n("#actualPageIframe").attr("url", t.requestUrl), setTimeout(function() {
- n("#seoActivityIndicator").hide()
- }, 2e3);
- else if (t.Status == "UrlNotProcessed" && i.fetchAttemptCounter > 0) i.fetchAttemptCounter--, i.analyzeUrlPoll(f);
- else {
- if (n("#seoActivityIndicator").hide(), console.log("FetchAttempt count:" + i.fetchAttemptCounter), t.ErrMsg == null) return;
- t.redirectChain != null && t.redirectChain.length > 1 && i.displayRedirectsTableOnError(t.redirectChain);
- n("div.validationErrorPlaceholder").html(n.validator.format('<label class="error" for="seoUrl" generated="false">{0}<\/label>', t.ErrMsg));
- console.log("Error:" + t.ErrMsg)
- }
- })
- }, i.updateInterval)
- },
- analyzeUrl: function() {
- var r = t.requestId;
- r != "" && i.validateParentIframe() && (n("#seoActivityIndicator").show(), i.fetchAttemptCounter = i.maxFetchAttempts, i.analyzeUrlPoll(r))
- },
- validateParentIframe: function() {
- function r(n) {
- return n.match(/:\/\/(.[^/?]+)/)[1]
- }
- var n, i;
- return top.location == location ? (console.log("No parent iframe"), !1) : document.referrer ? (n = r(document.referrer), console.log(n), i = new RegExp(t.SeoSandboxParentIframeHost), n.match(i) == null ? (console.log("Invalid parent iframe"), !1) : !0) : (console.log("No referrer"), !1)
- },
- populateRulesFilterTable: function() {
- if (i.seoPageFailureDetails != null) {
- var t = [],
- r = "",
- u = "<tr seoseverity='{0}' id='ruleId_{1}'><td class='lpad row{0}'>{2}<\/td><td class='lpad'>{3}<\/td><\/tr>";
- n.each(i.seoPageFailureDetails, function(i, f) {
- r = n.validator.format(u, f.SeverityEnumString, i, f.ErrorCountFormatted, n("<div/>").text(f.Description).html());
- t.push(r)
- });
- t.length > 0 ? (n("#rulesTable tbody").html(t.join("")), n("#rulesTable tbody tr").bind("click", i.rowClicked)) : (n("#rulesTable").attr("emptytable", "true"), n("#rulesTable").attr("emptytablesetup", "false"), initEmptyTables())
- }
- },
- toggleRulesFilterTable: function() {
- n("#suggestionsShow").toggle(function() {
- n("#rulesFilterContainer").hide();
- n("#suggestionsShow").text(wr.G_Show);
- i.resizeRedirectsTableContainer()
- }, function() {
- n("#rulesFilterContainer").show();
- n("#suggestionsShow").text(wr.G_Hide);
- i.resizeRedirectsTableContainer()
- })
- },
- populateRedirectsTable: function(t) {
- var i = [],
- r = "",
- u = "<tr><td class='lpad'>{0}<\/td><td class='lpad'>{1}<\/td><\/tr>";
- n.each(t, function(t, f) {
- r = n.validator.format(u, f.StatusCode, f.Url);
- i.push(r)
- });
- i.length > 0 && n("#redirectsTable tbody").html(i.join(""))
- },
- toggleRedirects: function() {
- n("#redirectsShow").toggle(function() {
- n("#redirectsTable").show();
- n("#redirectsShow").text(wr.G_Hide)
- }, function() {
- n("#redirectsTable").hide();
- n("#redirectsShow").text(wr.G_Show)
- })
- },
- displayRedirectsTableOnError: function(t) {
- n("#seoResultTable").before(n("#redirectsContainer"));
- n("#redirectsContainer").show();
- n("#redirectsShow").hide();
- n("#redirectsTable").css({
- width: "50%"
- });
- n("#redirectsTable").show();
- i.populateRedirectsTable(t)
- },
- tabInitialize: function() {
- var t = n("div.tabs-header a");
- t.click(function() {
- t.removeClass("on");
- n(this).addClass("on");
- n("div.tabs-body > div").removeClass("on");
- n("div.tabs-body > div[name=" + n(this).attr("href") + "]").addClass("on");
- n("#iFrametabContainer .analyzedPageImgTag").each(function() {
- n(this).attr("state") == "0" && i.hideSeoFloat(n(this), !1)
- });
- n(this).attr("href") == "#tab3" && i.setOriginaliFrameSrc()
- })
- },
- go: function() {
- i.tabInitialize();
- r.isIframeReady = !1;
- n("#iFrametabContainer .analyzedPageImgTag").click(i.showHideRuleDetail);
- n("#buttonContainer .seoArrowButton").mouseenter(function() {
- n(this).addClass("seoArrowButtonHover")
- }).mouseleave(function() {
- n(this).removeClass("seoArrowButtonHover")
- }).mousedown(function() {
- n(this).addClass("seoArrowButtonClick")
- }).mouseup(function() {
- n(this).removeClass("seoArrowButtonClick")
- }).click(i.markerArrowsClicked);
- n("#seoResultTable").hide();
- n("#clearSelection").click(i.clearFilter);
- i.toggleRulesFilterTable();
- i.toggleRedirects();
- i.analyzeUrl()
- }
- };
- i.go()
- }
- }(jQuery),
- function(n) {
- n.fn.sitemove = function(t) {
- function e(t) {
- console.log("addParamSuccess", t);
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- n("#sourceurl").val("");
- n("#targeturl").val("");
- n("#scope").val("2");
- n("#sourceurl").prop("readonly", !1);
- n("#paramList table.wmtable span[sourceurl]").each(function() {
- n(this).attr("sourceurl") == t.SourceUrl && n(this).parent().parent().remove()
- });
- var r = n("<tr/>");
- r.append(n("<td/>")).append(n("<td/>").append(createExternalUrl(t.SourceUrl))).append(n("<td/>").append(createExternalUrl(t.TargetUrl))).append(n("<td/>").text(t.TypeString)).append(n("<td/>").text(t.ScopeString)).append(n("<td/>").text(t.Email)).append(n("<td/>").text(t.DateFormatted));
- n("#paramList table.wmtable tbody").prepend(r);
- n("#paramList table.wmtable").trigger("update")
- }
- function o(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- reportError(n)
- }
- function r(n, t) {
- if (t.length < 1) return t;
- if (t[t.length - 1] != "/" && (t += "/"), n == "0") {
- var i = t.indexOf("://");
- t = i > 0 ? t.substring(0, i + 3) + "*." + t.substring(i + 3) : "*." + t
- }
- return t + "*"
- }
- var i = function() {
- n("#sourceurl").prop("disabled", !1);
- n("#targeturl").prop("disabled", !1);
- n("#scope").prop("disabled", !1);
- n("#addParam").prop("disabled", !1)
- },
- f = function() {
- n("#sourceurl").prop("disabled", !0);
- n("#targeturl").prop("disabled", !0);
- n("#scope").prop("disabled", !0);
- n("#addParam").prop("disabled", !0)
- },
- u;
- n("#sitemoveconfirm").click(function() {
- if ((n("#sitemoveconfirmdialog").jqmHide(), n(this).attr("disabled") != "disabled" && !window.readOnlyMode) && n("#addParamForm").valid()) {
- var i = {
- SourceUrl: n("#sourceurl").val(),
- TargetUrl: n("#targeturl").val(),
- Scope: n("#scope").val()
- };
- showActivityIndicator(!0);
- f();
- startPostRequestWithJson({
- settings: JSON.stringify(i)
- }, t.AddUrl, e, o, "#addParamForm")
- }
- });
- n("#addParam").click(function() {
- if (n("#addParamForm").valid()) {
- n("#confirmtype").text(n("#movetypeglobal").is(":checked") ? wr.SiteMove_TypeGlobal : wr.SiteMove_TypeLocal);
- n("#confirmscope").text(n("#scope > option:selected").text());
- n("#confirmsource").text(n("#sourceurl").val());
- n("#confirmtarget").text(n("#targeturl").val());
- var t = r(n("#scope").val(), n("#sourceurl").val()),
- i = r(n("#scope").val(), n("#targeturl").val());
- n("#confirmexamplesource").text(t);
- n("#confirmexampletarget").text(i);
- n("#sitemoveconfirmdialog").jqmShow()
- }
- });
- n("#sitemoveconfirmdialog").jqm({
- overlay: 10,
- modal: !0
- });
- n("#addParamForm").validate(formValidateOptions);
- clickButtonOnEnter("#addParam", ["#sourceurl", "#targeturl"]);
- n("#scope").change(function() {
- n(this).val() == "0" ? (n("#sourceurl").val(url), n("#sourceurl").prop("readonly", !0)) : n(this).val() == "1" && n('#scope option[value="1"]').attr("locked") == "1" ? (n("#sourceurl").val(url), n("#sourceurl").prop("readonly", !0)) : n("#sourceurl").prop("readonly", !1)
- });
- u = function(t, i) {
- n("#targeturl").val(t);
- n("#targetsitelink").text(i)
- };
- n("#targetsitelink").click(function(t) {
- n("#movetypeglobal").is(":checked") || n("#movetypeglobal").click();
- var i = n("#targetsitelink").offset(),
- r, f = i.top + n("#targetsitelink").height();
- r = isRTL ? {
- right: i.right,
- top: f
- } : {
- left: i.left,
- top: f
- };
- n("#siteSelector").siteSelector(null, t, {
- callback: u,
- offset: r,
- width: 350
- })
- });
- n.browser.msie && n("#targetsitelinkcontainer").click(function(n) {
- n.stopPropagation()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.diagnostics = function(t) {
- function r(t, i, r, u) {
- var e = n(i).val(),
- f;
- n(r).valid() && (f = null, f = n.validator.format("{0}&{1}={2}", t, u, encodeURIComponent(e)), window.location = f)
- }
- var u = function() {
- r(t.linkExplorerUrl, "#exploreUrl", "#linkExploreForm", "targetUrl")
- },
- f = function() {
- r(t.fetchBingbotUrl, "#fetchUrl", "#botFetchForm", "paramurl")
- },
- e = function() {
- r(t.markupValidatorUrl, "#markupUrl", "#markupValidateForm", "paramurl")
- },
- o = function() {
- r(t.seoAnalyzerUrl, "#seoUrl", "#seoAnalyzeForm", "paramurl")
- },
- i;
- n("#linkExplore").click(u);
- n("#botFetch").click(f);
- n("#markupValidate").click(e);
- n("#seoAnalyze").click(o);
- n("#linkExploreForm").validate(formValidateOptions);
- n("#botFetchForm").validate(formValidateOptions);
- n("#markupValidateForm").validate(formValidateOptions);
- n("#seoAnalyzeForm").validate(formValidateOptions);
- clickButtonOnEnter("#linkExplore", "#exploreUrl");
- clickButtonOnEnter("#botFetch", "#fetchUrl");
- clickButtonOnEnter("#markupValidate", "#markupUrl");
- clickButtonOnEnter("#seoAnalyze", "#seoUrl");
- i = n("#keywordresearchsearchform");
- i.validate(formValidateOptions);
- n("#keywordresearchsearch").click(function() {
- i.valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(i), i.submit())
- });
- n("#keywords").keydown(textAreaWithLineLimit(t.keywordsLineLimit))
- }
- }(jQuery),
- function(n) {
- n.fn.verifybingbot = function() {
- n("#addParamForm").validate(n.extend(!0, {}, formValidateOptions, {
- onsubmit: !0
- }));
- n("#addParam").click(function() {
- n("#addParamForm").valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(n("#addParamForm")), n("#addParamForm").submit())
- });
- clickButtonOnEnter("#addParam", ["#ip"])
- }
- }(jQuery),
- function(n) {
- n.fn.developerSelector = function(t) {
- function s() {
- showActivityIndicator(!1);
- n("#developersTableContainer").load(t.developersReportTableUrl, {
- startDate: n("#keywordRangeFrom").val(),
- endDate: n("#keywordRangeTo").val(),
- appid: t.appId
- }, function() {
- hideActivityIndicator()
- })
- }
- function h() {
- var i = n(this).parent().parent().parent().find(":checkbox"),
- r;
- return console.log(n(this)), console.log(i), r = i.attr("appID"), document.location.href = [t.developersEditAppIdUrl, "?appId=", r].join(""), !1
- }
- function c() {
- var i, r;
- console.log(n(this));
- i = n(this).parent().parent().parent().find(":checkbox");
- console.log(i);
- r = i.attr("appID");
- document.location.href = [t.developersReportAppIdUrl, "?appId=", r].join("")
- }
- function l() {
- document.location.href = t.developersShowAppIdUrl
- }
- function u(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function f(i) {
- var r, y, p;
- if (n("#DevelopersSubmitForm").validate(formValidateOptions), $id("DevelopersSubmitForm").valid()) {
- r = null;
- i && (r = $id("appId").text());
- var e = $id("appIdName").val(),
- o = $id("appIdDesc").val(),
- s = $id("appIdCompName").val(),
- h = $id("appIdCountryRegion").val(),
- c = $id("appIdEmailAddress").val(),
- f, l = $id("appIdWebsite").val();
- f = $id("promotionOffers").is(":checked") ? "on" : "off";
- showActivityIndicator(!0);
- i ? (y = {
- appId: r,
- appName: e,
- appDescription: o,
- companyName: s,
- countryRegion: h,
- contactEmail: c,
- emailPromotion: f,
- website: l
- }, startPostRequestWithJson(y, t.UpdateUrl, v, u, "#DevelopersSubmitForm")) : (p = {
- appName: e,
- appDescription: o,
- companyName: s,
- countryRegion: h,
- contactEmail: c,
- emailPromotion: f,
- website: l
- }, startPostRequestWithJson(p, t.AddUrl, a, u, "#DevelopersSubmitForm"))
- }
- }
- function a() {
- n("#thankyouPage").jqm({
- overlay: 5,
- modal: !0
- }).jqmShow()
- }
- function v() {
- e()
- }
- function e() {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n("#submitEditAppid").hide();
- n("#submitAppid").hide();
- n("#cancelAppid").hide();
- document.location.href = t.developersShowAppIdUrl
- }
- function y() {
- e()
- }
- function p() {
- f(!0)
- }
- function w() {
- document.location.href = t.developersCreateAppIdUrl
- }
- function b() {
- f(!1)
- }
- function k() {
- if (r = [], n("table.wmtable :checked").each(function() {
- var t = n(this),
- i = t.attr("appID");
- r.push(i)
- }), r.length > 0) {
- var t = "";
- for (i = 0; i < r.length; i++) t = t + "<tr><td>" + r[i] + "<\/td><\/tr>";
- n("#deleteConfirmPage tbody").prepend(t);
- n("#deleteConfirmPage").jqm({
- overlay: 5,
- modal: !0
- }).jqmShow()
- }
- }
- function d() {
- r = [];
- triggerCheckboxChange();
- n("#deleteConfirmPage").hide();
- n("#delTable > tbody").empty()
- }
- function g() {
- r = [];
- document.location.href = t.developersShowAppIdUrl
- }
- function nt() {
- n("#deleteConfirmPage").hide();
- showActivityIndicator(!0);
- startPostRequestWithJson({
- appIds: r
- }, t.RemoveUrl, g, u, "#deleteConfirmPage", null, {
- traditional: !0
- })
- }
- function tt() {
- var n = document.getElementById("appIdsName"),
- i = n.options[n.selectedIndex].value,
- r = n.options[n.selectedIndex].text;
- console.log(r + i);
- document.location.href = [t.developersReportAppIdUrl, "?appId=", i].join("")
- }
- function it() {
- n("#appIdsName").live("change", function() {
- tt()
- });
- n("#appIdDevelopersList table.wmtable :checkbox").live("change", o);
- n('table.wmtable tbody a[action="edit"]').click(h);
- n('table.wmtable tbody a[action="appId"]').click(c);
- n("#cancelAppid").click(l);
- n("#submitEditAppid").click(p);
- n("#addAppId").click(w);
- n("#submitAppid").click(b);
- n("#deleteAppId").click(k);
- n("#deleteConfirm").click(nt);
- n("#deleteCancel").click(d);
- n("#thankYouOk").click(y);
- var r = getStandartChartOptions(),
- u = n("#chart"),
- f = n('.charts-legend input[type="checkbox"]'),
- i = [
- [],
- []
- ],
- e;
- splitChartData(t.data, i, 2);
- e = setupChart(u, r, f, i, "#keywordRangeFrom", "#keywordRangeTo", "#keywordRangeContainer", "#site-nav-toggle-button");
- n("#keywordRangeContainer").live("dateChanged", s)
- }
- var r = [],
- o = setupGridCheckButtonEnabler("#appIdDevelopersList table.wmtable", "#deleteAppId");
- it()
- }
- }(jQuery),
- function(n) {
- n.fn.adminappidsreport = function() {
- n("#submitParam").click(function() {
- n("#addParamForm").submit()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.articleCategories = function(t) {
- function r() {
- n("#helpCategoriesTableContainer tbody tr").removeClass("row-selected");
- var r = n(this).parent(),
- i = n("td > input", r),
- u = n("td:nth-child(2)", r).text(),
- f = i.attr("categoryId"),
- e = i.attr("culture"),
- o = i.attr("sortOrder"),
- s = i.attr("landingArticleId");
- n("#title").val(u);
- n("#SortOrder").val(o);
- n("#LandingArticleId").val(s);
- n("#Culture").val(e);
- n("#categoryId").val(f);
- n("#submitParam").val("Update Selected");
- n("#clearSelection").show();
- n("#categoryForm").attr("action", t.updateCatoryUrl);
- r.addClass("row-selected")
- }
- function u() {
- n("#categoryForm").valid() && n("#categoryForm").submit()
- }
- function f() {
- n("#title").val("");
- n("#SortOrder").val("");
- n("#LandingArticleId").val("");
- n("#helpCategoriesTableContainer tbody tr").removeClass("row-selected");
- n("#submitParam").val("Add");
- n("#clearSelection").hide();
- n("#categoryForm").attr("action", t.addCategoryUrl)
- }
- function e() {
- var t = i.filter(":checked");
- n("#deleteCategory").prop("disabled", t.length == 0)
- }
- function o() {
- n.ajax({
- type: "POST",
- url: t.deleteCatoryUrl,
- data: s(),
- contentType: "application/json;",
- dataType: "json",
- success: function() {
- window.location.reload(!0)
- }
- })
- }
- function s() {
- var t = [],
- r = i.filter(":checked");
- return n.each(r, function() {
- var i = {
- categoryid: n(this).attr("categoryid"),
- culture: n(this).attr("culture")
- };
- t.push(i)
- }), JSON.stringify(t)
- }
- function h() {
- n("#helpCategoriesTableContainer tbody td:not(:first-child)").click(r);
- n("#submitParam").click(u);
- n("#clearSelection").click(f);
- n("#categoryForm").attr("action", t.addCategoryUrl);
- n("#title").val("");
- n("#SortOrder").val("");
- n("#deleteCategory").prop("disabled", !0);
- i.change(e);
- n("#deleteCategory").click(o);
- n("#categoryForm").validate(formValidateOptions)
- }
- var i = n("#helpCategoriesTableContainer input[type='checkbox']");
- h()
- }
- }(jQuery),
- function(n) {
- n.fn.articledetail = function(t) {
- function i() {
- window.open(t.previewUrl, "helppreview")
- }
- function r() {
- n("#helpArticleForm input[type='text']").each(function() {
- n(this).val() == n(this).attr("placeholder") && n(this).val("")
- });
- (n("#state").val() == 1 || n("#helpArticleForm").valid()) && (n("#helpArticleForm").attr("action", t.saveDraftUrl), n("#helpArticleForm").submit())
- }
- function u() {
- n("#helpArticleForm").attr("action", t.discardDraftUrl);
- n("#helpArticleForm").submit()
- }
- function f() {
- n("#helpArticleForm").attr("action", t.publishUrl);
- n("#helpArticleForm").submit()
- }
- function e() {
- n("#helpArticleForm").attr("action", t.unPublishUrl);
- n("#helpArticleForm").submit()
- }
- function o() {
- n("#helpArticleForm").attr("action", t.deleteUrl);
- n("#helpArticleForm").submit()
- }
- function s() {
- document.location.href = t.cancelUrl
- }
- function h() {
- var t = n("#state").val();
- n(".filter-block input").removeAttr("disabled");
- switch (t) {
- case "1":
- n("#discardDraft").hide();
- n("#publishArticle").prop("disabled", !0);
- n("#helpArticleForm input[type='text']").prop("readOnly", !0);
- n("#helpArticleForm select").prop("readOnly", !0);
- n("#helpArticleForm textarea").prop("readOnly", !0);
- break;
- case "2":
- n("#discardDraft").hide();
- n("#unPublishArticle").hide()
- }
- }
- function c() {
- n.validator.addClassRules({
- helpTextRequired: {
- required: function() {
- var t = n("#RedirectUrl");
- return t.val().length == 0 ? !0 : isValueSameAsPalceHolder(t.val(), t)
- }
- }
- })
- }
- function l() {
- h();
- c();
- n("#preview").click(i);
- n("#saveDraft").click(r);
- n("#discardDraft").click(u);
- n("#publishArticle").click(f);
- n("#unPublishArticle").click(e);
- n("#deleteArticle").click(o);
- n("#cancel").click(s);
- n("#CategoryId").val(t.selectedCategory);
- n("#helpArticleForm").validate(formValidateOptions)
- }
- l()
- }
- }(jQuery),
- function(n) {
- n.fn.articlesreport = function(t) {
- function u() {
- var t = n("td > input", n(this).parent()).attr("url");
- document.location.href = t
- }
- function f() {
- var f = i.filter(":checked"),
- t = !0,
- r = !0,
- u = !1;
- n.each(f, function() {
- u = !0;
- n(this).attr("state") == "1" && (t = !1);
- n(this).attr("state") == "2" && (r = !1)
- });
- u == !1 && (t = !1, r = !1);
- n("#publishArticle").prop("disabled", !t);
- n("#unPublishArticle").prop("disabled", !r);
- n("#deleteArticle").prop("disabled", !u)
- }
- function e() {
- document.location.href = t.addNewArticleUrl
- }
- function o() {
- r(t.publishBulkUrl)
- }
- function s() {
- r(t.unpublishBulkUrl)
- }
- function h() {
- r(t.deleteBulkUrl)
- }
- function r(t) {
- n.ajax({
- type: "POST",
- url: t,
- data: c(),
- contentType: "application/json;",
- dataType: "json",
- success: function() {
- window.location.reload(!0)
- }
- })
- }
- function c() {
- var t = [],
- r = i.filter(":checked");
- return n.each(r, function() {
- var i = {
- articleid: n(this).attr("articleid"),
- version: n(this).attr("version"),
- culture: n(this).attr("culture")
- };
- t.push(i)
- }), JSON.stringify(t)
- }
- function l() {
- i.prop("checked", !1);
- n("#addArticle").prop("disabled", !1);
- n("#publishArticle").prop("disabled", !0);
- n("#unPublishArticle").prop("disabled", !0);
- n("#deleteArticle").prop("disabled", !0);
- n("#helpArticlesTableContainer tbody td:not(:nth-child(1), :nth-child(2))").click(u);
- i.change(f);
- n("#addArticle").click(e);
- n("#publishArticle").click(o);
- n("#unPublishArticle").click(s);
- n("#deleteArticle").click(h)
- }
- var i = n("#helpArticlesTableContainer input[type='checkbox']");
- l()
- }
- }(jQuery),
- function(n) {
- n.fn.adminblockusers = function(t) {
- function e(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- r();
- n("table.wmtable :checkbox").each(function() {
- n(this).attr("userid") == t.UserId && n(this).attr("email") == t.Email && n(this).parent().parent().remove()
- });
- n("#email").val("");
- n('input[type="checkbox"][name="role"]', "#addParamForm").each(function() {
- n(this).next().removeClass("on");
- n(this).prop("checked", !1)
- });
- var i = n("<tr/>");
- i.append(n("<td/>").append(n("<input>", {
- type: "checkbox",
- userid: t.UserId,
- email: t.Email
- })).append(n("<label/>"))).append(n("<td/>").text(t.Email)).append(n("<td/>").text(t.UserId));
- n("#userList table.wmtable tbody").prepend(i)
- }
- function o(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- r();
- reportError(n)
- }
- function s(t, r) {
- var f, u;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), f = {}, u = 0; u < r.length; ++u) f[r[u].UserId + "|" + r[u].Email] = !0;
- n("#userList table.wmtable input[type=checkbox]").each(function() {
- var t = n(this).attr("userid") + "|" + n(this).attr("email");
- f[t] && n(this).parent().parent().remove()
- });
- i()
- }
- function h(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- var i = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
- u = null,
- r = function() {
- n("#email").attr("disabled", null);
- n("#addParam").attr("disabled", null)
- },
- f = function() {
- n("#email").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled")
- };
- n("#addParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
- var i = n.trim(n("#email").val()),
- r = n('input[type="checkbox"][name="role"]:checked', "#addParamForm"),
- h = u,
- s = [];
- r.each(function() {
- s.push(n(this).val())
- });
- showActivityIndicator(!0);
- f();
- startPostRequestWithJson({
- email: i
- }, t.AddUrl, e, o, "#addParamForm")
- }
- });
- n("#editParam").click(function() {
- n(this).attr("disabled") != "disabled" && n("#addParam").click()
- });
- n("#removeParam").click(function() {
- var r = [];
- n("#userList table.wmtable :checked").each(function() {
- var t = n(this),
- i = {
- Email: t.attr("email"),
- UserId: t.attr("userid")
- };
- r.push(i)
- });
- r.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
- blockedUsers: JSON.stringify(r)
- }, t.RemoveUrl, function(n) {
- s(n, r)
- }, h, "#addParamForm"));
- i()
- });
- n("#addParamForm").validate(formValidateOptions);
- n("#userList table.wmtable :checkbox").live("change", i);
- clickButtonOnEnter("#addParam", ["#email"])
- }
- }(jQuery),
- function(n) {
- n.fn.admindebugsitemaps = function(t) {
- function i(i) {
- showActivityIndicator(!0);
- n.getJSON(t.ResubmitUrl, {
- feedUrl: i
- }, function() {
- hideActivityIndicator();
- unsetModalActivityIndicator()
- }).error(function(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- })
- }
- n("#submitParam").click(function() {
- n("#addParamForm").valid() && n("#addParamForm").submit()
- });
- n("#resubmitParam").click(function() {
- n("#addParamForm").valid() && i(n("#feedurl").val())
- });
- n("#addParamForm").validate(formValidateOptions);
- clickButtonOnEnter("#submitParam", ["#feedurl", "#siteurl"])
- }
- }(jQuery),
- function(n) {
- n.fn.adminfetchurl = function(t, i) {
- var r = function() {
- n("#fetchedContent").load(t.updateUrl)
- };
- if (i == "update") {
- setTimeout(r, 1e3);
- return
- }
- if (i == "prettify") {
- n(".prettyprint").length > 0 && prettyPrint();
- return
- }
- n("#submitParam").click(function() {
- n("#addParamForm").submit()
- });
- t.updateUrl != "" && setTimeout(r, 1e3)
- }
- }(jQuery),
- function(n) {
- n.fn.adminglobalusers = function(t) {
- function o(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- f();
- e();
- n("table.wmtable :checkbox").each(function() {
- n(this).attr("userid") == t.UserId && n(this).attr("email") == t.Email && n(this).parent().parent().remove()
- });
- n("#email").val("");
- n('input[type="checkbox"][name="role"]', "#addParamForm").each(function() {
- n(this).next().removeClass("on");
- n(this).prop("checked", !1)
- });
- var i = n("<tr/>");
- i.append(n("<td/>").append(n("<input>", {
- type: "checkbox",
- userid: t.UserId,
- email: t.Email,
- roles: t.Roles
- })).append(n("<label/>"))).append(n("<td/>").append(n("<a>", {
- href: "javascript:void(0)"
- }).text(t.Email))).append(n("<td/>").text(t.UserId)).append(n("<td/>").text(t.RolesFormatted));
- n("#userList table.wmtable tbody").prepend(i)
- }
- function s(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- f();
- reportError(n)
- }
- function c(t, i) {
- var f, r;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), f = {}, r = 0; r < i.length; ++r) f[i[r].UserId + "|" + i[r].Email] = !0;
- n("#userList table.wmtable input[type=checkbox]").each(function() {
- var t = n(this).attr("userid") + "|" + n(this).attr("email");
- f[t] && n(this).parent().parent().remove()
- });
- u()
- }
- function l(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- var u = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
- i = !1,
- r = null,
- f = function() {
- n("#email").attr("disabled", null);
- n("#addParam").attr("disabled", null);
- n("#editParam").attr("disabled", null)
- },
- h = function() {
- n("#email").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled");
- n("#editParam").attr("disabled", "disabled")
- },
- e = function() {
- i && (r = null, i = !1, n("#addParam").show(), n("#editParam").hide(), n("#addCaption").show(), n("#editCaption").hide(), n("#userList table.wmtable tr.row-selected").removeClass("row-selected"))
- };
- n("#addParam").click(function() {
- if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
- var f = n.trim(n("#email").val()),
- e = n('input[type="checkbox"][name="role"]:checked', "#addParamForm"),
- c = r,
- u = [];
- e.each(function() {
- u.push(n(this).val())
- });
- showActivityIndicator(!0);
- h();
- i ? startPostRequestWithJson({
- roles: JSON.stringify([{
- Email: f,
- UserId: c
- }]),
- access: u
- }, t.UpdateUrl, function(n) {
- o(n[0])
- }, s, "#addParamForm", null, {
- traditional: !0
- }) : startPostRequestWithJson({
- email: f,
- access: u
- }, t.AddUrl, o, s, "#addParamForm", null, {
- traditional: !0
- })
- }
- });
- n("#editParam").click(function() {
- n(this).attr("disabled") != "disabled" && n("#addParam").click()
- });
- n("#removeParam").click(function() {
- var i = [];
- n("#userList table.wmtable :checked").each(function() {
- var t = n(this),
- r = {
- Email: t.attr("email"),
- UserId: t.attr("userid")
- };
- i.push(r)
- });
- i.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
- roles: JSON.stringify(i)
- }, t.RemoveUrl, function(n) {
- c(n, i)
- }, l, "#addParamForm"))
- });
- n("#addParamForm").validate(formValidateOptions);
- n("#userList table.wmtable :checkbox").live("change", u);
- n("#userList table.wmtable a").live("click", function() {
- var t, f, u, e;
- if (n("#addParam").attr("disabled") != "disabled") {
- t = n(this).parent().parent().find('input[type="checkbox"]');
- n("#email").val(t.attr("email"));
- n("#addParam").hide();
- n("#editParam").show();
- n("#addCaption").hide();
- n("#editCaption").show();
- f = t.attr("roles").split(",");
- u = {};
- for (e in f) u[f[e]] = !0;
- n('input[type="checkbox"][name="role"]', "#addParamForm").each(function() {
- var t = u[n(this).val()];
- console.log(u, n(this).val(), t);
- t ? n(this).next().addClass("on") : n(this).next().removeClass("on");
- n(this).prop("checked", t)
- });
- r = t.attr("userid");
- i = !0;
- n("#userList table.wmtable tr.row-selected").removeClass("row-selected");
- n(this).parent().parent().addClass("row-selected");
- scrollToTop()
- }
- });
- n("#email").keyup(function() {
- e()
- });
- clickButtonOnEnter("#addParam", ["#email"])
- }
- }(jQuery),
- function(n) {
- n.fn.helpImage = function(t) {
- function i() {
- n("#imageForm").valid() && (n("#imageForm").attr("action", t.saveImageUrl), n("#imageForm").submit())
- }
- function r() {
- n("#imageForm").attr("action", t.deleteImageUrl);
- n("#imageForm").submit()
- }
- function u() {
- n("#imageForm").attr("action", t.cancelImageUrl);
- n("#imageForm").submit()
- }
- function f() {
- n("#save").prop("disabled", !1);
- n("#delete").prop("disabled", !1);
- n("#cancel").prop("disabled", !1);
- n("#save").click(i);
- n("#delete").click(r);
- n("#cancel").click(u);
- n("#imageForm").validate(formValidateOptions);
- t.imageExists && (n(".fileInputSelector .fields-required-marker").hide(), n("#httpFile").removeClass("required"))
- }
- f()
- }
- }(jQuery),
- function(n) {
- n.fn.helpImages = function(t) {
- function r() {
- var t = n("td > input", n(this).parent()).attr("url");
- document.location.href = t
- }
- function u() {
- var t = i.filter(":checked");
- n("#deleteimages").prop("disabled", t.length == 0)
- }
- function f() {
- document.location.href = t.addImageUrl
- }
- function e() {
- n.ajax({
- type: "POST",
- url: t.deleteImageUrl,
- data: o(),
- contentType: "application/json;",
- dataType: "json",
- success: function() {
- window.location.reload(!0)
- }
- })
- }
- function o() {
- var t = [],
- r = i.filter(":checked");
- return n.each(r, function() {
- var i = {
- imageId: n(this).attr("imageId"),
- culture: n(this).attr("culture")
- };
- t.push(i)
- }), JSON.stringify(t)
- }
- function s() {
- i.prop("checked", !1);
- n("#addImage").prop("disabled", !1);
- n("#deleteimages").prop("deleteImages", !0);
- n("#helpImagesTableContainer tbody td:not(:first-child)").click(r);
- i.change(u);
- n("#addImage").click(f);
- n("#deleteimages").click(e)
- }
- var i = n("#helpImagesTableContainer input[type='checkbox']");
- s()
- }
- }(jQuery),
- function(n) {
- n.fn.admininvalidatecache = function() {
- n("#submitParam").click(function() {
- n("#addParamForm").submit()
- })
- }
- }(jQuery),
- function(n) {
- var t = {},
- r = {},
- i;
- n.fn.adminmessaging = function(u, f) {
- function v() {
- t = {};
- n("tbody", "#messageParamList").empty()
- }
- function y(i) {
- var u = n("#messageRowTemplate").html(),
- r = n("<tr/>", {
- parameterName: i.Name
- });
- r.append(n("<td/>").append(n("<a>", {
- href: "javascript:void(0)"
- }).text(i.Name))).append(n("<td/>").append(n("<input>", {
- type: "text",
- parameterName: i.Name
- }).val(i.Value)));
- n("#messageParamList tbody").append(r);
- t[i.Name] = i.Value
- }
- function o() {
- var s = n("#message").val(),
- u = s.match(/%%[a-z0-9_]+%%/gi),
- e, r, i, o, f;
- if (u == null) n("tfoot", "#messageParamList").show(), t = {}, n("tbody", "#messageParamList").empty();
- else {
- for (n("tfoot", "#messageParamList").hide(), e = {}, r = 0; r < u.length; ++r) i = u[r].substr(2, u[r].length - 4), t[i] == null ? y({
- Name: i,
- Value: ""
- }) : (o = n('tr[parameterName="' + i + '"]', "#messageParamList"), n("input", o).val(t[i])), e[i] = !0;
- for (f in t) e[f] || (delete t[f], n('tr[parameterName="' + f + '"]', "#messageParamList").remove())
- }
- }
- function s() {
- var r = n("#messagepreset").val(),
- t, i;
- n("#custommessage").is(":checked") ? (n("#messagepreset").hide(), n("#message").prop("disabled", !1)) : (n("#messagepreset").show(), n("#message").prop("disabled", !0), t = n("#messagepreset").children('option[value="' + r + '"]'), i = t.attr("key"), n("#message").val(n("#" + i + "Detail").html()));
- v();
- o()
- }
- function h(r) {
- var f = n.trim(n("#siteurl").val()),
- u;
- return isValueSameAsPalceHolder(f, n("#siteurl")) && (f = ""), u = {
- SiteUrl: f,
- MessageType: n("#messagetype").val(),
- Subject: n("#customsubject").is(":checked") ? n.trim(n("#subject").val()) : n("#subjectpreset").val(),
- Body: n("#custommessage").is(":checked") ? n.trim(n("#message").val()) : n("#messagepreset").val(),
- Params: JSON.stringify(t),
- State: r ? 1 : 0,
- Market: n.trim(n("#market").val())
- }, i != null && (i.State != 0 && (u.State = i.State), u = n.extend(i, u)), u
- }
- function c(t) {
- var i = n("<tr/>");
- i.append(n("<td/>").append(n("<input>", {
- type: "checkbox",
- messageid: t.MessageId,
- category: t.Category,
- state: t.State
- })).append(n("<label/>"))).append(n("<td/>").text(t.Subject)).append(n("<td/>").append(n("<span>", {
- "class": "url-text"
- }).text(t.SiteUrl != null && t.SiteUrl != "") ? t.SiteUrl : wr.AdminMessaging_AllDomains)).append(n("<td/>").text(u.messageStates[t.State])).append(n("<td/>").text(u.messageTypes[t.MessageType])).append(n("<td/>").text(t.DateFormatted));
- n("#messageList table.wmtable tbody").prepend(i)
- }
- function p(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n("table.wmtable :checkbox").each(function() {
- n(this).attr("messageid") == t.MessageId && n(this).parent().parent().remove()
- });
- c(t);
- n("#messageDialog").jqmHide()
- }
- function w(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function b(t, i) {
- var u, r;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, r = 0; r < i.length; ++r) u[i[r].MessageId] = !0;
- n("#messageList table.wmtable input[type=checkbox]").each(function() {
- var t = n(this).attr("messageid");
- u[t] && n(this).parent().parent().remove()
- });
- for (r in t) c(t[r]);
- e()
- }
- function k(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function l(t) {
- if (n("#addParamForm").valid()) {
- var r = h(t);
- r.Body = encodeURIComponent(r.Body);
- showActivityIndicator(!0);
- startPostRequestWithJson({
- message: JSON.stringify(r)
- }, i == null ? u.AddUrl : u.UpdateUrl, p, w, "#tokenContainer")
- }
- }
- function a() {
- n("#save").click(function() {
- n(this).attr("disabled") != "disabled" && l(!1)
- });
- n("#send").click(function() {
- n(this).attr("disabled") != "disabled" && l(!0)
- });
- n("#preview").click(function() {
- if (n(this).attr("disabled") != "disabled") {
- showActivityIndicator(!0);
- var t = h(!1);
- t.__RequestVerificationToken = getRequestVerificationToken("#addParamForm");
- n.post(u.previewDialogUrl, t, function(t) {
- n("#messageDialog").jqmHide();
- showPopupModalDialog("#messagePreviewDialog", t, {
- onHide: function(t) {
- t.w.hide();
- t.o && t.o.remove();
- n("#messageDialog").jqmShow()
- }
- });
- hideActivityIndicator()
- }).error(function() {
- showErrorMessage(null, wr.G_Error)
- })
- }
- });
- n("#customsubject").change(function() {
- n(this).prop("checked") ? (n("#subjectpreset").hide(), n("#subject").show()) : (n("#subjectpreset").show(), n("#subject").hide())
- });
- n("#custommessage").change(s);
- var i = null;
- n("#message").keyup(function() {
- i != null && clearTimeout(i);
- i = setTimeout(o, 500)
- });
- n("#messagepreset").change(s);
- n("input", "#messageParamList").live("keyup", function() {
- t[n(this).attr("parametername")] = n(this).val()
- });
- s()
- }
- if (f == "setparameters") {
- r = u;
- return
- }
- var e = setupGridCheckButtonEnabler("#messageList table.wmtable", "#removeParam");
- n("#addParam").click(function() {
- n(this).attr("disabled") != "disabled" && (showActivityIndicator(!0), n.post(u.addDialogUrl, function(n) {
- showPopupModalDialog("#messageDialog", n);
- hideActivityIndicator();
- a();
- i = null
- }))
- });
- n("#removeParam").click(function() {
- var t = [];
- n("#messageList table.wmtable :checked").each(function() {
- var i = n(this),
- r = {
- MessageId: i.attr("messageid")
- };
- t.push(r)
- });
- t.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
- messages: JSON.stringify(t)
- }, u.RemoveUrl, function(n) {
- b(n, t)
- }, k, "#tokenContainer"));
- e()
- });
- n("#messageList tbody tr td").live("click", function() {
- if (!(n('input[type="checkbox"]', n(this)).length > 0)) {
- var f = n('input[type="checkbox"]', n(this).parent()),
- e = f.attr("messageid"),
- s = f.attr("state"),
- c = f.attr("category");
- r = null;
- showActivityIndicator(!0);
- n.post(n.validator.format(u.editDialogUrl, encodeURI(e)), function(n) {
- showPopupModalDialog("#messageDialog", n);
- hideActivityIndicator();
- a();
- r != null && (t = r, o(), i = h(!1), i.MessageId = e, i.State = s, i.Category = c)
- })
- }
- });
- n("#messageList table.wmtable :checkbox").live("change", e)
- }
- }(jQuery),
- function(n) {
- n.fn.adminResetQuota = function() {
- n("#resetParam").click(function() {
- n("#addParamForm").valid() && n("#addParamForm").submit()
- });
- n("#addParamForm").validate(formValidateOptions);
- clickButtonOnEnter("#resetParam", ["#siteurl"])
- }
- }(jQuery),
- function(n) {
- n.fn.adminsubmiturls = function(t) {
- function u(t, r) {
- var f, u;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), i(), n("#urls").val(""), f = [], f.push(r + ":"), u = 0; u < t.length; ++u) f.push('<a href="' + t[u] + '" target="blank">' + t[u] + "<\/a>");
- n("#resultArea").html(f.join("<br/>"))
- }
- function f(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- reportError(n)
- }
- var i = function() {
- n("#urls").attr("disabled", null);
- n("#addParam").attr("disabled", null)
- },
- r = function() {
- n("#urls").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled")
- };
- n("#addParam").click(function() {
- var i, e;
- if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && n("#addParamForm").valid()) {
- var o = n("#urls").val().split("\n"),
- s = [],
- h = n('input[type="radio"]:checked', "#addParamForm").val();
- for (i = 0; i < o.length; ++i) e = n.trim(o[i]), e != "" && s.push(e);
- showActivityIndicator(!0);
- r();
- startPostRequestWithJson({
- target: h,
- urlList: s
- }, t.SubmitUrl, function(n) {
- u(n, h)
- }, f, "#addParamForm", null, {
- traditional: !0
- })
- }
- });
- n("#addParamForm").validate(n.merge({
- onkeyup: !1,
- focusCleanup: !0,
- errorPlacement: function() {}
- }, formValidateOptions));
- n("#urls").urlTextArea()
- }
- }(jQuery),
- function(n) {
- n.fn.admintermofuse = function(t) {
- function u(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- n("#tou").val("");
- var r = n("<tr/>");
- r.append(n("<td/>").append(n("<span>", {
- feature: t.FeatureName,
- version: t.Version,
- isactive: t.IsActive ? "1" : "0"
- }).text(t.FeatureName))).append(n("<td/>").text(t.Version)).append(n("<td/>").text(t.IsActive ? wr.AdminTermOfUse_StatusActive : wr.AdminTermOfUse_StatusInactive)).append(n("<td/>").text(t.DateFormatted));
- n("#touList table.wmtable tbody").prepend(r)
- }
- function f(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- reportError(n)
- }
- function e(t, r, u) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- n("#touList table.wmtable span").each(function() {
- if (n(this).attr("feature") == r) {
- var t = n(n(this).parent().parent().children("td")[2]);
- n(this).attr("version") == u ? t.text(wr.AdminTermOfUse_StatusActive) : t.text(wr.AdminTermOfUse_StatusInactive)
- }
- })
- }
- function o(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i();
- reportError(n)
- }
- var i = function() {
- n("#tou").attr("disabled", null);
- n("#featuretoadd").attr("disabled", null);
- n("#upload").attr("disabled", null)
- },
- r = function() {
- n("#tou").attr("disabled", "disabled");
- n("#featuretoadd").attr("disabled", "disabled");
- n("#upload").attr("disabled", "disabled")
- };
- n("#upload").click(function() {
- if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
- var i = n("#tou").val(),
- e = n("#featuretoadd").val();
- showActivityIndicator(!0);
- r();
- startPostRequestWithJson({
- featureName: e,
- text: i
- }, t.UploadUrl, u, f, "#addParamForm")
- }
- });
- n("#touList tbody tr").click(function() {
- var f = n("td:first span", n(this)),
- i = f.attr("feature"),
- u = f.attr("version");
- showActivityIndicator(!0);
- n.post(n.validator.format(t.dialogUrl, encodeURI(i), encodeURI(u)), function(f) {
- showPopupModalDialog("#touViewDialog", f);
- hideActivityIndicator();
- n("#activate").click(function() {
- n("#touViewDialog").jqmHide().remove();
- showActivityIndicator(!0);
- r();
- startPostRequestWithJson({
- tou: JSON.stringify({
- FeatureName: i,
- Version: u
- })
- }, t.ActivateUrl, function(n) {
- e(n, i, u)
- }, o, "#addParamForm")
- })
- })
- });
- n("#addParamForm").validate(n.merge({
- onkeyup: !1,
- focusCleanup: !0,
- errorPlacement: function() {}
- }, formValidateOptions));
- n("#feature").change(function() {
- n("#filterForm").submit()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.adminusers = function(t) {
- function c(t) {
- var o, s;
- console.log("addParamSuccess", t);
- hideActivityIndicator();
- unsetModalActivityIndicator();
- h();
- i && (o = {}, o[r + "|" + f + "|" + u] = !0, n("#userList table.wmtable input[type=checkbox]").each(function() {
- var t = n(this).attr("userid") + "|" + n(this).attr("url") + "|" + n(this).attr("verificationurl");
- o[t] && n(this).parent().parent().remove()
- }));
- e();
- n("#email").val("");
- s = n("<tr/>");
- s.append(n("<td/>").append(n("<input>", {
- type: "checkbox",
- email: t.Email,
- userid: t.UserId,
- url: t.Site,
- verificationurl: t.VerificationSite,
- role: t.Role,
- authenticationcode: t.AuthenticationCode,
- delegatedcode: t.DelegatedCode,
- delegatedcodeowneremail: t.DelegatedCodeOwnerEmail,
- delegatorid: t.DelegatorId,
- delegatoremail: t.DelegatorEmail
- })).append(n("<label/>"))).append(n("<td/>").append(n("<a>", {
- href: "javascript:void(0)"
- }).text(t.Email))).append(n("<td/>").append(n("<span>", {
- "class": "url-text"
- }).text(t.Site))).append(n("<td/>").append(n("<span>", {
- "class": "url-text"
- }).text(t.VerificationSite))).append(n("<td/>").text(t.RolesFormatted)).append(n("<td/>").text(t.DelegatedCodeOwnerEmail != null ? t.DelegatedCodeOwnerEmail : "")).append(n("<td/>").text(t.DelegatorEmail != null ? t.DelegatorEmail : "")).append(n("<td/>").text(t.AuthenticationCode != null ? t.AuthenticationCode : "")).append(n("<td/>").text(t.Expired ? wr.G_Expired : "")).append(n("<td/>").text(t.DateFormatted));
- n("#userList table.wmtable tbody").prepend(s)
- }
- function l(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- h();
- reportError(n)
- }
- function v(t, i) {
- var u, r;
- for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, r = 0; r < i.length; ++r) u[i[r].Site + "|" + i[r].Email + "|" + i[r].VerificationSite] = !0;
- n("#userList table.wmtable input[type=checkbox]").each(function() {
- var t = n(this).attr("url") + "|" + n(this).attr("email") + "|" + n(this).attr("verificationurl");
- u[t] && n(this).parent().parent().remove()
- });
- o()
- }
- function y(n) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- reportError(n)
- }
- function p(t) {
- t.Site = n.trim(t.Site);
- t.VerificationSite = n.trim(t.VerificationSite);
- t.VerificationSite == "" && (t.VerificationSite = t.Site);
- t.Email = n.trim(t.Email);
- t.DelegatedCode = n.trim(t.DelegatedCode);
- t.DelegatedCode == "" && (t.DelegatedCode = null);
- t.DelegatedCodeOwnerEmail = n.trim(t.DelegatedCodeOwnerEmail);
- t.DelegatedCodeOwnerEmail == "" && (t.DelegatedCodeOwnerEmail = null);
- t.DelegatorEmail = n.trim(t.DelegatorEmail);
- t.DelegatorEmail == "" && (t.DelegatorEmail = null);
- t.DelegatorId = n.trim(t.DelegatorId);
- t.DelegatorId == "" && (t.DelegatorId = null);
- t.Roles == "None" && (t.Roles = "")
- }
- var o = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
- i = !1,
- r = null,
- s = null,
- f = null,
- u = null,
- e = function() {
- i && (r = null, s = null, f = null, u = null, i = !1, n("#addParam").show(), n("#editParam").hide(), n("#userList table.wmtable tr.row-selected").removeClass("row-selected"))
- },
- h = function() {
- n("#email").attr("disabled", null);
- n("#url").attr("disabled", null);
- n("#role").attr("disabled", null);
- n("#verificationurl").attr("disabled", null);
- n("#delegatorid").attr("disabled", null);
- n("#delegatoremail").attr("disabled", null);
- n("#delegatedcode").attr("disabled", null);
- n("#delegatedcodeemail").attr("disabled", null);
- n("#authenticationcode").attr("disabled", null);
- n("#addParam").attr("disabled", null)
- },
- a = function() {
- n("#email").attr("disabled", "disabled");
- n("#url").attr("disabled", "disabled");
- n("#role").attr("disabled", "disabled");
- n("#verificationurl").attr("disabled", "disabled");
- n("#delegatorid").attr("disabled", "disabled");
- n("#delegatoremail").attr("disabled", "disabled");
- n("#delegatedcode").attr("disabled", "disabled");
- n("#delegatedcodeemail").attr("disabled", "disabled");
- n("#authenticationcode").attr("disabled", "disabled");
- n("#addParam").attr("disabled", "disabled")
- };
- n("#addParam").click(function() {
- var f, e;
- n(this).attr("disabled") != "disabled" && n("#addParamForm").valid() && (f = {
- Email: n("#email").val(),
- Site: n("#url").val(),
- VerificationSite: n("#verificationurl").val(),
- DelegatedCode: n("#delegatedcode").val(),
- DelegatedCodeOwnerEmail: n("#delegatedcodeemail").val(),
- DelegatorEmail: n("#delegatoremail").val(),
- DelegatorId: n("#delegatorid").val(),
- AuthenticationCode: n("#authenticationcode").val(),
- Roles: n("#role").val()
- }, console.log(f), p(f), showActivityIndicator(!0), a(), i ? (e = n.extend({}, f), e.UserId = r, e.VerificationSite = u, startPostRequestWithJson({
- siteRoles: JSON.stringify([e]),
- fields: JSON.stringify(f)
- }, t.UpdateUrl, function(n) {
- c(n[0])
- }, l, "#addParamForm")) : startPostRequestWithJson({
- fields: JSON.stringify(f)
- }, t.AddUrl, c, l, "#addParamForm"))
- });
- n("#removeParam").click(function() {
- var i = [];
- n("#userList table.wmtable :checked").each(function() {
- var t = n(this),
- r = {
- Site: t.attr("url"),
- Email: t.attr("email"),
- UserId: t.attr("userid"),
- VerificationSite: t.attr("verificationurl")
- };
- i.push(r)
- });
- console.log(i);
- i.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
- siteRoles: JSON.stringify(i)
- }, t.RemoveUrl, function(n) {
- v(n, i)
- }, y, "#addParamForm"))
- });
- n("#addParamForm").validate(formValidateOptions);
- n("#userList table.wmtable :checkbox").live("change", o);
- clickButtonOnEnter("#addParam", ["#url", "#email", "#verificationurl", "#delegatorid", "#delegatoremail", "#delegatedcode", "#delegatedcodeemail"]);
- n("#userList table.wmtable tbody a").live("click", function() {
- if (n("#addParam").attr("disabled") != "disabled") {
- var t = n(this).parent().parent().find('input[type="checkbox"]');
- n("#email").val(t.attr("email"));
- n("#url").val(t.attr("url"));
- n("#verificationurl").val(t.attr("verificationurl"));
- n("#authenticationcode").val(t.attr("authenticationcode"));
- n("#delegatedcode").val(t.attr("delegatedcode"));
- n("#delegatedcodeemail").val(t.attr("delegatedcodeowneremail"));
- n("#delegatorid").val(t.attr("delegatorid"));
- n("#delegatoremail").val(t.attr("delegatoremail"));
- n("#role").val(t.attr("role") ? t.attr("role") : "None");
- n("#addParam").hide();
- n("#editParam").show();
- r = t.attr("userId");
- s = t.attr("email");
- f = t.attr("url");
- u = t.attr("verificationurl");
- i = !0;
- n("#userList table.wmtable tr.row-selected").removeClass("row-selected");
- n(this).parent().parent().addClass("row-selected");
- scrollToTop()
- }
- });
- n("#editParam").click(function() {
- n(this).attr("disabled") != "disabled" && n("#addParam").click()
- });
- n("#email").keyup(function() {
- e()
- });
- n("#url").keyup(function() {
- e()
- });
- n("#applyFilter").click(function() {
- n("#filterForm").submit()
- });
- n("#toggleFilter").click(function() {
- n("#filter").val() == "all" ? n("#filter").val("").prop("disabled", !0) : n("#filter").val("all").prop("disabled", !1);
- n("#filterForm").submit()
- })
- }
- }(jQuery),
- function(n) {
- n.fn.appLinking = function() {
- function t(t) {
- t.indexOf("<table") > -1 ? n("#appt").html(t) : (n("#appt").html(""), n(".validationErrorPlaceholderBox ").html(t), n("#errorBox").show())
- }
- function i(i) {
- n("#errorBox").hide();
- hideActivityIndicator();
- t(i)
- }
- function r() {
- n("#errorBox").hide();
- n("#appLinksUrlTxt").removeClass("error");
- n("#activityIndicator").css("top", "120");
- n("#appLinksForm").valid() && (showActivityIndicator(!0), n.ajax({
- url: n("#appLinksForm").attr("action") + "?" + n("#appLinksForm").serialize(),
- type: "GET",
- dataType: "text",
- timeout: 13500,
- success: i,
- error: function(n) {
- handleAjaxError(n, reportError)
- }
- }))
- }
- function u() {
- validatorSetup();
- n("#fetchUrl").click(r);
- n("#appLinksUrlTxt").focus();
- clickButtonOnEnter("#fetchUrl", "#appLinksUrlTxt");
- n("#appLinksForm").validate(formValidateOptions)
- }
- u()
- }
- }(jQuery),
- function(n) {
- var t = function() {
- function n(n) {
- this.sessionId = n;
- this.newComment = ko.observable("").extend({
- required: !0
- });
- this.status = ko.observable("");
- this.error = ko.observable("");
- this.isShowStatus = ko.computed(function() {
- return !StringExtensions.isNullOrEmpty(this.status())
- }, this)
- }
- return n.prototype.getAjaxErrorAsString = function(n, t) {
- var i = {
- 400: "Server understood the request, but request content was invalid.",
- 401: "Unauthorized access.",
- 404: "URL not found",
- 403: "Forbidden resource can't be accessed.",
- 500: "Internal server error.",
- 503: "Service unavailable."
- };
- return n && n.status && i[n.status] ? i[n.status] : t ? t : "Unknown Error"
- }, n
- }(),
- i;
- n.SubmissionReviewViewModel = t;
- i = function() {
- function n(n) {
- this.submissionReviewViewModel = new t(n.sessionId)
- }
- return n.prototype.Run = function() {
- ko.validation.init({
- registerExtenders: !0,
- messagesOnModified: !0,
- insertMessages: !0,
- parseInputAttributes: !0,
- messageTemplate: null
- }, !0);
- this.knockoutSetup()
- }, n.prototype.knockoutSetup = function() {
- ko.applyBindings(this.submissionReviewViewModel)
- }, n
- }();
- n.SubmissionReview = i
- }(PublicTools || (PublicTools = {})),
- function(n) {
- n.fn.contentRemoval = function() {
- function r() {
- if (n("#errorBox").hide(), n("#cachedPageText").removeClass("error"), n("#activityIndicator").css("top", "120"), n("#contentRemovalForm").valid()) {
- showActivityIndicator(!0);
- var r = n("#contentRemovalForm").serialize();
- n.getJSON(n("#contentRemovalForm").attr("action"), r, function(r) {
- if (!r.Success) {
- n("#errorBox").text(r.ErrorMessage).show();
- r.CacheRefreshRequired && (n("#type").val(t).change(), n("#cachedPageText").addClass("error"));
- hideActivityIndicator();
- return
- }
- n("#contentRemovalForm")[0].reset();
- n("#errorBox").hide();
- hideActivityIndicator();
- i();
- u(r)
- })
- }
- }
- function u(t) {
- var i = "<tr><td class='centeralign'>{0}<\/td><td><a href='{1}' target='_blank' class='url-text'>{1}<span class='trend-icon blink-icon-popup'><\/span><\/a><\/td><td>{2}<\/td><td>{3}<\/td><td class='centeralign'>{4}<\/td><\/tr>",
- r = t.HttpResponse > 0 ? t.HttpResponse : t.ResponseDescription;
- i = n.validator.format(i, t.Date, t.Url, t.RemovalType, t.Status, r);
- n("table.grid tbody").prepend(i);
- n("table.grid tr.empty").addClass("none")
- }
- function i() {
- n("#type").val() == t ? n("#cachedTextContainer").removeClass("none") : (n("#cachedTextContainer").addClass("none"), n("#cachedPageText").val(""))
- }
- function f() {
- n.validator.addClassRules({
- requiredIfRemovalTypeCache: {
- required: {
- depends: function() {
- return n("#type").val() == t
- }
- }
- }
- })
- }
- function e() {
- f();
- i();
- n("#type").change(i);
- n("#submitHipUrl").click(r);
- n("#contentRemovalForm").validate(formValidateOptions)
- }
- var t = 2;
- e()
- }
- }(jQuery),
- function(n) {
- var t = function() {
- function t(n, t, i, r, u, f, e, o, s) {
- var h = this;
- this.sessionId = n;
- this.apiSubmitUrl = t;
- this.ticketDetailsUrl = i;
- this.firstName = ko.observable(r).extend({
- required: !0
- });
- this.lastName = ko.observable(u).extend({
- required: !0
- });
- this.companyName = ko.observable(f);
- this.copyrightOwnerFullName = ko.observable(e).extend({
- required: !0
- });
- this.copyrightOwnerCountry = ko.observable(o).extend({
- required: !0
- });
- this.emailAddress = ko.observable(s).extend({
- required: !0,
- email: !0
- });
- this.typeOfWork = ko.observable("").extend({
- required: !0
- });
- this.titleOfWork = ko.observable();
- this.authorizedExample = ko.observable();
- this.description = ko.observable().extend({
- required: !0
- });
- this.attachmentData = ko.observable("");
- this.bulkSubmissionData = ko.observable();
- this.urlsToRemove = ko.observable().extend({
- required: {
- onlyIf: function() {
- return StringExtensions.isNullOrEmpty(h.bulkSubmissionData())
- },
- message: "Please fill in the text area or upload a bulk submission"
- }
- });
- this.additionalInformation = ko.observable();
- this.goodFaithStatement = ko.observable(!1).extend({
- equal: {
- required: !0,
- message: "This field is required."
- }
- });
- this.authorityToActStatement = ko.observable(!1).extend({
- equal: {
- required: !0,
- message: "This field is required."
- }
- });
- this.acknowledgementStatement = ko.observable(!1).extend({
- equal: {
- required: !0,
- message: "This field is required."
- }
- });
- this.signature = ko.observable().extend({
- required: !0
- });
- this.relatedTickets = ko.observable();
- this.status = ko.observable("");
- this.error = ko.observable("");
- this.isShowStatus = ko.computed(function() {
- return !StringExtensions.isNullOrEmpty(this.status())
- }, this)
- }
- return t.prototype.validateAndSubmit = function() {
- var n = ko.validation.group(this);
- n().length === 0 ? this.submitDataToServer() : (n.showAllMessages(!0), this.error("Please fill in the required fields"))
- }, t.prototype.redirectToTicketDetailsPage = function(n) {
- var t = $.validator.format("{0}?ticketId={1}", this.ticketDetailsUrl, n);
- window.location.assign(t)
- }, t.prototype.resetFormFields = function() {
- this.firstName("");
- this.lastName("");
- this.companyName("");
- this.copyrightOwnerFullName("");
- this.copyrightOwnerCountry("");
- this.emailAddress("");
- this.typeOfWork("");
- this.titleOfWork("");
- this.authorizedExample("");
- this.description("");
- this.urlsToRemove("");
- this.additionalInformation("");
- this.goodFaithStatement(!1);
- this.authorityToActStatement(!1);
- this.acknowledgementStatement(!1);
- this.signature("");
- this.relatedTickets("");
- this.status("");
- this.clearAttachments();
- this.clearBulkSubmission();
- this.error("");
- var n = ko.validation.group(this);
- n.showAllMessages(!1)
- }, t.prototype.clearAttachments = function() {
- this.attachmentData("")
- }, t.prototype.clearBulkSubmission = function() {
- this.bulkSubmissionData("")
- }, t.prototype.getAjaxErrorAsString = function(n, t) {
- var i = {
- 400: "Server understood the request, but request content was invalid.",
- 401: "Unauthorized access.",
- 404: "URL not found",
- 403: "Forbidden resource can't be accessed.",
- 500: "Internal server error.",
- 503: "Service unavailable."
- };
- return n && n.status && i[n.status] ? i[n.status] : t ? t : "Unknown Error"
- }, t.prototype.submitDataToServer = function() {
- var i = this,
- t, r, f, u;
- this.status("Submitting...");
- this.error("");
- t = new FormData;
- t.append("__RequestVerificationToken", n.SearchBlockShared.getAntiForgeryToken());
- r = ko.toJS(this);
- delete r.error;
- t.append("data", ko.toJSON(r));
- f = $("#attachment").get(0).files;
- $.each(f, function(n, i) {
- t.append("attachment", i)
- });
- u = $("#bulkSubmission").get(0).files;
- u.length > 0 && t.append("bulk", u[0]);
- $.ajax({
- url: this.apiSubmitUrl,
- type: "POST",
- contentType: !1,
- processData: !1,
- data: t,
- success: function(n) {
- n.Success ? i.redirectToTicketDetailsPage(n.TicketId) : (i.status(""), i.error(n.Message))
- },
- error: function(n, t) {
- var r = i.getAjaxErrorAsString(n, t);
- i.status(r)
- }
- })
- }, t
- }(),
- i;
- n.ContentRemovalFormViewModel = t;
- i = function() {
- function n(n) {
- this.contentRemovalFormViewModel = new t(n.sessionId, n.apiSubmitUrl, n.ticketDetailsUrl, n.firstName, n.lastName, n.companyName, n.copyrightOwnerFullName, n.copyrightOwnerCountry, n.emailAddress)
- }
- return n.prototype.Run = function() {
- ko.validation.init({
- registerExtenders: !0,
- messagesOnModified: !0,
- insertMessages: !0,
- parseInputAttributes: !0,
- messageTemplate: null
- }, !0);
- this.knockoutSetup()
- }, n.prototype.knockoutSetup = function() {
- ko.applyBindings(this.contentRemovalFormViewModel)
- }, n
- }();
- n.ContentRemovalForm = i
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function n(n, t, i, r, u, f) {
- var e = this;
- this.name = ko.observable(n);
- this.size = ko.observable(t);
- this.id = ko.observable(i);
- this.error = ko.observable(r);
- this.eventType = ko.observable(u);
- this.success = ko.observable(f);
- this.formattedSize = ko.computed(function() {
- return e.formatFileSize(e.size())
- });
- this.showLoading = ko.computed(function() {
- return e.eventType() == "fileSelected" && !e.error()
- })
- }
- return n.prototype.formatFileSize = function(n) {
- if (n == 0) return "";
- var t = Math.floor(Math.log(n) / Math.log(1024)),
- i = Number((n / Math.pow(1024, t)).toFixed(2)),
- r = ["B", "KB", "MB", "GB", "TB"][t];
- return i + " " + r
- }, n.prototype.toJSON = function() {
- var n = ko.toJS(this);
- return n.id ? (delete n.size, delete n.error, delete n.success, delete n.formattedSize, delete n.showLoading, delete n.eventType, n) : null
- }, n
- }();
- n.Document = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function t(t, i) {
- var r = this;
- this.maxiFrameLoadWaitTimeInMilliSeconds = 15e3;
- this.removeDocument = function(t, i) {
- if (t) {
- if (t.eventType() == "fileSelected") {
- r.documents.remove(t);
- return
- }
- $.ajax({
- url: $.validator.format("{0}/tools/{1}/removedocument", containerPrefix, r.controller),
- type: "POST",
- data: n.SearchBlockShared.appendAntiForgeryToken({
- id: t.id(),
- sid: i
- }),
- success: function() {
- r.documents.remove(t);
- $(".error:visible").length && $("input[type=hidden][name=validUploads]").valid()
- }
- })
- }
- };
- this.documents = t;
- this.documentMessageHandlerSetup();
- this.controller = i
- }
- return t.prototype.documentMessageHandlerSetup = function() {
- var t = this;
- $(window).on("message", function(i) {
- var f = i.originalEvent.data,
- e = f.indexOf(":"),
- u, o, r, s, h;
- e != -1 && (u = f.substring(0, e), u == "fileSelected" || u == "fileUploaded") && (o = f.substring(e + 1), r = JSON.parse(o), r) && (s = u == "fileUploaded" && !r.Error, h = new n.Document(r.Name, parseInt(r.Size), r.Id, r.Error, u, s), t.addOrUpdateDocument(h), $(".error:visible").length && $("input[type=hidden][name=validUploads]").valid())
- })
- }, t.prototype.addOrUpdateDocument = function(n) {
- var i = this.documents().length,
- t;
- if (this.setupIFrameLoadTimer(n), i == 0) {
- this.documents.push(n);
- return
- }
- t = ko.utils.arrayFirst(this.documents(), function(n) {
- return n.error() != null
- });
- t && this.documents.remove(t);
- t = ko.utils.arrayFirst(this.documents(), function(t) {
- return t.name() == n.name()
- });
- t && this.documents.remove(t);
- this.documents.push(n)
- }, t.prototype.setupIFrameLoadTimer = function(t) {
- t.eventType() == "fileSelected" && (this.documentIframeErrorTimer = setTimeout(function() {
- var i = $("iframe[name=docUploader]").attr("src");
- t.error(n.SearchBlockFollowup.options.fileUploadError);
- $("iframe[name=docUploader]").attr("src", i)
- }, this.maxiFrameLoadWaitTimeInMilliSeconds));
- (t.eventType() == "fileUploaded" || t.error()) && clearTimeout(this.documentIframeErrorTimer)
- }, t
- }();
- n.DocumentUploadManager = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function n() {}
- return n.prototype.Run = function(n) {
- var i = n.UploadStatus,
- t;
- i && (window.top.postMessage("fileUploaded:" + JSON.stringify(i), "*"), $("#uploadFile span").text(n.UploadAnotherFile));
- t = $(".link-button");
- $("#uploaddoc").width(t.width() + 5).height(t.height());
- $("input:file").change(function() {
- var u = n.MaxUploadSize,
- f = n.MaxUploadSize / 1048576,
- t = {},
- i, r;
- this.files ? (i = this.files[0], t.Name = i.name, t.Size = parseInt(i.size), t.Type = i.type) : (r = $(this).val().split("\\").pop(), t.Name = r, t.Size = 0, t.Type = r.split(".").pop());
- t.Type.match(/(png|jpe?g|pdf)$/i) ? !t.Size || t.Size < u + 1 || (t.Error = $.validator.format(n.FileSizeError, f.toString())) : t.Error = n.AllowedFiletypesError;
- window.top.postMessage("fileSelected:" + JSON.stringify(t), "*");
- t.Error == null && $("#uploadForm").submit()
- });
- window.onscroll = function() {
- window.scrollTo(0, 0)
- }
- }, n
- }();
- n.DocUploader = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function t(i) {
- t.options = i;
- this.searchBlockUserViewModel = new n.SearchBlockUser(i.id, i.controller);
- t.documentUploadManager = new n.DocumentUploadManager(this.searchBlockUserViewModel.documents, i.controller);
- n.SearchBlockShared.lsAvailable() && localStorage.setItem("sid", i.id)
- }
- return t.prototype.Run = function() {
- this.validatorSetup();
- this.knockoutSetup()
- }, t.prototype.validatorSetup = function() {
- var n = $.extend(!0, {}, formValidateOptions),
- t;
- n.onkeyup = !1;
- n.focusCleanup = !0;
- n.ignore = [];
- n.errorPlacement = function(n, t) {
- t.hasClass("no-label") || n.insertAfter(t)
- };
- $(".part2 input[type=radio]").change(function() {
- $(".error:visible").length && $(".part2 textarea").valid()
- });
- $("#linkRemovalForm").on("change", ".urlItem input[type=checkbox]", function() {
- $(".error:visible").length && $(this).closest(".urlItem").find("textarea.dependentCheckboxes").valid()
- });
- $("a.add-url").on("click", function() {
- t.resetForm();
- $(".validationErrorPlaceholderBox").hide()
- });
- t = $("#linkRemovalForm").validate(n);
- $.validator.addClassRules({
- requiredIfPublicOrCommunityFigure: {
- required: function() {
- return $("[name=isPublicFigureRadio][value=true]").is(":checked") || $("[name=isCommunityInterestInfoRadio][value=true]").is(":checked")
- }
- },
- dependentCheckboxes: {
- required: function(n) {
- var t = $(n).closest(".page-content-items").find("input[type=checkbox]:checked");
- return t.length > 0
- }
- },
- docCount: {
- min: function(n) {
- return parseInt($(n).val()) == 0
- }
- }
- })
- }, t.prototype.knockoutSetup = function() {
- ko.bindingHandlers.slideVisible = {
- init: function(n, t) {
- $(n).toggle(ko.unwrap(t()))
- },
- update: function(n, t) {
- ko.unwrap(t()) ? $(n).slideDown() : $(n).slideUp()
- }
- };
- ko.bindingHandlers.fadeVisible = {
- init: function(n, t) {
- $(n).toggle(ko.unwrap(t()))
- },
- update: function(n, t) {
- ko.unwrap(t()) ? $(n).fadeIn() : $(n).fadeOut()
- }
- };
- ko.applyBindings(this.searchBlockUserViewModel)
- }, t
- }();
- n.EuSearchBlock = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- n.imageWidgetSetup = function(t) {
- function ft() {
- jQuery.extend(jQuery.validator.messages, {
- range: jQuery.validator.format(t.errorMessages.customSizeErrorMessage),
- required: t.errorMessages.queryErrorMessage
- });
- n.validator.addMethod("customColorCheck", function(t) {
- return /^(#)?([0-9a-fA-F]{3})([0-9a-fA-F]{3})?$/.test(n.trim(t)) ? !0 : !1
- }, t.errorMessages.customColorErrorMessage);
- n.validator.addClassRules({
- customSizeText: {
- digits: !0,
- range: [180, 1024]
- },
- customColorText: {
- customColorCheck: !0
- }
- })
- }
- function u() {
- var t, u, f;
- n("#image-form").valid() && (t = et(), u = n("#markupbox"), u.val() != t && (u.val(t), n("#widgetCopyCode").attr("data-clipboard-text", t), f = ot(), n("#sample-frame").css("width", r[i.width]).css("height", r[i.height]).attr("src", f)))
- }
- function et() {
- var t = l(r),
- u, f;
- return t[i.query] = encodeURIComponent(t[i.query]), u = b(t, '{0}="{1}"', " ", !1), f = n.validator.format('<div class="bingwidget" data-type="images" {0}><\/div><script type="text/javascript" src="//www.bing.com/widget/bootstrap.js" async><\/script>', u), f
- }
- function ot() {
- var i = t.previewUrl.indexOf("?") >= 0 ? "{0}&{1}" : "{0}?{1}",
- u = b(l(r), "{0}={1}", "&", !0);
- return n.validator.format(i, t.previewUrl, u)
- }
- function l(t) {
- var r = n.extend({}, t);
- return n("#countDropdown").css("display") == "none" && (r[i.imageCount] = ""), r
- }
- function b(t, i, r, u) {
- if (t == null) return "";
- var f = "";
- return n.each(t, function(t, e) {
- e != null && e != "" && (f += n.validator.format(i, t, u ? encodeURIComponent(e) : e), f += r)
- }), f.indexOf(r, f.length - r.length) != -1 && (f = f.substring(0, f.length - r.length)), f
- }
- function h(n) {
- o && clearTimeout(o);
- o = setTimeout(function() {
- o = null;
- n()
- }, 1e3)
- }
- function st() {
- r[i.query] = n("#queryInput").val();
- r[i.layout] = n("input[name=layout-radio]:checked").val();
- r[i.imageCount] = n("#countDropdown option:selected").val();
- r[i.height] = n("#sizeDropdown option:selected").attr("data-height") + "px";
- r[i.width] = n("#sizeDropdown option:selected").attr("data-width") + "px";
- r[i.background] = n("#backgroundDropdown option:selected").val();
- r[i.market] = n("#mktDropdown option:selected").val();
- r[i.safeSearch] = n("input[name=safeSearch-radio]:checked").val();
- r[i.version] = ut;
- r[i.style] = e()
- }
- function ht() {
- n("#queryInput").keyup(ct).change(a).focusout(a)
- }
- function ct() {
- h(a)
- }
- function a() {
- var t = n.trim(n("#queryInput").val());
- r[i.query] = t;
- u()
- }
- function lt() {
- n("input[name=layout-radio]").click(at)
- }
- function at() {
- var f = n("input[name=layout-radio]:checked").val(),
- t;
- r[i.layout] = f;
- t = n("#countDropdown");
- f == t.attr("data-layout") ? (n("#countLabelSpan").removeClass("none"), t.removeClass("none")) : (n("#countLabelSpan").addClass("none"), t.addClass("none"));
- u()
- }
- function vt() {
- n("#countDropdown").change(yt)
- }
- function yt() {
- var t = n("#countDropdown option:selected").val();
- r[i.imageCount] = t;
- u()
- }
- function pt() {
- n("#sizeDropdown").change(wt)
- }
- function wt() {
- var t = n("#sizeDropdown option:selected"),
- f = n("#customSize");
- t.val() == f.attr("data-size") ? (f.removeClass("none"), t.attr("data-height", n("#heightInput").val()).attr("data-width", n("#widthInput").val())) : (f.addClass("none"), n("#heightInput").val(t.attr("data-height")), n("#widthInput").val(t.attr("data-width")));
- r[i.height] = t.attr("data-height") + "px";
- r[i.width] = t.attr("data-width") + "px";
- u()
- }
- function bt() {
- var t = n("#sizeDropdown option:selected");
- n("#widthInput").val(t.attr("data-width")).keyup(k).change(f).focusout(f);
- n("#heightInput").val(t.attr("data-height")).keyup(k).change(f).focusout(f)
- }
- function k() {
- h(f)
- }
- function f() {
- var t = n.trim(n("#widthInput").val()) + "px",
- f = n.trim(n("#heightInput").val()) + "px";
- r[i.height] = f;
- r[i.width] = t;
- u()
- }
- function kt() {
- n("#backgroundDropdown").change(dt)
- }
- function dt() {
- var f = n("#backgroundDropdown option:selected"),
- t = n("#customBackground");
- f.val() == t.attr("data-background") ? (t.removeClass("none"), r[i.background] = n("#backgroundInput").val()) : (t.addClass("none"), r[i.background] = f.val());
- u()
- }
- function gt() {
- n("#backgroundInput").val(s).keyup(ni);
- n("#backgroundIndicator").css("background-color", s)
- }
- function ni() {
- h(ti)
- }
- function ti() {
- var n = function(n) {
- r[i.background] = n;
- u()
- };
- tt("#backgroundInput", "#backgroundIndicator", "#backgroundColorPicker", n)
- }
- function ii() {
- it("#backgroundInput", "#backgroundIndicator", "#backgroundColorPicker");
- v("#backgroundRedSlider", "#backgroundRedMin", "#backgroundRedMax", 0, 255, 0);
- v("#backgroundGreenSlider", "#backgroundGreenMin", "#backgroundGreenMax", 0, 255, 0);
- v("#backgroundBlueSlider", "#backgroundBlueMin", "#backgroundBlueMax", 0, 255, 0)
- }
- function c(t, i) {
- var c = n(t).is(":visible"),
- h, r;
- if (c) {
- var u = n(i).css("background-color"),
- f = 0,
- e = 0,
- o = 0,
- s = p.exec(u);
- s !== null ? (f = parseInt(s[1]), e = parseInt(s[2]), o = parseInt(s[3])) : (h = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, u = u.replace(h, function(n, t, i, r) {
- return t + t + i + i + r + r
- }), r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(u), r && (f = parseInt(r[1], 16), e = parseInt(r[2], 16), o = parseInt(r[3], 16)));
- n(t).find(".redValue").text(f);
- n(t).find(".greenValue").text(e);
- n(t).find(".blueValue").text(o);
- n(t).find(".redSlider").slider("value", f);
- n(t).find(".greenSlider").slider("value", e);
- n(t).find(".blueSlider").slider("value", o)
- }
- }
- function v(n, t, f, e, o, s) {
- var h = function() {
- var n = g("#backgroundColorPicker", "#backgroundInput", "#backgroundIndicator");
- r[i.background] = n;
- u()
- };
- d(n, t, f, e, o, s, h)
- }
- function d(t, i, r, u, f, e, o) {
- n(i).text(u);
- n(r).text(f);
- n(t).slider({
- orientation: "horizontal",
- animate: !1,
- range: "min",
- min: u,
- max: f,
- value: e,
- stop: o
- })
- }
- function g(t, i, r) {
- var o = n(t).find(".redSlider").slider("value"),
- f, e, u;
- return n(t).find(".redValue").text(o), f = n(t).find(".greenSlider").slider("value"), n(t).find(".greenValue").text(f), e = n(t).find(".blueSlider").slider("value"), n(t).find(".blueValue").text(e), u = nt(o, f, e), n(i).val(u), n(r).css("background-color", u), u
- }
- function nt(n, t, i) {
- return "#" + (16777216 + (n << 16) + (t << 8) + i).toString(16).slice(1)
- }
- function ri() {
- n("#borderDropdown").change(ui)
- }
- function ui() {
- var f = n("#borderDropdown option:selected"),
- t = n("#borderColor");
- f.val() != t.attr("data-border") ? t.removeClass("none") : t.addClass("none");
- r[i.style] = e();
- u()
- }
- function fi() {
- n("#borderColorInput").val(s).keyup(ei);
- n("#borderColorIndicator").css("background-color", s)
- }
- function ei() {
- h(oi)
- }
- function oi() {
- var n = function() {
- r[i.style] = e();
- u()
- };
- tt("#borderColorInput", "#borderColorIndicator", "#borderColorPicker", n)
- }
- function tt(t, i, r, u) {
- var e = n(t),
- f = n.trim(e.val());
- f.indexOf("#") != 0 && (f = "#" + f, e.val(f));
- u(f);
- n(i).css("background-color", f);
- c(r, i)
- }
- function it(t, i, r) {
- n(t).focus(function() {
- n(r).show();
- c(r, i)
- });
- n(r).click(function(n) {
- n.stopPropagation()
- });
- n(document).click(function(u) {
- var f = n(u.target);
- f.is(i) || f.is(t) || n(r).hide()
- })
- }
- function si() {
- it("#borderColorInput", "#borderColorIndicator", "#borderColorPicker");
- y("#borderRedSlider", "#borderRedMin", "#borderRedMax", 0, 255, 0);
- y("#borderGreenSlider", "#borderGreenMin", "#borderGreenMax", 0, 255, 0);
- y("#borderBlueSlider", "#borderBlueMin", "#borderBlueMax", 0, 255, 0)
- }
- function y(n, t, f, o, s, h) {
- var c = function() {
- g("#borderColorPicker", "#borderColorInput", "#borderColorIndicator");
- r[i.style] = e();
- u()
- };
- d(n, t, f, o, s, h, c)
- }
- function hi() {
- n("#paddingDropdown").change(ci)
- }
- function ci() {
- r[i.style] = e();
- u()
- }
- function e() {
- var t = [],
- i = n("#paddingDropdown option:selected").val(),
- r, u;
- return i != "none" && (t.push("padding-left:"), t.push(i), t.push("px;"), t.push("padding-right:"), t.push(i), t.push("px;"), t.push("padding-top:"), t.push(i), t.push("px;"), t.push("padding-bottom:"), t.push(i - 9), t.push("px;")), r = n("#borderDropdown option:selected").val(), t.push("border:"), t.push(r), r != "none" && (t.push(" solid "), u = n("#borderColorInput").val(), t.push(u)), t.push(";"), t.join("")
- }
- function li() {
- n("#mktDropdown").change(ai)
- }
- function ai() {
- r[i.market] = n("#mktDropdown option:selected").val();
- u()
- }
- function vi() {
- n("#languageDropdown").change(yi)
- }
- function yi() {
- r[i.language] = n("#languageDropdown option:selected").val();
- u()
- }
- function pi() {
- n("input[name=safeSearch-radio]").click(wi)
- }
- function wi() {
- r[i.safeSearch] = n("input[name=safeSearch-radio]:checked").val();
- u()
- }
- function bi() {
- var n = l(r);
- n[i.query] = encodeURIComponent(n[i.query]);
- window.top.postMessage(w + ":" + JSON.stringify(n), "*")
- }
- function ki(n) {
- var t = di(n, w),
- i;
- if (t) try {
- i = JSON.parse(t);
- gi(i)
- } catch (r) {
- return
- }
- }
- function di(n, t) {
- var i = n.originalEvent.data,
- r = i.indexOf(":"),
- f, u;
- return r == -1 ? null : (f = i.substring(0, r), f != t) ? null : (u = i.substring(r + 1), !u) ? null : u
- }
- function gi(n) {
- var t = decodeURIComponent(n[i.query]);
- r[i.query] = t == null ? r[i.query] : t;
- r[i.layout] = n[i.layout] == null ? r[i.layout] : n[i.layout];
- r[i.imageCount] = n[i.imageCount] == null ? r[i.imageCount] : n[i.imageCount];
- r[i.height] = n[i.height] == null ? r[i.height] : n[i.height];
- r[i.width] = n[i.width] == null ? r[i.width] : n[i.width];
- r[i.background] = n[i.background] == null ? r[i.background] : n[i.background];
- r[i.market] = n[i.market] == null ? r[i.market] : n[i.market];
- r[i.language] = n[i.language] == null ? r[i.language] : n[i.language];
- r[i.safeSearch] = n[i.safeSearch] == null ? r[i.safeSearch] : n[i.safeSearch];
- r[i.style] = n[i.style] == null ? r[i.style] : n[i.style];
- nr();
- u()
- }
- function nr() {
- var l, o, v, t, f, e, s, u, it;
- n("#queryInput").val(r[i.query]);
- l = r[i.layout];
- l == "collage" ? (n("#layoutCollage").prop("checked", !0), n("#countLabelSpan").addClass("none"), n("#countDropdown").addClass("none")) : l == "slideshow" && (n("#layoutSlideshow").prop("checked", !0), n("#countLabelSpan").removeClass("none"), n("#countDropdown").removeClass("none"), n("#countDropdown").val(r[i.imageCount]));
- o = [];
- n("#sizeDropdown option").each(function() {
- o.push(n(this).attr("value"))
- });
- var y = r[i.height].replace("px", ""),
- w = r[i.width].replace("px", ""),
- rt = w + " x " + y,
- b = n("#sizeDropdown"),
- a = n("#customSize"),
- k = n.inArray(rt, o);
- if (k != -1 ? (a.addClass("none"), b.val(o[k])) : (a.removeClass("none"), n("#heightInput").val(y), n("#widthInput").val(w), b.val(a.attr("data-size"))), v = n("#backgroundDropdown"), t = r[i.background], t == "match" || t == "#ffffff" || t == "#000000" ? (n("#customBackground").addClass("none"), v.val(t)) : (n("#customBackground").removeClass("none"), v.val("custom"), n("#backgroundInput").val(t), n("#backgroundIndicator").css("background-color", t), c("#backgroundColorPicker", "#backgroundIndicator")), f = n("<div/>"), f.attr("style", r[i.style]), e = f.css("padding-left"), e != "" && (e = e.replace("px", ""), n("#paddingDropdown").val(e)), s = f.css("border-left-width"), s != "0px" && s != "initial" && (n("#borderDropdown").val(s), u = f.css("border-left-color"), u != "initial")) {
- if (n("#borderColor").removeClass("none"), u.indexOf("#") != 0) {
- var d = 0,
- g = 0,
- tt = 0,
- h = p.exec(u);
- h !== null && (d = parseInt(h[1]), g = parseInt(h[2]), tt = parseInt(h[3]));
- u = nt(d, g, tt)
- }
- n("#borderColorInput").val(u);
- n("#borderColorIndicator").css("background-color", u);
- c("#borderColorPicker", "#borderColorIndicator")
- }
- n("#mktDropdown").val(r[i.market]);
- n("#languageDropdown").val(r[i.language]);
- it = r[i.safeSearch];
- n("input[name='safeSearch-radio'][value='" + it + "']").prop("checked", !0)
- }
- function tr() {
- if (ft(), rt = n("#image-form").validate(formValidateOptions), st(), t.isPluginPreview) {
- n(window).on("message", ki);
- n("#widgetSaveImagePlugin").on("click", bi)
- } else n("#widgetCopyCode").initCopyCodeButton(), n("#markupbox").focus(selectAllTextAreaContent);
- ht();
- lt();
- vt();
- pt();
- bt();
- kt();
- gt();
- ri();
- fi();
- hi();
- li();
- vi();
- pi();
- ii();
- si();
- u()
- }
- var rt = null,
- r = {},
- o = null,
- i = t.widgetAttributes,
- ut = t.version,
- s = "#cccccc",
- p = /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/,
- w = "Microsoft.Bing.ImageWidget.wpPlugin.ValidationString";
- tr()
- }
- }(jQuery),
- function(n) {
- n.fn.initCopyCodeButton = function() {
- ZeroClipboard.setDefaults({
- moviePath: "/webmaster/content/images/zeroclipboard.swf"
- });
- var t = n(this),
- i = new ZeroClipboard(t);
- i.on("mouseover", function() {
- t.addClass("button-hover")
- });
- i.on("mouseout", function() {
- t.removeClass("button-hover")
- });
- i.on("mousedown", function() {
- t.addClass("button-active")
- });
- i.on("mouseup", function() {
- t.removeClass("button-active")
- });
- n(this).click(function() {
- if (window.clipboardData) {
- var t = n(this).attr("data-clipboard-text");
- window.clipboardData.setData("Text", t)
- }
- })
- };
- n.fn.knowledgeWidget = function(t) {
- function e(i) {
- var r, u;
- (i = typeof i != "undefined" ? i : !1, ot(), n("#knowledge-form").valid()) && (t.isPreview && t.previewUrl == "" || ((!it || t.isPublic) && (r = ai(), n("#markupbox").val(r), n("#widgetCopyCode").attr("data-clipboard-text", r), it = !0), vi(), u = s, setTimeout(function() {
- u == s && (i == !0 && (s = st(s), t.previewUrl = s), n("#sample-pageframe").attr("src", s))
- }, 100)))
- }
- function ot() {
- t.isPublic || (ct() ? n("#widgetSaveSettings, #widgetResetSettings").removeAttr("disabled") : n("#widgetSaveSettings, #widgetResetSettings").attr("disabled", "disabled"))
- }
- function ai() {
- var u = "",
- f;
- return t.isPublic ? (f = c(k(), "{0}={1}", ",", !1), r[i.dataOptions] = f, u = c(d(), "{0}='{1}'", " ", !1)) : u = n.validator.format("{0}='{1}' {2}='{3}' {4}='{5}'", i.id, r[i.id], i.version, r[i.version], i.autoSnapshot, r[i.autoSnapshot]), n.validator.format("<script type='text/javascript' src='//www.bing.com/widget/bootstrap.js' {0} async><\/script>", u)
- }
- function vi() {
- var u, e, f, o;
- t.isPreview ? (t.previewUrl = st(t.previewUrl), u = t.previewUrl.indexOf("#") >= 0 ? "{0}&{1}" : "{0}#{1}") : u = t.previewUrl.indexOf("?") >= 0 ? "{0}&{1}" : "{0}?{1}";
- e = c(k(), "{0}={1}", ",", !1);
- r[i.dataOptions] = e;
- f = d();
- f[i.id] = t.previewId;
- o = c(f, "{0}={1}", "&", !0);
- s = n.validator.format(u, t.previewUrl, o)
- }
- function st(n) {
- var u = "toggle=",
- t, f, i, r;
- return n.indexOf(u) != -1 ? (t = n.indexOf(u) + u.length, f = n[t] == "1" ? "0" : "1", n = n.substring(0, t) + f + n.substring(t + 1)) : (i = n.indexOf("?"), r = n.indexOf("#"), n = i >= 0 ? n.substring(0, i + 1) + "toggle=1&" + n.substring(i + 1) : r >= 0 ? n.substring(0, r) + "?toggle=1" + n.substring(r) : n + "?toggle=1"), n
- }
- function k() {
- var t = n.extend({}, f),
- u = r[i.visualization];
- switch (u) {
- case o[p]:
- t[i.options.underlineDecoration] = null;
- break;
- case o[w]:
- t[i.options.shadowEnabled] = null;
- break;
- case o[b]:
- t[i.options.underlineDecoration] = null;
- t[i.options.shadowEnabled] = null
- }
- return t
- }
- function d() {
- var t = n.extend({}, r),
- u = r[i.visualization];
- switch (u) {
- case o[p]:
- t[i.linkStyle] = null;
- t[i.maxLinks] = null;
- t[i.maxEntityLinks] = null;
- t[i.maxParagraphLinks] = null;
- break;
- case o[w]:
- t[i.carouselState] = null;
- break;
- case o[b]:
- t[i.linkStyle] = null;
- t[i.maxLinks] = null;
- t[i.maxEntityLinks] = null;
- t[i.maxParagraphLinks] = null;
- t[i.carouselState] = null
- }
- return t
- }
- function c(t, i, r, u) {
- if (t == null) return "";
- var f = "";
- return n.each(t, function(t, e) {
- e != null && e != "" && (f += n.validator.format(i, t, u ? escape(e) : e), f += r)
- }), f.indexOf(r, f.length - r.length) != -1 && (f = f.substring(0, f.length - r.length)), f
- }
- function yi() {
- if (s != null && s != "") {
- var n = window.open(s, "_blank");
- n.focus()
- }
- }
- function pi() {
- n.validator.addMethod("valueNoSpace", function(n) {
- return n.match(/\s/g) == null
- }, "The css class name cannot not contain spaces");
- n.validator.addClassRules({
- noSpaceCheck: {
- valueNoSpace: !0
- },
- minResolutionCheck: {
- digits: !0,
- range: [100, 1024]
- }
- })
- }
- function ht() {
- r[i.visualization] = o[u.visualization];
- r[i.linkStyle] = u.linkStyle;
- r[i.carouselState] = et[u.carouselState];
- r[i.strength] = v[u.strength];
- r[i.maxLinks] = u.maxLinks;
- r[i.maxEntityLinks] = u.maxEntityLinks;
- r[i.maxParagraphLinks] = u.maxParagraphLinks;
- r[i.extractionIgnoreClass] = u.extractionIgnoreClass;
- r[i.ignoreClass] = u.ignoreClass;
- f[i.options.underlineDecoration] = u.optionUnderlineDecoration;
- f[i.options.shadowEnabled] = u.optionShadowEnabled ? 1 : 0
- }
- function ct() {
- var t = n("#inputWidgetName").val() != u.widgetName;
- return t = t || r[i.visualization] != o[u.visualization], t = t || r[i.linkStyle] != u.linkStyle, t = t || r[i.carouselState] != et[u.carouselState], t = t || r[i.strength] != v[u.strength], t = t || r[i.maxLinks] != u.maxLinks, t = t || r[i.maxEntityLinks] != u.maxEntityLinks, t = t || r[i.maxParagraphLinks] != u.maxParagraphLinks, t = t || r[i.extractionIgnoreClass] != u.extractionIgnoreClass, t = t || r[i.ignoreClass] != u.ignoreClass, t = t || f[i.options.underlineDecoration] != u.optionUnderlineDecoration, t || f[i.options.shadowEnabled] != (u.optionShadowEnabled ? 1 : 0)
- }
- function lt() {
- var i = !0;
- t.isPreview || (n("#inputWidgetName").val(u.widgetName), i = !1);
- ht();
- g();
- e(i)
- }
- function g() {
- var t;
- n("#presenceOption input[data-presence-option=" + r[i.visualization] + "]").click();
- t = f[i.options.underlineDecoration];
- t ? n("#styleOption input[data-style-option=" + t + "]").click() : n("#styleOption input[data-style-option=custom]").click();
- var u = jQuery.inArray(r[i.strength], v),
- e = r[i.maxLinks],
- o = r[i.maxEntityLinks],
- s = r[i.maxParagraphLinks];
- n("#widgetStrengthSlider").slider("value", u);
- n("#widgetMaxLinksSlider").slider("value", e);
- n("#widgetMaxEntityLinksSlider").slider("value", o);
- n("#widgetMaxParagraphLinksSlider").slider("value", s);
- n("#carouselOption input[data-initial-state=" + r[i.carouselState] + "]").attr("checked", "checked");
- f[i.options.shadowEnabled] == 1 ? n("#carouselOption input#carouselBorder").attr("checked", "checked") : n("#carouselOption input#carouselBorder").removeAttr("checked");
- n("#optionClassToIgnore").val(r[i.extractionIgnoreClass]);
- n("#optionClassNotToMarkup").val(r[i.ignoreClass])
- }
- function wi() {
- r[i.version] = t.version;
- r[i.autoSnapshot] = t.autoSnapshot.toLowerCase();
- r[i.id] = u.id
- }
- function bi() {
- n("#presenceOption input").on("click", rr)
- }
- function ki() {
- n("#styleOption input[type=radio]").on("click", ur);
- n("#optionCustomStyle").on("focusout", at);
- n("#optionCustomStyle").keyup(fr)
- }
- function di() {
- n("#widgetStrengthSlider").slider({
- orientation: "horizontal",
- animate: !0,
- range: "min",
- min: gt,
- max: ni,
- value: u.strengh,
- stop: vt,
- change: vt
- });
- nt("#widgetMaxLinksSlider", "#widgetMaxLinksMin", "#widgetMaxLinksMax", ti, ii, r[i.maxLinks]);
- nt("#widgetMaxEntityLinksSlider", "#widgetMaxEntityLinksMin", "#widgetMaxEntityLinksMax", ui, fi, r[i.maxEntityLinks]);
- nt("#widgetMaxParagraphLinksSlider", "#widgetMaxParagraphLinksMin", "#widgetMaxParagraphLinksMax", oi, si, r[i.maxParagraphLinks])
- }
- function nt(t, i, r, u, f, e) {
- n(i).text(u);
- n(r).text(f);
- n(t).slider({
- orientation: "horizontal",
- animate: !0,
- range: "min",
- min: u,
- max: f,
- value: e,
- stop: yt,
- change: yt
- })
- }
- function gi() {
- n("#carouselOption input[type=radio]").on("click", er);
- n("#carouselOption input#carouselBorder").on("click", or)
- }
- function nr() {
- n("#optionClassToIgnore").on("focusout", pt);
- n("#optionClassNotToMarkup").on("focusout", wt);
- n("#optionClassToIgnore").keyup(sr);
- n("#optionClassNotToMarkup").keyup(hr)
- }
- function tr() {
- l();
- n("#widget-option-left").addClass("left-most");
- n("#widget-option-right").click(cr);
- n("#widget-option-left").click(lr);
- n("#widget-option-frame").on("scroll", kt)
- }
- function ir() {
- n(".widget-page-preview-tab").click(vr);
- n(".widget-page-preview-tab").filter(":first-child").click()
- }
- function rr() {
- var f, u;
- n("#presenceOption input[type=button]").removeClass("current");
- n("#presenceOption input[type=button]").val(t.PresenceOffButton);
- n(this).addClass("current");
- n(this).val(t.PresenceOnButton);
- f = n(this).attr("data-presence-option");
- r[i.visualization] = f;
- u = 300;
- switch (f) {
- case o[p]:
- n("#styleOption, #widgetLinkingStrengthContainer").hide(u, "swing", function() {
- n("#carouselOption").show(u, "swing", l)
- });
- break;
- case o[li]:
- n("#carouselOption, #styleOption, #widgetLinkingStrengthContainer").show(u, "swing", l);
- break;
- case o[w]:
- n("#carouselOption").hide(u, "swing", function() {
- n("#styleOption, #widgetLinkingStrengthContainer").show(u, "swing", l)
- });
- break;
- case o[b]:
- n("#carouselOption, #styleOption, #widgetLinkingStrengthContainer").hide(u, "swing", l)
- }
- e()
- }
- function ur() {
- var t = n(this).attr("data-style-option");
- t == "custom" ? (f[i.options.underlineDecoration] = "", n("#optionCustomStyle").show().val(r[i.linkStyle]).addClass("wmRequired").focus()) : (n("#optionCustomStyle").val("").hide().removeClass("wmRequired"), f[i.options.underlineDecoration] = t, r[i.linkStyle] = "");
- e()
- }
- function fr() {
- tt(at)
- }
- function tt(n) {
- a && clearTimeout(a);
- a = setTimeout(function() {
- a = null;
- n()
- }, 1e3)
- }
- function at() {
- var t = n("#optionCustomStyle").val();
- r[i.linkStyle] = t;
- e()
- }
- function er() {
- var t = n(this).attr("data-initial-state");
- r[i.carouselState] = t;
- e()
- }
- function or() {
- var t = n(this).is(":checked") ? "1" : "0";
- f[i.options.shadowEnabled] = t;
- e()
- }
- function vt() {
- var t = n("#widgetStrengthSlider").slider("value");
- n("#widgetMaxLinksSlider").slider("value", ri[t]);
- n("#widgetMaxEntityLinksSlider").slider("value", ei[t]);
- n("#widgetMaxParagraphLinksSlider").slider("value", hi[t]);
- r[i.strength] = v[t];
- n("#widgetStrengthValue").text(ci[t]);
- e()
- }
- function yt() {
- var t = n(this).slider("value"),
- u = n(this).attr("data-setting"),
- i;
- r[u] = t;
- i = n(this).attr("data-value-id");
- n("#" + i).text(t);
- e()
- }
- function sr() {
- tt(pt)
- }
- function pt() {
- var t = n("#optionClassToIgnore").val();
- r[i.extractionIgnoreClass] = t;
- e()
- }
- function hr() {
- tt(wt)
- }
- function wt() {
- var t = n("#optionClassNotToMarkup").val();
- r[i.ignoreClass] = t;
- e()
- }
- function cr() {
- var t = n("#widget-option-frame").scrollLeft(),
- i = bt(t, !1);
- n("#widget-option-frame").animate({
- scrollLeft: i
- }, ft)
- }
- function lr() {
- var t = n("#widget-option-frame").scrollLeft(),
- i = bt(t, !0);
- n("#widget-option-frame").animate({
- scrollLeft: i
- }, ft)
- }
- function bt(n, t) {
- var r = n,
- i;
- if (t) {
- for (i = h.length - 1; i >= 0; i--)
- if (h[i] < n) {
- r = h[i];
- break
- }
- } else
- for (i = 0; i < h.length; i++)
- if (h[i] > n) {
- r = h[i];
- break
- } return r
- }
- function kt() {
- var t = n("#widget-option-frame").scrollLeft();
- t < y - ut ? n("#widget-option-right").removeClass("right-most") : n("#widget-option-right").addClass("right-most");
- t > 0 ? n("#widget-option-left").removeClass("left-most") : n("#widget-option-left").addClass("left-most")
- }
- function ar() {
- var t = 0;
- n("#widget-options-carousel > div.widget-option-group").each(function() {
- h[t++] = n(this).position().left
- });
- h.sort(function(n, t) {
- return n - t
- })
- }
- function l() {
- n("#widget-options-carousel").width(1e4);
- var t = n("#widget-options-carousel > div.widget-last-option-group"),
- i = n("#widget-options-carousel > div.widget-option-group:first-child"),
- r = parseInt(t.css("padding-left").replace("px", "")) + parseInt(t.css("padding-right").replace("px", ""));
- y = t.offset().left + t.width() + r - i.offset().left;
- ut = n("#widget-option-frame").width();
- n("#widget-options-carousel").width(y);
- kt();
- ar()
- }
- function vr() {
- n(".widget-page-preview-tab-active").removeClass("widget-page-preview-tab-active");
- n(this).addClass("widget-page-preview-tab-active");
- var i = n(this).attr("data-url");
- t.previewUrl != i && (t.previewUrl = i, e())
- }
- function yr() {
- if (n("#knowledge-form").valid()) {
- var i = br();
- kr(t.saveUrl, i, pr);
- n("#settingsOverlay").show(300);
- n("#inputWidgetName").attr("disabled", "disabled")
- }
- }
- function pr(t) {
- u.widgetName = n("#inputWidgetName").val();
- u.visualization = t.Visualization;
- u.linkStyle = t.LinkStyle;
- u.carouselState = t.InitialCarouselState;
- u.strength = t.DetectionStrength;
- u.maxLinks = t.MaxLinks;
- u.maxEntityLinks = t.MaxEntityLinks;
- u.maxParagraphLinks = t.MaxParagraphLinks;
- u.extractionIgnoreClass = t.ExtractionIgnoreClass;
- u.ignoreClass = t.IgnoreClass;
- u.optionUnderlineDecoration = t.UnderlineDecoration;
- u.optionShadowEnabled = t.CarouselShadowEnabled;
- ct() || (n("#inputWidgetName").removeAttr("disabled"), n("#widgetSaveSettings, #widgetResetSettings").attr("disabled", "disabled"), n("#settingsOverlay").hide(300));
- n("#saveWidgetName").text(u.widgetName)
- }
- function br() {
- var t = {
- Id: u.id,
- Visualization: r[i.visualization],
- LinkStyle: r[i.linkStyle],
- InitialCarouselState: r[i.carouselState],
- DetectionStrength: r[i.strength],
- MaxLinks: r[i.maxLinks],
- MaxEntityLinks: r[i.maxEntityLinks],
- MaxParagraphLinks: r[i.maxParagraphLinks],
- ExtractionIgnoreClass: r[i.extractionIgnoreClass],
- IgnoreClass: r[i.ignoreClass],
- UnderlineDecoration: f[i.options.underlineDecoration],
- CarouselShadowEnabled: f[i.options.shadowEnabled] == 1
- };
- return {
- widgetName: n("#inputWidgetName").val(),
- newSettings: JSON.stringify(t)
- }
- }
- function kr(n, t, i, r) {
- startPostRequestWithJson(t, n, i, r, "#knowledge-form")
- }
- function dr() {
- var n = c(k(), "{0}={1}", ",", !1);
- r[i.dataOptions] = n;
- window.top.postMessage(rt + ":" + JSON.stringify(d()), "*")
- }
- function gr(n) {
- var i = nu(n, rt),
- t;
- if (i !== null) try {
- t = JSON.parse(i);
- t !== null && typeof t == "object" && tu(t)
- } catch (r) {
- return
- }
- }
- function nu(i, r) {
- var u = i.originalEvent.data,
- f = u.indexOf(":"),
- s, e, o, h;
- return f == -1 ? null : (s = u.substring(0, f), s != r) ? null : (e = u.substring(f + 1), !e) ? null : (o = n("<a href='" + t.previewUrl + "'><\/a>"), h = o.prop("protocol") + "//" + o.prop("host"), i.originalEvent.origin != h) ? null : e
- }
- function tu(n) {
- var u, o, t;
- if (r[i.visualization] = n[i.visualization] == null ? r[i.visualization] : n[i.visualization], r[i.linkStyle] = n[i.linkStyle] == null ? r[i.linkStyle] : n[i.linkStyle], r[i.carouselState] = n[i.carouselState] == null ? r[i.carouselState] : n[i.carouselState], r[i.strength] = n[i.strength] == null ? r[i.strength] : n[i.strength], r[i.maxLinks] = n[i.maxLinks] == null ? r[i.maxLinks] : n[i.maxLinks].toString(), r[i.maxEntityLinks] = n[i.maxEntityLinks] == null ? r[i.maxEntityLinks] : n[i.maxEntityLinks].toString(), r[i.maxParagraphLinks] = n[i.maxParagraphLinks] == null ? r[i.maxParagraphLinks] : n[i.maxParagraphLinks].toString(), r[i.extractionIgnoreClass] = n[i.extractionIgnoreClass] == null ? r[i.extractionIgnoreClass] : n[i.extractionIgnoreClass], r[i.ignoreClass] = n[i.ignoreClass] == null ? r[i.ignoreClass] : n[i.ignoreClass], n["data-options"]) {
- u = n["data-options"].split(",");
- for (o in u) t = u[o].split("="), t[0] == "cse" ? f[i.options.shadowEnabled] = t[1] : t[0] == "dc" && (f[i.options.underlineDecoration] = t[1])
- }
- g();
- e()
- }
- function iu() {
- dt = n("#knowledge-form").validate(formValidateOptions);
- pi();
- n("#fullPreview").on("click", yi);
- if (ir(), ht(), t.isPreview) {
- n(window).on("message", gr);
- n("#widgetResetPluginSettings").on("click", lt);
- n("#widgetSavePluginSettings").on("click", dr)
- } else n("#widgetCopyCode").initCopyCodeButton(), n("#markupbox").focus(selectAllTextAreaContent);
- wi();
- ki();
- di();
- gi();
- nr();
- bi();
- g();
- tr();
- e();
- t.isPublic || (n("#inputWidgetName").change(ot), n("#widgetResetSettings").click(lt), n("#widgetSaveSettings").click(yr))
- }
- var dt = null,
- s = "",
- it = !1,
- a = null,
- rt = "Microsoft.Bing.KnowledgeWidget.wpPlugin.ValidationString",
- y = 0,
- ut = 0,
- ft = 400,
- gt = 0,
- ni = 2,
- h = [],
- ti = 3,
- ii = 100,
- ri = [7, 12, 100],
- ui = 1,
- fi = 10,
- ei = [3, 4, 10],
- oi = 1,
- si = 20,
- hi = [3, 5, 20],
- ci = [wr.Widget_Strength_Conservative, wr.Widget_Strength_Moderate, wr.Widget_Strength_Aggressive],
- v = [t.detectionStrengthOptions.conservative, t.detectionStrengthOptions.moderate, t.detectionStrengthOptions.aggressive],
- et = [t.carouselStateOptions.collapsed, t.carouselStateOptions.expanded, t.carouselStateOptions.auto],
- o = [t.visualizationOptions.linksAndImages, t.visualizationOptions.images, t.visualizationOptions.links, t.visualizationOptions.interactiveonly],
- li = 0,
- p = 1,
- w = 2,
- b = 3,
- r = {},
- f = {},
- i = t.widgetAttributes,
- u = t.defaults;
- iu()
- }
- }(jQuery),
- function(n) {
- function i() {
- $(".resources-link").click(function(n) {
- $(n.target).next(".resources").slideToggle()
- });
- $(".resources .see-more").click(function(n) {
- $(n.target).next(".jqmWindow").jqm({
- overlay: 5,
- modal: !0
- }).jqmShow()
- })
- }
- function u(n) {
- t = n;
- $("#activityIndicator").remove();
- $("#url-input-button").click(r);
- clickButtonOnEnter("#url-input-button", "#url-input-field")
- }
- var t = "",
- r = function() {
- function n() {
- var n = this,
- r;
- (this.maxRetry = 80, this.submit = function() {
- $.ajax({
- url: t + window.location.search,
- type: "POST",
- dataType: "html",
- data: {
- url: n.urlToTest,
- retry: n.retry
- }
- }).success(function(t) {
- if (t.length === 0) {
- if (n.retry < n.maxRetry) {
- n.retry = n.retry + 1;
- setTimeout(n.submit, n.retry < 3 ? 5e3 : 1e3);
- return
- }
- t = $("#errorMsg").clone().show()
- }
- $("#loadingIndicator").hide();
- $("#test-results").html(t);
- $("#desc").clone().appendTo("#result-section").show();
- $("#url-input-button").prop("disabled", !1);
- initInfoHovers();
- i()
- }).error(function() {
- $("#loadingIndicator").hide();
- $("#url-input-button").prop("disabled", !1)
- })
- }, r = $("#url-input-field").val().trim(), $(".validationErrorPlaceholder").toggle(r === ""), r !== "") && ($("#test-results").empty(), $("#analyze-statement").hide(), $("#desc").hide(), $(this).prop("disabled", !0), $("#loadingIndicator").show(), this.urlToTest = r, this.retry = 0, this.submit())
- }
- return n
- }();
- n.initializeMobileFriendlinessHandlers = u
- }(MobileFriendliness || (MobileFriendliness = {})),
- function(n) {
- var i = function() {
- function i(r) {
- i.options = r;
- this.followupViewModel = new t(r.id, r.controller);
- i.documentUploadManager = new n.DocumentUploadManager(this.followupViewModel.documents, r.controller);
- n.SearchBlockShared.lsAvailable() && localStorage.setItem("sid", this.followupViewModel.sessionId)
- }
- return i.prototype.Run = function() {
- this.validatorSetup();
- ko.applyBindings(this.followupViewModel)
- }, i.prototype.validatorSetup = function() {
- var n = $.extend(!0, {}, formValidateOptions);
- n.onkeyup = !1;
- n.focusCleanup = !0;
- n.ignore = [];
- n.errorPlacement = function(n, t) {
- t.hasClass("no-label") || n.insertAfter(t)
- };
- $("#folloupForm").validate(n);
- $.validator.addClassRules({
- docCount: {
- min: function(n) {
- return parseInt($(n).val()) == 0
- }
- }
- })
- }, i
- }(),
- t;
- n.SearchBlockFollowup = i;
- t = function() {
- function t(n, t) {
- var r = this;
- this.removeDocument = function(n) {
- i.documentUploadManager.removeDocument(n, r.sessionId)
- };
- this.id = n;
- this.controller = t;
- this.sessionId = n.split("_")[1];
- this.documents = ko.observableArray();
- this.validDocuments = ko.computed(function() {
- return ko.utils.arrayFilter(r.documents(), function(n) {
- return n.success()
- }).length
- });
- this.comment = ko.observable()
- }
- return t.prototype.validateAndSubmit = function() {
- var t = this,
- i = $("#followupForm");
- if (!i.valid()) {
- $(".validationErrorPlaceholderBox").show();
- return
- }
- $.ajax({
- url: i.attr("action"),
- type: "POST",
- data: {
- __RequestVerificationToken: n.SearchBlockShared.getAntiForgeryToken(),
- data: ko.toJSON(this)
- },
- success: function() {
- var n = $.validator.format("{0}/tools/{1}/thankyou?id={2}", containerPrefix, t.controller, t.sessionId);
- window.location.replace(n)
- }
- })
- }, t.prototype.toJSON = function() {
- var n = ko.toJS(this);
- return delete n.validDocuments, delete n.sessionId, n
- }, t
- }();
- n.FollowupViewModel = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function n() {}
- return n.lsAvailable = function() {
- var n = "lstest";
- try {
- return localStorage.setItem(n, n), localStorage.removeItem(n), !0
- } catch (t) {
- return !1
- }
- }, n.getAntiForgeryToken = function() {
- return $("input[name=__RequestVerificationToken]").val()
- }, n.appendAntiForgeryToken = function(t) {
- return t.__RequestVerificationToken = n.getAntiForgeryToken(), t
- }, n
- }();
- n.SearchBlockShared = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function t() {
- var t = this;
- this.url = ko.observable();
- this.pageContentItems = ko.observableArray();
- this.pageContent = ko.computed(function() {
- return n.SearchBlockUser.bitwiseOr(t.pageContentItems)
- });
- this.contentRelatesDesc = ko.observable();
- this.pageContentDescription = ko.observable();
- this.otherReasonDesc = ko.observable();
- this.urlPreviouslySubmitted = ko.observable(!1)
- }
- return t.prototype.isInArray = function(n) {
- var t = this;
- return ko.computed(function() {
- return ko.utils.arrayFirst(t.pageContentItems(), function(t) {
- return t == n
- }) != null
- })
- }, t.prototype.toJSON = function() {
- var t = ko.toJS(this);
- return delete t.pageContentItems, n.SearchBlockUser.deleteUnsetProperties(t)
- }, t
- }();
- n.SearchBlockUrl = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- var t = function() {
- function t(t, i) {
- var r = this;
- this.addUrl = function() {
- r.urls.push(new n.SearchBlockUrl)
- };
- this.removeUrl = function(n) {
- r.urls.remove(n)
- };
- this.removeDocument = function(t) {
- n.EuSearchBlock.documentUploadManager.removeDocument(t, r.sessionId)
- };
- this.sessionId = t;
- this.controller = i;
- this.name = ko.observable();
- this.country = ko.observable();
- this.contactEmail = ko.observable();
- this.phoneOrFaxNumber = ko.observable();
- this.mailingAddress = ko.observable();
- this.documents = ko.observableArray();
- this.validDocuments = ko.computed(function() {
- return ko.utils.arrayFilter(r.documents(), function(n) {
- return n.success()
- }).length
- });
- this.isPublicFigure = ko.observable(!1);
- this.isCommunityInterestInfo = ko.observable(!1);
- this.societyCommunityDesc = ko.observable();
- this.urls = ko.observableArray([new n.SearchBlockUrl]);
- this.signature = ko.observable()
- }
- return t.bitwiseOr = function(n) {
- var t = 0;
- return $.each(n(), function(n, i) {
- t = t | parseInt(i)
- }), t
- }, t.prototype.animateRemoveUrlItem = function(n) {
- n.nodeType === 1 && $(n).animate({
- height: 0,
- opacity: 0
- }, 300, "swing", function() {
- $(n).remove()
- })
- }, t.prototype.validateAndSubmit = function() {
- var t = this,
- i = $("#linkRemovalForm");
- if (!i.valid()) {
- $(".validationErrorPlaceholderBox").show();
- $("html,body").animate({
- scrollTop: 0
- }, 300);
- return
- }
- $.ajax({
- url: i.attr("action"),
- type: "POST",
- data: {
- __RequestVerificationToken: n.SearchBlockShared.getAntiForgeryToken(),
- data: ko.toJSON(this)
- },
- success: function() {
- var n = $.validator.format("{0}/tools/{1}/thankyou?id={2}", containerPrefix, t.controller, t.sessionId);
- window.location.replace(n)
- }
- })
- }, t.prototype.toJSON = function() {
- var n = ko.toJS(this);
- return delete n.validDocuments, delete n.isPublicFigure, delete n.isCommunityInterestInfo, t.deleteUnsetProperties(n)
- }, t.deleteUnsetProperties = function(n) {
- var t, i;
- for (t in n) n.hasOwnProperty(t) && (i = n[t], (typeof i == "undefined" || i === null || i === "") && delete n[t]);
- return n
- }, t
- }();
- n.SearchBlockUser = t
- }(PublicTools || (PublicTools = {})),
- function(n) {
- n.fn.mstranslator = function(t) {
- function s() {
- n.get(t.markupUrl, function(n) {
- r = n;
- r != null && r.length > 0 && i()
- })
- }
- function i() {
- console.log("Outputting the markup in the text area and injecting it into the DOM 3");
- var i = n("#themeBox").find("input[name='theme']:checked").val(),
- u = n("#ctEnabledBox").find("input[name='ctEnabled']:checked").val(),
- e = n("#modeBox").find("input[name='mode']:checked").val(),
- o = b(),
- t = n.validator.format(r, i, u, e, o);
- a = t;
- setTimeout(function() {
- if (a == t) {
- n("#WidgetFloaterPanels").remove();
- n("#MicrosoftTranslatorWidget").remove();
- var i = t.indexOf("<script "),
- r = t.substring(0, i),
- u = t.substring(i),
- e = n(u);
- n("#markupbox").val(t);
- n("#preview").empty().html(r).append(e).parent().hide();
- f == -1 && (f = window.setInterval(function() {
- n("#WidgetLauncher").length >= 1 && (window.clearInterval(f), n("#previewContainer").show(), ht(), f = -1)
- }, 100))
- }
- }, 200)
- }
- function v(t) {
- n("#vtab2>ul>li").eq(t).click()
- }
- function d() {
- var i = n("#vtab2>ul>li"),
- r = t.isAuthenticated || t.code != null && t.code != "" ? 2 : 0;
- i.click(function() {
- i.removeClass("selected");
- n(this).addClass("selected");
- var t = i.index(n(this));
- n("#vtab2 >div").hide().eq(t).show()
- }).eq(r).click()
- }
- function h() {
- console.log("Clearing cookies");
- n.cookie("bwt_tw_tth", null, {
- path: "/"
- });
- n.cookie("bwt_tw_tmd", null, {
- path: "/"
- });
- n.cookie("bwt_tw_tct", null, {
- path: "/"
- });
- n.cookie("bwt_tw_tsl", null, {
- path: "/"
- });
- n.cookie("bwt_tw_tsu", null, {
- path: "/"
- });
- n.cookie("bwt_tw_tia", null, {
- path: "/"
- });
- n.cookie("bwt_tw_tctmk", null, {
- path: "/"
- })
- }
- function g() {
- console.log(t);
- h();
- var i = n("input[name='theme']:checked").val(),
- r = n("input[name='mode']:checked").val(),
- u = n("input[name='ctEnabled']:checked").val(),
- f = b(),
- e = n("#siteUrl").val(),
- o = t.isAuthenticated;
- console.log("Setting cookies");
- n.cookie("bwt_tw_tth", i, {
- path: "/"
- });
- n.cookie("bwt_tw_tmd", r, {
- path: "/"
- });
- n.cookie("bwt_tw_tct", u, {
- path: "/"
- });
- n.cookie("bwt_tw_tsl", f, {
- path: "/"
- });
- n.cookie("bwt_tw_tsu", e, {
- path: "/"
- });
- n.cookie("bwt_tw_tia", o, {
- path: "/"
- })
- }
- function nt() {
- console.log("Reading cookies");
- t.theme = n.cookie("bwt_tw_tth");
- t.mode = n.cookie("bwt_tw_tmd");
- t.ctEnabled = n.cookie("bwt_tw_tct");
- t.siteLanguage = n.cookie("bwt_tw_tsl");
- t.siteUrl = n.cookie("bwt_tw_tsu");
- t.isAuthenticated = n.cookie("bwt_tw_tia");
- console.log("Options after reading cookies %o", t)
- }
- function tt() {
- t.code != null && t.code != "" ? nt() : (console.log("URL contains no code query parameter. Calling clearing cookies"), h(), s())
- }
- function it() {
- if (t.theme && (n("input[name='theme'][value='" + t.theme + "']").prop("checked", !0), y()), t.mode) {
- var i = n("input[name='mode'][value='" + t.mode + "']");
- i.prop("checked", !0);
- p()
- }
- t.siteLanguage && t.siteLanguage != "" && n("#siteLanguage option[value='" + t.siteLanguage + "']").prop("selected", !0);
- t.ctEnabled && (n("input[name='ctEnabled'][value='" + t.ctEnabled + "']").prop("checked", !0), w());
- t.siteUrl && n("#siteUrl").val(t.siteUrl)
- }
- function c() {
- var f = 0,
- e;
- return n("#siteUrl").val() && n("#siteUrl").valid() ? (n("input[name='ctSteps'][value='1']").prop("checked", !0), f++) : (n("input[name='ctSteps'][value='1']").prop("checked", !1), f--), t.isAuthenticated && (n("input[name='ctSteps'][value='2']").prop("checked", !0), f++), t.code && f++, f == 3 ? (console.log("All Steps validated."), e = n.cookie("bwt_tw_tctmk"), e == null || e == "" ? (console.log("No existing ctf cookies found. Going ahead with the ctf markup request."), rt()) : (console.log("Ctf cookies found. markup was not fetched. We'll be loading the markup from cookie"), r = e, n(".ctfCodeGenerated").show(), u = !0, n("input[name='ctSteps'][value='3']").prop("checked", !0), i()), !0) : (n(".ctfCodeGenerated").hide(), u = !1, !1)
- }
- function rt() {
- n.get(t.ctfMarkupUrl, {
- code: t.code,
- siteUrl: n("#siteUrl").val()
- }, function(t) {
- console.log("CTF request result from the server %o", t);
- t != null && t.length > 0 ? (r = t, console.log("Setting tctmk cookie after getting the ctf markup"), n.cookie("bwt_tw_tctmk", r, {
- path: "/"
- }), n(".ctfCodeGenerated").show(), u = !0, n("input[name='ctSteps'][value='3']").prop("checked", !0), i(), n("#markupbox").css("overflow-y", "auto")) : (u = !1, n("input[name='ctSteps'][value='3']").prop("checked", !1), s())
- })
- }
- function y() {
- var t = n("input[name='theme']:checked").val() == "Dark";
- t ? n("#previewBackground").removeClass("dark-background") : n("#previewBackground").addClass("dark-background")
- }
- function p() {
- var t = n("input[name='mode']:checked").val() == "Manual";
- t && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.FloaterOnClose()
- }
- function w() {
- var t = n("input[name='ctEnabled']:checked").val() == "True";
- t ? (n(".ctf-steps").removeClass("disabled-section"), n("#siteUrl").prop("disabled", !1), c() || i()) : (n(".ctf-steps").addClass("disabled-section"), n("#siteUrl").prop("disabled", !0), n(".ctfCodeGenerated").hide(), u == !0 && (h(), s(), u = !1), n("input[name='ctSteps']").prop("checked", !1), l.resetForm(), i())
- }
- function ut() {
- n("body").attr("adjustalign", "false");
- n("#sb_foot").attr("translate", "no");
- n("#sw_hdr").attr("translate", "no");
- n("#sw_abar").attr("translate", "no");
- n("#fbpgbt").attr("translate", "no")
- }
- function ft() {
- n(".ctf-steps").hasClass("disabled-section") || n("#translatorForm").submit()
- }
- function et() {
- n(".ctf-steps").hasClass("disabled-section") || n("#siteUrl").valid() && t.isAuthenticated && (g(), console.log("Cookies Info saved {0} " + t.azureDmUrl), document.location.href = t.azureDmUrl)
- }
- function ot(n) {
- if (n.which == 13) {
- n.preventDefault();
- return
- }(n.type == "keypress" || u == !1) && c()
- }
- function b() {
- var i = n("#siteLanguage").val();
- return i == null && (t.siteLanguage == "" ? (i = o, e = o) : i = t.siteLanguage), i
- }
- function st() {
- n("#siteLanguage").append(n("<option />").val(o).text(t.autoDetectOption))
- }
- function k(r) {
- var f = n("#siteLanguage"),
- u;
- n.each(r, function(t, i) {
- f.append(n("<option />").val(i.Code).text(i.Name))
- });
- u = "";
- t.siteLanguage !== "" && (u = t.siteLanguage);
- n("#siteLanguage option[value='" + u + "']").prop("selected", !0);
- e != null && e != u && i()
- }
- function ht() {
- n("#siteLanguage option").length == 1 && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.Widget.GetLanguagesForTranslate(t.parentCulture, function(n) {
- typeof n == "undefined" ? Microsoft.Translator.Widget.GetLanguagesForTranslate("en-us", function(n) {
- typeof n != "undefined" && k(n)
- }) : k(n)
- }, function(n) {
- console.log("Error Fetching list of languages %s !", n)
- })
- }
- function ct() {
- window.AM != null && window.AM.push(t.translatorDomain);
- l = n("#translatorForm").validate(formValidateOptions);
- st();
- tt();
- it();
- d();
- c();
- ut();
- n(".customize-options input:radio").change(i);
- n("input[name='theme']").change(y);
- n("input[name='mode']").change(p);
- n("#siteLanguage").change(i);
- n("input[name='ctEnabled']").change(w);
- n("#signInLink a").click(ft);
- n("#associateInLink a").click(et);
- n("#markupbox").focus(selectAllTextAreaContent);
- n("#siteUrl").bind("blur mouseleave keypress", ot);
- n("#settingsContinue").click(function() {
- v(1)
- });
- n("#themeContinue").click(function() {
- v(2)
- })
- }
- var r = "",
- l = null,
- u = !1,
- f = -1,
- e = null,
- o = "",
- a = "";
- ct()
- }
- }(jQuery),
- function(n) {
- function t() {
- function c(n) {
- t = n.widgetUrl;
- r = n.blockUrl;
- u = n.deleteUrl;
- f = n.textMaxLength;
- l();
- a()
- }
- function l() {
- n("#submitBlock").click(v);
- clickButtonOnEnter("#submitBlock", "#blockTextInput");
- n("#deleteTextBlock").click(p);
- e()
- }
- function e() {
- n("#textBlockList table.wmtable :checkbox").change(h)
- }
- function a() {
- n.validator.addClassRules({
- textMaxLengthRule: {
- maxlength: f
- }
- })
- }
- function v() {
- if (n("#textBlockForm").valid()) {
- var i = {
- widgetUrl: t,
- daysToExpire: n("#expireDropdown").val(),
- text: n("#blockTextInput").val(),
- caseSensitive: n("#caseSensitiveCheck").is(":checked")
- };
- showActivityIndicator(!0);
- o(r, i, y, unsetModalAndReportErrorHandler)
- }
- }
- function y(t) {
- var i, r;
- hideActivityIndicator();
- unsetModalActivityIndicator();
- i = t.TextBlock;
- n("#blockTextInput").val("");
- n("#expireDropdown option[data-default=true]").attr("selected", "selected");
- n("#caseLabel").removeClass("on");
- n("#caseSensitiveCheck").removeAttr("checked");
- r = n("<tr/>");
- readOnlyMode ? r.append(n("<td/>")) : r.append(n('<td class="width20"/>').append(n("<input>", {
- type: "checkbox",
- "data-text": i.Text,
- "data-case": i.CaseSensitive
- })).append(n("<label/>")));
- r.append(n("<td/>").append(i.Text)).append(n("<td/>").append(i.CaseSensitiveFormatted)).append(n("<td/>").text(i.DaysToExpireFormatted)).append(n("<td/>").text(i.UserEmail)).append(n("<td/>").text(i.CreatedFormatted));
- n("#textBlockList tbody").prepend(r);
- n("#textBlockList table.wmtable").trigger("update");
- e()
- }
- function p() {
- var i, r;
- showActivityIndicator(!0);
- i = [];
- n("#textBlockList table.wmtable input:checked").each(function() {
- var t = {
- Text: n(this).attr("data-text"),
- CaseSensitive: n(this).attr("data-case")
- };
- i.push(t)
- });
- r = {
- widgetUrl: t,
- textBlocks: JSON.stringify(i)
- };
- o(u, r, w, unsetModalAndReportErrorHandler)
- }
- function w(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n.each(t, function(t, i) {
- n("#textBlockList table input[data-case=" + i.CaseSensitive + "]").each(function() {
- n(this).attr("data-text") == i.Text && n(this).closest("tr").remove()
- })
- });
- n("#textBlockList table.wmtable").trigger("update")
- }
- function o(n, t, i, r) {
- startPostRequestWithJson(t, n, i, r, s)
- }
- var i = {},
- s = "#textBlockForm",
- t, r, u, f, h = setupGridCheckButtonEnabler("#textBlockList table.wmtable", "#deleteTextBlock");
- return i.initialize = c, i
- }
- n.textBlockController = function() {
- return new t
- }
- }(jQuery),
- function(n) {
- function t() {
- function s(n) {
- i = n.createUrl;
- r = n.deleteUrl;
- u = n.settingsUrl;
- h()
- }
- function h() {
- n("#submitWidgetButton").click(l);
- clickButtonOnEnter("#submitWidgetButton", "#inputWidgetName");
- n("#deleteWidgetButton").click(v);
- n("#goBlockButton").click(p);
- c()
- }
- function c() {
- n("#siteWidgetList table.wmtable :checkbox").change(o)
- }
- function l() {
- showActivityIndicator(!0);
- var t = {
- name: n("#inputWidgetName").val()
- };
- f(i, t, a, unsetModalAndReportErrorHandler)
- }
- function a(t) {
- var i = u + "&id=" + t.Id;
- n("#inputWidgetName").val().length == 0 && (i += "&unnamed=1");
- window.location = i
- }
- function v() {
- var t, i;
- showActivityIndicator(!0);
- t = [];
- n.each(getCheckedItemsInTable("data-id"), function(n, i) {
- var r = {
- Id: i,
- SiteUrl: url
- };
- t.push(r)
- });
- i = {
- widgets: JSON.stringify(t)
- };
- f(r, i, y, unsetModalAndReportErrorHandler)
- }
- function y(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n.each(t, function(t, i) {
- n("#siteWidgetList table input[data-id=" + i.Id + "]").closest("tr").remove()
- });
- n("#siteWidgetList table.wmtable").trigger("update")
- }
- function p() {
- window.location = n("#blockDropdown").val()
- }
- function f(n, t, i, r) {
- startPostRequestWithJson(t, n, i, r, e)
- }
- var t = {},
- e = "#siteWidgetsForm",
- i, r, u, o = setupGridCheckButtonEnabler("#siteWidgetList table.wmtable", "#deleteWidgetButton");
- return t.initialize = s, t
- }
- n.siteWidgetController = function() {
- return new t
- }
- }(jQuery),
- function(n) {
- n.fn.translatorWidget = function(t) {
- function o() {
- n.get(t.markupUrl, function(n) {
- r = n;
- r != null && r.length > 0 && i()
- })
- }
- function i() {
- n("#WidgetFloaterPanels").remove();
- n("#MicrosoftTranslatorWidget").remove();
- var f = n("input[name='theme']:checked").val(),
- e = n("input[name='ctEnabled']:checked").val(),
- o = n("input[name='mode']:checked").val(),
- s = a(),
- t = n.validator.format(r, f, e, o, s),
- i = t.indexOf("<script "),
- h = t.substring(0, i),
- c = t.substring(i),
- l = n(c);
- n("#markupbox").val(t);
- n("#copyToClipboard").attr("data-clipboard-text", t);
- n("#preview").empty().html(h).append(l).parent().hide();
- u == -1 && (u = window.setInterval(function() {
- n("#WidgetLauncher").length >= 1 && (window.clearInterval(u), n("#previewContainer").show(), v(), u = -1)
- }, 100))
- }
- function s() {
- var t = n("input[name='theme']:checked").val() == "Dark";
- t ? n("#previewBackground").removeClass("dark-background") : n("#previewBackground").addClass("dark-background")
- }
- function h() {
- var t = n("input[name='mode']:checked").val() == "Manual";
- t && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.FloaterOnClose()
- }
- function c() {
- i()
- }
- function l() {
- n("body").attr("adjustalign", "false");
- n("header").attr("translate", "no");
- n("nav").attr("translate", "no");
- n("footer").attr("translate", "no");
- n("h1.page-name").attr("translate", "no");
- n("#fbpgbt").attr("translate", "no")
- }
- function a() {
- var i = n("#siteLanguage").val();
- return i == null && (i = t.parentCulture, f = t.parentCulture), i
- }
- function e(r) {
- n.each(r, function(t, i) {
- n("#siteLanguage").append(n("<option />").val(i.Code).text(i.Name))
- });
- var u = "en";
- n("#siteLanguage option").each(function() {
- if (n(this).attr("value") == t.parentCulture) {
- u = t.parentCulture;
- return
- }
- });
- n("#siteLanguage option[value='" + u + "']").prop("selected", !0);
- f != "" && f != u && i()
- }
- function v() {
- n("#siteLanguage option").length == 0 && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.Widget.GetLanguagesForTranslate(t.parentCulture, function(n) {
- typeof n == "undefined" ? Microsoft.Translator.Widget.GetLanguagesForTranslate("en-us", function(n) {
- typeof n != "undefined" && e(n)
- }) : e(n)
- }, function(n) {
- console.log("Error Fetching list of languages %s !", n)
- })
- }
- function y() {
- ZeroClipboard.setDefaults({
- moviePath: "/webmaster/content/images/zeroclipboard.swf"
- });
- var t = n("#copyToClipboard"),
- i = new ZeroClipboard(t);
- i.on("mouseover", function() {
- t.addClass("button-hover")
- });
- i.on("mouseout", function() {
- t.removeClass("button-hover")
- });
- i.on("mousedown", function() {
- t.addClass("button-active")
- });
- i.on("mouseup", function() {
- t.removeClass("button-active")
- })
- }
- function p() {
- o();
- l();
- y();
- n(".customize-options input:radio").change(i);
- n("input[name='theme']").change(s);
- n("input[name='mode']").change(h);
- n("#siteLanguage").change(i);
- n("input[name='ctEnabled']").change(c);
- n("#markupbox").focus(selectAllTextAreaContent)
- }
- var r = "",
- u = -1,
- f = "";
- p()
- }
- }(jQuery),
- function(n) {
- n.fn.trendingWidget = function(t) {
- function i() {
- var f = n("#widget-flavor").val(),
- e = n("#widget-data-type").val(),
- u = n("div.size-option").is(":visible") ? n("#widget-size").val().split("x") : [300, 250],
- i = n.validator.format("<script type='text/javascript' src='//www.bing.com/widget/bootstrap.js' async><\/script> <div class='bingwidget floatinggroup' data-flavor='{0}' data-type='{1}' data-width='{2}px' data-height='{3}px' data-widgetid='{4}'/>", f, e, u[0], u[1], t.dataId),
- r;
- n("#markupbox").val(i);
- n("#copyToClipboard").attr("data-clipboard-text", i);
- r = n("div.widget-preview");
- r.css({
- "overflow-y": "hidden",
- "min-height": "333px"
- });
- n("div.preview-block").html(i);
- r.css({
- "overflow-y": "",
- "min-height": ""
- })
- }
- function r() {
- var t = n("#widget-flavor").val();
- switch (t) {
- case "trending":
- n("#widget-size :not(option.textonly)").show();
- n("#widget-size option.textonly").hide();
- n("div.size-option").show();
- n("#widget-size :first-child").prop("selected", !0);
- break;
- case "text":
- n("#widget-size :not(option.textonly)").hide();
- n("#widget-size option.textonly").show();
- n("div.size-option").show();
- n("#widget-size option.textonly:first").prop("selected", !0);
- break;
- case "slicebox":
- n("div.size-option").hide();
- break;
- case "tagferriswheel":
- n("div.size-option").hide()
- }
- }
- function u() {
- r();
- i()
- }
- function f() {
- i()
- }
- function e() {
- i()
- }
- function o() {
- ZeroClipboard.setDefaults({
- moviePath: "/webmaster/content/images/zeroclipboard.swf"
- });
- var t = n("#copyToClipboard"),
- i = new ZeroClipboard(t);
- i.on("mouseover", function() {
- t.addClass("button-hover")
- });
- i.on("mouseout", function() {
- t.removeClass("button-hover")
- });
- i.on("mousedown", function() {
- t.addClass("button-active")
- });
- i.on("mouseup", function() {
- t.removeClass("button-active")
- })
- }
- function s() {
- n("#widget-flavor").change(u);
- n("#widget-data-type").change(f);
- n("#widget-size").change(e);
- n("#markupbox").focus(selectAllTextAreaContent);
- r();
- i();
- o()
- }
- s()
- }
- }(jQuery),
- function(n) {
- function t() {
- function s(n) {
- t = n.blockLink;
- u = n.deleteUrl;
- f = n.blockUrl;
- h()
- }
- function h() {
- n("#submitBlock").click(a);
- clickButtonOnEnter("#submitBlock", "#blockTextInput, #inputWidgetUrl");
- n("#deleteUrlButton").click(y);
- c();
- l()
- }
- function c() {
- n("#widgetUrlList tr.widgetUrlRow").find("td:gt(0)").click(w);
- n("span.stopPropagation").click(function(n) {
- n.stopPropagation()
- })
- }
- function l() {
- n("#widgetUrlList table.wmtable :checkbox").change(o)
- }
- function a() {
- if (n(r).valid()) {
- var t = n("#inputWidgetUrl").val(),
- i = {
- widgetUrl: t,
- daysToExpire: n("#expireDropdown").val(),
- text: n("#blockTextInput").val(),
- caseSensitive: n("#caseSensitiveCheck").is(":checked")
- };
- showActivityIndicator(!0);
- e(f, i, v, unsetModalAndReportErrorHandler)
- }
- }
- function v(n) {
- window.location = t + "&widgeturl=" + encodeURIComponent(n.Url)
- }
- function y() {
- var t, i;
- showActivityIndicator(!0);
- t = [];
- n.each(getCheckedItemsInTable("data-url"), function(n, i) {
- var r = {
- SiteUrl: url,
- url: i
- };
- t.push(r)
- });
- i = {
- widgetUrls: JSON.stringify(t)
- };
- e(u, i, p, unsetModalAndReportErrorHandler)
- }
- function p(t) {
- hideActivityIndicator();
- unsetModalActivityIndicator();
- n.each(t, function(t, i) {
- n('#widgetUrlList table input[data-url="' + i.Url + '"]').closest("tr").remove()
- });
- n("#widgetUrlList table.wmtable").trigger("update")
- }
- function e(n, t, i, u) {
- startPostRequestWithJson(t, n, i, u, r)
- }
- function w() {
- var i = n(this).parent("tr").find("input").attr("data-url");
- window.location = t + "&widgetUrl=" + encodeURIComponent(i)
- }
- var i = {},
- r = "#widgetUrlForm",
- t, u, f, o = setupGridCheckButtonEnabler("#widgetUrlList table.wmtable", "#deleteUrlButton");
- return i.initialize = s, i
- }
- n.widgetUrlController = function() {
- return new t
- }
- }(jQuery)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement