Advertisement
Guest User

Untitled

a guest
Dec 4th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 428.32 KB | None | 0 0
  1. function toggleTableBoxes() {
  2. var n = $("table.grid :checkbox");
  3. $(this).is(":checked") ? (n.next().addClass("on"), n.prop("checked", !0)) : (n.next().removeClass("on"), n.prop("checked", !1));
  4. n.first().trigger("change")
  5. }
  6.  
  7. function emptyImage(n, t) {
  8. var i = $(n);
  9. i.attr("src", containerPrefix + "/content/images/1.gif");
  10. i.css("border", "1px solid #ccc");
  11. t && t.length > 0 ? i.height(t) : i.css("width", "158px")
  12. }
  13.  
  14. function enableAjaxSorting() {
  15. constrainCheckboxWidth();
  16. $('table.grid[paginationUrl][paginationAjax="true"]').each(function() {
  17. var n = $(this),
  18. i = n.attr("paginationUrl"),
  19. t = n.attr("paginationContainer");
  20. $("th a", n).each(function() {
  21. var u = $(this),
  22. o = u.attr("href"),
  23. r = $.deparam.querystring(o),
  24. f, e;
  25. !r.sort || (u.attr("href", "javascript:void(0);"), f = {
  26. sort: r.sort
  27. }, !r.sort || (f.sortdir = r.sortdir), e = $.param.querystring(i, f), u.click(function() {
  28. $.get(e, function(i) {
  29. if (!t) {
  30. var r = $(n).parent();
  31. $(n).replaceWith(i);
  32. r.trigger("onsort")
  33. } else $(t).html(i).trigger("onsort");
  34. enableAjaxSorting();
  35. enablePagination();
  36. initInfoHovers()
  37. }).error(function() {
  38. showErrorMessage(null, wr.G_Error)
  39. })
  40. }))
  41. })
  42. })
  43. }
  44.  
  45. function enablePagination() {
  46. constrainCheckboxWidth();
  47. $("table.grid:not([alreadypaginated])").each(function() {
  48. var n = $(this),
  49. r = n.attr("paginationTotalPages"),
  50. u = n.attr("paginationCurrentPage"),
  51. i = n.attr("paginationUrl"),
  52. t = !r ? 0 : parseInt(r),
  53. f, e = $.trim($("tfoot", n).text()),
  54. c, o, s, h;
  55. e.length > 1 && (r == null && (t = 0, $("tfoot a", n).each(function() {
  56. var s = $(this),
  57. u = s.attr("href"),
  58. e = u.lastIndexOf("page="),
  59. o = parseInt(u.substring(e + 5)),
  60. r, f;
  61. t = t > o ? t : o;
  62. i == null ? (i = u.substring(0, e), n.attr("paginationUrl", i)) : i.indexOf("sort=") < 0 && (r = $.deparam.querystring(u), !r.sort || (f = {
  63. sort: r.sort
  64. }, !r.sort || (f.sortdir = r.sortdir), i = $.param.querystring(i, f), n.attr("paginationUrl", i)))
  65. })), 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() {
  66. var t = $("#pagBox", n),
  67. i = $(this).attr("increment");
  68. t.val((parseInt(n.attr("paginationCurrentPage")) + parseInt(i)).toString());
  69. gridPaginate.call(t)
  70. }), f == t ? $("#pagNext", n).hide() : f == 1 && $("#pagPrev", n).hide(), t > 1 && s.show(), n.attr("alreadypaginated", "true"))
  71. })
  72. }
  73.  
  74. function gridPaginate() {
  75. var u = $(this),
  76. r = u.val(),
  77. t = $(this).parents("table.grid"),
  78. f = t.parent(),
  79. e = t.attr("paginationAjax"),
  80. o = t.attr("paginationUrl"),
  81. s = t.attr("paginationCurrentPage"),
  82. i = t.attr("paginationContainer"),
  83. n;
  84. r != s && (showActivityIndicator(!0), n = o, n[n.length - 1] != "&" && (n = n + "&"), n = n + "page=" + r, e ? $.get(n, function(n) {
  85. i ? $(i).html(n) : t.replaceWith(n);
  86. enablePagination();
  87. initInfoHovers();
  88. enableAjaxSorting();
  89. showActivityIndicator(!1);
  90. scrollToTop();
  91. i ? $(i).parent().animate({
  92. scrollTop: 0
  93. }, "fast") : f.animate({
  94. scrollTop: 0
  95. }, "fast")
  96. }) : window.location.href = n)
  97. }
  98.  
  99. function validatorSetup() {
  100. function n(n, t) {
  101. for (var r, u, e, f = [], i = 2; i < arguments.length; i++) f[i - 2] = arguments[i];
  102. r = $.trim(n).split("\n");
  103. for (u in r)
  104. if ($.trim(r[u]).length > 0 && (e = $.validator.methods.url.call(this, r[u], t, f), !e)) return !1;
  105. return !0
  106. }
  107.  
  108. function t(n, t) {
  109. for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
  110. return isValueSameAsPalceHolder(n, t) ? !1 : $.validator.methods.required.call(this, n, t, r)
  111. }
  112.  
  113. function i(n, t) {
  114. for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
  115. return isValueSameAsPalceHolder(n, t) ? !0 : $.validator.methods.url.call(this, n, t, r)
  116. }
  117.  
  118. function r(n, t) {
  119. for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
  120. return isValueSameAsPalceHolder(n, t) ? !0 : $.validator.methods.email.call(this, n, t, r)
  121. }
  122.  
  123. function f(n, t) {
  124. for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
  125. return isValueSameAsPalceHolder(n, t) ? !0 : u.test($.trim(n))
  126. }
  127. 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*$/;
  128. $.validator.addMethod("urlListValidation", n);
  129. $.validator.addMethod("requiredNoWatermark", t, $.validator.messages.required);
  130. $.validator.addMethod("urlNoWatermark", i, $.validator.messages.url);
  131. $.validator.addMethod("emailNoWatermark", r, $.validator.messages.email);
  132. $.validator.addMethod("elementWithZeroOrEmptyValue", function(n) {
  133. return !(n == "" || n == "0")
  134. });
  135. $.validator.addMethod("ipNoWatermark", f, $.validator.messages.ip);
  136. $.validator.addClassRules({
  137. wmMaxLength60: {
  138. maxlength: 60
  139. },
  140. wmMaxLength500: {
  141. maxlength: 500
  142. },
  143. wmMaxLength100: {
  144. maxlength: 100
  145. },
  146. wmRequired: {
  147. requiredNoWatermark: !0
  148. },
  149. wmUrl: {
  150. urlNoWatermark: !0
  151. },
  152. wmEmail: {
  153. emailNoWatermark: !0
  154. },
  155. urlValidation: {
  156. requiredNoWatermark: !0,
  157. urlNoWatermark: !0
  158. },
  159. emailValidation: {
  160. requiredNoWatermark: !0,
  161. emailNoWatermark: !0
  162. },
  163. urlListValidation: {
  164. requiredNoWatermark: !0,
  165. urlListValidation: !0,
  166. minlength: 10
  167. },
  168. requiredIfValueZeroOrEmpty: {
  169. elementWithZeroOrEmptyValue: !0
  170. },
  171. wmIp: {
  172. ipNoWatermark: !0
  173. }
  174. })
  175. }
  176.  
  177. function validationErrorPlacement(n, t) {
  178. var i = t.attr("id");
  179. i !== undefined && $('.validationErrorPlaceholder[for~="' + i + '"]').html(n)
  180. }
  181.  
  182. function onEnterPressExecute(n, t, i) {
  183. var r = function(r) {
  184. t != null && i != null && ($.trim($(this).val()) == "" ? t.removeClass(i) : t.addClass(i));
  185. r.which == 13 && n.call(this)
  186. };
  187. this.eventHandler = r
  188. }
  189.  
  190. function clickButtonOnEnter(n, t) {
  191. var r = $(n),
  192. u = function() {
  193. r.click()
  194. },
  195. f, i;
  196. if (t.constructor.toString().indexOf("Array") == -1) i = $(t), i.keyup(new onEnterPressExecute(u, r, "orangeBorder").eventHandler);
  197. else
  198. for (f in t) i = $(t[f]), $(i).keyup(new onEnterPressExecute(u, r, "orangeBorder").eventHandler)
  199. }
  200.  
  201. function getCheckedItemsInTable(n) {
  202. var t = [];
  203. return $("table.grid :checked").each(function() {
  204. var i = $(this);
  205. t.push(i.attr(n))
  206. }), t
  207. }
  208.  
  209. function enableHintText() {
  210. hasPlaceholderSupport() || $("input[placeholder], textarea[placeholder]").each(function() {
  211. var n = $(this);
  212. n.Watermark(n.attr("placeholder"))
  213. })
  214. }
  215.  
  216. function isValueSameAsPalceHolder(n, t) {
  217. return hasPlaceholderSupport() ? !1 : $(t).attr("placeholder") == undefined ? !1 : n == $(t).attr("placeholder")
  218. }
  219.  
  220. function enableAutofocus() {
  221. hasAutofocusSupport() || $("input[autofocus], textarea[autofocus]").each(function() {
  222. var n = $(this);
  223. n.focus()
  224. })
  225. }
  226.  
  227. function hasAutofocusSupport() {
  228. var n = document.createElement("input");
  229. return "autofocus" in n
  230. }
  231.  
  232. function triggerCheckboxChange() {
  233. var n = $("table.grid :checkbox");
  234. n.first().trigger("change");
  235. constrainCheckboxWidth()
  236. }
  237.  
  238. function setupGridCheckButtonEnabler(n, t) {
  239. var i = function() {
  240. var i = $("input[type=checkbox]", n),
  241. r = i.length,
  242. u = i.filter(":checked").length,
  243. e = u > 0,
  244. f;
  245. e ? $(t).removeAttr("disabled") : $(t).attr("disabled", "disabled");
  246. f = r - u > 0 || r == 0;
  247. f ? ($("#toggleAll").removeAttr("checked"), $("#toggleAllL").removeClass("on")) : ($("#toggleAll").attr("checked", "checked"), $("#toggleAllL").addClass("on"))
  248. };
  249. return $(n).bind("update", i), i
  250. }
  251.  
  252. function setupGridCheckboxChangeEnalber(n, t) {
  253. var i = function() {
  254. var i = $("input[value=false]:checked", n).length > 0 || $("input[value=true]:not(input:checked)", n).length > 0;
  255. i ? $(t).removeAttr("disabled") : $(t).attr("disabled", "disabled");
  256. $("tbody tr", n).each(function() {
  257. $(this).removeClass("row-selected")
  258. });
  259. $("input[value=false]:checked", n).each(function() {
  260. $(this).closest("tr").addClass("row-selected")
  261. });
  262. $("input[value=true]:not(input:checked)", n).each(function() {
  263. $(this).closest("tr").addClass("row-selected")
  264. })
  265. };
  266. return $(n).bind("update", i), i
  267. }
  268.  
  269. function setupGridCheckButtonEnablerDisableFor2OrMore(n, t) {
  270. var i = function() {
  271. var i = $("input:checked", n).length == 1;
  272. i ? $(t).removeAttr("disabled") : $(t).attr("disabled", "disabled")
  273. };
  274. return $(n).bind("update", i), i
  275. }
  276.  
  277. function turnOnCheckboxes() {
  278. $(document).on("click", "input[type='checkbox'] + label, input[type='checkbox'] + label + label", function() {
  279. var n = $(this),
  280. t = n.prev("input[type=checkbox]");
  281. (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")))
  282. });
  283. constrainCheckboxWidth()
  284. }
  285.  
  286. function constrainCheckboxWidth() {
  287. $("table.grid td input[type='checkbox'] + label").first().parent().addClass("width20")
  288. }
  289.  
  290. function initTreeView() {
  291. var n = $("#site-nav-minor");
  292. $("li[expand] > button.tree-toggle-button.collapsed", n).each(function() {
  293. $(this).click()
  294. })
  295. }
  296.  
  297. function calcPercentageChange(n, t) {
  298. return t == 0 ? 0 : Math.round((n / t - 1) * 100)
  299. }
  300.  
  301. function reportError(n, t) {
  302. if (t != "abort" && t != "No Transport" && (n.status != 0 || n.readyState != 0)) {
  303. var i = null;
  304. n.Message != null && (i = n.Message);
  305. showErrorMessage(i, wr.G_Error)
  306. }
  307. }
  308.  
  309. function unsetModalAndReportErrorHandler(n) {
  310. hideActivityIndicator();
  311. unsetModalActivityIndicator();
  312. reportError(n)
  313. }
  314.  
  315. function setupDeveloperConsole() {
  316. window.console || (console = {}, console.log = console.log || function() {}, console.warn = console.warn || function() {}, console.error = console.error || function() {}, console.info = console.info || function() {})
  317. }
  318.  
  319. function handleAjaxError(n, t, i) {
  320. if (n.readyState == 4) {
  321. if (n.responseText) {
  322. var r;
  323. try {
  324. r = JSON.parse(n.responseText)
  325. } catch (u) {
  326. r = n.responseText
  327. }
  328. r ? t(r) : t({
  329. Message: null
  330. })
  331. }
  332. } else n.statusText == "timeout" && (i != null ? i() : showErrorMessage(wr.G_TimeoutError, wr.G_TimeoutErrorTitle))
  333. }
  334.  
  335. function $id(n) {
  336. return $(document.getElementById(n))
  337. }
  338.  
  339. function showActivityIndicator(n) {
  340. n != null && n && (activityIndicatorModal = !0);
  341. activityIndicatorInitialized || activityIndicatorModal && $("#activityIndicator").jqm({
  342. overlay: 20,
  343. modal: !0,
  344. overlayClass: "jqmLoadingOverlay"
  345. });
  346. activityIndicatorModal ? $("#activityIndicator").jqmShow() : $("#activityIndicator").show()
  347. }
  348.  
  349. function hideActivityIndicator() {
  350. activityIndicatorModal ? $("#activityIndicator").jqmHide() : $("#activityIndicator").hide()
  351. }
  352.  
  353. function unsetModalActivityIndicator() {
  354. activityIndicatorModal = !1
  355. }
  356.  
  357. function showHtmlMessage(n, t) {
  358. n != null && t != null && ($("#dgExErrorTitle").text(t), $("#dgExErrorMessage").html(n), $("#dgExError").jqm({
  359. overlay: 5,
  360. modal: !0
  361. }), $("#dgExError").jqmShow())
  362. }
  363.  
  364. function showErrorMessageMarkUpBusy() {
  365. $("#dgExErrorMessage").text(wr.G_Throttling);
  366. $("#dgExErrorTitle").text(wr.G_UnknownError);
  367. $("#dgExError").jqm({
  368. overlay: 5,
  369. modal: !0
  370. });
  371. $("#dgExError").jqmShow()
  372. }
  373.  
  374. function closeMessage() {
  375. $("#dgExError").jqmHide()
  376. }
  377.  
  378. function showErrorMessage(n, t, i) {
  379. $("#dgExErrorMessage").empty();
  380. t != null ? $("#dgExErrorTitle").text(t) : $("#dgExErrorTitle").text(wr.G_UnknownError);
  381. n != null ? i ? $("#dgExErrorMessage").html(n) : $("#dgExErrorMessage").text(n) : $("#dgExErrorMessage").text(wr.G_UnkownErrorDetails);
  382. $("#dgExError").jqm({
  383. overlay: 5,
  384. modal: !0
  385. });
  386. $("#dgExError").jqmShow()
  387. }
  388.  
  389. function genKpiMarkup(n, t, i) {
  390. if (n == null) return wr.G_NotAvailable;
  391. if (t == null) return r = $.validator.format('<img src="{0}/content/images/arrowunknown.png"><\/img>', containerPrefix), $.validator.format(kpiFormat, "0", r);
  392. var u = calcPercentageChange(n[i], t[i]),
  393. r = "";
  394. 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)
  395. }
  396.  
  397. function setupKpi(n, t) {
  398. n.html(t)
  399. }
  400.  
  401. function swapQueryString(n, t, i) {
  402. var r = $.deparam.querystring(n);
  403. return r[t] = i, $.param.querystring(n, r)
  404. }
  405.  
  406. function appendUrlParameter(n, t, i) {
  407. 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)
  408. }
  409.  
  410. function showSparklines(n) {
  411. n || (n = "60px");
  412. $(".sparkline:not(.sparkline-drawn)").show().sparkline("html", {
  413. width: n,
  414. fillColor: ""
  415. }).addClass("sparkline-drawn")
  416. }
  417.  
  418. function disableFormSubmit() {
  419. $("form.disable-submit").submit(function() {
  420. return !1
  421. })
  422. }
  423.  
  424. function showPopupModalDialog(n, t, i) {
  425. $(n).remove();
  426. var r = $(t);
  427. r.hide();
  428. $("body").append(r);
  429. enablePagination();
  430. $(n).jqm($.extend({
  431. overlay: 10,
  432. modal: !0
  433. }, i || {})).jqmShow()
  434. }
  435.  
  436. function autoSelect(n) {
  437. var t, i, r;
  438. 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()))
  439. }
  440.  
  441. function initInfoHovers() {
  442. $("img.info-pop-up:not([done])").each(function() {
  443. var t = $(this),
  444. n = t.next();
  445. t.mouseover(function() {
  446. var i, e;
  447. $("img.info-pop-up").next().hide();
  448. i = isRTL;
  449. isRTL ? t.offset().left - n.width() - 20 < 0 && (i = !i) : t.offset().left + n.width() + 20 > $(window).width() && (i = !i);
  450. n.removeClass("flipped");
  451. $("img[flipped]", n).each(function() {
  452. var n = $(this);
  453. n.attr("src", n.attr("src").replace("-fli.png", ".png")).removeAttr("flipped")
  454. });
  455. i && (n.addClass("flipped"), $("img:not([flipped])", n).each(function() {
  456. var n = $(this);
  457. n.attr("src", n.attr("src").replace(".png", "-fli.png")).attr("flipped", "y")
  458. }));
  459. var r = t.offsetParent(),
  460. u = t.position(),
  461. f = u.left + (i ? -n.width() + 12 : -15) + r.scrollLeft() - (isRTL ? 18 : 0),
  462. o = u.top - 12 + r.scrollTop();
  463. 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());
  464. n.css({
  465. top: o,
  466. left: f
  467. }).show()
  468. });
  469. n.mouseleave(function() {
  470. n.hide()
  471. });
  472. t.attr("done", "done")
  473. })
  474. }
  475.  
  476. function cancelEvent(n) {
  477. n.stopPropagation()
  478. }
  479.  
  480. function initHeader() {
  481. $("#account-name").click(function(n) {
  482. n.stopPropagation();
  483. var i = $(this).width(),
  484. t = $("#signoutHover");
  485. t.width(i);
  486. t.toggle()
  487. });
  488. $("body").click(function() {
  489. $("#signoutHover").hide()
  490. })
  491. }
  492.  
  493. function getCalendarName(n) {
  494. var t = {
  495. GregorianCalendar: "gregorian",
  496. UmAlQuraCalendar: "islamic",
  497. HijriCalendar: "islamic",
  498. ThaiBuddhistCalendar: "thai"
  499. };
  500. return t[n] ? t[n] : "gregorian"
  501. }
  502.  
  503. function initCalendars() {
  504. var r = getCalendarName(window.calendarName),
  505. t = calendar.ShortDatePattern,
  506. n, i;
  507. t = t.replace(/M/g, "m");
  508. n = "local";
  509. $.calendars.picker.regional[n] = {
  510. renderer: $.calendars.picker.defaultRenderer,
  511. prevText: "",
  512. prevStatus: wr.G_Prev,
  513. prevJumpText: "",
  514. prevJumpStatus: "",
  515. nextText: "",
  516. nextStatus: wr.G_Next,
  517. nextJumpText: "",
  518. nextJumpStatus: "",
  519. currentText: "",
  520. currentStatus: "",
  521. todayText: "",
  522. todayStatus: "",
  523. clearText: "",
  524. clearStatus: "",
  525. closeText: "",
  526. closeStatus: "",
  527. yearStatus: "",
  528. monthStatus: "",
  529. weekText: "",
  530. weekStatus: "",
  531. dayStatus: "",
  532. defaultStatus: "",
  533. isRTL: calendar.IsRightToLeft
  534. };
  535. $.calendars.picker.setDefaults($.calendars.picker.regional[n]);
  536. $.calendars.calendars[r].prototype.regional[n] = {
  537. epochs: ["BCE", "CE"],
  538. monthNames: calendar.MonthNames,
  539. monthNamesShort: calendar.AbbreviatedMonthGenitiveNames,
  540. dayNames: calendar.DayNames,
  541. dayNamesShort: calendar.AbbreviatedDayNames,
  542. dayNamesMin: calendar.ShortestDayNames,
  543. dateFormat: t,
  544. firstDay: calendar.FirstDayOfWeek,
  545. isRTL: calendar.IsRightToLeft
  546. };
  547. i = $.calendars.instance(r, n);
  548. window.calendarObject = i;
  549. $('.calendar-input input[type="text"]').each(function() {
  550. var n = $(this).attr("minvalue"),
  551. t = $(this).attr("maxvalue");
  552. n == "" && (n = null);
  553. t == "" && (t = null);
  554. $(this).calendarsPicker({
  555. calendar: i,
  556. onSelect: function(n) {
  557. $(this).trigger("inputDateChanged", n)
  558. },
  559. changeMonth: !1,
  560. showAnim: "fade",
  561. showSpeed: "fast",
  562. minDate: n,
  563. maxDate: t
  564. })
  565. });
  566. $(".calendar-date-range-picker").calendarRangeSelector({})
  567. }
  568.  
  569. function initEmptyTables() {
  570. $('table[emptytable]:not([emptytablesetup="true"])').each(function() {
  571. var o, n, t;
  572. $(this).attr("emptytablesetup", "true");
  573. o = $(this).find("thead>tr:first-child th").length;
  574. n = $(this).children("tfoot");
  575. n.length == 0 && (n = $("<tfoot/>").appendTo($(this)));
  576. var i = $(this),
  577. l = i.attr("emptytable") == "true",
  578. a = $(this).attr("emptycompact") == "true",
  579. r = $("<tr />", {
  580. "class": "empty " + (l ? "" : " none") + (a ? " compact" : "")
  581. }).appendTo(n),
  582. s = $("<td />", {
  583. colspan: o
  584. }).appendTo(r),
  585. h = $.trim($(this).attr("emptytitle")),
  586. c = $.trim($(this).attr("emptybutton")),
  587. u = $.trim($(this).attr("emptyurl")),
  588. f = $.trim($(this).attr("emptyfocus")),
  589. e = $.trim($(this).attr("emptyevent"));
  590. h.length > 0 && $("<div />").appendTo(s).html(h);
  591. c.length > 0 && (u.length > 0 || f.length > 0 || e.length > 0) && (t = $("<input />", {
  592. type: "button",
  593. value: c,
  594. disabled: readOnlyMode ? "disabled" : null
  595. }).appendTo(s), readOnlyMode || (f.length > 0 ? t.click(function() {
  596. $(f).focus()
  597. }) : u.length > 0 ? t.click(function() {
  598. window.location.href = u
  599. }) : e.length > 0 && t.click(function() {
  600. i.trigger(e)
  601. })));
  602. i.bind("update", function() {
  603. var n = $(this).find("tbody>tr").length;
  604. n > 0 ? r.hide() : r.show()
  605. })
  606. })
  607. }
  608.  
  609. function loadShared() {
  610. $.ajaxSetup({
  611. error: function(n) {
  612. handleAjaxError(n, reportError)
  613. }
  614. });
  615. $(document).ajaxStart(function() {
  616. showActivityIndicator()
  617. }).ajaxStop(function() {
  618. hideActivityIndicator()
  619. });
  620. $("#toggleAll").change(toggleTableBoxes);
  621. initTreeView();
  622. validatorSetup();
  623. turnOnCheckboxes();
  624. enableHintText();
  625. enableAutofocus();
  626. enablePagination();
  627. enableAjaxSorting();
  628. showSparklines();
  629. $.fn.addSite.userProfileFormInit("#profileDialogForm", "#saveProfile");
  630. disableFormSubmit();
  631. initInfoHovers();
  632. initHeader();
  633. initCalendars();
  634. initEmptyTables();
  635. $("input.urlValidation, input.wmUrl").urlInputBox();
  636. fixIeSelectWidth()
  637. }
  638.  
  639. function textAreaWithLineLimit(n) {
  640. return function(t) {
  641. var i = $(this).val().split("\n").length;
  642. if (t.keyCode == 13 && i >= n) return !1
  643. }
  644. }
  645.  
  646. function formatNumber(n) {
  647. return n == 0 ? "0" : $.formatNumber(n, {
  648. format: formattingNumberFormat,
  649. locale: locale
  650. })
  651. }
  652.  
  653. function formatRealNumber(n) {
  654. return n == 0 ? "0" : $.formatNumber(n, {
  655. format: formattingRealNumberFormat,
  656. locale: locale
  657. })
  658. }
  659.  
  660. function scrollToTop() {
  661. $("#page-content").animate({
  662. scrollTop: 0
  663. }, "fast")
  664. }
  665.  
  666. function fixPlaceholdersBeforeInFormSubmit(n) {
  667. if (!hasPlaceholderSupport()) {
  668. var t = n.find("input[placeholder], textarea[placeholder]");
  669. t.each(function() {
  670. $(this).attr("placeholder") != undefined && $(this).attr("placeholder") == $(this).val() && $(this).val("")
  671. })
  672. }
  673. }
  674.  
  675. function getLocalTimezoneOffset(n) {
  676. var t = n.getTimezoneOffset();
  677. return Math.floor(t / 60)
  678. }
  679.  
  680. function formatXaxis(n) {
  681. var t = new Date(n),
  682. i = monthDayPattern.replace(/M+/g, function(n) {
  683. return n.length > 1 ? "M" : "m"
  684. });
  685. return calendarObject.formatDate(i, calendarObject.newDate(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate()))
  686. }
  687.  
  688. function getStandartChartOptions() {
  689. var n, t, i;
  690. return monthDayPattern = calendar.MonthDayPattern, n = {
  691. mode: "time",
  692. minTickSize: [1, "day"],
  693. monthNames: calendar.AbbreviatedMonthGenitiveNames
  694. }, monthDayPattern.length > 1 && monthDayPattern.indexOf("MMM") == -1 && (n.tickFormatter = formatXaxis), t = isRTL && $.browser.msie && parseFloat($.browser.version) < 9, i = {
  695. colors: ["#215dd3", "#009bda", "#339a00", "#ef2a24", "#727272"],
  696. xaxis: n,
  697. yaxis: {
  698. minTickSize: 1,
  699. tickFormatter: function(n) {
  700. return formatNumber(n).replace(" ", "&nbsp;")
  701. }
  702. },
  703. grid: {
  704. hoverable: !0,
  705. autoHighlight: !1,
  706. color: "#949596",
  707. tickColor: "#eaecee",
  708. borderWidth: 1
  709. },
  710. series: {
  711. lines: {
  712. show: !0,
  713. lineWidth: 2
  714. },
  715. points: {
  716. show: !1,
  717. radius: 2.5,
  718. symbol: function(n, t, i, r) {
  719. n.arc(t, i, r, 0, 2 * Math.PI, !1);
  720. n.closePath();
  721. n.fillStyle = "#e66400";
  722. n.fill();
  723. n.beginPath()
  724. }
  725. },
  726. shadowSize: 2
  727. },
  728. legend: {
  729. show: !1
  730. },
  731. crosshair: {
  732. mode: t ? "" : "x",
  733. color: "#f6c5a1"
  734. },
  735. webmasterlegend: {
  736. enabled: !0,
  737. showPoints: !t
  738. },
  739. webmastergrid: {
  740. show: !0,
  741. color: "#ffffff",
  742. lineWidth: 3
  743. }
  744. }, i
  745. }
  746.  
  747. function splitChartData(n, t, i) {
  748. var f, u, e, r;
  749. for (f in n)
  750. for (u = n[f], e = u[0] * 1e3, r = 0; r < i; ++r) u[r + 1] !== null && t[r].push([e, u[r + 1]])
  751. }
  752.  
  753. function setupChart(n, t, i, r, u, f, e, o) {
  754. var a, c = function() {
  755. var e = 0,
  756. o = 0,
  757. v, y, p, s;
  758. try {
  759. v = calendarObject.parseDate(calendarObject.local.dateFormat, $(u).val()).toJSDate();
  760. y = calendarObject.parseDate(calendarObject.local.dateFormat, $(f).val()).toJSDate();
  761. e = v.getTime();
  762. o = y.getTime()
  763. } catch (d) {}
  764. e > o && (p = o, o = e, e = p);
  765. var h = null,
  766. c = null,
  767. l = 1,
  768. w = !1,
  769. b = [{}, {}, {}, {}, {}],
  770. k = i.filter(":checked");
  771. k.each(function() {
  772. var n = parseInt($(this).attr("index")),
  773. t, u, i, f, s;
  774. b[n] = {
  775. data: r[n],
  776. label: $(this).parent().find("span").text()
  777. };
  778. r[n].length > 0 && (h = Math.max(h, r[n][0][0]), c = Math.max(h, r[n][r[n].length - 1][0]));
  779. 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)
  780. });
  781. e < h && (e = h);
  782. o > c && (o = c);
  783. s = $.extend({}, t);
  784. s.xaxis.min = e;
  785. s.xaxis.max = o;
  786. s.yaxis.min = 0;
  787. s.yaxis.max = l * 1.05;
  788. w ? (n.html(""), a = $.plot(n, b, s)) : n.html($.validator.format('<div class="charts-na"><div>{0}<\/div><\/div>', wr.G_NA))
  789. },
  790. s, l, h;
  791. return c(), s = null, l = function(n) {
  792. s && clearTimeout(s);
  793. s = setTimeout(function() {
  794. s = null;
  795. c()
  796. }, n)
  797. }, $(window).resize(function() {
  798. l(10)
  799. }), $(o).click(function() {
  800. n.html("");
  801. l(500)
  802. }), h = null, i.change(function() {
  803. h && clearTimeout(h);
  804. h = setTimeout(function() {
  805. h = null;
  806. c()
  807. }, 10)
  808. }), $(e).bind("dateChanged", function() {
  809. c()
  810. }), a
  811. }
  812.  
  813. function fixIeSelectWidth() {
  814. !$.browser.msie || parseFloat($.browser.version) >= 9 || $(".line-item .half-width select, .line-item .auto-size-width select").bind("focus mouseover", function() {
  815. $(this).addClass("autowidth").removeClass("clicked");
  816. $(this).parent().addClass("autosize")
  817. }).bind("click", function() {
  818. $(this).toggleClass("clicked")
  819. }).bind("mouseout", function() {
  820. $(this).hasClass("clicked") || ($(this).removeClass("autowidth"), $(this).parent().removeClass("autosize"))
  821. }).bind("blur", function() {
  822. $(this).removeClass("autowidth clicked");
  823. $(this).parent().removeClass("autosize")
  824. })
  825. }
  826.  
  827. function showAdCenterPopup(n, t) {
  828. showHtmlMessage(n, t)
  829. }
  830.  
  831. function getRequestVerificationToken(n) {
  832. return $(n).find('input[type="hidden"][name="__RequestVerificationToken"]').val()
  833. }
  834.  
  835. function createExternalUrl(n) {
  836. return $("<a>", {
  837. target: "_blank",
  838. "class": "url-text",
  839. href: n
  840. }).text(n).append($("<span>", {
  841. "class": "trend-icon blink-icon-popup"
  842. }))
  843. }
  844.  
  845. function startPostRequestWithJson(n, t, i, r, u, f, e) {
  846. n = $.extend(n, {
  847. __RequestVerificationToken: getRequestVerificationToken(u)
  848. });
  849. var o = $.extend({
  850. url: t,
  851. data: n,
  852. type: "POST",
  853. success: i,
  854. error: function(n) {
  855. if (!r) {
  856. handleAjaxError(n, reportError, f);
  857. return
  858. }
  859. handleAjaxError(n, r, f);
  860. return
  861. }
  862. }, e || {});
  863. $.ajax(o)
  864. }
  865.  
  866. function startGetRequestWithJson(n, t, i, r, u, f) {
  867. $.ajax({
  868. url: t,
  869. data: n,
  870. type: "GET",
  871. success: i,
  872. error: function(n) {
  873. if (!r) {
  874. handleAjaxError(n, reportError, f);
  875. return
  876. }
  877. handleAjaxError(n, r, f);
  878. return
  879. }
  880. })
  881. }
  882.  
  883. function unCheckAllCheckBoxes(n, t) {
  884. var i;
  885. t ? $(t + " :checkbox:checked").each(function() {
  886. var n = $(this);
  887. n.attr("checked", !1);
  888. n.parent().find("label").removeClass("on")
  889. }) : $("table.wmtable :checkbox:checked").each(function() {
  890. var n = $(this);
  891. n.attr("checked", !1);
  892. n.parent().find("label").removeClass("on")
  893. });
  894. n && (i = $(n + ":checked"), i.attr("checked", !1), i.parent().find("label").removeClass("on"));
  895. triggerCheckboxChange()
  896. }
  897.  
  898. function getGuid() {
  899. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(n) {
  900. var t = Math.random() * 16 | 0,
  901. i = n == "x" ? t : t & 3 | 8;
  902. return i.toString(16)
  903. })
  904. }
  905.  
  906. function htmlEncodeJQuery(n) {
  907. return $("<div/>").text(n).html()
  908. }
  909.  
  910. function htmlDecodeJQuery(n) {
  911. return $("<div/>").html(n).text()
  912. }
  913.  
  914. function selectAllTextAreaContent() {
  915. var n = $(this);
  916. n.select();
  917. n.mouseup(function() {
  918. return n.unbind("mouseup"), !1
  919. })
  920. }
  921.  
  922. function generateString(n) {
  923. for (var t = "abcdefghijklmnopqrstuvwxyz0123456789", i = [], r = 0; r < n; ++r) i.push(t.charAt(Math.floor(Math.random() * t.length)));
  924. return i.join("")
  925. }
  926.  
  927. function appendParameter(n, t, i) {
  928. return n + (n.indexOf("?") >= 0 ? "&" : "?") + t + "=" + i
  929. }
  930.  
  931. function createHip(n) {
  932. var t;
  933. return t = {
  934. error: 0,
  935. left: "10",
  936. showInstruction: !1,
  937. showMenu: !0,
  938. showError: !1,
  939. instructionsInside: !1,
  940. inputWidth: 250,
  941. done: !1,
  942. holder: "ispHIPHIP",
  943. scriptHolder: "ispHIPScript",
  944. count: 0,
  945. type: "visual",
  946. cssSet: {
  947. cssCdHIPMenu: "hip-menu",
  948. cssCdHIPInput: "hip-input",
  949. cssCdHIPLink: "hip-link",
  950. cssCdHIPError: "hip-error",
  951. cssCdHIPErrorImg: "hip-error-img"
  952. },
  953. postLoad: function() {
  954. var i, r;
  955. $("input.hip-input").css({
  956. "border-width": "1px",
  957. padding: "5px 2px 3px 2px"
  958. });
  959. $("input.hip-input").closest("table").css({
  960. "margin-right": "6px"
  961. });
  962. i = $("div.hip-menu div :nth-child(3)");
  963. $("div.hip-menu div :first-child").text(n.refresh).attr("title", n.refreshTooltip);
  964. 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));
  965. r = $("#serverCode").val();
  966. t.error != "0" || r != "0" ? ($("#idError").show(), $("input.hip-input").focus(), $("#serverCode").val("0")) : $("#idError").hide()
  967. },
  968. reloadHIP: function() {},
  969. hipVerify: function(n, i) {
  970. if (t.clientValidation(), t.error == "0") {
  971. $("#Solution").val(n);
  972. $("#Token").val(i);
  973. $("#Type").val(t.type);
  974. return
  975. }
  976. }
  977. }
  978. }
  979.  
  980. function testForIE6() {
  981. var n, t;
  982. try {
  983. n = $.browser.msie && parseFloat($.browser.version) < 7;
  984. n && (t = $.validator.format(wr.Upgrade_Description, ['<a href="', apCfg.WebConfig.DownloadInternetExplorer, '">', wr.Upgrade_Link, "<\/a>"].join("")), showErrorMessage(t, wr.Upgrade_Title, !0))
  985. } catch (i) {
  986. console.log(i)
  987. }
  988. }
  989. var formValidateOptions, noCleanValidateOptions, hasPlaceholderSupport, activityIndicatorInitialized, activityIndicatorModal, kpiFormat, formattingNumberFormat, formattingRealNumberFormat, monthDayPattern, StringExtensions, Feedback, Home, Configure, MobileFriendliness, PublicTools;
  990. (function(n) {
  991. function i() {
  992. var i = n("#siteurl").val();
  993. n("#siteUrlSuggestion").hide();
  994. t = r(i);
  995. t != i && (n("#siteUrlSuggestion").html(n.validator.format(wr.AddSite_AddingPageWarning, t, "javascript:void(0);")), n("#siteUrlSuggestion").show())
  996. }
  997.  
  998. function r(n) {
  999. var t = n.replace(/(.*\/)(([^\/]+.(htm|xml|html|xhtml|shtml|phtml|php|asp|aspx|jsp|cgi|pl|py)([\/?]|$))).*/i, function(n, t) {
  1000. return t
  1001. }),
  1002. i = t.indexOf("?");
  1003. return i >= 0 && (t = t.substring(0, i)), t
  1004. }
  1005.  
  1006. function u(t) {
  1007. console.log("updateEmailOptInStatus private method called");
  1008. 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")
  1009. }
  1010. var t = "";
  1011. n.fn.addSite = function() {
  1012. n("#offsetHours").val(getLocalTimezoneOffset(new Date));
  1013. n.fn.addSite.userProfileFormInit("#addSiteForm", "#AddSite");
  1014. n("#profileFormFields").length == 1 && n.fn.addSite.populateProfileForm("#addSiteForm");
  1015. n("#siteurl").keyup(i);
  1016. n("#siteUrlSuggestion a").live("click", function() {
  1017. n("#siteUrlSuggestion").hide();
  1018. n("#siteurl").val(t)
  1019. });
  1020. i()
  1021. };
  1022. n.fn.addSite.userProfileFormInit = function(t, i) {
  1023. n(t).validate(formValidateOptions);
  1024. n(i, t).click({
  1025. parentFormId: t
  1026. }, function(t) {
  1027. n.fn.addSite.saveProfileForm(t.data.parentFormId)
  1028. });
  1029. n("#communicationsOptIn", t).click({
  1030. parentFormId: t
  1031. }, function(n) {
  1032. u(n.data.parentFormId)
  1033. })
  1034. };
  1035. n.fn.addSite.showProfileDialog = function() {
  1036. n("#profileDialog").jqm({
  1037. overlay: 10,
  1038. modal: !0
  1039. }).jqmShow();
  1040. n.fn.addSite.populateProfileForm("#profileDialogForm")
  1041. };
  1042. n.fn.addSite.saveProfileForm = function(t) {
  1043. var u, r, s, i, f, e, o, h, c;
  1044. n(t).valid() ? (u = [], n("input[name=alert]:not(:checked)", t).each(function() {
  1045. u.push(n(this).val())
  1046. }), 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) {
  1047. if (t == "#profileDialogForm") n("#profileDialog").jqmHide();
  1048. else {
  1049. var r = i.IsSiteAlreadyVerified ? "/home/mysites" : "/configure/verify/ownership/?url=" + i.SiteUrl;
  1050. document.location = containerPrefix + r
  1051. }
  1052. showActivityIndicator(!1)
  1053. })) : (o = n("select.error, input.error", t), o.length > 0 && (h = t == "#profileDialogForm" ? ".contentScroll" : "#page-content", c = o.first().offset().top, n(h).animate({
  1054. scrollTop: c
  1055. }, 1e3)))
  1056. };
  1057. n.fn.addSite.populateProfileForm = function(t) {
  1058. n.getJSON(containerPrefix + "/Home/GetUserProfile", function(i) {
  1059. var r, u, f, e;
  1060. n("#sitemapurl", t).val("");
  1061. n("#sitetraffic", t).val("");
  1062. n("#firstName", t).val(i.FirstName);
  1063. n("#lastName", t).val(i.LastName);
  1064. n("#email", t).val(i.Email);
  1065. n("#company", t).val(i.Company);
  1066. n("#contactphone", t).val(i.ContactPhone);
  1067. n("#jobrole", t).val(i.JobRole);
  1068. n("#city", t).val(i.City);
  1069. n("#state", t).val(i.State);
  1070. n("#zip", t).val(i.Zip);
  1071. n("#country", t).val(i.Country);
  1072. n("#companysize", t).val(i.CompanySize);
  1073. n("#industry", t).val(i.Industry);
  1074. n("#isAgency", t).prop("checked", i.IsAgency);
  1075. 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"));
  1076. n("input[value=" + i.EmailFrequency + "]", t).prop("checked", !0);
  1077. i.Alerts == null && (i.Alerts = "");
  1078. r = i.Alerts.split(",");
  1079. u = n(t + " input[name=alert]");
  1080. u.prop("checked", !0);
  1081. for (f in r) e = u.filter("[value=" + r[f] + "]"), e.prop("checked", !1)
  1082. })
  1083. }
  1084. })(jQuery);
  1085. formValidateOptions = {
  1086. onsubmit: !1,
  1087. onfocusout: !1,
  1088. focusCleanup: !0,
  1089. errorPlacement: validationErrorPlacement
  1090. };
  1091. noCleanValidateOptions = $.extend(!0, {}, formValidateOptions);
  1092. noCleanValidateOptions.focusCleanup = !1;
  1093. hasPlaceholderSupport = function() {
  1094. var n = document.createElement("input"),
  1095. t = "placeholder" in n;
  1096. return function() {
  1097. return t
  1098. }
  1099. }();
  1100. setupDeveloperConsole();
  1101. activityIndicatorInitialized = !1;
  1102. activityIndicatorModal = !1;
  1103. kpiFormat = "<span>{0}<\/span>% {1}";
  1104. formattingNumberFormat = "#,###";
  1105. formattingRealNumberFormat = "#,##0.##";
  1106. monthDayPattern = "";
  1107. $(document).ready(loadShared),
  1108. function(n) {
  1109. n.fn.calendarRangeSelector = function() {
  1110. var t = n(this),
  1111. e = t.find(".calendar-end-date").val(),
  1112. i = t.find(".calendar-preset"),
  1113. r = t.find(".calendar-input-start-date"),
  1114. u = t.find(".calendar-input-end-date"),
  1115. f = function(t) {
  1116. n.cookie("cp", t, {
  1117. expires: 365,
  1118. path: containerPrefix
  1119. })
  1120. },
  1121. o = function(t, i) {
  1122. n.cookie("ccs", t, {
  1123. expires: 1,
  1124. path: containerPrefix
  1125. });
  1126. n.cookie("cce", i, {
  1127. expires: 1,
  1128. path: containerPrefix
  1129. })
  1130. };
  1131. i.change(function() {
  1132. var i = n(this).find("option:selected").attr("period");
  1133. f(i);
  1134. n(this).val() != "" && (r.val(n(this).val()), u.val(e), t.trigger("dateChanged"))
  1135. });
  1136. t.find('.calendar-input input[type="text"]').bind("inputDateChanged", function() {
  1137. i.val() != "" && (i.val(""), f(""));
  1138. o(r.val(), u.val());
  1139. t.trigger("dateChanged")
  1140. })
  1141. }
  1142. }(jQuery),
  1143. function(n) {
  1144. function t(n) {
  1145. return n == null || n.length === 0
  1146. }
  1147. n.isNullOrEmpty = t
  1148. }(StringExtensions || (StringExtensions = {})),
  1149. function(n) {
  1150. var t;
  1151. (function(n) {
  1152. function t(n, t) {
  1153. function s(n, t, r, u, e) {
  1154. $.support.cors = !0;
  1155. $.ajax({
  1156. type: "POST",
  1157. timeout: o,
  1158. url: appendParameter(n, "c", t),
  1159. contentType: "application/json; charset=utf-8",
  1160. data: JSON.stringify({
  1161. i: r,
  1162. t: u,
  1163. o: !1,
  1164. d: e
  1165. }),
  1166. success: function() {
  1167. i.responses[r] = !0;
  1168. f()
  1169. },
  1170. error: function() {
  1171. i.responses[r] = !1;
  1172. f()
  1173. }
  1174. })
  1175. }
  1176.  
  1177. function u(n, u) {
  1178. var e = typeof u == "undefined" ? generateString(8) : u,
  1179. v = typeof i == "undefined" || i.id != e ? 0 : i.retries + 1,
  1180. o = encodeURIComponent(JSON.stringify(n)),
  1181. h = Math.ceil(o.length / r),
  1182. f, c, l, a;
  1183. for (i = {
  1184. id: e,
  1185. payload: n,
  1186. retries: v,
  1187. responses: {},
  1188. total: h
  1189. }, 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)
  1190. }
  1191.  
  1192. function f() {
  1193. for (var r, t = !0, n = 0; n < i.total; n++) {
  1194. if (typeof i.responses[n] == "undefined") break;
  1195. t = t && i.responses[n]
  1196. }
  1197. n === i.total && t ? i = null : n !== i.total || t || (r = i.payload, i.retries < e ? u(r, i.id) : i = null)
  1198. }
  1199. var i, r = 195e3,
  1200. e = 3,
  1201. o = 1e4;
  1202. return u(n)
  1203. }
  1204. n.SendToBackend = t
  1205. })(t = n.Protocol || (n.Protocol = {}))
  1206. }(Feedback || (Feedback = {})),
  1207. function(n) {
  1208. n.setupFeedbackForm = function(t) {
  1209. function ot() {
  1210. var n = document.doctype ? "<!DOCTYPE " + document.doctype.name + ' PUBLIC "' + document.doctype.publicId + '" "' + document.doctype.systemId + '">' : "";
  1211. return n += document.compatMode ? "<!--COMPATMODE:" + document.compatMode + "-->" : "", n += document.documentMode ? "<!--DOCMODE:" + document.documentMode.toString(10) + "-->" : "", n + ("<html>" + document.getElementsByTagName("html")[0].innerHTML + "<\/html>")
  1212. }
  1213.  
  1214. function st() {
  1215. jQuery.extend(jQuery.validator.messages, {
  1216. maxlength: jQuery.validator.format(t.errorMessage.commentTooLong),
  1217. requiredNoWatermark: t.errorMessage.emptyComment
  1218. });
  1219. n.validator.addClassRules({
  1220. maxLength400: {
  1221. maxlength: 400
  1222. }
  1223. })
  1224. }
  1225.  
  1226. function ht() {
  1227. var r = n("input[type='radio'][name='feedbackType']:checked").val(),
  1228. i;
  1229. yt();
  1230. i = {
  1231. text: n("#feedbackComment").val(),
  1232. original_html: ot(),
  1233. width: n(window).outerWidth(),
  1234. height: n(window).outerHeight(),
  1235. type: r,
  1236. source: t.source,
  1237. url: window.location.href,
  1238. vertical: t.vertical,
  1239. send_mail: !0
  1240. };
  1241. g();
  1242. Feedback.Protocol.SendToBackend(i, t.endpoint)
  1243. }
  1244.  
  1245. function l(t, i, u, f) {
  1246. var o = 0,
  1247. s = 0,
  1248. e;
  1249. do o += u, s += f, e = document.elementFromPoint(t + o, i + s); while (e !== null && n(e).is(r));
  1250. return e
  1251. }
  1252.  
  1253. function ct(n, t) {
  1254. var i = l(n, t, 0, -1),
  1255. r = l(n, t, 1, 0),
  1256. u = l(n, t, 0, 1),
  1257. f = l(n, t, -1, 0);
  1258. 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
  1259. }
  1260.  
  1261. function k(t) {
  1262. r.css({
  1263. left: t.pageX,
  1264. top: t.pageY
  1265. });
  1266. c && clearTimeout(c);
  1267. c = setTimeout(function() {
  1268. c = null;
  1269. s.hide();
  1270. i = ct(t.clientX, t.clientY);
  1271. s.show();
  1272. i !== null && i !== b && (b = i, n(i).trigger(h))
  1273. }, 5)
  1274. }
  1275.  
  1276. function lt() {
  1277. var t = n(i);
  1278. t.is(".highlightIgnore") || w(u, f, e, o, t, 2)
  1279. }
  1280.  
  1281. function at() {
  1282. var t = n(i),
  1283. s, r;
  1284. if (t.is(".feedbackHighlighted") || t.is(".highlightIgnore")) t.is(".feedbackHighlighted") && (n("div.feedbackHighlightContainer[hlid='" + t.attr("hlid") + "']").remove(), t.removeClass("feedbackHighlighted").removeAttr("hlid"));
  1285. else {
  1286. var u = rt.clone(),
  1287. f = ut.clone(),
  1288. e = ft.clone(),
  1289. o = et.clone();
  1290. w(u, f, e, o, t);
  1291. s = it.clone().append(u).append(f).append(e).append(o);
  1292. r = generateString(5);
  1293. n("body").append(s.attr("hlid", r));
  1294. t.addClass("feedbackHighlighted").attr("hlid", r)
  1295. }
  1296. }
  1297.  
  1298. function d() {
  1299. n(".feedbackHighlighted").each(function() {
  1300. var i = n(this).attr("hlid"),
  1301. t = n(".feedbackHighlightContainer[hlid=" + i + "]"),
  1302. r = t.find(".highlightLeftBorder"),
  1303. u = t.find(".highlightRightBorder"),
  1304. f = t.find(".highlightTopBorder"),
  1305. e = t.find(".highlightBottomBorder");
  1306. w(r, u, f, e, n(this))
  1307. })
  1308. }
  1309.  
  1310. function w(n, t, i, r, u, f) {
  1311. typeof f == "undefined" && (f = 0);
  1312. var e = u.offset();
  1313. n.css("height", u.outerHeight() + f * 2 + "px").css("top", e.top - f).css("left", e.left - f).show();
  1314. t.css("height", u.outerHeight() + f * 2 + "px").css("top", e.top - f).css("left", e.left + u.outerWidth() + f).show();
  1315. i.css("width", u.outerWidth() + f * 2 + "px").css("top", e.top - f).css("left", e.left - f).show();
  1316. r.css("width", u.outerWidth() + f * 2 + "px").css("top", e.top + u.outerHeight() + f).css("left", e.left - f).show()
  1317. }
  1318.  
  1319. function g() {
  1320. u.remove();
  1321. f.remove();
  1322. e.remove();
  1323. o.remove();
  1324. s.remove();
  1325. r.remove();
  1326. n(".feedbackHighlight").remove();
  1327. n(".feedbackHighlightContainer").remove();
  1328. n(".feedbackHighlighted").removeClass("borderHighlighted feedbackHighlighted");
  1329. v.remove();
  1330. y.remove();
  1331. n(document).unbind("mousemove", k).unbind(h).unbind(p);
  1332. n(window).unbind("resize", d)
  1333. }
  1334.  
  1335. function nt() {
  1336. n("#feedbackBadge").toggle();
  1337. n("#feedbackContent").toggle()
  1338. }
  1339.  
  1340. function vt() {
  1341. var t = n("#feedbackContent"),
  1342. i, c;
  1343. t.after(u).after(f).after(e).after(o).after(s).after(r).on(h, function(n) {
  1344. u.hide();
  1345. f.hide();
  1346. e.hide();
  1347. o.hide();
  1348. n.stopPropagation()
  1349. });
  1350. n(document).mousemove(k).on(h, lt).on(p, at);
  1351. r.on("click", function(t) {
  1352. t.stopPropagation();
  1353. n(document).trigger(p)
  1354. });
  1355. n(window).resize(d);
  1356. nt();
  1357. i = 20;
  1358. isRTL || (i = n(window).width() - t.outerWidth() - 20);
  1359. c = n(window).height() - t.outerHeight();
  1360. t.draggable({
  1361. cursor: "move"
  1362. }).css("left", i).css("top", c)
  1363. }
  1364.  
  1365. function tt() {
  1366. g();
  1367. n("#feedbackForm").show();
  1368. n("#feedbackAcknowledge").hide();
  1369. nt()
  1370. }
  1371.  
  1372. function yt() {
  1373. v.text(userId);
  1374. n("#user-nav > ul").prepend(v);
  1375. y.text(url);
  1376. n("#user-nav > ul").prepend(y);
  1377. n(".feedbackHighlighted").addClass("borderHighlighted");
  1378. n(".feedbackHighlight").remove();
  1379. n(".feedbackHighlightContainer").remove();
  1380. n(".feedbackHover").remove()
  1381. }
  1382.  
  1383. function pt() {
  1384. if (n("#feedback-form").valid()) {
  1385. var t = n("#feedbackContent");
  1386. t.fadeOut({
  1387. complete: function() {
  1388. var r, i, u;
  1389. ht();
  1390. n("#feedbackForm").hide();
  1391. r = n("#feedbackAcknowledge");
  1392. r.show();
  1393. i = 20;
  1394. isRTL || (i = n(window).width() - t.outerWidth() - 20);
  1395. u = n(window).height() - t.outerHeight();
  1396. t.css("left", i).css("top", u).fadeIn(400)
  1397. }
  1398. })
  1399. }
  1400. }
  1401.  
  1402. function wt() {
  1403. var i = n("#feedbackComment").val().length,
  1404. t = n("#characterCount");
  1405. t.text(i + "/" + a);
  1406. i >= a ? t.addClass("invalidCommentLength") : t.removeClass("invalidCommentLength")
  1407. }
  1408.  
  1409. function bt() {
  1410. n("#feedbackBadge").click(function(n) {
  1411. vt();
  1412. n.stopPropagation()
  1413. });
  1414. n("#feedbackCloseCross").click(tt);
  1415. n("#feedbackCloseButton").click(tt);
  1416. n("#feedbackSend").click(pt);
  1417. n("#characterCount").text("0/" + a);
  1418. n("#feedbackComment").keyup(wt)
  1419. }
  1420.  
  1421. function kt() {
  1422. bt();
  1423. st()
  1424. }
  1425. var a = n("#feedbackComment").attr("maxlength"),
  1426. v = n("<li id='feedbackUserId'><\/li>"),
  1427. y = n("<li id='feedbackSiteUrl'><\/li>"),
  1428. u = n("<div class='feedbackHover hoverLeftBorder highlightIgnore'><\/div>"),
  1429. f = n("<div class='feedbackHover hoverRightBorder highlightIgnore'><\/div>"),
  1430. e = n("<div class='feedbackHover hoverTopBorder highlightIgnore'><\/div>"),
  1431. o = n("<div class='feedbackHover hoverBottomBorder highlightIgnore'><\/div>"),
  1432. it = n("<div class='feedbackHighlightContainer highlightIgnore'>"),
  1433. rt = n("<div class='feedbackHighlight highlightLeftBorder highlightIgnore'><\/div>"),
  1434. ut = n("<div class='feedbackHighlight highlightRightBorder highlightIgnore'><\/div>"),
  1435. ft = n("<div class='feedbackHighlight highlightTopBorder highlightIgnore'><\/div>"),
  1436. et = n("<div class='feedbackHighlight highlightBottomBorder highlightIgnore'><\/div>"),
  1437. s = n('<div id="feedbackScreen" class="highlightIgnore"><\/div>'),
  1438. r = n('<div id="feedbackPxl" class="highlightIgnore"><\/div>'),
  1439. h = "webmaster.feedback.elementChanged",
  1440. p = "webmaster.feedback.elementSelected",
  1441. c, b, i;
  1442. kt()
  1443. }
  1444. }(jQuery),
  1445. function(n) {
  1446. function r(i) {
  1447. function e(n) {
  1448. for (var c = [], t, l = i.getData(), r, a, u = 0; u < l.length; ++u) {
  1449. for (r = l[u], t = 0; t < r.data.length; ++t)
  1450. if (r.data[t][0] > n.x) break;
  1451. var o, s, h = 0,
  1452. f = r.data[t - 1],
  1453. e = r.data[t];
  1454. 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);
  1455. a = r.datapoints.pointsize;
  1456. c[c.length] = {
  1457. datapoint: [o, s],
  1458. dataIndex: h,
  1459. series: r,
  1460. seriesIndex: u
  1461. }
  1462. }
  1463. return c
  1464. }
  1465. var r = [],
  1466. u = !1,
  1467. f = !1;
  1468. i.hooks.bindEvents.push(function(i, o) {
  1469. function h(n) {
  1470. var t = i.getAxes(),
  1471. u = i.getPlotOffset(),
  1472. f = o.offset(),
  1473. r = {
  1474. pageX: n.pageX,
  1475. pageY: n.pageY
  1476. },
  1477. e = n.pageX - f.left - u.left,
  1478. s = n.pageY - f.top - u.top;
  1479. return t.xaxis.used && (r.x = t.xaxis.c2p(e)), t.yaxis.used && (r.y = t.yaxis.c2p(s)), r
  1480. }
  1481.  
  1482. function s(n) {
  1483. return e(h(n))
  1484. }
  1485.  
  1486. function a() {
  1487. if (document.onselectstart !== undefined && (document.onselectstart = t.onselectstart), document.ondrag !== undefined && (document.ondrag = t.ondrag), u = !1, f) {
  1488. f = !1;
  1489. var n = i.getData();
  1490. i.getOptions().webmastercrawldelay.onChange(n[0].data)
  1491. }
  1492. return !1
  1493. }
  1494.  
  1495. function c(n, t) {
  1496. var o, f, u, e;
  1497. if (i.getOptions().webmastercrawldelay.highlightRadius != 0)
  1498. 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))
  1499. }
  1500.  
  1501. function l(n, t) {
  1502. var r = i.getData(),
  1503. u, e, o, n;
  1504. 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))
  1505. }
  1506. i.getOptions().webmastercrawldelay != null && i.getOptions().webmastercrawldelay.enabled && (o.mousedown(function(r) {
  1507. if (r.which == 1) {
  1508. document.body.focus();
  1509. document.onselectstart !== undefined && t.onselectstart == null && (t.onselectstart = document.onselectstart, document.onselectstart = function() {
  1510. return !1
  1511. });
  1512. document.ondrag !== undefined && t.ondrag == null && (t.ondrag = document.ondrag, document.ondrag = function() {
  1513. return !1
  1514. });
  1515. var f = s(r);
  1516. l(f, r);
  1517. u = !0;
  1518. i.getOptions().webmastercrawldelay.onChangeBegin();
  1519. n(document).one("mouseup", a)
  1520. }
  1521. }), o.mousemove(function(n) {
  1522. var t = s(n);
  1523. c(t);
  1524. u && l(t, n)
  1525. }), o.mouseout(function() {
  1526. for (var t, n = 0; n < r.length; ++n) t = r[n], t != null && (i.unhighlight(t.series, t.datapoint), r[n] = null)
  1527. }))
  1528. })
  1529. }
  1530. var i = {
  1531. webmastercrawldelay: {
  1532. enabled: !1,
  1533. autoHighlight: !0,
  1534. highlightColors: ["#1b95ff", "#43f8f8"],
  1535. highlightRadius: 2,
  1536. onChange: function() {},
  1537. onChangeBegin: function() {},
  1538. min: 1,
  1539. max: 10
  1540. }
  1541. },
  1542. t = {};
  1543. n.plot.plugins.push({
  1544. init: r,
  1545. options: i,
  1546. name: "webmastercrawldelay",
  1547. version: "1.0"
  1548. })
  1549. }(jQuery),
  1550. function(n) {
  1551. function t(n) {
  1552. n.hooks.draw.push(function(n, t) {
  1553. var i = n.getOptions().webmastergrid,
  1554. r;
  1555. 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())
  1556. })
  1557. }
  1558. n.plot.plugins.push({
  1559. init: t,
  1560. options: {
  1561. webmastergrid: {
  1562. show: !1,
  1563. color: "rgba(170, 0, 0, 0.80)",
  1564. lineWidth: 1
  1565. }
  1566. },
  1567. name: "webmastergrid",
  1568. version: "1.0"
  1569. })
  1570. }(jQuery),
  1571. function(n) {
  1572. function t(t) {
  1573. function e() {
  1574. var s = t.getPlaceholder(),
  1575. h = t.getData(),
  1576. i, c, o, e, l;
  1577. for (s.find(".legend").remove(), i = [], i.push('<tr><th class="dateLabel" colspan="2">&nbsp;<\/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>');
  1578. 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"))
  1579. }
  1580.  
  1581. function o(n) {
  1582. for (var s = [], i, c = t.getData(), r, u, f, e = 0; e < c.length; ++e) {
  1583. for (r = c[e], i = 0; i < r.data.length; ++i)
  1584. if (r.data[i][0] > n.x) break;
  1585. var l = i < r.data.length,
  1586. a = n.x,
  1587. o = 0,
  1588. h = 0;
  1589. 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]));
  1590. s[s.length] = {
  1591. datapoint: [a, o],
  1592. dataIndex: h,
  1593. series: r,
  1594. seriesIndex: e,
  1595. visible: l
  1596. }
  1597. }
  1598. return s
  1599. }
  1600. var i = [],
  1601. u, f, r;
  1602. t.hooks.bindEvents.push(function(t, s) {
  1603. if (t.getOptions().webmasterlegend != null && t.getOptions().webmasterlegend.enabled) {
  1604. var h = t.getOptions().webmasterlegend.showPoints;
  1605. e();
  1606. r.hide();
  1607. s.mousemove(function(e) {
  1608. var v = t.getAxes(),
  1609. b = t.getPlotOffset(),
  1610. k = s.offset(),
  1611. y = {
  1612. pageX: e.pageX,
  1613. pageY: e.pageY
  1614. },
  1615. d = e.pageX - k.left - b.left,
  1616. g = e.pageY - k.top - b.top,
  1617. p, a, c, l, w;
  1618. 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))));
  1619. r.css("position", "fixed").css("top", y.pageY + 10 + "px").css("left", y.pageX + 15 + "px")
  1620. });
  1621. s.mouseout(function() {
  1622. for (var u, n = 0; n < i.length; ++n) u = i[n], u != null && (h && t.unhighlight(u.series, u.datapoint), i[n] = null);
  1623. r.hide()
  1624. });
  1625. s.mouseover(function() {
  1626. var n = t.getData(),
  1627. i = !1;
  1628. for (var u in n)
  1629. if (n[u].data.length > 0) {
  1630. i = !0;
  1631. break
  1632. }
  1633. i && r.show()
  1634. })
  1635. }
  1636. })
  1637. }
  1638. n.plot.plugins.push({
  1639. init: t,
  1640. options: {
  1641. webmasterlegend: {
  1642. enabled: !1,
  1643. showPoints: !0
  1644. }
  1645. },
  1646. name: "webmasterlegend",
  1647. version: "1.0"
  1648. })
  1649. }(jQuery);
  1650. $(document).ready(testForIE6),
  1651. function(n) {
  1652. var i = function(n, t, i) {
  1653. return {
  1654. SiteUrl: n,
  1655. MessageType: t,
  1656. MessageId: i
  1657. }
  1658. },
  1659. t = function(n) {
  1660. hideActivityIndicator();
  1661. reportError(n)
  1662. },
  1663. u = function(n, r, u, f, e) {
  1664. showActivityIndicator(!0);
  1665. var o = i(r, u, f);
  1666. startPostRequestWithJson({
  1667. messages: JSON.stringify([o])
  1668. }, n.DeleteUrl, function() {
  1669. hideActivityIndicator();
  1670. e(r, u, f)
  1671. }, t, "#messageTokenContainer")
  1672. },
  1673. f = function(n, i, r) {
  1674. showActivityIndicator(!0);
  1675. startPostRequestWithJson({
  1676. messages: JSON.stringify(i)
  1677. }, n.DeleteUrl, function() {
  1678. hideActivityIndicator();
  1679. r(i)
  1680. }, t, "#messageTokenContainer")
  1681. },
  1682. e = function(n, r, u, f, e) {
  1683. showActivityIndicator(!0);
  1684. var o = i(r, u, f);
  1685. startPostRequestWithJson({
  1686. messages: JSON.stringify([o])
  1687. }, n.ArchiveUrl, function() {
  1688. hideActivityIndicator();
  1689. e(r, u, f)
  1690. }, t, "#messageTokenContainer")
  1691. },
  1692. o = function(n, i, r) {
  1693. showActivityIndicator(!0);
  1694. startPostRequestWithJson({
  1695. messages: JSON.stringify(i)
  1696. }, n.ArchiveUrl, function() {
  1697. hideActivityIndicator();
  1698. r(i)
  1699. }, t, "#messageTokenContainer")
  1700. },
  1701. s = function(n, r, u, f, e) {
  1702. showActivityIndicator(!0);
  1703. var o = i(r, u, f);
  1704. startPostRequestWithJson({
  1705. messages: JSON.stringify([o])
  1706. }, n.DeleteArchivedUrl, function() {
  1707. hideActivityIndicator();
  1708. e(r, u, f)
  1709. }, t, "#messageTokenContainer")
  1710. },
  1711. h = function(n, i, r) {
  1712. showActivityIndicator(!0);
  1713. startPostRequestWithJson({
  1714. messages: JSON.stringify(i)
  1715. }, n.DeleteArchivedUrl, function() {
  1716. hideActivityIndicator();
  1717. r(i)
  1718. }, t, "#messageTokenContainer")
  1719. },
  1720. r = function(t, i, r, f, o, h) {
  1721. showActivityIndicator(!0);
  1722. n.post(n.validator.format(i.DialogUrl, encodeURI(r), encodeURI(f), encodeURI(o)), function(c) {
  1723. showPopupModalDialog("#messageDialog", c);
  1724. hideActivityIndicator();
  1725. n("#messagearchive").click(function() {
  1726. n("#messageDialog").jqmHide().remove();
  1727. e(i, r, f, o, h)
  1728. });
  1729. n("#messagedelete").click(function() {
  1730. n("#messageDialog").jqmHide().remove();
  1731. t ? s(i, r, f, o, h) : u(i, r, f, o, h)
  1732. })
  1733. })
  1734. };
  1735. n.fn.messages = function(t) {
  1736. var s = typeof t == "string",
  1737. e = Array.prototype.slice.call(arguments, 1);
  1738. s && t == "show" && (e.splice(0, 0, !1), r.apply(null, e));
  1739. var c = setupGridCheckButtonEnabler("table.wmtable", "#removeParam"),
  1740. l = setupGridCheckButtonEnabler("table.wmtable", "#archiveParam"),
  1741. a = function() {
  1742. n(this).removeClass("messages-unread");
  1743. var i = n(this).parent().parent().find(":checkbox");
  1744. r(t.archive, t, i.attr("siteurl"), i.attr("messagetype"), i.attr("messageid"), function() {
  1745. i.parent().parent().remove();
  1746. n("table.grid").trigger("update")
  1747. })
  1748. },
  1749. u = function(t, r) {
  1750. var u = [],
  1751. f = n("table.wmtable :checked").parent().parent();
  1752. n("table.wmtable :checked").each(function() {
  1753. var t = n(this),
  1754. r = i(t.attr("siteurl"), t.attr("messagetype"), t.attr("messageid"));
  1755. u.push(r)
  1756. });
  1757. u.length > 0 && r(t, u, function() {
  1758. n(f).remove();
  1759. n("table.grid").trigger("update")
  1760. })
  1761. };
  1762. n("table.wmtable tbody a").click(a);
  1763. n("table.wmtable :checkbox").change(c).change(l);
  1764. n("#filterSite").change(function() {
  1765. n("#filters").submit()
  1766. });
  1767. n("#filterType").change(function() {
  1768. n("#filters").submit()
  1769. });
  1770. t.archive ? n("#removeParam").click(function() {
  1771. u(t, h)
  1772. }) : (n("#removeParam").click(function() {
  1773. u(t, f)
  1774. }), n("#archiveParam").click(function() {
  1775. u(t, o)
  1776. }));
  1777. t.showMessage != null && n.fn.messages("show", t, "", t.showMessage, "")
  1778. }
  1779. }(jQuery),
  1780. function(n) {
  1781. var t = function() {
  1782. function n(n) {
  1783. this.kpiRequestQueue = [];
  1784. this.lastSearched = "";
  1785. this.lastKeyedSearch = "";
  1786. this.onGridCheck = setupGridCheckButtonEnabler("table.wmtable", "#removeParam");
  1787. this.options = n
  1788. }
  1789. return n.prototype.Run = function() {
  1790. var n = this,
  1791. t;
  1792. this.fixSiteVerificationSpacing();
  1793. $("#addParamForm").validate(noCleanValidateOptions);
  1794. $("#compactView").change(function() {
  1795. return n.toggleThumbs()
  1796. });
  1797. $("#siteSearch, #siteSearch + button").keyup(function() {
  1798. return n.searchSite()
  1799. });
  1800. $.setupSearchbox(".searchWrapper");
  1801. this.addMySiteRowClick();
  1802. $("#removeParam").click(function() {
  1803. return n.removeSitesHandler()
  1804. });
  1805. $("#addParam").click(function() {
  1806. return n.addSiteHandler()
  1807. });
  1808. $("#kpiPeriodSelectorContainer").bind("dateChanged", function() {
  1809. return n.loadSiteKpis()
  1810. });
  1811. clickButtonOnEnter("#addParam", "#addSite");
  1812. this.loadSiteKpis();
  1813. t = $.deparam.querystring();
  1814. t.profile == 1 && $.fn.addSite.showProfileDialog()
  1815. }, n.prototype.loadSiteKpis = function() {
  1816. 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 = []);
  1817. n.length > 0 && this.kpiRequestQueue.push(n);
  1818. this.kpiRequestQueue.length > 0 && (this.kpiRequestQueue.reverse(), this.invokeKpiRequest())
  1819. }, n.prototype.invokeKpiRequest = function() {
  1820. var n = this,
  1821. t = this.kpiRequestQueue.pop();
  1822. $.ajax({
  1823. url: this.options.KpiUrl,
  1824. type: "POST",
  1825. data: {
  1826. siteUrls: t,
  1827. startDate: $("#kpiPeriodSelectorFrom").val(),
  1828. endDate: $("#kpiPeriodSelectorTo").val()
  1829. },
  1830. traditional: !0,
  1831. timeout: 13500,
  1832. success: function(t) {
  1833. return n.reportSuccess(t)
  1834. },
  1835. error: reportError
  1836. })
  1837. }, n.prototype.reportSuccess = function(n) {
  1838. this.showSiteKpi(n);
  1839. this.kpiRequestQueue.length > 0 && this.invokeKpiRequest()
  1840. }, n.prototype.showSiteKpi = function(n) {
  1841. $("tr", $("<div/>").html(n)).each(function() {
  1842. var n = $(this),
  1843. i = n.attr("site"),
  1844. t = $id(i).parent().parent();
  1845. $("td:gt(3)", t).remove();
  1846. t.append(n.children())
  1847. });
  1848. this.addMySiteRowClick()
  1849. }, n.prototype.addMySiteRowClick = function() {
  1850. var n = this,
  1851. t = function(t) {
  1852. return n.siteRowClicked(t)
  1853. };
  1854. $("a.cancelClick").click(cancelEvent);
  1855. $("td:gt(0)", $("tr", "table.wmtable")).click(function() {
  1856. t($(this))
  1857. });
  1858. $("table.wmtable :checkbox").change(this.onGridCheck)
  1859. }, n.prototype.siteRowClicked = function(n) {
  1860. var i = n.parent(),
  1861. t = $(".siteUrl", i);
  1862. 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
  1863. }, n.prototype.removeDataSuccess = function(n, t) {
  1864. var r, i;
  1865. for (hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i]] = !0;
  1866. $("table.wmtable :checkbox").each(function() {
  1867. r[$(this).attr("site")] && $(this).parent().parent().remove()
  1868. });
  1869. triggerCheckboxChange();
  1870. this.revertToOriginalEmptyMessage();
  1871. $("table.grid").trigger("update")
  1872. }, n.prototype.revertToOriginalEmptyMessage = function() {
  1873. var n = $("#siteList table");
  1874. n.attr("emptytitle", n.attr("oldemptytable")).attr("emptybutton", n.attr("oldemptybutton")).attr("emptytablesetup", "");
  1875. $("tr.empty", n).remove();
  1876. initEmptyTables()
  1877. }, n.prototype.removeDataFailure = function(n) {
  1878. hideActivityIndicator();
  1879. unsetModalActivityIndicator();
  1880. reportError(n)
  1881. }, n.prototype.removeData = function(n) {
  1882. var t = this;
  1883. showActivityIndicator(!0);
  1884. startPostRequestWithJson({
  1885. url: n
  1886. }, this.options.RemoveSitesUrl, function(i) {
  1887. return t.removeDataSuccess(i, n)
  1888. }, function(n) {
  1889. return t.removeDataFailure(n)
  1890. }, "#addParamForm", null, {
  1891. traditional: !0
  1892. })
  1893. }, n.prototype.fixSiteVerificationSpacing = function() {
  1894. var n = $("div.metabox").parent().parent();
  1895. n.attr("colspan", "4");
  1896. n.nextAll().detach()
  1897. }, n.prototype.searchSite = function() {
  1898. var n = this,
  1899. t = $("#siteSearch").val();
  1900. t != this.lastKeyedSearch && (this.lastKeyedSearch = t, setTimeout(function() {
  1901. if (n.lastKeyedSearch != n.lastSearched) {
  1902. n.lastSearched = n.lastKeyedSearch;
  1903. var t = $("#siteList table");
  1904. t.attr("oldemptytable") == null && t.attr("oldemptytable", t.attr("emptytitle")).attr("oldemptybutton", t.attr("emptybutton"));
  1905. 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();
  1906. n.searchXhr != null && n.searchXhr.abort();
  1907. n.searchXhr = $.ajax({
  1908. url: n.options.SiteSearchUrl,
  1909. type: "POST",
  1910. data: {
  1911. partial: n.lastSearched,
  1912. startDate: $("#kpiPeriodSelectorFrom").val(),
  1913. endDate: $("#kpiPeriodSelectorTo").val()
  1914. },
  1915. timeout: 13500,
  1916. success: function(t) {
  1917. return n.showSearchedSites(t)
  1918. },
  1919. error: reportError
  1920. })
  1921. }
  1922. }, 200))
  1923. }, n.prototype.showSearchedSites = function(n) {
  1924. this.searchXhr = null;
  1925. $("#siteList table tbody").html(n);
  1926. $("table.grid").trigger("update");
  1927. $("#pagCont").hide();
  1928. triggerCheckboxChange();
  1929. this.addMySiteRowClick()
  1930. }, n.prototype.toggleThumbs = function() {
  1931. var n = $("#compactView:checked").length > 0;
  1932. $.cookie("cv", n, {
  1933. expires: 365,
  1934. path: containerPrefix
  1935. });
  1936. n ? $("img.thumbnail").hide() : $("img.thumbnail").show()
  1937. }, n.prototype.addSiteHandler = function() {
  1938. var n = $("#addParamForm");
  1939. n.valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(n), window.location.href = [Encoder.htmlDecode(this.options.AddSiteUrl), "&addurl=", encodeURIComponent($("#addSite").val())].join(""))
  1940. }, n.prototype.removeSitesHandler = function() {
  1941. var n = [];
  1942. $("table.wmtable :checked").each(function() {
  1943. var t = $(this),
  1944. i = t.attr("site");
  1945. n.push(i)
  1946. });
  1947. n.length > 0 && this.removeData(n)
  1948. }, n
  1949. }();
  1950. n.MySites = t
  1951. }(Home || (Home = {})),
  1952. function(n) {
  1953. n.setupSearchbox = function(t) {
  1954. var i = n(t);
  1955. return i.find("input[type=search], input[type=search] + button").focus(function() {
  1956. return i.addClass("searchWrapperFocused")
  1957. }).mouseenter(function() {
  1958. return i.addClass("searchWrapperHover")
  1959. }).focusout(function() {
  1960. return i.removeClass("searchWrapperFocused")
  1961. }).mouseout(function() {
  1962. return i.removeClass("searchWrapperHover")
  1963. }), i
  1964. }
  1965. }(jQuery),
  1966. function(n) {
  1967. function r(r, u) {
  1968. var f, h, c, e, o, s, l;
  1969. r.stopPropagation();
  1970. f = n("#siteSelectorHover");
  1971. h = u && u.callback;
  1972. t != h && f.is(":visible") && i();
  1973. c = n(this).width();
  1974. u && u.width && (c = u.width);
  1975. t = h;
  1976. e = parseInt(c) + 70;
  1977. o = parseInt(n("#siteGrid").css("max-width"));
  1978. o > 0 && e > o && (e = o);
  1979. e < 350 && (e = 350);
  1980. f.css("min-width", e);
  1981. f.toggle();
  1982. u ? f.offset(u.offset) : (s = n("#siteSelector").offset(), l = s.top + n("#siteSelector").height(), isRTL ? f.offset({
  1983. right: s.right,
  1984. top: l
  1985. }) : f.offset({
  1986. left: s.left,
  1987. top: l
  1988. }));
  1989. n("#siteSelectorSearch").focus()
  1990. }
  1991.  
  1992. function i() {
  1993. n("#siteSelectorHover").hide()
  1994. }
  1995.  
  1996. function u(n) {
  1997. n.stopPropagation()
  1998. }
  1999.  
  2000. function f() {
  2001. var t = n("#siteSelectorSearch").val();
  2002. n("#siteGrid div").each(function() {
  2003. var i = n(this);
  2004. i.text().indexOf(t) > -1 ? i.parent().parent().show() : i.parent().parent().hide()
  2005. })
  2006. }
  2007.  
  2008. function e(r) {
  2009. var f, u;
  2010. u = n(this);
  2011. 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)))
  2012. }
  2013.  
  2014. function o() {
  2015. var t = e;
  2016. n("#siteSelector").click(r);
  2017. n("body").click(i);
  2018. n("#siteSelectorSearch").keyup(f).click(u);
  2019. n("#searchIcon").click(u);
  2020. n("#siteGrid div").click(t)
  2021. }
  2022. var t = null;
  2023. n.fn.siteSelector = function(n, t, i) {
  2024. i ? r(t, i) : o()
  2025. }
  2026. }(jQuery),
  2027. function(n) {
  2028. n.fn.runSnrHeaderFooterHacks = function(t) {
  2029. n("#sb_help").attr("href", t);
  2030. n("input[name='scope']").remove();
  2031. sj_evt.bind("id:refreshed", function() {
  2032. n('#b_idProviders a[href*="provider=facebook"]').remove()
  2033. })
  2034. };
  2035. n.fn.microsoftTouBanner = function(t) {
  2036. function l() {
  2037. (i = new Date, i.setHours(0, 0, 0, 0), a()) || (v(), y())
  2038. }
  2039.  
  2040. function r() {
  2041. return i.getTime() < h.getTime()
  2042. }
  2043.  
  2044. function a() {
  2045. if (!PublicTools.SearchBlockShared.lsAvailable() || i > c) return !0;
  2046. var n = localStorage.getItem(u),
  2047. t = n ? new Date(n) : null;
  2048. return t != null && t.getTime() == i.getTime() ? !0 : r() ? !!localStorage.getItem(f) : !!localStorage.getItem(e)
  2049. }
  2050.  
  2051. function v() {
  2052. localStorage.setItem(u, i);
  2053. var f = r() ? t.updatingString : t.updatedString;
  2054. n("#msTOU .toumsg").text(f);
  2055. n("#msTOU").css("display", "inline-block")
  2056. }
  2057.  
  2058. function o() {
  2059. r() ? localStorage.setItem(f, 1) : localStorage.setItem(e, 1);
  2060. n("#msTOU").css("display", "none")
  2061. }
  2062.  
  2063. function y() {
  2064. n("#btnLearnMore").click(function() {
  2065. var n = window.open(s, "_blank");
  2066. n.focus();
  2067. o()
  2068. });
  2069. n("#msTOU .tou_close").click(function() {
  2070. o()
  2071. })
  2072. }
  2073. var s = "http://go.microsoft.com/fwlink/?LinkID=536683",
  2074. h = new Date(2015, 07, 1),
  2075. c = new Date(2015, 07, 5),
  2076. u = "MsaLastSeen",
  2077. f = "MsaFirstDismissed",
  2078. e = "MsaSecondDismissed",
  2079. i = null;
  2080. l()
  2081. }
  2082. }(jQuery),
  2083. function(n) {
  2084. var t = function(n) {
  2085. var i, r, t;
  2086. if (!n.match(/^https?:[\/]{2}/i) && n.length > 0) {
  2087. for (i = !1, r = ["http://", "https://"], t = 0; t < r.length; t++)
  2088. if (r[t].toUpperCase().indexOf(n.toUpperCase()) == 0) {
  2089. i = !0;
  2090. break
  2091. }
  2092. return i
  2093. }
  2094. return !0
  2095. };
  2096. n.fn.urlInputBox = function() {
  2097. this.keyup(function() {
  2098. var i = n(this);
  2099. if (!t(i.val())) {
  2100. if (isValueSameAsPalceHolder(i.val(), i)) return;
  2101. i.val("http://" + i.val())
  2102. }
  2103. });
  2104. this.focusout(function() {
  2105. var t = n(this);
  2106. t.val().match(/\s+$/) != null && t.val(n.trim(t.val()))
  2107. })
  2108. };
  2109. n.fn.urlTextArea = function() {
  2110. this.keyup(function() {
  2111. var r = n(this),
  2112. i, u, f, e;
  2113. if (!isValueSameAsPalceHolder(r.val(), r)) {
  2114. i = r.val().split("\n");
  2115. u = !1;
  2116. for (f in i) e = i[f], t(e) || (u = !0, i[f] = "http://" + e);
  2117. u && r.val(i.join("\n"))
  2118. }
  2119. })
  2120. }
  2121. }(jQuery),
  2122. function(n) {
  2123. n.fn.webmasterApi = function(t) {
  2124. function u(t) {
  2125. hideActivityIndicator();
  2126. unsetModalActivityIndicator();
  2127. n("#deleteKey").attr("disabled", !1);
  2128. n("#apiKey").text(t)
  2129. }
  2130.  
  2131. function f() {
  2132. showActivityIndicator(!0);
  2133. startPostRequestWithJson({}, t.generateApiKey, u, r, i)
  2134. }
  2135.  
  2136. function e() {
  2137. hideActivityIndicator();
  2138. unsetModalActivityIndicator();
  2139. n("#deleteKey").attr("disabled", !0);
  2140. n("#apiKey").text(wr.Api_NotGenerated)
  2141. }
  2142.  
  2143. function o() {
  2144. showActivityIndicator(!0);
  2145. startPostRequestWithJson({}, t.deleteApiKey, e, r, i)
  2146. }
  2147. var i = "#apiForm",
  2148. r = function(n) {
  2149. hideActivityIndicator();
  2150. unsetModalActivityIndicator();
  2151. reportError(n)
  2152. };
  2153. n("#generateKey").click(f);
  2154. n("#deleteKey").click(o)
  2155. }
  2156. }(jQuery),
  2157. function(n) {
  2158. function t(t) {
  2159. function i(t, i, r, u, f, e, o, s) {
  2160. s = s || function() {};
  2161. n(u).live("click", function() {
  2162. n(i).show();
  2163. n(u).hide();
  2164. n(e).focus()
  2165. });
  2166. n(f).live("click", function() {
  2167. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
  2168. var h = n.trim(n(e).val()),
  2169. c = isValueSameAsPalceHolder(h, n(e));
  2170. h.length > 0 && !c ? (n(f).attr("disabled", "disabled"), showActivityIndicator(!0), n.post(o, n(r).serialize(), function(i) {
  2171. n(t).html(i);
  2172. showActivityIndicator(!1);
  2173. clickButtonOnEnter(f, e);
  2174. initInfoHovers();
  2175. disableFormSubmit();
  2176. n("input.urlValidation, input.wmUrl").urlInputBox();
  2177. n("#addIgnoredParameter").val("");
  2178. s()
  2179. })) : (n(i).hide(), n(u).show())
  2180. }
  2181. });
  2182. clickButtonOnEnter(f, e);
  2183. s()
  2184. }
  2185.  
  2186. function u() {
  2187. var i = n("#diagnosticSubmit"),
  2188. t = n("#diagnosticsSelector");
  2189. t.val("");
  2190. n("#diagnosticWidgetForm").validate(formValidateOptions);
  2191. i.click(function() {
  2192. var u = n("#diagnosticsUrl").val(),
  2193. i = t.val(),
  2194. r;
  2195. n("#diagnosticWidgetForm").valid() && (r = "", r = i.indexOf("diagnostics/link/explorer") != -1 ? n.validator.format("{0}&targeturl={1}", i, encodeURI(u)) : n.validator.format("{0}&paramurl={1}", i, encodeURI(u)), window.location = r)
  2196. })
  2197. }
  2198.  
  2199. function f() {
  2200. n("table.adCenterIntegration").adCenter({
  2201. KeywordsUrl: t.AdCenterKeywordsUrl,
  2202. TokenContainer: "#tokenContainer"
  2203. });
  2204. n("#periodSelectorContainer").bind("dateChanged", function() {
  2205. showActivityIndicator(!1);
  2206. n.post(t.keywordTableUrl, {
  2207. startDate: n("#periodSelectorFrom").val(),
  2208. endDate: n("#periodSelectorTo").val(),
  2209. socialUrl: t.socialUrl
  2210. }, function(i) {
  2211. hideActivityIndicator();
  2212. n("#searchKeywordWidget").replaceWith(i);
  2213. n("table.adCenterIntegration").adCenter({
  2214. KeywordsUrl: t.AdCenterKeywordsUrl,
  2215. TokenContainer: "#tokenContainer"
  2216. });
  2217. initInfoHovers()
  2218. })
  2219. })
  2220. }
  2221.  
  2222. function e() {
  2223. n("#messageswidget").click(function() {
  2224. window.location = t.messagesUrl
  2225. });
  2226. n("#messageswidget a").click(function(i) {
  2227. jQuery.browser.msie && (i.cancelBubble = !0);
  2228. i.stopPropagation();
  2229. n(this).removeClass("messages-unread");
  2230. var r = n(this);
  2231. n.fn.messages("show", t.messageOptions, n(this).attr("siteurl"), n(this).attr("messagetype"), n(this).attr("messageid"), function() {
  2232. r.remove();
  2233. n("#messageswidget a").length == 0 && n("#messageswidget").remove()
  2234. })
  2235. })
  2236. }
  2237.  
  2238. function o() {
  2239. window.location = t.blockUrlLink
  2240. }
  2241.  
  2242. function s() {
  2243. n("#periodSelectorContainer").bind("dateChanged", function() {
  2244. n.post(t.siteActivityWidgetUrl, {
  2245. startDate: n("#periodSelectorFrom").val(),
  2246. endDate: n("#periodSelectorTo").val(),
  2247. socialUrl: t.socialUrl
  2248. }, function(t) {
  2249. n("#siteactivitywidget").replaceWith(t);
  2250. showSparklines();
  2251. initInfoHovers()
  2252. })
  2253. })
  2254. }
  2255.  
  2256. function h() {
  2257. n('#sitemapwidget table.grid a[si="0"]').each(function() {
  2258. var i = n(this),
  2259. r = n(":nth-child(3)", i.parent().parent().parent());
  2260. n("body").sitemaps({
  2261. IndexCountUrl: t.sitemapsIndexCountUrl
  2262. }, "getSitemapIndexCount", i.text(), r)
  2263. })
  2264. }
  2265. var r = {};
  2266. return r.go = function() {
  2267. n("#blockUrlsPageLoad").click(o);
  2268. i("#sitemapwidget", "#weSitemap", "#addswform", "#weSitemapSubmit1", "#weSitemapSubmit2", "#addSitemap", containerPrefix + "/configure/sitemaps/addwidget?url=" + encodeURI(url), h);
  2269. u();
  2270. i("#ignoreTheseParameterswidget", "#weIgnoreTheseParameters", "#addqpform", "#weIgnoreParametersSubmit1", "#weIgnoreParametersSubmit2", "#addIgnoredParameter", containerPrefix + "/configure/ignore/addwidget?url=" + encodeURI(url));
  2271. i("#submiturlswidget", "#weSubmitUrls", "#addsuwform", "#weSubmitUrlsSubmit1", "#weSubmitUrlsSubmit2", "#submitUrl", t.addSubmitUrlsWidget);
  2272. e();
  2273. f();
  2274. s()
  2275. }, r
  2276. }
  2277. n.widgetController = function(n) {
  2278. return new t(n)
  2279. }
  2280. }(jQuery),
  2281. function(n) {
  2282. function t(t) {
  2283. function f(n) {
  2284. hideActivityIndicator();
  2285. unsetModalActivityIndicator();
  2286. reportError(n)
  2287. }
  2288.  
  2289. function a(n) {
  2290. f(n)
  2291. }
  2292.  
  2293. function v(t) {
  2294. var f, e, s;
  2295. hideActivityIndicator();
  2296. unsetModalActivityIndicator();
  2297. n("table.wmtable :checkbox").each(function() {
  2298. n(this).attr("qp") == t.Url && n(this).parent().parent().remove()
  2299. });
  2300. f = "";
  2301. e = "";
  2302. e = t.EntityType == o ? wr.G_Directory : wr.G_Page;
  2303. f = t.RequestType == i ? wr.BlockUrls_Cache : wr.BlockUrls_URLAndCache;
  2304. s = n("<tr/>");
  2305. s.append(n('<td class="width20"/>').append(n("<input>", {
  2306. type: "checkbox",
  2307. qp: t.Url,
  2308. et: t.EntityType,
  2309. bt: t.RequestType
  2310. })).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));
  2311. n("#urlRemovalList tbody").prepend(s);
  2312. n("#inputBlockUrl").val("");
  2313. triggerCheckboxChange();
  2314. n("table.wmtable :checkbox").change(r);
  2315. n("table.wmtable :checkbox").change(u);
  2316. n("#urlRemovalList table.wmtable").trigger("update")
  2317. }
  2318.  
  2319. function h(n, r, u) {
  2320. var e, f, o;
  2321. console.log("blockUrl", n, r);
  2322. e = s;
  2323. f = l;
  2324. u && (f = i);
  2325. showActivityIndicator(!0);
  2326. o = {
  2327. Url: n,
  2328. EntityType: r,
  2329. RequestType: f,
  2330. BlockTypePermOrTemp: e
  2331. };
  2332. startPostRequestWithJson({
  2333. urlRemoval: JSON.stringify(o)
  2334. }, t.AddUrl, v, a, "#blockUrlForm")
  2335. }
  2336.  
  2337. function y(t) {
  2338. var e, f, s, h, c;
  2339. for (hideActivityIndicator(), unsetModalActivityIndicator(), e = {}, f = 0; f < t.length; ++f) e[t[f].Url] = !0;
  2340. for (n("table.wmtable :checkbox").each(function() {
  2341. e[n(this).attr("qp")] && n(this).parent().parent().remove()
  2342. }), 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>", {
  2343. type: "checkbox",
  2344. qp: t[f].Url,
  2345. et: t[f].EntityType,
  2346. bt: t[f].RequestType
  2347. })).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);
  2348. n("table.wmtable :checkbox").change(r);
  2349. n("table.wmtable :checkbox").change(u);
  2350. triggerCheckboxChange();
  2351. n("#urlRemovalList table.wmtable").trigger("update")
  2352. }
  2353.  
  2354. function p(t) {
  2355. var r, i;
  2356. for (hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
  2357. n("table.wmtable :checkbox").each(function() {
  2358. r[n(this).attr("qp")] && n(this).parent().parent().remove()
  2359. });
  2360. triggerCheckboxChange();
  2361. n("#urlRemovalList table.wmtable").trigger("update")
  2362. }
  2363.  
  2364. function w(n, i) {
  2365. for (var e, u = [], r = 0; r < n.length; r++) e = {
  2366. Url: n[r].urlBlocked,
  2367. RequestType: n[r].blockType,
  2368. EntityType: n[r].entityType,
  2369. BlockTypePermOrTemp: s
  2370. }, u.push(e);
  2371. showActivityIndicator(!0);
  2372. i ? startPostRequestWithJson({
  2373. urlList: JSON.stringify(u)
  2374. }, t.RemoveUrl, function() {
  2375. p(u)
  2376. }, f, "#blockUrlForm") : startPostRequestWithJson({
  2377. urlList: JSON.stringify(u)
  2378. }, t.ExtendUrl, y, f, "#blockUrlForm")
  2379. }
  2380.  
  2381. function c(t) {
  2382. var i = [];
  2383. n("table.wmtable :checked").each(function() {
  2384. var t = n(this),
  2385. r = t.attr("qp"),
  2386. u = t.attr("et"),
  2387. f = t.attr("bt"),
  2388. e = {
  2389. urlBlocked: r,
  2390. entityType: u,
  2391. blockType: f
  2392. };
  2393. i.push(e)
  2394. });
  2395. i.length > 0 && w(i, t)
  2396. }
  2397. var e = {},
  2398. o = 1,
  2399. l = 1,
  2400. i = 0,
  2401. s = 0,
  2402. r = setupGridCheckButtonEnabler("table.wmtable", "#extendBlock"),
  2403. u = setupGridCheckButtonEnabler("table.wmtable", "#stopBlocking");
  2404. return e.go = function() {
  2405. n("table.wmtable :checkbox").change(r);
  2406. n("table.wmtable :checkbox").change(u);
  2407. n("#submitBlockUrl").click(function() {
  2408. if ($id("blockUrlForm").valid()) {
  2409. var t = n("#entitySelected").val(),
  2410. i = n("#inputBlockUrl").val();
  2411. h(i, t, !1)
  2412. }
  2413. });
  2414. n("#submitBlockUrlCache").click(function() {
  2415. if ($id("blockUrlForm").valid()) {
  2416. var t = n("#entitySelected").val(),
  2417. i = n("#inputBlockUrl").val();
  2418. h(i, t, !0)
  2419. }
  2420. });
  2421. n("#stopBlocking").click(function() {
  2422. c(!0)
  2423. });
  2424. n("#extendBlock").click(function() {
  2425. c(!1)
  2426. });
  2427. $id("blockUrlForm").validate(formValidateOptions)
  2428. }, e
  2429. }
  2430. n.blockUrlsController = function(n) {
  2431. return new t(n)
  2432. }
  2433. }(jQuery),
  2434. function(n) {
  2435. function t() {
  2436. function si() {
  2437. var r, i, u, f;
  2438. if (i = htmlDecodeJQuery(n(t).attr("url")), d(), !n(s).valid()) {
  2439. n(l).addClass("error");
  2440. n(l).removeClass("valid");
  2441. return
  2442. }
  2443. i && (showActivityIndicator(!0), f = n(l).val(), r = at(i, f), u = [r], g(u))
  2444. }
  2445.  
  2446. function lt(n) {
  2447. var t = "",
  2448. i = n,
  2449. r = "https://",
  2450. u = "http://";
  2451. return n.indexOf(r) == 0 ? (i = n.substring(r.length), t = r) : n.indexOf(u) == 0 && (i = n.substring(u.length), t = u), {
  2452. Protocol: t,
  2453. Rest: i
  2454. }
  2455. }
  2456.  
  2457. function at(n, t) {
  2458. var i = lt(n),
  2459. r = lt(t);
  2460. return r.Rest.indexOf(i.Rest) == 0 ? n + r.Rest.substring(i.Rest.length) : n + t
  2461. }
  2462.  
  2463. function d() {
  2464. n(u).each(function() {
  2465. var f, i, t, r, u;
  2466. t = n(this);
  2467. t.parent().parent().find("div.validationErrorPlaceholder>label").remove();
  2468. r = t.closest(".socialSiteGroup");
  2469. u = r.find(".socialPageHiddenUrl");
  2470. u.removeClass("error");
  2471. t.removeClass("error");
  2472. i = htmlDecodeJQuery(r.find(".socialSiteUrl").attr("url"));
  2473. i && (f = i + t.val(), u.val(f))
  2474. })
  2475. }
  2476.  
  2477. function hi() {
  2478. var t;
  2479. d();
  2480. n(p).valid() ? (t = [], n(st + " tr").each(function() {
  2481. var r, i;
  2482. i = n(this).find(u).val();
  2483. i && (r = htmlDecodeJQuery(n(this).find("td > span").attr("url")), ut !== r && (i = at(r, i)), t.push(i))
  2484. }), t.length > 0 && g(t)) : n(".socialPageHiddenUrl.error").each(function() {
  2485. var t = n(this);
  2486. t.closest(".socialSiteGroup").find(u).addClass("error");
  2487. t.closest(".socialSiteGroup").find(u).addClass("valid")
  2488. })
  2489. }
  2490.  
  2491. function vt() {
  2492. n(s).length > 0 ? si() : hi()
  2493. }
  2494.  
  2495. function yt() {
  2496. var t = [];
  2497. return n.each(getCheckedItemsInTable("url"), function(n, i) {
  2498. t.push(htmlDecodeJQuery(i))
  2499. }), t
  2500. }
  2501.  
  2502. function ci() {
  2503. g(yt())
  2504. }
  2505.  
  2506. function g(n) {
  2507. var t = {
  2508. connectedUrls: JSON.stringify(n)
  2509. };
  2510. startPostRequestWithJson(t, tt, vi, pt, h)
  2511. }
  2512.  
  2513. function w(t, i, r) {
  2514. var u = {
  2515. urls: r,
  2516. startDate: t,
  2517. endDate: i
  2518. };
  2519. n.ajax({
  2520. url: ot,
  2521. data: u,
  2522. type: "GET",
  2523. success: li,
  2524. error: reportError,
  2525. traditional: !0
  2526. })
  2527. }
  2528.  
  2529. function li(t) {
  2530. var i;
  2531. i = n(t);
  2532. i.find(" tr").each(function() {
  2533. var i, r, t;
  2534. i = n(this);
  2535. t = nt(htmlDecodeJQuery(i.attr("url")));
  2536. 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")))
  2537. });
  2538. showSparklines();
  2539. ai()
  2540. }
  2541.  
  2542. function ai() {
  2543. n(i + " tr").each(function() {
  2544. var t = n(this);
  2545. t.find(f + "[verified='1']").length > 0 && t.hover(function() {
  2546. var t = n(this);
  2547. t.css("background-color", "#efefef");
  2548. t.css("cursor", "pointer")
  2549. }, function() {
  2550. var t = n(this);
  2551. t.css("background-color", "#ffffff");
  2552. t.css("cursor", "default")
  2553. });
  2554. n(this).find("td:gt(0)").click(function() {
  2555. var t = n(this),
  2556. i;
  2557. 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))
  2558. })
  2559. })
  2560. }
  2561.  
  2562. function vi(r) {
  2563. var u, e, f;
  2564. if (hideActivityIndicator(), unsetModalActivityIndicator(), f = [], r)
  2565. for (e = r.length, u = 0; u < e; u++) r[u].RequestId || f.push(r[u].Url);
  2566. bt(r);
  2567. dt();
  2568. f.length > 0 && w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val(), f);
  2569. n(t).append("<div class='blink-icon-selectdrop'/>");
  2570. b(htmlDecodeJQuery(n(t).attr("url")));
  2571. unCheckAllCheckBoxes("#toggleAll", i);
  2572. k()
  2573. }
  2574.  
  2575. function pt(i) {
  2576. hideActivityIndicator();
  2577. unsetModalActivityIndicator();
  2578. reportError(i);
  2579. b(htmlDecodeJQuery(n(t).attr("url")))
  2580. }
  2581.  
  2582. function wt(n, t, i) {
  2583. c[t] || (c[t] = 0);
  2584. var r = {
  2585. requestId: n,
  2586. socialUrl: t,
  2587. lastCall: i
  2588. };
  2589. startGetRequestWithJson(r, ct, function(i) {
  2590. yi(i, n, t)
  2591. }, pt)
  2592. }
  2593.  
  2594. function yi(t, i, r) {
  2595. t ? (bt(t), w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val(), [r]), k()) : c[r]++ < 10 && window.setTimeout(function() {
  2596. wt(i, r, c[r] === 10)
  2597. }, 3e3)
  2598. }
  2599.  
  2600. function bt(t) {
  2601. 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/>", {
  2602. type: "checkbox",
  2603. url: h
  2604. })).append("<label/>")).append(n("<td>").append(n("<span>", {
  2605. "class": "addSocialSiteIdColumn",
  2606. url: h,
  2607. "data-isApp": t[e].IsConnectedApp,
  2608. verified: t[e].IsVerified ? 1 : 0
  2609. }))).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()
  2610. }
  2611.  
  2612. function pi() {
  2613. var n = yt();
  2614. startPostRequestWithJson({
  2615. connectedUrls: JSON.stringify(n)
  2616. }, rt, wi, bi, h)
  2617. }
  2618.  
  2619. function kt() {
  2620. n("table.grid div.info-pop-up a").addClass("connected-reason-url url-text")
  2621. }
  2622.  
  2623. function wi(i) {
  2624. hideActivityIndicator();
  2625. unsetModalActivityIndicator();
  2626. ki(i);
  2627. dt();
  2628. n("tr>td>input[type='checkbox']").each(function() {
  2629. var t = n(this).parent();
  2630. t.hasClass("width20") || t.addClass("width20")
  2631. });
  2632. n(t).append("<div class='blink-icon-selectdrop'/>");
  2633. unCheckAllCheckBoxes("#toggleAll");
  2634. k()
  2635. }
  2636.  
  2637. function bi(n) {
  2638. hideActivityIndicator();
  2639. unsetModalActivityIndicator();
  2640. reportError(n)
  2641. }
  2642.  
  2643. function ki(t) {
  2644. n.each(t, function(t, i) {
  2645. n(nt(i)).remove()
  2646. });
  2647. n(i + " table").trigger("update")
  2648. }
  2649.  
  2650. function nt(t) {
  2651. var i = [f, "[url='", htmlEncodeJQuery(t), "']'"];
  2652. return n(i.join("")).parent().parent()
  2653. }
  2654.  
  2655. function dt() {
  2656. n("div.socialSiteGroup input[type='text']").each(function() {
  2657. n(this).val("")
  2658. });
  2659. n("#socialSiteStartupTable input[type='text']").each(function() {
  2660. n(this).val("")
  2661. });
  2662. n(t).text(it);
  2663. n(t).attr("url", "")
  2664. }
  2665.  
  2666. function di() {
  2667. n(u).keyup(new onEnterPressExecute(function() {
  2668. n(this).blur();
  2669. n(o).attr("disabled") || vt()
  2670. }).eventHandler)
  2671. }
  2672.  
  2673. function gt(i) {
  2674. var r;
  2675. r = htmlDecodeJQuery(n(i).attr("url"));
  2676. n(t).text(n(i).text());
  2677. n(t).attr("url", htmlEncodeJQuery(r));
  2678. n(e).hide();
  2679. n(t).append(n('<div class="blink-icon-selectdrop"/>'));
  2680. n(t).addClass("url-text");
  2681. b(r)
  2682. }
  2683.  
  2684. function b(t) {
  2685. var i = "";
  2686. n(u).each(function() {
  2687. i += n(this).val()
  2688. });
  2689. h === p && (t = "a");
  2690. t && i && !ht ? n(o).removeAttr("disabled") : n(o).attr("disabled", "disabled")
  2691. }
  2692.  
  2693. function ni() {
  2694. n(f + "[verified='0']").each(function() {
  2695. n(this).parent().next().next().attr("colspan", "5")
  2696. })
  2697. }
  2698.  
  2699. function k() {
  2700. var t = n("span.addSocialSiteIdColumn[data-isapp=1][verified=1]", i + " table").length > 0;
  2701. t ? n("div#appLinkingLink").show() : n("div#appLinkingLink").hide()
  2702. }
  2703.  
  2704. function gi(g, nt, lt, at, yt, pt, wt, bt, dt, si, hi, li, ai, vi, yi) {
  2705. s = "#socialSiteForm";
  2706. o = "#submitSocialSite";
  2707. v = "#removeConnectedSite";
  2708. a = "#verifyNowConnectedSite";
  2709. l = "#inputSocialSite";
  2710. ri = "#socialSiteTextBoxContainer";
  2711. ii = "#socialSiteDropDown";
  2712. i = "#socialSitesList";
  2713. ut = "custom";
  2714. t = "div.socialSiteSelected";
  2715. e = "div.socialSiteDropList";
  2716. y = "div.socialSiteDropElement";
  2717. p = "#socialSiteFormStartup";
  2718. st = "#socialSiteStartupTable";
  2719. u = ".socialSiteExtensionInput";
  2720. f = "span.addSocialSiteIdColumn";
  2721. ti = g;
  2722. tt = nt;
  2723. rt = lt;
  2724. ot = yt;
  2725. ft = at;
  2726. ct = pt;
  2727. fi = wt;
  2728. et = bt;
  2729. ui = dt;
  2730. oi = hi;
  2731. ei = si;
  2732. r = ai;
  2733. it = li;
  2734. h = n(s).length > 0 ? s : p;
  2735. ht = yi === "True";
  2736. c = {};
  2737. w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val());
  2738. ni();
  2739. n(v).click(pi);
  2740. n(o).click(vt);
  2741. n(a).click(ci);
  2742. n("#wmbody").css("min-width", "1100px");
  2743. n(t).click(function(t) {
  2744. t.stopPropagation();
  2745. n(e).is(":visible") ? n(e).hide() : n(e).show()
  2746. });
  2747. n(y).click(function(n) {
  2748. n.stopPropagation();
  2749. gt(this)
  2750. });
  2751. n(t).keyup(function(t) {
  2752. t.which == 40 && (n(e).show(), n(y)[0].focus())
  2753. });
  2754. n(y).keyup(function(t) {
  2755. t.which == 40 && n("div.socialSiteDropElement:focus").next().focus();
  2756. t.which == 38 && n("div.socialSiteDropElement:focus").prev().focus();
  2757. t.which == 13 && gt(this)
  2758. });
  2759. formValidateOptions.ignore = "";
  2760. formValidateOptions.messages = [];
  2761. formValidateOptions.messages.inputSocialSiteHidden = vi;
  2762. n(".socialPageExtension").each(function(n) {
  2763. formValidateOptions.messages["inputSocialSiteHidden" + n] = vi
  2764. });
  2765. n(h).validate(formValidateOptions);
  2766. n(o).attr("disabled", "disabled");
  2767. n(i + " table :checkbox").change(setupGridCheckButtonEnabler(i + " table", v));
  2768. n(i + " table :checkbox").change(setupGridCheckButtonEnabler(i + " table", a));
  2769. di();
  2770. n(document).click(function() {
  2771. n(e).hide()
  2772. });
  2773. n(f).each(function() {
  2774. var t = n(this);
  2775. t.attr("verified") == "0" && t.parent().parent().find("td:gt(3)").remove()
  2776. });
  2777. n(u).focus(function() {
  2778. d();
  2779. n(u).addClass("valid");
  2780. n("input.error").removeClass("error");
  2781. n("div.validationErrorPlaceholder").children().remove();
  2782. return
  2783. });
  2784. n(u).keyup(function() {
  2785. var i = htmlDecodeJQuery(n(t).attr("url"));
  2786. b(i)
  2787. });
  2788. n("#periodSelectorContainer").bind("dateChanged", function() {
  2789. showActivityIndicator(!1);
  2790. w(n("#periodSelectorFrom").val(), n("#periodSelectorTo").val())
  2791. });
  2792. kt();
  2793. n("tr.connectedTableHeader>th:eq(0)").addClass("connectedCheckBoxHeader");
  2794. n("tr.connectedTableHeader>th:eq(1)").addClass("width0");
  2795. n("tr.connectedTableHeader>th:eq(2)").addClass("connectedUrlHeader");
  2796. n("tr.connectedTableHeader>th:eq(3)").addClass("connectedRightAlignColumnHeader connectedStatHeader");
  2797. n("tr.connectedTableHeader>th:eq(4)").addClass("connectedCenterAlignColumnHeader connectedStatHeader");
  2798. n("tr.connectedTableHeader>th:eq(5)").addClass("connectedRightAlignColumnHeader connectedStatHeader");
  2799. n("tr.connectedTableHeader>th:eq(6)").addClass("connectedCenterAlignColumnHeader connectedStatHeader");
  2800. k()
  2801. }
  2802. 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;
  2803. return {
  2804. initialize: gi
  2805. }
  2806. }
  2807. n.socialSiteController = function() {
  2808. return new t
  2809. }
  2810. }(jQuery),
  2811. function(n) {
  2812. function t(t) {
  2813. function u() {
  2814. f()
  2815. }
  2816.  
  2817. function f() {
  2818. n("#saveApps").click(o);
  2819. e()
  2820. }
  2821.  
  2822. function e() {
  2823. n("#connectedAppList table.wmtable :checkbox").change(r)
  2824. }
  2825.  
  2826. function o() {
  2827. var t, i;
  2828. showActivityIndicator(!0);
  2829. t = [];
  2830. n("tr.row-selected", "#connectedAppList table.wmtable tbody").each(function() {
  2831. var i = n(this).find("span[data-field=appId]").text(),
  2832. r = n(this).find("span[data-field=appType]").attr("data-appType"),
  2833. u = n(this).find("span[data-field=isDeepLaunchSupported] input").attr("checked") == "checked",
  2834. f = n(this).find("span[data-field=linked] input").attr("checked") == "checked",
  2835. e = {
  2836. Site: url,
  2837. AppId: i,
  2838. AppType: r,
  2839. IsBlocked: !f,
  2840. IsDeepLaunchSupported: u
  2841. };
  2842. t.push(e)
  2843. });
  2844. i = {
  2845. viewModelApps: JSON.stringify(t)
  2846. };
  2847. s(i, h, unsetModalAndReportErrorHandler)
  2848. }
  2849.  
  2850. function s(n, i, r) {
  2851. startPostRequestWithJson(n, t.UpdateUrl, i, r, "#connectedAppsForm")
  2852. }
  2853.  
  2854. function h(t) {
  2855. hideActivityIndicator();
  2856. unsetModalActivityIndicator();
  2857. n.each(t, function(t, i) {
  2858. var r = n('tr:contains("' + i.AppId + '")');
  2859. r.find("span[data-field=isDeepLaunchSupported] input").attr("value", i.IsDeepLaunchSupported);
  2860. r.find("span[data-field=linked] input").attr("value", !i.IsBlocked);
  2861. r.find("span[data-field=lastModified]").text(i.LastModifiedFormatted)
  2862. });
  2863. n("#connectedAppList table.wmtable").trigger("update")
  2864. }
  2865. var i = {},
  2866. r = setupGridCheckboxChangeEnalber("#connectedAppList table.wmtable", "#saveApps");
  2867. return i.initialize = u, i
  2868. }
  2869. n.connectedAppsController = function(n) {
  2870. return new t(n)
  2871. }
  2872. }(jQuery),
  2873. function(n) {
  2874. n.fn.crawlControl = function(t) {
  2875. function y(n) {
  2876. r();
  2877. reportError(n)
  2878. }
  2879. for (var o, u = new Date, f = (24 + getLocalTimezoneOffset(u)) % 24, s = n(".crawl-control-chart > div:first-child"), i = t.crawlRate, r = function() {
  2880. window.readOnlyMode || n("#save").attr("disabled", !1)
  2881. }, a = function() {
  2882. n("#preset").val() != "" && n("#preset").val("");
  2883. r()
  2884. }, v = function(n) {
  2885. if (n != null) {
  2886. i = [];
  2887. for (var t = 0; t < 24; ++t) i[t] = n[(24 + t - f) % 24][1];
  2888. r()
  2889. }
  2890. }, h = function(i) {
  2891. for (var o, e, c, l, y, h = [], r = 0; r < 24; ++r) h.push([parseInt(r), i[(r + f) % 24]]);
  2892. for (o = [], r = 0; r < 11; ++r) o[r] = [r, ""];
  2893. for (e = [], r = 0; r <= 24; ++r) c = r % (t.has24Hours ? 24 : 12), e[r] = [r, c.toString()];
  2894. !t.has24Hours && t.AMDesignator.length > 0 && (e[0] = [0, '<span class="nowrap crawl-control-ampm">12&nbsp;' + t.AMDesignator + "<\/span>"], e[24] = [24, '<span class="nowrap crawl-control-ampm">12&nbsp;' + t.AMDesignator + "<\/span>"]);
  2895. !t.has24Hours && t.PMDesignator.length > 0 && (e[12] = [12, '<span class="nowrap crawl-control-ampm">12&nbsp;' + t.PMDesignator + "<\/span>"]);
  2896. l = function() {
  2897. var n = [];
  2898. return n.push({
  2899. xaxis: {
  2900. from: u.getHours(),
  2901. to: u.getHours() + 1
  2902. }
  2903. }), n
  2904. };
  2905. y = {
  2906. colors: [window.readOnlyMode ? "#adadad" : "#71ccee"],
  2907. xaxis: {
  2908. mode: "number",
  2909. min: 0,
  2910. max: 24,
  2911. minTickSize: 1,
  2912. tickSize: 1,
  2913. tickFormatter: function(n) {
  2914. return formatNumber(n)
  2915. },
  2916. ticks: e
  2917. },
  2918. yaxis: {
  2919. mode: "number",
  2920. min: 0,
  2921. max: 10,
  2922. minTickSize: 1,
  2923. tickSize: 1,
  2924. tickFormatter: function(n) {
  2925. return formatNumber(n)
  2926. },
  2927. ticks: o
  2928. },
  2929. series: {
  2930. lines: {
  2931. show: !1,
  2932. fill: !1
  2933. },
  2934. bars: {
  2935. show: !0,
  2936. lineWidth: 0,
  2937. barWidth: 1,
  2938. fill: !0,
  2939. fillColor: window.readOnlyMode ? "#adadad" : "#00adee",
  2940. align: "left"
  2941. }
  2942. },
  2943. grid: {
  2944. tickColor: "#ffffff",
  2945. backgroundColor: "#e6e6e6",
  2946. borderWidth: 0,
  2947. markings: l,
  2948. markingsColor: "rgba(100,100,100,0.2)",
  2949. aboveData: !0
  2950. },
  2951. webmastercrawldelay: {
  2952. enabled: !window.readOnlyMode && !t.widget,
  2953. onChange: v,
  2954. onChangeBegin: a,
  2955. highlightRadius: 2,
  2956. autoHighlight: !1
  2957. }
  2958. };
  2959. n.plot(s, [h], y)
  2960. }, c = function() {
  2961. n("#save").attr("disabled", "disabled");
  2962. var r = {
  2963. Site: url,
  2964. CrawlBoostAvailable: t.boostAvailable,
  2965. CrawlBoostEnabled: !!n("#crawlboost").is(":checked"),
  2966. CrawlRate: i
  2967. };
  2968. startPostRequestWithJson({
  2969. settings: JSON.stringify(r)
  2970. }, t.SaveUrl, function() {}, y, "#addParamForm")
  2971. }, p = function() {
  2972. var u, r, t;
  2973. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
  2974. 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);
  2975. if (i = r, !u) {
  2976. n("#forceSaveDialog").jqm({
  2977. overlay: 10,
  2978. modal: !0
  2979. }).jqmShow();
  2980. return
  2981. }
  2982. c();
  2983. n("#save").attr("disabled", "disabled")
  2984. }
  2985. }, w = function() {
  2986. var e, u, t;
  2987. if (n(this).val() != "") {
  2988. for (e = n(this).val().split(","), u = [], t = 0; t < 24; ++t) u[t] = parseInt(e[(24 + t - f) % 24]);
  2989. i = u;
  2990. h(u);
  2991. r()
  2992. }
  2993. }, l = [], e = 0; e < 24; ++e) l[e] = parseInt(t.crawlRate[(24 + e + f) % 24]);
  2994. o = l.join(",");
  2995. n("#preset").find("option").each(function() {
  2996. n(this).val() == o && n("#preset").val(o)
  2997. });
  2998. n("#localtime").text(u.toLocaleTimeString());
  2999. h(t.crawlRate);
  3000. n("#preset").change(w);
  3001. n("#crawlboost").change("change", r);
  3002. n("#save").click(p);
  3003. n("#forcesave").click(function() {
  3004. n("#forceSaveDialog").jqmHide();
  3005. c()
  3006. });
  3007. t.widget && s.click(function() {
  3008. window.location = t.crawlControlUrl
  3009. })
  3010. }
  3011. }(jQuery),
  3012. function(n) {
  3013. function t(t) {
  3014. function h(n) {
  3015. c();
  3016. i.All = n
  3017. }
  3018.  
  3019. function c() {
  3020. n("#submitDeepLinkBlock").click(l);
  3021. n("#extendBlock").click(a);
  3022. n("#removeBlock").click(v);
  3023. n("#blockDeepLinkForm").validate(formValidateOptions);
  3024. r()
  3025. }
  3026.  
  3027. function r() {
  3028. n("table.wmtable :checkbox").change(o);
  3029. n("table.wmtable :checkbox").change(s)
  3030. }
  3031.  
  3032. function l() {
  3033. var u, t, e, o, r, s;
  3034. fixPlaceholdersBeforeInFormSubmit(n("#blockDeepLinkForm"));
  3035. n("#blockDeepLinkForm").valid() && (u = n("#inputDeepLink").val(), t = n("#inputParentLink").val(), e = n("#dropdownMarket").val(), t || (t = i.All), o = {
  3036. DeepLinkUrl: u,
  3037. SearchUrl: t,
  3038. Market: e,
  3039. ExpiryDate: new Date
  3040. }, r = [], r.push(o), s = {
  3041. deepLinks: JSON.stringify(r)
  3042. }, f(s, p))
  3043. }
  3044.  
  3045. function a() {
  3046. var n = u(),
  3047. t = {
  3048. deepLinks: JSON.stringify(n)
  3049. };
  3050. f(t, w)
  3051. }
  3052.  
  3053. function v() {
  3054. var n = u(),
  3055. t = {
  3056. deepLinks: JSON.stringify(n)
  3057. };
  3058. y(t, b)
  3059. }
  3060.  
  3061. function u() {
  3062. var t = [];
  3063. return n("table.wmtable :checkbox:checked").each(function() {
  3064. var i = {
  3065. DeepLinkUrl: n(this).attr("dl"),
  3066. SearchUrl: n(this).attr("bu"),
  3067. Market: n(this).attr("bmc")
  3068. };
  3069. t.push(i)
  3070. }), t
  3071. }
  3072.  
  3073. function f(n, i, r) {
  3074. startPostRequestWithJson(n, t.AddUrl, i, r, "#blockDeepLinkForm")
  3075. }
  3076.  
  3077. function y(n, i, r) {
  3078. startPostRequestWithJson(n, t.RemoveUrl, i, r, "#blockDeepLinkForm")
  3079. }
  3080.  
  3081. function p(t) {
  3082. var u, f;
  3083. hideActivityIndicator();
  3084. unsetModalActivityIndicator();
  3085. 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>", {
  3086. type: "checkbox",
  3087. dl: t[0].DeepLinkUrl,
  3088. bu: t[0].SearchUrl,
  3089. bmc: t[0].Market
  3090. })).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"))
  3091. }
  3092.  
  3093. function w(t) {
  3094. var i, f, u;
  3095. 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);
  3096. r();
  3097. unCheckAllCheckBoxes();
  3098. n("#deepLinkBlockList table.wmtable").trigger("update")
  3099. }
  3100.  
  3101. function b(t) {
  3102. var i, u, f;
  3103. 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();
  3104. r();
  3105. unCheckAllCheckBoxes();
  3106. n("#deepLinkBlockList table.wmtable").trigger("update")
  3107. }
  3108.  
  3109. function e(t, i, r) {
  3110. var u = ["table.wmtable :checkbox[dl='", t, "'][bu='", i, "'][bmc='", r, "']"];
  3111. return n(u.join("")).parent().parent()
  3112. }
  3113.  
  3114. function k() {
  3115. var t = n("#inputDeepLink"),
  3116. i = n("#inputParentLink");
  3117. t.val("");
  3118. i.val("");
  3119. n("#dropdownMarket").val(0);
  3120. hasPlaceholderSupport() || (t.focus(), t.blur(), i.focus(), i.blur())
  3121. }
  3122. var i = {
  3123. All: "all"
  3124. },
  3125. o = setupGridCheckButtonEnabler("table.wmtable", "#extendBlock"),
  3126. s = setupGridCheckButtonEnabler("table.wmtable", "#removeBlock");
  3127. return i.initialize = h, i
  3128. }
  3129. n.blockDeepLinksController = function(n) {
  3130. return new t(n)
  3131. }
  3132. }(jQuery),
  3133. function(n) {
  3134. n.fn.disavowSelector = function(t) {
  3135. function i(n) {
  3136. hideActivityIndicator();
  3137. unsetModalActivityIndicator();
  3138. reportError(n)
  3139. }
  3140.  
  3141. function o(t) {
  3142. var i = {};
  3143. i[t.DisavowedUrl] = !0;
  3144. n("table.wmtable :checkbox").each(function() {
  3145. i[n(this).attr("qp")] && t.EntityType == n(this).attr("et") && n(this).parent().parent().remove()
  3146. })
  3147. }
  3148.  
  3149. function s(t) {
  3150. var i, e;
  3151. hideActivityIndicator();
  3152. unsetModalActivityIndicator();
  3153. o(t);
  3154. i = "";
  3155. t.EntityType == r ? i = wr.G_Page : t.EntityType == u ? i = wr.G_Directory : t.EntityType == f && (i = wr.G_Domain);
  3156. e = "";
  3157. 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);
  3158. n("#urlDisavowList tbody").prepend(e);
  3159. n("#inputDisavowUrl").val("");
  3160. triggerCheckboxChange();
  3161. n("#urlDisavowList table.grid").trigger("update")
  3162. }
  3163.  
  3164. function h(n, r) {
  3165. showActivityIndicator(!0);
  3166. startPostRequestWithJson({
  3167. disavowUrl: n,
  3168. entityType: r
  3169. }, t.AddUrl, s, i, "#disavowUrlForm")
  3170. }
  3171.  
  3172. function c(t, i) {
  3173. var u, f, r;
  3174. for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, f = {}, r = 0; r < t.length; ++r) f[t[r]] = !0, u[t[r]] = i[r];
  3175. n("table.wmtable :checkbox").each(function() {
  3176. f[n(this).attr("qp")] && u[n(this).attr("qp")] == n(this).attr("et") && n(this).parent().parent().remove()
  3177. });
  3178. triggerCheckboxChange();
  3179. n("#urlDisavowList table.grid").trigger("update")
  3180. }
  3181.  
  3182. function l(n, r) {
  3183. showActivityIndicator(!0);
  3184. startPostRequestWithJson({
  3185. urlsToProcess: n,
  3186. entitiesToProcess: r
  3187. }, t.RemoveUrl, function() {
  3188. c(n, r)
  3189. }, i, "#disavowUrlForm", null, {
  3190. traditional: !0
  3191. })
  3192. }
  3193.  
  3194. function a() {
  3195. n("#urlDisavowList table.wmtable :checkbox").live("change", e);
  3196. n("#disavowUrlButton").click(function() {
  3197. if ($id("disavowUrlForm").valid()) {
  3198. var t = n("#entitySelected").val(),
  3199. i = n("#inputDisavowUrl").val();
  3200. h(i, t)
  3201. }
  3202. });
  3203. n("#stopDisavowing").click(function() {
  3204. var t = [],
  3205. i = [];
  3206. n("table.wmtable :checked").each(function() {
  3207. var r = n(this),
  3208. u = r.attr("qp"),
  3209. f = r.attr("et");
  3210. t.push(u);
  3211. i.push(f)
  3212. });
  3213. t.length > 0 && i.length > 0 && l(t, i)
  3214. });
  3215. $id("disavowUrlForm").validate(formValidateOptions);
  3216. clickButtonOnEnter("#disavowUrlButton", "#inputDisavowUrl")
  3217. }
  3218. var r = 0,
  3219. u = 1,
  3220. f = 2,
  3221. e = setupGridCheckButtonEnabler("#urlDisavowList table.wmtable", "#stopDisavowing");
  3222. a()
  3223. }
  3224. }(jQuery),
  3225. function(n) {
  3226. var t = function() {
  3227. function n(n) {
  3228. this.onGridCheck = setupGridCheckButtonEnabler("#paramList table.wmtable", "#removeParam");
  3229. this.options = n
  3230. }
  3231. return n.prototype.Run = function() {
  3232. var n = this,
  3233. t = function(t) {
  3234. return n.addParam(t)
  3235. },
  3236. i = function(t) {
  3237. return n.removeParams(t)
  3238. },
  3239. r = function(t) {
  3240. return n.urlTypeChange(t)
  3241. };
  3242. $("#addParam").click(function() {
  3243. t($(this))
  3244. });
  3245. $("#removeParam").click(function() {
  3246. i($(this))
  3247. });
  3248. $("#addParamForm").validate(formValidateOptions);
  3249. $(document).on("change", "#paramList table.wmtable :checkbox", this.onGridCheck);
  3250. clickButtonOnEnter("#addParam", ["#url"]);
  3251. $("#urltype").change(function() {
  3252. r($(this))
  3253. })
  3254. }, n.prototype.enableControls = function() {
  3255. $("#country").prop("disabled", !1);
  3256. $("#url").prop("disabled", !1);
  3257. $("#urltype").prop("disabled", !1);
  3258. $("#addParam").prop("disabled", !1)
  3259. }, n.prototype.disableControls = function() {
  3260. $("#country").prop("disabled", !0);
  3261. $("#url").prop("disabled", !0);
  3262. $("#urltype").prop("disabled", !0);
  3263. $("#addParam").prop("disabled", !0)
  3264. }, n.prototype.addParam = function(n) {
  3265. var t = this,
  3266. i;
  3267. n.attr("disabled") == "disabled" || readOnlyMode || $("#addParamForm").valid() && (i = {
  3268. Url: $("#url").val(),
  3269. Type: $("#urltype").val(),
  3270. Region: $("#country").val()
  3271. }, showActivityIndicator(!0), this.disableControls(), startPostRequestWithJson({
  3272. settings: JSON.stringify(i)
  3273. }, this.options.AddUrl, function(n) {
  3274. return t.addParamSuccess(n)
  3275. }, function(n) {
  3276. return t.addParamFailure(n)
  3277. }, "#addParamForm"))
  3278. }, n.prototype.addParamSuccess = function(n) {
  3279. hideActivityIndicator();
  3280. unsetModalActivityIndicator();
  3281. this.enableControls();
  3282. $("#url").val("");
  3283. $("#url").prop("readonly", !1);
  3284. $("#paramList table.wmtable input[type=checkbox]").each(function() {
  3285. $(this).attr("url") == n.Url && $(this).attr("urltype") == n.Type && $(this).parent().parent().remove()
  3286. });
  3287. var t = $("<tr/>");
  3288. t.append($("<td/>").append($("<input>", {
  3289. type: "checkbox",
  3290. url: n.Url,
  3291. urltype: n.Type
  3292. })).append($("<label/>"))).append($("<td/>").append($("<span>", {
  3293. "class": "url-text"
  3294. }).text(n.Url))).append($("<td/>").text(n.TypeFormatted)).append($("<td/>").text(n.Region)).append($("<td/>").text(n.DateFormatted));
  3295. $("#paramList table.wmtable tbody").prepend(t);
  3296. $("#paramList table.wmtable").trigger("update")
  3297. }, n.prototype.addParamFailure = function(n) {
  3298. hideActivityIndicator();
  3299. unsetModalActivityIndicator();
  3300. this.enableControls();
  3301. reportError(n)
  3302. }, n.prototype.removeParams = function() {
  3303. var t = this,
  3304. n = [];
  3305. $("#paramList table.wmtable :checked").each(function() {
  3306. var t = $(this),
  3307. i = {
  3308. Url: t.attr("url"),
  3309. Type: t.attr("urltype")
  3310. };
  3311. n.push(i)
  3312. });
  3313. n.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
  3314. settings: JSON.stringify(n)
  3315. }, this.options.RemoveUrl, function(i) {
  3316. return t.removeParamsSuccess(i, n)
  3317. }, function(n) {
  3318. return t.removeParamsFailure(n)
  3319. }, "#addParamForm"))
  3320. }, n.prototype.removeParamsSuccess = function(n, t) {
  3321. var r, i;
  3322. for (hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i].Url + "|" + t[i].Type] = !0;
  3323. $("#paramList table.wmtable input[type=checkbox]").each(function() {
  3324. var n = $(this).attr("url") + "|" + $(this).attr("urltype");
  3325. r[n] && $(this).parent().parent().remove()
  3326. });
  3327. this.onGridCheck();
  3328. $("#paramList table.wmtable").trigger("update")
  3329. }, n.prototype.removeParamsFailure = function(n) {
  3330. hideActivityIndicator();
  3331. unsetModalActivityIndicator();
  3332. reportError(n)
  3333. }, n.prototype.urlTypeChange = function(n) {
  3334. 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)
  3335. }, n
  3336. }();
  3337. n.GeoTargeting = t
  3338. }(Configure || (Configure = {})),
  3339. function(n) {
  3340. function t(t) {
  3341. function h(t) {
  3342. hideActivityIndicator();
  3343. unsetModalActivityIndicator();
  3344. i && ($id(t.Param).remove(), i = !1);
  3345. var r = "";
  3346. 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);
  3347. n("#qpList tbody").prepend(r);
  3348. n("#inputQueryParam").val("");
  3349. n("#qpList table.grid").trigger("update");
  3350. triggerCheckboxChange();
  3351. n("table.wmtable :checkbox").change(u)
  3352. }
  3353.  
  3354. function c(n) {
  3355. i = !1;
  3356. o(n)
  3357. }
  3358.  
  3359. function e(i) {
  3360. if (!(i.length < 1)) {
  3361. if (i.length > f) {
  3362. reportError({
  3363. Message: n.validator.format(wr.QueryParam_CharLimit, f)
  3364. });
  3365. return
  3366. }
  3367. showActivityIndicator(!0);
  3368. startPostRequestWithJson({
  3369. queryParam: i
  3370. }, t.AddUrl, h, c, "#ignoreParaForm")
  3371. }
  3372. }
  3373.  
  3374. function l(t, i) {
  3375. var u, r;
  3376. for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, r = 0; r < i.length; ++r) u[i[r]] = !0;
  3377. n("table.wmtable :checkbox").each(function() {
  3378. u[n(this).attr("qp")] && n(this).parent().parent().remove()
  3379. });
  3380. triggerCheckboxChange();
  3381. n("#qpList table.grid").trigger("update")
  3382. }
  3383.  
  3384. function o(n) {
  3385. hideActivityIndicator();
  3386. unsetModalActivityIndicator();
  3387. reportError(n)
  3388. }
  3389.  
  3390. function a(n) {
  3391. o(n)
  3392. }
  3393.  
  3394. function v(n) {
  3395. showActivityIndicator(!0);
  3396. startPostRequestWithJson({
  3397. queryParameters: n
  3398. }, t.RemoveUrl, function(t) {
  3399. l(t, n)
  3400. }, a, "#ignoreParaForm", null, {
  3401. traditional: !0
  3402. })
  3403. }
  3404.  
  3405. function s(n) {
  3406. i = !0;
  3407. e(n)
  3408. }
  3409.  
  3410. function y(t) {
  3411. jQuery.browser.msie && (t.cancelBubble = !0);
  3412. t.stopPropagation();
  3413. n("#moreLink").hasClass("opened") ? (n("#spanForDisabledQpHide").hide(), n("#moreLink").removeClass("opened")) : (n("#spanForDisabledQpHide").show(100), n("#moreLink").addClass("opened"))
  3414. }
  3415. var r = {},
  3416. i = !1,
  3417. u = setupGridCheckButtonEnabler("table.wmtable", "#removeParam"),
  3418. f = 100;
  3419. return r.go = function() {
  3420. n("table.wmtable :checkbox").change(u);
  3421. n("#more").click(y);
  3422. n(document).click(function() {
  3423. n("#spanForDisabledQpHide").hide();
  3424. n("#moreLink").removeClass("opened")
  3425. });
  3426. n("#submitQueryParam").click(function() {
  3427. if ($id("ignoreParaForm").valid()) {
  3428. var t = n("#inputQueryParam").val();
  3429. e(t)
  3430. }
  3431. });
  3432. n("#spanForDisabledQp a").click(function() {
  3433. var t = n(this).attr("id");
  3434. s(t)
  3435. });
  3436. n("#spanForDisabledQpHide a").click(function() {
  3437. var t = n(this).attr("id");
  3438. s(t)
  3439. });
  3440. n("#removeParam").click(function() {
  3441. var t = [];
  3442. n("table.wmtable :checked").each(function() {
  3443. var i = n(this),
  3444. r = i.attr("qp");
  3445. t.push(r)
  3446. });
  3447. t.length > 0 && v(t)
  3448. });
  3449. clickButtonOnEnter("#submitQueryParam", "#inputQueryParam");
  3450. $id("ignoreParaForm").validate(formValidateOptions)
  3451. }, r
  3452. }
  3453. n.ignoretheseparametersController = function(n) {
  3454. return new t(n)
  3455. }
  3456. }(jQuery),
  3457. function(n) {
  3458. function t() {
  3459. function st(i, r, u, f, e, o, s, h, c, l, a, v, y, p, w) {
  3460. t.SiteUrl = i;
  3461. t.FormId = r;
  3462. t.ActionDictionary = u;
  3463. t.BlockReasons = f;
  3464. t.RefreshReasons = e;
  3465. t.RemoveDetailsSection = at;
  3466. t.SwitchFormButtons = vt;
  3467. t.PageUpdateUrl = o;
  3468. t.PageDetailsUrl = s;
  3469. t.PageRemoveUrl = h;
  3470. t.PageRefreshUrl = c;
  3471. t.PreviewRequestUrl = l;
  3472. t.PagePreviewSuccessMessage = a;
  3473. t.PagePreviewLowQualityMessage = v;
  3474. t.RefreshInProgressMessage = y.replace("{0}", "");
  3475. t.InlineDetailsControl = n.previewDetailsController();
  3476. t.InlineDetailsControl.initialize(t);
  3477. t.BlockAtMaxWarning = n.format(p, w);
  3478. t.ExpiryInDays = w;
  3479. ht()
  3480. }
  3481.  
  3482. function ht() {
  3483. n(e).click(g);
  3484. n(h).click(ct);
  3485. n(c).click(lt);
  3486. n(u + " tr").each(function() {
  3487. var u, f;
  3488. u = n(this);
  3489. f = u.find("input[type='checkbox']");
  3490. f.length == 1 && (u.addClass(l), u.find("td").each(function(u) {
  3491. u > 0 && n(this).click(f.attr(r), function(u) {
  3492. var f = n(i);
  3493. n(a).attr(r, u.data);
  3494. n(i).removeAttr("readonly");
  3495. f.val(u.data);
  3496. n(i).attr("readonly", "");
  3497. t.InlineDetailsControl.show(u)
  3498. })
  3499. }))
  3500. });
  3501. n(f).validate(formValidateOptions);
  3502. n(i).keyup(new onEnterPressExecute(function() {
  3503. n(this).blur();
  3504. g()
  3505. }).eventHandler);
  3506. o()
  3507. }
  3508.  
  3509. function o() {
  3510. n("table.wmtable :checkbox").change(et);
  3511. n("table.wmtable :checkbox").change(ot)
  3512. }
  3513.  
  3514. function g() {
  3515. if (n(t.FormId).valid()) {
  3516. var r = n(i).val();
  3517. t.InlineDetailsControl.show({
  3518. data: r
  3519. })
  3520. }
  3521. }
  3522.  
  3523. function ct() {
  3524. var n = nt(),
  3525. i;
  3526. if (n.length == 1 && n[0].Expiry === t.ExpiryInDays) {
  3527. showErrorMessage(t.BlockAtMaxWarning, wr.G_Warning);
  3528. return
  3529. }
  3530. i = {
  3531. pagePreviews: JSON.stringify(n)
  3532. };
  3533. yt(i, function(n) {
  3534. it(n, !0)
  3535. })
  3536. }
  3537.  
  3538. function lt() {
  3539. var i = nt(),
  3540. r;
  3541. n.each(i, function(n, i) {
  3542. i.Action = t.ActionDictionary[y]
  3543. });
  3544. r = {
  3545. pagePreviews: JSON.stringify(i)
  3546. };
  3547. pt(r, function(n) {
  3548. rt(n, !0)
  3549. })
  3550. }
  3551.  
  3552. function nt() {
  3553. var t = [];
  3554. return n("table.wmtable :checkbox:checked").each(function() {
  3555. var i = n(this),
  3556. u = {
  3557. Url: i.attr(r),
  3558. Expiry: i.parent().parent().find("td:eq(2)").text()
  3559. };
  3560. t.push(u)
  3561. }), t
  3562. }
  3563.  
  3564. function at() {
  3565. var i = n(t.InlineSelector).children();
  3566. i && i.length > 0 && i.remove()
  3567. }
  3568.  
  3569. function vt() {
  3570. tt(p);
  3571. tt(w);
  3572. n(i).removeAttr("readonly");
  3573. n(b).hide();
  3574. n(k).hide();
  3575. n(e).show();
  3576. n(d).hide()
  3577. }
  3578.  
  3579. function tt(t) {
  3580. for (var i = n(t)[0]; i.options.length;) i.options[0] = null;
  3581. n(i).attr("disabled")
  3582. }
  3583.  
  3584. function yt(n, i, r) {
  3585. startPostRequestWithJson(n, t.PageUpdateUrl, i, r, f)
  3586. }
  3587.  
  3588. function pt(n, i, r) {
  3589. startPostRequestWithJson(n, t.PageRemoveUrl, i, r, f)
  3590. }
  3591.  
  3592. function it(i, r) {
  3593. var f, h, e;
  3594. 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);
  3595. o();
  3596. unCheckAllCheckBoxes("#toggleAll");
  3597. r && (t.InlineDetailsControl.hideDetailsAnimation(!0), s());
  3598. n(u + " table.wmtable").trigger("update")
  3599. }
  3600.  
  3601. function rt(i, r) {
  3602. var f, e, h;
  3603. for (hideActivityIndicator(), unsetModalActivityIndicator(), e = i.length, f = 0; f < e; f++) h = ut(i[f].Url, t.ActionDictionary[v]), n(h).remove();
  3604. o();
  3605. unCheckAllCheckBoxes("#toggleAll");
  3606. n(u + " table.wmtable").trigger("update");
  3607. r && (t.InlineDetailsControl.hideDetailsAnimation(!0), s())
  3608. }
  3609.  
  3610. function ut(t, i) {
  3611. var u = n(["table.wmtable :checkbox[", r, "='", t, "'][action='", i, "']"].join(""));
  3612. return u.parent().parent()
  3613. }
  3614.  
  3615. function s() {
  3616. var t = n(i);
  3617. t.val("");
  3618. hasPlaceholderSupport() || (t.focus(), t.blur())
  3619. }
  3620. var e, h, c, u, l, r, i, a, v, y, f, p, w, b, k, d, ft;
  3621. e = "#submitPreview";
  3622. h = "#extendBlock";
  3623. c = "#removeBlock";
  3624. u = "#previewBlockList";
  3625. l = "pagePreviewRow";
  3626. r = "previewUrl";
  3627. i = "#inputPagePreviewUrl";
  3628. a = "div.pagePreviewStatus";
  3629. f = "#pagePreviewForm";
  3630. v = "block";
  3631. y = "unblock";
  3632. p = "#pagePreviewReasonDropDown";
  3633. w = "#pagePreviewActionDropDown";
  3634. b = "#submitPreviewAction";
  3635. k = "#cancelPreviewAction";
  3636. d = "label.pagePreviewDropDownField";
  3637. ft = "#pagePreviewBlockAtMax";
  3638. var t = {
  3639. SiteUrl: "",
  3640. FormId: "",
  3641. ActionDictionary: [],
  3642. BlockReasons: [],
  3643. RefreshReasons: [],
  3644. InlineSelector: "#pagePreviewDetailsInline"
  3645. },
  3646. et = setupGridCheckButtonEnabler("table.wmtable", "#extendBlock"),
  3647. ot = setupGridCheckButtonEnabler("table.wmtable", "#removeBlock");
  3648. return t.initialize = st, t.deletePreviewBlockSuccess = rt, t.extendPreviewBlockSuccess = it, t.ClearFormInput = s, t
  3649. }
  3650. n.blockPreviewController = function() {
  3651. return new t
  3652. }
  3653. }(jQuery),
  3654. function(n) {
  3655. function t() {
  3656. function yt(n) {
  3657. i.SiteUrl = n.SiteUrl;
  3658. t = n
  3659. }
  3660.  
  3661. function st(i) {
  3662. var s = i.data;
  3663. n.get(t.PageDetailsUrl + "&previewUrl=" + encodeURIComponent(s)).done(function(i) {
  3664. var a, c = n(t.InlineSelector).children();
  3665. c.length > 0 ? c.fadeOut(f, function() {
  3666. t.RemoveDetailsSection();
  3667. c = n(i);
  3668. c.css({
  3669. display: "none"
  3670. });
  3671. c.find(et).css({
  3672. height: "200px",
  3673. width: "360px"
  3674. });
  3675. c.find("div.line-item").css({
  3676. height: "211px"
  3677. });
  3678. c.find(u).removeClass("none");
  3679. n(t.InlineSelector).append(c);
  3680. c.fadeIn(f);
  3681. n(r).attr("readonly", "");
  3682. n(h).hide();
  3683. n(e).show();
  3684. n(o).show();
  3685. n(b).show();
  3686. ht();
  3687. hideActivityIndicator();
  3688. k(n(l))
  3689. }) : (c = n(i), n(t.InlineSelector).append(c), c.find(".line-item").animate({
  3690. height: "211px"
  3691. }, f), c.find("#pagePreviewImage").animate({
  3692. height: "200px",
  3693. width: "360px"
  3694. }, f, function() {
  3695. n(u).removeClass("none")
  3696. }), n(r).attr("readonly", ""), n(h).hide(), n(e).show(), n(o).show(), n(b).show(), ht(), hideActivityIndicator(), k(n(l)));
  3697. a = n(ft).attr("requestId");
  3698. a !== "00000000-0000-0000-0000-000000000000" && window.setTimeout(function() {
  3699. at(s);
  3700. d(s, a, 1, !0)
  3701. }, f + 100)
  3702. }).fail(function(n) {
  3703. showErrorMessage(JSON.parse(n.responseText).Message, wr.G_Error, !0)
  3704. })
  3705. }
  3706.  
  3707. function ht() {
  3708. i.Initialized || (n(e).click(wt), n(o).click(function() {
  3709. n(r).val("");
  3710. s(!0)
  3711. }), n(l).change(pt), i.Initialized = !0)
  3712. }
  3713.  
  3714. function s(i) {
  3715. i && t.SwitchFormButtons();
  3716. n(u).remove();
  3717. n(t.InlineSelector + " .line-item").animate({
  3718. height: "0"
  3719. }, 500);
  3720. n("#pagePreviewImage").animate({
  3721. height: "0",
  3722. width: "0"
  3723. }, 500, function() {
  3724. t.RemoveDetailsSection()
  3725. })
  3726. }
  3727.  
  3728. function pt() {
  3729. k(n(this))
  3730. }
  3731.  
  3732. function k(i) {
  3733. for (var u = i.val(), r = n(w)[0]; r.options.length;) r.options[0] = null;
  3734. 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()
  3735. }
  3736.  
  3737. function ct(n, t) {
  3738. for (var r = t.length, i = 0; i < r; i++) n.options[n.options.length] = new Option(t[i][1], t[i][0])
  3739. }
  3740.  
  3741. function wt() {
  3742. var o, f, i, r, e, s;
  3743. n(p).valid() && (o = n(u).attr(a), f = n(w).val(), i = n(l).val(), r = {
  3744. Url: o,
  3745. SubmitDate: new Date,
  3746. Action: i
  3747. }, i == t.ActionDictionary[c] ? r.RefreshReason = f : i == t.ActionDictionary[y] && (r.BlockReason = f), e = [], e.push(r), s = {
  3748. pagePreviews: JSON.stringify(e)
  3749. }, lt(s, bt))
  3750. }
  3751.  
  3752. function lt(n, i, r) {
  3753. startPostRequestWithJson(n, t.PageUpdateUrl, i, r, p)
  3754. }
  3755.  
  3756. function d(i, r, u, f) {
  3757. var e = u;
  3758. n.ajax({
  3759. url: [t.PreviewRequestUrl, "&previewUrl=", encodeURIComponent(i), "&requestId=", encodeURIComponent(r), "&trial=", u].join(""),
  3760. type: "GET",
  3761. success: function(i) {
  3762. var u = [],
  3763. r;
  3764. 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() {
  3765. d(i.Url, i.RequestId, e + 1, f)
  3766. }, 4e3) : (showErrorMessage(i.ErrorString, wr.G_Error, !0), hideActivityIndicator(), unsetModalActivityIndicator(), s(!0), t.ClearFormInput(), g(i.Url))
  3767. },
  3768. error: function(n) {
  3769. g();
  3770. reportError(n)
  3771. }
  3772. })
  3773. }
  3774.  
  3775. function at(i) {
  3776. n(e).attr("disabled", "disabled");
  3777. n(o).attr("disabled", "disabled");
  3778. n(h).attr("disabled", "disabled");
  3779. i && n("<div class = pagePreviewRefreshInProgress>").text(t.RefreshInProgressMessage).insertAfter(n(ut))
  3780. }
  3781.  
  3782. function g(t) {
  3783. n(e).removeAttr("disabled");
  3784. n(o).removeAttr("disabled");
  3785. n(h).removeAttr("disabled");
  3786. t && n(u).find("div.pagePreviewRefreshInProgress").remove()
  3787. }
  3788.  
  3789. function bt(n) {
  3790. if (n && n.length == 1 && n[0].Action == t.ActionDictionary[c] && n[0].RequestId) {
  3791. at(n[0].Url);
  3792. d(n[0].Url, n[0].RequestId, 1);
  3793. return
  3794. }
  3795. hideActivityIndicator();
  3796. unsetModalActivityIndicator();
  3797. s(!0);
  3798. t.ClearFormInput();
  3799. vt(n)
  3800. }
  3801.  
  3802. function kt(i) {
  3803. var h, f, e, c, l, o, u, r, a, v;
  3804. e = i.RefreshBlocked ? "pagePreviewLowQImage" : "pagePreviewAcceptedImage";
  3805. f = n("#" + e);
  3806. h = f.parent();
  3807. f.remove();
  3808. c = ["<img src='", i.Preview, "'id=", e, "style='height: 200px; width: 360px;'/>"];
  3809. h.append(n(c.join("")));
  3810. i.RefreshBlocked ? (r = "#pagePreviewRefreshBlockedDialog", v = "#pagePreviewRefreshBlockedDialogTextContent", n(r).attr("url", i.Url), n(r).attr("reason", i.RefreshReason), n(n(r + " > .jqmClose")).each(function() {
  3811. this.jqmHide = null
  3812. }), n(v).html(n.validator.format(t.PagePreviewLowQualityMessage, ['<span class="url-text">', i.Url, "<\/span>"].join(""))), showPopupModalDialog(r, n(r)), n("#pagePreviewAcceptButton").click(function() {
  3813. l = {
  3814. Url: n(r).attr("url"),
  3815. SubmitDate: new Date,
  3816. RefreshReason: n(r).attr("reason"),
  3817. Action: 1,
  3818. BypassQualityCheck: !0
  3819. };
  3820. o = [];
  3821. o.push(l);
  3822. var i = {
  3823. pagePreviews: JSON.stringify(o)
  3824. };
  3825. lt(i);
  3826. n(r).jqmHide();
  3827. hideActivityIndicator();
  3828. unsetModalActivityIndicator();
  3829. s(!0);
  3830. t.ClearFormInput()
  3831. })) : (u = "#pagePreviewRefreshSuccessDialog", a = "#pagePreviewRefreshSuccessDialogTextContent", n(n(u + " > .jqmClose")).each(function() {
  3832. this.jqmHide = null
  3833. }), n(a).html(n.validator.format(t.PagePreviewSuccessMessage, ['<span class="url-text">', i.Url, "<\/span>"].join(""))), showPopupModalDialog(u, n(u)))
  3834. }
  3835.  
  3836. function vt(i) {
  3837. if (hideActivityIndicator(), unsetModalActivityIndicator(), i && i.length == 1) {
  3838. if (i[0].Action == t.ActionDictionary[c]) {
  3839. kt(i[0]);
  3840. return
  3841. }
  3842. if (i[0].Action == t.ActionDictionary[rt]) {
  3843. t.deletePreviewBlockSuccess(i);
  3844. return
  3845. }
  3846. var f = n(["table.wmtable :checkbox[", a, "='", i[0].Url, "'][action='", i[0].Action, "']"].join("")).parent().parent();
  3847. 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>", {
  3848. type: "checkbox",
  3849. previewUrl: i[0].Url,
  3850. action: i[0].Action
  3851. })).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) {
  3852. t > 0 && n(this).click(i[0].Url, function(t) {
  3853. var i = n(r);
  3854. n(u).attr(a, t.data);
  3855. n(r).removeAttr("readonly");
  3856. i.val(t.data);
  3857. n(r).attr("readonly", "");
  3858. st(t)
  3859. })
  3860. }), 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"))
  3861. }
  3862. }
  3863. 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;
  3864. 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
  3865. }
  3866. n.previewDetailsController = function() {
  3867. return new t
  3868. }
  3869. }(jQuery),
  3870. function(n) {
  3871. n.fn.sitemaps = function(t, i) {
  3872. function h(t) {
  3873. for (var r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
  3874. n("#sitemapsTable table.grid input[type=checkbox]").each(function() {
  3875. r[n(this).attr("url")] && n(this).parent().parent().remove()
  3876. });
  3877. triggerCheckboxChange()
  3878. }
  3879.  
  3880. function o(n) {
  3881. hideActivityIndicator();
  3882. unsetModalActivityIndicator();
  3883. u();
  3884. reportError(n)
  3885. }
  3886.  
  3887. function b(t, i) {
  3888. hideActivityIndicator();
  3889. unsetModalActivityIndicator();
  3890. u();
  3891. h(n.map(i, function(n) {
  3892. return {
  3893. Url: n
  3894. }
  3895. }));
  3896. n("table.grid").trigger("update")
  3897. }
  3898.  
  3899. function k(n) {
  3900. hideActivityIndicator();
  3901. unsetModalActivityIndicator();
  3902. reportError(n);
  3903. u()
  3904. }
  3905.  
  3906. function s(i, r, u) {
  3907. var f = {};
  3908. f.updateEl = i;
  3909. f.indexUrl = r;
  3910. f.retryCount = u;
  3911. n.ajax({
  3912. url: [t.IndexCountUrl, "&indexUrl=", escape(r)].join(""),
  3913. type: "GET",
  3914. dataType: "text",
  3915. timeout: 13500,
  3916. context: f,
  3917. success: g,
  3918. error: d
  3919. })
  3920. }
  3921.  
  3922. function d() {
  3923. 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())
  3924. }
  3925.  
  3926. function g(n) {
  3927. if (n != null) {
  3928. var t = JSON.parse(n);
  3929. this.updateEl.html([t.Formatted, '<span class="none">', t.Count, "<\/span>"].join(""))
  3930. }
  3931. c()
  3932. }
  3933.  
  3934. function c() {
  3935. if (r.length > 0) {
  3936. var n = r.pop();
  3937. s(n[0], n[1], n[2])
  3938. } else e = 0
  3939. }
  3940.  
  3941. function nt() {
  3942. var t, i, r;
  3943. 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) {
  3944. n("div.tableheaderbox").replaceWith(t);
  3945. showActivityIndicator(!1);
  3946. a();
  3947. var i = n("#submittedFeed tbody").html(),
  3948. u = [];
  3949. u.push({
  3950. Url: r
  3951. });
  3952. i && u.push({
  3953. Url: n("input[url]", i).attr("url")
  3954. });
  3955. h(u);
  3956. n("#sitemapsTable table.grid tbody").prepend(i);
  3957. n("#sitemapsTable table.grid").trigger("update");
  3958. constrainCheckboxWidth()
  3959. }).error(o)))
  3960. }
  3961.  
  3962. function tt() {
  3963. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
  3964. var i = getCheckedItemsInTable("url");
  3965. i.length > 0 && (showActivityIndicator(!0), f(), startPostRequestWithJson({
  3966. feedUrls: i
  3967. }, t.RemoveUrl, function(n) {
  3968. b(n, i)
  3969. }, k, "#addParamForm", null, {
  3970. traditional: !0
  3971. }))
  3972. }
  3973. }
  3974.  
  3975. function it() {
  3976. n(this).attr("disabled") == "disabled" || window.readOnlyMode || (showActivityIndicator(!0), startPostRequestWithJson({}, t.ResubmitIndexUrl, function(t) {
  3977. n("#sitemapIndexTable").html(t);
  3978. showActivityIndicator(!1)
  3979. }, o, "#addParamForm", null, {
  3980. traditional: !0
  3981. }))
  3982. }
  3983.  
  3984. function rt() {
  3985. var i, r;
  3986. n(this).attr("disabled") == "disabled" || window.readOnlyMode || (i = getCheckedItemsInTable("url"), i.length > 0 && (f(), showActivityIndicator(!0), r = function(t) {
  3987. n("#sitemapsTable").html(t);
  3988. initInfoHovers();
  3989. enablePagination();
  3990. enableAjaxSorting();
  3991. disableFormSubmit();
  3992. n("input.urlValidation, input.wmUrl").urlInputBox();
  3993. window.sitemapsController != null && window.sitemapsController.getAccurateSitemapIndexCounts();
  3994. hideActivityIndicator();
  3995. unsetModalActivityIndicator();
  3996. u();
  3997. n("table.grid").trigger("update")
  3998. }, startPostRequestWithJson({
  3999. feedUrls: i
  4000. }, t.ResubmitUrl, r, o, "#addParamForm", null, {
  4001. traditional: !0
  4002. })))
  4003. }
  4004.  
  4005. function l() {
  4006. n('#sitemapsTable table.grid span[si="0"]').each(function() {
  4007. var i = n(this),
  4008. f = t.Detail ? ":nth-child(3)" : ":nth-child(4)",
  4009. u = n(f, i.parent().parent());
  4010. e < 4 ? (s(u, i.attr("url"), 0), e++) : r.push([u, i.attr("url"), 0])
  4011. })
  4012. }
  4013.  
  4014. function a() {
  4015. clickButtonOnEnter("#addParam", "#addSitemap");
  4016. n("#addParam").click(nt);
  4017. n("#addParamForm").validate(noCleanValidateOptions);
  4018. window.readOnlyMode && f();
  4019. disableFormSubmit();
  4020. n("input.urlValidation, input.wmUrl").urlInputBox()
  4021. }
  4022.  
  4023. function ut() {
  4024. n("#removeParam").click(tt);
  4025. n("#resubmitParam").click(rt);
  4026. n("#resubmitIndex").click(it);
  4027. n("#sitemapsTable table.grid :checkbox").live("change", p).live("change", w);
  4028. n("#sitemapsTable table.grid").parent().bind("onsort", function() {
  4029. initInfoHovers();
  4030. l();
  4031. initEmptyTables()
  4032. });
  4033. a()
  4034. }
  4035. var p = setupGridCheckButtonEnabler("#sitemapsTable table.grid", "#removeParam"),
  4036. w = setupGridCheckButtonEnabler("#sitemapsTable table.grid", "#resubmitParam"),
  4037. r = [],
  4038. e = 0,
  4039. u = function() {
  4040. n("#addSitemap").attr("disabled", null);
  4041. n("#addParam").attr("disabled", null);
  4042. var t = n("#sitemapsTable table.grid :checked").length > 0;
  4043. n("#resubmitParam").attr("disabled", t ? null : "disabled");
  4044. n("#removeParam").attr("disabled", t ? null : "disabled")
  4045. },
  4046. f = function() {
  4047. n("#addSitemap").attr("disabled", "disabled");
  4048. n("#addParam").attr("disabled", "disabled");
  4049. n("#resubmitParam").attr("disabled", "disabled");
  4050. n("#removeParam").attr("disabled", "disabled")
  4051. },
  4052. v, y;
  4053. return (this.getAccurateSitemapIndexCounts = l, i == "getSitemapIndexCount") ? (v = arguments[2], y = arguments[3], s(y, v, 0), this) : (ut(), this.getAccurateSitemapIndexCounts(), this)
  4054. }
  4055. }(jQuery),
  4056. function(n) {
  4057. n.fn.submiturls = function(t) {
  4058. function u(t) {
  4059. for (var r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
  4060. n("#paramList table.wmtable input[type=checkbox]").each(function() {
  4061. r[n(this).attr("url")] && n(this).parent().parent().remove()
  4062. })
  4063. }
  4064.  
  4065. function f(t) {
  4066. var e, r, f;
  4067. hideActivityIndicator();
  4068. unsetModalActivityIndicator();
  4069. i();
  4070. n("#urls").val("");
  4071. u(t);
  4072. for (e in t) r = t[e], f = n("<tr/>"), f.append(n('<td class="width20"/>').append(n("<input>", {
  4073. type: "checkbox",
  4074. url: r.Url
  4075. })).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);
  4076. n("#dailyQuota").text(parseInt(n("#dailyQuota").text()) - t.length);
  4077. n("#monthlyQuota").text(parseInt(n("#monthlyQuota").text()) - t.length);
  4078. n("#paramList table.wmtable").trigger("update")
  4079. }
  4080.  
  4081. function e(n) {
  4082. hideActivityIndicator();
  4083. unsetModalActivityIndicator();
  4084. i();
  4085. var t = null;
  4086. n.Message != null && (t = n.Message.replace(/\n/g, "<br/>"));
  4087. showErrorMessage(t, wr.G_Error, !0)
  4088. }
  4089.  
  4090. function h(t, r) {
  4091. hideActivityIndicator();
  4092. unsetModalActivityIndicator();
  4093. i();
  4094. u(n.map(r, function(n) {
  4095. return {
  4096. Url: n
  4097. }
  4098. }));
  4099. n("#paramList table.wmtable").trigger("update")
  4100. }
  4101.  
  4102. function c(n) {
  4103. hideActivityIndicator();
  4104. unsetModalActivityIndicator();
  4105. reportError(n);
  4106. i()
  4107. }
  4108. var o = setupGridCheckButtonEnabler("#paramList table.wmtable", "#removeParam"),
  4109. s = setupGridCheckButtonEnabler("#paramList table.wmtable", "#resubmitParam"),
  4110. i = function() {
  4111. n("#urls").attr("disabled", null);
  4112. n("#addParam").attr("disabled", null);
  4113. var t = n("#paramList table.wmtable :checked").length > 0;
  4114. n("#resubmitParam").attr("disabled", t ? null : "disabled");
  4115. n("#removeParam").attr("disabled", t ? null : "disabled")
  4116. },
  4117. r = function() {
  4118. n("#urls").attr("disabled", "disabled");
  4119. n("#addParam").attr("disabled", "disabled");
  4120. n("#resubmitParam").attr("disabled", "disabled");
  4121. n("#removeParam").attr("disabled", "disabled")
  4122. };
  4123. n("#addParam").click(function() {
  4124. var u, o, i, s;
  4125. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && n("#addParamForm").valid()) {
  4126. for (u = n("#urls").val().split("\n"), o = [], i = 0; i < u.length; ++i) s = n.trim(u[i]), s != "" && o.push(s);
  4127. showActivityIndicator(!0);
  4128. r();
  4129. startPostRequestWithJson({
  4130. urlList: o
  4131. }, t.AddUrl, f, e, "#addParamForm", null, {
  4132. traditional: !0
  4133. })
  4134. }
  4135. });
  4136. n("#resubmitParam").click(function() {
  4137. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
  4138. var i = getCheckedItemsInTable("url");
  4139. i.length > 0 && (showActivityIndicator(!0), r(), startPostRequestWithJson({
  4140. urlList: i
  4141. }, t.AddUrl, f, e, "#addParamForm", null, {
  4142. traditional: !0
  4143. }))
  4144. }
  4145. });
  4146. n("#removeParam").click(function() {
  4147. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
  4148. var i = getCheckedItemsInTable("url");
  4149. i.length > 0 && (showActivityIndicator(!0), r(), startPostRequestWithJson({
  4150. urlList: i
  4151. }, t.RemoveUrl, function(n) {
  4152. h(n, i)
  4153. }, c, "#addParamForm", null, {
  4154. traditional: !0
  4155. }))
  4156. }
  4157. });
  4158. n("#addParamForm").validate(n.merge({
  4159. onkeyup: !1,
  4160. focusCleanup: !0,
  4161. errorPlacement: function() {}
  4162. }, formValidateOptions));
  4163. n("#paramList table.wmtable :checkbox").live("change", o).live("change", s);
  4164. window.readOnlyMode && r();
  4165. n("#urls").urlTextArea()
  4166. }
  4167. }(jQuery),
  4168. function(n) {
  4169. n.fn.users = function(t, i, r) {
  4170. function e(t) {
  4171. hideActivityIndicator();
  4172. unsetModalActivityIndicator();
  4173. f();
  4174. n("#email").val("");
  4175. var r = t.Expired ? wr.G_Expired : t.DelegatorEmail == null ? wr.Users_AddedBySystem : t.DelegatorEmail,
  4176. i = n("<tr/>");
  4177. i.append(n("<td/>").append(n("<input>", {
  4178. type: "checkbox",
  4179. site: t.Site,
  4180. email: t.Email
  4181. })).append(n("<label/>"))).append(n("<td/>").text(t.Email)).append(n("<td/>").append(n("<span>", {
  4182. "class": "url-text"
  4183. }).text(t.Site))).append(n("<td/>").text(t.RolesFormatted)).append(n("<td/>").text(t.DateFormatted)).append(n("<td/>").text(r));
  4184. n("#userList table.wmtable tbody").prepend(i)
  4185. }
  4186.  
  4187. function o(n) {
  4188. hideActivityIndicator();
  4189. unsetModalActivityIndicator();
  4190. f();
  4191. reportError(n)
  4192. }
  4193.  
  4194. function s(t, i) {
  4195. var f, r;
  4196. for (hideActivityIndicator(), unsetModalActivityIndicator(), f = {}, r = 0; r < i.length; ++r) f[i[r].Site + "|" + i[r].Email] = !0;
  4197. n("#userList table.wmtable input[type=checkbox]").each(function() {
  4198. var t = n(this).attr("site") + "|" + n(this).attr("email");
  4199. f[t] && n(this).parent().parent().remove()
  4200. });
  4201. u()
  4202. }
  4203.  
  4204. function h(n) {
  4205. hideActivityIndicator();
  4206. unsetModalActivityIndicator();
  4207. reportError(n)
  4208. }
  4209. var u = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
  4210. f = function() {
  4211. n("#email").attr("disabled", null);
  4212. n("#url").attr("disabled", null);
  4213. n("#role").attr("disabled", null);
  4214. n("#key").attr("disabled", null);
  4215. n("#addParam").attr("disabled", null)
  4216. },
  4217. c = function() {
  4218. n("#email").attr("disabled", "disabled");
  4219. n("#url").attr("disabled", "disabled");
  4220. n("#role").attr("disabled", "disabled");
  4221. n("#key").attr("disabled", "disabled");
  4222. n("#addParam").attr("disabled", "disabled")
  4223. };
  4224. i && r && (n("#requestSiteAccessApprovalDialog").jqm({
  4225. overlay: 5,
  4226. modal: !0
  4227. }).jqmShow(), n("#buttonApprove").click(function() {
  4228. startPostRequestWithJson({
  4229. userId: i,
  4230. userEmail: r
  4231. }, t.ApproveAccessUrl, e, o, "#addParamForm")
  4232. }), n("#buttonReject").click(function() {
  4233. startPostRequestWithJson({
  4234. userId: i
  4235. }, t.DenyAccessUrl, s, h, "#addParamForm")
  4236. }));
  4237. n("#addParam").click(function() {
  4238. if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
  4239. var r = n.trim(n("#email").val()),
  4240. u = n.trim(n("#url").val()),
  4241. i = n("#role").val(),
  4242. f = n("#key").val(),
  4243. s = i == "admin",
  4244. h = i == "readonly";
  4245. showActivityIndicator(!0);
  4246. c();
  4247. startPostRequestWithJson({
  4248. delegatedUrl: u,
  4249. userEmail: r,
  4250. isAdministrator: s,
  4251. isReadOnly: h,
  4252. authenticationCode: f
  4253. }, t.AddUrl, e, o, "#addParamForm")
  4254. }
  4255. });
  4256. n("#removeParam").click(function() {
  4257. var i = [];
  4258. n("#userList table.wmtable :checked").each(function() {
  4259. var t = n(this),
  4260. r = {
  4261. Site: t.attr("site"),
  4262. Email: t.attr("email")
  4263. };
  4264. i.push(r)
  4265. });
  4266. i.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
  4267. siteRoles: JSON.stringify(i)
  4268. }, t.RemoveUrl, function(n) {
  4269. s(n, i)
  4270. }, h, "#addParamForm"))
  4271. });
  4272. n("#addParamForm").validate(formValidateOptions);
  4273. n("#userList table.wmtable :checkbox").live("change", u);
  4274. clickButtonOnEnter("#addParam", ["#url", "#email"])
  4275. }
  4276. }(jQuery),
  4277. function(n) {
  4278. n.fn.verify = function(t) {
  4279. function w() {
  4280. var i = n("#hosters").val();
  4281. i != "0" && (i = "how+to+add+CNAME+record+to+" + i, window.open(n.validator.format(t.SerpFormat, i), "dns"))
  4282. }
  4283.  
  4284. function b() {
  4285. s = 0;
  4286. h = getGuid();
  4287. showActivityIndicator(!0);
  4288. r.hide();
  4289. i.hide();
  4290. u.hide();
  4291. f.remove();
  4292. e.hide();
  4293. n.ajax({
  4294. url: [t.VerifyUrl, "&cacheKey=", h].join(""),
  4295. type: "POST",
  4296. processData: !1,
  4297. contentType: "application/json",
  4298. timeout: 13500,
  4299. success: v,
  4300. error: function(n) {
  4301. handleAjaxError(n, y, function() {
  4302. a(!0)
  4303. })
  4304. }
  4305. })
  4306. }
  4307.  
  4308. function a() {
  4309. r.show();
  4310. n.ajax({
  4311. url: [t.QueryUrl, "&cacheKey=", h].join(""),
  4312. type: "GET",
  4313. timeout: 13500,
  4314. success: k,
  4315. error: function(n) {
  4316. handleAjaxError(n, y);
  4317. return
  4318. }
  4319. })
  4320. }
  4321.  
  4322. function k(n) {
  4323. n ? v(n) : s < 15 ? (s++, window.setTimeout(function() {
  4324. a()
  4325. }, 2e3)) : (r.hide(), showErrorMessage(wr.G_TimeoutError, wr.G_TimeoutErrorTitle))
  4326. }
  4327.  
  4328. function v(o) {
  4329. r.hide();
  4330. hideActivityIndicator();
  4331. unsetModalActivityIndicator();
  4332. 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))
  4333. }
  4334.  
  4335. function y(n) {
  4336. r.hide();
  4337. hideActivityIndicator();
  4338. unsetModalActivityIndicator();
  4339. reportError(n)
  4340. }
  4341.  
  4342. function d(n, t) {
  4343. tt(n, t.Xml);
  4344. nt(n, t.MetaTag);
  4345. g(n, t.Dns)
  4346. }
  4347.  
  4348. function g(t, i) {
  4349. var r = n("<div>"),
  4350. u = i.CNames.length > 0 ? i.CNames.join(", ") : wr.G_NA;
  4351. l(r, wr.Verify_Dns);
  4352. c(r, wr.G_Url, i.HostName);
  4353. c(r, wr.Verify_CNames, u);
  4354. i.Success || o(r, i.Error);
  4355. t.append(r)
  4356. }
  4357.  
  4358. function nt(t, i) {
  4359. var r = n("<div>");
  4360. l(r, wr.Verify_MetaTag);
  4361. p(r, i.ConnectionInfo, !1);
  4362. i.ConnectionInfo.Success && i.Error && o(r, i.Error);
  4363. t.append(r)
  4364. }
  4365.  
  4366. function tt(t, i) {
  4367. var r = n("<div>");
  4368. l(r, wr.Verify_Xml);
  4369. p(r, i.ConnectionInfo, !0);
  4370. i.ConnectionInfo.Success && i.Error && o(r, i.Error);
  4371. t.append(r)
  4372. }
  4373.  
  4374. function p(t, i) {
  4375. var r, u;
  4376. 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) {
  4377. u.append(n("<span class='url-text'>").text(r));
  4378. t < i.RedirectChain.length - 1 && u.append(n("<span class='url-text'>").text(" => "))
  4379. }), 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))
  4380. }
  4381.  
  4382. function c(t, i, r, u) {
  4383. var f = n("<span>").text(r);
  4384. u && f.addClass("url-text");
  4385. t.append(n("<div>").append(n("<span style='font-weight: bold'>").text(i + " ")).append(f))
  4386. }
  4387.  
  4388. function l(t, i) {
  4389. t.append(n("<div class='darkTitle verificationTypeTitle'>").text(i))
  4390. }
  4391.  
  4392. function o(t, i) {
  4393. t.append(n("<div class='errorRed'>").text(i))
  4394. }
  4395.  
  4396. function it() {
  4397. var o = n("#page-content>h1.page-name");
  4398. n("#hosters").change(w);
  4399. n("#metaSnippet").click(function() {
  4400. autoSelect(this)
  4401. });
  4402. n("#verifySite").click(b);
  4403. f = n("div.verificationDebugBox");
  4404. i = n("#verificationFailIconLg");
  4405. u = n("#verificationPassIconLg");
  4406. r = n("<span class='verificationInProgress'>").text(wr.Verify_VerificationInProgress);
  4407. e = n("#verificationHelp");
  4408. r.hide();
  4409. o.addClass("verificationHeader");
  4410. i.length == 0 && (i = n("<img/>", {
  4411. id: "verificationFailIconLg",
  4412. src: "/webmaster/content/images/RedXLg.png",
  4413. "class": "middlealign marginleft5"
  4414. }), o.append(i), i = n("#verificationFailIconLg"), i.hide());
  4415. u.length == 0 && (u = n("<img/>", {
  4416. id: "verificationPassIconLg",
  4417. src: "/webmaster/content/images/GreenCheckLg.png",
  4418. "class": "middlealign marginleft5"
  4419. }), o.append(u), u = n("#verificationPassIconLg"), t.IsVerified || u.hide());
  4420. o.append(r);
  4421. r = n("span.verificationInProgress")
  4422. }
  4423. var f, i, u, r, s, h, e;
  4424. it()
  4425. }
  4426. }(jQuery),
  4427. function(n) {
  4428. n.fn.adCenter = function(t) {
  4429. function o(t) {
  4430. var r = [],
  4431. e = 0,
  4432. o = 0;
  4433. n("td:first-child span.keyword:first-child", t).each(function() {
  4434. var t = n.trim(n(this).text()),
  4435. u = f(t);
  4436. if (u != null) return e++, !0;
  4437. o++;
  4438. r.push(t);
  4439. r.length >= 20 && (i.push(r), r = [])
  4440. });
  4441. r.length > 0 && i.push(r);
  4442. i.length > 0 && (i.reverse(), u())
  4443. }
  4444.  
  4445. function u() {
  4446. var n = i.pop();
  4447. n != null && n.length > 0 && startPostRequestWithJson({
  4448. keywords: n
  4449. }, t.KeywordsUrl, s, h, t.TokenContainer, null, {
  4450. traditional: !0
  4451. })
  4452. }
  4453.  
  4454. function s(n) {
  4455. for (var t = 0; t < n.length; t++) r.push(n[t]);
  4456. i.length > 0 && u()
  4457. }
  4458.  
  4459. function h(t) {
  4460. console.error(t);
  4461. n("td:first-child span:nth-child(2)", this).hide()
  4462. }
  4463.  
  4464. function f(t) {
  4465. var i = null;
  4466. return n.each(r, function(n, r) {
  4467. if (r.Keyword == t) return i = r, !1
  4468. }), i
  4469. }
  4470.  
  4471. function c(t) {
  4472. var i = f(t);
  4473. if (i == null) {
  4474. n(".adKpiContent span").text(e);
  4475. return
  4476. }
  4477. n("#mlavgcpc").text(i.MainLineAds.AverageCpc);
  4478. n("#mlavgbid").text(i.MainLineAds.AverageBid);
  4479. n("#sbavgcpc").text(i.SidebarAds.AverageCpc);
  4480. n("#sbavgbid").text(i.SidebarAds.AverageBid)
  4481. }
  4482.  
  4483. function l(t) {
  4484. n("td:first-child span:nth-child(2)", t).each(function() {
  4485. var t = n("#adCenterPop");
  4486. n(this).mouseover(function() {
  4487. var i = n(this).position(),
  4488. r = i.left + 2,
  4489. f = i.top + 23 + n("#page-content").scrollTop(),
  4490. u, e;
  4491. 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());
  4492. t.css({
  4493. top: f,
  4494. left: r + "px"
  4495. }).show();
  4496. e = n(this).prev().text();
  4497. c(e)
  4498. }).mouseleave(function() {
  4499. var n = t.position().top;
  4500. setTimeout(function() {
  4501. t.is(":hover") || n != t.position().top || t.hide()
  4502. }, 100)
  4503. });
  4504. t.mouseleave(function() {
  4505. t.hide()
  4506. })
  4507. })
  4508. }
  4509.  
  4510. function a(t) {
  4511. var i = "<span class='graybox cursor-default'>$<\/span>";
  4512. n("tbody td:first-child", t).each(function() {
  4513. if (n(this).find("span.keyword").length == 0) {
  4514. var t = n.validator.format("<span class='keyword'>{0}<\/span> {1}", n(this).html(), i);
  4515. n(this).html(t)
  4516. }
  4517. })
  4518. }
  4519. var i = [],
  4520. r = [],
  4521. e = "$0.05";
  4522. n("#adCenterPop").length == 1 && (a(this), l(this), o(this))
  4523. };
  4524. n.fn.adCenterCoupon = function(t) {
  4525. var i = n(this);
  4526. i && i.length && n.ajax({
  4527. url: t.url,
  4528. type: "POST",
  4529. data: {},
  4530. traditional: !0,
  4531. timeout: 13500,
  4532. success: function(t) {
  4533. var r = n.trim(t);
  4534. r && i.append(n(r))
  4535. },
  4536. error: reportError
  4537. })
  4538. }
  4539. }(jQuery),
  4540. function(n) {
  4541. n.fn.crawlInformation = function(t) {
  4542. function i() {
  4543. if (n.trim(n(this).text()) != "0") {
  4544. var i = n("a", n(this)).attr("issueType"),
  4545. r = n.validator.format("{0}&issueType={1}", t.crawlInformationDetailUrl, i);
  4546. document.location = r
  4547. }
  4548. }
  4549. n("#crawlInfoWidget td.pointer").hover(function() {
  4550. n(this).hasClass("orange-bottom-border") || n(this).addClass("grey-bottom-border")
  4551. }, function() {
  4552. n("#crawlInfoWidget .grey-bottom-border").removeClass("grey-bottom-border")
  4553. });
  4554. n("#" + t.selectedIssueType).addClass("orange-bottom-border");
  4555. n("#crawlInfoWidget td.pointer").click(i)
  4556. }
  4557. }(jQuery),
  4558. function(n) {
  4559. n.fn.showInboundLinks = function(t) {
  4560. showActivityIndicator(!0);
  4561. n.post(inboundLinksDialogUrl + encodeURI(t), function(n) {
  4562. showPopupModalDialog("#linksDialog", n);
  4563. hideActivityIndicator()
  4564. })
  4565. }
  4566. }(jQuery),
  4567. function(n) {
  4568. n.fn.indexexplorer = function(t) {
  4569. function f(n) {
  4570. n.addClass("active");
  4571. l()
  4572. }
  4573. var o = null,
  4574. st = function() {
  4575. n("#index-explorer-tree").hide();
  4576. n("#index-explorer-folder").hide();
  4577. n("#index-explorer-page").hide();
  4578. n("#index-explorer-tree-default").show();
  4579. n("#index-explorer-folder-default").show();
  4580. n("#index-explorer-page-default").show();
  4581. n("#status-no-data").hide();
  4582. n("#status-loading").show();
  4583. n("#status-error").hide()
  4584. },
  4585. e = function() {
  4586. n("#index-explorer-page").hide();
  4587. n("#index-explorer-page-default").show()
  4588. },
  4589. i = function() {
  4590. var t = n("#folder").val();
  4591. return t.length > 0 && !hasPlaceholderSupport() && n("#folder").attr("placeholder") != undefined && n("#folder").attr("placeholder") == n("#folder").val() && (t = ""), {
  4592. httpCode: n("#httpCode").val(),
  4593. discovery: n("#discovery").val(),
  4594. crawlDate: n("#crawlDate").val(),
  4595. itUrl: t,
  4596. malware: n("#malware").is(":checked"),
  4597. robotstxt: n("#robotstxt").is(":checked"),
  4598. traffic: !1
  4599. }
  4600. },
  4601. a = function() {
  4602. n("#navigationContainer").hide();
  4603. n("#navigationContainerDefault").show();
  4604. n("#index-explorer-tree").hide();
  4605. n("#index-explorer-tree-default").show();
  4606. n("#status-no-data").show();
  4607. n("#status-loading").hide();
  4608. n("#status-error").hide()
  4609. },
  4610. v = function() {
  4611. n("#navigationContainerDefault").hide();
  4612. n("#navigationContainer").empty().show();
  4613. n("#navigation").detach().appendTo(n("#navigationContainer"));
  4614. n("#index-explorer-tree").show();
  4615. n("#index-explorer-tree-default").hide();
  4616. scrollToTop();
  4617. var t = n(".index-explorer-tree-list > ul > li:not(.more)");
  4618. t.length < 4 && t.each(function() {
  4619. c(n(this))
  4620. })
  4621. },
  4622. y = function(i) {
  4623. var r = n.extend({}, i);
  4624. n("#index-explorer-tree").load(t.treeUrl, r, function(t, i) {
  4625. 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())
  4626. })
  4627. },
  4628. r = function(r) {
  4629. var u = i();
  4630. u.itUrl.length == 0 && (u.itUrl = t.rootUrl);
  4631. r && r.length > 0 && (u.itUrl = r);
  4632. e();
  4633. y(u);
  4634. s(u);
  4635. n("#index-explorer-page").empty()
  4636. },
  4637. p = function() {
  4638. var u = i(),
  4639. f, r;
  4640. u.itUrl = n(this).attr("iturl");
  4641. u.offset = n(this).attr("offset");
  4642. u.level = n(this).attr("level");
  4643. f = n(this);
  4644. r = n(this).parent();
  4645. f.text(wr.G_Loading);
  4646. r.load(t.treeChildrenUrl, u, function(n, t) {
  4647. t == "success" ? (r.children().appendTo(r.parent()), r.remove()) : f.text(wr.IndexExplorer_More)
  4648. })
  4649. },
  4650. w = function() {
  4651. n("#index-explorer-folder").hide();
  4652. n("#index-explorer-folder-default").show()
  4653. },
  4654. b = function() {
  4655. n("#index-explorer-folder").show();
  4656. n("#index-explorer-folder-default").hide();
  4657. scrollToTop()
  4658. },
  4659. s = function(i) {
  4660. var r = n.extend({}, i);
  4661. n("#index-explorer-folder").load(t.folderUrl, r, function(t, r) {
  4662. r == "success" ? (o = i.itUrl, n.trim(t).length == 0 ? w() : b()) : (n("#index-explorer-folder").hide(), n("#index-explorer-folder-default").show())
  4663. })
  4664. },
  4665. h = function(n) {
  4666. if (e(), o != n) {
  4667. var t = i();
  4668. t.itUrl = n;
  4669. s(t)
  4670. }
  4671. },
  4672. k = function() {
  4673. var u = i(),
  4674. f, r;
  4675. u.itUrl = n(this).attr("iturl");
  4676. u.offset = n(this).attr("offset");
  4677. f = n(this);
  4678. r = n(this).parent();
  4679. f.text(wr.G_Loading);
  4680. r.load(t.folderNextUrl, u, function(n, t) {
  4681. t == "success" ? (r.children().appendTo(r.parent()), r.remove()) : f.text(wr.IndexExplorer_More)
  4682. })
  4683. },
  4684. d = function() {
  4685. n("#index-explorer-page").hide();
  4686. n("#index-explorer-page-default").show()
  4687. },
  4688. g = function() {
  4689. n("#index-explorer-page").show();
  4690. n("#index-explorer-page-default").hide();
  4691. scrollToTop()
  4692. },
  4693. nt = function(i) {
  4694. var r = n.extend({}, i);
  4695. n("#index-explorer-page").load(t.pageUrl, r, function(t, i) {
  4696. i == "success" ? n.trim(t).length == 0 ? d() : g() : (n("#index-explorer-page").hide(), n("#index-explorer-page-default").show())
  4697. })
  4698. },
  4699. tt = function() {
  4700. var t = i();
  4701. t.itUrl = n(this).attr("iturl");
  4702. nt(t)
  4703. },
  4704. c = function(r) {
  4705. var f, e, u;
  4706. 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 />", {
  4707. "class": "folders"
  4708. }), u = n("<li />").hide(), u.append(e), r.after(u), e.load(t.treeChildrenUrl, f, function(t, i) {
  4709. i == "success" ? (r.addClass("open"), r.data("loaded", !0), n.trim(t).length == 0 ? (r.data("empty", !0), u.remove()) : u.show()) : u.remove()
  4710. }))
  4711. },
  4712. it = function() {
  4713. var t = n(this);
  4714. c(t);
  4715. n("#index-explorer-tree").find(".active").removeClass("active");
  4716. t.addClass("active");
  4717. h(n(this).attr("iturl"))
  4718. },
  4719. rt = function() {
  4720. var t = n(this);
  4721. n("#index-explorer-tree").find(".active").removeClass("active");
  4722. t.addClass("active");
  4723. h(n(this).attr("iturl"))
  4724. },
  4725. ut = function() {
  4726. e();
  4727. r(n(this).attr("iturl"))
  4728. },
  4729. u = function() {
  4730. n("#httpCode").val("Any");
  4731. n("#discovery").val("Any");
  4732. n("#crawlDate").val("Any");
  4733. n("#folder").val("");
  4734. n("#malware").prop("checked", !1).next().removeClass("on");
  4735. n("#robotstxt").prop("checked", !1).next().removeClass("on");
  4736. n(".index-explorer-preset").removeClass("active")
  4737. },
  4738. l = function() {
  4739. n("#indexexplorerform").valid() && r()
  4740. },
  4741. ft = function() {
  4742. hideActivityIndicator();
  4743. unsetModalActivityIndicator();
  4744. showHtmlMessage(wr.IndexExplorer_RecrawlSuccess, wr.G_UrlsSubmitted)
  4745. },
  4746. et = function(n) {
  4747. hideActivityIndicator();
  4748. unsetModalActivityIndicator();
  4749. reportError(n)
  4750. },
  4751. ot = function() {
  4752. var i = n(this).attr("iturl");
  4753. showActivityIndicator(!0);
  4754. startPostRequestWithJson({
  4755. urlList: [i]
  4756. }, t.submitUrl, ft, et, "#indexexplorerform", null, {
  4757. traditional: !0
  4758. })
  4759. };
  4760. n("#showCustomOptions").click(function() {
  4761. n(this).hide();
  4762. n("#hideCustomOptions").show();
  4763. n("#customOptions").show()
  4764. });
  4765. n("#hideCustomOptions").click(function() {
  4766. n(this).hide();
  4767. n("#showCustomOptions").show();
  4768. n("#customOptions").hide()
  4769. });
  4770. n("#resetfilters").click(function() {
  4771. u();
  4772. r()
  4773. });
  4774. n("#applyfilters").click(l);
  4775. n("#preset301").click(function() {
  4776. u();
  4777. n("#httpCode").val("Code301");
  4778. f(n(this))
  4779. });
  4780. n("#preset404").click(function() {
  4781. u();
  4782. n("#httpCode").val("Code4xx");
  4783. f(n(this))
  4784. });
  4785. n("#presetMalware").click(function() {
  4786. u();
  4787. n("#malware").prop("checked", !0).next().addClass("on");
  4788. f(n(this))
  4789. });
  4790. n("#presetRobot").click(function() {
  4791. u();
  4792. n("#robotstxt").prop("checked", !0).next().addClass("on");
  4793. f(n(this))
  4794. });
  4795. n("#navigationContainerDefault a.index-explorer-navigational-link").click(function() {
  4796. r(t.rootUrl)
  4797. });
  4798. n(".index-explorer-navigational-link").live("click", ut);
  4799. clickButtonOnEnter("#applyfilters", "#folder");
  4800. n("#index-explorer-tree .index-explorer-more").live("click", p);
  4801. n(".index-explorer-expandable").live("click", it);
  4802. n(".index-explorer-viewable").live("click", rt);
  4803. n("#index-explorer-folder .index-explorer-more").live("click", k);
  4804. n("#index-explorer-folder .index-explorer-page-link").live("click", tt);
  4805. n("#index-explorer-page .index-explorer-recrawl").live("click", ot);
  4806. clickButtonOnEnter("#applyfilters", ["#folder"]);
  4807. n("#indexexplorerform").validate(formValidateOptions);
  4808. n("#indexexplorerform select, #indexexplorerform input").change(function() {
  4809. n(".index-explorer-preset").removeClass("active")
  4810. });
  4811. r()
  4812. }
  4813. }(jQuery),
  4814. function(n) {
  4815. n.fn.searchKeyword = function(t) {
  4816. var i = n.extend({}, t);
  4817. i.isKeyword = !0;
  4818. i.Title = wr.Keyword_TrafficDetailsForTitle;
  4819. i.Description = wr.Keyword_DetailsIntro;
  4820. i.PageDetailsUrl = t.pagequerytrafficdetailsUrl;
  4821. i.PopupDeatilsUrl = t.querypagedetailsUrl;
  4822. i.TableContainer = "#keywordsTableContainer";
  4823. i.DataRangeChanged = function() {
  4824. showActivityIndicator(!1);
  4825. n("#keywordsTableContainer").load(i.keywordTableUrl, {
  4826. startDate: n("#keywordRangeFrom").val(),
  4827. endDate: n("#keywordRangeTo").val()
  4828. }, function() {
  4829. hideActivityIndicator();
  4830. n("table.adCenterIntegration").adCenter({
  4831. KeywordsUrl: t.AdCenterKeywordsUrl,
  4832. TokenContainer: "#tokenContainer"
  4833. });
  4834. initEmptyTables();
  4835. initInfoHovers()
  4836. })
  4837. };
  4838. n.fn.searchDetails(i)
  4839. }
  4840. }(jQuery),
  4841. function(n) {
  4842. n.fn.malware = function(t) {
  4843. function i(n) {
  4844. var t = JSON.parse(n.responseText);
  4845. hideActivityIndicator();
  4846. unsetModalActivityIndicator();
  4847. reportError(t)
  4848. }
  4849.  
  4850. function r() {
  4851. n("#reviewRequestContainer").remove();
  4852. n.ajax({
  4853. url: t.historyDataUrl,
  4854. type: "GET",
  4855. success: function(t) {
  4856. n("#historyContainer").html(t);
  4857. enablePagination();
  4858. enableAjaxSorting()
  4859. },
  4860. error: i
  4861. })
  4862. }
  4863.  
  4864. function u() {
  4865. showActivityIndicator(!0);
  4866. n.getJSON(t.requestReviewUrl, r).error(i)
  4867. }
  4868. n("#requestreview").click(u)
  4869. }
  4870. }(jQuery),
  4871. function(n) {
  4872. n.fn.pageTraffic = function(t) {
  4873. var i = n.extend({}, t);
  4874. i.isKeyword = !1;
  4875. i.Title = wr.Page_TrafficDetailsForTitle;
  4876. i.Description = wr.Page_PageDetailsIntro;
  4877. i.PageDetailsUrl = t.PageQueryTrafficDetailsJsonUrl;
  4878. i.PopupDeatilsUrl = t.PageTrafficDetailsTableUrl;
  4879. i.TableContainer = "#pageTrafficTableContainer";
  4880. i.DataRangeChanged = function() {
  4881. showActivityIndicator(!1);
  4882. n("#pageTrafficTableContainer").load(i.fullPageTrafficTableUrl, {
  4883. startDate: n("#keywordRangeFrom").val(),
  4884. endDate: n("#keywordRangeTo").val()
  4885. }, function() {
  4886. hideActivityIndicator();
  4887. initInfoHovers()
  4888. })
  4889. };
  4890. n.fn.searchDetails(i)
  4891. }
  4892. }(jQuery),
  4893. function(n) {
  4894. n.fn.reportsAndData = function(t) {
  4895. n(this).pageTraffic(t);
  4896. n(this).searchKeyword(t);
  4897. n(this).seoReport(t);
  4898. n(this).crawlInformation(t);
  4899. n("#keywordRangeContainer").live("dateChanged", function() {
  4900. initInfoHovers()
  4901. })
  4902. }
  4903. }(jQuery),
  4904. function(n) {
  4905. n.fn.seoReport = function(t) {
  4906. function i() {
  4907. var i = n(this).attr("for"),
  4908. r = n.validator.format("{0}&ruleId={1}", t.seoRuleDetailUrl, i);
  4909. document.location = r
  4910. }
  4911.  
  4912. function r() {
  4913. var i = n(this).text(),
  4914. r = n.validator.format("{0}&paramUrl={1}", t.seoAnalyzerUrl, encodeURIComponent(i));
  4915. document.location = r
  4916. }
  4917. n("#seoRulesTableContainer a.ruleDetailLink").click(i);
  4918. n("#failingPagesTableContainer td > a").click(r)
  4919. }
  4920. }(jQuery),
  4921. function(n) {
  4922. n.fn.searchDetails = function(t) {
  4923. function r() {
  4924. var r = n(this).attr("for"),
  4925. t, f;
  4926. n("#popupDialogTitleText").text(i.Title);
  4927. n("#popupDialogTitleParameter").text(r);
  4928. n("#popupDialogDescription").text(i.Description);
  4929. n("#ptdDialog").jqm({
  4930. overlay: 10,
  4931. modal: !0
  4932. }).jqmShow();
  4933. t = {
  4934. startDate: n("#keywordRangeFrom").val(),
  4935. endDate: n("#keywordRangeTo").val()
  4936. };
  4937. i.isKeyword ? t.query = r : t.pageUrl = r;
  4938. n("#dialogTableContainer").load(i.PopupDeatilsUrl, t, function() {
  4939. hideActivityIndicator();
  4940. initEmptyTables();
  4941. n("#dialogTableContainer a.rowExpand").bind("click", u)
  4942. });
  4943. f = n(this);
  4944. f.hasClass("viewClicked") || f.addClass("viewClicked")
  4945. }
  4946.  
  4947. function u() {
  4948. var u = n("#popupDialogTitleParameter").text(),
  4949. r = n(this).attr("for"),
  4950. e = i.isKeyword ? u : r,
  4951. o = i.isKeyword ? r : u,
  4952. f = "#dialogTableContainer td[for='" + r + "']",
  4953. t = n(f);
  4954. 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, {
  4955. query: e,
  4956. pageUrl: o,
  4957. startDate: n("#keywordRangeFrom").val(),
  4958. endDate: n("#keywordRangeTo").val()
  4959. }, function() {
  4960. hideActivityIndicator()
  4961. })) : t.is(":visible") ? t.parent().slideUp("fast") : t.parent().slideDown("fast")
  4962. }
  4963. var i = t;
  4964. n("#keywordRangeContainer").live("dateChanged", i.DataRangeChanged);
  4965. n("table.adCenterIntegration").adCenter({
  4966. KeywordsUrl: t.AdCenterKeywordsUrl,
  4967. TokenContainer: "#tokenContainer"
  4968. });
  4969. n(i.TableContainer + " a.viewtrafficDetails").live("click", r)
  4970. }
  4971. }(jQuery),
  4972. function(n) {
  4973. n.fn.siteActivityReports = function(t) {
  4974. var e = getStandartChartOptions(),
  4975. o = n("#chart"),
  4976. s = n('.charts-legend input[type="checkbox"]'),
  4977. i = [
  4978. [],
  4979. [],
  4980. [],
  4981. [],
  4982. []
  4983. ],
  4984. h, r = "#keywordRangeFrom",
  4985. u = "#keywordRangeTo",
  4986. f = "#keywordRangeContainer";
  4987. splitChartData(t.data, i, 5);
  4988. t.dateFromSelector && (r = t.dateFromSelector);
  4989. t.dateToSelector && (u = t.dateToSelector);
  4990. t.datePickerContainer && (f = t.datePickerContainer);
  4991. h = setupChart(o, e, s, i, r, u, f, "#site-nav-toggle-button")
  4992. }
  4993. }(jQuery),
  4994. function(n) {
  4995. n.fn.fetchasbot = function(t) {
  4996. function y() {
  4997. var i = n(this).attr("url");
  4998. return showActivityIndicator(!1), n.post(t.detailsUrl, {
  4999. fetchedUrl: i
  5000. }, function(t) {
  5001. hideActivityIndicator();
  5002. n("#fetchedStatus").html(t);
  5003. n(".prettyprint").length > 0 && prettyPrint()
  5004. }), !1
  5005. }
  5006.  
  5007. function p(t) {
  5008. for (var r = {}, i = 0; i < t.length; ++i) r[t[i].Url] = !0;
  5009. n("#paramList table.wmtable input[type=checkbox]").each(function() {
  5010. r[n(this).attr("url")] && n(this).parent().parent().remove()
  5011. })
  5012. }
  5013.  
  5014. function c(t) {
  5015. hideActivityIndicator();
  5016. unsetModalActivityIndicator();
  5017. n("#url").val("");
  5018. p([t]);
  5019. var r = n("<tr/>");
  5020. r.append(n('<td class="width20"/>').append(n("<input>", {
  5021. type: "checkbox",
  5022. url: t.Url
  5023. })).append(n("<label/>"))).append(n('<td class="leftalign" />').append(createExternalUrl(t.Url))).append(t.Fetched ? n("<td/>").append(n("<a/>", {
  5024. "class": "fetch-as-bot-completed",
  5025. href: "javascript:void",
  5026. url: t.Url
  5027. }).text(wr.G_Completed)) : n("<td/>").text(t.Expired ? wr.G_TimeoutErrorTitle : wr.G_Pending));
  5028. n("#paramList table.wmtable tbody").prepend(r);
  5029. n("#paramList table.wmtable").trigger("update");
  5030. --i;
  5031. i == 0 && (o(), h())
  5032. }
  5033.  
  5034. function s(n) {
  5035. hideActivityIndicator();
  5036. unsetModalActivityIndicator();
  5037. reportError(n);
  5038. --i;
  5039. i == 0 && (o(), h())
  5040. }
  5041.  
  5042. function w(t) {
  5043. for (var r, e, o = {}, i = 0; i < t.length; ++i) o[t[i].Url] = t[i];
  5044. for (r = [], n("#paramList table.wmtable tbody tr").each(function() {
  5045. var u = n(this).children("td:nth-child(3)"),
  5046. f = n.trim(u.text()),
  5047. t, i;
  5048. 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/>", {
  5049. "class": "fetch-as-bot-completed",
  5050. href: "javascript:void",
  5051. url: t
  5052. }).text(wr.G_Completed)), r.push(t))))
  5053. }), e = !1, i = 0; i < t.length; ++i) t[i].Fetched || t[i].Expired || (e = !0);
  5054. e ? (u != null && clearTimeout(u), u = setTimeout(function() {
  5055. h()
  5056. }, a)) : f == 1 && r.length > 0 && n("#paramList table.wmtable tbody tr").find('a[url="' + r[0] + '"]').trigger("click")
  5057. }
  5058.  
  5059. function h() {
  5060. startPostRequestWithJson({}, t.getFetchedUrl, w, reportError, "#addParamForm")
  5061. }
  5062.  
  5063. function l(n) {
  5064. showActivityIndicator(!0);
  5065. r();
  5066. i = 1;
  5067. f = i;
  5068. startPostRequestWithJson({
  5069. urlToFetch: n
  5070. }, t.fetchUrl, c, s, "#addParamForm")
  5071. }
  5072.  
  5073. function b(t) {
  5074. var r, i;
  5075. for (o(), hideActivityIndicator(), unsetModalActivityIndicator(), r = {}, i = 0; i < t.length; ++i) r[t[i]] = !0;
  5076. n("table.wmtable :checkbox").each(function() {
  5077. r[n(this).attr("url")] && n(this).parent().parent().remove()
  5078. });
  5079. triggerCheckboxChange();
  5080. n("#paramList table.wmtable").trigger("update")
  5081. }
  5082. var a = 2e3,
  5083. u = null,
  5084. i = 0,
  5085. f = 0,
  5086. e = setupGridCheckButtonEnabler("#paramList table.wmtable", "#removeParam"),
  5087. v = setupGridCheckButtonEnabler("#paramList table.wmtable", "#resubmitParam"),
  5088. o = function() {
  5089. n("#url").attr("disabled", null);
  5090. n("#addParam").attr("disabled", null);
  5091. var t = n("#paramList table.wmtable :checked").length > 0;
  5092. n("#resubmitParam").attr("disabled", t ? null : "disabled")
  5093. },
  5094. r = function() {
  5095. n("#url").attr("disabled", "disabled");
  5096. n("#addParam").attr("disabled", "disabled");
  5097. n("#resubmitParam").attr("disabled", "disabled")
  5098. };
  5099. n("#addParam").click(function() {
  5100. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && n("#addParamForm").valid()) {
  5101. var t = n.trim(n("#url").val());
  5102. l(t)
  5103. }
  5104. });
  5105. n("#removeParam").click(function() {
  5106. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode) {
  5107. var i = [];
  5108. n("#paramList table.wmtable :checked").each(function() {
  5109. var t = n(this);
  5110. i.push(t.attr("url"))
  5111. });
  5112. console.log(i);
  5113. i.length > 0 && (showActivityIndicator(!0), r(), startPostRequestWithJson({
  5114. urlToRemove: i
  5115. }, t.removeUrl, function() {
  5116. b(i)
  5117. }, s, "#addParamForm", null, {
  5118. traditional: !0
  5119. }))
  5120. }
  5121. });
  5122. n("#resubmitParam").click(function() {
  5123. var u, e;
  5124. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && (u = [], n("#paramList table.wmtable :checked").each(function() {
  5125. var t = n(this);
  5126. u.push(t.attr("url"))
  5127. }), u.length > 0)) {
  5128. showActivityIndicator(!0);
  5129. r();
  5130. i = u.length;
  5131. f = i;
  5132. for (e in u) startPostRequestWithJson({
  5133. urlToFetch: u[e]
  5134. }, t.fetchUrl, c, s, "#addParamForm")
  5135. }
  5136. });
  5137. n("#addParamForm").validate(formValidateOptions);
  5138. n("#paramList table.wmtable :checkbox").live("change", e).live("change", v);
  5139. n("#paramList table.wmtable :checkbox").live("change", e).live("change", e);
  5140. n("#paramList table.wmtable .fetch-as-bot-completed").live("click", y);
  5141. window.readOnlyMode && r();
  5142. clickButtonOnEnter("#addParam", "#url");
  5143. t.paramUrl.length > 0 && l(t.paramUrl)
  5144. }
  5145. }(jQuery),
  5146. function(n) {
  5147. n.fn.keywordResearch = function(t) {
  5148. function s(n, t) {
  5149. var r, i;
  5150. t.relatedKeywordSparklineData = n;
  5151. r = {};
  5152. for (i in n) r[n[i].Query] = t.strict ? n[i].BroadImpressionsSparkDataFormatted : n[i].ImpressionsSparkDataFormatted;
  5153. t.relatedKeywordSparklineDataMap = r;
  5154. l(t)
  5155. }
  5156.  
  5157. function h(n) {
  5158. console.log("loadRelatedKeywordSparklineDataFailure", n);
  5159. reportError(n)
  5160. }
  5161.  
  5162. function c(n) {
  5163. console.log("loadRelatedKeywordSparklineDataTimeout", n);
  5164. n.relatedKeywordSparklineDataTimeoutCount++;
  5165. r(n)
  5166. }
  5167.  
  5168. function r(n) {
  5169. startPostRequestWithJson({
  5170. queries: n.relatedKeywordDataQueries,
  5171. country: n.country,
  5172. language: n.language,
  5173. startDate: n.startDate,
  5174. endDate: n.endDate
  5175. }, t.sparklineUrl, function(t) {
  5176. s(t, n)
  5177. }, function(t) {
  5178. h(t, n)
  5179. }, "#tokenContainer", n.relatedKeywordSparklineDataTimeoutCount > 5 ? null : function() {
  5180. c(n)
  5181. }, {
  5182. traditional: !0
  5183. })
  5184. }
  5185.  
  5186. function u(n, t, i) {
  5187. var f, r;
  5188. if (!(i >= t.length)) {
  5189. for (f = Math.min(i + 2, t.length), r = i; r < f; ++r) {
  5190. var e = t[r],
  5191. o = e.visualElement,
  5192. s = e.value;
  5193. o.text(s);
  5194. o.sparkline("html", {
  5195. width: "60px",
  5196. fillColor: ""
  5197. })
  5198. }
  5199. setTimeout(function() {
  5200. u(n, t, f)
  5201. }, 1)
  5202. }
  5203. }
  5204.  
  5205. function l(t) {
  5206. var i = t.relatedKeywordSparklineDataMap,
  5207. r = [],
  5208. f = n("table.grid.keywords-with-sparklines tbody tr");
  5209. f.each(function() {
  5210. var t = n(this).find("td"),
  5211. u = n("a.keyword", t[0]).text(),
  5212. f = n(t[2]),
  5213. e = f.children("span"),
  5214. o = i[u] || "";
  5215. i[u] && r.push({
  5216. visualElement: e,
  5217. value: o
  5218. })
  5219. });
  5220. u(t, r, 0)
  5221. }
  5222. var i = n("#searchform"),
  5223. f = function() {
  5224. var i = [];
  5225. n("table.grid.keywords-with-sparklines tbody tr td:first-child").each(function() {
  5226. i.push(n(this).text())
  5227. });
  5228. r({
  5229. relatedKeywordDataQueries: i,
  5230. strict: n("#strict").is(":checked"),
  5231. startDate: n("#dateRangeFrom").val(),
  5232. endDate: n("#dateRangeTo").val(),
  5233. country: n("#country").val(),
  5234. language: n("#language").val(),
  5235. relatedKeywordSparklineDataTimeoutCount: 0
  5236. });
  5237. n("table.adCenterIntegration").adCenter({
  5238. KeywordsUrl: t.AdCenterKeywordsUrl,
  5239. TokenContainer: "#tokenContainer"
  5240. })
  5241. },
  5242. a = function(t) {
  5243. n("#keywordscontainer").html(t);
  5244. showActivityIndicator(!1);
  5245. enableAjaxSorting();
  5246. initInfoHovers();
  5247. f()
  5248. },
  5249. v = function(n, t, i, r, u) {
  5250. t == "timeout" ? u < 5 ? e(r, u + 1) : showErrorMessage(wr.G_TimeoutError, wr.G_TimeoutErrorTitle) : handleAjaxError(n, reportError)
  5251. },
  5252. e = function(i, r) {
  5253. n.ajax({
  5254. type: "POST",
  5255. url: t.dataUrl,
  5256. data: i,
  5257. success: a,
  5258. error: function(n, t, u) {
  5259. return v(n, t, u, i, r)
  5260. },
  5261. timeout: 13500
  5262. })
  5263. },
  5264. o;
  5265. n("#search").click(function() {
  5266. n(this).attr("disabled") != "disabled" && i.valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(i), i.submit())
  5267. });
  5268. i.validate(formValidateOptions);
  5269. n.trim(n("#keywords").val()).length > 0 && i.valid() && (showActivityIndicator(!0), o = i.serialize(), e(o, 0));
  5270. n("#historyDialog").jqm({
  5271. overlay: 10,
  5272. modal: !0
  5273. });
  5274. n("#showhistory").click(function() {
  5275. n("#historyDialog").jqmShow()
  5276. });
  5277. n("#historyContainer a").click(function() {
  5278. n("#keywords").val(n(this).text());
  5279. n("#search").trigger("click");
  5280. n("#historyDialog").jqmHide()
  5281. });
  5282. n("a.keyword").live("click", function() {
  5283. n("#keywords").val(n(this).text());
  5284. n("#search").trigger("click")
  5285. });
  5286. n("#keywords").keydown(textAreaWithLineLimit(t.lineLimit));
  5287. n("#keywordscontainer").bind("onsort", function() {
  5288. console.log("on sort");
  5289. f()
  5290. })
  5291. }
  5292. }(jQuery),
  5293. function(n) {
  5294. n.fn.linkexplorer = function() {
  5295. n("#linkExplorerForm").validate(formValidateOptions);
  5296. n("#exploreUrl").click(function() {
  5297. n("#linkExplorerForm").valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(n("#linkExplorerForm")), n("#linkExplorerForm").submit())
  5298. });
  5299. clickButtonOnEnter("#exploreUrl", ["#targetUrl", "#filterBySite", "#anchorText", "#additionalQuery"]);
  5300. n("#requery").live("click", function() {
  5301. n("#targetUrl").val(n(this).text());
  5302. n("#exploreUrl").trigger("click")
  5303. });
  5304. n("#historyDialog").jqm({
  5305. overlay: 10,
  5306. modal: !0
  5307. });
  5308. n("#showhistory").click(function() {
  5309. n("#historyDialog").jqmShow()
  5310. });
  5311. n("#historyContainer a").click(function() {
  5312. n("#targetUrl").val(n(this).text());
  5313. n("#exploreUrl").trigger("click");
  5314. n("#historyDialog").jqmHide()
  5315. })
  5316. }
  5317. }(jQuery),
  5318. function(n) {
  5319. function t() {
  5320. function u(t) {
  5321. var i = t,
  5322. r, u;
  5323. if (i.length < 1) {
  5324. $id("output").html(wr.MarkupValidation_NoUrlsEntered);
  5325. return
  5326. }
  5327. return r = n.validator.format("{0}/diagnostics/markup/processor/?url={1}", containerPrefix, url), u = {
  5328. SiteUrl: i
  5329. }, showActivityIndicator(!0), n.ajax({
  5330. url: r,
  5331. type: "POST",
  5332. data: u,
  5333. dataType: "json",
  5334. success: function(n) {
  5335. if (n != null) {
  5336. if (n.Throttling == "Error") return e(), !0;
  5337. if (n.MarkupValidation_BadUrl) return f(n.MarkupValidation_BadUrl), !0;
  5338. o(n)
  5339. } else s()
  5340. }
  5341. }), !0
  5342. }
  5343.  
  5344. function f(n) {
  5345. showErrorMessage(n, wr.G_Error)
  5346. }
  5347.  
  5348. function e() {
  5349. hideActivityIndicator();
  5350. unsetModalActivityIndicator();
  5351. showErrorMessageMarkUpBusy()
  5352. }
  5353.  
  5354. function o(i) {
  5355. t = [];
  5356. var f = !1,
  5357. u = {};
  5358. 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) {
  5359. var o, e;
  5360. 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)
  5361. for (f = !0, o = JSON.parse(i), e = 0; e < o.Entities.length; e++) r(o.Entities[e])
  5362. }), hideActivityIndicator(), unsetModalActivityIndicator(), !f) {
  5363. $id("output").html(wr.MarkupValidation_NoDataGot);
  5364. return
  5365. }
  5366. $id("output").html(t.join(""))
  5367. }
  5368.  
  5369. function r(n) {
  5370. var o = n.Properties,
  5371. h, f, i, s, u, e;
  5372. if (typeof o != "undefined") {
  5373. 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++)
  5374. if (i = o[f], !(i.Type.length < 0)) {
  5375. if (s = i.Type, i.Entities != null && i.Entities.length > 0 && i.Value == null) {
  5376. for (t.push("<li>"), t.push(s), t.push(":<\/li>"), t.push("<li>"), u = 0; u < i.Entities.length; u++)
  5377. if (i.Entities[u] == null) continue;
  5378. else r(i.Entities[u]);
  5379. t.push("<\/li>")
  5380. }
  5381. if (i.Value != null)
  5382. for (e = 0; e < i.Value.length; e++) t.push("<li>"), t.push(s), t.push(": " + i.Value[e] + "<\/li>")
  5383. }
  5384. t.push("<\/ul>")
  5385. }
  5386. }
  5387.  
  5388. function s(n) {
  5389. hideActivityIndicator();
  5390. unsetModalActivityIndicator();
  5391. reportError(n)
  5392. }
  5393.  
  5394. function h(n) {
  5395. u(n)
  5396. }
  5397. var i = {},
  5398. t = [];
  5399. return i.go = function() {
  5400. $id("markupValidateForm").validate(formValidateOptions);
  5401. $id("markupValidate").click(function() {
  5402. var n = $id("markupUrl").val();
  5403. $id("markupValidateForm").valid() && h(n)
  5404. });
  5405. $id("markupUrl").val().length > 0 && !isValueSameAsPalceHolder(n("#markupUrl").val(), n("#markupUrl")) && $id("markupValidate").trigger("click");
  5406. clickButtonOnEnter("#markupValidate", "#markupUrl")
  5407. }, i
  5408. }
  5409. n.markupValidatorController = function() {
  5410. return new t
  5411. }
  5412. }(jQuery),
  5413. function(n) {
  5414. n.fn.seoAnalyzer = function(t) {
  5415. function i(t) {
  5416. var r = t.data != null,
  5417. u = n("#site-nav-minor").width(),
  5418. i;
  5419. (r && n("#site-nav").hasClass("on") || !r && !n("#site-nav").hasClass("on")) && (u = 0);
  5420. i = n("#sandboxIframe").position();
  5421. isRTL && (i.left = 0);
  5422. var o = n(window).width(),
  5423. s = n(window).height(),
  5424. f = o - (i.left + u + 75),
  5425. e = s - (i.top + 100);
  5426. r ? n("#sandboxIframe").animate({
  5427. width: f
  5428. }, 400).height(e) : n("#sandboxIframe").width(f).height(e)
  5429. }
  5430.  
  5431. function r() {
  5432. if (n("#analyzeButtonForm").valid()) {
  5433. var i = n("#seoUrl").val();
  5434. document.location = t.seoAnalyzerUrl + "&paramUrl=" + encodeURIComponent(i)
  5435. }
  5436. }
  5437.  
  5438. function u() {
  5439. n(window).width() < 1220 && t.autoHideLeftNav == "true" && n("#site-nav").hasClass("on") && n("#site-nav-toggle-button").click();
  5440. n("#analyzeButtonForm").validate(formValidateOptions);
  5441. n("body > article").css({
  5442. "padding-bottom": "5px"
  5443. });
  5444. n("#site-nav-toggle-button").bind("click", {
  5445. siteNavToggle: !0
  5446. }, i);
  5447. n(window).resize(i).trigger("resize");
  5448. clickButtonOnEnter("#analyzeButton", "#seoUrl");
  5449. n("#analyzeButton").click(r)
  5450. }
  5451. u()
  5452. }
  5453. }(jQuery),
  5454. function(n) {
  5455. n.fn.seoSandbox = function(t) {
  5456. var r = {
  5457. iframeContents: null,
  5458. markerImages: null,
  5459. seoFloatingPopup: null,
  5460. lastActiveMarker: null,
  5461. isIframeReady: !1,
  5462. setupMarkers: function() {
  5463. r.positionMarkerImages(!0)
  5464. },
  5465. positionMarkerImages: function(t) {
  5466. r.iframeContents == null && (r.iframeContents = n("#analyzedPageIframe").contents());
  5467. r.markerImages.each(function() {
  5468. var e = n(this).attr("violationIndex"),
  5469. o = n(this).attr("seoSeverity"),
  5470. u, s, f;
  5471. 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({
  5472. position: "absolute",
  5473. top: f.top + u.height() / 2 - 12 + "px",
  5474. left: f.left - 24 + "px"
  5475. }), t && n(this).bind("mouseenter", {
  5476. violatingElement: u
  5477. }, r.markerMouseEnter).bind("mouseleave", {
  5478. violatingElement: u
  5479. }, r.markerMouseLeave).bind("click", {
  5480. violatingElement: u
  5481. }, r.markerClick)))
  5482. });
  5483. r.isIframeReady = !0
  5484. },
  5485. markerClick: function(t) {
  5486. var f = t.data.violatingElement,
  5487. u = n(this).attr("seoSeverity"),
  5488. e = n(this).attr("state");
  5489. 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"))
  5490. },
  5491. markerMouseLeave: function(n) {
  5492. var t = n.data.violatingElement
  5493. },
  5494. markerMouseEnter: function(t) {
  5495. var u = t.data.violatingElement,
  5496. e = n(this).attr("seoSeverity"),
  5497. l = n(this).attr("seorule"),
  5498. h = n(this).attr("violationindex"),
  5499. c, f, o, s;
  5500. (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({
  5501. position: "absolute",
  5502. top: s.top + 3 + u.height() + "px",
  5503. left: s.left - 1 + "px"
  5504. }))
  5505. },
  5506. setupViolationPanel: function(t, u, f, e, o) {
  5507. var h, c;
  5508. t.attr("class", "");
  5509. t.attr("class", "seoAnalyzer seoViolationMarkerPanel " + e + "Severity");
  5510. var y = n("#floatTitle", u),
  5511. p = n("#floatruleDescription", u),
  5512. l = n("#floatViolatingTag", u),
  5513. w = n("#floatErrorMsg", u),
  5514. a = n("#floatAction", u),
  5515. v = n("#floatExplanation", u),
  5516. s = "";
  5517. switch (e) {
  5518. case "high":
  5519. s = wr.Seo_Severityhigh;
  5520. break;
  5521. case "moderate":
  5522. s = wr.Seo_Severitymoderate;
  5523. break;
  5524. case "low":
  5525. s = wr.Seo_Severitylow
  5526. }
  5527. y.text(s);
  5528. 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)));
  5529. o != null ? (l.show(), l.text(r.getViolatingTag(o))) : l.hide()
  5530. },
  5531. getViolatingTag: function(n) {
  5532. var t = n.clone(),
  5533. i, r, u;
  5534. 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)
  5535. },
  5536. htmlDecodeString: function(t) {
  5537. return n("<div/>").html(t).text()
  5538. },
  5539. collapsableLinkClickHander: function() {
  5540. n(this).attr("state") == "0" ? r.seoDetailsExpandCollapse(!0, !1) : r.seoDetailsExpandCollapse(!1, !1)
  5541. },
  5542. seoDetailsExpandCollapse: function(n, t) {
  5543. var u = r.iframeContents.find("#seoDetails"),
  5544. i = r.iframeContents.find("#collapsableLink");
  5545. 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"))
  5546. },
  5547. filterMarkers: function(n) {
  5548. if (r.seoFloatingPopup != null && r.seoFloatingPopup.hide(), r.markerImages != null) {
  5549. r.markerImages.hide();
  5550. r.iframeContents.find(".highElemBorder, .ModerateElemBorder, .lowElemBorder").removeClass("highElemBorder ModerateElemBorder lowElemBorder");
  5551. var t = null;
  5552. switch (n) {
  5553. case "all":
  5554. t = r.markerImages;
  5555. break;
  5556. case "high":
  5557. t = r.markerImages.filter("img[seoseverity='High']");
  5558. break;
  5559. case "moderate":
  5560. t = r.markerImages.filter("img[seoseverity='Moderate']");
  5561. break;
  5562. case "low":
  5563. t = r.markerImages.filter("img[seoseverity='Low']");
  5564. break;
  5565. default:
  5566. t = r.markerImages.filter("img[seorule='" + n + "']")
  5567. }
  5568. t.show()
  5569. }
  5570. },
  5571. go: function() {
  5572. r.iframeContents = n("#analyzedPageIframe").contents();
  5573. n("#seoMarkerNodes", r.iframeContents).append(n("#seoFloat").clone());
  5574. r.seoFloatingPopup = n("#seoFloat", r.iframeContents);
  5575. r.markerImages = n("#seoMarkerNodes img", r.iframeContents);
  5576. setTimeout(function() {
  5577. r.setupMarkers();
  5578. n("#collapsableLink", r.iframeContents).click(r.collapsableLinkClickHander);
  5579. r.filterMarkers("all");
  5580. n("#seoAnalyzerVeil", r.iframeContents).hide("slow");
  5581. n("#renderWarning").show();
  5582. console.log("Page analysis Iframe is ready")
  5583. }, 1e3)
  5584. }
  5585. },
  5586. u = {
  5587. iframeContents: null,
  5588. sourceSpanTags: null,
  5589. filterMarkers: function(t) {
  5590. var r, f;
  5591. u.sourceSpanTags.css({
  5592. background: "",
  5593. border: "",
  5594. outline: ""
  5595. });
  5596. r = null;
  5597. switch (t) {
  5598. case "all":
  5599. r = u.sourceSpanTags;
  5600. break;
  5601. case "high":
  5602. r = u.sourceSpanTags.filter("[seoseverity='High']");
  5603. break;
  5604. case "moderate":
  5605. r = u.sourceSpanTags.filter("[seoseverity='Moderate']");
  5606. break;
  5607. case "low":
  5608. r = u.sourceSpanTags.filter("[seoseverity='Low']");
  5609. break;
  5610. default:
  5611. r = u.sourceSpanTags.filter("[seorule='" + t + "']")
  5612. }
  5613. r.css("background", "yellow").css("border", "1px solid red");
  5614. f = n.map(r, function(t) {
  5615. return parseInt(n(t).attr("violationindex"))
  5616. });
  5617. i.currentSourceTabMarkerIndex = -1;
  5618. i.sourceTabMarkers = f
  5619. },
  5620. go: function() {
  5621. "25" in i.seoPageFailureDetails || document.getElementById("pageSourceIframe").contentWindow.prettyPrint();
  5622. u.iframeContents = n("#pageSourceIframe").contents();
  5623. u.sourceSpanTags = n("span.seoSourceMarker", u.iframeContents);
  5624. u.filterMarkers("all");
  5625. console.log("Page Source Iframe is ready")
  5626. }
  5627. },
  5628. i = {
  5629. seoPageFailureDetails: null,
  5630. updateTimer: null,
  5631. updateInterval: 1e3,
  5632. maxFetchAttempts: 15,
  5633. fetchAttemptCounter: 0,
  5634. sourceTabMarkers: null,
  5635. currentSourceTabMarkerIndex: -1,
  5636. analyzedPageIframeHeight: 0,
  5637. pageSourceIframeHeight: 0,
  5638. markerArrowsClicked: function() {
  5639. var r = n(this).attr("action"),
  5640. t;
  5641. 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({
  5642. border: "",
  5643. outline: ""
  5644. }), n(t, u.iframeContents).css("outline", "1px solid red"))
  5645. },
  5646. scrollIframeContent: function(n, t) {
  5647. var i = n.find(t).offset();
  5648. n.find("html,body").stop().animate({
  5649. scrollTop: i.top - 50,
  5650. scrollLeft: i.left
  5651. }, 1e3)
  5652. },
  5653. showHideRuleDetail: function() {
  5654. var u = n(this).attr("seoSeverity"),
  5655. f = n(this).attr("state"),
  5656. e = n(this).attr("seorule"),
  5657. t = n("#seoFloat");
  5658. 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({
  5659. my: "left top",
  5660. at: "left bottom",
  5661. of: n(this),
  5662. offset: "-1 3"
  5663. }))
  5664. },
  5665. hideSeoFloat: function(t, r) {
  5666. var f = t.attr("seoSeverity"),
  5667. u = n("#seoFloat");
  5668. i.setMarkerSourceAndState(t, "plus", f);
  5669. r ? u.hide("slow") : u.hide()
  5670. },
  5671. getMarkerSource: function(t, i) {
  5672. var r = window.location.protocol + "//" + window.location.host;
  5673. return n.validator.format("{0}/webmaster/content/images/{1}_{2}_severity.png", r, t, i)
  5674. },
  5675. setMarkerSourceAndState: function(n, t, r) {
  5676. var f = i.getMarkerSource(t, r),
  5677. u = 1;
  5678. t == "minus" && (u = 0);
  5679. n.attr("src", f).attr("state", u)
  5680. },
  5681. rowClicked: function() {
  5682. var t = n(this).attr("id").split("_")[1],
  5683. o = n(this).attr("seoseverity"),
  5684. e;
  5685. n("input[name='violationFilter']").removeAttr("checked");
  5686. n("tr", n(this).parent()).removeClass("selectedRow");
  5687. n(this).addClass("selectedRow");
  5688. n("#clearSelection").show();
  5689. var a = n("#analyzedPageMessage td"),
  5690. v = n("#sourcePageMessage td"),
  5691. y = i.getMarkerSource("plus", o);
  5692. n("img.analyzedPageImgTag", "#iFrametabContainer").attr("src", y).attr("state", "1").attr("seorule", t).attr("seoseverity", o);
  5693. n("#seoFloat").hide();
  5694. var f = Encoder.htmlEncode(n("td", n(this)).filter(":nth-child(2)").text()),
  5695. s = f,
  5696. h = f,
  5697. c = n.validator.format("[seorule='{0}']", t),
  5698. l = !0;
  5699. r.markerImages.filter(c).length > 0 && n("[seoruleid=" + t + "]:visible", r.iframeContents).length > 0 && (l = !1);
  5700. r.markerImages != null && l && (s = n.validator.format("{0} <b>{1}<\/b>", f, wr.Seo_RuleNotVisible));
  5701. u.sourceSpanTags != null && u.sourceSpanTags.filter(c).length == 0 && (h = n.validator.format("{0} <b>{1}<\/b>", f, wr.Seo_RuleNotVisible));
  5702. a.last().html(s);
  5703. v.last().html(h);
  5704. r.filterMarkers(t);
  5705. u.filterMarkers(t);
  5706. n("#iFrametabContainer .selected-rule-box").is(":visible") || (e = !1, n("#iFrametabContainer .selected-rule-box").slideDown("slow", function() {
  5707. if (!e) {
  5708. var t = n("#analyzedPageRuleBox").outerHeight(!0) > n("#pageSourceRuleBox").outerHeight(!0) ? n("#analyzedPageRuleBox").outerHeight(!0) : n("#pageSourceRuleBox").outerHeight(!0);
  5709. i.analyzedPageIframeHeight = n("#analyzedPageIframe").outerHeight();
  5710. i.pageSourceIframeHeight = n("#pageSourceIframe").outerHeight();
  5711. n("#analyzedPageIframe").outerHeight(i.analyzedPageIframeHeight - t + 5);
  5712. n("#pageSourceIframe").outerHeight(i.pageSourceIframeHeight - t + 5);
  5713. e = !0
  5714. }
  5715. }))
  5716. },
  5717. clearFilter: function() {
  5718. n("#rulesTable tbody tr").removeClass("selectedRow");
  5719. n("#seoFloat").hide();
  5720. n("#iFrametabContainer .selected-rule-box").each(function() {
  5721. var t = n(this);
  5722. t.is(":visible") ? t.slideUp("slow") : t.css({
  5723. display: "none"
  5724. })
  5725. });
  5726. i.analyzedPageIframeHeight > 0 && n("#analyzedPageIframe").outerHeight(i.analyzedPageIframeHeight);
  5727. i.pageSourceIframeHeight > 0 && n("#pageSourceIframe").outerHeight(i.pageSourceIframeHeight);
  5728. var t = "all";
  5729. r.filterMarkers(t);
  5730. u.filterMarkers(t);
  5731. n("#clearSelection").hide()
  5732. },
  5733. resizeIframeWindows: function() {
  5734. var f = n("#iFrametabContainer .tabs-body").offset(),
  5735. t = n(window).width() - 310,
  5736. u = n(window).height() - f.top;
  5737. n(".tab_text").width(t + 5);
  5738. n("#analyzedPageIframe").width(t).height(u - 20);
  5739. n("#pageSourceIframe").width(t).height(u);
  5740. n("#actualPageIframe").width(t).height(u);
  5741. r.isIframeReady && r.positionMarkerImages(!1);
  5742. i.resizeRedirectsTableContainer()
  5743. },
  5744. resizeRedirectsTableContainer: function() {
  5745. var t = n("#redirectsTableContainer").offset(),
  5746. i = n(window).height() - t.top;
  5747. n("#redirectsTableContainer").height(i)
  5748. },
  5749. setIframeSources: function(i) {
  5750. var r = n.validator.format("{0}&id={1}", t.renderedAnalyzedPageUrl, i),
  5751. u = n.validator.format("{0}&id={1}", t.renderedSourcePageUrl, i);
  5752. n("#analyzedPageIframe").attr("src", r);
  5753. n("#pageSourceIframe").attr("src", u)
  5754. },
  5755. setOriginaliFrameSrc: function() {
  5756. n("#actualPageIframe").attr("url") != n("#actualPageIframe").attr("src") && n("#actualPageIframe").attr("src", n("#actualPageIframe").attr("url"))
  5757. },
  5758. resetIframeSources: function() {
  5759. n("#analyzedPageIframe").attr("src", "");
  5760. n("#actualPageIframe").attr("src", "");
  5761. n("#pageSourceIframe").attr("src", "")
  5762. },
  5763. analyzeUrlPoll: function(f) {
  5764. i.updateTimer = setTimeout(function() {
  5765. n.get(t.pageAnalysisResultUrl, {
  5766. id: f
  5767. }, function(t) {
  5768. 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() {
  5769. n("#seoActivityIndicator").hide()
  5770. }, 2e3);
  5771. else if (t.Status == "UrlNotProcessed" && i.fetchAttemptCounter > 0) i.fetchAttemptCounter--, i.analyzeUrlPoll(f);
  5772. else {
  5773. if (n("#seoActivityIndicator").hide(), console.log("FetchAttempt count:" + i.fetchAttemptCounter), t.ErrMsg == null) return;
  5774. t.redirectChain != null && t.redirectChain.length > 1 && i.displayRedirectsTableOnError(t.redirectChain);
  5775. n("div.validationErrorPlaceholder").html(n.validator.format('<label class="error" for="seoUrl" generated="false">{0}<\/label>', t.ErrMsg));
  5776. console.log("Error:" + t.ErrMsg)
  5777. }
  5778. })
  5779. }, i.updateInterval)
  5780. },
  5781. analyzeUrl: function() {
  5782. var r = t.requestId;
  5783. r != "" && i.validateParentIframe() && (n("#seoActivityIndicator").show(), i.fetchAttemptCounter = i.maxFetchAttempts, i.analyzeUrlPoll(r))
  5784. },
  5785. validateParentIframe: function() {
  5786. function r(n) {
  5787. return n.match(/:\/\/(.[^/?]+)/)[1]
  5788. }
  5789. var n, i;
  5790. 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)
  5791. },
  5792. populateRulesFilterTable: function() {
  5793. if (i.seoPageFailureDetails != null) {
  5794. var t = [],
  5795. r = "",
  5796. u = "<tr seoseverity='{0}' id='ruleId_{1}'><td class='lpad row{0}'>{2}<\/td><td class='lpad'>{3}<\/td><\/tr>";
  5797. n.each(i.seoPageFailureDetails, function(i, f) {
  5798. r = n.validator.format(u, f.SeverityEnumString, i, f.ErrorCountFormatted, n("<div/>").text(f.Description).html());
  5799. t.push(r)
  5800. });
  5801. 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())
  5802. }
  5803. },
  5804. toggleRulesFilterTable: function() {
  5805. n("#suggestionsShow").toggle(function() {
  5806. n("#rulesFilterContainer").hide();
  5807. n("#suggestionsShow").text(wr.G_Show);
  5808. i.resizeRedirectsTableContainer()
  5809. }, function() {
  5810. n("#rulesFilterContainer").show();
  5811. n("#suggestionsShow").text(wr.G_Hide);
  5812. i.resizeRedirectsTableContainer()
  5813. })
  5814. },
  5815. populateRedirectsTable: function(t) {
  5816. var i = [],
  5817. r = "",
  5818. u = "<tr><td class='lpad'>{0}<\/td><td class='lpad'>{1}<\/td><\/tr>";
  5819. n.each(t, function(t, f) {
  5820. r = n.validator.format(u, f.StatusCode, f.Url);
  5821. i.push(r)
  5822. });
  5823. i.length > 0 && n("#redirectsTable tbody").html(i.join(""))
  5824. },
  5825. toggleRedirects: function() {
  5826. n("#redirectsShow").toggle(function() {
  5827. n("#redirectsTable").show();
  5828. n("#redirectsShow").text(wr.G_Hide)
  5829. }, function() {
  5830. n("#redirectsTable").hide();
  5831. n("#redirectsShow").text(wr.G_Show)
  5832. })
  5833. },
  5834. displayRedirectsTableOnError: function(t) {
  5835. n("#seoResultTable").before(n("#redirectsContainer"));
  5836. n("#redirectsContainer").show();
  5837. n("#redirectsShow").hide();
  5838. n("#redirectsTable").css({
  5839. width: "50%"
  5840. });
  5841. n("#redirectsTable").show();
  5842. i.populateRedirectsTable(t)
  5843. },
  5844. tabInitialize: function() {
  5845. var t = n("div.tabs-header a");
  5846. t.click(function() {
  5847. t.removeClass("on");
  5848. n(this).addClass("on");
  5849. n("div.tabs-body > div").removeClass("on");
  5850. n("div.tabs-body > div[name=" + n(this).attr("href") + "]").addClass("on");
  5851. n("#iFrametabContainer .analyzedPageImgTag").each(function() {
  5852. n(this).attr("state") == "0" && i.hideSeoFloat(n(this), !1)
  5853. });
  5854. n(this).attr("href") == "#tab3" && i.setOriginaliFrameSrc()
  5855. })
  5856. },
  5857. go: function() {
  5858. i.tabInitialize();
  5859. r.isIframeReady = !1;
  5860. n("#iFrametabContainer .analyzedPageImgTag").click(i.showHideRuleDetail);
  5861. n("#buttonContainer .seoArrowButton").mouseenter(function() {
  5862. n(this).addClass("seoArrowButtonHover")
  5863. }).mouseleave(function() {
  5864. n(this).removeClass("seoArrowButtonHover")
  5865. }).mousedown(function() {
  5866. n(this).addClass("seoArrowButtonClick")
  5867. }).mouseup(function() {
  5868. n(this).removeClass("seoArrowButtonClick")
  5869. }).click(i.markerArrowsClicked);
  5870. n("#seoResultTable").hide();
  5871. n("#clearSelection").click(i.clearFilter);
  5872. i.toggleRulesFilterTable();
  5873. i.toggleRedirects();
  5874. i.analyzeUrl()
  5875. }
  5876. };
  5877. i.go()
  5878. }
  5879. }(jQuery),
  5880. function(n) {
  5881. n.fn.sitemove = function(t) {
  5882. function e(t) {
  5883. console.log("addParamSuccess", t);
  5884. hideActivityIndicator();
  5885. unsetModalActivityIndicator();
  5886. i();
  5887. n("#sourceurl").val("");
  5888. n("#targeturl").val("");
  5889. n("#scope").val("2");
  5890. n("#sourceurl").prop("readonly", !1);
  5891. n("#paramList table.wmtable span[sourceurl]").each(function() {
  5892. n(this).attr("sourceurl") == t.SourceUrl && n(this).parent().parent().remove()
  5893. });
  5894. var r = n("<tr/>");
  5895. 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));
  5896. n("#paramList table.wmtable tbody").prepend(r);
  5897. n("#paramList table.wmtable").trigger("update")
  5898. }
  5899.  
  5900. function o(n) {
  5901. hideActivityIndicator();
  5902. unsetModalActivityIndicator();
  5903. i();
  5904. reportError(n)
  5905. }
  5906.  
  5907. function r(n, t) {
  5908. if (t.length < 1) return t;
  5909. if (t[t.length - 1] != "/" && (t += "/"), n == "0") {
  5910. var i = t.indexOf("://");
  5911. t = i > 0 ? t.substring(0, i + 3) + "*." + t.substring(i + 3) : "*." + t
  5912. }
  5913. return t + "*"
  5914. }
  5915. var i = function() {
  5916. n("#sourceurl").prop("disabled", !1);
  5917. n("#targeturl").prop("disabled", !1);
  5918. n("#scope").prop("disabled", !1);
  5919. n("#addParam").prop("disabled", !1)
  5920. },
  5921. f = function() {
  5922. n("#sourceurl").prop("disabled", !0);
  5923. n("#targeturl").prop("disabled", !0);
  5924. n("#scope").prop("disabled", !0);
  5925. n("#addParam").prop("disabled", !0)
  5926. },
  5927. u;
  5928. n("#sitemoveconfirm").click(function() {
  5929. if ((n("#sitemoveconfirmdialog").jqmHide(), n(this).attr("disabled") != "disabled" && !window.readOnlyMode) && n("#addParamForm").valid()) {
  5930. var i = {
  5931. SourceUrl: n("#sourceurl").val(),
  5932. TargetUrl: n("#targeturl").val(),
  5933. Scope: n("#scope").val()
  5934. };
  5935. showActivityIndicator(!0);
  5936. f();
  5937. startPostRequestWithJson({
  5938. settings: JSON.stringify(i)
  5939. }, t.AddUrl, e, o, "#addParamForm")
  5940. }
  5941. });
  5942. n("#addParam").click(function() {
  5943. if (n("#addParamForm").valid()) {
  5944. n("#confirmtype").text(n("#movetypeglobal").is(":checked") ? wr.SiteMove_TypeGlobal : wr.SiteMove_TypeLocal);
  5945. n("#confirmscope").text(n("#scope > option:selected").text());
  5946. n("#confirmsource").text(n("#sourceurl").val());
  5947. n("#confirmtarget").text(n("#targeturl").val());
  5948. var t = r(n("#scope").val(), n("#sourceurl").val()),
  5949. i = r(n("#scope").val(), n("#targeturl").val());
  5950. n("#confirmexamplesource").text(t);
  5951. n("#confirmexampletarget").text(i);
  5952. n("#sitemoveconfirmdialog").jqmShow()
  5953. }
  5954. });
  5955. n("#sitemoveconfirmdialog").jqm({
  5956. overlay: 10,
  5957. modal: !0
  5958. });
  5959. n("#addParamForm").validate(formValidateOptions);
  5960. clickButtonOnEnter("#addParam", ["#sourceurl", "#targeturl"]);
  5961. n("#scope").change(function() {
  5962. 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)
  5963. });
  5964. u = function(t, i) {
  5965. n("#targeturl").val(t);
  5966. n("#targetsitelink").text(i)
  5967. };
  5968. n("#targetsitelink").click(function(t) {
  5969. n("#movetypeglobal").is(":checked") || n("#movetypeglobal").click();
  5970. var i = n("#targetsitelink").offset(),
  5971. r, f = i.top + n("#targetsitelink").height();
  5972. r = isRTL ? {
  5973. right: i.right,
  5974. top: f
  5975. } : {
  5976. left: i.left,
  5977. top: f
  5978. };
  5979. n("#siteSelector").siteSelector(null, t, {
  5980. callback: u,
  5981. offset: r,
  5982. width: 350
  5983. })
  5984. });
  5985. n.browser.msie && n("#targetsitelinkcontainer").click(function(n) {
  5986. n.stopPropagation()
  5987. })
  5988. }
  5989. }(jQuery),
  5990. function(n) {
  5991. n.fn.diagnostics = function(t) {
  5992. function r(t, i, r, u) {
  5993. var e = n(i).val(),
  5994. f;
  5995. n(r).valid() && (f = null, f = n.validator.format("{0}&{1}={2}", t, u, encodeURIComponent(e)), window.location = f)
  5996. }
  5997. var u = function() {
  5998. r(t.linkExplorerUrl, "#exploreUrl", "#linkExploreForm", "targetUrl")
  5999. },
  6000. f = function() {
  6001. r(t.fetchBingbotUrl, "#fetchUrl", "#botFetchForm", "paramurl")
  6002. },
  6003. e = function() {
  6004. r(t.markupValidatorUrl, "#markupUrl", "#markupValidateForm", "paramurl")
  6005. },
  6006. o = function() {
  6007. r(t.seoAnalyzerUrl, "#seoUrl", "#seoAnalyzeForm", "paramurl")
  6008. },
  6009. i;
  6010. n("#linkExplore").click(u);
  6011. n("#botFetch").click(f);
  6012. n("#markupValidate").click(e);
  6013. n("#seoAnalyze").click(o);
  6014. n("#linkExploreForm").validate(formValidateOptions);
  6015. n("#botFetchForm").validate(formValidateOptions);
  6016. n("#markupValidateForm").validate(formValidateOptions);
  6017. n("#seoAnalyzeForm").validate(formValidateOptions);
  6018. clickButtonOnEnter("#linkExplore", "#exploreUrl");
  6019. clickButtonOnEnter("#botFetch", "#fetchUrl");
  6020. clickButtonOnEnter("#markupValidate", "#markupUrl");
  6021. clickButtonOnEnter("#seoAnalyze", "#seoUrl");
  6022. i = n("#keywordresearchsearchform");
  6023. i.validate(formValidateOptions);
  6024. n("#keywordresearchsearch").click(function() {
  6025. i.valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(i), i.submit())
  6026. });
  6027. n("#keywords").keydown(textAreaWithLineLimit(t.keywordsLineLimit))
  6028. }
  6029. }(jQuery),
  6030. function(n) {
  6031. n.fn.verifybingbot = function() {
  6032. n("#addParamForm").validate(n.extend(!0, {}, formValidateOptions, {
  6033. onsubmit: !0
  6034. }));
  6035. n("#addParam").click(function() {
  6036. n("#addParamForm").valid() && (showActivityIndicator(!0), fixPlaceholdersBeforeInFormSubmit(n("#addParamForm")), n("#addParamForm").submit())
  6037. });
  6038. clickButtonOnEnter("#addParam", ["#ip"])
  6039. }
  6040. }(jQuery),
  6041. function(n) {
  6042. n.fn.developerSelector = function(t) {
  6043. function s() {
  6044. showActivityIndicator(!1);
  6045. n("#developersTableContainer").load(t.developersReportTableUrl, {
  6046. startDate: n("#keywordRangeFrom").val(),
  6047. endDate: n("#keywordRangeTo").val(),
  6048. appid: t.appId
  6049. }, function() {
  6050. hideActivityIndicator()
  6051. })
  6052. }
  6053.  
  6054. function h() {
  6055. var i = n(this).parent().parent().parent().find(":checkbox"),
  6056. r;
  6057. return console.log(n(this)), console.log(i), r = i.attr("appID"), document.location.href = [t.developersEditAppIdUrl, "?appId=", r].join(""), !1
  6058. }
  6059.  
  6060. function c() {
  6061. var i, r;
  6062. console.log(n(this));
  6063. i = n(this).parent().parent().parent().find(":checkbox");
  6064. console.log(i);
  6065. r = i.attr("appID");
  6066. document.location.href = [t.developersReportAppIdUrl, "?appId=", r].join("")
  6067. }
  6068.  
  6069. function l() {
  6070. document.location.href = t.developersShowAppIdUrl
  6071. }
  6072.  
  6073. function u(n) {
  6074. hideActivityIndicator();
  6075. unsetModalActivityIndicator();
  6076. reportError(n)
  6077. }
  6078.  
  6079. function f(i) {
  6080. var r, y, p;
  6081. if (n("#DevelopersSubmitForm").validate(formValidateOptions), $id("DevelopersSubmitForm").valid()) {
  6082. r = null;
  6083. i && (r = $id("appId").text());
  6084. var e = $id("appIdName").val(),
  6085. o = $id("appIdDesc").val(),
  6086. s = $id("appIdCompName").val(),
  6087. h = $id("appIdCountryRegion").val(),
  6088. c = $id("appIdEmailAddress").val(),
  6089. f, l = $id("appIdWebsite").val();
  6090. f = $id("promotionOffers").is(":checked") ? "on" : "off";
  6091. showActivityIndicator(!0);
  6092. i ? (y = {
  6093. appId: r,
  6094. appName: e,
  6095. appDescription: o,
  6096. companyName: s,
  6097. countryRegion: h,
  6098. contactEmail: c,
  6099. emailPromotion: f,
  6100. website: l
  6101. }, startPostRequestWithJson(y, t.UpdateUrl, v, u, "#DevelopersSubmitForm")) : (p = {
  6102. appName: e,
  6103. appDescription: o,
  6104. companyName: s,
  6105. countryRegion: h,
  6106. contactEmail: c,
  6107. emailPromotion: f,
  6108. website: l
  6109. }, startPostRequestWithJson(p, t.AddUrl, a, u, "#DevelopersSubmitForm"))
  6110. }
  6111. }
  6112.  
  6113. function a() {
  6114. n("#thankyouPage").jqm({
  6115. overlay: 5,
  6116. modal: !0
  6117. }).jqmShow()
  6118. }
  6119.  
  6120. function v() {
  6121. e()
  6122. }
  6123.  
  6124. function e() {
  6125. hideActivityIndicator();
  6126. unsetModalActivityIndicator();
  6127. n("#submitEditAppid").hide();
  6128. n("#submitAppid").hide();
  6129. n("#cancelAppid").hide();
  6130. document.location.href = t.developersShowAppIdUrl
  6131. }
  6132.  
  6133. function y() {
  6134. e()
  6135. }
  6136.  
  6137. function p() {
  6138. f(!0)
  6139. }
  6140.  
  6141. function w() {
  6142. document.location.href = t.developersCreateAppIdUrl
  6143. }
  6144.  
  6145. function b() {
  6146. f(!1)
  6147. }
  6148.  
  6149. function k() {
  6150. if (r = [], n("table.wmtable :checked").each(function() {
  6151. var t = n(this),
  6152. i = t.attr("appID");
  6153. r.push(i)
  6154. }), r.length > 0) {
  6155. var t = "";
  6156. for (i = 0; i < r.length; i++) t = t + "<tr><td>" + r[i] + "<\/td><\/tr>";
  6157. n("#deleteConfirmPage tbody").prepend(t);
  6158. n("#deleteConfirmPage").jqm({
  6159. overlay: 5,
  6160. modal: !0
  6161. }).jqmShow()
  6162. }
  6163. }
  6164.  
  6165. function d() {
  6166. r = [];
  6167. triggerCheckboxChange();
  6168. n("#deleteConfirmPage").hide();
  6169. n("#delTable > tbody").empty()
  6170. }
  6171.  
  6172. function g() {
  6173. r = [];
  6174. document.location.href = t.developersShowAppIdUrl
  6175. }
  6176.  
  6177. function nt() {
  6178. n("#deleteConfirmPage").hide();
  6179. showActivityIndicator(!0);
  6180. startPostRequestWithJson({
  6181. appIds: r
  6182. }, t.RemoveUrl, g, u, "#deleteConfirmPage", null, {
  6183. traditional: !0
  6184. })
  6185. }
  6186.  
  6187. function tt() {
  6188. var n = document.getElementById("appIdsName"),
  6189. i = n.options[n.selectedIndex].value,
  6190. r = n.options[n.selectedIndex].text;
  6191. console.log(r + i);
  6192. document.location.href = [t.developersReportAppIdUrl, "?appId=", i].join("")
  6193. }
  6194.  
  6195. function it() {
  6196. n("#appIdsName").live("change", function() {
  6197. tt()
  6198. });
  6199. n("#appIdDevelopersList table.wmtable :checkbox").live("change", o);
  6200. n('table.wmtable tbody a[action="edit"]').click(h);
  6201. n('table.wmtable tbody a[action="appId"]').click(c);
  6202. n("#cancelAppid").click(l);
  6203. n("#submitEditAppid").click(p);
  6204. n("#addAppId").click(w);
  6205. n("#submitAppid").click(b);
  6206. n("#deleteAppId").click(k);
  6207. n("#deleteConfirm").click(nt);
  6208. n("#deleteCancel").click(d);
  6209. n("#thankYouOk").click(y);
  6210. var r = getStandartChartOptions(),
  6211. u = n("#chart"),
  6212. f = n('.charts-legend input[type="checkbox"]'),
  6213. i = [
  6214. [],
  6215. []
  6216. ],
  6217. e;
  6218. splitChartData(t.data, i, 2);
  6219. e = setupChart(u, r, f, i, "#keywordRangeFrom", "#keywordRangeTo", "#keywordRangeContainer", "#site-nav-toggle-button");
  6220. n("#keywordRangeContainer").live("dateChanged", s)
  6221. }
  6222. var r = [],
  6223. o = setupGridCheckButtonEnabler("#appIdDevelopersList table.wmtable", "#deleteAppId");
  6224. it()
  6225. }
  6226. }(jQuery),
  6227. function(n) {
  6228. n.fn.adminappidsreport = function() {
  6229. n("#submitParam").click(function() {
  6230. n("#addParamForm").submit()
  6231. })
  6232. }
  6233. }(jQuery),
  6234. function(n) {
  6235. n.fn.articleCategories = function(t) {
  6236. function r() {
  6237. n("#helpCategoriesTableContainer tbody tr").removeClass("row-selected");
  6238. var r = n(this).parent(),
  6239. i = n("td > input", r),
  6240. u = n("td:nth-child(2)", r).text(),
  6241. f = i.attr("categoryId"),
  6242. e = i.attr("culture"),
  6243. o = i.attr("sortOrder"),
  6244. s = i.attr("landingArticleId");
  6245. n("#title").val(u);
  6246. n("#SortOrder").val(o);
  6247. n("#LandingArticleId").val(s);
  6248. n("#Culture").val(e);
  6249. n("#categoryId").val(f);
  6250. n("#submitParam").val("Update Selected");
  6251. n("#clearSelection").show();
  6252. n("#categoryForm").attr("action", t.updateCatoryUrl);
  6253. r.addClass("row-selected")
  6254. }
  6255.  
  6256. function u() {
  6257. n("#categoryForm").valid() && n("#categoryForm").submit()
  6258. }
  6259.  
  6260. function f() {
  6261. n("#title").val("");
  6262. n("#SortOrder").val("");
  6263. n("#LandingArticleId").val("");
  6264. n("#helpCategoriesTableContainer tbody tr").removeClass("row-selected");
  6265. n("#submitParam").val("Add");
  6266. n("#clearSelection").hide();
  6267. n("#categoryForm").attr("action", t.addCategoryUrl)
  6268. }
  6269.  
  6270. function e() {
  6271. var t = i.filter(":checked");
  6272. n("#deleteCategory").prop("disabled", t.length == 0)
  6273. }
  6274.  
  6275. function o() {
  6276. n.ajax({
  6277. type: "POST",
  6278. url: t.deleteCatoryUrl,
  6279. data: s(),
  6280. contentType: "application/json;",
  6281. dataType: "json",
  6282. success: function() {
  6283. window.location.reload(!0)
  6284. }
  6285. })
  6286. }
  6287.  
  6288. function s() {
  6289. var t = [],
  6290. r = i.filter(":checked");
  6291. return n.each(r, function() {
  6292. var i = {
  6293. categoryid: n(this).attr("categoryid"),
  6294. culture: n(this).attr("culture")
  6295. };
  6296. t.push(i)
  6297. }), JSON.stringify(t)
  6298. }
  6299.  
  6300. function h() {
  6301. n("#helpCategoriesTableContainer tbody td:not(:first-child)").click(r);
  6302. n("#submitParam").click(u);
  6303. n("#clearSelection").click(f);
  6304. n("#categoryForm").attr("action", t.addCategoryUrl);
  6305. n("#title").val("");
  6306. n("#SortOrder").val("");
  6307. n("#deleteCategory").prop("disabled", !0);
  6308. i.change(e);
  6309. n("#deleteCategory").click(o);
  6310. n("#categoryForm").validate(formValidateOptions)
  6311. }
  6312. var i = n("#helpCategoriesTableContainer input[type='checkbox']");
  6313. h()
  6314. }
  6315. }(jQuery),
  6316. function(n) {
  6317. n.fn.articledetail = function(t) {
  6318. function i() {
  6319. window.open(t.previewUrl, "helppreview")
  6320. }
  6321.  
  6322. function r() {
  6323. n("#helpArticleForm input[type='text']").each(function() {
  6324. n(this).val() == n(this).attr("placeholder") && n(this).val("")
  6325. });
  6326. (n("#state").val() == 1 || n("#helpArticleForm").valid()) && (n("#helpArticleForm").attr("action", t.saveDraftUrl), n("#helpArticleForm").submit())
  6327. }
  6328.  
  6329. function u() {
  6330. n("#helpArticleForm").attr("action", t.discardDraftUrl);
  6331. n("#helpArticleForm").submit()
  6332. }
  6333.  
  6334. function f() {
  6335. n("#helpArticleForm").attr("action", t.publishUrl);
  6336. n("#helpArticleForm").submit()
  6337. }
  6338.  
  6339. function e() {
  6340. n("#helpArticleForm").attr("action", t.unPublishUrl);
  6341. n("#helpArticleForm").submit()
  6342. }
  6343.  
  6344. function o() {
  6345. n("#helpArticleForm").attr("action", t.deleteUrl);
  6346. n("#helpArticleForm").submit()
  6347. }
  6348.  
  6349. function s() {
  6350. document.location.href = t.cancelUrl
  6351. }
  6352.  
  6353. function h() {
  6354. var t = n("#state").val();
  6355. n(".filter-block input").removeAttr("disabled");
  6356. switch (t) {
  6357. case "1":
  6358. n("#discardDraft").hide();
  6359. n("#publishArticle").prop("disabled", !0);
  6360. n("#helpArticleForm input[type='text']").prop("readOnly", !0);
  6361. n("#helpArticleForm select").prop("readOnly", !0);
  6362. n("#helpArticleForm textarea").prop("readOnly", !0);
  6363. break;
  6364. case "2":
  6365. n("#discardDraft").hide();
  6366. n("#unPublishArticle").hide()
  6367. }
  6368. }
  6369.  
  6370. function c() {
  6371. n.validator.addClassRules({
  6372. helpTextRequired: {
  6373. required: function() {
  6374. var t = n("#RedirectUrl");
  6375. return t.val().length == 0 ? !0 : isValueSameAsPalceHolder(t.val(), t)
  6376. }
  6377. }
  6378. })
  6379. }
  6380.  
  6381. function l() {
  6382. h();
  6383. c();
  6384. n("#preview").click(i);
  6385. n("#saveDraft").click(r);
  6386. n("#discardDraft").click(u);
  6387. n("#publishArticle").click(f);
  6388. n("#unPublishArticle").click(e);
  6389. n("#deleteArticle").click(o);
  6390. n("#cancel").click(s);
  6391. n("#CategoryId").val(t.selectedCategory);
  6392. n("#helpArticleForm").validate(formValidateOptions)
  6393. }
  6394. l()
  6395. }
  6396. }(jQuery),
  6397. function(n) {
  6398. n.fn.articlesreport = function(t) {
  6399. function u() {
  6400. var t = n("td > input", n(this).parent()).attr("url");
  6401. document.location.href = t
  6402. }
  6403.  
  6404. function f() {
  6405. var f = i.filter(":checked"),
  6406. t = !0,
  6407. r = !0,
  6408. u = !1;
  6409. n.each(f, function() {
  6410. u = !0;
  6411. n(this).attr("state") == "1" && (t = !1);
  6412. n(this).attr("state") == "2" && (r = !1)
  6413. });
  6414. u == !1 && (t = !1, r = !1);
  6415. n("#publishArticle").prop("disabled", !t);
  6416. n("#unPublishArticle").prop("disabled", !r);
  6417. n("#deleteArticle").prop("disabled", !u)
  6418. }
  6419.  
  6420. function e() {
  6421. document.location.href = t.addNewArticleUrl
  6422. }
  6423.  
  6424. function o() {
  6425. r(t.publishBulkUrl)
  6426. }
  6427.  
  6428. function s() {
  6429. r(t.unpublishBulkUrl)
  6430. }
  6431.  
  6432. function h() {
  6433. r(t.deleteBulkUrl)
  6434. }
  6435.  
  6436. function r(t) {
  6437. n.ajax({
  6438. type: "POST",
  6439. url: t,
  6440. data: c(),
  6441. contentType: "application/json;",
  6442. dataType: "json",
  6443. success: function() {
  6444. window.location.reload(!0)
  6445. }
  6446. })
  6447. }
  6448.  
  6449. function c() {
  6450. var t = [],
  6451. r = i.filter(":checked");
  6452. return n.each(r, function() {
  6453. var i = {
  6454. articleid: n(this).attr("articleid"),
  6455. version: n(this).attr("version"),
  6456. culture: n(this).attr("culture")
  6457. };
  6458. t.push(i)
  6459. }), JSON.stringify(t)
  6460. }
  6461.  
  6462. function l() {
  6463. i.prop("checked", !1);
  6464. n("#addArticle").prop("disabled", !1);
  6465. n("#publishArticle").prop("disabled", !0);
  6466. n("#unPublishArticle").prop("disabled", !0);
  6467. n("#deleteArticle").prop("disabled", !0);
  6468. n("#helpArticlesTableContainer tbody td:not(:nth-child(1), :nth-child(2))").click(u);
  6469. i.change(f);
  6470. n("#addArticle").click(e);
  6471. n("#publishArticle").click(o);
  6472. n("#unPublishArticle").click(s);
  6473. n("#deleteArticle").click(h)
  6474. }
  6475. var i = n("#helpArticlesTableContainer input[type='checkbox']");
  6476. l()
  6477. }
  6478. }(jQuery),
  6479. function(n) {
  6480. n.fn.adminblockusers = function(t) {
  6481. function e(t) {
  6482. hideActivityIndicator();
  6483. unsetModalActivityIndicator();
  6484. r();
  6485. n("table.wmtable :checkbox").each(function() {
  6486. n(this).attr("userid") == t.UserId && n(this).attr("email") == t.Email && n(this).parent().parent().remove()
  6487. });
  6488. n("#email").val("");
  6489. n('input[type="checkbox"][name="role"]', "#addParamForm").each(function() {
  6490. n(this).next().removeClass("on");
  6491. n(this).prop("checked", !1)
  6492. });
  6493. var i = n("<tr/>");
  6494. i.append(n("<td/>").append(n("<input>", {
  6495. type: "checkbox",
  6496. userid: t.UserId,
  6497. email: t.Email
  6498. })).append(n("<label/>"))).append(n("<td/>").text(t.Email)).append(n("<td/>").text(t.UserId));
  6499. n("#userList table.wmtable tbody").prepend(i)
  6500. }
  6501.  
  6502. function o(n) {
  6503. hideActivityIndicator();
  6504. unsetModalActivityIndicator();
  6505. r();
  6506. reportError(n)
  6507. }
  6508.  
  6509. function s(t, r) {
  6510. var f, u;
  6511. for (hideActivityIndicator(), unsetModalActivityIndicator(), f = {}, u = 0; u < r.length; ++u) f[r[u].UserId + "|" + r[u].Email] = !0;
  6512. n("#userList table.wmtable input[type=checkbox]").each(function() {
  6513. var t = n(this).attr("userid") + "|" + n(this).attr("email");
  6514. f[t] && n(this).parent().parent().remove()
  6515. });
  6516. i()
  6517. }
  6518.  
  6519. function h(n) {
  6520. hideActivityIndicator();
  6521. unsetModalActivityIndicator();
  6522. reportError(n)
  6523. }
  6524. var i = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
  6525. u = null,
  6526. r = function() {
  6527. n("#email").attr("disabled", null);
  6528. n("#addParam").attr("disabled", null)
  6529. },
  6530. f = function() {
  6531. n("#email").attr("disabled", "disabled");
  6532. n("#addParam").attr("disabled", "disabled")
  6533. };
  6534. n("#addParam").click(function() {
  6535. if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
  6536. var i = n.trim(n("#email").val()),
  6537. r = n('input[type="checkbox"][name="role"]:checked', "#addParamForm"),
  6538. h = u,
  6539. s = [];
  6540. r.each(function() {
  6541. s.push(n(this).val())
  6542. });
  6543. showActivityIndicator(!0);
  6544. f();
  6545. startPostRequestWithJson({
  6546. email: i
  6547. }, t.AddUrl, e, o, "#addParamForm")
  6548. }
  6549. });
  6550. n("#editParam").click(function() {
  6551. n(this).attr("disabled") != "disabled" && n("#addParam").click()
  6552. });
  6553. n("#removeParam").click(function() {
  6554. var r = [];
  6555. n("#userList table.wmtable :checked").each(function() {
  6556. var t = n(this),
  6557. i = {
  6558. Email: t.attr("email"),
  6559. UserId: t.attr("userid")
  6560. };
  6561. r.push(i)
  6562. });
  6563. r.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
  6564. blockedUsers: JSON.stringify(r)
  6565. }, t.RemoveUrl, function(n) {
  6566. s(n, r)
  6567. }, h, "#addParamForm"));
  6568. i()
  6569. });
  6570. n("#addParamForm").validate(formValidateOptions);
  6571. n("#userList table.wmtable :checkbox").live("change", i);
  6572. clickButtonOnEnter("#addParam", ["#email"])
  6573. }
  6574. }(jQuery),
  6575. function(n) {
  6576. n.fn.admindebugsitemaps = function(t) {
  6577. function i(i) {
  6578. showActivityIndicator(!0);
  6579. n.getJSON(t.ResubmitUrl, {
  6580. feedUrl: i
  6581. }, function() {
  6582. hideActivityIndicator();
  6583. unsetModalActivityIndicator()
  6584. }).error(function(n) {
  6585. hideActivityIndicator();
  6586. unsetModalActivityIndicator();
  6587. reportError(n)
  6588. })
  6589. }
  6590. n("#submitParam").click(function() {
  6591. n("#addParamForm").valid() && n("#addParamForm").submit()
  6592. });
  6593. n("#resubmitParam").click(function() {
  6594. n("#addParamForm").valid() && i(n("#feedurl").val())
  6595. });
  6596. n("#addParamForm").validate(formValidateOptions);
  6597. clickButtonOnEnter("#submitParam", ["#feedurl", "#siteurl"])
  6598. }
  6599. }(jQuery),
  6600. function(n) {
  6601. n.fn.adminfetchurl = function(t, i) {
  6602. var r = function() {
  6603. n("#fetchedContent").load(t.updateUrl)
  6604. };
  6605. if (i == "update") {
  6606. setTimeout(r, 1e3);
  6607. return
  6608. }
  6609. if (i == "prettify") {
  6610. n(".prettyprint").length > 0 && prettyPrint();
  6611. return
  6612. }
  6613. n("#submitParam").click(function() {
  6614. n("#addParamForm").submit()
  6615. });
  6616. t.updateUrl != "" && setTimeout(r, 1e3)
  6617. }
  6618. }(jQuery),
  6619. function(n) {
  6620. n.fn.adminglobalusers = function(t) {
  6621. function o(t) {
  6622. hideActivityIndicator();
  6623. unsetModalActivityIndicator();
  6624. f();
  6625. e();
  6626. n("table.wmtable :checkbox").each(function() {
  6627. n(this).attr("userid") == t.UserId && n(this).attr("email") == t.Email && n(this).parent().parent().remove()
  6628. });
  6629. n("#email").val("");
  6630. n('input[type="checkbox"][name="role"]', "#addParamForm").each(function() {
  6631. n(this).next().removeClass("on");
  6632. n(this).prop("checked", !1)
  6633. });
  6634. var i = n("<tr/>");
  6635. i.append(n("<td/>").append(n("<input>", {
  6636. type: "checkbox",
  6637. userid: t.UserId,
  6638. email: t.Email,
  6639. roles: t.Roles
  6640. })).append(n("<label/>"))).append(n("<td/>").append(n("<a>", {
  6641. href: "javascript:void(0)"
  6642. }).text(t.Email))).append(n("<td/>").text(t.UserId)).append(n("<td/>").text(t.RolesFormatted));
  6643. n("#userList table.wmtable tbody").prepend(i)
  6644. }
  6645.  
  6646. function s(n) {
  6647. hideActivityIndicator();
  6648. unsetModalActivityIndicator();
  6649. f();
  6650. reportError(n)
  6651. }
  6652.  
  6653. function c(t, i) {
  6654. var f, r;
  6655. for (hideActivityIndicator(), unsetModalActivityIndicator(), f = {}, r = 0; r < i.length; ++r) f[i[r].UserId + "|" + i[r].Email] = !0;
  6656. n("#userList table.wmtable input[type=checkbox]").each(function() {
  6657. var t = n(this).attr("userid") + "|" + n(this).attr("email");
  6658. f[t] && n(this).parent().parent().remove()
  6659. });
  6660. u()
  6661. }
  6662.  
  6663. function l(n) {
  6664. hideActivityIndicator();
  6665. unsetModalActivityIndicator();
  6666. reportError(n)
  6667. }
  6668. var u = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
  6669. i = !1,
  6670. r = null,
  6671. f = function() {
  6672. n("#email").attr("disabled", null);
  6673. n("#addParam").attr("disabled", null);
  6674. n("#editParam").attr("disabled", null)
  6675. },
  6676. h = function() {
  6677. n("#email").attr("disabled", "disabled");
  6678. n("#addParam").attr("disabled", "disabled");
  6679. n("#editParam").attr("disabled", "disabled")
  6680. },
  6681. e = function() {
  6682. 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"))
  6683. };
  6684. n("#addParam").click(function() {
  6685. if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
  6686. var f = n.trim(n("#email").val()),
  6687. e = n('input[type="checkbox"][name="role"]:checked', "#addParamForm"),
  6688. c = r,
  6689. u = [];
  6690. e.each(function() {
  6691. u.push(n(this).val())
  6692. });
  6693. showActivityIndicator(!0);
  6694. h();
  6695. i ? startPostRequestWithJson({
  6696. roles: JSON.stringify([{
  6697. Email: f,
  6698. UserId: c
  6699. }]),
  6700. access: u
  6701. }, t.UpdateUrl, function(n) {
  6702. o(n[0])
  6703. }, s, "#addParamForm", null, {
  6704. traditional: !0
  6705. }) : startPostRequestWithJson({
  6706. email: f,
  6707. access: u
  6708. }, t.AddUrl, o, s, "#addParamForm", null, {
  6709. traditional: !0
  6710. })
  6711. }
  6712. });
  6713. n("#editParam").click(function() {
  6714. n(this).attr("disabled") != "disabled" && n("#addParam").click()
  6715. });
  6716. n("#removeParam").click(function() {
  6717. var i = [];
  6718. n("#userList table.wmtable :checked").each(function() {
  6719. var t = n(this),
  6720. r = {
  6721. Email: t.attr("email"),
  6722. UserId: t.attr("userid")
  6723. };
  6724. i.push(r)
  6725. });
  6726. i.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
  6727. roles: JSON.stringify(i)
  6728. }, t.RemoveUrl, function(n) {
  6729. c(n, i)
  6730. }, l, "#addParamForm"))
  6731. });
  6732. n("#addParamForm").validate(formValidateOptions);
  6733. n("#userList table.wmtable :checkbox").live("change", u);
  6734. n("#userList table.wmtable a").live("click", function() {
  6735. var t, f, u, e;
  6736. if (n("#addParam").attr("disabled") != "disabled") {
  6737. t = n(this).parent().parent().find('input[type="checkbox"]');
  6738. n("#email").val(t.attr("email"));
  6739. n("#addParam").hide();
  6740. n("#editParam").show();
  6741. n("#addCaption").hide();
  6742. n("#editCaption").show();
  6743. f = t.attr("roles").split(",");
  6744. u = {};
  6745. for (e in f) u[f[e]] = !0;
  6746. n('input[type="checkbox"][name="role"]', "#addParamForm").each(function() {
  6747. var t = u[n(this).val()];
  6748. console.log(u, n(this).val(), t);
  6749. t ? n(this).next().addClass("on") : n(this).next().removeClass("on");
  6750. n(this).prop("checked", t)
  6751. });
  6752. r = t.attr("userid");
  6753. i = !0;
  6754. n("#userList table.wmtable tr.row-selected").removeClass("row-selected");
  6755. n(this).parent().parent().addClass("row-selected");
  6756. scrollToTop()
  6757. }
  6758. });
  6759. n("#email").keyup(function() {
  6760. e()
  6761. });
  6762. clickButtonOnEnter("#addParam", ["#email"])
  6763. }
  6764. }(jQuery),
  6765. function(n) {
  6766. n.fn.helpImage = function(t) {
  6767. function i() {
  6768. n("#imageForm").valid() && (n("#imageForm").attr("action", t.saveImageUrl), n("#imageForm").submit())
  6769. }
  6770.  
  6771. function r() {
  6772. n("#imageForm").attr("action", t.deleteImageUrl);
  6773. n("#imageForm").submit()
  6774. }
  6775.  
  6776. function u() {
  6777. n("#imageForm").attr("action", t.cancelImageUrl);
  6778. n("#imageForm").submit()
  6779. }
  6780.  
  6781. function f() {
  6782. n("#save").prop("disabled", !1);
  6783. n("#delete").prop("disabled", !1);
  6784. n("#cancel").prop("disabled", !1);
  6785. n("#save").click(i);
  6786. n("#delete").click(r);
  6787. n("#cancel").click(u);
  6788. n("#imageForm").validate(formValidateOptions);
  6789. t.imageExists && (n(".fileInputSelector .fields-required-marker").hide(), n("#httpFile").removeClass("required"))
  6790. }
  6791. f()
  6792. }
  6793. }(jQuery),
  6794. function(n) {
  6795. n.fn.helpImages = function(t) {
  6796. function r() {
  6797. var t = n("td > input", n(this).parent()).attr("url");
  6798. document.location.href = t
  6799. }
  6800.  
  6801. function u() {
  6802. var t = i.filter(":checked");
  6803. n("#deleteimages").prop("disabled", t.length == 0)
  6804. }
  6805.  
  6806. function f() {
  6807. document.location.href = t.addImageUrl
  6808. }
  6809.  
  6810. function e() {
  6811. n.ajax({
  6812. type: "POST",
  6813. url: t.deleteImageUrl,
  6814. data: o(),
  6815. contentType: "application/json;",
  6816. dataType: "json",
  6817. success: function() {
  6818. window.location.reload(!0)
  6819. }
  6820. })
  6821. }
  6822.  
  6823. function o() {
  6824. var t = [],
  6825. r = i.filter(":checked");
  6826. return n.each(r, function() {
  6827. var i = {
  6828. imageId: n(this).attr("imageId"),
  6829. culture: n(this).attr("culture")
  6830. };
  6831. t.push(i)
  6832. }), JSON.stringify(t)
  6833. }
  6834.  
  6835. function s() {
  6836. i.prop("checked", !1);
  6837. n("#addImage").prop("disabled", !1);
  6838. n("#deleteimages").prop("deleteImages", !0);
  6839. n("#helpImagesTableContainer tbody td:not(:first-child)").click(r);
  6840. i.change(u);
  6841. n("#addImage").click(f);
  6842. n("#deleteimages").click(e)
  6843. }
  6844. var i = n("#helpImagesTableContainer input[type='checkbox']");
  6845. s()
  6846. }
  6847. }(jQuery),
  6848. function(n) {
  6849. n.fn.admininvalidatecache = function() {
  6850. n("#submitParam").click(function() {
  6851. n("#addParamForm").submit()
  6852. })
  6853. }
  6854. }(jQuery),
  6855. function(n) {
  6856. var t = {},
  6857. r = {},
  6858. i;
  6859. n.fn.adminmessaging = function(u, f) {
  6860. function v() {
  6861. t = {};
  6862. n("tbody", "#messageParamList").empty()
  6863. }
  6864.  
  6865. function y(i) {
  6866. var u = n("#messageRowTemplate").html(),
  6867. r = n("<tr/>", {
  6868. parameterName: i.Name
  6869. });
  6870. r.append(n("<td/>").append(n("<a>", {
  6871. href: "javascript:void(0)"
  6872. }).text(i.Name))).append(n("<td/>").append(n("<input>", {
  6873. type: "text",
  6874. parameterName: i.Name
  6875. }).val(i.Value)));
  6876. n("#messageParamList tbody").append(r);
  6877. t[i.Name] = i.Value
  6878. }
  6879.  
  6880. function o() {
  6881. var s = n("#message").val(),
  6882. u = s.match(/%%[a-z0-9_]+%%/gi),
  6883. e, r, i, o, f;
  6884. if (u == null) n("tfoot", "#messageParamList").show(), t = {}, n("tbody", "#messageParamList").empty();
  6885. else {
  6886. 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({
  6887. Name: i,
  6888. Value: ""
  6889. }) : (o = n('tr[parameterName="' + i + '"]', "#messageParamList"), n("input", o).val(t[i])), e[i] = !0;
  6890. for (f in t) e[f] || (delete t[f], n('tr[parameterName="' + f + '"]', "#messageParamList").remove())
  6891. }
  6892. }
  6893.  
  6894. function s() {
  6895. var r = n("#messagepreset").val(),
  6896. t, i;
  6897. 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()));
  6898. v();
  6899. o()
  6900. }
  6901.  
  6902. function h(r) {
  6903. var f = n.trim(n("#siteurl").val()),
  6904. u;
  6905. return isValueSameAsPalceHolder(f, n("#siteurl")) && (f = ""), u = {
  6906. SiteUrl: f,
  6907. MessageType: n("#messagetype").val(),
  6908. Subject: n("#customsubject").is(":checked") ? n.trim(n("#subject").val()) : n("#subjectpreset").val(),
  6909. Body: n("#custommessage").is(":checked") ? n.trim(n("#message").val()) : n("#messagepreset").val(),
  6910. Params: JSON.stringify(t),
  6911. State: r ? 1 : 0,
  6912. Market: n.trim(n("#market").val())
  6913. }, i != null && (i.State != 0 && (u.State = i.State), u = n.extend(i, u)), u
  6914. }
  6915.  
  6916. function c(t) {
  6917. var i = n("<tr/>");
  6918. i.append(n("<td/>").append(n("<input>", {
  6919. type: "checkbox",
  6920. messageid: t.MessageId,
  6921. category: t.Category,
  6922. state: t.State
  6923. })).append(n("<label/>"))).append(n("<td/>").text(t.Subject)).append(n("<td/>").append(n("<span>", {
  6924. "class": "url-text"
  6925. }).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));
  6926. n("#messageList table.wmtable tbody").prepend(i)
  6927. }
  6928.  
  6929. function p(t) {
  6930. hideActivityIndicator();
  6931. unsetModalActivityIndicator();
  6932. n("table.wmtable :checkbox").each(function() {
  6933. n(this).attr("messageid") == t.MessageId && n(this).parent().parent().remove()
  6934. });
  6935. c(t);
  6936. n("#messageDialog").jqmHide()
  6937. }
  6938.  
  6939. function w(n) {
  6940. hideActivityIndicator();
  6941. unsetModalActivityIndicator();
  6942. reportError(n)
  6943. }
  6944.  
  6945. function b(t, i) {
  6946. var u, r;
  6947. for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, r = 0; r < i.length; ++r) u[i[r].MessageId] = !0;
  6948. n("#messageList table.wmtable input[type=checkbox]").each(function() {
  6949. var t = n(this).attr("messageid");
  6950. u[t] && n(this).parent().parent().remove()
  6951. });
  6952. for (r in t) c(t[r]);
  6953. e()
  6954. }
  6955.  
  6956. function k(n) {
  6957. hideActivityIndicator();
  6958. unsetModalActivityIndicator();
  6959. reportError(n)
  6960. }
  6961.  
  6962. function l(t) {
  6963. if (n("#addParamForm").valid()) {
  6964. var r = h(t);
  6965. r.Body = encodeURIComponent(r.Body);
  6966. showActivityIndicator(!0);
  6967. startPostRequestWithJson({
  6968. message: JSON.stringify(r)
  6969. }, i == null ? u.AddUrl : u.UpdateUrl, p, w, "#tokenContainer")
  6970. }
  6971. }
  6972.  
  6973. function a() {
  6974. n("#save").click(function() {
  6975. n(this).attr("disabled") != "disabled" && l(!1)
  6976. });
  6977. n("#send").click(function() {
  6978. n(this).attr("disabled") != "disabled" && l(!0)
  6979. });
  6980. n("#preview").click(function() {
  6981. if (n(this).attr("disabled") != "disabled") {
  6982. showActivityIndicator(!0);
  6983. var t = h(!1);
  6984. t.__RequestVerificationToken = getRequestVerificationToken("#addParamForm");
  6985. n.post(u.previewDialogUrl, t, function(t) {
  6986. n("#messageDialog").jqmHide();
  6987. showPopupModalDialog("#messagePreviewDialog", t, {
  6988. onHide: function(t) {
  6989. t.w.hide();
  6990. t.o && t.o.remove();
  6991. n("#messageDialog").jqmShow()
  6992. }
  6993. });
  6994. hideActivityIndicator()
  6995. }).error(function() {
  6996. showErrorMessage(null, wr.G_Error)
  6997. })
  6998. }
  6999. });
  7000. n("#customsubject").change(function() {
  7001. n(this).prop("checked") ? (n("#subjectpreset").hide(), n("#subject").show()) : (n("#subjectpreset").show(), n("#subject").hide())
  7002. });
  7003. n("#custommessage").change(s);
  7004. var i = null;
  7005. n("#message").keyup(function() {
  7006. i != null && clearTimeout(i);
  7007. i = setTimeout(o, 500)
  7008. });
  7009. n("#messagepreset").change(s);
  7010. n("input", "#messageParamList").live("keyup", function() {
  7011. t[n(this).attr("parametername")] = n(this).val()
  7012. });
  7013. s()
  7014. }
  7015. if (f == "setparameters") {
  7016. r = u;
  7017. return
  7018. }
  7019. var e = setupGridCheckButtonEnabler("#messageList table.wmtable", "#removeParam");
  7020. n("#addParam").click(function() {
  7021. n(this).attr("disabled") != "disabled" && (showActivityIndicator(!0), n.post(u.addDialogUrl, function(n) {
  7022. showPopupModalDialog("#messageDialog", n);
  7023. hideActivityIndicator();
  7024. a();
  7025. i = null
  7026. }))
  7027. });
  7028. n("#removeParam").click(function() {
  7029. var t = [];
  7030. n("#messageList table.wmtable :checked").each(function() {
  7031. var i = n(this),
  7032. r = {
  7033. MessageId: i.attr("messageid")
  7034. };
  7035. t.push(r)
  7036. });
  7037. t.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
  7038. messages: JSON.stringify(t)
  7039. }, u.RemoveUrl, function(n) {
  7040. b(n, t)
  7041. }, k, "#tokenContainer"));
  7042. e()
  7043. });
  7044. n("#messageList tbody tr td").live("click", function() {
  7045. if (!(n('input[type="checkbox"]', n(this)).length > 0)) {
  7046. var f = n('input[type="checkbox"]', n(this).parent()),
  7047. e = f.attr("messageid"),
  7048. s = f.attr("state"),
  7049. c = f.attr("category");
  7050. r = null;
  7051. showActivityIndicator(!0);
  7052. n.post(n.validator.format(u.editDialogUrl, encodeURI(e)), function(n) {
  7053. showPopupModalDialog("#messageDialog", n);
  7054. hideActivityIndicator();
  7055. a();
  7056. r != null && (t = r, o(), i = h(!1), i.MessageId = e, i.State = s, i.Category = c)
  7057. })
  7058. }
  7059. });
  7060. n("#messageList table.wmtable :checkbox").live("change", e)
  7061. }
  7062. }(jQuery),
  7063. function(n) {
  7064. n.fn.adminResetQuota = function() {
  7065. n("#resetParam").click(function() {
  7066. n("#addParamForm").valid() && n("#addParamForm").submit()
  7067. });
  7068. n("#addParamForm").validate(formValidateOptions);
  7069. clickButtonOnEnter("#resetParam", ["#siteurl"])
  7070. }
  7071. }(jQuery),
  7072. function(n) {
  7073. n.fn.adminsubmiturls = function(t) {
  7074. function u(t, r) {
  7075. var f, u;
  7076. 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>");
  7077. n("#resultArea").html(f.join("<br/>"))
  7078. }
  7079.  
  7080. function f(n) {
  7081. hideActivityIndicator();
  7082. unsetModalActivityIndicator();
  7083. i();
  7084. reportError(n)
  7085. }
  7086. var i = function() {
  7087. n("#urls").attr("disabled", null);
  7088. n("#addParam").attr("disabled", null)
  7089. },
  7090. r = function() {
  7091. n("#urls").attr("disabled", "disabled");
  7092. n("#addParam").attr("disabled", "disabled")
  7093. };
  7094. n("#addParam").click(function() {
  7095. var i, e;
  7096. if (n(this).attr("disabled") != "disabled" && !window.readOnlyMode && n("#addParamForm").valid()) {
  7097. var o = n("#urls").val().split("\n"),
  7098. s = [],
  7099. h = n('input[type="radio"]:checked', "#addParamForm").val();
  7100. for (i = 0; i < o.length; ++i) e = n.trim(o[i]), e != "" && s.push(e);
  7101. showActivityIndicator(!0);
  7102. r();
  7103. startPostRequestWithJson({
  7104. target: h,
  7105. urlList: s
  7106. }, t.SubmitUrl, function(n) {
  7107. u(n, h)
  7108. }, f, "#addParamForm", null, {
  7109. traditional: !0
  7110. })
  7111. }
  7112. });
  7113. n("#addParamForm").validate(n.merge({
  7114. onkeyup: !1,
  7115. focusCleanup: !0,
  7116. errorPlacement: function() {}
  7117. }, formValidateOptions));
  7118. n("#urls").urlTextArea()
  7119. }
  7120. }(jQuery),
  7121. function(n) {
  7122. n.fn.admintermofuse = function(t) {
  7123. function u(t) {
  7124. hideActivityIndicator();
  7125. unsetModalActivityIndicator();
  7126. i();
  7127. n("#tou").val("");
  7128. var r = n("<tr/>");
  7129. r.append(n("<td/>").append(n("<span>", {
  7130. feature: t.FeatureName,
  7131. version: t.Version,
  7132. isactive: t.IsActive ? "1" : "0"
  7133. }).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));
  7134. n("#touList table.wmtable tbody").prepend(r)
  7135. }
  7136.  
  7137. function f(n) {
  7138. hideActivityIndicator();
  7139. unsetModalActivityIndicator();
  7140. i();
  7141. reportError(n)
  7142. }
  7143.  
  7144. function e(t, r, u) {
  7145. hideActivityIndicator();
  7146. unsetModalActivityIndicator();
  7147. i();
  7148. n("#touList table.wmtable span").each(function() {
  7149. if (n(this).attr("feature") == r) {
  7150. var t = n(n(this).parent().parent().children("td")[2]);
  7151. n(this).attr("version") == u ? t.text(wr.AdminTermOfUse_StatusActive) : t.text(wr.AdminTermOfUse_StatusInactive)
  7152. }
  7153. })
  7154. }
  7155.  
  7156. function o(n) {
  7157. hideActivityIndicator();
  7158. unsetModalActivityIndicator();
  7159. i();
  7160. reportError(n)
  7161. }
  7162. var i = function() {
  7163. n("#tou").attr("disabled", null);
  7164. n("#featuretoadd").attr("disabled", null);
  7165. n("#upload").attr("disabled", null)
  7166. },
  7167. r = function() {
  7168. n("#tou").attr("disabled", "disabled");
  7169. n("#featuretoadd").attr("disabled", "disabled");
  7170. n("#upload").attr("disabled", "disabled")
  7171. };
  7172. n("#upload").click(function() {
  7173. if (n(this).attr("disabled") != "disabled" && n("#addParamForm").valid()) {
  7174. var i = n("#tou").val(),
  7175. e = n("#featuretoadd").val();
  7176. showActivityIndicator(!0);
  7177. r();
  7178. startPostRequestWithJson({
  7179. featureName: e,
  7180. text: i
  7181. }, t.UploadUrl, u, f, "#addParamForm")
  7182. }
  7183. });
  7184. n("#touList tbody tr").click(function() {
  7185. var f = n("td:first span", n(this)),
  7186. i = f.attr("feature"),
  7187. u = f.attr("version");
  7188. showActivityIndicator(!0);
  7189. n.post(n.validator.format(t.dialogUrl, encodeURI(i), encodeURI(u)), function(f) {
  7190. showPopupModalDialog("#touViewDialog", f);
  7191. hideActivityIndicator();
  7192. n("#activate").click(function() {
  7193. n("#touViewDialog").jqmHide().remove();
  7194. showActivityIndicator(!0);
  7195. r();
  7196. startPostRequestWithJson({
  7197. tou: JSON.stringify({
  7198. FeatureName: i,
  7199. Version: u
  7200. })
  7201. }, t.ActivateUrl, function(n) {
  7202. e(n, i, u)
  7203. }, o, "#addParamForm")
  7204. })
  7205. })
  7206. });
  7207. n("#addParamForm").validate(n.merge({
  7208. onkeyup: !1,
  7209. focusCleanup: !0,
  7210. errorPlacement: function() {}
  7211. }, formValidateOptions));
  7212. n("#feature").change(function() {
  7213. n("#filterForm").submit()
  7214. })
  7215. }
  7216. }(jQuery),
  7217. function(n) {
  7218. n.fn.adminusers = function(t) {
  7219. function c(t) {
  7220. var o, s;
  7221. console.log("addParamSuccess", t);
  7222. hideActivityIndicator();
  7223. unsetModalActivityIndicator();
  7224. h();
  7225. i && (o = {}, o[r + "|" + f + "|" + u] = !0, n("#userList table.wmtable input[type=checkbox]").each(function() {
  7226. var t = n(this).attr("userid") + "|" + n(this).attr("url") + "|" + n(this).attr("verificationurl");
  7227. o[t] && n(this).parent().parent().remove()
  7228. }));
  7229. e();
  7230. n("#email").val("");
  7231. s = n("<tr/>");
  7232. s.append(n("<td/>").append(n("<input>", {
  7233. type: "checkbox",
  7234. email: t.Email,
  7235. userid: t.UserId,
  7236. url: t.Site,
  7237. verificationurl: t.VerificationSite,
  7238. role: t.Role,
  7239. authenticationcode: t.AuthenticationCode,
  7240. delegatedcode: t.DelegatedCode,
  7241. delegatedcodeowneremail: t.DelegatedCodeOwnerEmail,
  7242. delegatorid: t.DelegatorId,
  7243. delegatoremail: t.DelegatorEmail
  7244. })).append(n("<label/>"))).append(n("<td/>").append(n("<a>", {
  7245. href: "javascript:void(0)"
  7246. }).text(t.Email))).append(n("<td/>").append(n("<span>", {
  7247. "class": "url-text"
  7248. }).text(t.Site))).append(n("<td/>").append(n("<span>", {
  7249. "class": "url-text"
  7250. }).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));
  7251. n("#userList table.wmtable tbody").prepend(s)
  7252. }
  7253.  
  7254. function l(n) {
  7255. hideActivityIndicator();
  7256. unsetModalActivityIndicator();
  7257. h();
  7258. reportError(n)
  7259. }
  7260.  
  7261. function v(t, i) {
  7262. var u, r;
  7263. for (hideActivityIndicator(), unsetModalActivityIndicator(), u = {}, r = 0; r < i.length; ++r) u[i[r].Site + "|" + i[r].Email + "|" + i[r].VerificationSite] = !0;
  7264. n("#userList table.wmtable input[type=checkbox]").each(function() {
  7265. var t = n(this).attr("url") + "|" + n(this).attr("email") + "|" + n(this).attr("verificationurl");
  7266. u[t] && n(this).parent().parent().remove()
  7267. });
  7268. o()
  7269. }
  7270.  
  7271. function y(n) {
  7272. hideActivityIndicator();
  7273. unsetModalActivityIndicator();
  7274. reportError(n)
  7275. }
  7276.  
  7277. function p(t) {
  7278. t.Site = n.trim(t.Site);
  7279. t.VerificationSite = n.trim(t.VerificationSite);
  7280. t.VerificationSite == "" && (t.VerificationSite = t.Site);
  7281. t.Email = n.trim(t.Email);
  7282. t.DelegatedCode = n.trim(t.DelegatedCode);
  7283. t.DelegatedCode == "" && (t.DelegatedCode = null);
  7284. t.DelegatedCodeOwnerEmail = n.trim(t.DelegatedCodeOwnerEmail);
  7285. t.DelegatedCodeOwnerEmail == "" && (t.DelegatedCodeOwnerEmail = null);
  7286. t.DelegatorEmail = n.trim(t.DelegatorEmail);
  7287. t.DelegatorEmail == "" && (t.DelegatorEmail = null);
  7288. t.DelegatorId = n.trim(t.DelegatorId);
  7289. t.DelegatorId == "" && (t.DelegatorId = null);
  7290. t.Roles == "None" && (t.Roles = "")
  7291. }
  7292. var o = setupGridCheckButtonEnabler("#userList table.wmtable", "#removeParam"),
  7293. i = !1,
  7294. r = null,
  7295. s = null,
  7296. f = null,
  7297. u = null,
  7298. e = function() {
  7299. 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"))
  7300. },
  7301. h = function() {
  7302. n("#email").attr("disabled", null);
  7303. n("#url").attr("disabled", null);
  7304. n("#role").attr("disabled", null);
  7305. n("#verificationurl").attr("disabled", null);
  7306. n("#delegatorid").attr("disabled", null);
  7307. n("#delegatoremail").attr("disabled", null);
  7308. n("#delegatedcode").attr("disabled", null);
  7309. n("#delegatedcodeemail").attr("disabled", null);
  7310. n("#authenticationcode").attr("disabled", null);
  7311. n("#addParam").attr("disabled", null)
  7312. },
  7313. a = function() {
  7314. n("#email").attr("disabled", "disabled");
  7315. n("#url").attr("disabled", "disabled");
  7316. n("#role").attr("disabled", "disabled");
  7317. n("#verificationurl").attr("disabled", "disabled");
  7318. n("#delegatorid").attr("disabled", "disabled");
  7319. n("#delegatoremail").attr("disabled", "disabled");
  7320. n("#delegatedcode").attr("disabled", "disabled");
  7321. n("#delegatedcodeemail").attr("disabled", "disabled");
  7322. n("#authenticationcode").attr("disabled", "disabled");
  7323. n("#addParam").attr("disabled", "disabled")
  7324. };
  7325. n("#addParam").click(function() {
  7326. var f, e;
  7327. n(this).attr("disabled") != "disabled" && n("#addParamForm").valid() && (f = {
  7328. Email: n("#email").val(),
  7329. Site: n("#url").val(),
  7330. VerificationSite: n("#verificationurl").val(),
  7331. DelegatedCode: n("#delegatedcode").val(),
  7332. DelegatedCodeOwnerEmail: n("#delegatedcodeemail").val(),
  7333. DelegatorEmail: n("#delegatoremail").val(),
  7334. DelegatorId: n("#delegatorid").val(),
  7335. AuthenticationCode: n("#authenticationcode").val(),
  7336. Roles: n("#role").val()
  7337. }, console.log(f), p(f), showActivityIndicator(!0), a(), i ? (e = n.extend({}, f), e.UserId = r, e.VerificationSite = u, startPostRequestWithJson({
  7338. siteRoles: JSON.stringify([e]),
  7339. fields: JSON.stringify(f)
  7340. }, t.UpdateUrl, function(n) {
  7341. c(n[0])
  7342. }, l, "#addParamForm")) : startPostRequestWithJson({
  7343. fields: JSON.stringify(f)
  7344. }, t.AddUrl, c, l, "#addParamForm"))
  7345. });
  7346. n("#removeParam").click(function() {
  7347. var i = [];
  7348. n("#userList table.wmtable :checked").each(function() {
  7349. var t = n(this),
  7350. r = {
  7351. Site: t.attr("url"),
  7352. Email: t.attr("email"),
  7353. UserId: t.attr("userid"),
  7354. VerificationSite: t.attr("verificationurl")
  7355. };
  7356. i.push(r)
  7357. });
  7358. console.log(i);
  7359. i.length > 0 && (showActivityIndicator(!0), startPostRequestWithJson({
  7360. siteRoles: JSON.stringify(i)
  7361. }, t.RemoveUrl, function(n) {
  7362. v(n, i)
  7363. }, y, "#addParamForm"))
  7364. });
  7365. n("#addParamForm").validate(formValidateOptions);
  7366. n("#userList table.wmtable :checkbox").live("change", o);
  7367. clickButtonOnEnter("#addParam", ["#url", "#email", "#verificationurl", "#delegatorid", "#delegatoremail", "#delegatedcode", "#delegatedcodeemail"]);
  7368. n("#userList table.wmtable tbody a").live("click", function() {
  7369. if (n("#addParam").attr("disabled") != "disabled") {
  7370. var t = n(this).parent().parent().find('input[type="checkbox"]');
  7371. n("#email").val(t.attr("email"));
  7372. n("#url").val(t.attr("url"));
  7373. n("#verificationurl").val(t.attr("verificationurl"));
  7374. n("#authenticationcode").val(t.attr("authenticationcode"));
  7375. n("#delegatedcode").val(t.attr("delegatedcode"));
  7376. n("#delegatedcodeemail").val(t.attr("delegatedcodeowneremail"));
  7377. n("#delegatorid").val(t.attr("delegatorid"));
  7378. n("#delegatoremail").val(t.attr("delegatoremail"));
  7379. n("#role").val(t.attr("role") ? t.attr("role") : "None");
  7380. n("#addParam").hide();
  7381. n("#editParam").show();
  7382. r = t.attr("userId");
  7383. s = t.attr("email");
  7384. f = t.attr("url");
  7385. u = t.attr("verificationurl");
  7386. i = !0;
  7387. n("#userList table.wmtable tr.row-selected").removeClass("row-selected");
  7388. n(this).parent().parent().addClass("row-selected");
  7389. scrollToTop()
  7390. }
  7391. });
  7392. n("#editParam").click(function() {
  7393. n(this).attr("disabled") != "disabled" && n("#addParam").click()
  7394. });
  7395. n("#email").keyup(function() {
  7396. e()
  7397. });
  7398. n("#url").keyup(function() {
  7399. e()
  7400. });
  7401. n("#applyFilter").click(function() {
  7402. n("#filterForm").submit()
  7403. });
  7404. n("#toggleFilter").click(function() {
  7405. n("#filter").val() == "all" ? n("#filter").val("").prop("disabled", !0) : n("#filter").val("all").prop("disabled", !1);
  7406. n("#filterForm").submit()
  7407. })
  7408. }
  7409. }(jQuery),
  7410. function(n) {
  7411. n.fn.appLinking = function() {
  7412. function t(t) {
  7413. t.indexOf("<table") > -1 ? n("#appt").html(t) : (n("#appt").html(""), n(".validationErrorPlaceholderBox ").html(t), n("#errorBox").show())
  7414. }
  7415.  
  7416. function i(i) {
  7417. n("#errorBox").hide();
  7418. hideActivityIndicator();
  7419. t(i)
  7420. }
  7421.  
  7422. function r() {
  7423. n("#errorBox").hide();
  7424. n("#appLinksUrlTxt").removeClass("error");
  7425. n("#activityIndicator").css("top", "120");
  7426. n("#appLinksForm").valid() && (showActivityIndicator(!0), n.ajax({
  7427. url: n("#appLinksForm").attr("action") + "?" + n("#appLinksForm").serialize(),
  7428. type: "GET",
  7429. dataType: "text",
  7430. timeout: 13500,
  7431. success: i,
  7432. error: function(n) {
  7433. handleAjaxError(n, reportError)
  7434. }
  7435. }))
  7436. }
  7437.  
  7438. function u() {
  7439. validatorSetup();
  7440. n("#fetchUrl").click(r);
  7441. n("#appLinksUrlTxt").focus();
  7442. clickButtonOnEnter("#fetchUrl", "#appLinksUrlTxt");
  7443. n("#appLinksForm").validate(formValidateOptions)
  7444. }
  7445. u()
  7446. }
  7447. }(jQuery),
  7448. function(n) {
  7449. var t = function() {
  7450. function n(n) {
  7451. this.sessionId = n;
  7452. this.newComment = ko.observable("").extend({
  7453. required: !0
  7454. });
  7455. this.status = ko.observable("");
  7456. this.error = ko.observable("");
  7457. this.isShowStatus = ko.computed(function() {
  7458. return !StringExtensions.isNullOrEmpty(this.status())
  7459. }, this)
  7460. }
  7461. return n.prototype.getAjaxErrorAsString = function(n, t) {
  7462. var i = {
  7463. 400: "Server understood the request, but request content was invalid.",
  7464. 401: "Unauthorized access.",
  7465. 404: "URL not found",
  7466. 403: "Forbidden resource can't be accessed.",
  7467. 500: "Internal server error.",
  7468. 503: "Service unavailable."
  7469. };
  7470. return n && n.status && i[n.status] ? i[n.status] : t ? t : "Unknown Error"
  7471. }, n
  7472. }(),
  7473. i;
  7474. n.SubmissionReviewViewModel = t;
  7475. i = function() {
  7476. function n(n) {
  7477. this.submissionReviewViewModel = new t(n.sessionId)
  7478. }
  7479. return n.prototype.Run = function() {
  7480. ko.validation.init({
  7481. registerExtenders: !0,
  7482. messagesOnModified: !0,
  7483. insertMessages: !0,
  7484. parseInputAttributes: !0,
  7485. messageTemplate: null
  7486. }, !0);
  7487. this.knockoutSetup()
  7488. }, n.prototype.knockoutSetup = function() {
  7489. ko.applyBindings(this.submissionReviewViewModel)
  7490. }, n
  7491. }();
  7492. n.SubmissionReview = i
  7493. }(PublicTools || (PublicTools = {})),
  7494. function(n) {
  7495. n.fn.contentRemoval = function() {
  7496. function r() {
  7497. if (n("#errorBox").hide(), n("#cachedPageText").removeClass("error"), n("#activityIndicator").css("top", "120"), n("#contentRemovalForm").valid()) {
  7498. showActivityIndicator(!0);
  7499. var r = n("#contentRemovalForm").serialize();
  7500. n.getJSON(n("#contentRemovalForm").attr("action"), r, function(r) {
  7501. if (!r.Success) {
  7502. n("#errorBox").text(r.ErrorMessage).show();
  7503. r.CacheRefreshRequired && (n("#type").val(t).change(), n("#cachedPageText").addClass("error"));
  7504. hideActivityIndicator();
  7505. return
  7506. }
  7507. n("#contentRemovalForm")[0].reset();
  7508. n("#errorBox").hide();
  7509. hideActivityIndicator();
  7510. i();
  7511. u(r)
  7512. })
  7513. }
  7514. }
  7515.  
  7516. function u(t) {
  7517. 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>",
  7518. r = t.HttpResponse > 0 ? t.HttpResponse : t.ResponseDescription;
  7519. i = n.validator.format(i, t.Date, t.Url, t.RemovalType, t.Status, r);
  7520. n("table.grid tbody").prepend(i);
  7521. n("table.grid tr.empty").addClass("none")
  7522. }
  7523.  
  7524. function i() {
  7525. n("#type").val() == t ? n("#cachedTextContainer").removeClass("none") : (n("#cachedTextContainer").addClass("none"), n("#cachedPageText").val(""))
  7526. }
  7527.  
  7528. function f() {
  7529. n.validator.addClassRules({
  7530. requiredIfRemovalTypeCache: {
  7531. required: {
  7532. depends: function() {
  7533. return n("#type").val() == t
  7534. }
  7535. }
  7536. }
  7537. })
  7538. }
  7539.  
  7540. function e() {
  7541. f();
  7542. i();
  7543. n("#type").change(i);
  7544. n("#submitHipUrl").click(r);
  7545. n("#contentRemovalForm").validate(formValidateOptions)
  7546. }
  7547. var t = 2;
  7548. e()
  7549. }
  7550. }(jQuery),
  7551. function(n) {
  7552. var t = function() {
  7553. function t(n, t, i, r, u, f, e, o, s) {
  7554. var h = this;
  7555. this.sessionId = n;
  7556. this.apiSubmitUrl = t;
  7557. this.ticketDetailsUrl = i;
  7558. this.firstName = ko.observable(r).extend({
  7559. required: !0
  7560. });
  7561. this.lastName = ko.observable(u).extend({
  7562. required: !0
  7563. });
  7564. this.companyName = ko.observable(f);
  7565. this.copyrightOwnerFullName = ko.observable(e).extend({
  7566. required: !0
  7567. });
  7568. this.copyrightOwnerCountry = ko.observable(o).extend({
  7569. required: !0
  7570. });
  7571. this.emailAddress = ko.observable(s).extend({
  7572. required: !0,
  7573. email: !0
  7574. });
  7575. this.typeOfWork = ko.observable("").extend({
  7576. required: !0
  7577. });
  7578. this.titleOfWork = ko.observable();
  7579. this.authorizedExample = ko.observable();
  7580. this.description = ko.observable().extend({
  7581. required: !0
  7582. });
  7583. this.attachmentData = ko.observable("");
  7584. this.bulkSubmissionData = ko.observable();
  7585. this.urlsToRemove = ko.observable().extend({
  7586. required: {
  7587. onlyIf: function() {
  7588. return StringExtensions.isNullOrEmpty(h.bulkSubmissionData())
  7589. },
  7590. message: "Please fill in the text area or upload a bulk submission"
  7591. }
  7592. });
  7593. this.additionalInformation = ko.observable();
  7594. this.goodFaithStatement = ko.observable(!1).extend({
  7595. equal: {
  7596. required: !0,
  7597. message: "This field is required."
  7598. }
  7599. });
  7600. this.authorityToActStatement = ko.observable(!1).extend({
  7601. equal: {
  7602. required: !0,
  7603. message: "This field is required."
  7604. }
  7605. });
  7606. this.acknowledgementStatement = ko.observable(!1).extend({
  7607. equal: {
  7608. required: !0,
  7609. message: "This field is required."
  7610. }
  7611. });
  7612. this.signature = ko.observable().extend({
  7613. required: !0
  7614. });
  7615. this.relatedTickets = ko.observable();
  7616. this.status = ko.observable("");
  7617. this.error = ko.observable("");
  7618. this.isShowStatus = ko.computed(function() {
  7619. return !StringExtensions.isNullOrEmpty(this.status())
  7620. }, this)
  7621. }
  7622. return t.prototype.validateAndSubmit = function() {
  7623. var n = ko.validation.group(this);
  7624. n().length === 0 ? this.submitDataToServer() : (n.showAllMessages(!0), this.error("Please fill in the required fields"))
  7625. }, t.prototype.redirectToTicketDetailsPage = function(n) {
  7626. var t = $.validator.format("{0}?ticketId={1}", this.ticketDetailsUrl, n);
  7627. window.location.assign(t)
  7628. }, t.prototype.resetFormFields = function() {
  7629. this.firstName("");
  7630. this.lastName("");
  7631. this.companyName("");
  7632. this.copyrightOwnerFullName("");
  7633. this.copyrightOwnerCountry("");
  7634. this.emailAddress("");
  7635. this.typeOfWork("");
  7636. this.titleOfWork("");
  7637. this.authorizedExample("");
  7638. this.description("");
  7639. this.urlsToRemove("");
  7640. this.additionalInformation("");
  7641. this.goodFaithStatement(!1);
  7642. this.authorityToActStatement(!1);
  7643. this.acknowledgementStatement(!1);
  7644. this.signature("");
  7645. this.relatedTickets("");
  7646. this.status("");
  7647. this.clearAttachments();
  7648. this.clearBulkSubmission();
  7649. this.error("");
  7650. var n = ko.validation.group(this);
  7651. n.showAllMessages(!1)
  7652. }, t.prototype.clearAttachments = function() {
  7653. this.attachmentData("")
  7654. }, t.prototype.clearBulkSubmission = function() {
  7655. this.bulkSubmissionData("")
  7656. }, t.prototype.getAjaxErrorAsString = function(n, t) {
  7657. var i = {
  7658. 400: "Server understood the request, but request content was invalid.",
  7659. 401: "Unauthorized access.",
  7660. 404: "URL not found",
  7661. 403: "Forbidden resource can't be accessed.",
  7662. 500: "Internal server error.",
  7663. 503: "Service unavailable."
  7664. };
  7665. return n && n.status && i[n.status] ? i[n.status] : t ? t : "Unknown Error"
  7666. }, t.prototype.submitDataToServer = function() {
  7667. var i = this,
  7668. t, r, f, u;
  7669. this.status("Submitting...");
  7670. this.error("");
  7671. t = new FormData;
  7672. t.append("__RequestVerificationToken", n.SearchBlockShared.getAntiForgeryToken());
  7673. r = ko.toJS(this);
  7674. delete r.error;
  7675. t.append("data", ko.toJSON(r));
  7676. f = $("#attachment").get(0).files;
  7677. $.each(f, function(n, i) {
  7678. t.append("attachment", i)
  7679. });
  7680. u = $("#bulkSubmission").get(0).files;
  7681. u.length > 0 && t.append("bulk", u[0]);
  7682. $.ajax({
  7683. url: this.apiSubmitUrl,
  7684. type: "POST",
  7685. contentType: !1,
  7686. processData: !1,
  7687. data: t,
  7688. success: function(n) {
  7689. n.Success ? i.redirectToTicketDetailsPage(n.TicketId) : (i.status(""), i.error(n.Message))
  7690. },
  7691. error: function(n, t) {
  7692. var r = i.getAjaxErrorAsString(n, t);
  7693. i.status(r)
  7694. }
  7695. })
  7696. }, t
  7697. }(),
  7698. i;
  7699. n.ContentRemovalFormViewModel = t;
  7700. i = function() {
  7701. function n(n) {
  7702. this.contentRemovalFormViewModel = new t(n.sessionId, n.apiSubmitUrl, n.ticketDetailsUrl, n.firstName, n.lastName, n.companyName, n.copyrightOwnerFullName, n.copyrightOwnerCountry, n.emailAddress)
  7703. }
  7704. return n.prototype.Run = function() {
  7705. ko.validation.init({
  7706. registerExtenders: !0,
  7707. messagesOnModified: !0,
  7708. insertMessages: !0,
  7709. parseInputAttributes: !0,
  7710. messageTemplate: null
  7711. }, !0);
  7712. this.knockoutSetup()
  7713. }, n.prototype.knockoutSetup = function() {
  7714. ko.applyBindings(this.contentRemovalFormViewModel)
  7715. }, n
  7716. }();
  7717. n.ContentRemovalForm = i
  7718. }(PublicTools || (PublicTools = {})),
  7719. function(n) {
  7720. var t = function() {
  7721. function n(n, t, i, r, u, f) {
  7722. var e = this;
  7723. this.name = ko.observable(n);
  7724. this.size = ko.observable(t);
  7725. this.id = ko.observable(i);
  7726. this.error = ko.observable(r);
  7727. this.eventType = ko.observable(u);
  7728. this.success = ko.observable(f);
  7729. this.formattedSize = ko.computed(function() {
  7730. return e.formatFileSize(e.size())
  7731. });
  7732. this.showLoading = ko.computed(function() {
  7733. return e.eventType() == "fileSelected" && !e.error()
  7734. })
  7735. }
  7736. return n.prototype.formatFileSize = function(n) {
  7737. if (n == 0) return "";
  7738. var t = Math.floor(Math.log(n) / Math.log(1024)),
  7739. i = Number((n / Math.pow(1024, t)).toFixed(2)),
  7740. r = ["B", "KB", "MB", "GB", "TB"][t];
  7741. return i + " " + r
  7742. }, n.prototype.toJSON = function() {
  7743. var n = ko.toJS(this);
  7744. return n.id ? (delete n.size, delete n.error, delete n.success, delete n.formattedSize, delete n.showLoading, delete n.eventType, n) : null
  7745. }, n
  7746. }();
  7747. n.Document = t
  7748. }(PublicTools || (PublicTools = {})),
  7749. function(n) {
  7750. var t = function() {
  7751. function t(t, i) {
  7752. var r = this;
  7753. this.maxiFrameLoadWaitTimeInMilliSeconds = 15e3;
  7754. this.removeDocument = function(t, i) {
  7755. if (t) {
  7756. if (t.eventType() == "fileSelected") {
  7757. r.documents.remove(t);
  7758. return
  7759. }
  7760. $.ajax({
  7761. url: $.validator.format("{0}/tools/{1}/removedocument", containerPrefix, r.controller),
  7762. type: "POST",
  7763. data: n.SearchBlockShared.appendAntiForgeryToken({
  7764. id: t.id(),
  7765. sid: i
  7766. }),
  7767. success: function() {
  7768. r.documents.remove(t);
  7769. $(".error:visible").length && $("input[type=hidden][name=validUploads]").valid()
  7770. }
  7771. })
  7772. }
  7773. };
  7774. this.documents = t;
  7775. this.documentMessageHandlerSetup();
  7776. this.controller = i
  7777. }
  7778. return t.prototype.documentMessageHandlerSetup = function() {
  7779. var t = this;
  7780. $(window).on("message", function(i) {
  7781. var f = i.originalEvent.data,
  7782. e = f.indexOf(":"),
  7783. u, o, r, s, h;
  7784. 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())
  7785. })
  7786. }, t.prototype.addOrUpdateDocument = function(n) {
  7787. var i = this.documents().length,
  7788. t;
  7789. if (this.setupIFrameLoadTimer(n), i == 0) {
  7790. this.documents.push(n);
  7791. return
  7792. }
  7793. t = ko.utils.arrayFirst(this.documents(), function(n) {
  7794. return n.error() != null
  7795. });
  7796. t && this.documents.remove(t);
  7797. t = ko.utils.arrayFirst(this.documents(), function(t) {
  7798. return t.name() == n.name()
  7799. });
  7800. t && this.documents.remove(t);
  7801. this.documents.push(n)
  7802. }, t.prototype.setupIFrameLoadTimer = function(t) {
  7803. t.eventType() == "fileSelected" && (this.documentIframeErrorTimer = setTimeout(function() {
  7804. var i = $("iframe[name=docUploader]").attr("src");
  7805. t.error(n.SearchBlockFollowup.options.fileUploadError);
  7806. $("iframe[name=docUploader]").attr("src", i)
  7807. }, this.maxiFrameLoadWaitTimeInMilliSeconds));
  7808. (t.eventType() == "fileUploaded" || t.error()) && clearTimeout(this.documentIframeErrorTimer)
  7809. }, t
  7810. }();
  7811. n.DocumentUploadManager = t
  7812. }(PublicTools || (PublicTools = {})),
  7813. function(n) {
  7814. var t = function() {
  7815. function n() {}
  7816. return n.prototype.Run = function(n) {
  7817. var i = n.UploadStatus,
  7818. t;
  7819. i && (window.top.postMessage("fileUploaded:" + JSON.stringify(i), "*"), $("#uploadFile span").text(n.UploadAnotherFile));
  7820. t = $(".link-button");
  7821. $("#uploaddoc").width(t.width() + 5).height(t.height());
  7822. $("input:file").change(function() {
  7823. var u = n.MaxUploadSize,
  7824. f = n.MaxUploadSize / 1048576,
  7825. t = {},
  7826. i, r;
  7827. 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());
  7828. 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;
  7829. window.top.postMessage("fileSelected:" + JSON.stringify(t), "*");
  7830. t.Error == null && $("#uploadForm").submit()
  7831. });
  7832. window.onscroll = function() {
  7833. window.scrollTo(0, 0)
  7834. }
  7835. }, n
  7836. }();
  7837. n.DocUploader = t
  7838. }(PublicTools || (PublicTools = {})),
  7839. function(n) {
  7840. var t = function() {
  7841. function t(i) {
  7842. t.options = i;
  7843. this.searchBlockUserViewModel = new n.SearchBlockUser(i.id, i.controller);
  7844. t.documentUploadManager = new n.DocumentUploadManager(this.searchBlockUserViewModel.documents, i.controller);
  7845. n.SearchBlockShared.lsAvailable() && localStorage.setItem("sid", i.id)
  7846. }
  7847. return t.prototype.Run = function() {
  7848. this.validatorSetup();
  7849. this.knockoutSetup()
  7850. }, t.prototype.validatorSetup = function() {
  7851. var n = $.extend(!0, {}, formValidateOptions),
  7852. t;
  7853. n.onkeyup = !1;
  7854. n.focusCleanup = !0;
  7855. n.ignore = [];
  7856. n.errorPlacement = function(n, t) {
  7857. t.hasClass("no-label") || n.insertAfter(t)
  7858. };
  7859. $(".part2 input[type=radio]").change(function() {
  7860. $(".error:visible").length && $(".part2 textarea").valid()
  7861. });
  7862. $("#linkRemovalForm").on("change", ".urlItem input[type=checkbox]", function() {
  7863. $(".error:visible").length && $(this).closest(".urlItem").find("textarea.dependentCheckboxes").valid()
  7864. });
  7865. $("a.add-url").on("click", function() {
  7866. t.resetForm();
  7867. $(".validationErrorPlaceholderBox").hide()
  7868. });
  7869. t = $("#linkRemovalForm").validate(n);
  7870. $.validator.addClassRules({
  7871. requiredIfPublicOrCommunityFigure: {
  7872. required: function() {
  7873. return $("[name=isPublicFigureRadio][value=true]").is(":checked") || $("[name=isCommunityInterestInfoRadio][value=true]").is(":checked")
  7874. }
  7875. },
  7876. dependentCheckboxes: {
  7877. required: function(n) {
  7878. var t = $(n).closest(".page-content-items").find("input[type=checkbox]:checked");
  7879. return t.length > 0
  7880. }
  7881. },
  7882. docCount: {
  7883. min: function(n) {
  7884. return parseInt($(n).val()) == 0
  7885. }
  7886. }
  7887. })
  7888. }, t.prototype.knockoutSetup = function() {
  7889. ko.bindingHandlers.slideVisible = {
  7890. init: function(n, t) {
  7891. $(n).toggle(ko.unwrap(t()))
  7892. },
  7893. update: function(n, t) {
  7894. ko.unwrap(t()) ? $(n).slideDown() : $(n).slideUp()
  7895. }
  7896. };
  7897. ko.bindingHandlers.fadeVisible = {
  7898. init: function(n, t) {
  7899. $(n).toggle(ko.unwrap(t()))
  7900. },
  7901. update: function(n, t) {
  7902. ko.unwrap(t()) ? $(n).fadeIn() : $(n).fadeOut()
  7903. }
  7904. };
  7905. ko.applyBindings(this.searchBlockUserViewModel)
  7906. }, t
  7907. }();
  7908. n.EuSearchBlock = t
  7909. }(PublicTools || (PublicTools = {})),
  7910. function(n) {
  7911. n.imageWidgetSetup = function(t) {
  7912. function ft() {
  7913. jQuery.extend(jQuery.validator.messages, {
  7914. range: jQuery.validator.format(t.errorMessages.customSizeErrorMessage),
  7915. required: t.errorMessages.queryErrorMessage
  7916. });
  7917. n.validator.addMethod("customColorCheck", function(t) {
  7918. return /^(#)?([0-9a-fA-F]{3})([0-9a-fA-F]{3})?$/.test(n.trim(t)) ? !0 : !1
  7919. }, t.errorMessages.customColorErrorMessage);
  7920. n.validator.addClassRules({
  7921. customSizeText: {
  7922. digits: !0,
  7923. range: [180, 1024]
  7924. },
  7925. customColorText: {
  7926. customColorCheck: !0
  7927. }
  7928. })
  7929. }
  7930.  
  7931. function u() {
  7932. var t, u, f;
  7933. 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)))
  7934. }
  7935.  
  7936. function et() {
  7937. var t = l(r),
  7938. u, f;
  7939. 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
  7940. }
  7941.  
  7942. function ot() {
  7943. var i = t.previewUrl.indexOf("?") >= 0 ? "{0}&{1}" : "{0}?{1}",
  7944. u = b(l(r), "{0}={1}", "&", !0);
  7945. return n.validator.format(i, t.previewUrl, u)
  7946. }
  7947.  
  7948. function l(t) {
  7949. var r = n.extend({}, t);
  7950. return n("#countDropdown").css("display") == "none" && (r[i.imageCount] = ""), r
  7951. }
  7952.  
  7953. function b(t, i, r, u) {
  7954. if (t == null) return "";
  7955. var f = "";
  7956. return n.each(t, function(t, e) {
  7957. e != null && e != "" && (f += n.validator.format(i, t, u ? encodeURIComponent(e) : e), f += r)
  7958. }), f.indexOf(r, f.length - r.length) != -1 && (f = f.substring(0, f.length - r.length)), f
  7959. }
  7960.  
  7961. function h(n) {
  7962. o && clearTimeout(o);
  7963. o = setTimeout(function() {
  7964. o = null;
  7965. n()
  7966. }, 1e3)
  7967. }
  7968.  
  7969. function st() {
  7970. r[i.query] = n("#queryInput").val();
  7971. r[i.layout] = n("input[name=layout-radio]:checked").val();
  7972. r[i.imageCount] = n("#countDropdown option:selected").val();
  7973. r[i.height] = n("#sizeDropdown option:selected").attr("data-height") + "px";
  7974. r[i.width] = n("#sizeDropdown option:selected").attr("data-width") + "px";
  7975. r[i.background] = n("#backgroundDropdown option:selected").val();
  7976. r[i.market] = n("#mktDropdown option:selected").val();
  7977. r[i.safeSearch] = n("input[name=safeSearch-radio]:checked").val();
  7978. r[i.version] = ut;
  7979. r[i.style] = e()
  7980. }
  7981.  
  7982. function ht() {
  7983. n("#queryInput").keyup(ct).change(a).focusout(a)
  7984. }
  7985.  
  7986. function ct() {
  7987. h(a)
  7988. }
  7989.  
  7990. function a() {
  7991. var t = n.trim(n("#queryInput").val());
  7992. r[i.query] = t;
  7993. u()
  7994. }
  7995.  
  7996. function lt() {
  7997. n("input[name=layout-radio]").click(at)
  7998. }
  7999.  
  8000. function at() {
  8001. var f = n("input[name=layout-radio]:checked").val(),
  8002. t;
  8003. r[i.layout] = f;
  8004. t = n("#countDropdown");
  8005. f == t.attr("data-layout") ? (n("#countLabelSpan").removeClass("none"), t.removeClass("none")) : (n("#countLabelSpan").addClass("none"), t.addClass("none"));
  8006. u()
  8007. }
  8008.  
  8009. function vt() {
  8010. n("#countDropdown").change(yt)
  8011. }
  8012.  
  8013. function yt() {
  8014. var t = n("#countDropdown option:selected").val();
  8015. r[i.imageCount] = t;
  8016. u()
  8017. }
  8018.  
  8019. function pt() {
  8020. n("#sizeDropdown").change(wt)
  8021. }
  8022.  
  8023. function wt() {
  8024. var t = n("#sizeDropdown option:selected"),
  8025. f = n("#customSize");
  8026. 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")));
  8027. r[i.height] = t.attr("data-height") + "px";
  8028. r[i.width] = t.attr("data-width") + "px";
  8029. u()
  8030. }
  8031.  
  8032. function bt() {
  8033. var t = n("#sizeDropdown option:selected");
  8034. n("#widthInput").val(t.attr("data-width")).keyup(k).change(f).focusout(f);
  8035. n("#heightInput").val(t.attr("data-height")).keyup(k).change(f).focusout(f)
  8036. }
  8037.  
  8038. function k() {
  8039. h(f)
  8040. }
  8041.  
  8042. function f() {
  8043. var t = n.trim(n("#widthInput").val()) + "px",
  8044. f = n.trim(n("#heightInput").val()) + "px";
  8045. r[i.height] = f;
  8046. r[i.width] = t;
  8047. u()
  8048. }
  8049.  
  8050. function kt() {
  8051. n("#backgroundDropdown").change(dt)
  8052. }
  8053.  
  8054. function dt() {
  8055. var f = n("#backgroundDropdown option:selected"),
  8056. t = n("#customBackground");
  8057. f.val() == t.attr("data-background") ? (t.removeClass("none"), r[i.background] = n("#backgroundInput").val()) : (t.addClass("none"), r[i.background] = f.val());
  8058. u()
  8059. }
  8060.  
  8061. function gt() {
  8062. n("#backgroundInput").val(s).keyup(ni);
  8063. n("#backgroundIndicator").css("background-color", s)
  8064. }
  8065.  
  8066. function ni() {
  8067. h(ti)
  8068. }
  8069.  
  8070. function ti() {
  8071. var n = function(n) {
  8072. r[i.background] = n;
  8073. u()
  8074. };
  8075. tt("#backgroundInput", "#backgroundIndicator", "#backgroundColorPicker", n)
  8076. }
  8077.  
  8078. function ii() {
  8079. it("#backgroundInput", "#backgroundIndicator", "#backgroundColorPicker");
  8080. v("#backgroundRedSlider", "#backgroundRedMin", "#backgroundRedMax", 0, 255, 0);
  8081. v("#backgroundGreenSlider", "#backgroundGreenMin", "#backgroundGreenMax", 0, 255, 0);
  8082. v("#backgroundBlueSlider", "#backgroundBlueMin", "#backgroundBlueMax", 0, 255, 0)
  8083. }
  8084.  
  8085. function c(t, i) {
  8086. var c = n(t).is(":visible"),
  8087. h, r;
  8088. if (c) {
  8089. var u = n(i).css("background-color"),
  8090. f = 0,
  8091. e = 0,
  8092. o = 0,
  8093. s = p.exec(u);
  8094. 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) {
  8095. return t + t + i + i + r + r
  8096. }), 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)));
  8097. n(t).find(".redValue").text(f);
  8098. n(t).find(".greenValue").text(e);
  8099. n(t).find(".blueValue").text(o);
  8100. n(t).find(".redSlider").slider("value", f);
  8101. n(t).find(".greenSlider").slider("value", e);
  8102. n(t).find(".blueSlider").slider("value", o)
  8103. }
  8104. }
  8105.  
  8106. function v(n, t, f, e, o, s) {
  8107. var h = function() {
  8108. var n = g("#backgroundColorPicker", "#backgroundInput", "#backgroundIndicator");
  8109. r[i.background] = n;
  8110. u()
  8111. };
  8112. d(n, t, f, e, o, s, h)
  8113. }
  8114.  
  8115. function d(t, i, r, u, f, e, o) {
  8116. n(i).text(u);
  8117. n(r).text(f);
  8118. n(t).slider({
  8119. orientation: "horizontal",
  8120. animate: !1,
  8121. range: "min",
  8122. min: u,
  8123. max: f,
  8124. value: e,
  8125. stop: o
  8126. })
  8127. }
  8128.  
  8129. function g(t, i, r) {
  8130. var o = n(t).find(".redSlider").slider("value"),
  8131. f, e, u;
  8132. 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
  8133. }
  8134.  
  8135. function nt(n, t, i) {
  8136. return "#" + (16777216 + (n << 16) + (t << 8) + i).toString(16).slice(1)
  8137. }
  8138.  
  8139. function ri() {
  8140. n("#borderDropdown").change(ui)
  8141. }
  8142.  
  8143. function ui() {
  8144. var f = n("#borderDropdown option:selected"),
  8145. t = n("#borderColor");
  8146. f.val() != t.attr("data-border") ? t.removeClass("none") : t.addClass("none");
  8147. r[i.style] = e();
  8148. u()
  8149. }
  8150.  
  8151. function fi() {
  8152. n("#borderColorInput").val(s).keyup(ei);
  8153. n("#borderColorIndicator").css("background-color", s)
  8154. }
  8155.  
  8156. function ei() {
  8157. h(oi)
  8158. }
  8159.  
  8160. function oi() {
  8161. var n = function() {
  8162. r[i.style] = e();
  8163. u()
  8164. };
  8165. tt("#borderColorInput", "#borderColorIndicator", "#borderColorPicker", n)
  8166. }
  8167.  
  8168. function tt(t, i, r, u) {
  8169. var e = n(t),
  8170. f = n.trim(e.val());
  8171. f.indexOf("#") != 0 && (f = "#" + f, e.val(f));
  8172. u(f);
  8173. n(i).css("background-color", f);
  8174. c(r, i)
  8175. }
  8176.  
  8177. function it(t, i, r) {
  8178. n(t).focus(function() {
  8179. n(r).show();
  8180. c(r, i)
  8181. });
  8182. n(r).click(function(n) {
  8183. n.stopPropagation()
  8184. });
  8185. n(document).click(function(u) {
  8186. var f = n(u.target);
  8187. f.is(i) || f.is(t) || n(r).hide()
  8188. })
  8189. }
  8190.  
  8191. function si() {
  8192. it("#borderColorInput", "#borderColorIndicator", "#borderColorPicker");
  8193. y("#borderRedSlider", "#borderRedMin", "#borderRedMax", 0, 255, 0);
  8194. y("#borderGreenSlider", "#borderGreenMin", "#borderGreenMax", 0, 255, 0);
  8195. y("#borderBlueSlider", "#borderBlueMin", "#borderBlueMax", 0, 255, 0)
  8196. }
  8197.  
  8198. function y(n, t, f, o, s, h) {
  8199. var c = function() {
  8200. g("#borderColorPicker", "#borderColorInput", "#borderColorIndicator");
  8201. r[i.style] = e();
  8202. u()
  8203. };
  8204. d(n, t, f, o, s, h, c)
  8205. }
  8206.  
  8207. function hi() {
  8208. n("#paddingDropdown").change(ci)
  8209. }
  8210.  
  8211. function ci() {
  8212. r[i.style] = e();
  8213. u()
  8214. }
  8215.  
  8216. function e() {
  8217. var t = [],
  8218. i = n("#paddingDropdown option:selected").val(),
  8219. r, u;
  8220. 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("")
  8221. }
  8222.  
  8223. function li() {
  8224. n("#mktDropdown").change(ai)
  8225. }
  8226.  
  8227. function ai() {
  8228. r[i.market] = n("#mktDropdown option:selected").val();
  8229. u()
  8230. }
  8231.  
  8232. function vi() {
  8233. n("#languageDropdown").change(yi)
  8234. }
  8235.  
  8236. function yi() {
  8237. r[i.language] = n("#languageDropdown option:selected").val();
  8238. u()
  8239. }
  8240.  
  8241. function pi() {
  8242. n("input[name=safeSearch-radio]").click(wi)
  8243. }
  8244.  
  8245. function wi() {
  8246. r[i.safeSearch] = n("input[name=safeSearch-radio]:checked").val();
  8247. u()
  8248. }
  8249.  
  8250. function bi() {
  8251. var n = l(r);
  8252. n[i.query] = encodeURIComponent(n[i.query]);
  8253. window.top.postMessage(w + ":" + JSON.stringify(n), "*")
  8254. }
  8255.  
  8256. function ki(n) {
  8257. var t = di(n, w),
  8258. i;
  8259. if (t) try {
  8260. i = JSON.parse(t);
  8261. gi(i)
  8262. } catch (r) {
  8263. return
  8264. }
  8265. }
  8266.  
  8267. function di(n, t) {
  8268. var i = n.originalEvent.data,
  8269. r = i.indexOf(":"),
  8270. f, u;
  8271. return r == -1 ? null : (f = i.substring(0, r), f != t) ? null : (u = i.substring(r + 1), !u) ? null : u
  8272. }
  8273.  
  8274. function gi(n) {
  8275. var t = decodeURIComponent(n[i.query]);
  8276. r[i.query] = t == null ? r[i.query] : t;
  8277. r[i.layout] = n[i.layout] == null ? r[i.layout] : n[i.layout];
  8278. r[i.imageCount] = n[i.imageCount] == null ? r[i.imageCount] : n[i.imageCount];
  8279. r[i.height] = n[i.height] == null ? r[i.height] : n[i.height];
  8280. r[i.width] = n[i.width] == null ? r[i.width] : n[i.width];
  8281. r[i.background] = n[i.background] == null ? r[i.background] : n[i.background];
  8282. r[i.market] = n[i.market] == null ? r[i.market] : n[i.market];
  8283. r[i.language] = n[i.language] == null ? r[i.language] : n[i.language];
  8284. r[i.safeSearch] = n[i.safeSearch] == null ? r[i.safeSearch] : n[i.safeSearch];
  8285. r[i.style] = n[i.style] == null ? r[i.style] : n[i.style];
  8286. nr();
  8287. u()
  8288. }
  8289.  
  8290. function nr() {
  8291. var l, o, v, t, f, e, s, u, it;
  8292. n("#queryInput").val(r[i.query]);
  8293. l = r[i.layout];
  8294. 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]));
  8295. o = [];
  8296. n("#sizeDropdown option").each(function() {
  8297. o.push(n(this).attr("value"))
  8298. });
  8299. var y = r[i.height].replace("px", ""),
  8300. w = r[i.width].replace("px", ""),
  8301. rt = w + " x " + y,
  8302. b = n("#sizeDropdown"),
  8303. a = n("#customSize"),
  8304. k = n.inArray(rt, o);
  8305. 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")) {
  8306. if (n("#borderColor").removeClass("none"), u.indexOf("#") != 0) {
  8307. var d = 0,
  8308. g = 0,
  8309. tt = 0,
  8310. h = p.exec(u);
  8311. h !== null && (d = parseInt(h[1]), g = parseInt(h[2]), tt = parseInt(h[3]));
  8312. u = nt(d, g, tt)
  8313. }
  8314. n("#borderColorInput").val(u);
  8315. n("#borderColorIndicator").css("background-color", u);
  8316. c("#borderColorPicker", "#borderColorIndicator")
  8317. }
  8318. n("#mktDropdown").val(r[i.market]);
  8319. n("#languageDropdown").val(r[i.language]);
  8320. it = r[i.safeSearch];
  8321. n("input[name='safeSearch-radio'][value='" + it + "']").prop("checked", !0)
  8322. }
  8323.  
  8324. function tr() {
  8325. if (ft(), rt = n("#image-form").validate(formValidateOptions), st(), t.isPluginPreview) {
  8326. n(window).on("message", ki);
  8327. n("#widgetSaveImagePlugin").on("click", bi)
  8328. } else n("#widgetCopyCode").initCopyCodeButton(), n("#markupbox").focus(selectAllTextAreaContent);
  8329. ht();
  8330. lt();
  8331. vt();
  8332. pt();
  8333. bt();
  8334. kt();
  8335. gt();
  8336. ri();
  8337. fi();
  8338. hi();
  8339. li();
  8340. vi();
  8341. pi();
  8342. ii();
  8343. si();
  8344. u()
  8345. }
  8346. var rt = null,
  8347. r = {},
  8348. o = null,
  8349. i = t.widgetAttributes,
  8350. ut = t.version,
  8351. s = "#cccccc",
  8352. p = /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/,
  8353. w = "Microsoft.Bing.ImageWidget.wpPlugin.ValidationString";
  8354. tr()
  8355. }
  8356. }(jQuery),
  8357. function(n) {
  8358. n.fn.initCopyCodeButton = function() {
  8359. ZeroClipboard.setDefaults({
  8360. moviePath: "/webmaster/content/images/zeroclipboard.swf"
  8361. });
  8362. var t = n(this),
  8363. i = new ZeroClipboard(t);
  8364. i.on("mouseover", function() {
  8365. t.addClass("button-hover")
  8366. });
  8367. i.on("mouseout", function() {
  8368. t.removeClass("button-hover")
  8369. });
  8370. i.on("mousedown", function() {
  8371. t.addClass("button-active")
  8372. });
  8373. i.on("mouseup", function() {
  8374. t.removeClass("button-active")
  8375. });
  8376. n(this).click(function() {
  8377. if (window.clipboardData) {
  8378. var t = n(this).attr("data-clipboard-text");
  8379. window.clipboardData.setData("Text", t)
  8380. }
  8381. })
  8382. };
  8383. n.fn.knowledgeWidget = function(t) {
  8384. function e(i) {
  8385. var r, u;
  8386. (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() {
  8387. u == s && (i == !0 && (s = st(s), t.previewUrl = s), n("#sample-pageframe").attr("src", s))
  8388. }, 100)))
  8389. }
  8390.  
  8391. function ot() {
  8392. t.isPublic || (ct() ? n("#widgetSaveSettings, #widgetResetSettings").removeAttr("disabled") : n("#widgetSaveSettings, #widgetResetSettings").attr("disabled", "disabled"))
  8393. }
  8394.  
  8395. function ai() {
  8396. var u = "",
  8397. f;
  8398. 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)
  8399. }
  8400.  
  8401. function vi() {
  8402. var u, e, f, o;
  8403. 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}";
  8404. e = c(k(), "{0}={1}", ",", !1);
  8405. r[i.dataOptions] = e;
  8406. f = d();
  8407. f[i.id] = t.previewId;
  8408. o = c(f, "{0}={1}", "&", !0);
  8409. s = n.validator.format(u, t.previewUrl, o)
  8410. }
  8411.  
  8412. function st(n) {
  8413. var u = "toggle=",
  8414. t, f, i, r;
  8415. 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
  8416. }
  8417.  
  8418. function k() {
  8419. var t = n.extend({}, f),
  8420. u = r[i.visualization];
  8421. switch (u) {
  8422. case o[p]:
  8423. t[i.options.underlineDecoration] = null;
  8424. break;
  8425. case o[w]:
  8426. t[i.options.shadowEnabled] = null;
  8427. break;
  8428. case o[b]:
  8429. t[i.options.underlineDecoration] = null;
  8430. t[i.options.shadowEnabled] = null
  8431. }
  8432. return t
  8433. }
  8434.  
  8435. function d() {
  8436. var t = n.extend({}, r),
  8437. u = r[i.visualization];
  8438. switch (u) {
  8439. case o[p]:
  8440. t[i.linkStyle] = null;
  8441. t[i.maxLinks] = null;
  8442. t[i.maxEntityLinks] = null;
  8443. t[i.maxParagraphLinks] = null;
  8444. break;
  8445. case o[w]:
  8446. t[i.carouselState] = null;
  8447. break;
  8448. case o[b]:
  8449. t[i.linkStyle] = null;
  8450. t[i.maxLinks] = null;
  8451. t[i.maxEntityLinks] = null;
  8452. t[i.maxParagraphLinks] = null;
  8453. t[i.carouselState] = null
  8454. }
  8455. return t
  8456. }
  8457.  
  8458. function c(t, i, r, u) {
  8459. if (t == null) return "";
  8460. var f = "";
  8461. return n.each(t, function(t, e) {
  8462. e != null && e != "" && (f += n.validator.format(i, t, u ? escape(e) : e), f += r)
  8463. }), f.indexOf(r, f.length - r.length) != -1 && (f = f.substring(0, f.length - r.length)), f
  8464. }
  8465.  
  8466. function yi() {
  8467. if (s != null && s != "") {
  8468. var n = window.open(s, "_blank");
  8469. n.focus()
  8470. }
  8471. }
  8472.  
  8473. function pi() {
  8474. n.validator.addMethod("valueNoSpace", function(n) {
  8475. return n.match(/\s/g) == null
  8476. }, "The css class name cannot not contain spaces");
  8477. n.validator.addClassRules({
  8478. noSpaceCheck: {
  8479. valueNoSpace: !0
  8480. },
  8481. minResolutionCheck: {
  8482. digits: !0,
  8483. range: [100, 1024]
  8484. }
  8485. })
  8486. }
  8487.  
  8488. function ht() {
  8489. r[i.visualization] = o[u.visualization];
  8490. r[i.linkStyle] = u.linkStyle;
  8491. r[i.carouselState] = et[u.carouselState];
  8492. r[i.strength] = v[u.strength];
  8493. r[i.maxLinks] = u.maxLinks;
  8494. r[i.maxEntityLinks] = u.maxEntityLinks;
  8495. r[i.maxParagraphLinks] = u.maxParagraphLinks;
  8496. r[i.extractionIgnoreClass] = u.extractionIgnoreClass;
  8497. r[i.ignoreClass] = u.ignoreClass;
  8498. f[i.options.underlineDecoration] = u.optionUnderlineDecoration;
  8499. f[i.options.shadowEnabled] = u.optionShadowEnabled ? 1 : 0
  8500. }
  8501.  
  8502. function ct() {
  8503. var t = n("#inputWidgetName").val() != u.widgetName;
  8504. 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)
  8505. }
  8506.  
  8507. function lt() {
  8508. var i = !0;
  8509. t.isPreview || (n("#inputWidgetName").val(u.widgetName), i = !1);
  8510. ht();
  8511. g();
  8512. e(i)
  8513. }
  8514.  
  8515. function g() {
  8516. var t;
  8517. n("#presenceOption input[data-presence-option=" + r[i.visualization] + "]").click();
  8518. t = f[i.options.underlineDecoration];
  8519. t ? n("#styleOption input[data-style-option=" + t + "]").click() : n("#styleOption input[data-style-option=custom]").click();
  8520. var u = jQuery.inArray(r[i.strength], v),
  8521. e = r[i.maxLinks],
  8522. o = r[i.maxEntityLinks],
  8523. s = r[i.maxParagraphLinks];
  8524. n("#widgetStrengthSlider").slider("value", u);
  8525. n("#widgetMaxLinksSlider").slider("value", e);
  8526. n("#widgetMaxEntityLinksSlider").slider("value", o);
  8527. n("#widgetMaxParagraphLinksSlider").slider("value", s);
  8528. n("#carouselOption input[data-initial-state=" + r[i.carouselState] + "]").attr("checked", "checked");
  8529. f[i.options.shadowEnabled] == 1 ? n("#carouselOption input#carouselBorder").attr("checked", "checked") : n("#carouselOption input#carouselBorder").removeAttr("checked");
  8530. n("#optionClassToIgnore").val(r[i.extractionIgnoreClass]);
  8531. n("#optionClassNotToMarkup").val(r[i.ignoreClass])
  8532. }
  8533.  
  8534. function wi() {
  8535. r[i.version] = t.version;
  8536. r[i.autoSnapshot] = t.autoSnapshot.toLowerCase();
  8537. r[i.id] = u.id
  8538. }
  8539.  
  8540. function bi() {
  8541. n("#presenceOption input").on("click", rr)
  8542. }
  8543.  
  8544. function ki() {
  8545. n("#styleOption input[type=radio]").on("click", ur);
  8546. n("#optionCustomStyle").on("focusout", at);
  8547. n("#optionCustomStyle").keyup(fr)
  8548. }
  8549.  
  8550. function di() {
  8551. n("#widgetStrengthSlider").slider({
  8552. orientation: "horizontal",
  8553. animate: !0,
  8554. range: "min",
  8555. min: gt,
  8556. max: ni,
  8557. value: u.strengh,
  8558. stop: vt,
  8559. change: vt
  8560. });
  8561. nt("#widgetMaxLinksSlider", "#widgetMaxLinksMin", "#widgetMaxLinksMax", ti, ii, r[i.maxLinks]);
  8562. nt("#widgetMaxEntityLinksSlider", "#widgetMaxEntityLinksMin", "#widgetMaxEntityLinksMax", ui, fi, r[i.maxEntityLinks]);
  8563. nt("#widgetMaxParagraphLinksSlider", "#widgetMaxParagraphLinksMin", "#widgetMaxParagraphLinksMax", oi, si, r[i.maxParagraphLinks])
  8564. }
  8565.  
  8566. function nt(t, i, r, u, f, e) {
  8567. n(i).text(u);
  8568. n(r).text(f);
  8569. n(t).slider({
  8570. orientation: "horizontal",
  8571. animate: !0,
  8572. range: "min",
  8573. min: u,
  8574. max: f,
  8575. value: e,
  8576. stop: yt,
  8577. change: yt
  8578. })
  8579. }
  8580.  
  8581. function gi() {
  8582. n("#carouselOption input[type=radio]").on("click", er);
  8583. n("#carouselOption input#carouselBorder").on("click", or)
  8584. }
  8585.  
  8586. function nr() {
  8587. n("#optionClassToIgnore").on("focusout", pt);
  8588. n("#optionClassNotToMarkup").on("focusout", wt);
  8589. n("#optionClassToIgnore").keyup(sr);
  8590. n("#optionClassNotToMarkup").keyup(hr)
  8591. }
  8592.  
  8593. function tr() {
  8594. l();
  8595. n("#widget-option-left").addClass("left-most");
  8596. n("#widget-option-right").click(cr);
  8597. n("#widget-option-left").click(lr);
  8598. n("#widget-option-frame").on("scroll", kt)
  8599. }
  8600.  
  8601. function ir() {
  8602. n(".widget-page-preview-tab").click(vr);
  8603. n(".widget-page-preview-tab").filter(":first-child").click()
  8604. }
  8605.  
  8606. function rr() {
  8607. var f, u;
  8608. n("#presenceOption input[type=button]").removeClass("current");
  8609. n("#presenceOption input[type=button]").val(t.PresenceOffButton);
  8610. n(this).addClass("current");
  8611. n(this).val(t.PresenceOnButton);
  8612. f = n(this).attr("data-presence-option");
  8613. r[i.visualization] = f;
  8614. u = 300;
  8615. switch (f) {
  8616. case o[p]:
  8617. n("#styleOption, #widgetLinkingStrengthContainer").hide(u, "swing", function() {
  8618. n("#carouselOption").show(u, "swing", l)
  8619. });
  8620. break;
  8621. case o[li]:
  8622. n("#carouselOption, #styleOption, #widgetLinkingStrengthContainer").show(u, "swing", l);
  8623. break;
  8624. case o[w]:
  8625. n("#carouselOption").hide(u, "swing", function() {
  8626. n("#styleOption, #widgetLinkingStrengthContainer").show(u, "swing", l)
  8627. });
  8628. break;
  8629. case o[b]:
  8630. n("#carouselOption, #styleOption, #widgetLinkingStrengthContainer").hide(u, "swing", l)
  8631. }
  8632. e()
  8633. }
  8634.  
  8635. function ur() {
  8636. var t = n(this).attr("data-style-option");
  8637. 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] = "");
  8638. e()
  8639. }
  8640.  
  8641. function fr() {
  8642. tt(at)
  8643. }
  8644.  
  8645. function tt(n) {
  8646. a && clearTimeout(a);
  8647. a = setTimeout(function() {
  8648. a = null;
  8649. n()
  8650. }, 1e3)
  8651. }
  8652.  
  8653. function at() {
  8654. var t = n("#optionCustomStyle").val();
  8655. r[i.linkStyle] = t;
  8656. e()
  8657. }
  8658.  
  8659. function er() {
  8660. var t = n(this).attr("data-initial-state");
  8661. r[i.carouselState] = t;
  8662. e()
  8663. }
  8664.  
  8665. function or() {
  8666. var t = n(this).is(":checked") ? "1" : "0";
  8667. f[i.options.shadowEnabled] = t;
  8668. e()
  8669. }
  8670.  
  8671. function vt() {
  8672. var t = n("#widgetStrengthSlider").slider("value");
  8673. n("#widgetMaxLinksSlider").slider("value", ri[t]);
  8674. n("#widgetMaxEntityLinksSlider").slider("value", ei[t]);
  8675. n("#widgetMaxParagraphLinksSlider").slider("value", hi[t]);
  8676. r[i.strength] = v[t];
  8677. n("#widgetStrengthValue").text(ci[t]);
  8678. e()
  8679. }
  8680.  
  8681. function yt() {
  8682. var t = n(this).slider("value"),
  8683. u = n(this).attr("data-setting"),
  8684. i;
  8685. r[u] = t;
  8686. i = n(this).attr("data-value-id");
  8687. n("#" + i).text(t);
  8688. e()
  8689. }
  8690.  
  8691. function sr() {
  8692. tt(pt)
  8693. }
  8694.  
  8695. function pt() {
  8696. var t = n("#optionClassToIgnore").val();
  8697. r[i.extractionIgnoreClass] = t;
  8698. e()
  8699. }
  8700.  
  8701. function hr() {
  8702. tt(wt)
  8703. }
  8704.  
  8705. function wt() {
  8706. var t = n("#optionClassNotToMarkup").val();
  8707. r[i.ignoreClass] = t;
  8708. e()
  8709. }
  8710.  
  8711. function cr() {
  8712. var t = n("#widget-option-frame").scrollLeft(),
  8713. i = bt(t, !1);
  8714. n("#widget-option-frame").animate({
  8715. scrollLeft: i
  8716. }, ft)
  8717. }
  8718.  
  8719. function lr() {
  8720. var t = n("#widget-option-frame").scrollLeft(),
  8721. i = bt(t, !0);
  8722. n("#widget-option-frame").animate({
  8723. scrollLeft: i
  8724. }, ft)
  8725. }
  8726.  
  8727. function bt(n, t) {
  8728. var r = n,
  8729. i;
  8730. if (t) {
  8731. for (i = h.length - 1; i >= 0; i--)
  8732. if (h[i] < n) {
  8733. r = h[i];
  8734. break
  8735. }
  8736. } else
  8737. for (i = 0; i < h.length; i++)
  8738. if (h[i] > n) {
  8739. r = h[i];
  8740. break
  8741. } return r
  8742. }
  8743.  
  8744. function kt() {
  8745. var t = n("#widget-option-frame").scrollLeft();
  8746. t < y - ut ? n("#widget-option-right").removeClass("right-most") : n("#widget-option-right").addClass("right-most");
  8747. t > 0 ? n("#widget-option-left").removeClass("left-most") : n("#widget-option-left").addClass("left-most")
  8748. }
  8749.  
  8750. function ar() {
  8751. var t = 0;
  8752. n("#widget-options-carousel > div.widget-option-group").each(function() {
  8753. h[t++] = n(this).position().left
  8754. });
  8755. h.sort(function(n, t) {
  8756. return n - t
  8757. })
  8758. }
  8759.  
  8760. function l() {
  8761. n("#widget-options-carousel").width(1e4);
  8762. var t = n("#widget-options-carousel > div.widget-last-option-group"),
  8763. i = n("#widget-options-carousel > div.widget-option-group:first-child"),
  8764. r = parseInt(t.css("padding-left").replace("px", "")) + parseInt(t.css("padding-right").replace("px", ""));
  8765. y = t.offset().left + t.width() + r - i.offset().left;
  8766. ut = n("#widget-option-frame").width();
  8767. n("#widget-options-carousel").width(y);
  8768. kt();
  8769. ar()
  8770. }
  8771.  
  8772. function vr() {
  8773. n(".widget-page-preview-tab-active").removeClass("widget-page-preview-tab-active");
  8774. n(this).addClass("widget-page-preview-tab-active");
  8775. var i = n(this).attr("data-url");
  8776. t.previewUrl != i && (t.previewUrl = i, e())
  8777. }
  8778.  
  8779. function yr() {
  8780. if (n("#knowledge-form").valid()) {
  8781. var i = br();
  8782. kr(t.saveUrl, i, pr);
  8783. n("#settingsOverlay").show(300);
  8784. n("#inputWidgetName").attr("disabled", "disabled")
  8785. }
  8786. }
  8787.  
  8788. function pr(t) {
  8789. u.widgetName = n("#inputWidgetName").val();
  8790. u.visualization = t.Visualization;
  8791. u.linkStyle = t.LinkStyle;
  8792. u.carouselState = t.InitialCarouselState;
  8793. u.strength = t.DetectionStrength;
  8794. u.maxLinks = t.MaxLinks;
  8795. u.maxEntityLinks = t.MaxEntityLinks;
  8796. u.maxParagraphLinks = t.MaxParagraphLinks;
  8797. u.extractionIgnoreClass = t.ExtractionIgnoreClass;
  8798. u.ignoreClass = t.IgnoreClass;
  8799. u.optionUnderlineDecoration = t.UnderlineDecoration;
  8800. u.optionShadowEnabled = t.CarouselShadowEnabled;
  8801. ct() || (n("#inputWidgetName").removeAttr("disabled"), n("#widgetSaveSettings, #widgetResetSettings").attr("disabled", "disabled"), n("#settingsOverlay").hide(300));
  8802. n("#saveWidgetName").text(u.widgetName)
  8803. }
  8804.  
  8805. function br() {
  8806. var t = {
  8807. Id: u.id,
  8808. Visualization: r[i.visualization],
  8809. LinkStyle: r[i.linkStyle],
  8810. InitialCarouselState: r[i.carouselState],
  8811. DetectionStrength: r[i.strength],
  8812. MaxLinks: r[i.maxLinks],
  8813. MaxEntityLinks: r[i.maxEntityLinks],
  8814. MaxParagraphLinks: r[i.maxParagraphLinks],
  8815. ExtractionIgnoreClass: r[i.extractionIgnoreClass],
  8816. IgnoreClass: r[i.ignoreClass],
  8817. UnderlineDecoration: f[i.options.underlineDecoration],
  8818. CarouselShadowEnabled: f[i.options.shadowEnabled] == 1
  8819. };
  8820. return {
  8821. widgetName: n("#inputWidgetName").val(),
  8822. newSettings: JSON.stringify(t)
  8823. }
  8824. }
  8825.  
  8826. function kr(n, t, i, r) {
  8827. startPostRequestWithJson(t, n, i, r, "#knowledge-form")
  8828. }
  8829.  
  8830. function dr() {
  8831. var n = c(k(), "{0}={1}", ",", !1);
  8832. r[i.dataOptions] = n;
  8833. window.top.postMessage(rt + ":" + JSON.stringify(d()), "*")
  8834. }
  8835.  
  8836. function gr(n) {
  8837. var i = nu(n, rt),
  8838. t;
  8839. if (i !== null) try {
  8840. t = JSON.parse(i);
  8841. t !== null && typeof t == "object" && tu(t)
  8842. } catch (r) {
  8843. return
  8844. }
  8845. }
  8846.  
  8847. function nu(i, r) {
  8848. var u = i.originalEvent.data,
  8849. f = u.indexOf(":"),
  8850. s, e, o, h;
  8851. 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
  8852. }
  8853.  
  8854. function tu(n) {
  8855. var u, o, t;
  8856. 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"]) {
  8857. u = n["data-options"].split(",");
  8858. 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])
  8859. }
  8860. g();
  8861. e()
  8862. }
  8863.  
  8864. function iu() {
  8865. dt = n("#knowledge-form").validate(formValidateOptions);
  8866. pi();
  8867. n("#fullPreview").on("click", yi);
  8868. if (ir(), ht(), t.isPreview) {
  8869. n(window).on("message", gr);
  8870. n("#widgetResetPluginSettings").on("click", lt);
  8871. n("#widgetSavePluginSettings").on("click", dr)
  8872. } else n("#widgetCopyCode").initCopyCodeButton(), n("#markupbox").focus(selectAllTextAreaContent);
  8873. wi();
  8874. ki();
  8875. di();
  8876. gi();
  8877. nr();
  8878. bi();
  8879. g();
  8880. tr();
  8881. e();
  8882. t.isPublic || (n("#inputWidgetName").change(ot), n("#widgetResetSettings").click(lt), n("#widgetSaveSettings").click(yr))
  8883. }
  8884. var dt = null,
  8885. s = "",
  8886. it = !1,
  8887. a = null,
  8888. rt = "Microsoft.Bing.KnowledgeWidget.wpPlugin.ValidationString",
  8889. y = 0,
  8890. ut = 0,
  8891. ft = 400,
  8892. gt = 0,
  8893. ni = 2,
  8894. h = [],
  8895. ti = 3,
  8896. ii = 100,
  8897. ri = [7, 12, 100],
  8898. ui = 1,
  8899. fi = 10,
  8900. ei = [3, 4, 10],
  8901. oi = 1,
  8902. si = 20,
  8903. hi = [3, 5, 20],
  8904. ci = [wr.Widget_Strength_Conservative, wr.Widget_Strength_Moderate, wr.Widget_Strength_Aggressive],
  8905. v = [t.detectionStrengthOptions.conservative, t.detectionStrengthOptions.moderate, t.detectionStrengthOptions.aggressive],
  8906. et = [t.carouselStateOptions.collapsed, t.carouselStateOptions.expanded, t.carouselStateOptions.auto],
  8907. o = [t.visualizationOptions.linksAndImages, t.visualizationOptions.images, t.visualizationOptions.links, t.visualizationOptions.interactiveonly],
  8908. li = 0,
  8909. p = 1,
  8910. w = 2,
  8911. b = 3,
  8912. r = {},
  8913. f = {},
  8914. i = t.widgetAttributes,
  8915. u = t.defaults;
  8916. iu()
  8917. }
  8918. }(jQuery),
  8919. function(n) {
  8920. function i() {
  8921. $(".resources-link").click(function(n) {
  8922. $(n.target).next(".resources").slideToggle()
  8923. });
  8924. $(".resources .see-more").click(function(n) {
  8925. $(n.target).next(".jqmWindow").jqm({
  8926. overlay: 5,
  8927. modal: !0
  8928. }).jqmShow()
  8929. })
  8930. }
  8931.  
  8932. function u(n) {
  8933. t = n;
  8934. $("#activityIndicator").remove();
  8935. $("#url-input-button").click(r);
  8936. clickButtonOnEnter("#url-input-button", "#url-input-field")
  8937. }
  8938. var t = "",
  8939. r = function() {
  8940. function n() {
  8941. var n = this,
  8942. r;
  8943. (this.maxRetry = 80, this.submit = function() {
  8944. $.ajax({
  8945. url: t + window.location.search,
  8946. type: "POST",
  8947. dataType: "html",
  8948. data: {
  8949. url: n.urlToTest,
  8950. retry: n.retry
  8951. }
  8952. }).success(function(t) {
  8953. if (t.length === 0) {
  8954. if (n.retry < n.maxRetry) {
  8955. n.retry = n.retry + 1;
  8956. setTimeout(n.submit, n.retry < 3 ? 5e3 : 1e3);
  8957. return
  8958. }
  8959. t = $("#errorMsg").clone().show()
  8960. }
  8961. $("#loadingIndicator").hide();
  8962. $("#test-results").html(t);
  8963. $("#desc").clone().appendTo("#result-section").show();
  8964. $("#url-input-button").prop("disabled", !1);
  8965. initInfoHovers();
  8966. i()
  8967. }).error(function() {
  8968. $("#loadingIndicator").hide();
  8969. $("#url-input-button").prop("disabled", !1)
  8970. })
  8971. }, 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())
  8972. }
  8973. return n
  8974. }();
  8975. n.initializeMobileFriendlinessHandlers = u
  8976. }(MobileFriendliness || (MobileFriendliness = {})),
  8977. function(n) {
  8978. var i = function() {
  8979. function i(r) {
  8980. i.options = r;
  8981. this.followupViewModel = new t(r.id, r.controller);
  8982. i.documentUploadManager = new n.DocumentUploadManager(this.followupViewModel.documents, r.controller);
  8983. n.SearchBlockShared.lsAvailable() && localStorage.setItem("sid", this.followupViewModel.sessionId)
  8984. }
  8985. return i.prototype.Run = function() {
  8986. this.validatorSetup();
  8987. ko.applyBindings(this.followupViewModel)
  8988. }, i.prototype.validatorSetup = function() {
  8989. var n = $.extend(!0, {}, formValidateOptions);
  8990. n.onkeyup = !1;
  8991. n.focusCleanup = !0;
  8992. n.ignore = [];
  8993. n.errorPlacement = function(n, t) {
  8994. t.hasClass("no-label") || n.insertAfter(t)
  8995. };
  8996. $("#folloupForm").validate(n);
  8997. $.validator.addClassRules({
  8998. docCount: {
  8999. min: function(n) {
  9000. return parseInt($(n).val()) == 0
  9001. }
  9002. }
  9003. })
  9004. }, i
  9005. }(),
  9006. t;
  9007. n.SearchBlockFollowup = i;
  9008. t = function() {
  9009. function t(n, t) {
  9010. var r = this;
  9011. this.removeDocument = function(n) {
  9012. i.documentUploadManager.removeDocument(n, r.sessionId)
  9013. };
  9014. this.id = n;
  9015. this.controller = t;
  9016. this.sessionId = n.split("_")[1];
  9017. this.documents = ko.observableArray();
  9018. this.validDocuments = ko.computed(function() {
  9019. return ko.utils.arrayFilter(r.documents(), function(n) {
  9020. return n.success()
  9021. }).length
  9022. });
  9023. this.comment = ko.observable()
  9024. }
  9025. return t.prototype.validateAndSubmit = function() {
  9026. var t = this,
  9027. i = $("#followupForm");
  9028. if (!i.valid()) {
  9029. $(".validationErrorPlaceholderBox").show();
  9030. return
  9031. }
  9032. $.ajax({
  9033. url: i.attr("action"),
  9034. type: "POST",
  9035. data: {
  9036. __RequestVerificationToken: n.SearchBlockShared.getAntiForgeryToken(),
  9037. data: ko.toJSON(this)
  9038. },
  9039. success: function() {
  9040. var n = $.validator.format("{0}/tools/{1}/thankyou?id={2}", containerPrefix, t.controller, t.sessionId);
  9041. window.location.replace(n)
  9042. }
  9043. })
  9044. }, t.prototype.toJSON = function() {
  9045. var n = ko.toJS(this);
  9046. return delete n.validDocuments, delete n.sessionId, n
  9047. }, t
  9048. }();
  9049. n.FollowupViewModel = t
  9050. }(PublicTools || (PublicTools = {})),
  9051. function(n) {
  9052. var t = function() {
  9053. function n() {}
  9054. return n.lsAvailable = function() {
  9055. var n = "lstest";
  9056. try {
  9057. return localStorage.setItem(n, n), localStorage.removeItem(n), !0
  9058. } catch (t) {
  9059. return !1
  9060. }
  9061. }, n.getAntiForgeryToken = function() {
  9062. return $("input[name=__RequestVerificationToken]").val()
  9063. }, n.appendAntiForgeryToken = function(t) {
  9064. return t.__RequestVerificationToken = n.getAntiForgeryToken(), t
  9065. }, n
  9066. }();
  9067. n.SearchBlockShared = t
  9068. }(PublicTools || (PublicTools = {})),
  9069. function(n) {
  9070. var t = function() {
  9071. function t() {
  9072. var t = this;
  9073. this.url = ko.observable();
  9074. this.pageContentItems = ko.observableArray();
  9075. this.pageContent = ko.computed(function() {
  9076. return n.SearchBlockUser.bitwiseOr(t.pageContentItems)
  9077. });
  9078. this.contentRelatesDesc = ko.observable();
  9079. this.pageContentDescription = ko.observable();
  9080. this.otherReasonDesc = ko.observable();
  9081. this.urlPreviouslySubmitted = ko.observable(!1)
  9082. }
  9083. return t.prototype.isInArray = function(n) {
  9084. var t = this;
  9085. return ko.computed(function() {
  9086. return ko.utils.arrayFirst(t.pageContentItems(), function(t) {
  9087. return t == n
  9088. }) != null
  9089. })
  9090. }, t.prototype.toJSON = function() {
  9091. var t = ko.toJS(this);
  9092. return delete t.pageContentItems, n.SearchBlockUser.deleteUnsetProperties(t)
  9093. }, t
  9094. }();
  9095. n.SearchBlockUrl = t
  9096. }(PublicTools || (PublicTools = {})),
  9097. function(n) {
  9098. var t = function() {
  9099. function t(t, i) {
  9100. var r = this;
  9101. this.addUrl = function() {
  9102. r.urls.push(new n.SearchBlockUrl)
  9103. };
  9104. this.removeUrl = function(n) {
  9105. r.urls.remove(n)
  9106. };
  9107. this.removeDocument = function(t) {
  9108. n.EuSearchBlock.documentUploadManager.removeDocument(t, r.sessionId)
  9109. };
  9110. this.sessionId = t;
  9111. this.controller = i;
  9112. this.name = ko.observable();
  9113. this.country = ko.observable();
  9114. this.contactEmail = ko.observable();
  9115. this.phoneOrFaxNumber = ko.observable();
  9116. this.mailingAddress = ko.observable();
  9117. this.documents = ko.observableArray();
  9118. this.validDocuments = ko.computed(function() {
  9119. return ko.utils.arrayFilter(r.documents(), function(n) {
  9120. return n.success()
  9121. }).length
  9122. });
  9123. this.isPublicFigure = ko.observable(!1);
  9124. this.isCommunityInterestInfo = ko.observable(!1);
  9125. this.societyCommunityDesc = ko.observable();
  9126. this.urls = ko.observableArray([new n.SearchBlockUrl]);
  9127. this.signature = ko.observable()
  9128. }
  9129. return t.bitwiseOr = function(n) {
  9130. var t = 0;
  9131. return $.each(n(), function(n, i) {
  9132. t = t | parseInt(i)
  9133. }), t
  9134. }, t.prototype.animateRemoveUrlItem = function(n) {
  9135. n.nodeType === 1 && $(n).animate({
  9136. height: 0,
  9137. opacity: 0
  9138. }, 300, "swing", function() {
  9139. $(n).remove()
  9140. })
  9141. }, t.prototype.validateAndSubmit = function() {
  9142. var t = this,
  9143. i = $("#linkRemovalForm");
  9144. if (!i.valid()) {
  9145. $(".validationErrorPlaceholderBox").show();
  9146. $("html,body").animate({
  9147. scrollTop: 0
  9148. }, 300);
  9149. return
  9150. }
  9151. $.ajax({
  9152. url: i.attr("action"),
  9153. type: "POST",
  9154. data: {
  9155. __RequestVerificationToken: n.SearchBlockShared.getAntiForgeryToken(),
  9156. data: ko.toJSON(this)
  9157. },
  9158. success: function() {
  9159. var n = $.validator.format("{0}/tools/{1}/thankyou?id={2}", containerPrefix, t.controller, t.sessionId);
  9160. window.location.replace(n)
  9161. }
  9162. })
  9163. }, t.prototype.toJSON = function() {
  9164. var n = ko.toJS(this);
  9165. return delete n.validDocuments, delete n.isPublicFigure, delete n.isCommunityInterestInfo, t.deleteUnsetProperties(n)
  9166. }, t.deleteUnsetProperties = function(n) {
  9167. var t, i;
  9168. for (t in n) n.hasOwnProperty(t) && (i = n[t], (typeof i == "undefined" || i === null || i === "") && delete n[t]);
  9169. return n
  9170. }, t
  9171. }();
  9172. n.SearchBlockUser = t
  9173. }(PublicTools || (PublicTools = {})),
  9174. function(n) {
  9175. n.fn.mstranslator = function(t) {
  9176. function s() {
  9177. n.get(t.markupUrl, function(n) {
  9178. r = n;
  9179. r != null && r.length > 0 && i()
  9180. })
  9181. }
  9182.  
  9183. function i() {
  9184. console.log("Outputting the markup in the text area and injecting it into the DOM 3");
  9185. var i = n("#themeBox").find("input[name='theme']:checked").val(),
  9186. u = n("#ctEnabledBox").find("input[name='ctEnabled']:checked").val(),
  9187. e = n("#modeBox").find("input[name='mode']:checked").val(),
  9188. o = b(),
  9189. t = n.validator.format(r, i, u, e, o);
  9190. a = t;
  9191. setTimeout(function() {
  9192. if (a == t) {
  9193. n("#WidgetFloaterPanels").remove();
  9194. n("#MicrosoftTranslatorWidget").remove();
  9195. var i = t.indexOf("<script "),
  9196. r = t.substring(0, i),
  9197. u = t.substring(i),
  9198. e = n(u);
  9199. n("#markupbox").val(t);
  9200. n("#preview").empty().html(r).append(e).parent().hide();
  9201. f == -1 && (f = window.setInterval(function() {
  9202. n("#WidgetLauncher").length >= 1 && (window.clearInterval(f), n("#previewContainer").show(), ht(), f = -1)
  9203. }, 100))
  9204. }
  9205. }, 200)
  9206. }
  9207.  
  9208. function v(t) {
  9209. n("#vtab2>ul>li").eq(t).click()
  9210. }
  9211.  
  9212. function d() {
  9213. var i = n("#vtab2>ul>li"),
  9214. r = t.isAuthenticated || t.code != null && t.code != "" ? 2 : 0;
  9215. i.click(function() {
  9216. i.removeClass("selected");
  9217. n(this).addClass("selected");
  9218. var t = i.index(n(this));
  9219. n("#vtab2 >div").hide().eq(t).show()
  9220. }).eq(r).click()
  9221. }
  9222.  
  9223. function h() {
  9224. console.log("Clearing cookies");
  9225. n.cookie("bwt_tw_tth", null, {
  9226. path: "/"
  9227. });
  9228. n.cookie("bwt_tw_tmd", null, {
  9229. path: "/"
  9230. });
  9231. n.cookie("bwt_tw_tct", null, {
  9232. path: "/"
  9233. });
  9234. n.cookie("bwt_tw_tsl", null, {
  9235. path: "/"
  9236. });
  9237. n.cookie("bwt_tw_tsu", null, {
  9238. path: "/"
  9239. });
  9240. n.cookie("bwt_tw_tia", null, {
  9241. path: "/"
  9242. });
  9243. n.cookie("bwt_tw_tctmk", null, {
  9244. path: "/"
  9245. })
  9246. }
  9247.  
  9248. function g() {
  9249. console.log(t);
  9250. h();
  9251. var i = n("input[name='theme']:checked").val(),
  9252. r = n("input[name='mode']:checked").val(),
  9253. u = n("input[name='ctEnabled']:checked").val(),
  9254. f = b(),
  9255. e = n("#siteUrl").val(),
  9256. o = t.isAuthenticated;
  9257. console.log("Setting cookies");
  9258. n.cookie("bwt_tw_tth", i, {
  9259. path: "/"
  9260. });
  9261. n.cookie("bwt_tw_tmd", r, {
  9262. path: "/"
  9263. });
  9264. n.cookie("bwt_tw_tct", u, {
  9265. path: "/"
  9266. });
  9267. n.cookie("bwt_tw_tsl", f, {
  9268. path: "/"
  9269. });
  9270. n.cookie("bwt_tw_tsu", e, {
  9271. path: "/"
  9272. });
  9273. n.cookie("bwt_tw_tia", o, {
  9274. path: "/"
  9275. })
  9276. }
  9277.  
  9278. function nt() {
  9279. console.log("Reading cookies");
  9280. t.theme = n.cookie("bwt_tw_tth");
  9281. t.mode = n.cookie("bwt_tw_tmd");
  9282. t.ctEnabled = n.cookie("bwt_tw_tct");
  9283. t.siteLanguage = n.cookie("bwt_tw_tsl");
  9284. t.siteUrl = n.cookie("bwt_tw_tsu");
  9285. t.isAuthenticated = n.cookie("bwt_tw_tia");
  9286. console.log("Options after reading cookies %o", t)
  9287. }
  9288.  
  9289. function tt() {
  9290. t.code != null && t.code != "" ? nt() : (console.log("URL contains no code query parameter. Calling clearing cookies"), h(), s())
  9291. }
  9292.  
  9293. function it() {
  9294. if (t.theme && (n("input[name='theme'][value='" + t.theme + "']").prop("checked", !0), y()), t.mode) {
  9295. var i = n("input[name='mode'][value='" + t.mode + "']");
  9296. i.prop("checked", !0);
  9297. p()
  9298. }
  9299. t.siteLanguage && t.siteLanguage != "" && n("#siteLanguage option[value='" + t.siteLanguage + "']").prop("selected", !0);
  9300. t.ctEnabled && (n("input[name='ctEnabled'][value='" + t.ctEnabled + "']").prop("checked", !0), w());
  9301. t.siteUrl && n("#siteUrl").val(t.siteUrl)
  9302. }
  9303.  
  9304. function c() {
  9305. var f = 0,
  9306. e;
  9307. 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)
  9308. }
  9309.  
  9310. function rt() {
  9311. n.get(t.ctfMarkupUrl, {
  9312. code: t.code,
  9313. siteUrl: n("#siteUrl").val()
  9314. }, function(t) {
  9315. console.log("CTF request result from the server %o", t);
  9316. t != null && t.length > 0 ? (r = t, console.log("Setting tctmk cookie after getting the ctf markup"), n.cookie("bwt_tw_tctmk", r, {
  9317. path: "/"
  9318. }), 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())
  9319. })
  9320. }
  9321.  
  9322. function y() {
  9323. var t = n("input[name='theme']:checked").val() == "Dark";
  9324. t ? n("#previewBackground").removeClass("dark-background") : n("#previewBackground").addClass("dark-background")
  9325. }
  9326.  
  9327. function p() {
  9328. var t = n("input[name='mode']:checked").val() == "Manual";
  9329. t && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.FloaterOnClose()
  9330. }
  9331.  
  9332. function w() {
  9333. var t = n("input[name='ctEnabled']:checked").val() == "True";
  9334. 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())
  9335. }
  9336.  
  9337. function ut() {
  9338. n("body").attr("adjustalign", "false");
  9339. n("#sb_foot").attr("translate", "no");
  9340. n("#sw_hdr").attr("translate", "no");
  9341. n("#sw_abar").attr("translate", "no");
  9342. n("#fbpgbt").attr("translate", "no")
  9343. }
  9344.  
  9345. function ft() {
  9346. n(".ctf-steps").hasClass("disabled-section") || n("#translatorForm").submit()
  9347. }
  9348.  
  9349. function et() {
  9350. 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)
  9351. }
  9352.  
  9353. function ot(n) {
  9354. if (n.which == 13) {
  9355. n.preventDefault();
  9356. return
  9357. }(n.type == "keypress" || u == !1) && c()
  9358. }
  9359.  
  9360. function b() {
  9361. var i = n("#siteLanguage").val();
  9362. return i == null && (t.siteLanguage == "" ? (i = o, e = o) : i = t.siteLanguage), i
  9363. }
  9364.  
  9365. function st() {
  9366. n("#siteLanguage").append(n("<option />").val(o).text(t.autoDetectOption))
  9367. }
  9368.  
  9369. function k(r) {
  9370. var f = n("#siteLanguage"),
  9371. u;
  9372. n.each(r, function(t, i) {
  9373. f.append(n("<option />").val(i.Code).text(i.Name))
  9374. });
  9375. u = "";
  9376. t.siteLanguage !== "" && (u = t.siteLanguage);
  9377. n("#siteLanguage option[value='" + u + "']").prop("selected", !0);
  9378. e != null && e != u && i()
  9379. }
  9380.  
  9381. function ht() {
  9382. n("#siteLanguage option").length == 1 && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.Widget.GetLanguagesForTranslate(t.parentCulture, function(n) {
  9383. typeof n == "undefined" ? Microsoft.Translator.Widget.GetLanguagesForTranslate("en-us", function(n) {
  9384. typeof n != "undefined" && k(n)
  9385. }) : k(n)
  9386. }, function(n) {
  9387. console.log("Error Fetching list of languages %s !", n)
  9388. })
  9389. }
  9390.  
  9391. function ct() {
  9392. window.AM != null && window.AM.push(t.translatorDomain);
  9393. l = n("#translatorForm").validate(formValidateOptions);
  9394. st();
  9395. tt();
  9396. it();
  9397. d();
  9398. c();
  9399. ut();
  9400. n(".customize-options input:radio").change(i);
  9401. n("input[name='theme']").change(y);
  9402. n("input[name='mode']").change(p);
  9403. n("#siteLanguage").change(i);
  9404. n("input[name='ctEnabled']").change(w);
  9405. n("#signInLink a").click(ft);
  9406. n("#associateInLink a").click(et);
  9407. n("#markupbox").focus(selectAllTextAreaContent);
  9408. n("#siteUrl").bind("blur mouseleave keypress", ot);
  9409. n("#settingsContinue").click(function() {
  9410. v(1)
  9411. });
  9412. n("#themeContinue").click(function() {
  9413. v(2)
  9414. })
  9415. }
  9416. var r = "",
  9417. l = null,
  9418. u = !1,
  9419. f = -1,
  9420. e = null,
  9421. o = "",
  9422. a = "";
  9423. ct()
  9424. }
  9425. }(jQuery),
  9426. function(n) {
  9427. function t() {
  9428. function c(n) {
  9429. t = n.widgetUrl;
  9430. r = n.blockUrl;
  9431. u = n.deleteUrl;
  9432. f = n.textMaxLength;
  9433. l();
  9434. a()
  9435. }
  9436.  
  9437. function l() {
  9438. n("#submitBlock").click(v);
  9439. clickButtonOnEnter("#submitBlock", "#blockTextInput");
  9440. n("#deleteTextBlock").click(p);
  9441. e()
  9442. }
  9443.  
  9444. function e() {
  9445. n("#textBlockList table.wmtable :checkbox").change(h)
  9446. }
  9447.  
  9448. function a() {
  9449. n.validator.addClassRules({
  9450. textMaxLengthRule: {
  9451. maxlength: f
  9452. }
  9453. })
  9454. }
  9455.  
  9456. function v() {
  9457. if (n("#textBlockForm").valid()) {
  9458. var i = {
  9459. widgetUrl: t,
  9460. daysToExpire: n("#expireDropdown").val(),
  9461. text: n("#blockTextInput").val(),
  9462. caseSensitive: n("#caseSensitiveCheck").is(":checked")
  9463. };
  9464. showActivityIndicator(!0);
  9465. o(r, i, y, unsetModalAndReportErrorHandler)
  9466. }
  9467. }
  9468.  
  9469. function y(t) {
  9470. var i, r;
  9471. hideActivityIndicator();
  9472. unsetModalActivityIndicator();
  9473. i = t.TextBlock;
  9474. n("#blockTextInput").val("");
  9475. n("#expireDropdown option[data-default=true]").attr("selected", "selected");
  9476. n("#caseLabel").removeClass("on");
  9477. n("#caseSensitiveCheck").removeAttr("checked");
  9478. r = n("<tr/>");
  9479. readOnlyMode ? r.append(n("<td/>")) : r.append(n('<td class="width20"/>').append(n("<input>", {
  9480. type: "checkbox",
  9481. "data-text": i.Text,
  9482. "data-case": i.CaseSensitive
  9483. })).append(n("<label/>")));
  9484. 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));
  9485. n("#textBlockList tbody").prepend(r);
  9486. n("#textBlockList table.wmtable").trigger("update");
  9487. e()
  9488. }
  9489.  
  9490. function p() {
  9491. var i, r;
  9492. showActivityIndicator(!0);
  9493. i = [];
  9494. n("#textBlockList table.wmtable input:checked").each(function() {
  9495. var t = {
  9496. Text: n(this).attr("data-text"),
  9497. CaseSensitive: n(this).attr("data-case")
  9498. };
  9499. i.push(t)
  9500. });
  9501. r = {
  9502. widgetUrl: t,
  9503. textBlocks: JSON.stringify(i)
  9504. };
  9505. o(u, r, w, unsetModalAndReportErrorHandler)
  9506. }
  9507.  
  9508. function w(t) {
  9509. hideActivityIndicator();
  9510. unsetModalActivityIndicator();
  9511. n.each(t, function(t, i) {
  9512. n("#textBlockList table input[data-case=" + i.CaseSensitive + "]").each(function() {
  9513. n(this).attr("data-text") == i.Text && n(this).closest("tr").remove()
  9514. })
  9515. });
  9516. n("#textBlockList table.wmtable").trigger("update")
  9517. }
  9518.  
  9519. function o(n, t, i, r) {
  9520. startPostRequestWithJson(t, n, i, r, s)
  9521. }
  9522. var i = {},
  9523. s = "#textBlockForm",
  9524. t, r, u, f, h = setupGridCheckButtonEnabler("#textBlockList table.wmtable", "#deleteTextBlock");
  9525. return i.initialize = c, i
  9526. }
  9527. n.textBlockController = function() {
  9528. return new t
  9529. }
  9530. }(jQuery),
  9531. function(n) {
  9532. function t() {
  9533. function s(n) {
  9534. i = n.createUrl;
  9535. r = n.deleteUrl;
  9536. u = n.settingsUrl;
  9537. h()
  9538. }
  9539.  
  9540. function h() {
  9541. n("#submitWidgetButton").click(l);
  9542. clickButtonOnEnter("#submitWidgetButton", "#inputWidgetName");
  9543. n("#deleteWidgetButton").click(v);
  9544. n("#goBlockButton").click(p);
  9545. c()
  9546. }
  9547.  
  9548. function c() {
  9549. n("#siteWidgetList table.wmtable :checkbox").change(o)
  9550. }
  9551.  
  9552. function l() {
  9553. showActivityIndicator(!0);
  9554. var t = {
  9555. name: n("#inputWidgetName").val()
  9556. };
  9557. f(i, t, a, unsetModalAndReportErrorHandler)
  9558. }
  9559.  
  9560. function a(t) {
  9561. var i = u + "&id=" + t.Id;
  9562. n("#inputWidgetName").val().length == 0 && (i += "&unnamed=1");
  9563. window.location = i
  9564. }
  9565.  
  9566. function v() {
  9567. var t, i;
  9568. showActivityIndicator(!0);
  9569. t = [];
  9570. n.each(getCheckedItemsInTable("data-id"), function(n, i) {
  9571. var r = {
  9572. Id: i,
  9573. SiteUrl: url
  9574. };
  9575. t.push(r)
  9576. });
  9577. i = {
  9578. widgets: JSON.stringify(t)
  9579. };
  9580. f(r, i, y, unsetModalAndReportErrorHandler)
  9581. }
  9582.  
  9583. function y(t) {
  9584. hideActivityIndicator();
  9585. unsetModalActivityIndicator();
  9586. n.each(t, function(t, i) {
  9587. n("#siteWidgetList table input[data-id=" + i.Id + "]").closest("tr").remove()
  9588. });
  9589. n("#siteWidgetList table.wmtable").trigger("update")
  9590. }
  9591.  
  9592. function p() {
  9593. window.location = n("#blockDropdown").val()
  9594. }
  9595.  
  9596. function f(n, t, i, r) {
  9597. startPostRequestWithJson(t, n, i, r, e)
  9598. }
  9599. var t = {},
  9600. e = "#siteWidgetsForm",
  9601. i, r, u, o = setupGridCheckButtonEnabler("#siteWidgetList table.wmtable", "#deleteWidgetButton");
  9602. return t.initialize = s, t
  9603. }
  9604. n.siteWidgetController = function() {
  9605. return new t
  9606. }
  9607. }(jQuery),
  9608. function(n) {
  9609. n.fn.translatorWidget = function(t) {
  9610. function o() {
  9611. n.get(t.markupUrl, function(n) {
  9612. r = n;
  9613. r != null && r.length > 0 && i()
  9614. })
  9615. }
  9616.  
  9617. function i() {
  9618. n("#WidgetFloaterPanels").remove();
  9619. n("#MicrosoftTranslatorWidget").remove();
  9620. var f = n("input[name='theme']:checked").val(),
  9621. e = n("input[name='ctEnabled']:checked").val(),
  9622. o = n("input[name='mode']:checked").val(),
  9623. s = a(),
  9624. t = n.validator.format(r, f, e, o, s),
  9625. i = t.indexOf("<script "),
  9626. h = t.substring(0, i),
  9627. c = t.substring(i),
  9628. l = n(c);
  9629. n("#markupbox").val(t);
  9630. n("#copyToClipboard").attr("data-clipboard-text", t);
  9631. n("#preview").empty().html(h).append(l).parent().hide();
  9632. u == -1 && (u = window.setInterval(function() {
  9633. n("#WidgetLauncher").length >= 1 && (window.clearInterval(u), n("#previewContainer").show(), v(), u = -1)
  9634. }, 100))
  9635. }
  9636.  
  9637. function s() {
  9638. var t = n("input[name='theme']:checked").val() == "Dark";
  9639. t ? n("#previewBackground").removeClass("dark-background") : n("#previewBackground").addClass("dark-background")
  9640. }
  9641.  
  9642. function h() {
  9643. var t = n("input[name='mode']:checked").val() == "Manual";
  9644. t && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.FloaterOnClose()
  9645. }
  9646.  
  9647. function c() {
  9648. i()
  9649. }
  9650.  
  9651. function l() {
  9652. n("body").attr("adjustalign", "false");
  9653. n("header").attr("translate", "no");
  9654. n("nav").attr("translate", "no");
  9655. n("footer").attr("translate", "no");
  9656. n("h1.page-name").attr("translate", "no");
  9657. n("#fbpgbt").attr("translate", "no")
  9658. }
  9659.  
  9660. function a() {
  9661. var i = n("#siteLanguage").val();
  9662. return i == null && (i = t.parentCulture, f = t.parentCulture), i
  9663. }
  9664.  
  9665. function e(r) {
  9666. n.each(r, function(t, i) {
  9667. n("#siteLanguage").append(n("<option />").val(i.Code).text(i.Name))
  9668. });
  9669. var u = "en";
  9670. n("#siteLanguage option").each(function() {
  9671. if (n(this).attr("value") == t.parentCulture) {
  9672. u = t.parentCulture;
  9673. return
  9674. }
  9675. });
  9676. n("#siteLanguage option[value='" + u + "']").prop("selected", !0);
  9677. f != "" && f != u && i()
  9678. }
  9679.  
  9680. function v() {
  9681. n("#siteLanguage option").length == 0 && typeof Microsoft != "undefined" && typeof Microsoft.Translator != "undefined" && Microsoft.Translator.Widget.GetLanguagesForTranslate(t.parentCulture, function(n) {
  9682. typeof n == "undefined" ? Microsoft.Translator.Widget.GetLanguagesForTranslate("en-us", function(n) {
  9683. typeof n != "undefined" && e(n)
  9684. }) : e(n)
  9685. }, function(n) {
  9686. console.log("Error Fetching list of languages %s !", n)
  9687. })
  9688. }
  9689.  
  9690. function y() {
  9691. ZeroClipboard.setDefaults({
  9692. moviePath: "/webmaster/content/images/zeroclipboard.swf"
  9693. });
  9694. var t = n("#copyToClipboard"),
  9695. i = new ZeroClipboard(t);
  9696. i.on("mouseover", function() {
  9697. t.addClass("button-hover")
  9698. });
  9699. i.on("mouseout", function() {
  9700. t.removeClass("button-hover")
  9701. });
  9702. i.on("mousedown", function() {
  9703. t.addClass("button-active")
  9704. });
  9705. i.on("mouseup", function() {
  9706. t.removeClass("button-active")
  9707. })
  9708. }
  9709.  
  9710. function p() {
  9711. o();
  9712. l();
  9713. y();
  9714. n(".customize-options input:radio").change(i);
  9715. n("input[name='theme']").change(s);
  9716. n("input[name='mode']").change(h);
  9717. n("#siteLanguage").change(i);
  9718. n("input[name='ctEnabled']").change(c);
  9719. n("#markupbox").focus(selectAllTextAreaContent)
  9720. }
  9721. var r = "",
  9722. u = -1,
  9723. f = "";
  9724. p()
  9725. }
  9726. }(jQuery),
  9727. function(n) {
  9728. n.fn.trendingWidget = function(t) {
  9729. function i() {
  9730. var f = n("#widget-flavor").val(),
  9731. e = n("#widget-data-type").val(),
  9732. u = n("div.size-option").is(":visible") ? n("#widget-size").val().split("x") : [300, 250],
  9733. 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),
  9734. r;
  9735. n("#markupbox").val(i);
  9736. n("#copyToClipboard").attr("data-clipboard-text", i);
  9737. r = n("div.widget-preview");
  9738. r.css({
  9739. "overflow-y": "hidden",
  9740. "min-height": "333px"
  9741. });
  9742. n("div.preview-block").html(i);
  9743. r.css({
  9744. "overflow-y": "",
  9745. "min-height": ""
  9746. })
  9747. }
  9748.  
  9749. function r() {
  9750. var t = n("#widget-flavor").val();
  9751. switch (t) {
  9752. case "trending":
  9753. n("#widget-size :not(option.textonly)").show();
  9754. n("#widget-size option.textonly").hide();
  9755. n("div.size-option").show();
  9756. n("#widget-size :first-child").prop("selected", !0);
  9757. break;
  9758. case "text":
  9759. n("#widget-size :not(option.textonly)").hide();
  9760. n("#widget-size option.textonly").show();
  9761. n("div.size-option").show();
  9762. n("#widget-size option.textonly:first").prop("selected", !0);
  9763. break;
  9764. case "slicebox":
  9765. n("div.size-option").hide();
  9766. break;
  9767. case "tagferriswheel":
  9768. n("div.size-option").hide()
  9769. }
  9770. }
  9771.  
  9772. function u() {
  9773. r();
  9774. i()
  9775. }
  9776.  
  9777. function f() {
  9778. i()
  9779. }
  9780.  
  9781. function e() {
  9782. i()
  9783. }
  9784.  
  9785. function o() {
  9786. ZeroClipboard.setDefaults({
  9787. moviePath: "/webmaster/content/images/zeroclipboard.swf"
  9788. });
  9789. var t = n("#copyToClipboard"),
  9790. i = new ZeroClipboard(t);
  9791. i.on("mouseover", function() {
  9792. t.addClass("button-hover")
  9793. });
  9794. i.on("mouseout", function() {
  9795. t.removeClass("button-hover")
  9796. });
  9797. i.on("mousedown", function() {
  9798. t.addClass("button-active")
  9799. });
  9800. i.on("mouseup", function() {
  9801. t.removeClass("button-active")
  9802. })
  9803. }
  9804.  
  9805. function s() {
  9806. n("#widget-flavor").change(u);
  9807. n("#widget-data-type").change(f);
  9808. n("#widget-size").change(e);
  9809. n("#markupbox").focus(selectAllTextAreaContent);
  9810. r();
  9811. i();
  9812. o()
  9813. }
  9814. s()
  9815. }
  9816. }(jQuery),
  9817. function(n) {
  9818. function t() {
  9819. function s(n) {
  9820. t = n.blockLink;
  9821. u = n.deleteUrl;
  9822. f = n.blockUrl;
  9823. h()
  9824. }
  9825.  
  9826. function h() {
  9827. n("#submitBlock").click(a);
  9828. clickButtonOnEnter("#submitBlock", "#blockTextInput, #inputWidgetUrl");
  9829. n("#deleteUrlButton").click(y);
  9830. c();
  9831. l()
  9832. }
  9833.  
  9834. function c() {
  9835. n("#widgetUrlList tr.widgetUrlRow").find("td:gt(0)").click(w);
  9836. n("span.stopPropagation").click(function(n) {
  9837. n.stopPropagation()
  9838. })
  9839. }
  9840.  
  9841. function l() {
  9842. n("#widgetUrlList table.wmtable :checkbox").change(o)
  9843. }
  9844.  
  9845. function a() {
  9846. if (n(r).valid()) {
  9847. var t = n("#inputWidgetUrl").val(),
  9848. i = {
  9849. widgetUrl: t,
  9850. daysToExpire: n("#expireDropdown").val(),
  9851. text: n("#blockTextInput").val(),
  9852. caseSensitive: n("#caseSensitiveCheck").is(":checked")
  9853. };
  9854. showActivityIndicator(!0);
  9855. e(f, i, v, unsetModalAndReportErrorHandler)
  9856. }
  9857. }
  9858.  
  9859. function v(n) {
  9860. window.location = t + "&widgeturl=" + encodeURIComponent(n.Url)
  9861. }
  9862.  
  9863. function y() {
  9864. var t, i;
  9865. showActivityIndicator(!0);
  9866. t = [];
  9867. n.each(getCheckedItemsInTable("data-url"), function(n, i) {
  9868. var r = {
  9869. SiteUrl: url,
  9870. url: i
  9871. };
  9872. t.push(r)
  9873. });
  9874. i = {
  9875. widgetUrls: JSON.stringify(t)
  9876. };
  9877. e(u, i, p, unsetModalAndReportErrorHandler)
  9878. }
  9879.  
  9880. function p(t) {
  9881. hideActivityIndicator();
  9882. unsetModalActivityIndicator();
  9883. n.each(t, function(t, i) {
  9884. n('#widgetUrlList table input[data-url="' + i.Url + '"]').closest("tr").remove()
  9885. });
  9886. n("#widgetUrlList table.wmtable").trigger("update")
  9887. }
  9888.  
  9889. function e(n, t, i, u) {
  9890. startPostRequestWithJson(t, n, i, u, r)
  9891. }
  9892.  
  9893. function w() {
  9894. var i = n(this).parent("tr").find("input").attr("data-url");
  9895. window.location = t + "&widgetUrl=" + encodeURIComponent(i)
  9896. }
  9897. var i = {},
  9898. r = "#widgetUrlForm",
  9899. t, u, f, o = setupGridCheckButtonEnabler("#widgetUrlList table.wmtable", "#deleteUrlButton");
  9900. return i.initialize = s, i
  9901. }
  9902. n.widgetUrlController = function() {
  9903. return new t
  9904. }
  9905. }(jQuery)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement