Änderungen von Dokument Art & Research Services Navigator
Zuletzt geändert von Veronika Kocher am Freitag, 18 Sep. 2026 16:47
Von Version 10.1
bearbeitet von Veronika Kocher
am Donnerstag, 03 Sep. 2026 13:08
am Donnerstag, 03 Sep. 2026 13:08
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Auf Version 9.3
bearbeitet von Veronika Kocher
am Donnerstag, 03 Sep. 2026 9:34
am Donnerstag, 03 Sep. 2026 9:34
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -4,6 +4,7 @@ 4 4 5 5 {{info title="Unterstützung für dein Projekt:"}} 6 6 7 + 7 7 **Support Kunst und Forschung (SKF)** begleitet Projekt- und Fördervorhaben und arbeitet je nach Bedarf mit den passenden Services der Universität zusammen. 8 8 9 9 Der Navigator führt dich entlang der Projektphasen zu den Angeboten und Ansprechstellen, die für dein Vorhaben relevant sind. ... ... @@ -635,100 +635,23 @@ 635 635 ))) 636 636 637 637 {{html clean="false"}} 638 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START --> 639 - 640 -<style data-sn-service-navigator-master="1"> 641 -/* ========================================================= 642 - MASTER TYPOGRAPHY 643 - ========================================================= */ 644 -#xwikicontent h1, 645 -#xwikicontent h2, 646 -#xwikicontent h3, 647 -#xwikicontent h4, 648 -#xwikicontent h5, 649 -#xwikicontent h6, 650 -#xwikicontent .box-title, 651 -#xwikicontent [role="heading"], 652 -#xwikicontent h1 a, 653 -#xwikicontent h2 a, 654 -#xwikicontent h3 a, 655 -#xwikicontent h4 a, 656 -#xwikicontent h5 a, 657 -#xwikicontent h6 a, 658 -#xwikicontent .box-title a, 659 -#xwikicontent [role="heading"] a{ 660 - text-align:left!important; 661 - text-justify:auto!important; 662 - word-spacing:normal!important; 663 -} 664 - 665 -/* ========================================================= 666 - COMING SOON / IN VORBEREITUNG 667 - ========================================================= */ 668 -.sn-coming-soon-badge{ 669 - display:inline-block; 670 - vertical-align:middle; 671 - margin-left:10px; 672 - padding:4px 8px; 673 - border-radius:14px; 674 - border:1px solid #efd9cc; 675 - background:#fff4ee; 676 - color:#8a4d36; 677 - font-size:11px; 678 - font-weight:700; 679 - letter-spacing:.055em; 680 - line-height:1.2; 681 - white-space:nowrap; 682 -} 683 - 684 -/* ========================================================= 685 - NATIVE / DETAIL CALLOUT GEOMETRY 686 - Preserve existing backgrounds. 687 - ========================================================= */ 688 -#xwikicontent .arsn-info, 689 -#xwikicontent .dmp-info, 690 -#xwikicontent .ido-info, 691 -#xwikicontent .pp-info, 692 -#xwikicontent .infomessage{ 693 - box-sizing:border-box!important; 694 - border-left:4px solid #21b6d7!important; 695 - border-radius:8px; 696 - text-align:left!important; 697 - word-spacing:normal!important; 698 -} 699 - 700 -#xwikicontent .arsn-warn, 701 -#xwikicontent .dmp-warn, 702 -#xwikicontent .ido-warn, 703 -#xwikicontent .pp-warn, 704 -#xwikicontent .warn, 705 -#xwikicontent .warning, 706 -#xwikicontent .warningmessage, 707 -#xwikicontent .errormessage{ 708 - box-sizing:border-box!important; 709 - border-left:4px solid #e94b13!important; 710 - border-radius:8px; 711 - text-align:left!important; 712 - word-spacing:normal!important; 713 -} 714 - 715 -[data-sn-master-equal-height], 716 -[data-sn-master-first-row]{ 639 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_START --> 640 +<style data-sn-horizontal-box-harmonizer="4"> 641 +[data-sn-equal-height-managed], 642 +[data-sn-first-section-aligned]{ 717 717 box-sizing:border-box; 718 718 } 719 719 </style> 720 - 721 -<script data-sn-service-navigator-master="1"> 646 +<script data-sn-horizontal-box-harmonizer="4"> 722 722 (function(){ 723 723 "use strict"; 724 724 725 - var PAGE_KIND="overview"; 726 - var PLACEHOLDER=false; 727 - var PLACEHOLDER_LABEL="IN VORBEREITUNG"; 728 - 729 729 var MOBILE_MAX=767; 730 730 var ROW_TOLERANCE=6; 731 - var RESIZE_DEBOUNCE=220; 652 + var MIN_W=150; 653 + var MIN_H=36; 654 + var MAX_PARENT_CHILDREN=16; 655 + var SEARCH_DEPTH=5; 732 732 733 733 var root= 734 734 document.getElementById("xwikicontent")|| ... ... @@ -738,105 +738,93 @@ 738 738 739 739 if(!root)return; 740 740 741 - var managedHeight=new Set(); 742 - var managedMargin=new Set(); 743 - var originalHeight=new WeakMap(); 744 - var originalMargin=new WeakMap(); 665 + var heightManaged=new Set(); 666 + var sectionManaged=new Set(); 667 + var originalMinHeight=new WeakMap(); 668 + var originalMarginTop=new WeakMap(); 669 + var raf=0; 745 745 746 - var resizeTimer=0; 747 - var running=false; 671 + function num(v){ 672 + var n=parseFloat(v); 673 + return Number.isFinite(n)?n:0; 674 + } 748 748 749 - var THEMES=[ 750 - { 751 - name:"BLUE", 752 - accent:"#21b6d7", 753 - bg:"#eaf7fb", 754 - text:"#315d68", 755 - labels:[ 756 - "HIER STARTEN", 757 - "ENTSCHEIDEN", 758 - "ÜBERPRÜFEN & ANPASSEN", 759 - "START HERE", 760 - "DECIDE", 761 - "REVIEW & ADAPT" 762 - ] 763 - }, 764 - { 765 - name:"RED", 766 - accent:"#e94b13", 767 - bg:"#fff1ec", 768 - text:"#8a4d36", 769 - labels:[ 770 - "PLANEN & ORGANISIEREN", 771 - "ORGANISIEREN & DOKUMENTIEREN", 772 - "PUBLIZIEREN & PRÄSENTIEREN", 773 - "PLAN & ORGANISE", 774 - "PLAN & ORGANIZE", 775 - "ORGANISE & DOCUMENT", 776 - "ORGANIZE & DOCUMENT", 777 - "PUBLISH & PRESENT" 778 - ] 779 - }, 780 - { 781 - name:"YELLOW", 782 - accent:"#f0aa00", 783 - bg:"#fff8e7", 784 - text:"#785b17", 785 - labels:[ 786 - "SCHÜTZEN & KLÄREN", 787 - "STANDARDISIEREN & IDENTIFIZIEREN", 788 - "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN", 789 - "PROTECT & CLARIFY", 790 - "STANDARDISE & IDENTIFY", 791 - "STANDARDIZE & IDENTIFY", 792 - "OPEN, REUSE & MAKE FINDABLE" 793 - ] 794 - }, 795 - { 796 - name:"GREEN", 797 - accent:"#38b76a", 798 - bg:"#edf9f1", 799 - text:"#3f7451", 800 - labels:[ 801 - "INFRASTRUKTUR EINRICHTEN", 802 - "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN", 803 - "SPEICHERN & ZUGRIFF STEUERN", 804 - "REPOSITORIUM, ERHALTEN & ÜBERGEBEN", 805 - "SET UP INFRASTRUCTURE", 806 - "SET UP INFRASTRUCTURE & COLLABORATION", 807 - "STORE & CONTROL ACCESS", 808 - "REPOSITORY, PRESERVE & HAND OVER" 809 - ] 676 + function visible(el,minW,minH){ 677 + if(!el||el.nodeType!==1)return false; 678 + 679 + var s=getComputedStyle(el); 680 + 681 + if( 682 + s.display==="none"|| 683 + s.visibility==="hidden"|| 684 + Number(s.opacity)===0 685 + ){ 686 + return false; 810 810 } 811 - ]; 812 812 813 - function num(value){ 814 - var n=parseFloat(value); 815 - return Number.isFinite(n)?n:0; 689 + var r=el.getBoundingClientRect(); 690 + 691 + return ( 692 + r.width>=(minW||1)&& 693 + r.height>=(minH||1) 694 + ); 816 816 } 817 817 818 - function norm(value){ 819 - return String(value||"") 820 - .replace(/\s+/g," ") 821 - .trim() 822 - .toUpperCase(); 697 + function excluded(el){ 698 + return ( 699 + !el.matches|| 700 + el.matches( 701 + "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]" 702 + ) 703 + ); 823 823 } 824 824 825 - function visible(el){ 826 - if(!el||el.nodeType!==1)return false; 706 + function namedLikeBox(el){ 707 + var c= 708 + typeof el.className==="string" 709 + ? el.className 710 + : ""; 827 827 828 - var style=getComputedStyle(el);829 - var rect=el.getBoundingClientRect();712 + return /(^|[s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([s_-]|$)/i.test(c); 713 + } 830 830 715 + function boxLike(el){ 716 + if(!visible(el,MIN_W,MIN_H)||excluded(el))return false; 717 + 718 + var s=getComputedStyle(el); 719 + var r=el.getBoundingClientRect(); 720 + 721 + var border= 722 + num(s.borderTopWidth)+ 723 + num(s.borderRightWidth)+ 724 + num(s.borderBottomWidth)+ 725 + num(s.borderLeftWidth); 726 + 727 + var radius=Math.max( 728 + num(s.borderTopLeftRadius), 729 + num(s.borderTopRightRadius), 730 + num(s.borderBottomLeftRadius), 731 + num(s.borderBottomRightRadius) 732 + ); 733 + 734 + var bg= 735 + s.backgroundColor&& 736 + s.backgroundColor!=="rgba(0, 0, 0, 0)"&& 737 + s.backgroundColor!=="transparent"; 738 + 739 + var shadow= 740 + s.boxShadow&& 741 + s.boxShadow!=="none"; 742 + 831 831 return ( 832 - style.display!=="none"&&833 - style.visibility!=="hidden"&&834 - r ect.width>20&&835 - r ect.height>4744 + namedLikeBox(el)|| 745 + border>=1|| 746 + (bg&&radius>=3)|| 747 + (shadow&&r.width>=180) 836 836 ); 837 837 } 838 838 839 - function save Style(el,map,property){751 + function saveOriginal(el,map,property){ 840 840 if(map.has(el))return; 841 841 842 842 map.set(el,{ ... ... @@ -845,7 +845,7 @@ 845 845 }); 846 846 } 847 847 848 - function restore Style(el,map,property){760 + function restoreOriginal(el,map,property){ 849 849 var original=map.get(el); 850 850 851 851 if(original&&original.value){ ... ... @@ -859,249 +859,247 @@ 859 859 } 860 860 } 861 861 862 - function reset Runtime(){863 - managedHeight.forEach(function(el){864 - restore Style(774 + function reset(){ 775 + heightManaged.forEach(function(el){ 776 + restoreOriginal( 865 865 el, 866 - originalHeight, 778 + originalMinHeight, 867 867 "min-height" 868 868 ); 781 + 869 869 el.removeAttribute( 870 - "data-sn- master-equal-height"783 + "data-sn-equal-height-managed" 871 871 ); 872 872 }); 873 873 874 - managedMargin.forEach(function(el){875 - restore Style(787 + sectionManaged.forEach(function(el){ 788 + restoreOriginal( 876 876 el, 877 - originalMargin, 790 + originalMarginTop, 878 878 "margin-top" 879 879 ); 793 + 880 880 el.removeAttribute( 881 - "data-sn- master-first-row"795 + "data-sn-first-section-aligned" 882 882 ); 883 883 }); 884 884 885 - managedHeight.clear();886 - managedMargin.clear();799 + heightManaged.clear(); 800 + sectionManaged.clear(); 887 887 } 888 888 889 - function themeFor(text){890 - v ar value=norm(text);803 + function pickTarget(child){ 804 + if(!visible(child,MIN_W,MIN_H))return null; 891 891 892 - for(var i=0;i<THEMES.length;i++){ 893 - for(var j=0;j<THEMES[i].labels.length;j++){ 894 - var label=THEMES[i].labels[j]; 895 - 896 - if( 897 - value===label|| 898 - value.indexOf(label+" ")===0|| 899 - value.indexOf(label+" -")===0|| 900 - value.indexOf(label+" ·")===0 901 - ){ 902 - return THEMES[i]; 903 - } 904 - } 806 + if(boxLike(child)){ 807 + return child; 905 905 } 906 906 907 - retu rnnull;908 - }810 + var cr=child.getBoundingClientRect(); 811 + var q=[]; 909 909 910 - /*=======================================================911 - PLACEHOLDERBADGE912 - ======================================================= */813 + Array.from(child.children||[]).forEach(function(el){ 814 + q.push({el:el,depth:1}); 815 + }); 913 913 914 - functionapplyPlaceholderBadge(){915 - if(!PLACEHOLDER)return;817 + var best=null; 818 + var bestScore=-Infinity; 916 916 917 - if( 918 - document.querySelector( 919 - ".sn-coming-soon-badge" 920 - ) 921 - ){ 922 - return; 923 - } 820 + while(q.length){ 821 + var item=q.shift(); 822 + var el=item.el; 924 924 925 - var title= 926 - document.querySelector( 927 - "#document-title" 928 - )|| 929 - document.querySelector( 930 - "h1" 931 - ); 824 + if(!visible(el,MIN_W,MIN_H))continue; 932 932 933 - if(!title)return;826 + var r=el.getBoundingClientRect(); 934 934 935 - var badge= 936 - document.createElement( 937 - "span" 938 - ); 828 + if( 829 + r.width>=cr.width*.68&& 830 + boxLike(el) 831 + ){ 832 + var widthFit= 833 + 1-Math.min( 834 + 1, 835 + Math.abs(cr.width-r.width)/ 836 + Math.max(1,cr.width) 837 + ); 939 939 940 - badge.className= 941 - "sn-coming-soon-badge"; 839 + var topFit= 840 + 1-Math.min( 841 + 1, 842 + Math.abs(cr.top-r.top)/100 843 + ); 942 942 943 - badge.textContent= 944 - PLACEHOLDER_LABEL; 845 + var score= 846 + widthFit*6+ 847 + topFit*3+ 848 + Math.min(r.height,900)/450+ 849 + Math.min(r.width*r.height,900000)/900000; 945 945 946 - badge.setAttribute( 947 - "aria-label", 948 - PLACEHOLDER_LABEL 949 - ); 851 + if(score>bestScore){ 852 + best=el; 853 + bestScore=score; 854 + } 855 + } 950 950 951 - title.appendChild( 952 - badge 953 - ); 857 + if(item.depth<SEARCH_DEPTH){ 858 + Array.from(el.children||[]).forEach(function(next){ 859 + q.push({ 860 + el:next, 861 + depth:item.depth+1 862 + }); 863 + }); 864 + } 865 + } 866 + 867 + return best; 954 954 } 955 955 956 - /* ======================================================= 957 - DETAIL PAGE OWN-ACCENT PROPAGATION 958 - ======================================================= */ 870 + function groupsByVisualRow(entries){ 871 + var groups=[]; 959 959 960 - function parseRGB(value){ 961 - var match=String(value||"").match( 962 - /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i 963 - ); 873 + entries 874 + .slice() 875 + .sort(function(a,b){ 876 + return ( 877 + a.rect.top-b.rect.top|| 878 + a.rect.left-b.rect.left 879 + ); 880 + }) 881 + .forEach(function(entry){ 882 + var group=null; 964 964 965 - if(!match)return null; 884 + for(var i=0;i<groups.length;i++){ 885 + if( 886 + Math.abs( 887 + groups[i].top- 888 + entry.rect.top 889 + )<=ROW_TOLERANCE 890 + ){ 891 + group=groups[i]; 892 + break; 893 + } 894 + } 966 966 967 - return [ 968 - Number(match[1]), 969 - Number(match[2]), 970 - Number(match[3]) 971 - ]; 972 - } 896 + if(!group){ 897 + group={ 898 + top:entry.rect.top, 899 + entries:[] 900 + }; 901 + groups.push(group); 902 + } 973 973 974 - function distance(a,b){ 975 - return Math.sqrt( 976 - Math.pow(a[0]-b[0],2)+ 977 - Math.pow(a[1]-b[1],2)+ 978 - Math.pow(a[2]-b[2],2) 979 - ); 904 + group.entries.push(entry); 905 + }); 906 + 907 + return groups; 980 980 } 981 981 982 - function paletteMatch(cssColor){983 - var rgb=parseRGB(cssColor);910 + function validHorizontalGroup(group){ 911 + if(group.entries.length<2)return false; 984 984 985 - if(!rgb)return null; 913 + var lefts= 914 + group.entries 915 + .map(function(e){return e.rect.left;}) 916 + .sort(function(a,b){return a-b;}); 986 986 987 - var palette=[ 988 - {hex:"#21b6d7",rgb:[33,182,215]}, 989 - {hex:"#e94b13",rgb:[233,75,19]}, 990 - {hex:"#f0aa00",rgb:[240,170,0]}, 991 - {hex:"#38b76a",rgb:[56,183,106]} 992 - ]; 918 + if( 919 + lefts[lefts.length-1]- 920 + lefts[0]< 921 + 80 922 + ){ 923 + return false; 924 + } 993 993 994 - var best=null; 995 - var bestDistance=Infinity; 926 + var widths= 927 + group.entries 928 + .map(function(e){return e.rect.width;}) 929 + .filter(function(w){return w>0;}); 996 996 997 - palette.forEach(function(item){ 998 - var d=distance(rgb,item.rgb); 931 + if(widths.length<2)return false; 999 999 1000 - if(d<bestDistance){ 1001 - best=item; 1002 - bestDistance=d; 1003 - } 1004 - }); 933 + var minWidth=Math.min.apply(Math,widths); 934 + var maxWidth=Math.max.apply(Math,widths); 1005 1005 1006 - return bestDistance<=30 1007 - ?best 1008 - :null; 936 + return ( 937 + maxWidth/ 938 + Math.max(1,minWidth)<= 939 + 1.9 940 + ); 1009 1009 } 1010 1010 1011 - function propagateDetailAccents(){ 1012 - if(PAGE_KIND!=="detail")return; 943 + function normalizeText(text){ 944 + return String(text||"") 945 + .replace(/s+/g," ") 946 + .trim() 947 + .toUpperCase(); 948 + } 1013 1013 950 + function exactKnownFirstSection(el){ 951 + var text=normalizeText(el.textContent); 952 + 953 + return ( 954 + text==="HIER STARTEN"|| 955 + text==="ORGANISIEREN & DOKUMENTIEREN"|| 956 + text==="ENTSCHEIDEN"|| 957 + text==="START HERE"|| 958 + text==="GET STARTED"|| 959 + text==="ORGANISE & DOCUMENT"|| 960 + text==="ORGANIZE & DOCUMENT"|| 961 + text==="DECIDE" 962 + ); 963 + } 964 + 965 + function visuallyFirstSectionBar(card){ 966 + var cardRect=card.getBoundingClientRect(); 967 + var candidates=[]; 968 + 1014 1014 Array.from( 1015 - root.querySelectorAll( 1016 - ".arsn-call,.dmp-call,.ido-call,.pp-call,"+ 1017 - ".arsn-source,.dmp-source,.ido-source,.pp-source" 970 + card.querySelectorAll( 971 + "div,p,span,strong,h3,h4,h5,h6" 1018 1018 ) 1019 1019 ).forEach(function(el){ 1020 - if(!visible(el))return; 974 + if(!visible(el,20,6))return; 975 + if(excluded(el))return; 1021 1021 1022 - var style=getComputedStyle(el); 977 + var r=el.getBoundingClientRect(); 978 + var relativeTop=r.top-cardRect.top; 1023 1023 1024 1024 if( 1025 - num(style.borderTopWidth)>=2 981 + relativeTop<45|| 982 + relativeTop>cardRect.height*.72 1026 1026 ){ 1027 - var match= 1028 - paletteMatch( 1029 - style.borderTopColor 1030 - ); 1031 - 1032 - if(match){ 1033 - el.style.setProperty( 1034 - "border-left", 1035 - "4px solid "+match.hex, 1036 - "important" 1037 - ); 1038 - } 984 + return; 1039 1039 } 1040 - }); 1041 1041 1042 - // Warning families: explicit safety override. 1043 - Array.from( 1044 - root.querySelectorAll( 1045 - ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+ 1046 - ".warn,.warning,.warningmessage,.errormessage" 1047 - ) 1048 - ).forEach(function(el){ 1049 - if(!visible(el))return; 987 + var widthRatio= 988 + r.width/ 989 + Math.max(1,cardRect.width); 1050 1050 1051 - el.style.setProperty( 1052 - "border-left", 1053 - "4px solid #e94b13", 1054 - "important" 1055 - ); 1056 - }); 991 + if( 992 + widthRatio<.55|| 993 + widthRatio>1.05|| 994 + r.height>54 995 + ){ 996 + return; 997 + } 1057 1057 1058 - // Info families: explicit orientation override. 1059 - Array.from( 1060 - root.querySelectorAll( 1061 - ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage" 1062 - ) 1063 - ).forEach(function(el){ 1064 - if(!visible(el))return; 999 + var text=normalizeText(el.textContent); 1065 1065 1066 - el.style.setProperty( 1067 - "border-left", 1068 - "4px solid #21b6d7", 1069 - "important" 1070 - ); 1071 - }); 1072 - } 1001 + if( 1002 + text.length<2|| 1003 + text.length>90 1004 + ){ 1005 + return; 1006 + } 1073 1073 1074 - /* ======================================================= 1075 - OVERVIEW SEMANTIC THEME PALETTE 1076 - ======================================================= */ 1008 + var style=getComputedStyle(el); 1077 1077 1078 - function smallestThemeHeaders(){ 1079 - return Array.from( 1080 - root.querySelectorAll( 1081 - "div,span,p,strong,h3,h4,h5,h6" 1082 - ) 1083 - ).filter(function(el){ 1084 - if(!visible(el))return false; 1085 - if(!themeFor(el.textContent))return false; 1010 + var bg= 1011 + style.backgroundColor&& 1012 + style.backgroundColor!=="rgba(0, 0, 0, 0)"&& 1013 + style.backgroundColor!=="transparent"; 1086 1086 1087 - return !Array.from( 1088 - el.children||[] 1089 - ).some(function(child){ 1090 - return !!themeFor( 1091 - child.textContent 1092 - ); 1093 - }); 1094 - }); 1095 - } 1096 - 1097 - function findOverviewCard(header){ 1098 - var node=header.parentElement; 1099 - var candidates=[]; 1100 - 1101 - while(node&&node!==root){ 1102 - var rect=node.getBoundingClientRect(); 1103 - var style=getComputedStyle(node); 1104 - 1105 1105 var border= 1106 1106 num(style.borderTopWidth)+ 1107 1107 num(style.borderRightWidth)+ ... ... @@ -1108,674 +1108,315 @@ 1108 1108 num(style.borderBottomWidth)+ 1109 1109 num(style.borderLeftWidth); 1110 1110 1111 - if( 1112 - rect.width>=220&& 1113 - rect.width<=800&& 1114 - rect.height>=120&& 1115 - border>=1 1116 - ){ 1117 - candidates.push(node); 1118 - } 1021 + var mostlyUpper= 1022 + text.length>=3&& 1023 + text===text.toUpperCase(); 1119 1119 1120 - node=node.parentElement; 1121 - } 1025 + var exact=exactKnownFirstSection(el); 1122 1122 1123 - if(!candidates.length)return null; 1027 + var score= 1028 + (exact?20:0)+ 1029 + (bg?6:0)+ 1030 + (border>=1?2:0)+ 1031 + (mostlyUpper?4:0)+ 1032 + (num(style.fontWeight)>=600?1:0); 1124 1124 1125 - candidates.sort(function(a,b){ 1126 - return ( 1127 - b.getBoundingClientRect().height- 1128 - a.getBoundingClientRect().height 1129 - ); 1034 + if(score>=7){ 1035 + candidates.push({ 1036 + el:el, 1037 + relativeTop:relativeTop, 1038 + width:r.width, 1039 + score:score 1040 + }); 1041 + } 1130 1130 }); 1131 1131 1132 - return candidates[0]; 1133 - } 1044 + if(!candidates.length)return null; 1134 1134 1135 - function rowCandidates(link,card){ 1136 - var result=[]; 1137 - var cardRect= 1138 - card.getBoundingClientRect(); 1139 - 1140 - var node=link; 1141 - 1142 - while(node&&node!==card){ 1143 - if(visible(node)){ 1144 - var rect= 1145 - node.getBoundingClientRect(); 1146 - 1147 - if( 1148 - rect.height<=105&& 1149 - rect.width>= 1150 - cardRect.width*.50&& 1151 - rect.width<= 1152 - cardRect.width*1.03 1153 - ){ 1154 - result.push(node); 1155 - } 1046 + candidates.sort(function(a,b){ 1047 + if(a.score!==b.score)return b.score-a.score; 1048 + if(Math.abs(a.relativeTop-b.relativeTop)>3){ 1049 + return a.relativeTop-b.relativeTop; 1156 1156 } 1051 + return b.width-a.width; 1052 + }); 1157 1157 1158 - node=node.parentElement; 1159 - } 1054 + // For exact known labels always prefer the earliest exact match. 1055 + var exacts=candidates.filter(function(c){ 1056 + return exactKnownFirstSection(c.el); 1057 + }); 1160 1160 1161 - return result; 1162 - } 1163 - 1164 - function chooseOuterRow( 1165 - candidates, 1166 - link 1167 - ){ 1168 - if(!candidates.length){ 1169 - return link; 1059 + if(exacts.length){ 1060 + exacts.sort(function(a,b){ 1061 + return a.relativeTop-b.relativeTop||b.width-a.width; 1062 + }); 1063 + return exacts[0].el; 1170 1170 } 1171 1171 1172 - var bordered= 1173 - candidates.filter(function(el){ 1174 - return ( 1175 - num( 1176 - getComputedStyle(el) 1177 - .borderLeftWidth 1178 - )>=1 1179 - ); 1180 - }); 1066 + // Generic fallback: earliest high-confidence bar. 1067 + candidates.sort(function(a,b){ 1068 + return a.relativeTop-b.relativeTop||b.score-a.score||b.width-a.width; 1069 + }); 1181 1181 1182 - var pool= 1183 - bordered.length 1184 - ?bordered 1185 - :candidates; 1071 + return candidates[0].el; 1072 + } 1186 1186 1187 - pool.sort(function(a,b){ 1188 - var ar= 1189 - a.getBoundingClientRect(); 1074 + function alignFirstSections(cards){ 1075 + var rows= 1076 + cards.map(function(card){ 1077 + var bar= 1078 + visuallyFirstSectionBar(card); 1190 1190 1191 - var br= 1192 - b.getBoundingClientRect(); 1080 + if(!bar)return null; 1193 1193 1194 - return ( 1195 - ar.left-br.left|| 1196 - br.width-ar.width 1197 - ); 1198 - }); 1082 + var cardRect= 1083 + card.getBoundingClientRect(); 1199 1199 1200 - ret urn pool[0]||link;1201 - }1085 + var barRect= 1086 + bar.getBoundingClientRect(); 1202 1202 1203 - function applyOverviewPalette(){ 1204 - if(PAGE_KIND!=="overview"){ 1205 - return []; 1088 + return { 1089 + card:card, 1090 + bar:bar, 1091 + relativeTop: 1092 + barRect.top-cardRect.top, 1093 + label: 1094 + normalizeText(bar.textContent) 1095 + }; 1096 + }); 1097 + 1098 + // Conservative: only align when every card in the horizontal row 1099 + // has a reliable first section bar. 1100 + if( 1101 + rows.some(function(row){ 1102 + return !row; 1103 + }) 1104 + ){ 1105 + return null; 1206 1206 } 1207 1207 1208 - var headers= 1209 - smallestThemeHeaders() 1210 - .map(function(el){ 1211 - return { 1212 - el:el, 1213 - theme: 1214 - themeFor( 1215 - el.textContent 1216 - ), 1217 - card: 1218 - findOverviewCard( 1219 - el 1220 - ) 1221 - }; 1108 + var targetTop= 1109 + Math.max.apply( 1110 + Math, 1111 + rows.map(function(row){ 1112 + return row.relativeTop; 1222 1222 }) 1223 - .filter(function(row){ 1224 - return !!row.card; 1225 - }); 1114 + ); 1226 1226 1227 - var unique=[]; 1228 - var seenHeaders=new Set(); 1116 + rows.forEach(function(row){ 1117 + var delta= 1118 + targetTop- 1119 + row.relativeTop; 1229 1229 1230 - headers.forEach(function(row){ 1231 - var key= 1232 - row.theme.name+ 1233 - "|"+ 1234 - Math.round( 1235 - row.card 1236 - .getBoundingClientRect() 1237 - .left 1238 - )+ 1239 - "|"+ 1240 - Math.round( 1241 - row.el 1242 - .getBoundingClientRect() 1243 - .top 1244 - ); 1121 + if(delta<=1)return; 1245 1245 1246 - if(!seenHeaders.has(key)){ 1247 - seenHeaders.add(key); 1248 - unique.push(row); 1249 - } 1250 - }); 1251 - 1252 - unique.forEach(function(row){ 1253 - var headerRect= 1254 - row.el 1255 - .getBoundingClientRect(); 1256 - 1257 - row.el.style.setProperty( 1258 - "background", 1259 - row.theme.bg, 1260 - "important" 1123 + saveOriginal( 1124 + row.bar, 1125 + originalMarginTop, 1126 + "margin-top" 1261 1261 ); 1262 1262 1263 - row.el.style.setProperty( 1264 - "color", 1265 - row.theme.text, 1266 - "important" 1267 - ); 1129 + var currentMargin= 1130 + num( 1131 + getComputedStyle( 1132 + row.bar 1133 + ).marginTop 1134 + ); 1268 1268 1269 - row.el.style.setProperty( 1270 - "text-align", 1271 - "left", 1272 - "important" 1136 + row.bar.style.setProperty( 1137 + "margin-top", 1138 + ( 1139 + currentMargin+ 1140 + delta 1141 + )+"px" 1273 1273 ); 1274 1274 1275 - row.el.style.setProperty( 1276 - "word-spacing", 1277 - "normal", 1278 - "important" 1144 + row.bar.setAttribute( 1145 + "data-sn-first-section-aligned", 1146 + "4" 1279 1279 ); 1280 1280 1281 - var later= 1282 - unique 1283 - .filter(function(other){ 1284 - return ( 1285 - other.card===row.card&& 1286 - other.el 1287 - .getBoundingClientRect() 1288 - .top> 1289 - headerRect.top+2 1290 - ); 1291 - }) 1292 - .sort(function(a,b){ 1293 - return ( 1294 - a.el 1295 - .getBoundingClientRect() 1296 - .top- 1297 - b.el 1298 - .getBoundingClientRect() 1299 - .top 1300 - ); 1301 - }); 1302 - 1303 - var stopTop= 1304 - later.length 1305 - ?later[0].el 1306 - .getBoundingClientRect() 1307 - .top 1308 - :Infinity; 1309 - 1310 - Array.from( 1311 - row.card.querySelectorAll("a") 1312 - ).forEach(function(link){ 1313 - if(!visible(link))return; 1314 - 1315 - var rect= 1316 - link.getBoundingClientRect(); 1317 - 1318 - if( 1319 - rect.top<= 1320 - headerRect.bottom-2|| 1321 - rect.top>= 1322 - stopTop-2 1323 - ){ 1324 - return; 1325 - } 1326 - 1327 - var candidates= 1328 - rowCandidates( 1329 - link, 1330 - row.card 1331 - ); 1332 - 1333 - var target= 1334 - chooseOuterRow( 1335 - candidates, 1336 - link 1337 - ); 1338 - 1339 - candidates.forEach(function(el){ 1340 - el.style.setProperty( 1341 - "border-left", 1342 - "0 solid transparent", 1343 - "important" 1344 - ); 1345 - }); 1346 - 1347 - target.style.setProperty( 1348 - "border-left", 1349 - "3px solid "+ 1350 - row.theme.accent, 1351 - "important" 1352 - ); 1353 - 1354 - target.style.setProperty( 1355 - "box-sizing", 1356 - "border-box", 1357 - "important" 1358 - ); 1359 - }); 1149 + sectionManaged.add(row.bar); 1360 1360 }); 1361 1361 1362 - return unique; 1152 + return { 1153 + labels: 1154 + rows.map(function(row){ 1155 + return row.label; 1156 + }), 1157 + targetRelativeTop: 1158 + Math.round(targetTop) 1159 + }; 1363 1363 } 1364 1364 1365 - /* ======================================================= 1366 - OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW 1367 - ======================================================= */ 1368 - 1369 - function alignOverviewCards(headers){ 1370 - if( 1371 - PAGE_KIND!=="overview"|| 1372 - window.innerWidth<=MOBILE_MAX 1373 - ){ 1374 - return; 1162 + function applyGroup(group){ 1163 + if(!validHorizontalGroup(group)){ 1164 + return null; 1375 1375 } 1376 1376 1377 1377 var cards=[]; 1378 1378 var seen=new Set(); 1379 1379 1380 - headers.forEach(function(row){1381 - if(!seen.has(r ow.card)){1382 - seen.add(r ow.card);1383 - cards.push(r ow.card);1170 + group.entries.forEach(function(entry){ 1171 + if(!seen.has(entry.target)){ 1172 + seen.add(entry.target); 1173 + cards.push(entry.target); 1384 1384 } 1385 1385 }); 1386 1386 1387 - if(cards.length<2){ 1388 - return; 1389 - } 1177 + if(cards.length<2)return null; 1390 1390 1391 - // Groupcardsby actual top position.1392 - vargroups=[];1179 + var firstSection= 1180 + alignFirstSections(cards); 1393 1393 1394 - cards.forEach(function(card){1395 - vartop=1396 - card.getBoundingClientRect().top;1182 + // The section alignment can change natural card heights. 1183 + // Measure only afterwards. 1184 + var maxHeight=0; 1397 1397 1398 - var group=null; 1399 - 1400 - for(var i=0;i<groups.length;i++){ 1401 - if( 1402 - Math.abs( 1403 - groups[i].top-top 1404 - )<=ROW_TOLERANCE 1405 - ){ 1406 - group=groups[i]; 1407 - break; 1408 - } 1409 - } 1410 - 1411 - if(!group){ 1412 - group={ 1413 - top:top, 1414 - cards:[] 1415 - }; 1416 - groups.push(group); 1417 - } 1418 - 1419 - group.cards.push(card); 1186 + cards.forEach(function(card){ 1187 + maxHeight=Math.max( 1188 + maxHeight, 1189 + card.getBoundingClientRect().height 1190 + ); 1420 1420 }); 1421 1421 1422 - groups.forEach(function(group){ 1423 - if(group.cards.length<2){ 1424 - return; 1425 - } 1193 + maxHeight=Math.ceil(maxHeight); 1426 1426 1427 - var firstHeaders= 1428 - group.cards.map(function(card){ 1429 - var candidates= 1430 - headers 1431 - .filter(function(row){ 1432 - return row.card===card; 1433 - }) 1434 - .sort(function(a,b){ 1435 - return ( 1436 - a.el 1437 - .getBoundingClientRect() 1438 - .top- 1439 - b.el 1440 - .getBoundingClientRect() 1441 - .top 1442 - ); 1443 - }); 1195 + if(maxHeight<MIN_H)return null; 1444 1444 1445 - return candidates.length 1446 - ?candidates[0] 1447 - :null; 1448 - }); 1197 + cards.forEach(function(card){ 1198 + saveOriginal( 1199 + card, 1200 + originalMinHeight, 1201 + "min-height" 1202 + ); 1449 1449 1450 - if( 1451 - !firstHeaders.some(function(row){ 1452 - return !row; 1453 - }) 1454 - ){ 1455 - var targetTop= 1456 - Math.max.apply( 1457 - Math, 1458 - firstHeaders.map(function(row){ 1459 - return ( 1460 - row.el 1461 - .getBoundingClientRect() 1462 - .top- 1463 - row.card 1464 - .getBoundingClientRect() 1465 - .top 1466 - ); 1467 - }) 1468 - ); 1204 + card.style.setProperty( 1205 + "min-height", 1206 + maxHeight+"px" 1207 + ); 1469 1469 1470 - firstHeaders.forEach(function(row){ 1471 - var relativeTop= 1472 - row.el 1473 - .getBoundingClientRect() 1474 - .top- 1475 - row.card 1476 - .getBoundingClientRect() 1477 - .top; 1209 + card.setAttribute( 1210 + "data-sn-equal-height-managed", 1211 + "4" 1212 + ); 1478 1478 1479 - var delta= 1480 - targetTop-relativeTop; 1481 - 1482 - if(delta>1){ 1483 - saveStyle( 1484 - row.el, 1485 - originalMargin, 1486 - "margin-top" 1487 - ); 1488 - 1489 - var current= 1490 - num( 1491 - getComputedStyle( 1492 - row.el 1493 - ).marginTop 1494 - ); 1495 - 1496 - row.el.style.setProperty( 1497 - "margin-top", 1498 - ( 1499 - current+delta 1500 - )+"px" 1501 - ); 1502 - 1503 - row.el.setAttribute( 1504 - "data-sn-master-first-row", 1505 - "1" 1506 - ); 1507 - 1508 - managedMargin.add( 1509 - row.el 1510 - ); 1511 - } 1512 - }); 1513 - } 1514 - 1515 - var maxHeight=0; 1516 - 1517 - group.cards.forEach(function(card){ 1518 - maxHeight= 1519 - Math.max( 1520 - maxHeight, 1521 - card 1522 - .getBoundingClientRect() 1523 - .height 1524 - ); 1525 - }); 1526 - 1527 - maxHeight= 1528 - Math.ceil(maxHeight); 1529 - 1530 - group.cards.forEach(function(card){ 1531 - saveStyle( 1532 - card, 1533 - originalHeight, 1534 - "min-height" 1535 - ); 1536 - 1537 - card.style.setProperty( 1538 - "min-height", 1539 - maxHeight+"px" 1540 - ); 1541 - 1542 - card.setAttribute( 1543 - "data-sn-master-equal-height", 1544 - "1" 1545 - ); 1546 - 1547 - managedHeight.add( 1548 - card 1549 - ); 1550 - }); 1214 + heightManaged.add(card); 1551 1551 }); 1216 + 1217 + return { 1218 + cards:cards.length, 1219 + height:maxHeight, 1220 + firstSection:firstSection 1221 + }; 1552 1552 } 1553 1553 1554 - /* ======================================================= 1555 - DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY 1556 - ======================================================= */ 1224 + function run(){ 1225 + reset(); 1557 1557 1558 - function equaliseDetailGrids(){ 1559 1559 if( 1560 - PAGE_KIND!=="detail"|| 1561 1561 window.innerWidth<=MOBILE_MAX 1562 1562 ){ 1563 1563 return; 1564 1564 } 1565 1565 1566 - var selectors=[ 1567 - ".arsn-grid", 1568 - ".arsn-grid-2", 1569 - ".arsn-grid-3", 1570 - ".dmp-grid", 1571 - ".ido-grid", 1572 - ".pp-grid" 1573 - ]; 1574 - 1575 - selectors.forEach(function(selector){ 1233 + var parents= 1576 1576 Array.from( 1577 - root.querySelectorAll(selector) 1578 - ).forEach(function(grid){ 1579 - var children= 1580 - Array.from( 1581 - grid.children||[] 1582 - ).filter(visible); 1235 + root.querySelectorAll("*") 1236 + ).filter(function(parent){ 1237 + return ( 1238 + visible(parent,MIN_W,MIN_H)&& 1239 + parent.children&& 1240 + parent.children.length>=2&& 1241 + parent.children.length<=MAX_PARENT_CHILDREN 1242 + ); 1243 + }); 1583 1583 1584 - if(children.length<2){ 1585 - return; 1586 - } 1245 + var touched=new Set(); 1587 1587 1588 - var groups=[]; 1247 + parents.forEach(function(parent){ 1248 + var entries=[]; 1589 1589 1590 - children.forEach(function(child){ 1591 - var top= 1592 - child 1593 - .getBoundingClientRect() 1594 - .top; 1250 + Array.from(parent.children).forEach(function(child){ 1251 + if(!visible(child,MIN_W,MIN_H))return; 1595 1595 1596 - var group=null; 1253 + var target=pickTarget(child); 1254 + if(!target)return; 1597 1597 1598 - for(var i=0;i<groups.length;i++){ 1599 - if( 1600 - Math.abs( 1601 - groups[i].top-top 1602 - )<=ROW_TOLERANCE 1603 - ){ 1604 - group=groups[i]; 1605 - break; 1606 - } 1607 - } 1608 - 1609 - if(!group){ 1610 - group={ 1611 - top:top, 1612 - items:[] 1613 - }; 1614 - groups.push(group); 1615 - } 1616 - 1617 - group.items.push(child); 1256 + entries.push({ 1257 + target:target, 1258 + rect:target.getBoundingClientRect() 1618 1618 }); 1260 + }); 1619 1619 1620 - groups.forEach(function(group){ 1621 - if(group.items.length<2){ 1622 - return; 1623 - } 1262 + if(entries.length<2)return; 1624 1624 1625 - var maxHeight=0; 1264 + groupsByVisualRow(entries).forEach(function(group){ 1265 + if(!validHorizontalGroup(group))return; 1626 1626 1627 - group.items.forEach(function(item){ 1628 - maxHeight= 1629 - Math.max( 1630 - maxHeight, 1631 - item 1632 - .getBoundingClientRect() 1633 - .height 1634 - ); 1267 + var signature= 1268 + group.entries.map(function(entry){ 1269 + return entry.target; 1635 1635 }); 1636 1636 1637 - maxHeight= 1638 - Math.ceil(maxHeight); 1272 + if( 1273 + !signature.some(function(el){ 1274 + return !touched.has(el); 1275 + }) 1276 + ){ 1277 + return; 1278 + } 1639 1639 1640 - group.items.forEach(function(item){ 1641 - saveStyle( 1642 - item, 1643 - originalHeight, 1644 - "min-height" 1645 - ); 1280 + var applied= 1281 + applyGroup(group); 1646 1646 1647 - item.style.setProperty( 1648 - "min-height", 1649 - maxHeight+"px" 1650 - ); 1651 - 1652 - item.setAttribute( 1653 - "data-sn-master-equal-height", 1654 - "1" 1655 - ); 1656 - 1657 - managedHeight.add(item); 1283 + if(applied){ 1284 + signature.forEach(function(el){ 1285 + touched.add(el); 1658 1658 }); 1659 - } );1287 + } 1660 1660 }); 1661 1661 }); 1662 1662 } 1663 1663 1664 - /* ======================================================= 1665 - RUN / RESPONSIVE SCHEDULING 1666 - ======================================================= */ 1292 + function schedule(){ 1293 + if(raf)cancelAnimationFrame(raf); 1667 1667 1668 - function run(){ 1669 - if(running)return; 1670 - 1671 - running=true; 1672 - 1673 - try{ 1674 - resetRuntime(); 1675 - applyPlaceholderBadge(); 1676 - propagateDetailAccents(); 1677 - 1678 - var headers= 1679 - applyOverviewPalette(); 1680 - 1681 - if( 1682 - window.innerWidth> 1683 - MOBILE_MAX 1684 - ){ 1685 - alignOverviewCards( 1686 - headers 1687 - ); 1688 - 1689 - equaliseDetailGrids(); 1690 - } 1691 - }finally{ 1692 - running=false; 1693 - } 1295 + raf=requestAnimationFrame(function(){ 1296 + raf=requestAnimationFrame(function(){ 1297 + raf=0; 1298 + run(); 1299 + }); 1300 + }); 1694 1694 } 1695 1695 1696 - function onResize(){ 1697 - if(resizeTimer){ 1698 - clearTimeout( 1699 - resizeTimer 1700 - ); 1701 - } 1303 + addEventListener("resize",schedule,{passive:true}); 1304 + addEventListener("load",schedule,{once:true}); 1702 1702 1703 - resizeTimer= 1704 - setTimeout( 1705 - function(){ 1706 - resizeTimer=0; 1707 - run(); 1708 - }, 1709 - RESIZE_DEBOUNCE 1710 - ); 1711 - } 1306 + root.addEventListener( 1307 + "click", 1308 + function(){ 1309 + setTimeout(schedule,0); 1310 + }, 1311 + true 1312 + ); 1712 1712 1713 - async function waitForReady(){ 1714 - if( 1715 - document.readyState!=="complete" 1716 - ){ 1717 - await new Promise(function(resolve){ 1718 - window.addEventListener( 1719 - "load", 1720 - resolve, 1721 - {once:true} 1722 - ); 1723 - }); 1314 + Array.from(root.querySelectorAll("img")).forEach(function(img){ 1315 + if(!img.complete){ 1316 + img.addEventListener("load",schedule,{once:true}); 1724 1724 } 1318 + }); 1725 1725 1726 - if( 1727 - document.fonts&& 1728 - document.fonts.ready 1729 - ){ 1730 - try{ 1731 - await document.fonts.ready; 1732 - }catch(error){} 1733 - } 1734 - 1735 - var images= 1736 - Array.from( 1737 - root.querySelectorAll("img") 1738 - ); 1739 - 1740 - await Promise.all( 1741 - images.map(function(img){ 1742 - if(img.complete){ 1743 - return Promise.resolve(); 1744 - } 1745 - 1746 - return new Promise(function(resolve){ 1747 - var done=function(){ 1748 - resolve(); 1749 - }; 1750 - 1751 - img.addEventListener( 1752 - "load", 1753 - done, 1754 - {once:true} 1755 - ); 1756 - 1757 - img.addEventListener( 1758 - "error", 1759 - done, 1760 - {once:true} 1761 - ); 1762 - }); 1763 - }) 1764 - ); 1765 - 1766 - run(); 1320 + if(document.fonts&&document.fonts.ready){ 1321 + document.fonts.ready.then(schedule); 1767 1767 } 1768 1768 1769 - window.addEventListener( 1770 - "resize", 1771 - onResize, 1772 - {passive:true} 1773 - ); 1774 - 1775 - waitForReady(); 1324 + schedule(); 1325 + setTimeout(schedule,200); 1326 + setTimeout(schedule,650); 1327 + setTimeout(schedule,1400); 1776 1776 })(); 1777 1777 </script> 1778 - 1779 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END --> 1330 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_END --> 1780 1780 {{/html}} 1781 1781