1var currentSecond; 2var fnCallAfterCountdown; 3function countdown() 4{ 5 if (currentSecond != 1) 6 { 7 currentSecond -= 1 8 } 9 else 10 { 11 fnCallAfterCountdown; 12 return; 13 } 14 setTimeout("countdown()",1000) 15} 16 17function addEvent(elm, evType, fn, useCapture) 18{ 19 if (elm.addEventListener) { 20 elm.addEventListener(evType, fn, useCapture); 21 return true; 22 } 23 else if (elm.attachEvent) { 24 var r = elm.attachEvent('on' + evType, fn); 25 return r; 26 } 27 else { 28 elm['on' + evType] = fn; 29 } 30} 31 32// TIMEOUT WARNING FUNCTIONS 33var iVizergyTimeoutSecondsTillWarning = 840; //14 minutes 34var iVizergyTimeoutSecondsTillRedirect = 62; //1 minute and 2 seconds 35var sVizergyTimeoutWarningDisplayCookieName = "VizergyTimeoutWarningDisplay"; 36var sVizergyTimeoutWarningLastAccessTimeCookieName = "VizergyTimeoutWarningLastAccessTime"; 37var sVizergyTimeoutWarningURL = "/login/timeout-warning.htm?dt=20120817"; 38var sVizergyTimeoutLogoutURL = "/login/logout.aspx"; 39var sVizergyTimeoutPopupBlockedMessage = "Your browser blocked a popup trying to warn you that your session is about to time out. Disable your popup blocker for this site so you can receive the warning popup next time."; 40var sVizergyTimeoutMarketingSystemName = ""; 41var sVizergyTimeoutLogoWithNameURL = ""; 42var sVizergyTimeoutLogoURL = ""; 43var sVizergyTimeoutLogoBackgroundColor = ""; 44function StartTimeoutWarningTimer(bFirstLoad) 45{ 46 createCookie(sVizergyTimeoutWarningLastAccessTimeCookieName, (new Date()).getTime()); 47 if (bFirstLoad == true) 48 { 49 setInterval(CheckTimeoutWarningTime, 1000); 50 } 51} 52 53function CheckTimeoutWarningTime() 54{ 55 var iLastAccessTime = parseInt(readCookie(sVizergyTimeoutWarningLastAccessTimeCookieName), 10); 56 if (iLastAccessTime == 0) 57 { 58 window.location.href = sVizergyTimeoutLogoutURL; 59 } 60 var iNow = (new Date).getTime(); 61 var iTimeoutWarningTime = iLastAccessTime + (iVizergyTimeoutSecondsTillWarning * 1000); 62 if (iNow >= iTimeoutWarningTime) 63 { 64 //if it's been 1 second since the warning time stop trying to open the warning popup 65 //-this controls opening the popup so that after the iTimeoutWarningTime has passed the pages won't try 66 //to keep opening the popup 67 //console.log(new Date().getMinutes() + "." + new Date().getSeconds() + "." + new Date().getMilliseconds() + " " + (iNow <= iTimeoutWarningTime + 2000)); 68 if (iNow <= iTimeoutWarningTime + 2000) 69 { 70 TimeoutWarning(); 71 } 72 else 73 { 74 return false; 75 } 76 } 77 else 78 { 79 var oTitleParts = document.title.split("="); 80 var sOriginalTitle = (oTitleParts.length == 1) ? oTitleParts[0] : oTitleParts[1]; 81 if (readCookie(sVizergyTimeoutWarningDisplayCookieName) == "1") 82 { 83 var iSecondsLeft = (iTimeoutWarningTime - iNow) / 1000; 84 var iMinutes = Math.floor(iSecondsLeft / 60); 85 var iSeconds = Math.floor(iSecondsLeft % 60); 86 var sTime = ((iMinutes < 10) ? "0"+iMinutes : iMinutes) + ":" + ((iSeconds < 10) ? "0"+iSeconds : iSeconds) 87 document.title = sTime+"="+sOriginalTitle; 88 } 89 else 90 { 91 document.title = sOriginalTitle; 92 } 93 } 94} 95 96function ToggleTimeoutWarningDisplay() 97{ 98 if(readCookie(sVizergyTimeoutWarningDisplayCookieName) != "1") 99 { 100 createCookie(sVizergyTimeoutWarningDisplayCookieName, "1"); 101 } 102 else 103 { 104 createCookie(sVizergyTimeoutWarningDisplayCookieName, "0"); 105 } 106} 107 108function StartTimeoutRedirectTimer() 109{ 110 setTimeout(TimeoutRedirect, iVizergyTimeoutSecondsTillRedirect * 1000); 111} 112 113function TimeoutWarning() 114{ 115 var win = window.open(sVizergyTimeoutWarningURL + "&msn=" + encodeURIComponent(sVizergyTimeoutMarketingSystemName) + "&lwn=" + encodeURIComponent(sVizergyTimeoutLogoWithNameURL) + "&l=" + encodeURIComponent(sVizergyTimeoutLogoURL) + "&b=" + encodeURIComponent(sVizergyTimeoutLogoBackgroundColor), "TimeoutWarning", "width=400, height=300, scrollbars=0, status=0"); 116 if (win == null || typeof (win) == "undefined") 117 { 118 //popup didn't exist 119 alert(sVizergyTimeoutPopupBlockedMessage); 120 } 121 else 122 { 123 //browsers like chrome do physically create the window object but they hide 124 //the window so we have to check if it is a shrunken window 125 win.onload = function () { 126 //wait a little bit before checking the dimensions of the popup content to be certain 127 //chrome has had time to update it's properties 128 setTimeout(function() 129 { 130 if (win.innerHeight == 0) 131 { 132 alert(sVizergyTimeoutPopupBlockedMessage); 133 } 134 }, 500); 135 } 136 } 137} 138 139function TimeoutRedirect() 140{ 141 if (window.opener && window.opener.open && !window.opener.closed) 142 { 143 window.opener.location.href = sVizergyTimeoutLogoutURL; 144 } 145 //set to zero so all tabs can identify a redirect happening and redirect themselves too 146 createCookie(sVizergyTimeoutWarningLastAccessTimeCookieName, 0); 147 window.close(); 148} 149 150//----------------------------------------------------------------------------- 151// COOKIES (http://www.quirksmode.org/js/cookies.html) 152//----------------------------------------------------------------------------- 153 154function createCookie(name,value,days) 155{ 156 if (days) 157 { 158 var date = new Date(); 159 date.setTime(date.getTime()+(days*24*60*60*1000)); 160 var expires = "; expires="+date.toGMTString(); 161 } 162 else var expires = ""; 163 document.cookie = name+"="+value+expires+"; path=/; secure"; 164} 165 166function readCookie(name) 167{ 168 var nameEQ = name + "="; 169 var ca = document.cookie.split(';'); 170 for(var i=0;i < ca.length;i++) 171 { 172 var c = ca[i];
173 while (c.charAt(0)==' ') c = c.substring(1,c.length); 174 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 175 } 176 return ""; 177} 178 179//----------------------------------------------------------------------------- 180// FLYING DIV 181//----------------------------------------------------------------------------- 182//iTopOffset = how far from the top of the page to keep the div 183//iRightOffset = how far from the rightside of the page to keep the div 184function flyingDiv(iTopOffset, iRightOffset) 185{ 186 (function ($) 187 { 188 //make a div float down when window scrolls 189 var flyingDiv; 190 var iflyingDivOriginalY; 191 $(function () 192 { 193 //store values in variables so they don't 194 //have to be looked up anymore, less expensive 195 flyingDiv = $("#flyingDiv"); 196 iflyingDivOriginalY = flyingDiv.offset().top; 197 198 $(window).scroll(function () 199 { 200 var scrollTop = $(window).scrollTop(); 201 202 if (scrollTop > iflyingDivOriginalY) 203 { 204 var top = (scrollTop + iTopOffset) + "px"; 205 var left = ($(window).width() - flyingDiv.width() - iRightOffset) + "px"; 206 flyingDiv.css("position", "absolute"); 207 flyingDiv.css("top", top); 208 flyingDiv.css("left", left); 209 } 210 else 211 { 212 flyingDiv.css("position", ""); 213 flyingDiv.css("top", ""); 214 flyingDiv.css("left", ""); 215 } 216 }); 217 }); 218 })(jQuery); 219} 220 221function accountChange(redirect) { 222 var ddl = document.getElementById("ctl00_ddlAccounts"); 223 window.location = "redirect-handler.aspx?accountid=" + ddl.value + "&accountName=" + ddl.options[ddl.selectedIndex].text + "&accountRedirect=" + redirect + "&view=" + ddl.options[ddl.selectedIndex].getAttribute("data-view") + "&demo=" + ddl.options[ddl.selectedIndex].getAttribute("data-demo") + "&recordid=" + ddl.options[ddl.selectedIndex].getAttribute("data-recordid"); 224} 225 226function accountGroupChange(redirect) { 227 var ddl = document.getElementById("ctl00_ddlAccounts"); 228 var ddlGroup = document.getElementById("ctl00_content_ddlAccountGroup"); 229 if (ddlGroup.value !== -1) 230 { 231 window.location = "redirect-handler.aspx?accountid=" + ddl.value + "&accountName=" + ddl.options[ddl.selectedIndex].text + "&accountRedirect=" + redirect + "&view=" + ddl.options[ddl.selectedIndex].getAttribute("data-view") + "&demo=" + ddl.options[ddl.selectedIndex].getAttribute("data-demo") + "&recordid=" + ddl.options[ddl.selectedIndex].getAttribute("data-recordid") + "&groupid=" + ddlGroup.value; 232 } 233} 234 235 236var qTipOptions = {}; 237 238//for tooltip content that needs to be clickable 239var qTipOptionsFixed = { 240 fixed: true 241}; 242 243//USE THIS TO DISABLE THE TOOLTIPS FROM BEING APPLIED TO GENERIC 'AREA' AND 'DIV' ELEMENTS THAT HAVE TITLES 244//LIKE ON THE PORTFOLIO PAGE WHERE MANY REPORTING SERVICES REPORTS HAVE GENERIC AREA AND DIV ELEMENTS WITH TITLES 245var bClientLoginDisableGenericTitleTooltips = false; 246 247function ApplyGeneralDesignEffects() 248{ 249 $(function() 250 { 251 var sSelector = '.tooltipElement:not(.tooltipApplied), area[title]:not(.tooltipApplied), div[title]:not(.tooltipApplied)'; 252 if (bClientLoginDisableGenericTitleTooltips == true) 253 { 254 sSelector = '.tooltipElement:not(.tooltipApplied)'; 255 } 256 257 //the qtip plugin is one of the slowest plugins running on the page so we fire it in a setTimeout function 258 //because this frees up the normal page execution thread so other things can finish fast since tooltips 259 //don't have to be loaded right away 260 setTimeout(function() 261 { 262 $(sSelector) 263 .filter(function(index) 264 { 265 return $(this).attr("title") != ""; 266 }) 267 .addClass("tooltipElement").addClass("tooltipApplied") 268 .qtip(qTipOptions); 269 270 $('.tooltipElementFixed:not(.tooltipApplied)') 271 .addClass("tooltipElement").addClass("tooltipApplied") 272 .qtip(qTipOptionsFixed); 273 }, 500); 274 275 }); 276} 277 278//asp.net ajax load event 279function pageLoad() 280{ 281 $("img[title='Report chart']").removeAttr("title"); 282 $("a[data-drillthroughurl], area[data-drillthroughurl]").removeAttr("data-drillthroughurl"); 283 284 //remove tabindex attributes from the image map areas, these attributes were causing a 2 second delay when clicking the account dropdown starting in chrome 62
285 //we guess it is because when the dropdown gets focused chrome is analyzing all the other fields on the page to see what tab order the focused field is in 286 //removing these tabindex attributes means less tabindex elements for chrome to analyze 287 $("map").each(function() 288 { 289 //loop over each map individually and detach it from the page before we update it's "area" elements so that as we update each one it doesn't 290 //cause a reflow/restyle on the page which is slow in IE, then we readd the map under its original parent so all updated areas are landed at the same time 291 var $map = $(this).closest("map"); 292 var $mapParent = $map.parent(); 293 $map.detach(); 294 $("area[tabindex", $map).removeAttr("tabindex"); 295 $mapParent.append($map); 296 }); 297 $("a[tabindex]").removeAttr("tabindex"); 298 299 var sSelector = '.tooltipElement:not(.tooltipApplied), area[title]:not(.tooltipApplied), div[title]:not(.tooltipApplied)'; 300 if (bClientLoginDisableGenericTitleTooltips == true) 301 { 302 sSelector = '.tooltipElement:not(.tooltipApplied)'; 303 } 304 305 //the qtip plugin is one of the slowest plugins running on the page so we fire it in a setTimeout function 306 //because this frees up the normal page execution thread so other things can finish fast since tooltips 307 //don't have to be loaded right away 308 setTimeout(function() 309 { 310 $(sSelector) 311 .filter(function(index) 312 { 313 return $(this).attr("title") != ""; 314 }) 315 .addClass("tooltipElement").addClass("tooltipApplied") 316 .qtip(qTipOptions) 317 .filter(function(index) 318 { 319 //when qtip applies successfully it moves the title attribute to an 'oldtitle' attribute 320 //so if that didn't happen then the qtips didn't apply successfully 321 return typeof($(this).attr("title")) != "undefined" && $(this).attr("title") != ""; 322 }) 323 .removeClass("tooltipApplied"); 324 325 $('.tooltipElementFixed:not(.tooltipApplied)') 326 .addClass("tooltipElement").addClass("tooltipApplied") 327 .qtip(qTipOptionsFixed); 328 }, 500); 329 330} 331 332//define console.log for old browsers so we don't get any errors 333if (typeof console === "undefined") 334{ 335 console={}; 336 console.log = function() 337 { 338 return; 339 } 340} 341 342function ActivateReportGroupingOptions() 343{ 344 $(function() 345 { 346 //if filter options are available then this js will toggle the correct fields when the radio buttons change 347 if ($("#ctl00_content_ulFilterBy").length > 0) 348 { 349 //hide group by default 350 if ($("#ctl00_content_radFilterByAccount").is(":checked")) 351 { 352 $("div.divGroupField").hide(); 353 $("div.divAccountField").show(); 354 } 355 else if ($("#ctl00_content_radFilterByGroup").is(":checked")) 356 { 357 $("div.divAccountField").hide(); 358 $("div.divGroupField").show(); 359 } 360 361 //clicking the account option toggles the group dropdown off 362 $("#ctl00_content_radFilterByAccount").click(function() 363 { 364 var $radio = $(this); 365 //hide other field 366 $("div.divGroupField").hide(); 367 $("div.divAccountField").show(); 368 //update other option to have All selected 369 $("div.divGroupField span.dropdownAllOption input").attr("checked", true).triggerHandler("click"); 370 //reroll up other option to get rid of any individual selections 371 $("div.divGroupField .dropdownValues").each(function () 372 { 373 RollupReportParameterValues(this); 374 $(this).hide(); 375 }); 376 }); 377 378 //clicking the group option toggles the account dropdown off 379 $("#ctl00_content_radFilterByGroup").click(function() 380 { 381 var $radio = $(this); 382 //hide other field 383 $("div.divAccountField").hide(); 384 $("div.divGroupField").show(); 385 //update other option to have All selected 386 $("div.divAccountField span.dropdownAllOption input").attr("checked", true).triggerHandler("click"); 387 //reroll up other option to get rid of any individual selections 388 $("div.divAccountField .dropdownValues").each(function () 389 { 390 RollupReportParameterValues(this); 391 $(this).hide(); 392 }); 393 }); 394 } 395 }); 396} 397 398function ActivateReportParameters() 399{ 400 $(function() 401 { 402 //add click event for showing the dropdown 403 $(".txtDropdown, .btnDropdown") 404 .click(function () 405 { 406 var values = $(this).parent().siblings(".dropdownValues"); 407 if ($(values).is(":visible")) 408 { 409 RollupReportParameterValues(values); 410 $(values).hide(); 411 } 412 else 413 { 414 //hide any dropdowns currently showing 415 $(".dropdownValues:visible").each(function () 416 { 417 RollupReportParameterValues(this); 418 $(this).hide(); 419 }); 420 $(values).show(); //show this dropdown 421 } 422 423 $(this).blur(); 424 });
425 426 //if View Report button is clicked then make sure all dropdowns are closed and rolled up 427 $("#ctl00_content_btnViewReport, #ctl00_content_btnSubmit, #ctl00_content_btnUpdateReport").click(function () 428 { 429 $(".dropdownValues:visible").each(function () 430 { 431 RollupReportParameterValues(this); 432 $(this).hide(); 433 }); 434 }); 435 436 //do an initial rollup of the values on load 437 $(".dropdownValues").each(function () 438 { 439 RollupReportParameterValues(this); 440 }); 441 442 //make the checkall checkbox for delete column work 443 $(".dropdownValues").each(function() 444 { 445 var $dropdown = $(this); 446 var $allOption = $("span.dropdownAllOption input", $dropdown); 447 var $otherOptions = $("input", $dropdown).not($allOption); 448 $allOption.click(function() 449 { 450 if (this.checked == true) 451 { 452 $otherOptions.attr("checked", false); 453 } 454 }); 455 $otherOptions.click(function() 456 { 457 $allOption.attr("checked", false); 458 }); 459 }); 460 461 //prevent users from editing the textbox values directly, don't want to use the 'readonly' property 462 //because firefox displays the fields as disabled if you use it 463 $(".txtDropdown").keydown(function () 464 { 465 return false; 466 }); 467 468 }); 469} 470 471function RollupReportParameterValues(valuesShell) 472{ 473 var txtField = $(valuesShell).parents(".parameterFieldCell:first").find(".txtDropdown"); 474 var hdnField = $(valuesShell).parents(".parameterFieldCell:first").find(".hdnDropdown"); 475 var text = []; 476 var values = []; 477 $(":checkbox:checked", valuesShell).each(function () 478 { 479 text.push($(this).parent().parent().text()); 480 values.push($(this).val()); 481 }); 482 $(txtField).val(text.join(", ")); 483 $(hdnField).val(values.join(", ")); 484} 485 486//iImagesSide: -1 = left, +1 = right 487function CleanupReportViewerReport(reportControlId, afterFunction, iImagesSide) 488{ 489 var oIntervalMap = new Object(); 490 oIntervalMap[reportControlId] = setInterval(function() 491 { 492 if ($("#" + reportControlId + " table td:contains('Account'):last").length > 0 && $("#" + reportControlId + " div[id$='_AsyncWait']:visible").length == 0) 493 { 494 clearInterval(oIntervalMap[reportControlId]); 495 setTimeout(function() 496 { 497 CleanupReportViewerReportLoaded(reportControlId, afterFunction, iImagesSide); 498 }, 500); 499 } 500 }, 500); 501 502} 503 504function CleanEmptyCells($table) 505{ 506 //identify report viewer empty left and top cells 507 var $emptyCells = $("td:empty", $table).addClass("emptyRVCell"); 508 /* 509 var $emptyCellParents = $emptyCells.parent(); 510 $emptyCells.remove(); 511 $emptyCellParents.each(function() 512 { 513 //if a parent (row) is empty now that we removed cells then remove the row 514 if ($(this).children().length == 0) 515 { 516 $(this).remove(); 517 } 518 }); 519 */ 520} 521 522function AddReportColumnClasses($table) 523{ 524 //add classes for each column header column so we can set specific widths in the css 525 //table > tbody > trs (0) > tds 526 $table.children().children().eq(1).children().each(function(i) 527 { 528 $(this).addClass("rvColumnHeader").addClass("rvColumn" + i); 529 }); 530} 531 532function GetReportTable($report) 533{ 534 //find first table that has columns defined for it 535 return $("td#oReportCell table[cols]:first", $report).closest("table").addClass("table").addClass("reportViewerTable"); 536} 537 538function BreakIndicatorsOutOfTables($table, iImagesSide) 539{ 540 541 //detach the table from the DOM while we make our changes so the browser doesn't try to render each little change 542 //we make along the way, we readd the table at the end so the browser can update after 543 var $tableParent = $table.parent(); 544 $table.detach(); 545 546 //break indicator columns out of their child tables so the numbers and images can just exist in 547 //the table cell without being in nested tables 548 //table > tbody > tr > td's 549 $table.find("> tbody > tr > td:has(img)").each(function() 550 { 551 var $td = $(this); 552 var sText = $td.text(); 553 var $imgs = $td.find("img, map"); 554 var $imgDivs = $imgs.parent("div"); //get the parents since the parent divs control showing the correct portion of the image since it's a sprite image 555 if ($imgDivs.length == 0) 556 { 557 $imgDivs = $("<div></div>").append($imgs); 558 } 559 if (iImagesSide == -1) 560 { 561 $td.empty().append($imgDivs).append(sText); 562 } 563 else if (iImagesSide == 1) 564 { 565 $td.empty().append(sText).append($imgDivs); 566 } 567 if (sText == "") 568 { 569 $td.addClass("rvCellImageOnly"); 570 $imgDivs.addClass("reportViewerSparklineShell"); 571 } 572 else 573 { 574 $td.addClass("rvCellImageAndText"); 575 $imgDivs.addClass("reportViewerIndicatorShell"); 576 } 577 578 }); 579 580 $tableParent.append($table); 581 582} 583 584function CleanupReportViewerReportLoaded(id, afterFunction, iImagesSide) 585{ 586 var $report = $("#"+id).addClass("rvLoadArea"); 587 588 //remove set heights from the table td's and remove the height:100% from their immediate child divs 589 $report.css("height", ""); 590 $("#"+id+"_fixedTable > tbody > tr > td").css("height", "").children("div").css("overflow", "").css("height", ""); 591 592 //identify the actual report table in the mess of report viewer nested tables 593 var $table = GetReportTable($report); 594 595 CleanEmptyCells($table); 596 597 BreakIndicatorsOutOfTables($table, iImagesSide); 598 599 AddReportColumnClasses($table); 600 601 if (afterFunction != null) 602 { 603 afterFunction($report, $table); 604 } 605 606} 607 608//call this function for a page if the classes "sectionHeader" and "sectionContent" have been
609//added to h2's and the divs that follow them 610//- add "collapsed" to the header and content elements if you want a section collapsed by default 611function ActivateSectionToggles() 612{ 613 $(function () { 614 //handle toggling sections and storing their state in cookies 615 $(".sectionHeader").click(function() 616 { 617 ToggleSection($(this), 0, true); 618 }).each(function() 619 { 620 //toggle the sections on load 621 var $header = $(this); 622 var sCookieName = GetSectionCookieName($header); 623 var sCookieValue = readCookie(sCookieName); 624 if (sCookieValue == "1") 625 { 626 ToggleSection($header, -1, true); 627 } 628 else if (sCookieValue == "0") 629 { 630 ToggleSection($header, 1, true); 631 } 632 else 633 { 634 //if not setting state based on cookie then verify the section doesn't have a default class 635 //of collapsed before setting the expanded class 636 if ($header.is(".collapsed") == false) 637 { 638 ToggleSection($header, 1, false); 639 } 640 else 641 { 642 AddExpandInstructions($header); 643 } 644 } 645 }); 646 }); 647 648 function AddExpandInstructions($header) 649 { 650 //$header.next().after("<p class='sectionExpandInstructions'>Expand this section for details</p>"); 651 } 652 653 function RemoveExpandInstructions($header) 654 { 655 //$header.next().next().remove(); 656 } 657 658 function GetSectionCookieName($header) 659 { 660 var sPageName = location.pathname.substring(location.pathname.lastIndexOf("/") + 1); 661 sPageName = sPageName.substring(0, sPageName.indexOf(".")); 662 return sPageName + $header.text().replace(" ", "")+"Collapsed"; 663 } 664 665 function ToggleSection($header, iDirection, bPersist) 666 { 667 var $content = $header.next(); 668 var sCookieName = GetSectionCookieName($header); 669 if (iDirection == 0) 670 { 671 iDirection = ($content.is(":visible")) ? -1 : 1; 672 } 673 if (iDirection == -1) 674 { 675 $header.removeClass("expanded").addClass("collapsed"); 676 $content.removeClass("expanded").addClass("collapsed"); 677 AddExpandInstructions($header); 678 if (bPersist) 679 { 680 createCookie(sCookieName, "1", 0); 681 } 682 } 683 else if (iDirection == 1) 684 { 685 $header.removeClass("collapsed").addClass("expanded"); 686 $content.removeClass("collapsed").addClass("expanded"); 687 RemoveExpandInstructions($header); 688 if (bPersist) 689 { 690 createCookie(sCookieName, "0", 0); 691 } 692 } 693 } 694} 695 696function RequestReportResult(sPage, divLoadAreaId, sReportKey, callback) 697{ 698 $.ajax({ 699 type: "GET", 700 dataType: "html", 701 url: sPage, 702 data: "ajaxRequest=1&ajaxAction=requestReport&reportKey=" + sReportKey, 703 cache: false, 704 success: function (sMarkup) 705 { 706 $("#"+divLoadAreaId).html(sMarkup); 707 708 if (typeof(callback) != "undefined") 709 { 710 callback(divLoadAreaId, sReportKey); 711 } 712 713 pageLoad(); 714 }, 715 error: function (XMLHttpRequest, textStatus, errorThrown) 716 { 717 $("#"+divLoadAreaId).html(""); 718 } 719 }); 720} 721 722function IdentifyReportSpriteImages(divLoadAreaId) 723{ 724 $("#"+divLoadAreaId).find("img").parent().addClass("reportSpriteImageShell").parent().addClass("reportSpriteImageShellParent"); 725} 726 727//OPEN THE FORM POST PAGE TO SUBMIT THE LOGIN AND THEN RESET THE PAGE TO THE FORM POST PAGE AGAIN SO IT 728//SUBMITS THE LOGIN A SECOND TIME TO BRUTE FORCE THAT THE APPROPRIATE COOKIES HAVE BEEN SET 729function FormPostPreSubmission(sURL) 730{ 731 //OPEN A NEW TAB WITH THE FORM POST PAGE 732 var preSubmitWindow = window.open(sURL + "&formpostattempt=1"); 733 734 //WAIT A COUPLE OF SECONDS TO MAKE SURE THE REQUEST HAS BEEN SENT AND RESPONDED TO 735 setTimeout(function() 736 { 737 //SET THE NEW TAB BACK TO THE FORM POST PAGE SO IT WILL SUBMIT THE LOGIN AGAIN 738 preSubmitWindow.location = sURL + "&formpostattempt=2"; 739 740 //IF THE FORM-POST PAGE INITIATED THIS LOGIN SEQUENCE THEN THEY ARE VIEWING THE ADOBE ANALYTICS TRANSFER MESSAGE SO WE CAN CLOSE THIS WINDOW 741 if (document.location.pathname.indexOf("form-post.aspx") > -1) 742 { 743 setTimeout(function () { 744 window.close(); 745 }, 1000); 746 } 747 748 //ADOBE CHANGED THEIR LOGIN FORM ON 4/16/2019 WHERE THE THIRD POST WAS NO LONGER NEEDED. SEE MORE DETAILS IN form-post.aspx. 749 ////WAIT A COUPLE OF SECONDS TO MAKE SURE THE REQUEST HAS BEEN SENT AND RESPONDED TO 750 //setTimeout(function () { 751 // //SET THE NEW TAB BACK TO THE FORM POST PAGE SO IT WILL SUBMIT THE LOGIN AGAIN 752 // preSubmitWindow.location = sURL + "&formpostattempt=3"; 753 754 // //POTENTIAL FUTURE CODE TO REDIRECT TO SPECIFIC REPORTS, NO LONGER SUPPORTED AS OF 8/2018 WITH MIGRATION TO ADOBE EXPERIENCE CLOUD LOGIN PROCESS BECAUSE OF NEW SESSION ID QUERYSTRING PARAMETERS WHEN VIEWING EACH REPORT. 755 // ////IF THE USER IS CLICKING THROUGH FROM A WEB MARKETING REPORTS MENU LINK TO A SPECIFIC ADOBE ANALYTICS REPORT THEN POST ONE MORE TIME SO WE CAN REDIRECT TO THE SPECIFIC REPORT 756 // //if (sURL.indexOf("formRedirect") != -1) { 757 // // setTimeout(function () { 758 // // //SET THE NEW TAB BACK TO THE FORM POST PAGE SO IT WILL SUBMIT THE LOGIN AGAIN 759 // // preSubmitWindow.location = sURL + "&formpostattempt=4"; 760 // // }, 4000); 761 // //} 762 763 //}, 4000); 764 765 766 }, 2000); 767 768} 769 770function ActivatePopupValueCopy() 771{ 772 $(".popupValueCopy").click(function() 773 { 774 var sValue = $(this).attr("data-popup-value"); 775 var docHeight = $(document).height(); 776 777 //BUILD THE BLACK OVERLAY ON TOP OF THE CURRENT PAGE 778 var $overlayDiv = $("<div id='popupValueOverlay'></div>"); 779 $overlayDiv 780 .height(docHeight) 781 .css({ 782 'opacity' : 0.8, 783 'position': 'absolute', 784 'top': 0, 785 'background-color': 'black', 786 'width': '100%', 787 'z-index': 5000, 788 'color': 'black' 789 }); 790 791 //BUILD THE POPUP BOX 792 var $overlayDivContent = $("<div id='popupValueOverlayContent'></div>"); 793 $overlayDivContent 794 .css({ 795 'position': 'absolute', 796 'top': "0", 797 'z-index': 5000, 798 'background': '#FFFFFF',
799 'padding': '20px', 800 'border-radius': '10px' 801 }); 802 803 var $input = $("<input type='text' value='" + sValue + "' style='width: 400px;' />"); 804 805 $overlayDivContent.append("<p>Press Ctrl+C or Cmd+C to copy the URL below</p>"); 806 $overlayDivContent.append($input); 807 808 var $close = $("<a href='#' id='popupValueOverlayClose' class='btn btn-primary'>Close</a>"); 809 $close.click(function() 810 { 811 $overlayDiv.remove(); 812 $overlayDivContent.remove(); 813 return false; 814 }); 815 816 $overlayDivContent.append("<p></p>").append($close); 817 818 //ADD ELEMENTS TO THE PAGE 819 $("body").append($overlayDiv); 820 821 $("body").append($overlayDivContent); 822 823 //POSITION THE POPUP BOX 824 $overlayDivContent.css("top", ($(window).height() / 2) - ($overlayDivContent.outerHeight(false) / 2)); 825 $overlayDivContent.css("left", ($(window).width() / 2) - ($overlayDivContent.outerWidth(false) / 2)); 826 827 //PRE-SELECT THE TEXT IN THE INPUT 828 $input[0].focus(); 829 $input[0].setSelectionRange(0, $input.val().length) 830 831 return false; 832 833 }); 834} 835 836function ShowButtonLoading(btn, sText) { 837 $(btn) 838 .addClass("disabled") 839 .attr("data-originalvalue", $(btn).attr("value")) 840 .attr("value", sText) 841 .attr("onclick", ""); 842 843 //set loading class in timeout function so it forces browser to play background loading animation correctly 844 setTimeout(function () { 845 $(btn) 846 .addClass("loadingAnimation") 847 .click(function () { 848 return false; 849 }); 850 }, 200); 851 852} 853 854function RemoveButtonLoading(btn, sText) { 855 $(btn) 856 .attr("value", $(btn).attr("data-originalvalue")) 857 .removeClass("disabled") 858 .removeClass("loadingAnimation"); 859} 860 861function ToggleDropdownMenu(link) 862{ 863 var $link = $(link); 864 var $menu = $link.next(); 865 if ($menu.is(":hidden")) 866 { 867 $menu.show(); 868 869 $("body").on("click.dropdownMenuToggle", function() 870 { 871 HideMenu(); 872 }); 873 874 } 875 else 876 { 877 HideMenu(); 878 } 879 880 function HideMenu() 881 { 882 $menu.hide(); 883 $("body").off("click.dropdownMenuToggle"); 884 } 885 886}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.