Changes for page Service Navigator
Last modified by Veronika Kocher on Thursday, 03 Sep 2026 14:15
From version 22.17
edited by Veronika Kocher
on Thursday, 03 Sep 2026 14:15
on Thursday, 03 Sep 2026 14:15
Change comment:
There is no comment for this version
To version 22.14
edited by Veronika Kocher
on Thursday, 03 Sep 2026 9:34
on Thursday, 03 Sep 2026 9:34
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -286,132 +286,23 @@ 286 286 {{/html}} 287 287 288 288 {{html clean="false"}} 289 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START --> 290 - 291 -<style data-sn-service-navigator-master="1"> 292 -/* ========================================================= 293 - MASTER TYPOGRAPHY 294 - ========================================================= */ 295 -#xwikicontent h1, 296 -#xwikicontent h2, 297 -#xwikicontent h3, 298 -#xwikicontent h4, 299 -#xwikicontent h5, 300 -#xwikicontent h6, 301 -#xwikicontent .box-title, 302 -#xwikicontent [role="heading"], 303 -#xwikicontent h1 a, 304 -#xwikicontent h2 a, 305 -#xwikicontent h3 a, 306 -#xwikicontent h4 a, 307 -#xwikicontent h5 a, 308 -#xwikicontent h6 a, 309 -#xwikicontent .box-title a, 310 -#xwikicontent [role="heading"] a{ 311 - text-align:left!important; 312 - text-justify:auto!important; 313 - word-spacing:normal!important; 314 -} 315 - 316 -/* ========================================================= 317 - COMING SOON / IN VORBEREITUNG 318 - ========================================================= */ 319 -.sn-coming-soon-badge{ 320 - display:inline-block; 321 - vertical-align:middle; 322 - margin-left:10px; 323 - padding:4px 8px; 324 - border-radius:14px; 325 - border:1px solid #efd9cc; 326 - background:#fff4ee; 327 - color:#8a4d36; 328 - font-size:11px; 329 - font-weight:700; 330 - letter-spacing:.055em; 331 - line-height:1.2; 332 - white-space:nowrap; 333 -} 334 - 335 -/* ========================================================= 336 - NATIVE / DETAIL CALLOUT GEOMETRY 337 - Preserve existing backgrounds. 338 - ========================================================= */ 339 -#xwikicontent .arsn-info, 340 -#xwikicontent .dmp-info, 341 -#xwikicontent .ido-info, 342 -#xwikicontent .pp-info, 343 -#xwikicontent .infomessage{ 344 - box-sizing:border-box!important; 345 - border-left:4px solid #21b6d7!important; 346 - border-radius:8px; 347 - text-align:left!important; 348 - word-spacing:normal!important; 349 -} 350 - 351 -#xwikicontent .arsn-warn, 352 -#xwikicontent .dmp-warn, 353 -#xwikicontent .ido-warn, 354 -#xwikicontent .pp-warn, 355 -#xwikicontent .warn, 356 -#xwikicontent .warning, 357 -#xwikicontent .warningmessage, 358 -#xwikicontent .errormessage{ 359 - box-sizing:border-box!important; 360 - border-left:4px solid #e94b13!important; 361 - border-radius:8px; 362 - text-align:left!important; 363 - word-spacing:normal!important; 364 -} 365 - 366 -[data-sn-master-equal-height], 367 -[data-sn-master-first-row]{ 289 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_START --> 290 +<style data-sn-horizontal-box-harmonizer="4"> 291 +[data-sn-equal-height-managed], 292 +[data-sn-first-section-aligned]{ 368 368 box-sizing:border-box; 369 369 } 370 - 371 -/* ========================================================= 372 - FULL-WIDTH THREE-LINE NUMBER / TITLE / SUBTITLE BLOCKS 373 - ========================================================= */ 374 -#xwikicontent .arsn-area-label[data-sn-three-line="1"]{ 375 - display:grid!important; 376 - grid-template-columns:minmax(0,1fr)!important; 377 - grid-auto-rows:auto!important; 378 - width:100%!important; 379 - max-width:none!important; 380 - box-sizing:border-box!important; 381 - justify-items:start!important; 382 - align-items:start!important; 383 - gap:2px!important; 384 - text-align:left!important; 385 - text-align-last:left!important; 386 - text-justify:auto!important; 387 - word-spacing:normal!important; 388 - white-space:normal!important; 389 -} 390 -#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-number, 391 -#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .sn-area-label-title, 392 -#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-action{ 393 - display:block!important; 394 - width:100%!important; 395 - margin:0!important; 396 - text-align:left!important; 397 - text-align-last:left!important; 398 - text-justify:auto!important; 399 - word-spacing:normal!important; 400 - white-space:normal!important; 401 -} 402 402 </style> 403 - 404 -<script data-sn-service-navigator-master="1"> 296 +<script data-sn-horizontal-box-harmonizer="4"> 405 405 (function(){ 406 406 "use strict"; 407 407 408 - var PAGE_KIND="overview"; 409 - var PLACEHOLDER=false; 410 - var PLACEHOLDER_LABEL="COMING SOON"; 411 - 412 412 var MOBILE_MAX=767; 413 413 var ROW_TOLERANCE=6; 414 - var RESIZE_DEBOUNCE=220; 302 + var MIN_W=150; 303 + var MIN_H=36; 304 + var MAX_PARENT_CHILDREN=16; 305 + var SEARCH_DEPTH=5; 415 415 416 416 var root= 417 417 document.getElementById("xwikicontent")|| ... ... @@ -421,105 +421,93 @@ 421 421 422 422 if(!root)return; 423 423 424 - var managedHeight=new Set(); 425 - var managedMargin=new Set(); 426 - var originalHeight=new WeakMap(); 427 - var originalMargin=new WeakMap(); 315 + var heightManaged=new Set(); 316 + var sectionManaged=new Set(); 317 + var originalMinHeight=new WeakMap(); 318 + var originalMarginTop=new WeakMap(); 319 + var raf=0; 428 428 429 - var resizeTimer=0; 430 - var running=false; 321 + function num(v){ 322 + var n=parseFloat(v); 323 + return Number.isFinite(n)?n:0; 324 + } 431 431 432 - var THEMES=[ 433 - { 434 - name:"BLUE", 435 - accent:"#21b6d7", 436 - bg:"#eaf7fb", 437 - text:"#315d68", 438 - labels:[ 439 - "HIER STARTEN", 440 - "ENTSCHEIDEN", 441 - "ÜBERPRÜFEN & ANPASSEN", 442 - "START HERE", 443 - "DECIDE", 444 - "REVIEW & ADAPT" 445 - ] 446 - }, 447 - { 448 - name:"RED", 449 - accent:"#e94b13", 450 - bg:"#fff1ec", 451 - text:"#8a4d36", 452 - labels:[ 453 - "PLANEN & ORGANISIEREN", 454 - "ORGANISIEREN & DOKUMENTIEREN", 455 - "PUBLIZIEREN & PRÄSENTIEREN", 456 - "PLAN & ORGANISE", 457 - "PLAN & ORGANIZE", 458 - "ORGANISE & DOCUMENT", 459 - "ORGANIZE & DOCUMENT", 460 - "PUBLISH & PRESENT" 461 - ] 462 - }, 463 - { 464 - name:"YELLOW", 465 - accent:"#f0aa00", 466 - bg:"#fff8e7", 467 - text:"#785b17", 468 - labels:[ 469 - "SCHÜTZEN & KLÄREN", 470 - "STANDARDISIEREN & IDENTIFIZIEREN", 471 - "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN", 472 - "PROTECT & CLARIFY", 473 - "STANDARDISE & IDENTIFY", 474 - "STANDARDIZE & IDENTIFY", 475 - "OPEN, REUSE & MAKE FINDABLE" 476 - ] 477 - }, 478 - { 479 - name:"GREEN", 480 - accent:"#38b76a", 481 - bg:"#edf9f1", 482 - text:"#3f7451", 483 - labels:[ 484 - "INFRASTRUKTUR EINRICHTEN", 485 - "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN", 486 - "SPEICHERN & ZUGRIFF STEUERN", 487 - "REPOSITORIUM, ERHALTEN & ÜBERGEBEN", 488 - "SET UP INFRASTRUCTURE", 489 - "SET UP INFRASTRUCTURE & COLLABORATION", 490 - "STORE & CONTROL ACCESS", 491 - "REPOSITORY, PRESERVE & HAND OVER" 492 - ] 326 + function visible(el,minW,minH){ 327 + if(!el||el.nodeType!==1)return false; 328 + 329 + var s=getComputedStyle(el); 330 + 331 + if( 332 + s.display==="none"|| 333 + s.visibility==="hidden"|| 334 + Number(s.opacity)===0 335 + ){ 336 + return false; 493 493 } 494 - ]; 495 495 496 - function num(value){ 497 - var n=parseFloat(value); 498 - return Number.isFinite(n)?n:0; 339 + var r=el.getBoundingClientRect(); 340 + 341 + return ( 342 + r.width>=(minW||1)&& 343 + r.height>=(minH||1) 344 + ); 499 499 } 500 500 501 - function norm(value){ 502 - return String(value||"") 503 - .replace(/\s+/g," ") 504 - .trim() 505 - .toUpperCase(); 347 + function excluded(el){ 348 + return ( 349 + !el.matches|| 350 + el.matches( 351 + "button,input,select,textarea,option,label,img,svg,canvas,table,thead,tbody,tfoot,tr,td,th,summary,script,style,noscript,template,.btn,.chip,[role=button]" 352 + ) 353 + ); 506 506 } 507 507 508 - function visible(el){ 509 - if(!el||el.nodeType!==1)return false; 356 + function namedLikeBox(el){ 357 + var c= 358 + typeof el.className==="string" 359 + ? el.className 360 + : ""; 510 510 511 - var style=getComputedStyle(el);512 - var rect=el.getBoundingClientRect();362 + return /(^|[s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([s_-]|$)/i.test(c); 363 + } 513 513 365 + function boxLike(el){ 366 + if(!visible(el,MIN_W,MIN_H)||excluded(el))return false; 367 + 368 + var s=getComputedStyle(el); 369 + var r=el.getBoundingClientRect(); 370 + 371 + var border= 372 + num(s.borderTopWidth)+ 373 + num(s.borderRightWidth)+ 374 + num(s.borderBottomWidth)+ 375 + num(s.borderLeftWidth); 376 + 377 + var radius=Math.max( 378 + num(s.borderTopLeftRadius), 379 + num(s.borderTopRightRadius), 380 + num(s.borderBottomLeftRadius), 381 + num(s.borderBottomRightRadius) 382 + ); 383 + 384 + var bg= 385 + s.backgroundColor&& 386 + s.backgroundColor!=="rgba(0, 0, 0, 0)"&& 387 + s.backgroundColor!=="transparent"; 388 + 389 + var shadow= 390 + s.boxShadow&& 391 + s.boxShadow!=="none"; 392 + 514 514 return ( 515 - style.display!=="none"&&516 - style.visibility!=="hidden"&&517 - r ect.width>20&&518 - r ect.height>4394 + namedLikeBox(el)|| 395 + border>=1|| 396 + (bg&&radius>=3)|| 397 + (shadow&&r.width>=180) 519 519 ); 520 520 } 521 521 522 - function save Style(el,map,property){401 + function saveOriginal(el,map,property){ 523 523 if(map.has(el))return; 524 524 525 525 map.set(el,{ ... ... @@ -528,7 +528,7 @@ 528 528 }); 529 529 } 530 530 531 - function restore Style(el,map,property){410 + function restoreOriginal(el,map,property){ 532 532 var original=map.get(el); 533 533 534 534 if(original&&original.value){ ... ... @@ -542,470 +542,247 @@ 542 542 } 543 543 } 544 544 545 - function reset Runtime(){546 - managedHeight.forEach(function(el){547 - restore Style(424 + function reset(){ 425 + heightManaged.forEach(function(el){ 426 + restoreOriginal( 548 548 el, 549 - originalHeight, 428 + originalMinHeight, 550 550 "min-height" 551 551 ); 431 + 552 552 el.removeAttribute( 553 - "data-sn- master-equal-height"433 + "data-sn-equal-height-managed" 554 554 ); 555 555 }); 556 556 557 - managedMargin.forEach(function(el){558 - restore Style(437 + sectionManaged.forEach(function(el){ 438 + restoreOriginal( 559 559 el, 560 - originalMargin, 440 + originalMarginTop, 561 561 "margin-top" 562 562 ); 443 + 563 563 el.removeAttribute( 564 - "data-sn- master-first-row"445 + "data-sn-first-section-aligned" 565 565 ); 566 566 }); 567 567 568 - managedHeight.clear();569 - managedMargin.clear();449 + heightManaged.clear(); 450 + sectionManaged.clear(); 570 570 } 571 571 572 - function themeFor(text){573 - v ar value=norm(text);453 + function pickTarget(child){ 454 + if(!visible(child,MIN_W,MIN_H))return null; 574 574 575 - for(var i=0;i<THEMES.length;i++){ 576 - for(var j=0;j<THEMES[i].labels.length;j++){ 577 - var label=THEMES[i].labels[j]; 578 - 579 - if( 580 - value===label|| 581 - value.indexOf(label+" ")===0|| 582 - value.indexOf(label+" -")===0|| 583 - value.indexOf(label+" ·")===0 584 - ){ 585 - return THEMES[i]; 586 - } 587 - } 456 + if(boxLike(child)){ 457 + return child; 588 588 } 589 589 590 - retu rnnull;591 - }460 + var cr=child.getBoundingClientRect(); 461 + var q=[]; 592 592 593 - /* ======================================================= 594 - BORDERLESS FILLED RED/ORANGE CTA BUTTONS 595 - ======================================================= */ 596 - 597 - function colourDistance(a,b){ 598 - return Math.sqrt( 599 - Math.pow(a[0]-b[0],2)+ 600 - Math.pow(a[1]-b[1],2)+ 601 - Math.pow(a[2]-b[2],2) 602 - ); 603 - } 604 - 605 - function makeFilledRedOrangeCTAsBorderless(){ 606 - var RED_ORANGE=[233,75,19]; 607 - 608 - Array.from( 609 - root.querySelectorAll( 610 - 'a,button,[role="button"],input[type="submit"],input[type="button"]' 611 - ) 612 - ).forEach(function(el){ 613 - if(!visible(el))return; 614 - 615 - var style=getComputedStyle(el); 616 - var rgb=parseRGB(style.backgroundColor); 617 - 618 - if(!rgb)return; 619 - 620 - if( 621 - colourDistance( 622 - rgb, 623 - RED_ORANGE 624 - )>55 625 - ){ 626 - return; 627 - } 628 - 629 - var rect=el.getBoundingClientRect(); 630 - 631 - if( 632 - rect.width<80|| 633 - rect.height<24 634 - ){ 635 - return; 636 - } 637 - 638 - el.style.setProperty( 639 - "border", 640 - "none", 641 - "important" 642 - ); 643 - 644 - el.style.setProperty( 645 - "border-left", 646 - "none", 647 - "important" 648 - ); 649 - 650 - el.style.setProperty( 651 - "border-top", 652 - "none", 653 - "important" 654 - ); 655 - 656 - el.style.setProperty( 657 - "border-right", 658 - "none", 659 - "important" 660 - ); 661 - 662 - el.style.setProperty( 663 - "border-bottom", 664 - "none", 665 - "important" 666 - ); 667 - 668 - el.style.setProperty( 669 - "box-shadow", 670 - "none", 671 - "important" 672 - ); 463 + Array.from(child.children||[]).forEach(function(el){ 464 + q.push({el:el,depth:1}); 673 673 }); 674 - } 675 675 676 - /* ======================================================= 677 - FULL-WIDTH THREE-LINE AREA LABELS 678 - ======================================================= */ 467 + var best=null; 468 + var bestScore=-Infinity; 679 679 680 - function compactText(value){ 681 - return String(value||"") 682 - .replace(/\s+/g," ") 683 - .trim(); 684 - } 470 + while(q.length){ 471 + var item=q.shift(); 472 + var el=item.el; 685 685 686 - function makeThreeLineAreaLabels(){ 687 - Array.from( 688 - root.querySelectorAll( 689 - ".arsn-area-label" 690 - ) 691 - ).forEach(function(label){ 692 - if( 693 - label.getAttribute( 694 - "data-sn-three-line" 695 - )==="1" 696 - ){ 697 - return; 698 - } 474 + if(!visible(el,MIN_W,MIN_H))continue; 699 699 700 - var number= 701 - label.querySelector( 702 - ":scope > .arsn-area-number" 703 - ); 476 + var r=el.getBoundingClientRect(); 704 704 705 - var action= 706 - label.querySelector( 707 - ":scope > .arsn-area-action" 708 - ); 709 - 710 710 if( 711 - !number||712 - !action479 + r.width>=cr.width*.68&& 480 + boxLike(el) 713 713 ){ 714 - return; 715 - } 482 + var widthFit= 483 + 1-Math.min( 484 + 1, 485 + Math.abs(cr.width-r.width)/ 486 + Math.max(1,cr.width) 487 + ); 716 716 717 - var clone= 718 - label.cloneNode(true); 489 + var topFit= 490 + 1-Math.min( 491 + 1, 492 + Math.abs(cr.top-r.top)/100 493 + ); 719 719 720 - var cloneNumber= 721 - clone.querySelector( 722 - ":scope > .arsn-area-number" 723 - ); 495 + var score= 496 + widthFit*6+ 497 + topFit*3+ 498 + Math.min(r.height,900)/450+ 499 + Math.min(r.width*r.height,900000)/900000; 724 724 725 - var cloneAction= 726 - clone.querySelector( 727 - ":scope > .arsn-area-action" 728 - ); 729 - 730 - if(cloneNumber){ 731 - cloneNumber.remove(); 501 + if(score>bestScore){ 502 + best=el; 503 + bestScore=score; 504 + } 732 732 } 733 733 734 - if(cloneAction){ 735 - cloneAction.remove(); 507 + if(item.depth<SEARCH_DEPTH){ 508 + Array.from(el.children||[]).forEach(function(next){ 509 + q.push({ 510 + el:next, 511 + depth:item.depth+1 512 + }); 513 + }); 736 736 } 515 + } 737 737 738 - var titleText= 739 - compactText( 740 - clone.textContent 741 - ); 517 + return best; 518 + } 742 742 743 - if(!titleText){ 744 - return; 745 - } 520 + function groupsByVisualRow(entries){ 521 + var groups=[]; 746 746 747 - var numberNode= 748 - number.cloneNode(true); 749 - 750 - var actionNode= 751 - action.cloneNode(true); 752 - 753 - var titleNode= 754 - document.createElement( 755 - "span" 523 + entries 524 + .slice() 525 + .sort(function(a,b){ 526 + return ( 527 + a.rect.top-b.rect.top|| 528 + a.rect.left-b.rect.left 756 756 ); 530 + }) 531 + .forEach(function(entry){ 532 + var group=null; 757 757 758 - titleNode.className= 759 - "sn-area-label-title"; 534 + for(var i=0;i<groups.length;i++){ 535 + if( 536 + Math.abs( 537 + groups[i].top- 538 + entry.rect.top 539 + )<=ROW_TOLERANCE 540 + ){ 541 + group=groups[i]; 542 + break; 543 + } 544 + } 760 760 761 - titleNode.textContent= 762 - titleText; 546 + if(!group){ 547 + group={ 548 + top:entry.rect.top, 549 + entries:[] 550 + }; 551 + groups.push(group); 552 + } 763 763 764 - while(label.firstChild){ 765 - label.removeChild( 766 - label.firstChild 767 - ); 768 - } 554 + group.entries.push(entry); 555 + }); 769 769 770 - label.appendChild( 771 - numberNode 772 - ); 773 - 774 - label.appendChild( 775 - titleNode 776 - ); 777 - 778 - label.appendChild( 779 - actionNode 780 - ); 781 - 782 - label.setAttribute( 783 - "data-sn-three-line", 784 - "1" 785 - ); 786 - 787 - var head= 788 - label.closest( 789 - ".arsn-area-head" 790 - ); 791 - 792 - if(head){ 793 - head.style.setProperty( 794 - "width", 795 - "100%", 796 - "important" 797 - ); 798 - 799 - head.style.setProperty( 800 - "max-width", 801 - "100%", 802 - "important" 803 - ); 804 - 805 - head.style.setProperty( 806 - "box-sizing", 807 - "border-box", 808 - "important" 809 - ); 810 - } 811 - }); 557 + return groups; 812 812 } 813 813 814 - /* ======================================================= 815 - PLACEHOLDER BADGE 816 - ======================================================= */ 560 + function validHorizontalGroup(group){ 561 + if(group.entries.length<2)return false; 817 817 818 - function applyPlaceholderBadge(){ 819 - if(!PLACEHOLDER)return; 563 + var lefts= 564 + group.entries 565 + .map(function(e){return e.rect.left;}) 566 + .sort(function(a,b){return a-b;}); 820 820 821 821 if( 822 - document.querySelector(823 - ".sn-coming-soon-badge"824 - )569 + lefts[lefts.length-1]- 570 + lefts[0]< 571 + 80 825 825 ){ 826 - return; 573 + return false; 827 827 } 828 828 829 - var title= 830 - document.querySelector( 831 - "#document-title" 832 - )|| 833 - document.querySelector( 834 - "h1" 835 - ); 576 + var widths= 577 + group.entries 578 + .map(function(e){return e.rect.width;}) 579 + .filter(function(w){return w>0;}); 836 836 837 - if( !title)return;581 + if(widths.length<2)return false; 838 838 839 - var badge= 840 - document.createElement( 841 - "span" 842 - ); 583 + var minWidth=Math.min.apply(Math,widths); 584 + var maxWidth=Math.max.apply(Math,widths); 843 843 844 - badge.className= 845 - "sn-coming-soon-badge"; 846 - 847 - badge.textContent= 848 - PLACEHOLDER_LABEL; 849 - 850 - badge.setAttribute( 851 - "aria-label", 852 - PLACEHOLDER_LABEL 586 + return ( 587 + maxWidth/ 588 + Math.max(1,minWidth)<= 589 + 1.9 853 853 ); 591 + } 854 854 855 - title.appendChild( 856 - badge 857 - ); 593 + function normalizeText(text){ 594 + return String(text||"") 595 + .replace(/s+/g," ") 596 + .trim() 597 + .toUpperCase(); 858 858 } 859 859 860 - /* ======================================================= 861 - DETAIL PAGE OWN-ACCENT PROPAGATION 862 - ======================================================= */ 600 + function exactKnownFirstSection(el){ 601 + var text=normalizeText(el.textContent); 863 863 864 - function parseRGB(value){ 865 - var match=String(value||"").match( 866 - /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i 603 + return ( 604 + text==="HIER STARTEN"|| 605 + text==="ORGANISIEREN & DOKUMENTIEREN"|| 606 + text==="ENTSCHEIDEN"|| 607 + text==="START HERE"|| 608 + text==="GET STARTED"|| 609 + text==="ORGANISE & DOCUMENT"|| 610 + text==="ORGANIZE & DOCUMENT"|| 611 + text==="DECIDE" 867 867 ); 868 - 869 - if(!match)return null; 870 - 871 - return [ 872 - Number(match[1]), 873 - Number(match[2]), 874 - Number(match[3]) 875 - ]; 876 876 } 877 877 878 - function distance(a,b){ 879 - return Math.sqrt( 880 - Math.pow(a[0]-b[0],2)+ 881 - Math.pow(a[1]-b[1],2)+ 882 - Math.pow(a[2]-b[2],2) 883 - ); 884 - } 615 + function visuallyFirstSectionBar(card){ 616 + var cardRect=card.getBoundingClientRect(); 617 + var candidates=[]; 885 885 886 - function paletteMatch(cssColor){ 887 - var rgb=parseRGB(cssColor); 888 - 889 - if(!rgb)return null; 890 - 891 - var palette=[ 892 - {hex:"#21b6d7",rgb:[33,182,215]}, 893 - {hex:"#e94b13",rgb:[233,75,19]}, 894 - {hex:"#f0aa00",rgb:[240,170,0]}, 895 - {hex:"#38b76a",rgb:[56,183,106]} 896 - ]; 897 - 898 - var best=null; 899 - var bestDistance=Infinity; 900 - 901 - palette.forEach(function(item){ 902 - var d=distance(rgb,item.rgb); 903 - 904 - if(d<bestDistance){ 905 - best=item; 906 - bestDistance=d; 907 - } 908 - }); 909 - 910 - return bestDistance<=30 911 - ?best 912 - :null; 913 - } 914 - 915 - function propagateDetailAccents(){ 916 - if(PAGE_KIND!=="detail")return; 917 - 918 918 Array.from( 919 - root.querySelectorAll( 920 - ".arsn-call,.dmp-call,.ido-call,.pp-call,"+ 921 - ".arsn-source,.dmp-source,.ido-source,.pp-source" 620 + card.querySelectorAll( 621 + "div,p,span,strong,h3,h4,h5,h6" 922 922 ) 923 923 ).forEach(function(el){ 924 - if(!visible(el))return; 624 + if(!visible(el,20,6))return; 625 + if(excluded(el))return; 925 925 926 - var style=getComputedStyle(el); 627 + var r=el.getBoundingClientRect(); 628 + var relativeTop=r.top-cardRect.top; 927 927 928 928 if( 929 - num(style.borderTopWidth)>=2 631 + relativeTop<45|| 632 + relativeTop>cardRect.height*.72 930 930 ){ 931 - var match= 932 - paletteMatch( 933 - style.borderTopColor 934 - ); 935 - 936 - if(match){ 937 - el.style.setProperty( 938 - "border-left", 939 - "4px solid "+match.hex, 940 - "important" 941 - ); 942 - } 634 + return; 943 943 } 944 - }); 945 945 946 - // Warning families: explicit safety override. 947 - Array.from( 948 - root.querySelectorAll( 949 - ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+ 950 - ".warn,.warning,.warningmessage,.errormessage" 951 - ) 952 - ).forEach(function(el){ 953 - if(!visible(el))return; 637 + var widthRatio= 638 + r.width/ 639 + Math.max(1,cardRect.width); 954 954 955 - el.style.setProperty( 956 - "border-left", 957 - "4px solid #e94b13", 958 - "important" 959 - ); 960 - }); 641 + if( 642 + widthRatio<.55|| 643 + widthRatio>1.05|| 644 + r.height>54 645 + ){ 646 + return; 647 + } 961 961 962 - // Info families: explicit orientation override. 963 - Array.from( 964 - root.querySelectorAll( 965 - ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage" 966 - ) 967 - ).forEach(function(el){ 968 - if(!visible(el))return; 649 + var text=normalizeText(el.textContent); 969 969 970 - el.style.setProperty( 971 - "border-left", 972 - "4px solid #21b6d7", 973 - "important" 974 - ); 975 - }); 976 - } 651 + if( 652 + text.length<2|| 653 + text.length>90 654 + ){ 655 + return; 656 + } 977 977 978 - /* ======================================================= 979 - OVERVIEW SEMANTIC THEME PALETTE 980 - ======================================================= */ 658 + var style=getComputedStyle(el); 981 981 982 - function smallestThemeHeaders(){ 983 - return Array.from( 984 - root.querySelectorAll( 985 - "div,span,p,strong,h3,h4,h5,h6" 986 - ) 987 - ).filter(function(el){ 988 - if(!visible(el))return false; 989 - if(!themeFor(el.textContent))return false; 660 + var bg= 661 + style.backgroundColor&& 662 + style.backgroundColor!=="rgba(0, 0, 0, 0)"&& 663 + style.backgroundColor!=="transparent"; 990 990 991 - return !Array.from( 992 - el.children||[] 993 - ).some(function(child){ 994 - return !!themeFor( 995 - child.textContent 996 - ); 997 - }); 998 - }); 999 - } 1000 - 1001 - function findOverviewCard(header){ 1002 - var node=header.parentElement; 1003 - var candidates=[]; 1004 - 1005 - while(node&&node!==root){ 1006 - var rect=node.getBoundingClientRect(); 1007 - var style=getComputedStyle(node); 1008 - 1009 1009 var border= 1010 1010 num(style.borderTopWidth)+ 1011 1011 num(style.borderRightWidth)+ ... ... @@ -1012,677 +1012,315 @@ 1012 1012 num(style.borderBottomWidth)+ 1013 1013 num(style.borderLeftWidth); 1014 1014 1015 - if( 1016 - rect.width>=220&& 1017 - rect.width<=800&& 1018 - rect.height>=120&& 1019 - border>=1 1020 - ){ 1021 - candidates.push(node); 1022 - } 671 + var mostlyUpper= 672 + text.length>=3&& 673 + text===text.toUpperCase(); 1023 1023 1024 - node=node.parentElement; 1025 - } 675 + var exact=exactKnownFirstSection(el); 1026 1026 1027 - if(!candidates.length)return null; 677 + var score= 678 + (exact?20:0)+ 679 + (bg?6:0)+ 680 + (border>=1?2:0)+ 681 + (mostlyUpper?4:0)+ 682 + (num(style.fontWeight)>=600?1:0); 1028 1028 1029 - candidates.sort(function(a,b){ 1030 - return ( 1031 - b.getBoundingClientRect().height- 1032 - a.getBoundingClientRect().height 1033 - ); 684 + if(score>=7){ 685 + candidates.push({ 686 + el:el, 687 + relativeTop:relativeTop, 688 + width:r.width, 689 + score:score 690 + }); 691 + } 1034 1034 }); 1035 1035 1036 - return candidates[0]; 1037 - } 694 + if(!candidates.length)return null; 1038 1038 1039 - function rowCandidates(link,card){ 1040 - var result=[]; 1041 - var cardRect= 1042 - card.getBoundingClientRect(); 1043 - 1044 - var node=link; 1045 - 1046 - while(node&&node!==card){ 1047 - if(visible(node)){ 1048 - var rect= 1049 - node.getBoundingClientRect(); 1050 - 1051 - if( 1052 - rect.height<=105&& 1053 - rect.width>= 1054 - cardRect.width*.50&& 1055 - rect.width<= 1056 - cardRect.width*1.03 1057 - ){ 1058 - result.push(node); 1059 - } 696 + candidates.sort(function(a,b){ 697 + if(a.score!==b.score)return b.score-a.score; 698 + if(Math.abs(a.relativeTop-b.relativeTop)>3){ 699 + return a.relativeTop-b.relativeTop; 1060 1060 } 701 + return b.width-a.width; 702 + }); 1061 1061 1062 - node=node.parentElement; 1063 - } 704 + // For exact known labels always prefer the earliest exact match. 705 + var exacts=candidates.filter(function(c){ 706 + return exactKnownFirstSection(c.el); 707 + }); 1064 1064 1065 - return result; 1066 - } 1067 - 1068 - function chooseOuterRow( 1069 - candidates, 1070 - link 1071 - ){ 1072 - if(!candidates.length){ 1073 - return link; 709 + if(exacts.length){ 710 + exacts.sort(function(a,b){ 711 + return a.relativeTop-b.relativeTop||b.width-a.width; 712 + }); 713 + return exacts[0].el; 1074 1074 } 1075 1075 1076 - var bordered= 1077 - candidates.filter(function(el){ 1078 - return ( 1079 - num( 1080 - getComputedStyle(el) 1081 - .borderLeftWidth 1082 - )>=1 1083 - ); 1084 - }); 716 + // Generic fallback: earliest high-confidence bar. 717 + candidates.sort(function(a,b){ 718 + return a.relativeTop-b.relativeTop||b.score-a.score||b.width-a.width; 719 + }); 1085 1085 1086 - var pool= 1087 - bordered.length 1088 - ?bordered 1089 - :candidates; 721 + return candidates[0].el; 722 + } 1090 1090 1091 - pool.sort(function(a,b){ 1092 - var ar= 1093 - a.getBoundingClientRect(); 724 + function alignFirstSections(cards){ 725 + var rows= 726 + cards.map(function(card){ 727 + var bar= 728 + visuallyFirstSectionBar(card); 1094 1094 1095 - var br= 1096 - b.getBoundingClientRect(); 730 + if(!bar)return null; 1097 1097 1098 - return ( 1099 - ar.left-br.left|| 1100 - br.width-ar.width 1101 - ); 1102 - }); 732 + var cardRect= 733 + card.getBoundingClientRect(); 1103 1103 1104 - ret urn pool[0]||link;1105 - }735 + var barRect= 736 + bar.getBoundingClientRect(); 1106 1106 1107 - function applyOverviewPalette(){ 1108 - if(PAGE_KIND!=="overview"){ 1109 - return []; 738 + return { 739 + card:card, 740 + bar:bar, 741 + relativeTop: 742 + barRect.top-cardRect.top, 743 + label: 744 + normalizeText(bar.textContent) 745 + }; 746 + }); 747 + 748 + // Conservative: only align when every card in the horizontal row 749 + // has a reliable first section bar. 750 + if( 751 + rows.some(function(row){ 752 + return !row; 753 + }) 754 + ){ 755 + return null; 1110 1110 } 1111 1111 1112 - var headers= 1113 - smallestThemeHeaders() 1114 - .map(function(el){ 1115 - return { 1116 - el:el, 1117 - theme: 1118 - themeFor( 1119 - el.textContent 1120 - ), 1121 - card: 1122 - findOverviewCard( 1123 - el 1124 - ) 1125 - }; 758 + var targetTop= 759 + Math.max.apply( 760 + Math, 761 + rows.map(function(row){ 762 + return row.relativeTop; 1126 1126 }) 1127 - .filter(function(row){ 1128 - return !!row.card; 1129 - }); 764 + ); 1130 1130 1131 - var unique=[]; 1132 - var seenHeaders=new Set(); 766 + rows.forEach(function(row){ 767 + var delta= 768 + targetTop- 769 + row.relativeTop; 1133 1133 1134 - headers.forEach(function(row){ 1135 - var key= 1136 - row.theme.name+ 1137 - "|"+ 1138 - Math.round( 1139 - row.card 1140 - .getBoundingClientRect() 1141 - .left 1142 - )+ 1143 - "|"+ 1144 - Math.round( 1145 - row.el 1146 - .getBoundingClientRect() 1147 - .top 1148 - ); 771 + if(delta<=1)return; 1149 1149 1150 - if(!seenHeaders.has(key)){ 1151 - seenHeaders.add(key); 1152 - unique.push(row); 1153 - } 1154 - }); 1155 - 1156 - unique.forEach(function(row){ 1157 - var headerRect= 1158 - row.el 1159 - .getBoundingClientRect(); 1160 - 1161 - row.el.style.setProperty( 1162 - "background", 1163 - row.theme.bg, 1164 - "important" 773 + saveOriginal( 774 + row.bar, 775 + originalMarginTop, 776 + "margin-top" 1165 1165 ); 1166 1166 1167 - row.el.style.setProperty( 1168 - "color", 1169 - row.theme.text, 1170 - "important" 1171 - ); 779 + var currentMargin= 780 + num( 781 + getComputedStyle( 782 + row.bar 783 + ).marginTop 784 + ); 1172 1172 1173 - row.el.style.setProperty( 1174 - "text-align", 1175 - "left", 1176 - "important" 786 + row.bar.style.setProperty( 787 + "margin-top", 788 + ( 789 + currentMargin+ 790 + delta 791 + )+"px" 1177 1177 ); 1178 1178 1179 - row.el.style.setProperty( 1180 - "word-spacing", 1181 - "normal", 1182 - "important" 794 + row.bar.setAttribute( 795 + "data-sn-first-section-aligned", 796 + "4" 1183 1183 ); 1184 1184 1185 - var later= 1186 - unique 1187 - .filter(function(other){ 1188 - return ( 1189 - other.card===row.card&& 1190 - other.el 1191 - .getBoundingClientRect() 1192 - .top> 1193 - headerRect.top+2 1194 - ); 1195 - }) 1196 - .sort(function(a,b){ 1197 - return ( 1198 - a.el 1199 - .getBoundingClientRect() 1200 - .top- 1201 - b.el 1202 - .getBoundingClientRect() 1203 - .top 1204 - ); 1205 - }); 1206 - 1207 - var stopTop= 1208 - later.length 1209 - ?later[0].el 1210 - .getBoundingClientRect() 1211 - .top 1212 - :Infinity; 1213 - 1214 - Array.from( 1215 - row.card.querySelectorAll("a") 1216 - ).forEach(function(link){ 1217 - if(!visible(link))return; 1218 - 1219 - var rect= 1220 - link.getBoundingClientRect(); 1221 - 1222 - if( 1223 - rect.top<= 1224 - headerRect.bottom-2|| 1225 - rect.top>= 1226 - stopTop-2 1227 - ){ 1228 - return; 1229 - } 1230 - 1231 - var candidates= 1232 - rowCandidates( 1233 - link, 1234 - row.card 1235 - ); 1236 - 1237 - var target= 1238 - chooseOuterRow( 1239 - candidates, 1240 - link 1241 - ); 1242 - 1243 - candidates.forEach(function(el){ 1244 - el.style.setProperty( 1245 - "border-left", 1246 - "0 solid transparent", 1247 - "important" 1248 - ); 1249 - }); 1250 - 1251 - target.style.setProperty( 1252 - "border-left", 1253 - "3px solid "+ 1254 - row.theme.accent, 1255 - "important" 1256 - ); 1257 - 1258 - target.style.setProperty( 1259 - "box-sizing", 1260 - "border-box", 1261 - "important" 1262 - ); 1263 - }); 799 + sectionManaged.add(row.bar); 1264 1264 }); 1265 1265 1266 - return unique; 802 + return { 803 + labels: 804 + rows.map(function(row){ 805 + return row.label; 806 + }), 807 + targetRelativeTop: 808 + Math.round(targetTop) 809 + }; 1267 1267 } 1268 1268 1269 - /* ======================================================= 1270 - OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW 1271 - ======================================================= */ 1272 - 1273 - function alignOverviewCards(headers){ 1274 - if( 1275 - PAGE_KIND!=="overview"|| 1276 - window.innerWidth<=MOBILE_MAX 1277 - ){ 1278 - return; 812 + function applyGroup(group){ 813 + if(!validHorizontalGroup(group)){ 814 + return null; 1279 1279 } 1280 1280 1281 1281 var cards=[]; 1282 1282 var seen=new Set(); 1283 1283 1284 - headers.forEach(function(row){1285 - if(!seen.has(r ow.card)){1286 - seen.add(r ow.card);1287 - cards.push(r ow.card);820 + group.entries.forEach(function(entry){ 821 + if(!seen.has(entry.target)){ 822 + seen.add(entry.target); 823 + cards.push(entry.target); 1288 1288 } 1289 1289 }); 1290 1290 1291 - if(cards.length<2){ 1292 - return; 1293 - } 827 + if(cards.length<2)return null; 1294 1294 1295 - // Groupcardsby actual top position.1296 - vargroups=[];829 + var firstSection= 830 + alignFirstSections(cards); 1297 1297 1298 - cards.forEach(function(card){1299 - vartop=1300 - card.getBoundingClientRect().top;832 + // The section alignment can change natural card heights. 833 + // Measure only afterwards. 834 + var maxHeight=0; 1301 1301 1302 - var group=null; 1303 - 1304 - for(var i=0;i<groups.length;i++){ 1305 - if( 1306 - Math.abs( 1307 - groups[i].top-top 1308 - )<=ROW_TOLERANCE 1309 - ){ 1310 - group=groups[i]; 1311 - break; 1312 - } 1313 - } 1314 - 1315 - if(!group){ 1316 - group={ 1317 - top:top, 1318 - cards:[] 1319 - }; 1320 - groups.push(group); 1321 - } 1322 - 1323 - group.cards.push(card); 836 + cards.forEach(function(card){ 837 + maxHeight=Math.max( 838 + maxHeight, 839 + card.getBoundingClientRect().height 840 + ); 1324 1324 }); 1325 1325 1326 - groups.forEach(function(group){ 1327 - if(group.cards.length<2){ 1328 - return; 1329 - } 843 + maxHeight=Math.ceil(maxHeight); 1330 1330 1331 - var firstHeaders= 1332 - group.cards.map(function(card){ 1333 - var candidates= 1334 - headers 1335 - .filter(function(row){ 1336 - return row.card===card; 1337 - }) 1338 - .sort(function(a,b){ 1339 - return ( 1340 - a.el 1341 - .getBoundingClientRect() 1342 - .top- 1343 - b.el 1344 - .getBoundingClientRect() 1345 - .top 1346 - ); 1347 - }); 845 + if(maxHeight<MIN_H)return null; 1348 1348 1349 - return candidates.length 1350 - ?candidates[0] 1351 - :null; 1352 - }); 847 + cards.forEach(function(card){ 848 + saveOriginal( 849 + card, 850 + originalMinHeight, 851 + "min-height" 852 + ); 1353 1353 1354 - if( 1355 - !firstHeaders.some(function(row){ 1356 - return !row; 1357 - }) 1358 - ){ 1359 - var targetTop= 1360 - Math.max.apply( 1361 - Math, 1362 - firstHeaders.map(function(row){ 1363 - return ( 1364 - row.el 1365 - .getBoundingClientRect() 1366 - .top- 1367 - row.card 1368 - .getBoundingClientRect() 1369 - .top 1370 - ); 1371 - }) 1372 - ); 854 + card.style.setProperty( 855 + "min-height", 856 + maxHeight+"px" 857 + ); 1373 1373 1374 - firstHeaders.forEach(function(row){ 1375 - var relativeTop= 1376 - row.el 1377 - .getBoundingClientRect() 1378 - .top- 1379 - row.card 1380 - .getBoundingClientRect() 1381 - .top; 859 + card.setAttribute( 860 + "data-sn-equal-height-managed", 861 + "4" 862 + ); 1382 1382 1383 - var delta= 1384 - targetTop-relativeTop; 1385 - 1386 - if(delta>1){ 1387 - saveStyle( 1388 - row.el, 1389 - originalMargin, 1390 - "margin-top" 1391 - ); 1392 - 1393 - var current= 1394 - num( 1395 - getComputedStyle( 1396 - row.el 1397 - ).marginTop 1398 - ); 1399 - 1400 - row.el.style.setProperty( 1401 - "margin-top", 1402 - ( 1403 - current+delta 1404 - )+"px" 1405 - ); 1406 - 1407 - row.el.setAttribute( 1408 - "data-sn-master-first-row", 1409 - "1" 1410 - ); 1411 - 1412 - managedMargin.add( 1413 - row.el 1414 - ); 1415 - } 1416 - }); 1417 - } 1418 - 1419 - var maxHeight=0; 1420 - 1421 - group.cards.forEach(function(card){ 1422 - maxHeight= 1423 - Math.max( 1424 - maxHeight, 1425 - card 1426 - .getBoundingClientRect() 1427 - .height 1428 - ); 1429 - }); 1430 - 1431 - maxHeight= 1432 - Math.ceil(maxHeight); 1433 - 1434 - group.cards.forEach(function(card){ 1435 - saveStyle( 1436 - card, 1437 - originalHeight, 1438 - "min-height" 1439 - ); 1440 - 1441 - card.style.setProperty( 1442 - "min-height", 1443 - maxHeight+"px" 1444 - ); 1445 - 1446 - card.setAttribute( 1447 - "data-sn-master-equal-height", 1448 - "1" 1449 - ); 1450 - 1451 - managedHeight.add( 1452 - card 1453 - ); 1454 - }); 864 + heightManaged.add(card); 1455 1455 }); 866 + 867 + return { 868 + cards:cards.length, 869 + height:maxHeight, 870 + firstSection:firstSection 871 + }; 1456 1456 } 1457 1457 1458 - /* ======================================================= 1459 - DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY 1460 - ======================================================= */ 874 + function run(){ 875 + reset(); 1461 1461 1462 - function equaliseDetailGrids(){ 1463 1463 if( 1464 - PAGE_KIND!=="detail"|| 1465 1465 window.innerWidth<=MOBILE_MAX 1466 1466 ){ 1467 1467 return; 1468 1468 } 1469 1469 1470 - var selectors=[ 1471 - ".arsn-grid", 1472 - ".arsn-grid-2", 1473 - ".arsn-grid-3", 1474 - ".dmp-grid", 1475 - ".ido-grid", 1476 - ".pp-grid" 1477 - ]; 1478 - 1479 - selectors.forEach(function(selector){ 883 + var parents= 1480 1480 Array.from( 1481 - root.querySelectorAll(selector) 1482 - ).forEach(function(grid){ 1483 - var children= 1484 - Array.from( 1485 - grid.children||[] 1486 - ).filter(visible); 885 + root.querySelectorAll("*") 886 + ).filter(function(parent){ 887 + return ( 888 + visible(parent,MIN_W,MIN_H)&& 889 + parent.children&& 890 + parent.children.length>=2&& 891 + parent.children.length<=MAX_PARENT_CHILDREN 892 + ); 893 + }); 1487 1487 1488 - if(children.length<2){ 1489 - return; 1490 - } 895 + var touched=new Set(); 1491 1491 1492 - var groups=[]; 897 + parents.forEach(function(parent){ 898 + var entries=[]; 1493 1493 1494 - children.forEach(function(child){ 1495 - var top= 1496 - child 1497 - .getBoundingClientRect() 1498 - .top; 900 + Array.from(parent.children).forEach(function(child){ 901 + if(!visible(child,MIN_W,MIN_H))return; 1499 1499 1500 - var group=null; 903 + var target=pickTarget(child); 904 + if(!target)return; 1501 1501 1502 - for(var i=0;i<groups.length;i++){ 1503 - if( 1504 - Math.abs( 1505 - groups[i].top-top 1506 - )<=ROW_TOLERANCE 1507 - ){ 1508 - group=groups[i]; 1509 - break; 1510 - } 1511 - } 1512 - 1513 - if(!group){ 1514 - group={ 1515 - top:top, 1516 - items:[] 1517 - }; 1518 - groups.push(group); 1519 - } 1520 - 1521 - group.items.push(child); 906 + entries.push({ 907 + target:target, 908 + rect:target.getBoundingClientRect() 1522 1522 }); 910 + }); 1523 1523 1524 - groups.forEach(function(group){ 1525 - if(group.items.length<2){ 1526 - return; 1527 - } 912 + if(entries.length<2)return; 1528 1528 1529 - var maxHeight=0; 914 + groupsByVisualRow(entries).forEach(function(group){ 915 + if(!validHorizontalGroup(group))return; 1530 1530 1531 - group.items.forEach(function(item){ 1532 - maxHeight= 1533 - Math.max( 1534 - maxHeight, 1535 - item 1536 - .getBoundingClientRect() 1537 - .height 1538 - ); 917 + var signature= 918 + group.entries.map(function(entry){ 919 + return entry.target; 1539 1539 }); 1540 1540 1541 - maxHeight= 1542 - Math.ceil(maxHeight); 922 + if( 923 + !signature.some(function(el){ 924 + return !touched.has(el); 925 + }) 926 + ){ 927 + return; 928 + } 1543 1543 1544 - group.items.forEach(function(item){ 1545 - saveStyle( 1546 - item, 1547 - originalHeight, 1548 - "min-height" 1549 - ); 930 + var applied= 931 + applyGroup(group); 1550 1550 1551 - item.style.setProperty( 1552 - "min-height", 1553 - maxHeight+"px" 1554 - ); 1555 - 1556 - item.setAttribute( 1557 - "data-sn-master-equal-height", 1558 - "1" 1559 - ); 1560 - 1561 - managedHeight.add(item); 933 + if(applied){ 934 + signature.forEach(function(el){ 935 + touched.add(el); 1562 1562 }); 1563 - } );937 + } 1564 1564 }); 1565 1565 }); 1566 1566 } 1567 1567 1568 - /* ======================================================= 1569 - RUN / RESPONSIVE SCHEDULING 1570 - ======================================================= */ 942 + function schedule(){ 943 + if(raf)cancelAnimationFrame(raf); 1571 1571 1572 - function run(){ 1573 - if(running)return; 1574 - 1575 - running=true; 1576 - 1577 - try{ 1578 - resetRuntime(); 1579 - applyPlaceholderBadge(); 1580 - propagateDetailAccents(); 1581 - 1582 - var headers= 1583 - applyOverviewPalette(); 1584 - 1585 - makeThreeLineAreaLabels(); 1586 - makeFilledRedOrangeCTAsBorderless(); 1587 - 1588 - if( 1589 - window.innerWidth> 1590 - MOBILE_MAX 1591 - ){ 1592 - alignOverviewCards( 1593 - headers 1594 - ); 1595 - 1596 - equaliseDetailGrids(); 1597 - } 1598 - }finally{ 1599 - running=false; 1600 - } 945 + raf=requestAnimationFrame(function(){ 946 + raf=requestAnimationFrame(function(){ 947 + raf=0; 948 + run(); 949 + }); 950 + }); 1601 1601 } 1602 1602 1603 - function onResize(){ 1604 - if(resizeTimer){ 1605 - clearTimeout( 1606 - resizeTimer 1607 - ); 1608 - } 953 + addEventListener("resize",schedule,{passive:true}); 954 + addEventListener("load",schedule,{once:true}); 1609 1609 1610 - resizeTimer= 1611 - setTimeout( 1612 - function(){ 1613 - resizeTimer=0; 1614 - run(); 1615 - }, 1616 - RESIZE_DEBOUNCE 1617 - ); 1618 - } 956 + root.addEventListener( 957 + "click", 958 + function(){ 959 + setTimeout(schedule,0); 960 + }, 961 + true 962 + ); 1619 1619 1620 - async function waitForReady(){ 1621 - if( 1622 - document.readyState!=="complete" 1623 - ){ 1624 - await new Promise(function(resolve){ 1625 - window.addEventListener( 1626 - "load", 1627 - resolve, 1628 - {once:true} 1629 - ); 1630 - }); 964 + Array.from(root.querySelectorAll("img")).forEach(function(img){ 965 + if(!img.complete){ 966 + img.addEventListener("load",schedule,{once:true}); 1631 1631 } 968 + }); 1632 1632 1633 - if( 1634 - document.fonts&& 1635 - document.fonts.ready 1636 - ){ 1637 - try{ 1638 - await document.fonts.ready; 1639 - }catch(error){} 1640 - } 1641 - 1642 - var images= 1643 - Array.from( 1644 - root.querySelectorAll("img") 1645 - ); 1646 - 1647 - await Promise.all( 1648 - images.map(function(img){ 1649 - if(img.complete){ 1650 - return Promise.resolve(); 1651 - } 1652 - 1653 - return new Promise(function(resolve){ 1654 - var done=function(){ 1655 - resolve(); 1656 - }; 1657 - 1658 - img.addEventListener( 1659 - "load", 1660 - done, 1661 - {once:true} 1662 - ); 1663 - 1664 - img.addEventListener( 1665 - "error", 1666 - done, 1667 - {once:true} 1668 - ); 1669 - }); 1670 - }) 1671 - ); 1672 - 1673 - run(); 970 + if(document.fonts&&document.fonts.ready){ 971 + document.fonts.ready.then(schedule); 1674 1674 } 1675 1675 1676 - window.addEventListener( 1677 - "resize", 1678 - onResize, 1679 - {passive:true} 1680 - ); 1681 - 1682 - waitForReady(); 974 + schedule(); 975 + setTimeout(schedule,200); 976 + setTimeout(schedule,650); 977 + setTimeout(schedule,1400); 1683 1683 })(); 1684 1684 </script> 1685 - 1686 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END --> 980 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_END --> 1687 1687 {{/html}} 1688 1688