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