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