1 2 3jQuery(function($) { 4 "use strict"; 5 6 7 var pannu = {}, 8 attrResults = [], 9 $menuDelay = 600, 10 $body = $('body'), 11 $window = $(window), 12 $header = $(".doc-header"), 13 $footer = $(".doc-footer"), 14 hoverTimer = null, 15 fo_rank = '', 16 fo_LPA = '', 17 $resultArea = $('#navcontainer').innerHeight() + $('.sitesearch').innerHeight() + 150, 18 $fp = true; 19 if ($window.width() < 767) { 20 $resultArea -= 50; 21 } 22 23 //var prepURL = '/?t=47&format=xmlsummary&directive=0&stylesheet=ajax_attorneylist'; 24 var prepURL = '/data.php?t=47&format=xmlsummary&directive=0&stylesheet=ajax_attorneylist'; 25 var prepArticleURL = '/?t=22&format=xmlsummary&directive=0&stylesheet=ajax_caselist&I=&lpa='; 26 var currentPage = 0; 27 28 function searchPages() { 29 $('.people-search-label').hide(); 30 $('.mega-search-results').html(''); 31 if(attrResults.length){ 32 currentPage = 0; 33 $('.peoplePrev').hide(); 34 if(attrResults.length > 2) { 35 $('.peopleNav').fadeIn(); 36 $('.peopleNext').fadeIn(); 37 $('.paging-info').html('Showing results 1-2 of ' + attrResults.length); 38 }else{ 39 $('.peopleNav').hide(); 40 } 41 for(var a=currentPage; a < currentPage+2; a++){ 42 $('.mega-search-results').append(attrResults[a]); 43 } 44 currentPage++; 45 }else{ 46 $('.peopleNav').hide(); 47 $('.mega-search-results').html('<h3 class="mt-20">No Results</h3>'); 48 } 49 } 50 51 $body.on('click','.peopleNext',function (e) { 52 $('.mega-search-results').html(''); 53 var s = currentPage*2; 54 for(var a=s;a < s+2;a++ ){ 55 if(attrResults[a]) { 56 $('.mega-search-results').append(attrResults[a]); 57 } 58 } 59 var ttl = s+2; 60 var st = s+1; 61 if(ttl > attrResults.length){ 62 ttl = attrResults.length; 63 } 64 $('.paging-info').html('Showing results ' + st + '-' + ttl + ' of ' + attrResults.length); 65 currentPage++; 66 67 if(s+2 >= attrResults.length){ 68 $('.peopleNext').hide(); 69 }else{ 70 $('.peopleNext').fadeIn(); 71 } 72 $('.peoplePrev').fadeIn(); 73 }); 74 $body.on('click','.peoplePrev',function (e) { 75 $('.mega-search-results').html(''); 76 currentPage--; 77 var s = currentPage*2; 78 for(var a=s-2;a < s;a++ ){ 79 if(attrResults[a]) { 80 $('.mega-search-results').append(attrResults[a]); 81 } 82 } 83 84 var st = s-2+1; 85 $('.paging-info').html('Showing results ' + st + '-' + s + ' of ' + attrResults.length); 86 87 if(s-2 === 0){ 88 $('.peoplePrev').hide(); 89 }else{ 90 $('.peoplePrev').fadeIn(); 91 } 92 $('.peopleNext').fadeIn(); 93 }); 94 95 $(window).scroll(function (e) { 96 if ($(document).scrollTop() > 50) { 97 $header.addClass('onMove'); 98 }else{ 99 $header.removeClass('onMove'); 100 } 101 }); 102 103 pannu.caller = { 104 thisYear: function () { 105 $(".thisYear").text(new Date().getFullYear()); 106 }, 107 searchResults: function (targetArea, apiUrl) { 108 var s_A_Count = 0; 109 attrResults = []; 110 $('.resultScroll').hide(); 111 targetArea.empty(); 112 targetArea.append('<i class="fa ajax-loading-icon fa-spin fa-spinner"></i>'); 113 jQuery.ajax({ 114 //type: "POST", 115 mode: "abort", 116 port: "ajaxmiddlesearch", 117 url: apiUrl, 118 //data: reqData, 119 dataType: 'json', 120 //cache: false, 121 error: function (jqXHR, textStatus, errorThrown) { 122 //alert(textStatus+errorThrown); 123 }, 124 success: function (data) { 125 $.each(data.attys, function (i, obj) { 126 $.each(obj, function (j, person) { 127 var theName = person.N.split(/\s+/), newName; 128 129 if (typeof theName[2] === "undefined") { 130 newName = theName[1] + ", " + theName[0]; 131 } else { 132 newName = theName[2] + ", " + theName[0] + " " + theName[1].charAt(0) + "."; 133 } 134 newName = newName.split(',,').join(','); 135 attrResults.push('<div class="att-ajax-result"><figure><a href="/data.php?t=3&A=' + person.I + '&format=xml"><img src="'+person.J+'" alt="' + person.A + '"></a></figure><a href="/?t=3&A=' + person.I + '&format=xml" class="att-name">' + person.A + '</a>, <span>' + person.R + '</span><div class="contacts"><div><a href="tel:' + person.P + '">' + person.P + '</a></div><div>
135<a onclick="return confirm(\'NOTICE: Emailing an attorney shall not and does not create an attorney-client relationship between the attorney and users of this web site or any other party whatsoever. An attorney-client relationship is ONLY established through a written engagement, and only where doing so would comply with all applicable laws and ethical rules. CONFIDENTIAL INFORMATION: Transmission of information on-line, over email, or through any electronic means can be unstable, unreliable and insecure. You should not send information or facts via e-mail relating to your legal problem or question. If you do not have an existing attorney-client relationship, your e-mail may not be privileged or confidential. By clicking OK below, you are agreeing to the terms of this web site.\')" href="mailto:' + person.E + '">' + person.E + '</a></div></div></div>'); 136 }); 137 }); 138 if (attrResults.length) { 139 $('.att-search .closeSearch').show(); 140 } 141 142 143 if(targetArea.parents(".mega-menu").length){ 144 searchPages(); 145 }else{ 146 if (!attrResults.length) { 147 attrResults.push('No Results Found'); 148 } 149 targetArea.html(attrResults); 150 } 151 } 152 }); 153 }, 154 setMenuDelay: function () { 155 var $link = '.mega-trigger'; 156 $($link).on('mouseenter', function (e) { 157 $(".pa-wrap").show(); 158 $(".spotlight-preview").hide(); 159 var $this = $(this), 160 $target = $($this.attr('data-target')); 161 /*$('.doc-header li').removeClass('pointer'); 162 $('.mega-menu').hide();*/ 163 if (hoverTimer) { 164 clearTimeout(hoverTimer); 165 hoverTimer = null; 166 } 167 if (!$this.hasClass('locked')) { 168 $this.addClass('locked'); 169 hoverTimer = setTimeout(function () { 170 $body.trigger('click'); 171 $this.parent('li').addClass('pointer'); 172 $target.fadeIn(function () { 173 $('.doc-header li').removeClass('pointer'); 174 $this.parent('li').addClass('pointer'); 175 $this.removeClass('locked'); 176 $('.news-carousel').css('opacity', '0'); 177 $('.news-carousel').slick('setPosition'); 178 $('.news-carousel').css('opacity', '1'); 179 if($this.attr('data-target') == '#mega-practices') { 180 $('body').addClass('mega-menu-active'); 181 } 182 }); 183 }, $menuDelay); 184 } 185 }); 186 $($link).on('mouseleave', function (e) { 187 var $this = $(this); 188 if (hoverTimer) { 189 $this.removeClass('locked'); 190 clearTimeout(hoverTimer); 191 hoverTimer = null; 192 } 193 }); 194 $body.on('click', 'a.locked', function () { 195 return false; 196 }); 197 $body.on('click', function (e) { 198 if ($(e.target).closest('.mega-menu,.mega-trigger').length === 0) { 199 $('.mega-menu').hide(); 200 $('.doc-header li').removeClass('pointer'); 201 $('body').removeClass('mega-menu-active'); 202 } 203 if ($(e.target).closest('.sm-inner,.searchTrigger').length === 0) { 204 $(".search-modal").fadeOut(); 205 $('.search-modal').removeClass('loading'); 206 $('.search-modal').removeClass('search-used'); 207 $('.search-results').hide(); 208 $body.removeClass('multi-search-active'); 209 } 210 if ($(e.target).closest('.offcanvas-nav,.navTrigger,.mob-navTrigger').length === 0) { 211 $body.removeClass('offcanvasActive'); 212 } 213 if ($(e.target).closest('.extra-list,.trigger-of-triggers').length === 0) { 214 $('.bio-triggers-wrap').removeClass('active'); 215 } 216 if ($(e.target).closest('.doc-footer').length === 0) { 217 $(".doc-footer").addClass('hidden-forms'); 218 $("body").removeClass("contact-forms-active"); 219 } 220 }); 221 }, 222 makeBg: function () { 223 $('.imgAsBg').each(function () { 224 var ele = $(this), 225 img = ele.children('img'), 226 src = img.attr('src'); 227 ele.css('background-image', 'url(' + src + ')'); 228 }); 229 }, 230 toggleOffCanvas: function () { 231 $('.navTrigger,.closeOffCanvas,.mob-navTrigger').on('click', function (e) { 232 e.preventDefault(); 233 $body.toggleClass('offcanvasActive'); 234 }); 235 }, 236 removeActive: function (ele) { 237 $body.on('click', function (e) { 238 if ($(e.target).closest(ele).length === 0) { 239 $(ele).removeClass("active"); 240 } 241 }); 242 }, 243 onStart: function () { 244 this.setMenuDelay(); 245 this.thisYear(); 246 this.makeBg(); 247 this.toggleOffCanvas(); 248 this.removeActive('.filter-list'); 249 } 250 }; 251 252 253 $(".text-widget hr, .bio-accordion-content hr").each(function () { 254 var $this = $(this); 255 $this.nextAll().wrapAll('<div class="extraText"/>'); 256 if($this.parent('ul').length || $this.parent('ol').length){ 257 $this.parent().nextAll().wrapAll('<div class="extraText"/>'); 258 if($this.parent().parent('li').length) { 259 console.log('parent 2'); 260 $this.parent().parent().nextAll().wrapAll('<div class="extraText"/>'); 261 if(!$this.parent().parent().parent().hasClass('text-widget')){ 262 $this.parent().parent().parent().nextAll().wrapAll('<div class="extraText"/>'); 263 if(!$this.parent().parent().parent().parent().hasClass('text-widget')){ 264 $this.parent().parent().parent().parent().nextAll().wrapAll('<div class="extraText"/>'); 265 } 266 } 267 } 268 } 269 $(".extraText").addClass('hidden-content'); 270 $(".extraText").parents('.text-widget,.bio-accordion-content').append("<div class='readMoreContent-wrap'><button class='readMoreContent'>Read More <i class='fa fa-arrow-down'></i></button></div>").promise().done(function () { 271 $this.hide(); 272 $(".readMoreContent-wrap").show(); 273 }); 274 275 });
276 277 $body.on("click", ".readMoreContent", function () { 278 var $this = $(this); 279 if ($this.hasClass("active")) { 280 $this.removeClass("active"); 281 $this.html("Read More <i class='fa fa-arrow-down'></i>"); 282 $this.parent(".readMoreContent-wrap").siblings(".extraText").addClass('hidden-content'); 283 } else { 284 $this.addClass("active"); 285 $this.html("Less <i class='fa fa-arrow-up'></i>"); 286 $this.parent(".readMoreContent-wrap").siblings(".extraText").removeClass('hidden-content'); 287 } 288 }); 289 290 291 /*================= 292 events 293 ===================*/ 294 295 296 pannu.caller.onStart(); 297 298 $("ul").parent('li').addClass('parent'); 299 if($(".bio-page").length){ 300 $body.addClass('scroll-y'); 301 } 302 $('.widget-mobile-accordion header a').on('click', function (e) { 303 e.preventDefault(); 304 $(this).parents('.widget-mobile-accordion').toggleClass('active'); 305 }); 306 307 $('.toggle-sidebar,.vertical-label').on('click', function (e) { 308 e.preventDefault(); 309 $(this).parents('.flexible-canvas').toggleClass('sidebar-closed'); 310 setTimeout(function () { 311 makeAttSlider($teamSlider); 312 },500) 313 }); 314 315 $body.on('click','.mega-close', function(e) { 316 $('.mega-menu').hide(); 317 $('.doc-header li').removeClass('pointer'); 318 }); 319 320 $(".backToTop").on('click', function (e) { 321 e.preventDefault(); 322 $('body,html').animate({scrollTop: 0}); 323 }); 324 325 $(".accordion-trigger").on('click', function (e) { 326 e.preventDefault(); 327 var $this = $(this), 328 p = $(this).parents('.' + 329 '-panels'); 330 $this.toggleClass('active'); 331 $this.parent().toggleClass('active'); 332 $this.siblings('.bio-accordion-content,.accordion-content').slideToggle(); 333 }); 334 335 $body.on('click','.bio-triggers > button', function (e) { 336 e.preventDefault(); 337 var $this = $(this); 338 if(!$this.hasClass('active')){ 339 $this.siblings().removeClass('active'); 340 $this.addClass('active'); 341 $('.bio-panel').hide(); 342 $('.bio-panel').eq($this.index()).show(); 343 } 344 }); 345 346 $body.on('click','.extra-list button', function (e) { 347 e.preventDefault(); 348 var $this = $(this); 349 if(!$this.hasClass('active')){ 350 $(".bio-triggers button").removeClass('active'); 351 $this.siblings().removeClass('active'); 352 $this.addClass('active'); 353 $('.bio-panel').hide(); 354 $('.bio-panel').eq($this.index()+4).show(); 355 } 356 }); 357 358 359 360 var triggersWrap = $('.bio-triggers-wrap'), 361 bioTriggers = $(".bio-triggers-wrap .bio-triggers button"), 362 ttlBioTabs = bioTriggers.length; 363 if(ttlBioTabs > 4){ 364 triggersWrap.addClass('moreTabs'); 365 triggersWrap.append('<button class="trigger-of-triggers"></button>'); 366 triggersWrap.append('<div class="extra-list"></div>'); 367 for (var i=4; i < ttlBioTabs; i++){ 368 $(".extra-list").append(bioTriggers.eq(i)); 369 } 370 } 371 $body.on('click', '.mega-trigger', function (e) { 372 var $this = $(this), 373 $target = $($this.attr('data-target')); 374 if (!$this.hasClass('locked') && !$this.parent().hasClass('pointer')) { 375 e.preventDefault(); 376 $(".mega-menu").hide(); 377 $('.doc-header li').removeClass('pointer'); 378 $target.fadeIn(function () { 379 $this.parent('li').addClass('pointer'); 380 }); 381 } 382 }); 383 384 385 386 387 388 $body.on('click','#navlist li.parent > a', function (e) { 389 e.preventDefault(); 390 var $this = $(this); 391 $this.parent('li').toggleClass('expanded'); 392 $this.siblings('ul').slideToggle(); 393 }); 394 $body.on('click','.accordion-list-widget li.parent > a', function (e) { 395 e.preventDefault(); 396 var $this = $(this); 397 $this.parent('li').toggleClass('expanded'); 398 $this.siblings('ul').slideToggle(); 399 }); 400 401 $(".attorney-image").css('top',$header.innerHeight() +'px'); 402 function set_page() { 403 var contentHeight = $('.content-area').innerHeight() > $window.height() ? $('.content-area').innerHeight() : $window.height(); 404 $('.page-sidebar').css('min-height', contentHeight + 'px');
405 $('.page-content').css('margin-bottom', $footer.innerHeight() + 'px'); 406 $('.home-content').css('margin-top', $header.innerHeight() + 'px'); 407 $('.page-head,.header-spacer').css('padding-top', $header.innerHeight() + 30 + 'px'); 408 $(".inner-page,.attorneys-wrap figure,.home-content .inner").css('min-height',$window.height() - ($header.innerHeight() + $footer.innerHeight()) + 'px' ); 409 } 410 411 $window.on('resize',function () { 412 $('.mega-menu').hide(); 413 $('body').removeClass('mega-menu-active'); 414 setTimeout(function () { 415 $('.doc-header li').removeClass('pointer'); 416 set_page(); 417 },150); 418 }); 419 set_page(); 420 421 if($(".bio-triggers").length) { 422 $('.bio-triggers button').each(function () { 423 var $this = $(this), 424 target = $this.data('target'); 425 if(window.location.hash && window.location.hash.indexOf(target) !== -1) { 426 $this.trigger('click'); 427 $(target).children('.accordion-trigger').trigger('click'); 428 } 429 }); 430 } 431 432 /*do not remove any of the code above*/ 433 434 435 436 $('.mega-attorney-search').on('submit', function (e) { 437 e.preventDefault(); 438 pannu.caller.searchResults($('.mega-search-results'), prepURL + '&' + $(this).serialize()); 439 }); 440 441 442 var megaInputTimer = null; 443 $('.mega-attorney-search input').on('keyup change', function(e){ 444 var $this = $(this); 445 if($this.val().length > 2 ){ 446 if(megaInputTimer !== null) clearTimeout(megaInputTimer); 447 megaInputTimer = setTimeout(function () { 448 $this.parents('form').trigger('submit'); 449 },1000); 450 } 451 }); 452 453 $('.mega-attorney-search select').on('change', function(e){ 454 var $this = $(this); 455 $this.parents('form').trigger('submit'); 456 $this.blur(); 457 }); 458 459 $('.alpha-list button').on('click', function(e){ 460 var $this = $(this); 461 pannu.caller.searchResults($('.mega-search-results'), prepURL + '&alpha=' + $this.data('alpha')); 462 }); 463 464 465 466 function letsDoAjax(key){ 467 468 $(".no-mega-results").hide(); 469 var ms_Count = 0,msAtt=[],msSer=[],msPub=[],msNews = [],msEvnt= [],msBlog= [],msOthr = [], 470 //ms_attURl = "/?t=47&format=xmlsummary&directive=0&stylesheet=ajax_attorneys&max=5&q="+key, 471 ms_attURl = "/data.php?t=47&format=xmlsummary&directive=0&stylesheet=ajax_attorneys&max=5&q="+key, 472 ms_services = "/?t=6&format=xmllist&directive=0&stylesheet=ajax_services&max=5&q="+key, 473 ms_blog = "/?t=39&format=xmldetail&directive=0&stylesheet=ajax_articles_loadmore&anc=868&q="+key, 474 ms_publication = "/?t=39&format=xmldetail&directive=0&stylesheet=ajax_articles_loadmore&anc=742,743&q="+key, 475 ms_events = "/?t=39&format=xmldetail&directive=0&stylesheet=ajax_articles_loadmore&anc=825&q="+key, 476 ms_insights = "/?t=39&format=xmldetail&directive=0&stylesheet=ajax_articles_loadmore&anc=744,1003,1004&q="+key, 477 ms_all_articles = "/?t=39&format=xmldetail&directive=0&stylesheet=ajax_articles_loadmore&anc=742,743,744,1003,1004,825,868&q="+key, 478 ms_others = "/?t=41&format=xml&p=5215&directive=0&stylesheet=ajax_search&max=5&q="+key; 479 var total_pub = 0; 480 481 482 $(".go-to-search").attr('href','/?t=41&format=xml&q='+ key); 483 484 /*====Attorney======*/ 485 jQuery.ajax({ 486 //type: "POST", 487 mode:"abort", 488 port:"ajaxmiddlesearch", 489 url:ms_attURl, 490 dataType: 'json', 491 error:function(jqXHR,textStatus,errorThrown){ 492 }, 493 success: function(data){ 494 $.each(data.attys, function(i, obj) { 495 $.each(obj, function(j, person) { 496 var theName = person.N.split(/\s+/),ms_newName; 497 if (typeof theName[2] === "undefined") { 498 ms_newName = theName[1]+", "+theName[0]; 499 }else{ 500 ms_newName = theName[2]+", "+theName[0]+" "+theName[1].charAt(0)+"."; 501 } 502 ms_newName = ms_newName.split(',,').join(','); 503 msAtt.push('<li><figure><a href="/data.php?t=3&A='+person.I+'&format=xml"><img src="'+person.J+'" alt="'+ms_newName+'"></a></figure>' + 504 '<div class="att-titles"><strong><a href="/data.php?t=3&A='+person.I+'&format=xml">'+person.A+'</a></strong><span class="rank">'+person.R+'</span><span class="location">'+person.O+'</span></div>\n' + 505 '<div class="att-gt"><a href="tel:'+person.P+'">'+person.P+'</a><a href="'+person.V+'" class="download-vcard">Download vCard</a></div>' + 506 '<div class="att-email">
506<a onclick="return confirm(\'NOTICE: Emailing an attorney shall not and does not create an attorney-client relationship between the attorney and users of this web site or any other party whatsoever. An attorney-client relationship is ONLY established through a written engagement, and only where doing so would comply with all applicable laws and ethical rules. CONFIDENTIAL INFORMATION: Transmission of information on-line, over email, or through any electronic means can be unstable, unreliable and insecure. You should not send information or facts via e-mail relating to your legal problem or question. If you do not have an existing attorney-client relationship, your e-mail may not be privileged or confidential. By clicking OK below, you are agreeing to the terms of this web site.\')" href="mailto:'+person.E+'">'+person.E+'</a></div>' + 507 '</li>'); 508 ms_Count++; 509 if(ms_Count === 5) { 510 return false; 511 } 512 }); 513 }); 514 if(data.count>5){ 515 $(".go-to-search").show(); 516 }else{ 517 $(".attMSMore").hide(); 518 } 519 520 if(data.count==0){ 521 $('.ms-tabPan .attorney-result-list').html(""); 522 $("#ms-attorneys").hide(); 523 $(".ms-prof-tri").hide(); 524 }else{ 525 $("#ms-attorneys,.ms-prof-tri").show(); 526 $('.ms-tabPan .attorney-result-list').html(msAtt); 527 $(".attMsCount").html(data.count).show(); 528 } 529 } 530 }); 531 532 ms_Count =0; 533 /*=====Practices=====*/ 534 535 jQuery.ajax({ 536 //type: "POST", 537 mode:"abort", 538 port:"ajaxmiddlesearch", 539 url:ms_services, 540 dataType: 'json', 541 error:function(jqXHR,textStatus,errorThrown){ 542 console.log(errorThrown); 543 }, 544 success: function(data){ 545 $.each(data.srvcs, function(i, obj) { 546 msSer.push("<li><a href='/?t=5&LPA="+obj.I+"&format=xml'>"+obj.N+"</a></li>"); 547 ms_Count++; 548 if(ms_Count==5) 549 return false; 550 }); 551 if(data.count > 5){ 552 $(".go-to-search").show(); 553 } 554 if(data.count == 0){ 555 $('.ms-tabpan-content .services-list').html(""); 556 $('#ms-services,.ms-ser-tri').hide(); 557 }else{ 558 $('#ms-services,.ms-ser-tri').show(); 559 $('.ms-tabpan-content .services-list').html(msSer); 560 $(".serMsCount").html(data.count).show(); 561 } 562 563 } 564 }); 565 566 567 568 /*=======publications=======*/ 569 570 jQuery.ajax({ 571 //type: "POST", 572 mode:"abort", 573 port:"ajaxmiddlesearch", 574 url:ms_publication, 575 dataType: 'json', 576 error:function(jqXHR,textStatus,errorThrown){ 577 }, 578 success: function(data){ 579 $.each(data.artcls, function(j, person) { 580 msPub.push('<article class="ms-post"><strong><a href="/?t=40&an='+ person.I +'">'+person.N+'</a></strong><time datetime="'+person.D+'">'+person.D+'</time>'+person.AD+'</article>'); 581 ms_Count++; 582 if(ms_Count==5) 583 return false; 584 }); 585 if(data.count == 0){ 586 $('#msr-pubs').html(""); 587 $('#msr-pubs').hide(); 588 }else{ 589 $('#msr-pubs').show(); 590 $('#msr-pubs').html(msPub); 591 } 592 } 593 }); 594 595 596 /*=======News=======*/ 597 598 jQuery.ajax({ 599 //type: "POST", 600 mode:"abort", 601 port:"ajaxmiddlesearch", 602 url: ms_insights, 603 dataType: 'json', 604 error:function(jqXHR,textStatus,errorThrown){ 605 }, 606 success: function(data){ 607 $.each(data.artcls, function(j, person) { 608 msNews.push('<article class="ms-post"><strong><a href="/?t=40&an='+ person.I +'">'+person.N+'</a></strong><time datetime="'+person.D+'">'+person.D+'</time>'+person.AD+'</article>'); 609 ms_Count++; 610 if(ms_Count==5) 611 return false; 612 }); 613 if(data.count == 0){ 614 $('#msr-news').html(""); 615 $('#msr-news').hide(); 616 }else{ 617 $('#msr-news').show();
618 $('#msr-news').html(msNews); 619 } 620 } 621 }); 622 623 /*=======Events=======*/ 624 625 626 jQuery.ajax({ 627 //type: "POST", 628 mode:"abort", 629 port:"ajaxmiddlesearch", 630 url: ms_events, 631 dataType: 'json', 632 error:function(jqXHR,textStatus,errorThrown){ 633 }, 634 success: function(data){ 635 636 $.each(data.artcls, function(j, person) { 637 msEvnt.push('<article class="ms-post"><strong><a href="/?t=40&an='+ person.I +'">'+person.N+'</a></strong><time datetime="'+person.D+'">'+person.D+'</time>'+person.AD+'</article>'); 638 ms_Count++; 639 if(ms_Count==5) 640 return false; 641 }); 642 if(data.count == 0){ 643 $('#msr-events').html(""); 644 $('#msr-events').hide(); 645 }else{ 646 $('#msr-events').show(); 647 $('#msr-events').html(msEvnt); 648 } 649 } 650 }); 651 652 /*=======blog=======*/ 653 654 jQuery.ajax({ 655 //type: "POST", 656 mode:"abort", 657 port:"ajaxmiddlesearch", 658 url: ms_blog, 659 dataType: 'json', 660 error:function(jqXHR,textStatus,errorThrown){ 661 }, 662 success: function(data){ 663 $.each(data.artcls, function(j, person) { 664 msBlog.push('<article class="ms-post"><strong><a href="/?t=40&an='+ person.I +'">'+person.N+'</a></strong><time datetime="'+person.D+'">'+person.D+'</time>'+person.AD+'</article>'); 665 ms_Count++; 666 if(ms_Count==5) 667 return false; 668 }); 669 if(data.count == 0){ 670 $('#msr-blogs').html(""); 671 $('#msr-blogs').hide(); 672 }else{ 673 $('#msr-blogs').show(); 674 $('#msr-blogs').html(msBlog); 675 } 676 } 677 }); 678 679 680 681 /*=====Others=====*/ 682 683 jQuery.ajax({ 684 //type: "POST", 685 mode:"abort", 686 port:"ajaxmiddlesearch", 687 url:ms_others, 688 dataType: 'json', 689 error:function(jqXHR,textStatus,errorThrown){ 690 }, 691 success: function(data){ 692 693 $.each(data.rslts, function(i, obj) { 694 msOthr.push("<li><a href='"+obj.U+"'>"+obj.N+"</a></li>"); 695 ms_Count++; 696 if(ms_Count==5) 697 return false; 698 }); 699 700 if(data.count>5){ 701 $(".go-to-search").show(); 702 }else{ 703 $(".othrMSMore").hide(); 704 } 705 706 707 if(data.count == 0){ 708 $('#ms-others .msr-news-list').html(''); 709 $('#ms-others,.ms-oth-tri').hide(); 710 }else{ 711 $('#ms-others,.ms-oth-tri').show(); 712 $('#ms-others .msr-news-list').html(msOthr); 713 $(".othrMsCount").html(data.count).show(); 714 } 715 716 } 717 }); 718 719 ms_Count =0; 720 total_pub = 0; 721 /*=======all articles=======*/ 722 723 jQuery.ajax({ 724 //type: "POST", 725 mode:"abort", 726 port:"ajaxmiddlesearch", 727 url:ms_all_articles, 728 dataType: 'json', 729 error:function(jqXHR,textStatus,errorThrown){ 730 console.log(textStatus); 731 }, 732 success: function(data){ 733 if(data.count == 0){ 734 $("#ms-publications,.ms-pub-tri").hide(); 735 jQuery.ajax({ 736 //type: "POST", 737 mode:"abort", 738 port:"ajaxmiddlesearch", 739 url:ms_others, 740 dataType: 'json', 741 error:function(jqXHR,textStatus,errorThrown){ 742 },
743 success: function(data_others){ 744 if(data_others.count == 0){ 745 jQuery.ajax({ 746 //type: "POST", 747 mode:"abort", 748 port:"ajaxmiddlesearch", 749 url:ms_services, 750 dataType: 'json', 751 error:function(jqXHR,textStatus,errorThrown){ 752 }, 753 success: function(data_ser){ 754 if(data_ser.count == 0){ 755 jQuery.ajax({ 756 //type: "POST", 757 mode:"abort", 758 port:"ajaxmiddlesearch", 759 url:ms_attURl, 760 dataType: 'json', 761 error:function(jqXHR,textStatus,errorThrown){ 762 }, 763 success: function(data_att){ 764 if(data_att.count == 0){ 765 $(".no-mega-results").show(); 766 $(".go-to-search").hide(); 767 }else{ 768 $(".no-mega-results").hide(); 769 } 770 } 771 }); 772 }else{ 773 $(".no-mega-results").hide(); 774 } 775 } 776 }); 777 } 778 else{ 779 $(".no-mega-results").hide(); 780 } 781 } 782 }); 783 }else{ 784 if(data.count > 5){ 785 $(".go-to-search").show(); 786 } 787 $("#ms-publications,.ms-pub-tri").show(); 788 $(".pubMsCount").html(data.count); 789 $(".no-mega-results").hide(); 790 } 791 792 } 793 }); 794 795 } 796 797 798 /*load more articles/news etc*/ 799 800 var $load_more_wrap = $(".articles-listing").not('.no-ajax'), 801 $load_more_trigger = $(".articles-listing .load-more > a"), 802 $load_more_canvas = $load_more_wrap.find(".load-articles"), 803 $ajax_id = $load_more_wrap.data(''), 804 $total_posts = +$load_more_wrap.data('total'), 805 default_visible = $load_more_canvas.find(".article-post").length, 806 current_page = 1, 807 total_pages = Math.ceil($total_posts/default_visible); 808 809 if($ajax_id && $ajax_id !== ''){ 810 if(default_visible >= $total_posts ){ 811 $load_more_wrap.removeClass('available'); 812 } 813 } 814 815 $load_more_trigger.on("click", function(e){ 816 e.preventDefault(); 817 var $this = $(this); 818 $this.addClass('loading'); 819 pull_posts($ajax_id, current_page); 820 }); 821 822 function pull_posts(anc, page){ 823 current_page +=1; 824 jQuery.ajax({ 825 //type: "POST", 826 mode:"abort", 827 port:"ajaxmiddlesearch", 828 url: "/?t=39&format=xmldetail&directive=0&stylesheet=ajax_articles_loadmore&anc="+ anc + "&page=" + current_page, 829 dataType: 'json', 830 error:function(jqXHR,textStatus,errorThrown){ 831 }, 832 success: function(data){ 833 $.each(data.artcls, function(j, post) { 834 $load_more_wrap.find('.article-post').last().addClass('ajax-success set-scoll-target'); 835 $load_more_canvas.append( 836 '<article class="article-post ajax-success ajax-page-'+ current_page + '-' + j +'"><header>' + 837 ' <ul class="social-list">' + 838 ' <li><a href="https://www.facebook.com/sharer.php?u=https://www.psh.com/'+ encodeURIComponent(post.I) +'" class="fab fa-facebook-f"></a></li>\n' + 839 ' <li><a href="https://twitter.com/home?status=https://www.psh.com/'+ encodeURIComponent(post.I) +'" class="fab fa-twitter"></a></li>' + 840 ' <li><a href="https://plus.google.com/share?url=https://www.psh.com/' + encodeURIComponent(post.I) + '" class="fab fa-google-plus-g"></a></li>\n' + 841 ' </ul>' + 842 ' <h3><a href="'+post.I+'">'+post.N+'</a></h3>' + 843 ' <time datetime="'+post.D+'">'+post.D+'</time>' + post.AD + 844 ' </header>' + 845 ' <p>'+post.A+'</p>' + 846 '</article>'); 847 }); 848 if(current_page >= total_pages ){ 849 $load_more_wrap.removeClass('available'); 850 } 851 var target_post = ".set-scoll-target"; 852 $("body,html").stop().animate({scrollTop: $(target_post).offset().top - 100},500); 853 setTimeout(function(){ 854 $load_more_trigger.removeClass('loading'); 855 $(".article-post").removeClass('ajax-success'); 856 $(".article-post").removeClass('set-scoll-target'); 857 },1000); 858 } 859 }); 860 861 } 862 863 864 865}); 866 867 868 869 870 871 872 873 874 875 876 877
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.