1var findEmptys; 2 3//Globals: 4var uri = document.location.href; 5var diDir = (typeof DIDIR !== "undefined" )?DIDIR:""; 6var fiDocs = (typeof FIDOCS !== "undefined" )?FIDOCS:""; 7var fiImages = (typeof FIIMAGES !== "undefined" )?FIIMAGES:""; 8var themeImages = (typeof THEMEIMAGES !== "undefined" )?THEMEIMAGES:""; 9var contextPath = (typeof CONTEXTPATH !== "undefined" )?CONTEXTPATH:""; 10var region = (typeof REGION !== "undefined" )?REGION:""; 11var fiName = (typeof FINAME !== "undefined" )?FINAME:""; 12var cfg_enable_logging = (typeof CFG_ENABLE_LOGGING !== "undefined" )?CFG_ENABLE_LOGGING:""; 13var ncr_blog_landing = (typeof NCR_BLOG_LANDING !== "undefined" )?NCR_BLOG_LANDING:""; 14var layout = (typeof LAYOUT !== "undefined" )?LAYOUT:""; 15var cfg_site_live = (typeof CFG_SITE_LIVE !== "undefined" )?CFG_SITE_LIVE:""; 16var ua = (typeof USERAGENT !== "undefined" )?USERAGENT:""; 17var userAgent = (typeof USERAGENT !== "undefined" )?USERAGENT:""; 18 19(function($){ 20 const copyOnClick = (e)=>{ 21 22 console.log(e.target,e.target.dataset.copytext) 23 navigator.clipboard.writeText(e.target.dataset.copytext).then(function () { 24 alert(e.target.dataset.copytext+" has been copied!") 25}, function () { 26 alert('Failure to copy. Check permissions for clipboard') 27}); 28 29 } 30document.querySelectorAll('.copy-on-click').forEach(element=>{ 31 element.addEventListener('click', copyOnClick) 32}) 33 //helper function to be used in console 34 //it locates empty tags and helps to point out where they are on the page 35 findEmptys = function(tag, parents){ 36 count = 0; 37 $(tag).each(function(){ 38 if($(this).html()==""){ 39 $(this).css("border", "2px solid red"); 40 $(this).addClass("empty_element"); 41 if(parents){ 42 $(this).parents(parents).css("border", "2px solid red"); 43 $(this).parents(parents).addClass("empty_element"); 44 } 45 count++; 46 } 47 }) 48 console.log("found: " + count + " links"); 49 } 50 51 $(function(){ 52 //fix target blank bug: (I'm sure this link will be valid forever .... right?) 53 // https://dev.to/ben/the-targetblank-vulnerability-by-example 54 window.opener=null; 55 $("a").each(function(){ 56 var tar = $(this).attr("target"); 57 if(tar = "_blank"){ 58 var rel = ($(this).attr("rel")==undefined)?"":$(this).attr("rel"); 59 if(rel.indexOf("noopener")<0){ 60 $(this).attr("rel", rel + " noopener"); 61 } 62 if(rel.indexOf("noreferrer")<0){ 63 $(this).attr("rel", rel + " noreferrer"); 64 } 65 } 66 }); 67 68 // prevent IE from throwing error 69 if (typeof console == "undefined") { 70 window.console = { 71 log: function () {} 72 }; 73 } 74 75 76 //EMU 77 //move all emu code 78 //to a separate function 79 //modularity 80 applyEmuFixes(); 81 82 //initialize UA classes 83 //applyUAclasses(); 84 85 86 //Backpage promo image mover 87 /* 88var $moveTo = $(".moveTo") 89var $moveFrom = $(".content .hed") 90//see if there's stuff in the snippet (a per-page promo image) 91if( $moveFrom.children().length > 0) { 92 var content = $moveFrom; 93 content.detach(); 94 if($(".editmode_workarea").children().length > 0){ 95 $moveTo.append(content); 96 } else { 97 $moveTo.html(content); 98 } 99} 100*/ 101 102 103//Replace top Image 104/* 105if($(".content .top-image").length > 0){ 106 var src = $(".content .top-image").attr("src"); 107 var alt = $(".content .top-image").attr("alt"); 108 if(alt == undefined){ 109 alt = ""; 110 } 111 if(src != undefined){ 112 $("#promo-replace").attr("src", src); 113 $("#promo-replace").attr("alt", alt); 114 $(".content .top-image").detach(); 115 } 116} 117 118$("#promo-replace").removeClass("hidden"); 119*/ 120 121 122 123/** 124 * apply tagReplace to any element with .tagReplace as a class 125 * Note: this is better done using velocity macro #tagReplace() 126 */ 127$(".tagReplace").each(function(){ 128 $(this).html($(this).text().tagReplace()); 129}); 130 131 /** 132 * if you add the class "missing" to empty links, this will add the popover class to it 133 * QA prefers this 134 * **/ 135 if(cfg_site_live =="false"){ 136 $("a.missing, a[href=#missing]").each(function(){ 137 $(this).click(function(event){ 138 event.preventDefault(); 139 alert("No URL was provided for this link."); 140 }); 141 $(this).addClass("popover-link"); 142 $(this).attr("data-toggle", "popover"); 143 $(this).attr("data-placement", "top"); 144 $(this).attr("data-container", "body"); 145 $(this).attr("data-template", '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title missing-link-title"></h3><div class="popover-content"></div></div>'); 146 $(this).attr("title", "Missing Link"); 147 $(this).attr("data-content", "No URL was provided for this link."); 148 }); 149 150 //$('.popover-link').popover({'html': true}); 151 $('.popover-link').on('shown.bs.popover', function () { 152 var $pop = $(this); 153 $pop.addClass("alert-danger"); 154 setTimeout(function () { 155 $pop.popover('hide'); 156 }, 3000); 157 }); 158 } 159 160 //DROPDOWNS 161 //ncr-custom-block 162 //block-dropdown.js 163 //initialize em 164 var count=0; 165 $(".dropdown").each(function(){ 166 $(this).find(".heading").addClass("discToggle"); 167 $(this).find(".content").addClass("disclaimer"); 168 $(this).find(".heading").attr("data-ncr-dropdown", count); 169 $(this).find(".content").attr("data-ncr-dropdown", count); 170 $(this).addClass("disclaimerBox"); 171 $(this).addClass("unhidden"); 172 $(this).attr("data-ncr-dropdown", count);
173 count++; 174 }); 175 176 177//make em work 178$(".dropdown .heading").click(function(){ 179 expandDisc($(this)); 180}); 181 182$(".dropdown .heading").keypress(function() { 183 if (event.which == 13 || event.which==32) { 184 expandDisc($(this)); 185 return false; 186 } 187}); 188 189function expandDisc(target){ 190 var dropdown_id = target.attr("data-ncr-dropdown"); 191 $(".content[data-ncr-dropdown="+dropdown_id+"]").slideToggle(200); 192 target.toggleClass("open"); 193} 194 195 196 197// TPWS 198$(".open-tpw").click(function(){ 199 //console.log("open tpw clicked"); 200}); 201// END TPWS 202 203//remove href from links that shouldn't be clickable 204$(".not-a-link").each(function(){ 205 $(this).removeAttr("href"); 206}); 207 208 209 210//if($(".sNav ul li").length <= 1){ 211//$(".sNav").detach(); 212//} 213 214 215 216//fix default wp table headers 217$("table.add-headers").addClass("table-hover") 218$("table.add-headers tr:first-child").each(function(){ 219 $(this).addClass("tableheader"); 220 $(this).find("td").each(function(){ 221 $(this).replaceWith("<th>" + $(this).html() + "</th>"); 222 }); 223}); 224//fix empty fields in blocks 225 226$(".wp-block-ncr-blocks-employee-bios-wrapper h2, .wp-block-ncr-blocks-employee-bios-wrapper h3, .wp-block-ncr-blocks-employee-bio .employee-name,.wp-block-ncr-blocks-employee-bio .employee-title, .wp-block-ncr-blocks-news-event .date, .wp-block-ncr-blocks-accordion h2, .wp-block-ncr-blocks-accordion h3, .edit-button-container a").each(function(){ 227 if($(this).html()===""){ 228 $(this).detach(); 229 } 230}); 231 232 233//init a modal for newsite redirects from WC 234initializeNewsiteModal(); 235//setup tpw 236initializeTPWModal(); 237initializeTPWRules();
238 239//setup alert tpws 240initializeAlert(); 241//init wp fixes, etc 242initializeSeclinks(); 243initializeTablepress(); 244//fixTablepressTables(); 245 246 247//BLOG CODE 248if(ncr_blog_landing === "true"){ 249 initializeBlogLazyLoad(); 250} 251 252//NCR CUSTOM BLOCKS 253initializeQuicklinks(); 254initializeSmPromos(); 255initializeAccordionBlock(); 256 257//set up the .clickableDiv class 258initializeClickableDivs(); 259 260 261if($("body").hasClass("ie")){ 262 fixIE(); 263} 264 265 266 267 268$("a.ncr-tpw").click(function(){ 269 var tpw = parseInt($(this).attr("data-ncr-tpw")) + 1; 270 if(!isNaN(tpw)){ 271 return displayThirdPartyAlert(tpw,this); 272 } 273}); 274 275//the skip links don't seem to always trigger hashchange, so force em to. 276$(".skip-link").click(function(){ 277 window.location.hash = $(this).attr("href"); 278}); 279 280//handle hashtags that aren't #login 281if (window.location.hash != undefined && window.location.hash != "") { 282 doHashtag(); 283} 284 285$(window).on('hashchange',function(){ 286 doHashtag(); 287}); 288 289//check for ?login 290if( getParameterByName("login") != null ){ 291 showLogin(); 292} 293 294 295 296}); 297 298 299 300//BLOG CODE 301var STILL_LOADING = true; 302var POSTS_LOADED = 0; 303var CURRENT_PAGE = 0; 304 305function initializeBlogLazyLoad(){ 306 log("initializing blog lazy load"); 307 308 //load params from blog landing page 309 //console.log(BLOG_PARAMS); 310 311 //UPDATE THIS DIV CLASS (and/or just make sure it's on the landing page) 312 var dest_div = ".blog-post-appender"; 313 var per_row = 3; 314 var category = BLOG_PARAMS['category']; 315 var max_posts = BLOG_PARAMS['max_posts']; 316 var initial_posts = BLOG_PARAMS['posts_loaded']; 317 POSTS_LOADED = BLOG_PARAMS['posts_loaded']; //$(dest_div).find(".feature").length; 318 319 320 var category_str = ""; 321 if (category != -1){ 322 category_str = "&categories=" + category; 323 } 324 325 326 //pull all the posts from the wp db 327 //also, create all the divs, push to dom, hide em 328 //https://www.pnwfcu.org/wph/newsite/wp-json/wp/v2/posts 329 var api_call = contextPath + '/wp-json/wp/v2/posts?per_page=420&offset='+initial_posts+category_str; 330 $.get(api_call, function(data){ 331 //log("got more pages"); 332 //console.log("URL:"); 333 //console.log(api_call); 334 //console.log(data); 335 for(var i=0; i<data.length; i++){ 336 var new_div = ""; 337 338 339 //UPDATE THIS IMAGE PATH 340 //if using featured images, not secondary: 341 //var img_src=(typeof data[i].featured_image_src != "undefined" )?data[i].featured_image_src:"https://www.pnwfcu.org/wph/newsite/wp-content/uploads/2019/07/img_blog-post_default.jpg"; 342 var img_src=(typeof data[i].secondary_image_src != "undefined" )?data[i].secondary_image_src:"https://www.pnwfcu.org/wph/newsite/wp-content/uploads/2019/07/img_blog-post_default.jpg"; 343 var post_title=data[i].title.rendered; 344 var subtitle=(typeof data[i].meta.attr_subtitle[0] != "undefined" )?data[i].meta.attr_subtitle[0]:""; 345 var timestamp=(typeof data[i].meta.attr_date[0] != "undefined" )?data[i].meta.attr_date[0]:""; 346 var excerpt= (typeof data[i].meta.attr_excerpt[0] != "undefined" )?data[i].meta.attr_excerpt[0]:""; 347 var post_link=data[i].link; 348 //if using featured images, not secondary: 349 //var img_alt=(typeof data[i].featured_image_alt != "undefined" )?data[i].featured_image_alt:"thumbnail image for blog post: " + post_title; 350 var img_alt=(typeof data[i].secondary_image_alt != "undefined" )?data[i].secondary_image_alt:"thumbnail image for blog post: " + post_title; 351 352 353 //UPDATE THIS HTML 354 new_div += '<div class="feature clickable-div clickableDiv blog-archive-entry appended-post hidden">'; 355 new_div += '<div class="feature-image cover-image">'; 356 new_div += '<img src="'+img_src+'" alt="'+img_alt+'" />'; 357 new_div += '</div>'; 358 new_div += '<div class="feature-content">'; 359 new_div += '<div class="feature-text">'; 360 new_div += '<h3>'+post_title+'</h3>'; 361 if (subtitle!=""){ 362 new_div += '<h4>'+subtitle+'</h4>'; 363 } 364 new_div += '<span>'+timestamp+'</span>'; 365 new_div += '<div class="text-container">'; 366 new_div += "<p>"+excerpt+"</p>"; 367 new_div += '</div><!--text-container-->'; 368 new_div += '</div><!--feature-text-->'; 369 new_div += '<div class="feature-cta">'; 370 new_div += '<a href="'+post_link+'"></a>'; 371 new_div += '</div><!--feature-cta-->'; 372 new_div += '</div><!--feature-content-->'; 373 new_div += '</div><!--feature-->'; 374 375 376 $(dest_div).append(new_div); 377 initializeClickableDivs(); 378 $('.blog-archive-entry .cover-image').moveImageToBg({ 379 bgPosition: 'center center', 380 bgType: 'cover' 381 }); 382 383 } 384 385 if(data.length == 0){ 386 $(dest_div).append("<div id='no-more-posts'><p><strong>No more posts in this category.</strong></p></div>"); 387 } 388 389 }).done(function(){ 390 STILL_LOADING = false; 391 }); 392 393 394 //on scroll, show a row 395 $(document).scroll( function(){ 396 var curr_top = $(this).scrollTop(); 397 var screen_height = $(window).height(); 398 var curr_bottom = curr_top + screen_height; 399 var container_top = $(dest_div).offset().top; 400 var container_height = $(dest_div).height(); 401 var container_bottom = container_top + container_height; 402 var buffer = 300; //number of pixels from bottom of container to trigger the ajax call 403 404 var showMore = false; 405 if(curr_bottom>(container_bottom-buffer) && $("#no-more-posts").length == 0 ){ 406 showMore = true; 407 log("show more posts"); 408 409 count = 0; 410 $(".blog-archive-entry.hidden").each(function(){ 411 count++; 412 if (count < 4){ 413 $(this).removeClass("hidden"); 414 } 415 }); 416 //log("curr_top: " + curr_top); 417 //log("screen_height: " + screen_height); 418 //log("curr_bottom: " + curr_bottom); 419 //log("container_top: " + container_top); 420 //log("container_height: " + container_height); 421 //log("container_bottom: " + container_bottom); 422 423 } 424 425 if ($(".blog-archive-entry.appended-post.hidden").length == 0 && $("#no-more-posts").length == 0 && STILL_LOADING==false){ 426 $(dest_div).append("<div id='no-more-posts'><p><strong>No more posts in this category.</strong></p></div>"); 427 } 428 });//end scroll 429 430} 431//END BLOG CODE 432 433 434function initializeClickableDivs(){ 435 /** 436 * make a div clickable by finding an <a> tag inside it 437 */ 438 $(".clickableDiv").each(function(){ 439 if($(this).attr("data-initialized") === "true" ){ 440 return; 441 } 442 var src = $(this).find("a").attr("href"); 443 if(src == undefined){ 444 $(this).removeClass("clickableDiv"); 445 return; 446 } 447 448 var tpw = false; 449 var tpw_index = false; 450 var target = $(this).find("a").attr("target"); 451 var emu = false; //set to true to enable enter key to trigger click 452 var t_ind = $(this).attr("tabindex"); 453 454 //if we want clickableDiv to work on an ncr-toggle/ncr-panel 455 var is_ncr_toggle = false; 456 var $ncr_toggle; 457 if($(this).find("a[ncr-toggle]").length>0){ 458 is_ncr_toggle = true; 459 $ncr_toggle = $(this).find("a[ncr-toggle]"); 460 } 461 462 //check for existing tab index 463 if(t_ind == undefined && emu == true){ 464 //here's where we should figure out a "scope" and set these indices within some context instead of globally 465 //issues: 466 //with ind = 0, the div will lose focus when we highlight the <a>, which is a problem for some sites 467 //with ind = 1, the div keeps focus, but the <a>
467 never gets focused 468 $(this).attr("tabindex", "0"); 469 } 470 471 //check for tpw 472 if(($(this).find("a").attr("onclick")!=undefined && $(this).find("a").attr("onclick").indexOf("displayThirdPartyAlert")>-1) || $(this).find("a.ncr-tpw").length>0 ){ 473 if($(this).find("a.ncr-tpw").attr("data-ncr-tpw")){ 474 tpw = true; 475 tpw_index = parseInt($(this).find("a.ncr-tpw").attr("data-ncr-tpw"))+1; 476 } else { 477 log("found ncr-tpw, but no 'data-ncr-tpw' attr"); 478 } 479 } 480 481 //check for locally hosted pdf 482 if(src.indexOf(contextPath)>-1 && src.indexOf(".pdf")>-1){ 483 log("pdf in a clickable div, ignoring it"); 484 //log("clickableDiv contains pdf, this might not work with external pdfs"); 485 //src = fiDocs + src.substring((src.indexOf(contextPath)+contextPath.length), src.length); 486 //target = "_blank"; 487 } 488 489 //if we're doing emu mode, enable enter to trigger links 490 if(emu == true){ 491 $(this).keypress(function (e) { 492 var key = e.which; 493 if(key == 13 || key == 32) { 494 $(this).trigger("click"); 495 } 496 }); 497 } 498 499 //process click 500 $(this).click(function(){ 501 if(tpw){ 502 if(tpw_index!=undefined){ 503 return showWarning(src, "", "", tpw_index) 504 } else { 505 return showWarning(src, "", "", 1) 506 } 507 //return displayThirdPartyAlert(1,$(this).find("a")); 508 } else if(target == "_blank"){ 509 target_blank(src); 510 } else if(is_ncr_toggle){ 511 $ncr_toggle.trigger("click"); 512 } else { 513 window.location = src; 514 } 515 }); 516 517 //display the right url in the status bar 518 $(this).mouseover(function(){ 519 window.status = src; 520 }).mouseout(function(){ 521 window.status = ''; 522 }); 523 $(this).attr("data-initialized", "true"); 524 }); 525} //end initializeClickableDivs 526 527function initializeSeclinks(){ 528 if($(".section-links.section-index").length>0){ 529 $(".contentback .zone.zone1.content").addClass("section-index"); 530 } 531} 532function initializeTablepress(){ 533 log("initializing tablepress tables"); 534 $(".tablepress .row-1").addClass("tableheader"); 535} 536 537function showLogin(){ 538 log("showing login."); 539 540 //If panel based, you need these: 541 $("[ncr-panel='Login']").on("ncr-panel-opened", function(){ 542 setTimeout(function() {$('input[name=userid]').focus();}, 300); 543 }); 544 545 $("[ncr-panel='Login']").trigger("ncr-open-panel"); 546 //$("#loginToggle").trigger("click"); 547 548 //You'll always want this: 549 $("input[name=userid]").focus(); 550 //document.getElementById("username1").focus(); 551 552 //Some older methods include: 553 //$(".ibDropdown").addClass("active"); 554 //$("#login").show(); 555} 556 557function initializeQuicklinks(){ 558 if($(".ncr-quicklinks-mover").length>0){ 559 log("moving quicklinks"); 560 $("#quicklinks-landing").html($(".ncr-quicklinks-mover")); 561 } 562} 563function initializeSmPromos(){ 564 if($(".ncr-sm-promo-mover").length>0){ 565 log("moving sm promos"); 566 $("#sm-promo-landing").html($(".ncr-sm-promo-mover")); 567 } 568} 569 570 571function initializeAlert(){ 572 $("#ncr-alert-wrapper .alert").on("ncr-panel-closed", function(){ 573 closeNCRalert(); //defined in class-alert.php 574 }); 575} 576 577 578//set up a "new website" modal 579function initializeNewsiteModal(){ 580 if(typeof(SHOW_NEWSITE_POPUP)!=="undefined"){ 581 if(SHOW_NEWSITE_POPUP == true){ 582 $("#ncr-newsite-popup-panel").trigger("ncr-open-panel"); 583 } 584 585 $("#ncr-newsite-popup-panel").on("ncr-panel-closed", function(){ 586 incrementNCRNewsiteCookie(); 587 }); 588 } 589} //end initializeNewsiteModal 590 591 592var tpw_html = ""; 593tpw_html += '<div class="band alert alert-level-one panel-closed panel-pop ncr-tpw-popup auto-focus hide-tpw" ncr-panel="ncr-tpw-panel" id="ncr-tpw-popup-panel">'; 594tpw_html += ' <div class="zone">'; 595tpw_html += ' <div class="feature-wrap">'; 596tpw_html += ''; 597tpw_html += ' <div class="feature"><!--top-->'; 598tpw_html += ' <div class="feature-padding">'; 599tpw_html += ''; 600tpw_html += ' <div class="feature-image">'; 601tpw_html += '<figure class="feature-image-inner">'; 602tpw_html += ' <img src="'+themeImages+'/img-logo.png" alt="'+fiName+'" />'; 603tpw_html += '</figure>'; 604tpw_html += ' </div><!--feature-icon-->'; 605tpw_html += ''; 606tpw_html += ' <div class="feature-content">'; 607tpw_html += ' <div class="feature-content-text">'; 608tpw_html += ' <h1 class="ncr-tpw-title" aria-label="heading" aria-level="1">tpw title</h1>'; 609tpw_html += ' <h3 class="ncr-tpw-body">tpw content</h3>'; 610tpw_html += ' <div class="feature-content-wysiwyg"></div>'; 611tpw_html += ' </div><!--feature-text-->'; 612tpw_html += ' <div class="feature-cta ncr-tpw-buttons">'; 613tpw_html += ' <a href="javascript:void(0)" class="btn-go ncr-tpw-close-btn" target="_blank" >'; 614tpw_html += ' Continue'; 615tpw_html += ' <span class="icon-utility-arrow-right " aria-label="Continue Icon" role="img"></span>'; 616tpw_html += ' </a>'; 617tpw_html += ''; 618tpw_html += ' <a href="javascript:void(0)" class="ncr-tpw-close-btn" aria-label="Close Button" ncr-toggle="ncr-tpw-panel">'; 619tpw_html += ' Close'; 620tpw_html += ' <span class="icon-utility-close" aria-label="Close Icon" role="img"></span>'; 621tpw_html += ' </a>'; 622tpw_html += ' </div><!--feature-cta-->'; 623tpw_html += ' </div><!--feature-content-->'; 624tpw_html += ' </div><!--feature-->';
625tpw_html += ' </div><!--feature-wrap-alert-message-->'; 626tpw_html += ' </div>'; 627tpw_html += ''; 628tpw_html += ' <div class="zone-cta">'; 629tpw_html += ' <a class="close-button" href="#">'; 630tpw_html += ' <span class="icon-utility-close close" aria-label="Close menu icon" role="img"></span>'; 631tpw_html += ' </a>'; 632tpw_html += ' </div>'; 633tpw_html += ''; 634tpw_html += ' </div><!--alert panel-->'; 635tpw_html += ' <div class="popout-bg"></div>'; 636tpw_html += '</div><!--band-alert-->'; 637 638//set up the TPW to be a dialog 639function initializeTPWModal(){ 640 //handled in design js, could manually call via: 641 //$("div[ncr-panel='ncr-tpw']").tabTrapping({}); 642 643 //inject the tpw html and initialize it 644 $("section.template-parts").append(tpw_html); 645 //$("div[ncr-panel='ncr-tpw-panel']").tabTrapping({}); //as of 5/2021, tabTrapping looks for children of the ele, not the ele itself 646 $("section.template-parts").tabTrapping({}); 647 648 649 //close the modal after you click continue 650 $(".btn-go").on("click", function(){ 651 $("#ncr-tpw-popup-panel").trigger("ncr-close-panel"); 652 }); 653 $(".hide-tpw").removeClass("hide-tpw"); 654} 655 656 657//sitewide TPW settings 658function initializeTPWRules(){ 659 log("initializing global tpw rules"); 660 var rules = NCR_TPW_RULES; 661 var all_external = NCR_TPW_ALL_EXTERNAL_SITES; 662 $("a[href]:not(.ncr-tpw)").each(function(){ 663 var href = $(this).attr("href").toLowerCase(); 664 665 if(all_external.enabled === "true"){ 666 var local_domain = all_external.local_domain; 667 var tpw = all_external.tpw; 668 if( href.indexOf(local_domain) >-1 || href.startsWith("/") || href.startsWith("#") || href.startsWith("javascript:") ){ 669 //continue; 670 } else { 671 log("adding tpw to: " + href); 672 $(this).addClass("ncr-tpw"); 673 $(this).attr("data-ncr-tpw", tpw); 674 } 675 } else { 676 //handle individual rules 677 //console.log(href); 678 for(i=0; i<rules.length; i++){ 679 //console.log("found rule: " + rules[i]); 680 var domain = rules[i].domain; 681 //do regex search 682 if(rules[i].regex === "true"){ 683 var res = href.match(new RegExp(domain, 'gi')) 684 if(res){ 685 //$(this).css("border", "3px solid red"); 686 $(this).addClass("ncr-tpw"); 687 $(this).attr("data-ncr-tpw", rules[i].tpw); 688 } 689 //not regex 690 } else { 691 if(href.indexOf(domain.toLowerCase()) > -1){ 692 //$(this).css("border", "3px solid red"); 693 $(this).addClass("ncr-tpw"); 694 $(this).attr("data-ncr-tpw", rules[i].tpw); 695 } 696 697 } //end regex check 698 } //end rules foreach 699 700 } 701 }); 702 703} //end initializeTPWRules 704 705//ncr-accordion 706// ncr-accordion-panel 707// ncr-accordion-panel-heading 708// ncr-accordion-panel-body 709function initializeAccordionBlock(){ 710 log("initializing custom accordion block(s)"); 711 712 if($(".ncr-accordion").length>0){ 713 var curr = 1; 714 var panel = 1; 715 716 $(".ncr-accordion").each(function(){ 717 $(this).find(".ncr-accordion-panel-heading, .ncr-accordion-panel-body").attr("data-accordion", "#NCR-accordion-"+curr); 718 $(this).attr("id", "NCR-accordion-" + curr); 719 var isStyleAllClosed = $(this).hasClass("is-style-all-closed"); 720 var isFirst = (!isStyleAllClosed)?true:false; 721 $(this).find(".ncr-accordion-panel").each(function(){ 722 var anchor_id = $(this).attr("id"); 723 $(this).attr("id", "ncr-accordion-panel-" + panel); 724 var $heading = $(this).find(".ncr-accordion-panel-heading"); 725 var $body = $(this).find(".ncr-accordion-panel-body"); 726 $heading.attr('id', "ncr-accordion-panel-heading-" + panel); 727 $heading.attr('aria-controls', "ncr-accordion-panel-body-" + panel); 728 $heading.attr('data-target', "ncr-accordion-panel-body-" + panel); 729 $heading.attr('data-parent', "ncr-accordion-panel-" + panel); 730 $heading.attr('data-accordion', "NCR-accordion-" + curr); 731 $heading.attr('data-anchor-id', anchor_id); 732 $heading.find('a').attr("href", "javascript:void(0)"); 733 $body.attr('id', "ncr-accordion-panel-body-" + panel); 734 if(!isFirst){ 735 $(this).addClass("entry-closed"); 736 $heading.attr("aria-expanded", "false"); 737 } else { 738 isFirst = false; 739 $heading.attr("aria-expanded", "true"); 740 $(this).addClass("entry-opened"); 741 } 742 panel++; 743 }); 744 //$(this).attr("role", "tablist"); 745 //$(this).attr("aria-multiselectable", "true"); 746 //$(this).attr("tabindex", "0"); 747 curr++; 748 }); 749 750 751 $(".ncr-accordion-panel-heading").each(function(){ 752 //set up the heading 753 //$(this).attr("aria-controls", "false"); 754 //$(this).attr("id", "ncr-accordion-panel-heading-" + panel); 755 //$(this).attr("data-target", "#ncr-accordion-panel-body-" + panel); 756 757 //panel++; 758 }); 759 760 761 $(".ncr-accordion-panel-heading").click(function(){ 762 var src = $(this); 763 var tar = $(this).attr("data-target"); 764 expandHandler(src, tar); 765 }); 766 $(".ncr-accordion-panel-heading").keypress(function(event) { 767 var src = $(this); 768 var tar = $(this).attr("data-target"); 769 if (event.which == 13 || event.which==32) { 770 expandHandler(src, tar); 771 return false; 772 } 773 }); 774 775 } 776} 777 778 779//handles the ncr accordions 780function expandHandler(src, tar){ 781 var $accordion = $("#" + src.attr("data-accordion")); 782 var isStyleDefault = $accordion.hasClass("is-style-default"); 783 var isStyleAllClosed = $accordion.hasClass("is-style-all-closed"); 784 var onlyOneOpen = $accordion.hasClass("is-style-one-open"); 785 786 //if no style is set, go with the default one. 787 if (!isStyleDefault && !onlyOneOpen && !isStyleAllClosed){ 788 isStyleDefault = true; 789 } 790 791 log("accordion: default: " + isStyleDefault + ", one: " + onlyOneOpen); 792 793 var target = "#" + src.attr("data-parent"); 794 if(isStyleDefault || isStyleAllClosed){ 795 //just toggle this panel 796 $(target).toggleClass("entry-closed").toggleClass("entry-opened"); 797 if($(target).hasClass("entry-opened")){ 798 //this selector is weird in case we're toggling this panel by other means. 799 //src.attr("aria-expanded") should be the same thing. 800 $(src.attr("data-parent")).find(".ncr-accordion-panel-heading").attr("aria-expanded", "true"); 801 } else { 802 $(src.attr("data-parent")).find(".ncr-accordion-panel-heading").attr("aria-expanded", "false"); 803 } 804 } 805 806 if(onlyOneOpen){ 807 //don't do anything if this is the only panel in this acc 808 //otherwise, close the open one, and open the new one. 809 if($(target).hasClass("entry-opened")){ 810 //$(target).toggleClass("entry-closed"); 811 } else { 812 $accordion.find(".ncr-accordion-panel").removeClass("entry-opened").addClass("entry-closed"); 813 $(target).addClass("entry-opened"); 814 $(target).removeClass("entry-closed"); 815 if($(target).hasClass("entry-opened")){ 816 //this selector is weird in case we're toggling this panel by other means. 817 //src.attr("aria-expanded") should be the same thing. 818 $(src.attr("data-parent")).find(".ncr-accordion-panel-heading").attr("aria-expanded", "true"); 819 } else { 820 $(src.attr("data-parent")).find(".ncr-accordion-panel-heading").attr("aria-expanded", "false"); 821 } 822 823 } 824 } 825 826 return; 827 //var isAccordion = src.parent().hasClass("accordion"); 828} //end expandHandler 829 830//url with hash? 831//guess we gotta process that 832//lots of fun stuff here 833function doHashtag(){ 834 var full_hash = window.location.hash; //www.domain.com/some/url/#test 835 var hash_name = (full_hash.indexOf("?")>-1)?full_hash.split("?")[1]:full_hash.substring(1); //hash_name = test 836 log("handling hashtag: " + hash_name); 837 838 if(hash_name==undefined || hash_name === ""){ 839 log("empty hashtag, bailing"); 840 return; 841 } 842 843 if (hash_name==="login" || hash_name==="skip-to-login"){ 844 showLogin(); 845 $('html,body').animate({scrollTop: $("#login-panel .feature-wrap1").offset().top-10}, 800); 846 847 } 848 849 //handle accordions
850 if($(".ncr-accordion-panel-heading[data-anchor-id=" + hash_name + "]").length>0){ 851 //log('$(".ncr-accordion-panel-heading[data-anchor-id="' + hash_name + '"]'); 852 853 expandHandler($(".ncr-accordion-panel-heading[data-anchor-id=" + hash_name + "]"), $(".ncr-accordion-panel-heading[data-anchor-id=" + hash_name + "]").attr("data-target")); 854 855 //$(".ncr-accordion-panel-heading[data-anchor-id=" + hash_name + "]").trigger("click"); 856 var $target = $(".ncr-accordion-panel-heading[data-anchor-id=" + hash_name + "]"); 857 var top_buffer = $(".sticky-mast").height() + 20; 858 var topset = ($target.offset().top)?$target.offset().top:0; 859 ////console.log($("a[name=" + hash_name + "]")); 860 //$('html,body').animate({scrollTop: }, 400); 861 $('html,body').animate({scrollTop: topset - top_buffer}, 400); 862 } 863 864 //I never tested this stuff. Turns out what I was working on is ^^^ 865 //if this works, remove these comments :) 866 if($("*[name="+hash_name+"]").length>0){ 867 log("scrolling to: [name=" + hash_name + "]" ); 868 $('html,body').animate({scrollTop: $("*[name="+hash_name+"]").offset().top-10}, 800); 869 } else if( $("#" + hash_name).length>0){ 870 log("scrolling to: id=" + hash_name); 871 $('html,body').animate({scrollTop: $("#" + hash_name).offset().top-10}, 800); 872 873 } 874 875 /* 876 * removed 9/28/2020, I don't think it's used anymore 877 $("a").each(function(){ 878 if($(this).attr("href") == full_hash && $(this).attr("data-toggle") == "tab" ){ 879 $("a[href=" + full_hash + "]").trigger("click"); 880 $('html,body').animate({scrollTop: $(".product-tabs").offset().top-$(".mast-wrap").height()-10}, 400); 881 //log("tab anchor"); 882 } else if ($(this).attr("name") == hash_name) { 883 884//handle question/answers 885$("a[name=" + hash_name + "]").parents('.question').trigger("click"); 886var $target = $("a[name=" + hash_name + "]"); 887var top_buffer = $(".mast-wrap").height() + 10; 888 889if($target.parents('.question').length>0){ 890 $target = $target.parents('.question'); 891} 892 893var topset = ($target.offset().top)?$target.offset().top:0; 894//console.log($("a[name=" + hash_name + "]")); 895$('html,body').animate({scrollTop: topset - top_buffer}, 400); 896} 897}); 898*/ 899 900 901} //end doHashtag 902 903 904function fixIE(){ 905 console.log("fix IE issues."); 906 907}//end fixIE 908 909 910//accordions, eh? 911//give the people what they want 912//even if it's trash 913function fixFAQIcons(stop){ 914 //log('fixing icons') 915 //log(stop) 916 $(".question").each(function(){ 917 var $content = $(this).next(".answer"); 918 if ($content.is(":visible") == true){ 919 $(this).find(".plus-icon").hide(); 920 $(this).find(".minus-icon").show(); 921 } else { 922 $(this).find(".plus-icon").show(); 923 $(this).find(".minus-icon").hide(); 924 } 925 }); 926 //if(stop == "undefined"){ 927 if(!stop){ 928 var p = setTimeout(function(){fixFAQIcons(true);}, 410); 929 //log("running it again") 930 } 931} 932 933 934 935//Apply useragent classes 936//these should be done via velocity too 937function applyUAclasses(){ 938 // Opera 8.0+ 939 var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; 940 941 // Firefox 1.0+ 942 var isFirefox = typeof InstallTrigger !== 'undefined'; 943 944 // Safari 3.0+ "[object HTMLElementConstructor]" 945 var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); 946 947 // Internet Explorer 6-11 948 var isIE = /*@cc_on!@*/false || !!document.documentMode; 949 950 // Edge 20+ 951 var isEdge = !isIE && !!window.StyleMedia; 952 953 // Chrome 1+ 954 var isChrome = !!window.chrome && !!window.chrome.webstore; 955 956 // Blink engine detection 957 var isBlink = (isChrome || isOpera) && !!window.CSS; 958 959 960 var body_class = ""; 961 if (isIE) { 962 body_class = "ie ie11"; 963 } else if(isEdge) { 964 body_class = "ie edge"; 965 } else if(isChrome){ 966 body_class = "chrome non_ie"; 967 } else { 968 body_class = "non_ie"; 969 } 970 971 $("body").addClass(body_class); 972 973 974 //Add body classes for mobile based on UA 975 if(ua == "android"){ 976 $("body").addClass("android"); 977 $("body").addClass("mobile"); 978 } 979 if(ua == "ios"){ 980 $("body").addClass("ios"); 981 $("body").addClass("mobile"); 982 } 983} 984 985 986function applyEmuFixes(){ 987 988 //fix custom blocks 989 $(".wp-block-ncr-blocks-news-event").each(function(){ 990 $btn = $(this).find(".cta-btn"); 991 $heading = $(this).find(".heading"); 992 $btn.attr("aria-label", "call to action for: " + $heading.text()); 993 }); 994 995 //EMU: 996 //using the b tag? 997 //it's twenty eighteen my friend 998 //we use the strong tag 999 $("b").each(function(){ 1000 $(this).replaceWith("<strong>" + $(this).text() + "</strong"); 1001 }); 1002 1003 1004 //EMU: 1005 //weird stuff from design? 1006 //just detach the empty links 1007 //and move on with life 1008 $("a").each(function(){ 1009 var href = $(this).attr("href"); 1010 var txt = $(this).text(); 1011 1012 //if(txt=="~" && href=="javascript:void(0);"){ 1013 if(txt=="~"){ 1014 $(this).detach(); 1015 } 1016 }); 1017 1018 //EMU: 1019 //image has no alt? 1020 //we can put in the filename 1021 //better than nothing 1022 $("img").each(function(){ 1023 var alt = $(this).attr("alt"); 1024 var src = $(this).attr("src"); 1025 if (src != "" && src != undefined && (alt == "" || alt == undefined)){ 1026 src = src.split("/"); 1027 alt = src[src.length-1]; 1028 alt = alt.replace(/\.png/gi, "").replace(/\.jpg/gi, "").replace(/\.gif/gi, "").replace(/\.jpeg/gi, "").replace(/-/gi, " ").replace(/_/gi, " "); 1029 } 1030 $(this).attr("alt", alt); 1031 }); 1032 1033 1034 //EMU: 1035 //not in a section? 1036 //wrap everything in sections 1037 //surely this is good .... 1038 $("body > *:not(section,main,header,footer)").each(function(){$(this).wrap("<section></section>");}); 1039 1040 //EMU: 1041 //sections need labels? 1042 //well ... we should just make one up 1043 //I think this will work? 1044 var sections = [] 1045 $("section").each(function(){ 1046 if($(this).attr("aria-label") == "" || $(this).attr("aria-label") == undefined){ 1047 var txt; 1048 if ($(this).text() == undefined){ 1049 txt = ""; 1050 } else { 1051 txt = $(this).text().trim().split(/\s/); //snag text from the html ele 1052 } 1053 var words = 3; //number of words to grab 1054 var max = 10; //make sure we don't loop forever 1055 words = (txt.length>words)?words:txt.length; //make sure there are enough words 1056 var label = ""; //string builder 1057 for(i=0; i<words; i++){ 1058 if(txt[i] != undefined && txt[i].trim().length>0){ 1059 word = txt[i].trim(); 1060 label += word + " "; 1061 } else if (words<max){ 1062 words++; 1063 } 1064 } 1065 label += "..."; 1066 txt = label; 1067 //check for duplicate aria-label (does not handle 3rd/4th/5th instance) 1068 if (sections.indexOf(txt) > -1){
1069 txt += " (duplicate)"; 1070 } 1071 sections.push(txt); 1072 $(this).attr("aria-label", txt); 1073 } 1074 }); 1075 1076 //EMU: 1077 //no h1 on page? 1078 //that's a problem for emus 1079 //let's just inject one 1080 if($("h1").length<1){ 1081 var h1 = '<h1 class="bankNameH1">' + fiName + '</h1>'; 1082 //implied: <a href="/" id="logoLink"><img src="$templateimages/logo.png" alt="$fiFriendlyName Logo" /> 1083 $("#logoLink").append(h1); 1084 } 1085 1086 //EMU: 1087 //roles will get Added 1088 //by megamenu js 1089 //so just remove it 1090 //$("#search-bar").removeAttr("role") 1091 1092 //EMU 1093 //aria-labels 1094 //let's try to add them in bulk 1095 //to shut up qa 1096 //Help: 1097 //relies on 'div.add-labels[data-prefix=whatever] a' 1098 //ex: 1099 // <div class="add-labels" data-prefix="footer link to: "> 1100 // <a>Login</a> 1101 // <a>Home</a> 1102 // <a>learn more</a> 1103 // </div> 1104 //result: 1105 // <a aria-label="footer link to: Login">Login</a> 1106 // <a aria-label="footer link to: Home">Home</a> 1107 // <a aria-label="footer link to: learn more">learn more</a> 1108 $(".add-labels a:not(.editorLink)").each(function(){ 1109 var label = $(this).attr("aria-label"); 1110 var prefix = ($(this).parents(".add-labels").attr("data-prefix"))?$(this).parents(".add-labels").attr("data-prefix"):"autogenerated link to "; 1111 if(label == "" || label == undefined){ 1112 var text = $(this).text().trim(); 1113 $(this).attr("aria-label", prefix + text); 1114 } 1115 }); 1116 1117 1118 //EMU: 1119 //add titles to frames 1120 //if they don't have a title 1121 //remove inline style 1122 var title_count = 0; 1123 $("iframe").each(function(){ 1124 $(this).removeAttr("border"); 1125 $(this).removeAttr("frameborder"); 1126 var title = $(this).attr("title"); 1127 if (title == undefined || title == ""){ 1128 $(this).attr("title", "untitled iframe: " + title_count); 1129 title_count++; 1130 } 1131 }); 1132 1133 //EMU: 1134 //fa icons fix 1135 //they don't have emu labels 1136 //so we make one up 1137 var c=0; 1138 $("svg.svg-inline--fa").each(function(){ 1139 var classes = $(this).attr("class"); 1140 faclass = classes.split("fa-")[1].replace(/-/g, " ").trim(); 1141 $(this).attr("aria-label", faclass + " icon, id: " + c); 1142 c++; 1143 }); 1144 1145 1146} 1147 1148//generate randome numbers 1149//randomBetween(1, 3) ==> 1, 2, 3 1150function randomBetween(min, max){ 1151 return Math.floor(Math.random() * max) + min; 1152} 1153 1154 1155 1156 1157//generic parameter pulling 1158function getParameterByName(name, url) { 1159 if (!url) url = window.location.href; 1160 name = name.replace(/[\[\]]/g, "\\$&"); 1161 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 1162 results = regex.exec(url); 1163 if (!results) return null; 1164 if (!results[2]) return ''; 1165 return decodeURIComponent(results[2].replace(/\+/g, " ")); 1166} 1167 1168 1169 1170//console.log, eh? 1171//we should hide our messages 1172//and save our keystrokes 1173function log(log_message){ 1174 //cfg_enable_logging set/managed in globals.php 1175 if(cfg_enable_logging == "true"){ 1176 if($("body.ie").length>0){ 1177 console.log(log_message); 1178 } else { 1179 console.log("%c" + log_message, "background: #2e0058; color: #00c0ff; padding:2px 4px; font-weight: bold; font-family: 'Comic Sans MS'"); 1180 } 1181 } 1182} 1183 1184// iframed form resizing 1185var int = self.setInterval(function(){isize()},2000); 1186var isize = function() { 1187 $('iframe.isize').each(function() { 1188 $(this).height($(this).contents().height()); 1189 }); 1190} 1191 1192 1193 1194function target_blank(url){ 1195 tmp = window.open(url); 1196 tmp = null; 1197} 1198 1199 1200/************************************************************************************************************ 1201 * This function is used in the onclick of the a tag to display the external site warning. 1202 * @param msg - Integer specifying the which message to display. 1203 * @param lk - The a link object 1204 * Usage: <a href="http://wwww.mysite.com" onclick="return displayThirdPartyAlert(1,this);">My Site</a> 1205 **************************************************************************************************************/ 1206function displayThirdPartyAlert(msg,lk){ 1207 var description = lk.innerHTML; 1208 if(description.indexOf('alt="') != -1){ 1209 var x = description.indexOf('alt="')+5; 1210 var temp = description.substring(x); 1211 description = temp.substring(0,temp.indexOf("\"")); 1212 }
1213 showWarning(lk.href, description, lk.target, msg) 1214 return false; 1215} 1216 1217/************************************************************************************************************ 1218 * This function is used in the href of the a tag to display the external site warning. 1219 * @param lk - The url of the site to be opened 1220 * @param desc - The description of the site to be opened, i.e. the name of the site. 1221 * @param target - Allows for the window to opened in a new window 1222 * @param msg - Integer specifying the which message to display. 1223 * Usage: <a href="javascript:showWarning('http://wwww.mysite.com');">My Site</a> 1224 **************************************************************************************************************/ 1225 1226function showWarning(lk, desc, target, msg){ 1227 desc = (desc) ? desc : "Third Party Site"; 1228 target="_blank"; 1229 if (lk.indexOf("http:")!=0&&lk.indexOf("https:")!=0&&lk.indexOf("mailto:")!=0) target = "_self"; 1230 msg = (msg) ? msg : 0; 1231 1232 /* 1233 var titles = new Array(); 1234 1235 titles[0] = titles[1] = '<h2>Third Party Site Disclaimer</h2>'; 1236 titles[2] = '<h2>Partner Site Disclaimer</h2>'; 1237 titles[3] = '<h2>Affiliate Site Disclaimer</h2>'; 1238 titles[4] = '<h2>Third Party Site Disclaimer</h2>'; 1239 titles[5] = '<h2>Email Disclaimer</h2>'; 1240 titles[6] = '<h2>Calculators Disclaimer</h2>'; 1241 1242 1243 var messages = new Array(); 1244 // Standard 3rd Party Warning 1245 messages[0] = messages[1] = "<p>By accessing the noted link you will be leaving "+fiName+"'s website and entering a website hosted by another party. "+fiName+" has not approved this as a reliable partner site. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of "+fiName+"'s website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of "+fiName+".</p>"; 1246 messages[2] = "<p>By accessing the noted link you will be leaving our website and entering a partner site which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>"; 1247 messages[3] = "<p>By accessing the noted link you will be leaving our website and entering an affiliate site which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>"; 1248 messages[4] = "<p>By accessing the noted link you will be leaving our website and entering a site which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>"; 1249 messages[5] = "<p>This is NOT a secured e-mail transmission. Please do not send personal/financial information via this method.</p>"; 1250 messages[6] = "<p>The information provided by these calculators is intended for illustrative purposes only and is not intended to purport actual user-defined parameters. The default figures shown are hypothetical and may not be applicable to your individual situation. Be sure to consult a financial professional prior to relying on the results.</p>"; 1251 */ 1252 1253 var titles = NCR_TPW_LABELS; 1254 var messages = NCR_TPW_CONTENT; 1255 1256 //$('#tpwModal .modal-title').html(titles[msg]); 1257 //$('#tpwModal .modal-body').html(messages[msg]); 1258 //$('#tpwModal .modal-footer .btn-go').attr('href',lk); 1259 //$('#tpwModal').show() 1260 if(msg !== 0){ 1261 $('#ncr-tpw-popup-panel .ncr-tpw-title').html(titles[msg]); 1262 $('#ncr-tpw-popup-panel .ncr-tpw-body').html(messages[msg]); 1263 $('#ncr-tpw-popup-panel .btn-go').attr('href',lk); 1264 //open the panel 1265 $("#ncr-tpw-popup-panel").trigger("ncr-open-panel"); 1266 } 1267 1268} 1269 1270 1271function getUrl(){ 1272 var url = document.location.href; 1273 var urlstart = url.indexOf("newUrl=") + 7; 1274 var urlToReturn = url.substring(urlstart); 1275 return urlToReturn; 1276} 1277 1278 1279String.prototype.tagReplace = function() { 1280 var result = (this == "") ? " " : this; 1281 1282 return result.replace(/\(%tr%([^)]*)\)/g, '\<$1\>') 1283 .replace(/\(br\)/gi, "<br />") 1284 .replace(/\(bold\)/gi, "<strong>") 1285 .replace(/\(\/bold\)/gi, "</strong>") 1286 .replace(/\(strong\)/gi, "<strong>") 1287 .replace(/\(\/strong\)/gi, "</strong>") 1288 .replace(/\(h2\)/gi, "<h2>") 1289 .replace(/\(\/h2\)/gi, "</h2>") 1290 .replace(/\(h3\)/gi, "<h3>") 1291 .replace(/\(\/h3\)/gi, "</h3>") 1292 .replace(/\(sup\)/gi, "<sup>") 1293 .replace(/\(\/sup\)/gi, "</sup>") 1294 .replace(/\(em\)/gi, "<em>") 1295 .replace(/\(\/em\)/gi, "</em>") 1296 .replace(/\(tm\)/gi, "™") 1297 .replace(/\(trade\)/gi, "™") 1298 .replace(/\(reg\)/gi, "®") 1299 .replace(/\(copy\)/gi, "©") 1300 .replace(/\(amp\)/gi, "&") 1301 .replace(/\(lt\)/gi, "<") 1302 .replace(/\(gt\)/gi, ">"); 1303 1304} 1305 1306 1307 1308})(jQuery); // or even jQuery.noConflict()
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.