Changes for page Prepare
Last modified by Veronika Kocher on Friday, 18 Sep 2026 16:47
From version 29.9
edited by Veronika Kocher
on Thursday, 03 Sep 2026 10:09
on Thursday, 03 Sep 2026 10:09
Change comment:
There is no comment for this version
To version 29.11
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
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -485,12 +485,13 @@ 485 485 </div> 486 486 {{/html}} 487 487 488 -\n\n 489 -\n\n{{html clean="false"}} 490 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START --> 488 +{{html clean="false"}} 489 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START --> 491 491 492 -<style data-sn-horizontal-box-harmonizer="7"> 493 -/* ---------- Typography: never justify headings ---------- */ 491 +<style data-sn-service-navigator-master="1"> 492 +/* ========================================================= 493 + MASTER TYPOGRAPHY 494 + ========================================================= */ 494 494 #xwikicontent h1, 495 495 #xwikicontent h2, 496 496 #xwikicontent h3, ... ... @@ -512,88 +512,105 @@ 512 512 word-spacing:normal!important; 513 513 } 514 514 515 -/* ---------- Native XWiki semantic callouts ---------- */ 516 -#xwikicontent .box.infomessage, 517 -#xwikicontent .infomessage, 518 -#xwikicontent .box.warningmessage, 519 -#xwikicontent .warningmessage, 520 -#xwikicontent .box.successmessage, 521 -#xwikicontent .successmessage, 522 -#xwikicontent .box.errormessage, 523 -#xwikicontent .errormessage, 524 -#xwikicontent [data-sn-callout-harmonized="1"]{ 516 +/* ========================================================= 517 + COMING SOON / IN VORBEREITUNG 518 + ========================================================= */ 519 +.sn-coming-soon-badge{ 520 + display:inline-block; 521 + vertical-align:middle; 522 + margin-left:10px; 523 + padding:4px 8px; 524 + border-radius:14px; 525 + border:1px solid #efd9cc; 526 + background:#fff4ee; 527 + color:#8a4d36; 528 + font-size:11px; 529 + font-weight:700; 530 + letter-spacing:.055em; 531 + line-height:1.2; 532 + white-space:nowrap; 533 +} 534 + 535 +/* ========================================================= 536 + NATIVE / DETAIL CALLOUT GEOMETRY 537 + Preserve existing backgrounds. 538 + ========================================================= */ 539 +#xwikicontent .arsn-info, 540 +#xwikicontent .dmp-info, 541 +#xwikicontent .ido-info, 542 +#xwikicontent .pp-info, 543 +#xwikicontent .infomessage{ 525 525 box-sizing:border-box!important; 526 - border-radius:8px!important; 527 - border-top:1px solid rgba(0,0,0,.08)!important; 528 - border-right:1px solid rgba(0,0,0,.08)!important; 529 - border-bottom:1px solid rgba(0,0,0,.08)!important; 530 - border-left:4px solid var(--sn-callout-accent,#21b6d7)!important; 531 - padding:14px 16px!important; 545 + border-left:4px solid #21b6d7!important; 546 + border-radius:8px; 532 532 text-align:left!important; 533 - text-justify:auto!important; 534 534 word-spacing:normal!important; 535 - box-shadow:none!important; 536 536 } 537 537 538 -#xwikicontent .box.infomessage, 539 -#xwikicontent .infomessage{ 540 - --sn-callout-accent:#21b6d7; 541 - background:#eaf7fb!important; 542 -} 543 - 544 -#xwikicontent .box.warningmessage, 545 -#xwikicontent .warningmessage{ 546 - --sn-callout-accent:#f0aa00; 547 - background:#fff8e7!important; 548 -} 549 - 550 -#xwikicontent .box.successmessage, 551 -#xwikicontent .successmessage{ 552 - --sn-callout-accent:#38b76a; 553 - background:#edf9f1!important; 554 -} 555 - 556 -#xwikicontent .box.errormessage, 551 +#xwikicontent .arsn-warn, 552 +#xwikicontent .dmp-warn, 553 +#xwikicontent .ido-warn, 554 +#xwikicontent .pp-warn, 555 +#xwikicontent .warn, 556 +#xwikicontent .warning, 557 +#xwikicontent .warningmessage, 557 557 #xwikicontent .errormessage{ 558 - --sn-callout-accent:#e94b13; 559 - background:#fff1ec!important; 559 + box-sizing:border-box!important; 560 + border-left:4px solid #e94b13!important; 561 + border-radius:8px; 562 + text-align:left!important; 563 + word-spacing:normal!important; 560 560 } 561 561 562 -#xwikicontent [data-sn-callout-harmonized="1"] > :first-child, 563 -#xwikicontent .infomessage > :first-child, 564 -#xwikicontent .warningmessage > :first-child, 565 -#xwikicontent .successmessage > :first-child, 566 -#xwikicontent .errormessage > :first-child{ 567 - margin-top:0!important; 566 +[data-sn-master-equal-height], 567 +[data-sn-master-first-row]{ 568 + box-sizing:border-box; 568 568 } 569 569 570 -#xwikicontent [data-sn-callout-harmonized="1"] > :last-child, 571 -#xwikicontent .infomessage > :last-child, 572 -#xwikicontent .warningmessage > :last-child, 573 -#xwikicontent .successmessage > :last-child, 574 -#xwikicontent .errormessage > :last-child{ 575 - margin-bottom:0!important; 571 +/* ========================================================= 572 + FULL-WIDTH THREE-LINE NUMBER / TITLE / SUBTITLE BLOCKS 573 + ========================================================= */ 574 +#xwikicontent .arsn-area-label[data-sn-three-line="1"]{ 575 + display:grid!important; 576 + grid-template-columns:minmax(0,1fr)!important; 577 + grid-auto-rows:auto!important; 578 + width:100%!important; 579 + max-width:none!important; 580 + box-sizing:border-box!important; 581 + justify-items:start!important; 582 + align-items:start!important; 583 + gap:2px!important; 584 + text-align:left!important; 585 + text-align-last:left!important; 586 + text-justify:auto!important; 587 + word-spacing:normal!important; 588 + white-space:normal!important; 576 576 } 577 - 578 -#xwikicontent [data-sn-equal-height-managed], 579 -#xwikicontent [data-sn-first-section-aligned], 580 -#xwikicontent [data-sn-first-content-aligned]{ 581 - box-sizing:border-box; 590 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-number, 591 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .sn-area-label-title, 592 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-action{ 593 + display:block!important; 594 + width:100%!important; 595 + margin:0!important; 596 + text-align:left!important; 597 + text-align-last:left!important; 598 + text-justify:auto!important; 599 + word-spacing:normal!important; 600 + white-space:normal!important; 582 582 } 583 583 </style> 584 584 585 -<script data-sn- horizontal-box-harmonizer="7">604 +<script data-sn-service-navigator-master="1"> 586 586 (function(){ 587 587 "use strict"; 588 588 608 + var PAGE_KIND="overview"; 609 + var PLACEHOLDER=false; 610 + var PLACEHOLDER_LABEL="COMING SOON"; 611 + 589 589 var MOBILE_MAX=767; 590 590 var ROW_TOLERANCE=6; 591 - var MIN_W=150; 592 - var MIN_H=36; 593 - var MAX_PARENT_CHILDREN=18; 594 - var SEARCH_DEPTH=5; 595 595 var RESIZE_DEBOUNCE=220; 596 - var MIN_WIDTH_CHANGE=2; 597 597 598 598 var root= 599 599 document.getElementById("xwikicontent")|| ... ... @@ -603,142 +603,114 @@ 603 603 604 604 if(!root)return; 605 605 606 - var heightManaged=new Set(); 607 - var sectionManaged=new Set(); 608 - var contentManaged=new Set(); 624 + var managedHeight=new Set(); 625 + var managedMargin=new Set(); 626 + var originalHeight=new WeakMap(); 627 + var originalMargin=new WeakMap(); 609 609 610 - var originalMinHeight=new WeakMap(); 611 - var originalMarginTop=new WeakMap(); 612 - 613 613 var resizeTimer=0; 614 - var lastWidth=-1; 615 - var hasApplied=false; 616 - var applying=false; 630 + var running=false; 617 617 618 - function num(v){ 619 - var n=parseFloat(v); 620 - return Number.isFinite(n)?n:0; 621 - } 622 - 623 - function visible(el,minW,minH){ 624 - if(!el||el.nodeType!==1)return false; 625 - 626 - var s=getComputedStyle(el); 627 - 628 - if( 629 - s.display==="none"|| 630 - s.visibility==="hidden"|| 631 - Number(s.opacity)===0 632 - ){ 633 - return false; 632 + var THEMES=[ 633 + { 634 + name:"BLUE", 635 + accent:"#21b6d7", 636 + bg:"#eaf7fb", 637 + text:"#315d68", 638 + labels:[ 639 + "HIER STARTEN", 640 + "ENTSCHEIDEN", 641 + "ÜBERPRÜFEN & ANPASSEN", 642 + "START HERE", 643 + "DECIDE", 644 + "REVIEW & ADAPT" 645 + ] 646 + }, 647 + { 648 + name:"RED", 649 + accent:"#e94b13", 650 + bg:"#fff1ec", 651 + text:"#8a4d36", 652 + labels:[ 653 + "PLANEN & ORGANISIEREN", 654 + "ORGANISIEREN & DOKUMENTIEREN", 655 + "PUBLIZIEREN & PRÄSENTIEREN", 656 + "PLAN & ORGANISE", 657 + "PLAN & ORGANIZE", 658 + "ORGANISE & DOCUMENT", 659 + "ORGANIZE & DOCUMENT", 660 + "PUBLISH & PRESENT" 661 + ] 662 + }, 663 + { 664 + name:"YELLOW", 665 + accent:"#f0aa00", 666 + bg:"#fff8e7", 667 + text:"#785b17", 668 + labels:[ 669 + "SCHÜTZEN & KLÄREN", 670 + "STANDARDISIEREN & IDENTIFIZIEREN", 671 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN", 672 + "PROTECT & CLARIFY", 673 + "STANDARDISE & IDENTIFY", 674 + "STANDARDIZE & IDENTIFY", 675 + "OPEN, REUSE & MAKE FINDABLE" 676 + ] 677 + }, 678 + { 679 + name:"GREEN", 680 + accent:"#38b76a", 681 + bg:"#edf9f1", 682 + text:"#3f7451", 683 + labels:[ 684 + "INFRASTRUKTUR EINRICHTEN", 685 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN", 686 + "SPEICHERN & ZUGRIFF STEUERN", 687 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN", 688 + "SET UP INFRASTRUCTURE", 689 + "SET UP INFRASTRUCTURE & COLLABORATION", 690 + "STORE & CONTROL ACCESS", 691 + "REPOSITORY, PRESERVE & HAND OVER" 692 + ] 634 634 } 694 + ]; 635 635 636 - var r=el.getBoundingClientRect(); 637 - 638 - return ( 639 - r.width>=(minW||1)&& 640 - r.height>=(minH||1) 641 - ); 696 + function num(value){ 697 + var n=parseFloat(value); 698 + return Number.isFinite(n)?n:0; 642 642 } 643 643 644 - function normal izeText(text){645 - return String( text||"")701 + function norm(value){ 702 + return String(value||"") 646 646 .replace(/\s+/g," ") 647 647 .trim() 648 648 .toUpperCase(); 649 649 } 650 650 651 - function excluded(el){ 652 - return ( 653 - !el.matches|| 654 - el.matches( 655 - "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]" 656 - ) 657 - ); 658 - } 708 + function visible(el){ 709 + if(!el||el.nodeType!==1)return false; 659 659 660 - /* ---------- Custom coloured callouts ---------- */ 711 + var style=getComputedStyle(el); 712 + var rect=el.getBoundingClientRect(); 661 661 662 - function nativeCallout(el){ 663 - var c= 664 - typeof el.className==="string" 665 - ? el.className.toLowerCase() 666 - : ""; 667 - 668 668 return ( 669 - /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c) 715 + style.display!=="none"&& 716 + style.visibility!=="hidden"&& 717 + rect.width>20&& 718 + rect.height>4 670 670 ); 671 671 } 672 672 673 - function customCallout(el){ 674 - if(!visible(el,220,42)||excluded(el))return false; 675 - 676 - var r=el.getBoundingClientRect(); 677 - 678 - if(r.height>520)return false; 679 - 680 - var s=getComputedStyle(el); 681 - 682 - var bg= 683 - s.backgroundColor&& 684 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&& 685 - s.backgroundColor!=="transparent"&& 686 - s.backgroundColor!=="rgb(255, 255, 255)"; 687 - 688 - var left= 689 - num(s.borderLeftWidth); 690 - 691 - return ( 692 - bg&& 693 - left>=2 694 - ); 695 - } 696 - 697 - function harmoniseCustomCallouts(){ 698 - Array.from( 699 - root.querySelectorAll( 700 - "div,aside,section" 701 - ) 702 - ).forEach(function(el){ 703 - if(nativeCallout(el))return; 704 - if(!customCallout(el))return; 705 - 706 - var s=getComputedStyle(el); 707 - 708 - el.setAttribute( 709 - "data-sn-callout-harmonized", 710 - "1" 711 - ); 712 - 713 - if( 714 - s.borderLeftColor 715 - ){ 716 - el.style.setProperty( 717 - "--sn-callout-accent", 718 - s.borderLeftColor 719 - ); 720 - } 721 - }); 722 - } 723 - 724 - /* ---------- Restore only values V7 itself changed ---------- */ 725 - 726 - function saveOriginal(el,map,property){ 722 + function saveStyle(el,map,property){ 727 727 if(map.has(el))return; 728 728 729 729 map.set(el,{ 730 - value: 731 - el.style.getPropertyValue( 732 - property 733 - ), 734 - priority: 735 - el.style.getPropertyPriority( 736 - property 737 - ) 726 + value:el.style.getPropertyValue(property), 727 + priority:el.style.getPropertyPriority(property) 738 738 }); 739 739 } 740 740 741 - function restore Original(el,map,property){731 + function restoreStyle(el,map,property){ 742 742 var original=map.get(el); 743 743 744 744 if(original&&original.value){ ... ... @@ -748,770 +748,1069 @@ 748 748 original.priority||"" 749 749 ); 750 750 }else{ 751 - el.style.removeProperty( 752 - property 753 - ); 741 + el.style.removeProperty(property); 754 754 } 755 755 } 756 756 757 757 function resetRuntime(){ 758 - heightManaged.forEach(function(el){759 - restore Original(746 + managedHeight.forEach(function(el){ 747 + restoreStyle( 760 760 el, 761 - original MinHeight,749 + originalHeight, 762 762 "min-height" 763 763 ); 764 - 765 765 el.removeAttribute( 766 - "data-sn-equal-height -managed"753 + "data-sn-master-equal-height" 767 767 ); 768 768 }); 769 769 770 - sectionManaged.forEach(function(el){771 - restore Original(757 + managedMargin.forEach(function(el){ 758 + restoreStyle( 772 772 el, 773 - originalMargin Top,760 + originalMargin, 774 774 "margin-top" 775 775 ); 776 - 777 777 el.removeAttribute( 778 - "data-sn-first- section-aligned"764 + "data-sn-master-first-row" 779 779 ); 780 780 }); 781 781 782 - contentManaged.forEach(function(el){ 783 - restoreOriginal( 784 - el, 785 - originalMarginTop, 786 - "margin-top" 787 - ); 768 + managedHeight.clear(); 769 + managedMargin.clear(); 770 + } 788 788 789 - el.removeAttribute( 790 - "data-sn-first-content-aligned" 791 - ); 792 - }); 772 + function themeFor(text){ 773 + var value=norm(text); 793 793 794 - heightManaged.clear(); 795 - sectionManaged.clear(); 796 - contentManaged.clear(); 797 - } 775 + for(var i=0;i<THEMES.length;i++){ 776 + for(var j=0;j<THEMES[i].labels.length;j++){ 777 + var label=THEMES[i].labels[j]; 798 798 799 - /* ---------- Card detection ---------- */ 779 + if( 780 + value===label|| 781 + value.indexOf(label+" ")===0|| 782 + value.indexOf(label+" -")===0|| 783 + value.indexOf(label+" ·")===0 784 + ){ 785 + return THEMES[i]; 786 + } 787 + } 788 + } 800 800 801 - function namedLikeBox(el){ 802 - var c= 803 - typeof el.className==="string" 804 - ? el.className 805 - : ""; 790 + return null; 791 + } 806 806 807 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c); 793 + /* ======================================================= 794 + BORDERLESS FILLED RED/ORANGE CTA BUTTONS 795 + ======================================================= */ 796 + 797 + function colourDistance(a,b){ 798 + return Math.sqrt( 799 + Math.pow(a[0]-b[0],2)+ 800 + Math.pow(a[1]-b[1],2)+ 801 + Math.pow(a[2]-b[2],2) 802 + ); 808 808 } 809 809 810 - function boxLike(el){ 811 - if( 812 - !visible(el,MIN_W,MIN_H)|| 813 - excluded(el) 814 - ){ 815 - return false; 816 - } 805 + function makeFilledRedOrangeCTAsBorderless(){ 806 + var RED_ORANGE=[233,75,19]; 817 817 818 - var s=getComputedStyle(el); 819 - var r=el.getBoundingClientRect(); 808 + Array.from( 809 + root.querySelectorAll( 810 + 'a,button,[role="button"],input[type="submit"],input[type="button"]' 811 + ) 812 + ).forEach(function(el){ 813 + if(!visible(el))return; 820 820 821 - var border= 822 - num(s.borderTopWidth)+ 823 - num(s.borderRightWidth)+ 824 - num(s.borderBottomWidth)+ 825 - num(s.borderLeftWidth); 815 + var style=getComputedStyle(el); 816 + var rgb=parseRGB(style.backgroundColor); 826 826 827 - var radius=Math.max( 828 - num(s.borderTopLeftRadius), 829 - num(s.borderTopRightRadius), 830 - num(s.borderBottomLeftRadius), 831 - num(s.borderBottomRightRadius) 832 - ); 818 + if(!rgb)return; 833 833 834 - var bg= 835 - s.backgroundColor&& 836 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&& 837 - s.backgroundColor!=="transparent"; 820 + if( 821 + colourDistance( 822 + rgb, 823 + RED_ORANGE 824 + )>55 825 + ){ 826 + return; 827 + } 838 838 839 - var shadow= 840 - s.boxShadow&& 841 - s.boxShadow!=="none"; 829 + var rect=el.getBoundingClientRect(); 842 842 843 - return ( 844 - namedLikeBox(el)|| 845 - border>=1|| 846 - (bg&&radius>=3)|| 847 - (shadow&&r.width>=180) 848 - ); 849 - } 831 + if( 832 + rect.width<80|| 833 + rect.height<24 834 + ){ 835 + return; 836 + } 850 850 851 - function pickTarget(child){ 852 - if(!visible(child,MIN_W,MIN_H))return null; 838 + el.style.setProperty( 839 + "border", 840 + "none", 841 + "important" 842 + ); 853 853 854 - if(boxLike(child))return child; 844 + el.style.setProperty( 845 + "border-left", 846 + "none", 847 + "important" 848 + ); 855 855 856 - var cr=child.getBoundingClientRect(); 857 - var q=[]; 850 + el.style.setProperty( 851 + "border-top", 852 + "none", 853 + "important" 854 + ); 858 858 859 - Array.from(child.children||[]).forEach(function(el){ 860 - q.push({el:el,depth:1}); 856 + el.style.setProperty( 857 + "border-right", 858 + "none", 859 + "important" 860 + ); 861 + 862 + el.style.setProperty( 863 + "border-bottom", 864 + "none", 865 + "important" 866 + ); 867 + 868 + el.style.setProperty( 869 + "box-shadow", 870 + "none", 871 + "important" 872 + ); 861 861 }); 874 + } 862 862 863 - var best=null; 864 - var bestScore=-Infinity; 876 + /* ======================================================= 877 + FULL-WIDTH THREE-LINE AREA LABELS 878 + ======================================================= */ 865 865 866 - while(q.length){ 867 - var item=q.shift(); 868 - var el=item.el; 880 + function compactText(value){ 881 + return String(value||"") 882 + .replace(/\s+/g," ") 883 + .trim(); 884 + } 869 869 870 - if(!visible(el,MIN_W,MIN_H))continue; 886 + function makeThreeLineAreaLabels(){ 887 + Array.from( 888 + root.querySelectorAll( 889 + ".arsn-area-label" 890 + ) 891 + ).forEach(function(label){ 892 + if( 893 + label.getAttribute( 894 + "data-sn-three-line" 895 + )==="1" 896 + ){ 897 + return; 898 + } 871 871 872 - var r=el.getBoundingClientRect(); 900 + var number= 901 + label.querySelector( 902 + ":scope > .arsn-area-number" 903 + ); 873 873 905 + var action= 906 + label.querySelector( 907 + ":scope > .arsn-area-action" 908 + ); 909 + 874 874 if( 875 - r .width>=cr.width*.68&&876 - boxLike(el)911 + !number|| 912 + !action 877 877 ){ 878 - var widthFit= 879 - 1-Math.min( 880 - 1, 881 - Math.abs(cr.width-r.width)/ 882 - Math.max(1,cr.width) 883 - ); 914 + return; 915 + } 884 884 885 - var topFit= 886 - 1-Math.min( 887 - 1, 888 - Math.abs(cr.top-r.top)/100 889 - ); 917 + var clone= 918 + label.cloneNode(true); 890 890 891 - var score= 892 - widthFit*6+ 893 - topFit*3+ 894 - Math.min(r.height,900)/450+ 895 - Math.min(r.width*r.height,900000)/900000; 920 + var cloneNumber= 921 + clone.querySelector( 922 + ":scope > .arsn-area-number" 923 + ); 896 896 897 - if(score>bestScore){ 898 - best=el; 899 - bestScore=score; 900 - } 925 + var cloneAction= 926 + clone.querySelector( 927 + ":scope > .arsn-area-action" 928 + ); 929 + 930 + if(cloneNumber){ 931 + cloneNumber.remove(); 901 901 } 902 902 903 - if(item.depth<SEARCH_DEPTH){ 904 - Array.from(el.children||[]).forEach(function(next){ 905 - q.push({ 906 - el:next, 907 - depth:item.depth+1 908 - }); 909 - }); 934 + if(cloneAction){ 935 + cloneAction.remove(); 910 910 } 911 - } 912 912 913 - return best; 914 - } 938 + var titleText= 939 + compactText( 940 + clone.textContent 941 + ); 915 915 916 - function groupRows(entries){ 917 - var groups=[]; 943 + if(!titleText){ 944 + return; 945 + } 918 918 919 - entries 920 - .slice() 921 - .sort(function(a,b){ 922 - return ( 923 - a.rect.top-b.rect.top|| 924 - a.rect.left-b.rect.left 947 + var numberNode= 948 + number.cloneNode(true); 949 + 950 + var actionNode= 951 + action.cloneNode(true); 952 + 953 + var titleNode= 954 + document.createElement( 955 + "span" 925 925 ); 926 - }) 927 - .forEach(function(entry){ 928 - var group=null; 929 929 930 - for(var i=0;i<groups.length;i++){ 931 - if( 932 - Math.abs( 933 - groups[i].top- 934 - entry.rect.top 935 - )<=ROW_TOLERANCE 936 - ){ 937 - group=groups[i]; 938 - break; 939 - } 940 - } 958 + titleNode.className= 959 + "sn-area-label-title"; 941 941 942 - if(!group){ 943 - group={ 944 - top:entry.rect.top, 945 - entries:[] 946 - }; 947 - groups.push(group); 948 - } 961 + titleNode.textContent= 962 + titleText; 949 949 950 - group.entries.push(entry); 951 - }); 964 + while(label.firstChild){ 965 + label.removeChild( 966 + label.firstChild 967 + ); 968 + } 952 952 953 - return groups; 970 + label.appendChild( 971 + numberNode 972 + ); 973 + 974 + label.appendChild( 975 + titleNode 976 + ); 977 + 978 + label.appendChild( 979 + actionNode 980 + ); 981 + 982 + label.setAttribute( 983 + "data-sn-three-line", 984 + "1" 985 + ); 986 + 987 + var head= 988 + label.closest( 989 + ".arsn-area-head" 990 + ); 991 + 992 + if(head){ 993 + head.style.setProperty( 994 + "width", 995 + "100%", 996 + "important" 997 + ); 998 + 999 + head.style.setProperty( 1000 + "max-width", 1001 + "100%", 1002 + "important" 1003 + ); 1004 + 1005 + head.style.setProperty( 1006 + "box-sizing", 1007 + "border-box", 1008 + "important" 1009 + ); 1010 + } 1011 + }); 954 954 } 955 955 956 - function validRow(group){ 957 - if(group.entries.length<2)return false; 1014 + /* ======================================================= 1015 + PLACEHOLDER BADGE 1016 + ======================================================= */ 958 958 959 - var lefts= 960 - group.entries 961 - .map(function(e){return e.rect.left;}) 962 - .sort(function(a,b){return a-b;}); 1018 + function applyPlaceholderBadge(){ 1019 + if(!PLACEHOLDER)return; 963 963 964 964 if( 965 - lefts[lefts.length-1]-966 - lefts[0]<967 - 801022 + document.querySelector( 1023 + ".sn-coming-soon-badge" 1024 + ) 968 968 ){ 969 - return false;1026 + return; 970 970 } 971 971 972 - var widths= 973 - group.entries 974 - .map(function(e){return e.rect.width;}) 975 - .filter(function(w){return w>0;}); 1029 + var title= 1030 + document.querySelector( 1031 + "#document-title" 1032 + )|| 1033 + document.querySelector( 1034 + "h1" 1035 + ); 976 976 977 - if( widths.length<2)returnfalse;1037 + if(!title)return; 978 978 979 - var minW= 980 - Math.min.apply(Math,widths); 1039 + var badge= 1040 + document.createElement( 1041 + "span" 1042 + ); 981 981 982 - var maxW=983 - Math.max.apply(Math,widths);1044 + badge.className= 1045 + "sn-coming-soon-badge"; 984 984 985 - return ( 986 - maxW/ 987 - Math.max(1,minW)<= 988 - 1.9 1047 + badge.textContent= 1048 + PLACEHOLDER_LABEL; 1049 + 1050 + badge.setAttribute( 1051 + "aria-label", 1052 + PLACEHOLDER_LABEL 989 989 ); 990 - } 991 991 992 - /* ---------- Known ARSN first section bars ---------- */ 993 - 994 - function knownBar(el){ 995 - var text= 996 - normalizeText( 997 - el.textContent 998 - ); 999 - 1000 - return ( 1001 - text==="HIER STARTEN"|| 1002 - text==="ORGANISIEREN & DOKUMENTIEREN"|| 1003 - text==="ENTSCHEIDEN"|| 1004 - text==="START HERE"|| 1005 - text==="GET STARTED"|| 1006 - text==="ORGANISE & DOCUMENT"|| 1007 - text==="ORGANIZE & DOCUMENT"|| 1008 - text==="DECIDE" 1055 + title.appendChild( 1056 + badge 1009 1009 ); 1010 1010 } 1011 1011 1012 - functionfindKnownBar(card){1013 - varcardRect=1014 - card.getBoundingClientRect();1060 + /* ======================================================= 1061 + DETAIL PAGE OWN-ACCENT PROPAGATION 1062 + ======================================================= */ 1015 1015 1016 - var rows= 1017 - Array.from( 1018 - card.querySelectorAll( 1019 - "div,p,span,strong,h3,h4,h5,h6" 1020 - ) 1021 - ) 1022 - .filter(function(el){ 1023 - if(!visible(el,20,6))return false; 1024 - if(!knownBar(el))return false; 1064 + function parseRGB(value){ 1065 + var match=String(value||"").match( 1066 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i 1067 + ); 1025 1025 1026 - varr=el.getBoundingClientRect();1069 + if(!match)return null; 1027 1027 1028 - var rel= 1029 - r.top- 1030 - cardRect.top; 1071 + return [ 1072 + Number(match[1]), 1073 + Number(match[2]), 1074 + Number(match[3]) 1075 + ]; 1076 + } 1031 1031 1032 - return ( 1033 - rel>=35&& 1034 - rel<= 1035 - cardRect.height*.75 1036 - ); 1037 - }) 1038 - .sort(function(a,b){ 1039 - return ( 1040 - a.getBoundingClientRect().top- 1041 - b.getBoundingClientRect().top 1042 - ); 1043 - }); 1044 - 1045 - return rows[0]||null; 1078 + function distance(a,b){ 1079 + return Math.sqrt( 1080 + Math.pow(a[0]-b[0],2)+ 1081 + Math.pow(a[1]-b[1],2)+ 1082 + Math.pow(a[2]-b[2],2) 1083 + ); 1046 1046 } 1047 1047 1048 - function alignKnownBars(cards){ 1049 - var rows= 1050 - cards.map(function(card){ 1051 - var bar= 1052 - findKnownBar(card); 1086 + function paletteMatch(cssColor){ 1087 + var rgb=parseRGB(cssColor); 1053 1053 1054 - if(!bar)return null;1089 + if(!rgb)return null; 1055 1055 1056 - var cr= 1057 - card.getBoundingClientRect(); 1091 + var palette=[ 1092 + {hex:"#21b6d7",rgb:[33,182,215]}, 1093 + {hex:"#e94b13",rgb:[233,75,19]}, 1094 + {hex:"#f0aa00",rgb:[240,170,0]}, 1095 + {hex:"#38b76a",rgb:[56,183,106]} 1096 + ]; 1058 1058 1059 - var br=1060 - bar.getBoundingClientRect();1098 + var best=null; 1099 + var bestDistance=Infinity; 1061 1061 1062 - return { 1063 - bar:bar, 1064 - relativeTop: 1065 - br.top- 1066 - cr.top 1067 - }; 1068 - }); 1101 + palette.forEach(function(item){ 1102 + var d=distance(rgb,item.rgb); 1069 1069 1070 - if( 1071 - rows.some(function(row){ 1072 - return !row; 1073 - }) 1074 - ){ 1075 - return false; 1076 - } 1104 + if(d<bestDistance){ 1105 + best=item; 1106 + bestDistance=d; 1107 + } 1108 + }); 1077 1077 1078 - var target= 1079 - Math.max.apply( 1080 - Math, 1081 - rows.map(function(row){ 1082 - return row.relativeTop; 1083 - }) 1084 - ); 1110 + return bestDistance<=30 1111 + ?best 1112 + :null; 1113 + } 1085 1085 1086 - rows.forEach(function(row){ 1087 - var delta= 1088 - target- 1089 - row.relativeTop; 1115 + function propagateDetailAccents(){ 1116 + if(PAGE_KIND!=="detail")return; 1090 1090 1091 - if(delta<=1)return; 1118 + Array.from( 1119 + root.querySelectorAll( 1120 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+ 1121 + ".arsn-source,.dmp-source,.ido-source,.pp-source" 1122 + ) 1123 + ).forEach(function(el){ 1124 + if(!visible(el))return; 1092 1092 1093 - saveOriginal( 1094 - row.bar, 1095 - originalMarginTop, 1096 - "margin-top" 1097 - ); 1126 + var style=getComputedStyle(el); 1098 1098 1099 - var current= 1100 - num( 1101 - getComputedStyle( 1102 - row.bar 1103 - ).marginTop 1104 - ); 1128 + if( 1129 + num(style.borderTopWidth)>=2 1130 + ){ 1131 + var match= 1132 + paletteMatch( 1133 + style.borderTopColor 1134 + ); 1105 1105 1106 - row.bar.style.setProperty( 1107 - "margin-top", 1108 - ( 1109 - current+ 1110 - delta 1111 - )+"px" 1112 - ); 1136 + if(match){ 1137 + el.style.setProperty( 1138 + "border-left", 1139 + "4px solid "+match.hex, 1140 + "important" 1141 + ); 1142 + } 1143 + } 1144 + }); 1113 1113 1114 - row.bar.setAttribute( 1115 - "data-sn-first-section-aligned", 1116 - "7" 1117 - ); 1146 + // Warning families: explicit safety override. 1147 + Array.from( 1148 + root.querySelectorAll( 1149 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+ 1150 + ".warn,.warning,.warningmessage,.errormessage" 1151 + ) 1152 + ).forEach(function(el){ 1153 + if(!visible(el))return; 1118 1118 1119 - sectionManaged.add( 1120 - row.bar 1155 + el.style.setProperty( 1156 + "border-left", 1157 + "4px solid #e94b13", 1158 + "important" 1121 1121 ); 1122 1122 }); 1123 1123 1124 - return true; 1162 + // Info families: explicit orientation override. 1163 + Array.from( 1164 + root.querySelectorAll( 1165 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage" 1166 + ) 1167 + ).forEach(function(el){ 1168 + if(!visible(el))return; 1169 + 1170 + el.style.setProperty( 1171 + "border-left", 1172 + "4px solid #21b6d7", 1173 + "important" 1174 + ); 1175 + }); 1125 1125 } 1126 1126 1127 - /* ---------- Generic first content after heading ---------- */ 1178 + /* ======================================================= 1179 + OVERVIEW SEMANTIC THEME PALETTE 1180 + ======================================================= */ 1128 1128 1129 - function heading(card){ 1130 - var cr= 1131 - card.getBoundingClientRect(); 1132 - 1133 - var rows= 1134 - Array.from( 1135 - card.querySelectorAll( 1136 - "h1,h2,h3,h4,h5,h6,.box-title,[role=heading]" 1137 - ) 1182 + function smallestThemeHeaders(){ 1183 + return Array.from( 1184 + root.querySelectorAll( 1185 + "div,span,p,strong,h3,h4,h5,h6" 1138 1138 ) 1139 - .filter(function(el){ 1140 - if(!visible(el,20,8))return false; 1187 + ).filter(function(el){ 1188 + if(!visible(el))return false; 1189 + if(!themeFor(el.textContent))return false; 1141 1141 1142 - var r=el.getBoundingClientRect(); 1143 - 1144 - var rel= 1145 - r.top- 1146 - cr.top; 1147 - 1148 - return ( 1149 - rel>=0&& 1150 - rel<= 1151 - Math.min( 1152 - 160, 1153 - cr.height*.45 1154 - ) 1191 + return !Array.from( 1192 + el.children||[] 1193 + ).some(function(child){ 1194 + return !!themeFor( 1195 + child.textContent 1155 1155 ); 1156 - }) 1157 - .sort(function(a,b){ 1158 - return ( 1159 - a.getBoundingClientRect().top- 1160 - b.getBoundingClientRect().top 1161 - ); 1162 1162 }); 1163 - 1164 - return rows[0]||null; 1198 + }); 1165 1165 } 1166 1166 1167 - function firstContent(card,h){ 1168 - if(!h)return null; 1201 + function findOverviewCard(header){ 1202 + var node=header.parentElement; 1203 + var candidates=[]; 1169 1169 1170 - var cr= 1171 - card.getBoundingClientRect(); 1205 + while(node&&node!==root){ 1206 + var rect=node.getBoundingClientRect(); 1207 + var style=getComputedStyle(node); 1172 1172 1173 - var hr= 1174 - h.getBoundingClientRect(); 1209 + var border= 1210 + num(style.borderTopWidth)+ 1211 + num(style.borderRightWidth)+ 1212 + num(style.borderBottomWidth)+ 1213 + num(style.borderLeftWidth); 1175 1175 1176 - var rows= 1177 - Array.from( 1178 - card.querySelectorAll( 1179 - "p,div,ul,ol,dl,blockquote" 1180 - ) 1181 - ) 1182 - .filter(function(el){ 1183 - if( 1184 - el===h|| 1185 - h.contains(el)|| 1186 - el.contains(h) 1187 - ){ 1188 - return false; 1189 - } 1215 + if( 1216 + rect.width>=220&& 1217 + rect.width<=800&& 1218 + rect.height>=120&& 1219 + border>=1 1220 + ){ 1221 + candidates.push(node); 1222 + } 1190 1190 1191 - if(!visible(el,30,8))return false; 1224 + node=node.parentElement; 1225 + } 1192 1192 1193 - var text= 1194 - String(el.textContent||"") 1195 - .replace(/\s+/g," ") 1196 - .trim(); 1227 + if(!candidates.length)return null; 1197 1197 1198 - if(text.length<3)return false; 1229 + candidates.sort(function(a,b){ 1230 + return ( 1231 + b.getBoundingClientRect().height- 1232 + a.getBoundingClientRect().height 1233 + ); 1234 + }); 1199 1199 1200 - var r=el.getBoundingClientRect(); 1236 + return candidates[0]; 1237 + } 1201 1201 1202 - if( 1203 - r.top< 1204 - hr.bottom-1 1205 - ){ 1206 - return false; 1207 - } 1239 + function rowCandidates(link,card){ 1240 + var result=[]; 1241 + var cardRect= 1242 + card.getBoundingClientRect(); 1208 1208 1209 - if( 1210 - r.top-cr.top> 1211 - Math.min( 1212 - 280, 1213 - cr.height*.65 1214 - ) 1215 - ){ 1216 - return false; 1217 - } 1244 + var node=link; 1218 1218 1246 + while(node&&node!==card){ 1247 + if(visible(node)){ 1248 + var rect= 1249 + node.getBoundingClientRect(); 1250 + 1219 1219 if( 1220 - r.height> 1221 - cr.height*.58 1252 + rect.height<=105&& 1253 + rect.width>= 1254 + cardRect.width*.50&& 1255 + rect.width<= 1256 + cardRect.width*1.03 1222 1222 ){ 1223 - re turn false;1258 + result.push(node); 1224 1224 } 1260 + } 1225 1225 1226 - return true; 1227 - }) 1228 - .sort(function(a,b){ 1229 - var ar= 1230 - a.getBoundingClientRect(); 1262 + node=node.parentElement; 1263 + } 1231 1231 1232 - varbr=1233 - b.getBoundingClientRect();1265 + return result; 1266 + } 1234 1234 1268 + function chooseOuterRow( 1269 + candidates, 1270 + link 1271 + ){ 1272 + if(!candidates.length){ 1273 + return link; 1274 + } 1275 + 1276 + var bordered= 1277 + candidates.filter(function(el){ 1235 1235 return ( 1236 - ar.top-br.top|| 1237 - ar.height-br.height 1279 + num( 1280 + getComputedStyle(el) 1281 + .borderLeftWidth 1282 + )>=1 1238 1238 ); 1239 1239 }); 1240 1240 1241 - return rows[0]||null; 1242 - } 1286 + var pool= 1287 + bordered.length 1288 + ?bordered 1289 + :candidates; 1243 1243 1244 - function alignGeneric(cards){ 1245 - var rows= 1246 - cards.map(function(card){ 1247 - var h= 1248 - heading(card); 1291 + pool.sort(function(a,b){ 1292 + var ar= 1293 + a.getBoundingClientRect(); 1249 1249 1250 - var c= 1251 - firstContent( 1252 - card, 1253 - h 1254 - ); 1295 + var br= 1296 + b.getBoundingClientRect(); 1255 1255 1256 - if(!h||!c)return null; 1298 + return ( 1299 + ar.left-br.left|| 1300 + br.width-ar.width 1301 + ); 1302 + }); 1257 1257 1258 - varcr=1259 - card.getBoundingClientRect();1304 + return pool[0]||link; 1305 + } 1260 1260 1261 - var rr= 1262 - c.getBoundingClientRect(); 1263 - 1264 - return { 1265 - content:c, 1266 - relativeTop: 1267 - rr.top-cr.top 1268 - }; 1269 - }); 1270 - 1271 - if( 1272 - rows.some(function(row){ 1273 - return !row; 1274 - }) 1275 - ){ 1276 - return false; 1307 + function applyOverviewPalette(){ 1308 + if(PAGE_KIND!=="overview"){ 1309 + return []; 1277 1277 } 1278 1278 1279 - var target= 1280 - Math.max.apply( 1281 - Math, 1282 - rows.map(function(row){ 1283 - return row.relativeTop; 1312 + var headers= 1313 + smallestThemeHeaders() 1314 + .map(function(el){ 1315 + return { 1316 + el:el, 1317 + theme: 1318 + themeFor( 1319 + el.textContent 1320 + ), 1321 + card: 1322 + findOverviewCard( 1323 + el 1324 + ) 1325 + }; 1284 1284 }) 1285 - ); 1327 + .filter(function(row){ 1328 + return !!row.card; 1329 + }); 1286 1286 1287 - rows.forEach(function(row){ 1288 - var delta= 1289 - target- 1290 - row.relativeTop; 1331 + var unique=[]; 1332 + var seenHeaders=new Set(); 1291 1291 1292 - if(delta<=1)return; 1334 + headers.forEach(function(row){ 1335 + var key= 1336 + row.theme.name+ 1337 + "|"+ 1338 + Math.round( 1339 + row.card 1340 + .getBoundingClientRect() 1341 + .left 1342 + )+ 1343 + "|"+ 1344 + Math.round( 1345 + row.el 1346 + .getBoundingClientRect() 1347 + .top 1348 + ); 1293 1293 1294 - sa veOriginal(1295 - r ow.content,1296 - originalMarginTop,1297 - "margin-top"1298 - );1350 + if(!seenHeaders.has(key)){ 1351 + seenHeaders.add(key); 1352 + unique.push(row); 1353 + } 1354 + }); 1299 1299 1300 - var current= 1301 - num( 1302 - getComputedStyle( 1303 - row.content 1304 - ).marginTop 1305 - ); 1356 + unique.forEach(function(row){ 1357 + var headerRect= 1358 + row.el 1359 + .getBoundingClientRect(); 1306 1306 1307 - row.content.style.setProperty( 1308 - "margin-top", 1309 - ( 1310 - current+ 1311 - delta 1312 - )+"px" 1361 + row.el.style.setProperty( 1362 + "background", 1363 + row.theme.bg, 1364 + "important" 1313 1313 ); 1314 1314 1315 - row.content.setAttribute( 1316 - "data-sn-first-content-aligned", 1317 - "7" 1367 + row.el.style.setProperty( 1368 + "color", 1369 + row.theme.text, 1370 + "important" 1318 1318 ); 1319 1319 1320 - contentManaged.add( 1321 - row.content 1373 + row.el.style.setProperty( 1374 + "text-align", 1375 + "left", 1376 + "important" 1322 1322 ); 1378 + 1379 + row.el.style.setProperty( 1380 + "word-spacing", 1381 + "normal", 1382 + "important" 1383 + ); 1384 + 1385 + var later= 1386 + unique 1387 + .filter(function(other){ 1388 + return ( 1389 + other.card===row.card&& 1390 + other.el 1391 + .getBoundingClientRect() 1392 + .top> 1393 + headerRect.top+2 1394 + ); 1395 + }) 1396 + .sort(function(a,b){ 1397 + return ( 1398 + a.el 1399 + .getBoundingClientRect() 1400 + .top- 1401 + b.el 1402 + .getBoundingClientRect() 1403 + .top 1404 + ); 1405 + }); 1406 + 1407 + var stopTop= 1408 + later.length 1409 + ?later[0].el 1410 + .getBoundingClientRect() 1411 + .top 1412 + :Infinity; 1413 + 1414 + Array.from( 1415 + row.card.querySelectorAll("a") 1416 + ).forEach(function(link){ 1417 + if(!visible(link))return; 1418 + 1419 + var rect= 1420 + link.getBoundingClientRect(); 1421 + 1422 + if( 1423 + rect.top<= 1424 + headerRect.bottom-2|| 1425 + rect.top>= 1426 + stopTop-2 1427 + ){ 1428 + return; 1429 + } 1430 + 1431 + var candidates= 1432 + rowCandidates( 1433 + link, 1434 + row.card 1435 + ); 1436 + 1437 + var target= 1438 + chooseOuterRow( 1439 + candidates, 1440 + link 1441 + ); 1442 + 1443 + candidates.forEach(function(el){ 1444 + el.style.setProperty( 1445 + "border-left", 1446 + "0 solid transparent", 1447 + "important" 1448 + ); 1449 + }); 1450 + 1451 + target.style.setProperty( 1452 + "border-left", 1453 + "3px solid "+ 1454 + row.theme.accent, 1455 + "important" 1456 + ); 1457 + 1458 + target.style.setProperty( 1459 + "box-sizing", 1460 + "border-box", 1461 + "important" 1462 + ); 1463 + }); 1323 1323 }); 1324 1324 1325 - return true;1466 + return unique; 1326 1326 } 1327 1327 1328 - function applyRow(group){ 1329 - if(!validRow(group))return false; 1469 + /* ======================================================= 1470 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW 1471 + ======================================================= */ 1330 1330 1473 + function alignOverviewCards(headers){ 1474 + if( 1475 + PAGE_KIND!=="overview"|| 1476 + window.innerWidth<=MOBILE_MAX 1477 + ){ 1478 + return; 1479 + } 1480 + 1331 1331 var cards=[]; 1332 1332 var seen=new Set(); 1333 1333 1334 - group.entries.forEach(function(entry){1335 - if(!seen.has( entry.target)){1336 - seen.add( entry.target);1337 - cards.push( entry.target);1484 + headers.forEach(function(row){ 1485 + if(!seen.has(row.card)){ 1486 + seen.add(row.card); 1487 + cards.push(row.card); 1338 1338 } 1339 1339 }); 1340 1340 1341 - if(cards.length<2)return false; 1342 - 1343 - if( 1344 - !alignKnownBars(cards) 1345 - ){ 1346 - alignGeneric(cards); 1491 + if(cards.length<2){ 1492 + return; 1347 1347 } 1348 1348 1349 - var maxHeight=0; 1495 + // Group cards by actual top position. 1496 + var groups=[]; 1350 1350 1351 1351 cards.forEach(function(card){ 1352 - maxHeight= 1353 - Math.max( 1354 - maxHeight, 1355 - card.getBoundingClientRect().height 1356 - ); 1499 + var top= 1500 + card.getBoundingClientRect().top; 1501 + 1502 + var group=null; 1503 + 1504 + for(var i=0;i<groups.length;i++){ 1505 + if( 1506 + Math.abs( 1507 + groups[i].top-top 1508 + )<=ROW_TOLERANCE 1509 + ){ 1510 + group=groups[i]; 1511 + break; 1512 + } 1513 + } 1514 + 1515 + if(!group){ 1516 + group={ 1517 + top:top, 1518 + cards:[] 1519 + }; 1520 + groups.push(group); 1521 + } 1522 + 1523 + group.cards.push(card); 1357 1357 }); 1358 1358 1359 - maxHeight=1360 - Math.ceil(1361 - maxHeight1362 - );1526 + groups.forEach(function(group){ 1527 + if(group.cards.length<2){ 1528 + return; 1529 + } 1363 1363 1364 - if(maxHeight<MIN_H)return false; 1531 + var firstHeaders= 1532 + group.cards.map(function(card){ 1533 + var candidates= 1534 + headers 1535 + .filter(function(row){ 1536 + return row.card===card; 1537 + }) 1538 + .sort(function(a,b){ 1539 + return ( 1540 + a.el 1541 + .getBoundingClientRect() 1542 + .top- 1543 + b.el 1544 + .getBoundingClientRect() 1545 + .top 1546 + ); 1547 + }); 1365 1365 1366 - cards.forEach(function(card){ 1367 - saveOriginal( 1368 - card, 1369 - originalMinHeight, 1370 - "min-height" 1371 - ); 1549 + return candidates.length 1550 + ?candidates[0] 1551 + :null; 1552 + }); 1372 1372 1373 - card.style.setProperty( 1374 - "min-height", 1375 - maxHeight+"px" 1376 - ); 1554 + if( 1555 + !firstHeaders.some(function(row){ 1556 + return !row; 1557 + }) 1558 + ){ 1559 + var targetTop= 1560 + Math.max.apply( 1561 + Math, 1562 + firstHeaders.map(function(row){ 1563 + return ( 1564 + row.el 1565 + .getBoundingClientRect() 1566 + .top- 1567 + row.card 1568 + .getBoundingClientRect() 1569 + .top 1570 + ); 1571 + }) 1572 + ); 1377 1377 1378 - card.setAttribute( 1379 - "data-sn-equal-height-managed", 1380 - "7" 1381 - ); 1574 + firstHeaders.forEach(function(row){ 1575 + var relativeTop= 1576 + row.el 1577 + .getBoundingClientRect() 1578 + .top- 1579 + row.card 1580 + .getBoundingClientRect() 1581 + .top; 1382 1382 1383 - heightManaged.add(card);1384 - });1583 + var delta= 1584 + targetTop-relativeTop; 1385 1385 1386 - return true; 1387 - } 1586 + if(delta>1){ 1587 + saveStyle( 1588 + row.el, 1589 + originalMargin, 1590 + "margin-top" 1591 + ); 1388 1388 1389 - function calculate(force){ 1390 - if(applying)return; 1593 + var current= 1594 + num( 1595 + getComputedStyle( 1596 + row.el 1597 + ).marginTop 1598 + ); 1391 1391 1392 - var width= 1393 - Math.round( 1394 - window.innerWidth 1395 - ); 1600 + row.el.style.setProperty( 1601 + "margin-top", 1602 + ( 1603 + current+delta 1604 + )+"px" 1605 + ); 1396 1396 1397 - var meaningful= 1398 - lastWidth<0|| 1399 - Math.abs( 1400 - width- 1401 - lastWidth 1402 - )>= 1403 - MIN_WIDTH_CHANGE; 1607 + row.el.setAttribute( 1608 + "data-sn-master-first-row", 1609 + "1" 1610 + ); 1404 1404 1612 + managedMargin.add( 1613 + row.el 1614 + ); 1615 + } 1616 + }); 1617 + } 1618 + 1619 + var maxHeight=0; 1620 + 1621 + group.cards.forEach(function(card){ 1622 + maxHeight= 1623 + Math.max( 1624 + maxHeight, 1625 + card 1626 + .getBoundingClientRect() 1627 + .height 1628 + ); 1629 + }); 1630 + 1631 + maxHeight= 1632 + Math.ceil(maxHeight); 1633 + 1634 + group.cards.forEach(function(card){ 1635 + saveStyle( 1636 + card, 1637 + originalHeight, 1638 + "min-height" 1639 + ); 1640 + 1641 + card.style.setProperty( 1642 + "min-height", 1643 + maxHeight+"px" 1644 + ); 1645 + 1646 + card.setAttribute( 1647 + "data-sn-master-equal-height", 1648 + "1" 1649 + ); 1650 + 1651 + managedHeight.add( 1652 + card 1653 + ); 1654 + }); 1655 + }); 1656 + } 1657 + 1658 + /* ======================================================= 1659 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY 1660 + ======================================================= */ 1661 + 1662 + function equaliseDetailGrids(){ 1405 1405 if( 1406 - hasApplied&& 1407 - !force&& 1408 - !meaningful 1664 + PAGE_KIND!=="detail"|| 1665 + window.innerWidth<=MOBILE_MAX 1409 1409 ){ 1410 1410 return; 1411 1411 } 1412 1412 1413 - applying=true; 1670 + var selectors=[ 1671 + ".arsn-grid", 1672 + ".arsn-grid-2", 1673 + ".arsn-grid-3", 1674 + ".dmp-grid", 1675 + ".ido-grid", 1676 + ".pp-grid" 1677 + ]; 1414 1414 1415 - try{ 1416 - harmoniseCustomCallouts(); 1679 + selectors.forEach(function(selector){ 1680 + Array.from( 1681 + root.querySelectorAll(selector) 1682 + ).forEach(function(grid){ 1683 + var children= 1684 + Array.from( 1685 + grid.children||[] 1686 + ).filter(visible); 1417 1417 1418 - if(width<=MOBILE_MAX){ 1419 - if(hasApplied){ 1420 - resetRuntime(); 1688 + if(children.length<2){ 1689 + return; 1421 1421 } 1422 1422 1423 - hasApplied=false; 1424 - lastWidth=width; 1425 - return; 1426 - } 1692 + var groups=[]; 1427 1427 1428 - if(hasApplied){ 1429 - resetRuntime(); 1430 - } 1694 + children.forEach(function(child){ 1695 + var top= 1696 + child 1697 + .getBoundingClientRect() 1698 + .top; 1431 1431 1432 - var parents= 1433 - Array.from( 1434 - root.querySelectorAll("*") 1435 - ) 1436 - .filter(function(parent){ 1437 - return ( 1438 - visible( 1439 - parent, 1440 - MIN_W, 1441 - MIN_H 1442 - )&& 1443 - parent.children&& 1444 - parent.children.length>=2&& 1445 - parent.children.length<= 1446 - MAX_PARENT_CHILDREN 1447 - ); 1448 - }); 1700 + var group=null; 1449 1449 1450 - var touched= 1451 - new Set(); 1702 + for(var i=0;i<groups.length;i++){ 1703 + if( 1704 + Math.abs( 1705 + groups[i].top-top 1706 + )<=ROW_TOLERANCE 1707 + ){ 1708 + group=groups[i]; 1709 + break; 1710 + } 1711 + } 1452 1452 1453 - parents.forEach(function(parent){ 1454 - var entries=[]; 1713 + if(!group){ 1714 + group={ 1715 + top:top, 1716 + items:[] 1717 + }; 1718 + groups.push(group); 1719 + } 1455 1455 1456 - Array.from( 1457 - parent.children 1458 - ).forEach(function(child){ 1459 - if( 1460 - !visible( 1461 - child, 1462 - MIN_W, 1463 - MIN_H 1464 - ) 1465 - ){ 1721 + group.items.push(child); 1722 + }); 1723 + 1724 + groups.forEach(function(group){ 1725 + if(group.items.length<2){ 1466 1466 return; 1467 1467 } 1468 1468 1469 - var target= 1470 - pickTarget(child); 1729 + var maxHeight=0; 1471 1471 1472 - if(!target)return; 1473 - 1474 - entries.push({ 1475 - target:target, 1476 - rect: 1477 - target.getBoundingClientRect() 1731 + group.items.forEach(function(item){ 1732 + maxHeight= 1733 + Math.max( 1734 + maxHeight, 1735 + item 1736 + .getBoundingClientRect() 1737 + .height 1738 + ); 1478 1478 }); 1479 - }); 1480 1480 1481 - groupRows( 1482 - entries 1483 - ).forEach(function(group){ 1484 - if(!validRow(group))return; 1741 + maxHeight= 1742 + Math.ceil(maxHeight); 1485 1485 1486 - var targets= 1487 - group.entries.map(function(entry){ 1488 - return entry.target; 1489 - }); 1744 + group.items.forEach(function(item){ 1745 + saveStyle( 1746 + item, 1747 + originalHeight, 1748 + "min-height" 1749 + ); 1490 1490 1491 - if( 1492 - !targets.some(function(el){ 1493 - return !touched.has(el); 1494 - }) 1495 - ){ 1496 - return; 1497 - } 1751 + item.style.setProperty( 1752 + "min-height", 1753 + maxHeight+"px" 1754 + ); 1498 1498 1499 - if(applyRow(group)){ 1500 - targets.forEach(function(el){ 1501 - touched.add(el); 1502 - }); 1503 - } 1756 + item.setAttribute( 1757 + "data-sn-master-equal-height", 1758 + "1" 1759 + ); 1760 + 1761 + managedHeight.add(item); 1762 + }); 1504 1504 }); 1505 1505 }); 1765 + }); 1766 + } 1506 1506 1507 - lastWidth=width; 1508 - hasApplied=true; 1768 + /* ======================================================= 1769 + RUN / RESPONSIVE SCHEDULING 1770 + ======================================================= */ 1771 + 1772 + function run(){ 1773 + if(running)return; 1774 + 1775 + running=true; 1776 + 1777 + try{ 1778 + resetRuntime(); 1779 + applyPlaceholderBadge(); 1780 + propagateDetailAccents(); 1781 + 1782 + var headers= 1783 + applyOverviewPalette(); 1784 + 1785 + makeThreeLineAreaLabels(); 1786 + makeFilledRedOrangeCTAsBorderless(); 1787 + 1788 + if( 1789 + window.innerWidth> 1790 + MOBILE_MAX 1791 + ){ 1792 + alignOverviewCards( 1793 + headers 1794 + ); 1795 + 1796 + equaliseDetailGrids(); 1797 + } 1509 1509 }finally{ 1510 - applying=false;1799 + running=false; 1511 1511 } 1512 1512 } 1513 1513 1514 - function resize(){1803 + function onResize(){ 1515 1515 if(resizeTimer){ 1516 1516 clearTimeout( 1517 1517 resizeTimer ... ... @@ -1522,19 +1522,40 @@ 1522 1522 setTimeout( 1523 1523 function(){ 1524 1524 resizeTimer=0; 1525 - calculate(false);1814 + run(); 1526 1526 }, 1527 1527 RESIZE_DEBOUNCE 1528 1528 ); 1529 1529 } 1530 1530 1531 - function waitImages(){ 1820 + async function waitForReady(){ 1821 + if( 1822 + document.readyState!=="complete" 1823 + ){ 1824 + await new Promise(function(resolve){ 1825 + window.addEventListener( 1826 + "load", 1827 + resolve, 1828 + {once:true} 1829 + ); 1830 + }); 1831 + } 1832 + 1833 + if( 1834 + document.fonts&& 1835 + document.fonts.ready 1836 + ){ 1837 + try{ 1838 + await document.fonts.ready; 1839 + }catch(error){} 1840 + } 1841 + 1532 1532 var images= 1533 1533 Array.from( 1534 1534 root.querySelectorAll("img") 1535 1535 ); 1536 1536 1537 - returnPromise.all(1847 + await Promise.all( 1538 1538 images.map(function(img){ 1539 1539 if(img.complete){ 1540 1540 return Promise.resolve(); ... ... @@ -1559,46 +1559,20 @@ 1559 1559 }); 1560 1560 }) 1561 1561 ); 1562 - } 1563 1563 1564 - async function initial(){ 1565 - if( 1566 - document.readyState!== 1567 - "complete" 1568 - ){ 1569 - await new Promise(function(resolve){ 1570 - addEventListener( 1571 - "load", 1572 - resolve, 1573 - {once:true} 1574 - ); 1575 - }); 1576 - } 1577 - 1578 - if( 1579 - document.fonts&& 1580 - document.fonts.ready 1581 - ){ 1582 - try{ 1583 - await document.fonts.ready; 1584 - }catch(error){} 1585 - } 1586 - 1587 - await waitImages(); 1588 - 1589 - // Exactly one initial layout calculation. 1590 - calculate(true); 1873 + run(); 1591 1591 } 1592 1592 1593 - addEventListener( 1876 + window.addEventListener( 1594 1594 "resize", 1595 - resize,1878 + onResize, 1596 1596 {passive:true} 1597 1597 ); 1598 1598 1599 - i nitial();1882 + waitForReady(); 1600 1600 })(); 1601 1601 </script> 1602 1602 1603 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END --> 1604 -{{/html}}\n 1886 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END --> 1887 +{{/html}} 1888 +