Changes for page Prepare
Last modified by Veronika Kocher on Friday, 18 Sep 2026 16:47
From version 30.2
edited by Veronika Kocher
on Thursday, 03 Sep 2026 15:54
on Thursday, 03 Sep 2026 15:54
Change comment:
There is no comment for this version
To 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
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Prepare1 +Enable - Content
-
... ... @@ -317,7 +317,7 @@ 317 317 <img src="https://xwiki.uni-ak.ac.at/bin/download/Service%20Navigator/Art%20%26%20Research%20Services%20Navigator/WebHome/enable.png" alt="Enable — planning and setting up an artistic or research project" /> 318 318 </div> 319 319 <div style="padding:18px 22px 21px 22px;"> 320 - <div class="arsn-eyebrow" style="color:#8a4d36;margin-bottom:6px;">PROJECT PHASE 1 · PREPARE</div>320 + <div class="arsn-eyebrow" style="color:#8a4d36;margin-bottom:6px;">PROJECT PHASE 1 · ENABLE</div> 321 321 <h2 style="font-size:28px;line-height:1.18;margin:0 0 9px 0;color:#2c2926;">I develop my project idea — I plan, fund & set up my project</h2> 322 322 <p style="font-size:15px;line-height:1.58;color:#5e5953;max-width:1080px;margin:0;"> 323 323 Before active project work begins, clarify how the project will be organised, funded and supported, ... ... @@ -331,7 +331,7 @@ 331 331 332 332 <div class="arsn-step active"> 333 333 <div class="arsn-step-dot"></div> 334 - <div class="arsn-step-label">1 · PREPARE</div>334 + <div class="arsn-step-label">1 · ENABLE</div> 335 335 <div class="arsn-step-desc">Plan & set up</div> 336 336 </div> 337 337 ... ... @@ -485,13 +485,12 @@ 485 485 </div> 486 486 {{/html}} 487 487 488 -{{html clean="false"}} 489 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START --> 488 +\n\n 489 +\n\n{{html clean="false"}} 490 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_START --> 490 490 491 -<style data-sn-service-navigator-master="1"> 492 -/* ========================================================= 493 - MASTER TYPOGRAPHY 494 - ========================================================= */ 492 +<style data-sn-horizontal-box-harmonizer="7"> 493 +/* ---------- Typography: never justify headings ---------- */ 495 495 #xwikicontent h1, 496 496 #xwikicontent h2, 497 497 #xwikicontent h3, ... ... @@ -513,105 +513,88 @@ 513 513 word-spacing:normal!important; 514 514 } 515 515 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{ 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"]{ 544 544 box-sizing:border-box!important; 545 - border-left:4px solid #21b6d7!important; 546 - border-radius:8px; 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; 547 547 text-align:left!important; 533 + text-justify:auto!important; 548 548 word-spacing:normal!important; 535 + box-shadow:none!important; 549 549 } 550 550 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, 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, 558 558 #xwikicontent .errormessage{ 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; 558 + --sn-callout-accent:#e94b13; 559 + background:#fff1ec!important; 564 564 } 565 565 566 -[data-sn-master-equal-height], 567 -[data-sn-master-first-row]{ 568 - box-sizing:border-box; 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; 569 569 } 570 570 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; 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; 589 589 } 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; 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; 601 601 } 602 602 </style> 603 603 604 -<script data-sn- service-navigator-master="1">585 +<script data-sn-horizontal-box-harmonizer="7"> 605 605 (function(){ 606 606 "use strict"; 607 607 608 - var PAGE_KIND="overview"; 609 - var PLACEHOLDER=false; 610 - var PLACEHOLDER_LABEL="COMING SOON"; 611 - 612 612 var MOBILE_MAX=767; 613 613 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; 614 614 var RESIZE_DEBOUNCE=220; 596 + var MIN_WIDTH_CHANGE=2; 615 615 616 616 var root= 617 617 document.getElementById("xwikicontent")|| ... ... @@ -621,114 +621,142 @@ 621 621 622 622 if(!root)return; 623 623 624 - var managedHeight=new Set(); 625 - var managedMargin=new Set(); 626 - var originalHeight=new WeakMap(); 627 - var originalMargin=new WeakMap(); 606 + var heightManaged=new Set(); 607 + var sectionManaged=new Set(); 608 + var contentManaged=new Set(); 628 628 610 + var originalMinHeight=new WeakMap(); 611 + var originalMarginTop=new WeakMap(); 612 + 629 629 var resizeTimer=0; 630 - var running=false; 614 + var lastWidth=-1; 615 + var hasApplied=false; 616 + var applying=false; 631 631 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 - ] 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; 693 693 } 694 - ]; 695 695 696 - function num(value){ 697 - var n=parseFloat(value); 698 - return Number.isFinite(n)?n:0; 636 + var r=el.getBoundingClientRect(); 637 + 638 + return ( 639 + r.width>=(minW||1)&& 640 + r.height>=(minH||1) 641 + ); 699 699 } 700 700 701 - function norm (value){702 - return String( value||"")644 + function normalizeText(text){ 645 + return String(text||"") 703 703 .replace(/\s+/g," ") 704 704 .trim() 705 705 .toUpperCase(); 706 706 } 707 707 708 - function visible(el){ 709 - if(!el||el.nodeType!==1)return false; 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 + } 710 710 711 - var style=getComputedStyle(el); 712 - var rect=el.getBoundingClientRect(); 660 + /* ---------- Custom coloured callouts ---------- */ 713 713 662 + function nativeCallout(el){ 663 + var c= 664 + typeof el.className==="string" 665 + ? el.className.toLowerCase() 666 + : ""; 667 + 714 714 return ( 715 - style.display!=="none"&& 716 - style.visibility!=="hidden"&& 717 - rect.width>20&& 718 - rect.height>4 669 + /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c) 719 719 ); 720 720 } 721 721 722 - function saveStyle(el,map,property){ 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){ 723 723 if(map.has(el))return; 724 724 725 725 map.set(el,{ 726 - value:el.style.getPropertyValue(property), 727 - priority:el.style.getPropertyPriority(property) 730 + value: 731 + el.style.getPropertyValue( 732 + property 733 + ), 734 + priority: 735 + el.style.getPropertyPriority( 736 + property 737 + ) 728 728 }); 729 729 } 730 730 731 - function restore Style(el,map,property){741 + function restoreOriginal(el,map,property){ 732 732 var original=map.get(el); 733 733 734 734 if(original&&original.value){ ... ... @@ -738,1068 +738,770 @@ 738 738 original.priority||"" 739 739 ); 740 740 }else{ 741 - el.style.removeProperty(property); 751 + el.style.removeProperty( 752 + property 753 + ); 742 742 } 743 743 } 744 744 745 745 function resetRuntime(){ 746 - managedHeight.forEach(function(el){747 - restore Style(758 + heightManaged.forEach(function(el){ 759 + restoreOriginal( 748 748 el, 749 - originalHeight, 761 + originalMinHeight, 750 750 "min-height" 751 751 ); 764 + 752 752 el.removeAttribute( 753 - "data-sn- master-equal-height"766 + "data-sn-equal-height-managed" 754 754 ); 755 755 }); 756 756 757 - managedMargin.forEach(function(el){758 - restore Style(770 + sectionManaged.forEach(function(el){ 771 + restoreOriginal( 759 759 el, 760 - originalMargin, 773 + originalMarginTop, 761 761 "margin-top" 762 762 ); 776 + 763 763 el.removeAttribute( 764 - "data-sn- master-first-row"778 + "data-sn-first-section-aligned" 765 765 ); 766 766 }); 767 767 768 - managedHeight.clear(); 769 - managedMargin.clear(); 770 - } 782 + contentManaged.forEach(function(el){ 783 + restoreOriginal( 784 + el, 785 + originalMarginTop, 786 + "margin-top" 787 + ); 771 771 772 - function themeFor(text){ 773 - var value=norm(text); 789 + el.removeAttribute( 790 + "data-sn-first-content-aligned" 791 + ); 792 + }); 774 774 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]; 778 - 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 - } 789 - 790 - return null; 794 + heightManaged.clear(); 795 + sectionManaged.clear(); 796 + contentManaged.clear(); 791 791 } 792 792 793 - /* ======================================================= 794 - BORDERLESS FILLED RED/ORANGE CTA BUTTONS 795 - ======================================================= */ 799 + /* ---------- Card detection ---------- */ 796 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 - ); 801 + function namedLikeBox(el){ 802 + var c= 803 + typeof el.className==="string" 804 + ? el.className 805 + : ""; 806 + 807 + return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c); 803 803 } 804 804 805 - function makeFilledRedOrangeCTAsBorderless(){ 806 - var RED_ORANGE=[233,75,19]; 810 + function boxLike(el){ 811 + if( 812 + !visible(el,MIN_W,MIN_H)|| 813 + excluded(el) 814 + ){ 815 + return false; 816 + } 807 807 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; 818 + var s=getComputedStyle(el); 819 + var r=el.getBoundingClientRect(); 814 814 815 - var style=getComputedStyle(el); 816 - var rgb=parseRGB(style.backgroundColor); 821 + var border= 822 + num(s.borderTopWidth)+ 823 + num(s.borderRightWidth)+ 824 + num(s.borderBottomWidth)+ 825 + num(s.borderLeftWidth); 817 817 818 - if(!rgb)return; 827 + var radius=Math.max( 828 + num(s.borderTopLeftRadius), 829 + num(s.borderTopRightRadius), 830 + num(s.borderBottomLeftRadius), 831 + num(s.borderBottomRightRadius) 832 + ); 819 819 820 - if( 821 - colourDistance( 822 - rgb, 823 - RED_ORANGE 824 - )>55 825 - ){ 826 - return; 827 - } 834 + var bg= 835 + s.backgroundColor&& 836 + s.backgroundColor!=="rgba(0, 0, 0, 0)"&& 837 + s.backgroundColor!=="transparent"; 828 828 829 - var rect=el.getBoundingClientRect(); 839 + var shadow= 840 + s.boxShadow&& 841 + s.boxShadow!=="none"; 830 830 831 - if( 832 - rect.width<80|| 833 - rect.height<24 834 - ){ 835 - return; 836 - } 843 + return ( 844 + namedLikeBox(el)|| 845 + border>=1|| 846 + (bg&&radius>=3)|| 847 + (shadow&&r.width>=180) 848 + ); 849 + } 837 837 838 - el.style.setProperty( 839 - "border", 840 - "none", 841 - "important" 842 - ); 851 + function pickTarget(child){ 852 + if(!visible(child,MIN_W,MIN_H))return null; 843 843 844 - el.style.setProperty( 845 - "border-left", 846 - "none", 847 - "important" 848 - ); 854 + if(boxLike(child))return child; 849 849 850 - el.style.setProperty( 851 - "border-top", 852 - "none", 853 - "important" 854 - ); 856 + var cr=child.getBoundingClientRect(); 857 + var q=[]; 855 855 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 - ); 859 + Array.from(child.children||[]).forEach(function(el){ 860 + q.push({el:el,depth:1}); 873 873 }); 874 - } 875 875 876 - /* ======================================================= 877 - FULL-WIDTH THREE-LINE AREA LABELS 878 - ======================================================= */ 863 + var best=null; 864 + var bestScore=-Infinity; 879 879 880 - function compactText(value){ 881 - return String(value||"") 882 - .replace(/\s+/g," ") 883 - .trim(); 884 - } 866 + while(q.length){ 867 + var item=q.shift(); 868 + var el=item.el; 885 885 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 - } 870 + if(!visible(el,MIN_W,MIN_H))continue; 899 899 900 - var number= 901 - label.querySelector( 902 - ":scope > .arsn-area-number" 903 - ); 872 + var r=el.getBoundingClientRect(); 904 904 905 - var action= 906 - label.querySelector( 907 - ":scope > .arsn-area-action" 908 - ); 909 - 910 910 if( 911 - !number||912 - !action875 + r.width>=cr.width*.68&& 876 + boxLike(el) 913 913 ){ 914 - return; 915 - } 878 + var widthFit= 879 + 1-Math.min( 880 + 1, 881 + Math.abs(cr.width-r.width)/ 882 + Math.max(1,cr.width) 883 + ); 916 916 917 - var clone= 918 - label.cloneNode(true); 885 + var topFit= 886 + 1-Math.min( 887 + 1, 888 + Math.abs(cr.top-r.top)/100 889 + ); 919 919 920 - var cloneNumber= 921 - clone.querySelector( 922 - ":scope > .arsn-area-number" 923 - ); 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; 924 924 925 - var cloneAction= 926 - clone.querySelector( 927 - ":scope > .arsn-area-action" 928 - ); 929 - 930 - if(cloneNumber){ 931 - cloneNumber.remove(); 897 + if(score>bestScore){ 898 + best=el; 899 + bestScore=score; 900 + } 932 932 } 933 933 934 - if(cloneAction){ 935 - cloneAction.remove(); 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 + }); 936 936 } 911 + } 937 937 938 - var titleText= 939 - compactText( 940 - clone.textContent 941 - ); 913 + return best; 914 + } 942 942 943 - if(!titleText){ 944 - return; 945 - } 916 + function groupRows(entries){ 917 + var groups=[]; 946 946 947 - var numberNode= 948 - number.cloneNode(true); 949 - 950 - var actionNode= 951 - action.cloneNode(true); 952 - 953 - var titleNode= 954 - document.createElement( 955 - "span" 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 956 956 ); 926 + }) 927 + .forEach(function(entry){ 928 + var group=null; 957 957 958 - titleNode.className= 959 - "sn-area-label-title"; 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 + } 960 960 961 - titleNode.textContent= 962 - titleText; 942 + if(!group){ 943 + group={ 944 + top:entry.rect.top, 945 + entries:[] 946 + }; 947 + groups.push(group); 948 + } 963 963 964 - while(label.firstChild){ 965 - label.removeChild( 966 - label.firstChild 967 - ); 968 - } 950 + group.entries.push(entry); 951 + }); 969 969 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 - }); 953 + return groups; 1012 1012 } 1013 1013 1014 - /* ======================================================= 1015 - PLACEHOLDER BADGE 1016 - ======================================================= */ 956 + function validRow(group){ 957 + if(group.entries.length<2)return false; 1017 1017 1018 - function applyPlaceholderBadge(){ 1019 - if(!PLACEHOLDER)return; 959 + var lefts= 960 + group.entries 961 + .map(function(e){return e.rect.left;}) 962 + .sort(function(a,b){return a-b;}); 1020 1020 1021 1021 if( 1022 - document.querySelector(1023 - ".sn-coming-soon-badge"1024 - )965 + lefts[lefts.length-1]- 966 + lefts[0]< 967 + 80 1025 1025 ){ 1026 - return; 969 + return false; 1027 1027 } 1028 1028 1029 - var title= 1030 - document.querySelector( 1031 - "#document-title" 1032 - )|| 1033 - document.querySelector( 1034 - "h1" 1035 - ); 972 + var widths= 973 + group.entries 974 + .map(function(e){return e.rect.width;}) 975 + .filter(function(w){return w>0;}); 1036 1036 1037 - if( !title)return;977 + if(widths.length<2)return false; 1038 1038 1039 - var badge= 1040 - document.createElement( 1041 - "span" 1042 - ); 979 + var minW= 980 + Math.min.apply(Math,widths); 1043 1043 1044 - badge.className=1045 - "sn-coming-soon-badge";982 + var maxW= 983 + Math.max.apply(Math,widths); 1046 1046 1047 - badge.textContent= 1048 - PLACEHOLDER_LABEL; 1049 - 1050 - badge.setAttribute( 1051 - "aria-label", 1052 - PLACEHOLDER_LABEL 985 + return ( 986 + maxW/ 987 + Math.max(1,minW)<= 988 + 1.9 1053 1053 ); 1054 - 1055 - title.appendChild( 1056 - badge 1057 - ); 1058 1058 } 1059 1059 1060 - /* ======================================================= 1061 - DETAIL PAGE OWN-ACCENT PROPAGATION 1062 - ======================================================= */ 992 + /* ---------- Known ARSN first section bars ---------- */ 1063 1063 1064 - function parseRGB(value){ 1065 - var match=String(value||"").match( 1066 - /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i 1067 - ); 994 + function knownBar(el){ 995 + var text= 996 + normalizeText( 997 + el.textContent 998 + ); 1068 1068 1069 - if(!match)return null; 1070 - 1071 - return [ 1072 - Number(match[1]), 1073 - Number(match[2]), 1074 - Number(match[3]) 1075 - ]; 1076 - } 1077 - 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) 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" 1083 1083 ); 1084 1084 } 1085 1085 1086 - function paletteMatch(cssColor){ 1087 - var rgb=parseRGB(cssColor); 1012 + function findKnownBar(card){ 1013 + var cardRect= 1014 + card.getBoundingClientRect(); 1088 1088 1089 - if(!rgb)return null; 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; 1090 1090 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 - ]; 1026 + var r=el.getBoundingClientRect(); 1097 1097 1098 - var best=null; 1099 - var bestDistance=Infinity; 1028 + var rel= 1029 + r.top- 1030 + cardRect.top; 1100 1100 1101 - palette.forEach(function(item){ 1102 - var d=distance(rgb,item.rgb); 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 + }); 1103 1103 1104 - if(d<bestDistance){ 1105 - best=item; 1106 - bestDistance=d; 1107 - } 1108 - }); 1109 - 1110 - return bestDistance<=30 1111 - ?best 1112 - :null; 1045 + return rows[0]||null; 1113 1113 } 1114 1114 1115 - function propagateDetailAccents(){ 1116 - if(PAGE_KIND!=="detail")return; 1048 + function alignKnownBars(cards){ 1049 + var rows= 1050 + cards.map(function(card){ 1051 + var bar= 1052 + findKnownBar(card); 1117 1117 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; 1054 + if(!bar)return null; 1125 1125 1126 - var style=getComputedStyle(el); 1056 + var cr= 1057 + card.getBoundingClientRect(); 1127 1127 1128 - if( 1129 - num(style.borderTopWidth)>=2 1130 - ){ 1131 - var match= 1132 - paletteMatch( 1133 - style.borderTopColor 1134 - ); 1059 + var br= 1060 + bar.getBoundingClientRect(); 1135 1135 1136 - if(match){ 1137 - el.style.setProperty( 1138 - "border-left", 1139 - "4px solid "+match.hex, 1140 - "important" 1141 - ); 1142 - } 1143 - } 1144 - }); 1062 + return { 1063 + bar:bar, 1064 + relativeTop: 1065 + br.top- 1066 + cr.top 1067 + }; 1068 + }); 1145 1145 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; 1070 + if( 1071 + rows.some(function(row){ 1072 + return !row; 1073 + }) 1074 + ){ 1075 + return false; 1076 + } 1154 1154 1155 - el.style.setProperty( 1156 - "border-left", 1157 - "4px solid #e94b13", 1158 - "important" 1078 + var target= 1079 + Math.max.apply( 1080 + Math, 1081 + rows.map(function(row){ 1082 + return row.relativeTop; 1083 + }) 1159 1159 ); 1160 - }); 1161 1161 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; 1086 + rows.forEach(function(row){ 1087 + var delta= 1088 + target- 1089 + row.relativeTop; 1169 1169 1170 - el.style.setProperty( 1171 - "border-left", 1172 - "4px solid #21b6d7", 1173 - "important" 1091 + if(delta<=1)return; 1092 + 1093 + saveOriginal( 1094 + row.bar, 1095 + originalMarginTop, 1096 + "margin-top" 1174 1174 ); 1175 - }); 1176 - } 1177 1177 1178 - /* ======================================================= 1179 - OVERVIEW SEMANTIC THEME PALETTE 1180 - ======================================================= */ 1099 + var current= 1100 + num( 1101 + getComputedStyle( 1102 + row.bar 1103 + ).marginTop 1104 + ); 1181 1181 1182 - function smallestThemeHeaders(){ 1183 - // Phase overview rule: 1184 - // only explicit three-line area-label blocks carry semantic colour. 1185 - // Ordinary h4 and focus-card headings stay neutral. 1186 - return Array.from( 1187 - root.querySelectorAll( 1188 - ".arsn-area-label" 1189 - ) 1190 - ).filter(function(el){ 1191 - return ( 1192 - visible(el)&& 1193 - !!themeFor( 1194 - el.textContent 1195 - ) 1106 + row.bar.style.setProperty( 1107 + "margin-top", 1108 + ( 1109 + current+ 1110 + delta 1111 + )+"px" 1196 1196 ); 1197 - }); 1198 - } 1199 1199 1200 - function findOverviewCard(header){ 1201 - var node=header.parentElement; 1202 - var candidates=[]; 1114 + row.bar.setAttribute( 1115 + "data-sn-first-section-aligned", 1116 + "7" 1117 + ); 1203 1203 1204 - while(node&&node!==root){ 1205 - var rect=node.getBoundingClientRect(); 1206 - var style=getComputedStyle(node); 1207 - 1208 - var border= 1209 - num(style.borderTopWidth)+ 1210 - num(style.borderRightWidth)+ 1211 - num(style.borderBottomWidth)+ 1212 - num(style.borderLeftWidth); 1213 - 1214 - if( 1215 - rect.width>=220&& 1216 - rect.width<=800&& 1217 - rect.height>=120&& 1218 - border>=1 1219 - ){ 1220 - candidates.push(node); 1221 - } 1222 - 1223 - node=node.parentElement; 1224 - } 1225 - 1226 - if(!candidates.length)return null; 1227 - 1228 - candidates.sort(function(a,b){ 1229 - return ( 1230 - b.getBoundingClientRect().height- 1231 - a.getBoundingClientRect().height 1119 + sectionManaged.add( 1120 + row.bar 1232 1232 ); 1233 1233 }); 1234 1234 1235 - return candidates[0];1124 + return true; 1236 1236 } 1237 1237 1238 - function rowCandidates(link,card){ 1239 - var result=[]; 1240 - var cardRect= 1127 + /* ---------- Generic first content after heading ---------- */ 1128 + 1129 + function heading(card){ 1130 + var cr= 1241 1241 card.getBoundingClientRect(); 1242 1242 1243 - var node=link; 1133 + var rows= 1134 + Array.from( 1135 + card.querySelectorAll( 1136 + "h1,h2,h3,h4,h5,h6,.box-title,[role=heading]" 1137 + ) 1138 + ) 1139 + .filter(function(el){ 1140 + if(!visible(el,20,8))return false; 1244 1244 1245 - while(node&&node!==card){ 1246 - if(visible(node)){ 1247 - var rect= 1248 - node.getBoundingClientRect(); 1142 + var r=el.getBoundingClientRect(); 1249 1249 1250 - if( 1251 - rect.height<=105&& 1252 - rect.width>= 1253 - cardRect.width*.50&& 1254 - rect.width<= 1255 - cardRect.width*1.03 1256 - ){ 1257 - result.push(node); 1258 - } 1259 - } 1144 + var rel= 1145 + r.top- 1146 + cr.top; 1260 1260 1261 - node=node.parentElement; 1262 - } 1263 - 1264 - return result; 1265 - } 1266 - 1267 - function chooseOuterRow( 1268 - candidates, 1269 - link 1270 - ){ 1271 - if(!candidates.length){ 1272 - return link; 1273 - } 1274 - 1275 - var bordered= 1276 - candidates.filter(function(el){ 1277 1277 return ( 1278 - num( 1279 - getComputedStyle(el) 1280 - .borderLeftWidth 1281 - )>=1 1149 + rel>=0&& 1150 + rel<= 1151 + Math.min( 1152 + 160, 1153 + cr.height*.45 1154 + ) 1282 1282 ); 1156 + }) 1157 + .sort(function(a,b){ 1158 + return ( 1159 + a.getBoundingClientRect().top- 1160 + b.getBoundingClientRect().top 1161 + ); 1283 1283 }); 1284 1284 1285 - var pool= 1286 - bordered.length 1287 - ?bordered 1288 - :candidates; 1289 - 1290 - pool.sort(function(a,b){ 1291 - var ar= 1292 - a.getBoundingClientRect(); 1293 - 1294 - var br= 1295 - b.getBoundingClientRect(); 1296 - 1297 - return ( 1298 - ar.left-br.left|| 1299 - br.width-ar.width 1300 - ); 1301 - }); 1302 - 1303 - return pool[0]||link; 1164 + return rows[0]||null; 1304 1304 } 1305 1305 1306 - function applyOverviewPalette(){ 1307 - if(PAGE_KIND!=="overview"){ 1308 - return []; 1309 - } 1167 + function firstContent(card,h){ 1168 + if(!h)return null; 1310 1310 1311 - var headers= 1312 - smallestThemeHeaders() 1313 - .map(function(el){ 1314 - return { 1315 - el:el, 1316 - theme: 1317 - themeFor( 1318 - el.textContent 1319 - ), 1320 - card: 1321 - findOverviewCard( 1322 - el 1323 - ) 1324 - }; 1325 - }) 1326 - .filter(function(row){ 1327 - return !!row.card; 1328 - }); 1170 + var cr= 1171 + card.getBoundingClientRect(); 1329 1329 1330 - var unique=[];1331 - varseenHeaders=new Set();1173 + var hr= 1174 + h.getBoundingClientRect(); 1332 1332 1333 - headers.forEach(function(row){ 1334 - var key= 1335 - row.theme.name+ 1336 - "|"+ 1337 - Math.round( 1338 - row.card 1339 - .getBoundingClientRect() 1340 - .left 1341 - )+ 1342 - "|"+ 1343 - Math.round( 1344 - row.el 1345 - .getBoundingClientRect() 1346 - .top 1347 - ); 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 + } 1348 1348 1349 - if(!seenHeaders.has(key)){ 1350 - seenHeaders.add(key); 1351 - unique.push(row); 1352 - } 1353 - }); 1191 + if(!visible(el,30,8))return false; 1354 1354 1355 - unique.forEach(function(row){1356 - varheaderRect=1357 - row.el1358 - . getBoundingClientRect();1193 + var text= 1194 + String(el.textContent||"") 1195 + .replace(/\s+/g," ") 1196 + .trim(); 1359 1359 1360 - row.el.style.setProperty( 1361 - "background", 1362 - row.theme.bg, 1363 - "important" 1364 - ); 1198 + if(text.length<3)return false; 1365 1365 1366 - row.el.style.setProperty( 1367 - "color", 1368 - row.theme.text, 1369 - "important" 1370 - ); 1200 + var r=el.getBoundingClientRect(); 1371 1371 1372 - row.el.style.setProperty( 1373 - "text-align", 1374 - "left", 1375 - "important" 1376 - ); 1202 + if( 1203 + r.top< 1204 + hr.bottom-1 1205 + ){ 1206 + return false; 1207 + } 1377 1377 1378 - row.el.style.setProperty( 1379 - "word-spacing", 1380 - "normal", 1381 - "important" 1382 - ); 1209 + if( 1210 + r.top-cr.top> 1211 + Math.min( 1212 + 280, 1213 + cr.height*.65 1214 + ) 1215 + ){ 1216 + return false; 1217 + } 1383 1383 1384 - var later= 1385 - unique 1386 - .filter(function(other){ 1387 - return ( 1388 - other.card===row.card&& 1389 - other.el 1390 - .getBoundingClientRect() 1391 - .top> 1392 - headerRect.top+2 1393 - ); 1394 - }) 1395 - .sort(function(a,b){ 1396 - return ( 1397 - a.el 1398 - .getBoundingClientRect() 1399 - .top- 1400 - b.el 1401 - .getBoundingClientRect() 1402 - .top 1403 - ); 1404 - }); 1405 - 1406 - var stopTop= 1407 - later.length 1408 - ?later[0].el 1409 - .getBoundingClientRect() 1410 - .top 1411 - :Infinity; 1412 - 1413 - Array.from( 1414 - row.card.querySelectorAll("a") 1415 - ).forEach(function(link){ 1416 - if(!visible(link))return; 1417 - 1418 - var rect= 1419 - link.getBoundingClientRect(); 1420 - 1421 1421 if( 1422 - rect.top<= 1423 - headerRect.bottom-2|| 1424 - rect.top>= 1425 - stopTop-2 1220 + r.height> 1221 + cr.height*.58 1426 1426 ){ 1427 - return; 1223 + return false; 1428 1428 } 1429 1429 1430 - varcandidates=1431 - rowCandidates(1432 - link,1433 - row.card1434 - ); 1226 + return true; 1227 + }) 1228 + .sort(function(a,b){ 1229 + var ar= 1230 + a.getBoundingClientRect(); 1435 1435 1436 - var target= 1437 - chooseOuterRow( 1438 - candidates, 1439 - link 1440 - ); 1232 + var br= 1233 + b.getBoundingClientRect(); 1441 1441 1442 - candidates.forEach(function(el){ 1443 - el.style.setProperty( 1444 - "border-left", 1445 - "0 solid transparent", 1446 - "important" 1447 - ); 1448 - }); 1449 - 1450 - target.style.setProperty( 1451 - "border-left", 1452 - "3px solid "+ 1453 - row.theme.accent, 1454 - "important" 1235 + return ( 1236 + ar.top-br.top|| 1237 + ar.height-br.height 1455 1455 ); 1456 - 1457 - target.style.setProperty( 1458 - "box-sizing", 1459 - "border-box", 1460 - "important" 1461 - ); 1462 1462 }); 1463 - }); 1464 1464 1465 - return unique;1241 + return rows[0]||null; 1466 1466 } 1467 1467 1468 - /* ======================================================= 1469 - OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW 1470 - ======================================================= */ 1244 + function alignGeneric(cards){ 1245 + var rows= 1246 + cards.map(function(card){ 1247 + var h= 1248 + heading(card); 1471 1471 1472 - function alignOverviewCards(headers){ 1473 - if( 1474 - PAGE_KIND!=="overview"|| 1475 - window.innerWidth<=MOBILE_MAX 1476 - ){ 1477 - return; 1478 - } 1250 + var c= 1251 + firstContent( 1252 + card, 1253 + h 1254 + ); 1479 1479 1480 - var cards=[]; 1481 - var seen=new Set(); 1256 + if(!h||!c)return null; 1482 1482 1483 - headers.forEach(function(row){ 1484 - if(!seen.has(row.card)){ 1485 - seen.add(row.card); 1486 - cards.push(row.card); 1487 - } 1488 - }); 1258 + var cr= 1259 + card.getBoundingClientRect(); 1489 1489 1490 - if(cards.length<2){ 1491 - return; 1492 - } 1261 + var rr= 1262 + c.getBoundingClientRect(); 1493 1493 1494 - // Group cards by actual top position. 1495 - var groups=[]; 1264 + return { 1265 + content:c, 1266 + relativeTop: 1267 + rr.top-cr.top 1268 + }; 1269 + }); 1496 1496 1497 - cards.forEach(function(card){ 1498 - var top= 1499 - card.getBoundingClientRect().top; 1271 + if( 1272 + rows.some(function(row){ 1273 + return !row; 1274 + }) 1275 + ){ 1276 + return false; 1277 + } 1500 1500 1501 - var group=null; 1279 + var target= 1280 + Math.max.apply( 1281 + Math, 1282 + rows.map(function(row){ 1283 + return row.relativeTop; 1284 + }) 1285 + ); 1502 1502 1503 - for(var i=0;i<groups.length;i++){ 1504 - if( 1505 - Math.abs( 1506 - groups[i].top-top 1507 - )<=ROW_TOLERANCE 1508 - ){ 1509 - group=groups[i]; 1510 - break; 1511 - } 1512 - } 1287 + rows.forEach(function(row){ 1288 + var delta= 1289 + target- 1290 + row.relativeTop; 1513 1513 1514 - if(!group){ 1515 - group={ 1516 - top:top, 1517 - cards:[] 1518 - }; 1519 - groups.push(group); 1520 - } 1292 + if(delta<=1)return; 1521 1521 1522 - group.cards.push(card); 1523 - }); 1294 + saveOriginal( 1295 + row.content, 1296 + originalMarginTop, 1297 + "margin-top" 1298 + ); 1524 1524 1525 - groups.forEach(function(group){ 1526 - if(group.cards.length<2){ 1527 - return; 1528 - } 1300 + var current= 1301 + num( 1302 + getComputedStyle( 1303 + row.content 1304 + ).marginTop 1305 + ); 1529 1529 1530 - var firstHeaders= 1531 - group.cards.map(function(card){ 1532 - var candidates= 1533 - headers 1534 - .filter(function(row){ 1535 - return row.card===card; 1536 - }) 1537 - .sort(function(a,b){ 1538 - return ( 1539 - a.el 1540 - .getBoundingClientRect() 1541 - .top- 1542 - b.el 1543 - .getBoundingClientRect() 1544 - .top 1545 - ); 1546 - }); 1307 + row.content.style.setProperty( 1308 + "margin-top", 1309 + ( 1310 + current+ 1311 + delta 1312 + )+"px" 1313 + ); 1547 1547 1548 - returncandidates.length1549 - ?candidates[0]1550 - :null;1551 - });1315 + row.content.setAttribute( 1316 + "data-sn-first-content-aligned", 1317 + "7" 1318 + ); 1552 1552 1553 - if( 1554 - !firstHeaders.some(function(row){ 1555 - return !row; 1556 - }) 1557 - ){ 1558 - var targetTop= 1559 - Math.max.apply( 1560 - Math, 1561 - firstHeaders.map(function(row){ 1562 - return ( 1563 - row.el 1564 - .getBoundingClientRect() 1565 - .top- 1566 - row.card 1567 - .getBoundingClientRect() 1568 - .top 1569 - ); 1570 - }) 1571 - ); 1320 + contentManaged.add( 1321 + row.content 1322 + ); 1323 + }); 1572 1572 1573 - firstHeaders.forEach(function(row){ 1574 - var relativeTop= 1575 - row.el 1576 - .getBoundingClientRect() 1577 - .top- 1578 - row.card 1579 - .getBoundingClientRect() 1580 - .top; 1325 + return true; 1326 + } 1581 1581 1582 - var delta=1583 - targetTop-relativeTop;1328 + function applyRow(group){ 1329 + if(!validRow(group))return false; 1584 1584 1585 - if(delta>1){ 1586 - saveStyle( 1587 - row.el, 1588 - originalMargin, 1589 - "margin-top" 1590 - ); 1331 + var cards=[]; 1332 + var seen=new Set(); 1591 1591 1592 - varcurrent=1593 - num(1594 - getComputedStyle(1595 - row.el1596 - ).marginTop1597 - );1334 + group.entries.forEach(function(entry){ 1335 + if(!seen.has(entry.target)){ 1336 + seen.add(entry.target); 1337 + cards.push(entry.target); 1338 + } 1339 + }); 1598 1598 1599 - row.el.style.setProperty( 1600 - "margin-top", 1601 - ( 1602 - current+delta 1603 - )+"px" 1604 - ); 1341 + if(cards.length<2)return false; 1605 1605 1606 - row.el.setAttribute( 1607 - "data-sn-master-first-row", 1608 - "1" 1609 - ); 1343 + if( 1344 + !alignKnownBars(cards) 1345 + ){ 1346 + alignGeneric(cards); 1347 + } 1610 1610 1611 - managedMargin.add( 1612 - row.el 1613 - ); 1614 - } 1615 - }); 1616 - } 1349 + var maxHeight=0; 1617 1617 1618 - var maxHeight=0; 1351 + cards.forEach(function(card){ 1352 + maxHeight= 1353 + Math.max( 1354 + maxHeight, 1355 + card.getBoundingClientRect().height 1356 + ); 1357 + }); 1619 1619 1620 - group.cards.forEach(function(card){ 1621 - maxHeight= 1622 - Math.max( 1623 - maxHeight, 1624 - card 1625 - .getBoundingClientRect() 1626 - .height 1627 - ); 1628 - }); 1359 + maxHeight= 1360 + Math.ceil( 1361 + maxHeight 1362 + ); 1629 1629 1630 - maxHeight= 1631 - Math.ceil(maxHeight); 1364 + if(maxHeight<MIN_H)return false; 1632 1632 1633 - group.cards.forEach(function(card){1634 - saveStyle(1635 - card,1636 - originalHeight,1637 - "min-height"1638 - );1366 + cards.forEach(function(card){ 1367 + saveOriginal( 1368 + card, 1369 + originalMinHeight, 1370 + "min-height" 1371 + ); 1639 1639 1640 - card.style.setProperty(1641 - "min-height",1642 - maxHeight+"px"1643 - );1373 + card.style.setProperty( 1374 + "min-height", 1375 + maxHeight+"px" 1376 + ); 1644 1644 1645 - card.setAttribute(1646 - "data-sn-master-equal-height",1647 - "1"1648 - );1378 + card.setAttribute( 1379 + "data-sn-equal-height-managed", 1380 + "7" 1381 + ); 1649 1649 1650 - managedHeight.add( 1651 - card 1652 - ); 1653 - }); 1383 + heightManaged.add(card); 1654 1654 }); 1385 + 1386 + return true; 1655 1655 } 1656 1656 1657 - /* ======================================================= 1658 - DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY 1659 - ======================================================= */ 1389 + function calculate(force){ 1390 + if(applying)return; 1660 1660 1661 - function equaliseDetailGrids(){ 1392 + var width= 1393 + Math.round( 1394 + window.innerWidth 1395 + ); 1396 + 1397 + var meaningful= 1398 + lastWidth<0|| 1399 + Math.abs( 1400 + width- 1401 + lastWidth 1402 + )>= 1403 + MIN_WIDTH_CHANGE; 1404 + 1662 1662 if( 1663 - PAGE_KIND!=="detail"|| 1664 - window.innerWidth<=MOBILE_MAX 1406 + hasApplied&& 1407 + !force&& 1408 + !meaningful 1665 1665 ){ 1666 1666 return; 1667 1667 } 1668 1668 1669 - var selectors=[ 1670 - ".arsn-grid", 1671 - ".arsn-grid-2", 1672 - ".arsn-grid-3", 1673 - ".dmp-grid", 1674 - ".ido-grid", 1675 - ".pp-grid" 1676 - ]; 1413 + applying=true; 1677 1677 1678 - selectors.forEach(function(selector){ 1679 - Array.from( 1680 - root.querySelectorAll(selector) 1681 - ).forEach(function(grid){ 1682 - var children= 1683 - Array.from( 1684 - grid.children||[] 1685 - ).filter(visible); 1415 + try{ 1416 + harmoniseCustomCallouts(); 1686 1686 1687 - if(children.length<2){ 1688 - return; 1418 + if(width<=MOBILE_MAX){ 1419 + if(hasApplied){ 1420 + resetRuntime(); 1689 1689 } 1690 1690 1691 - var groups=[]; 1423 + hasApplied=false; 1424 + lastWidth=width; 1425 + return; 1426 + } 1692 1692 1693 - children.forEach(function(child){ 1694 - var top= 1695 - child 1696 - .getBoundingClientRect() 1697 - .top; 1428 + if(hasApplied){ 1429 + resetRuntime(); 1430 + } 1698 1698 1699 - var group=null; 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 1700 1701 - for(var i=0;i<groups.length;i++){ 1702 - if( 1703 - Math.abs( 1704 - groups[i].top-top 1705 - )<=ROW_TOLERANCE 1706 - ){ 1707 - group=groups[i]; 1708 - break; 1709 - } 1710 - } 1450 + var touched= 1451 + new Set(); 1711 1711 1712 - if(!group){ 1713 - group={ 1714 - top:top, 1715 - items:[] 1716 - }; 1717 - groups.push(group); 1718 - } 1453 + parents.forEach(function(parent){ 1454 + var entries=[]; 1719 1719 1720 - group.items.push(child); 1721 - }); 1722 - 1723 - groups.forEach(function(group){ 1724 - if(group.items.length<2){ 1456 + Array.from( 1457 + parent.children 1458 + ).forEach(function(child){ 1459 + if( 1460 + !visible( 1461 + child, 1462 + MIN_W, 1463 + MIN_H 1464 + ) 1465 + ){ 1725 1725 return; 1726 1726 } 1727 1727 1728 - var maxHeight=0; 1469 + var target= 1470 + pickTarget(child); 1729 1729 1730 - group.items.forEach(function(item){ 1731 - maxHeight= 1732 - Math.max( 1733 - maxHeight, 1734 - item 1735 - .getBoundingClientRect() 1736 - .height 1737 - ); 1472 + if(!target)return; 1473 + 1474 + entries.push({ 1475 + target:target, 1476 + rect: 1477 + target.getBoundingClientRect() 1738 1738 }); 1479 + }); 1739 1739 1740 - maxHeight= 1741 - Math.ceil(maxHeight); 1481 + groupRows( 1482 + entries 1483 + ).forEach(function(group){ 1484 + if(!validRow(group))return; 1742 1742 1743 - group.items.forEach(function(item){ 1744 - saveStyle( 1745 - item, 1746 - originalHeight, 1747 - "min-height" 1748 - ); 1486 + var targets= 1487 + group.entries.map(function(entry){ 1488 + return entry.target; 1489 + }); 1749 1749 1750 - item.style.setProperty( 1751 - "min-height", 1752 - maxHeight+"px" 1753 - ); 1491 + if( 1492 + !targets.some(function(el){ 1493 + return !touched.has(el); 1494 + }) 1495 + ){ 1496 + return; 1497 + } 1754 1754 1755 - item.setAttribute( 1756 - "data-sn-master-equal-height", 1757 - "1" 1758 - ); 1759 - 1760 - managedHeight.add(item); 1761 - }); 1499 + if(applyRow(group)){ 1500 + targets.forEach(function(el){ 1501 + touched.add(el); 1502 + }); 1503 + } 1762 1762 }); 1763 1763 }); 1764 - }); 1765 - } 1766 1766 1767 - /* ======================================================= 1768 - RUN / RESPONSIVE SCHEDULING 1769 - ======================================================= */ 1770 - 1771 - function run(){ 1772 - if(running)return; 1773 - 1774 - running=true; 1775 - 1776 - try{ 1777 - resetRuntime(); 1778 - applyPlaceholderBadge(); 1779 - propagateDetailAccents(); 1780 - 1781 - var headers= 1782 - applyOverviewPalette(); 1783 - 1784 - makeThreeLineAreaLabels(); 1785 - makeFilledRedOrangeCTAsBorderless(); 1786 - 1787 - if( 1788 - window.innerWidth> 1789 - MOBILE_MAX 1790 - ){ 1791 - alignOverviewCards( 1792 - headers 1793 - ); 1794 - 1795 - equaliseDetailGrids(); 1796 - } 1507 + lastWidth=width; 1508 + hasApplied=true; 1797 1797 }finally{ 1798 - running=false;1510 + applying=false; 1799 1799 } 1800 1800 } 1801 1801 1802 - function onResize(){1514 + function resize(){ 1803 1803 if(resizeTimer){ 1804 1804 clearTimeout( 1805 1805 resizeTimer ... ... @@ -1810,40 +1810,19 @@ 1810 1810 setTimeout( 1811 1811 function(){ 1812 1812 resizeTimer=0; 1813 - run();1525 + calculate(false); 1814 1814 }, 1815 1815 RESIZE_DEBOUNCE 1816 1816 ); 1817 1817 } 1818 1818 1819 - async function waitForReady(){ 1820 - if( 1821 - document.readyState!=="complete" 1822 - ){ 1823 - await new Promise(function(resolve){ 1824 - window.addEventListener( 1825 - "load", 1826 - resolve, 1827 - {once:true} 1828 - ); 1829 - }); 1830 - } 1831 - 1832 - if( 1833 - document.fonts&& 1834 - document.fonts.ready 1835 - ){ 1836 - try{ 1837 - await document.fonts.ready; 1838 - }catch(error){} 1839 - } 1840 - 1531 + function waitImages(){ 1841 1841 var images= 1842 1842 Array.from( 1843 1843 root.querySelectorAll("img") 1844 1844 ); 1845 1845 1846 - await Promise.all(1537 + return Promise.all( 1847 1847 images.map(function(img){ 1848 1848 if(img.complete){ 1849 1849 return Promise.resolve(); ... ... @@ -1868,20 +1868,46 @@ 1868 1868 }); 1869 1869 }) 1870 1870 ); 1562 + } 1871 1871 1872 - run(); 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 1873 } 1874 1874 1875 - window.addEventListener(1593 + addEventListener( 1876 1876 "resize", 1877 - onResize,1595 + resize, 1878 1878 {passive:true} 1879 1879 ); 1880 1880 1881 - waitForReady();1599 + initial(); 1882 1882 })(); 1883 1883 </script> 1884 1884 1885 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END --> 1886 -{{/html}} 1887 - 1603 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_END --> 1604 +{{/html}}\n