Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45

From version 9.3
edited by Veronika Kocher
on Thursday, 03 Sep 2026 9:18
Change comment: There is no comment for this version
To version 9.6
edited by Veronika Kocher
on Thursday, 03 Sep 2026 13:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -426,21 +426,100 @@
426 426  {{/html}}
427 427  
428 428  {{html clean="false"}}
429 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
430 -<style data-sn-horizontal-box-harmonizer="1">
431 -[data-sn-equal-height-managed="1"]{box-sizing:border-box}
432 -@media(max-width:767px){
433 - [data-sn-equal-height-managed="1"]{min-height:0!important}
429 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
430 +
431 +<style data-sn-service-navigator-master="1">
432 +/* =========================================================
433 + MASTER TYPOGRAPHY
434 + ========================================================= */
435 +#xwikicontent h1,
436 +#xwikicontent h2,
437 +#xwikicontent h3,
438 +#xwikicontent h4,
439 +#xwikicontent h5,
440 +#xwikicontent h6,
441 +#xwikicontent .box-title,
442 +#xwikicontent [role="heading"],
443 +#xwikicontent h1 a,
444 +#xwikicontent h2 a,
445 +#xwikicontent h3 a,
446 +#xwikicontent h4 a,
447 +#xwikicontent h5 a,
448 +#xwikicontent h6 a,
449 +#xwikicontent .box-title a,
450 +#xwikicontent [role="heading"] a{
451 + text-align:left!important;
452 + text-justify:auto!important;
453 + word-spacing:normal!important;
434 434  }
455 +
456 +/* =========================================================
457 + COMING SOON / IN VORBEREITUNG
458 + ========================================================= */
459 +.sn-coming-soon-badge{
460 + display:inline-block;
461 + vertical-align:middle;
462 + margin-left:10px;
463 + padding:4px 8px;
464 + border-radius:14px;
465 + border:1px solid #efd9cc;
466 + background:#fff4ee;
467 + color:#8a4d36;
468 + font-size:11px;
469 + font-weight:700;
470 + letter-spacing:.055em;
471 + line-height:1.2;
472 + white-space:nowrap;
473 +}
474 +
475 +/* =========================================================
476 + NATIVE / DETAIL CALLOUT GEOMETRY
477 + Preserve existing backgrounds.
478 + ========================================================= */
479 +#xwikicontent .arsn-info,
480 +#xwikicontent .dmp-info,
481 +#xwikicontent .ido-info,
482 +#xwikicontent .pp-info,
483 +#xwikicontent .infomessage{
484 + box-sizing:border-box!important;
485 + border-left:4px solid #21b6d7!important;
486 + border-radius:8px;
487 + text-align:left!important;
488 + word-spacing:normal!important;
489 +}
490 +
491 +#xwikicontent .arsn-warn,
492 +#xwikicontent .dmp-warn,
493 +#xwikicontent .ido-warn,
494 +#xwikicontent .pp-warn,
495 +#xwikicontent .warn,
496 +#xwikicontent .warning,
497 +#xwikicontent .warningmessage,
498 +#xwikicontent .errormessage{
499 + box-sizing:border-box!important;
500 + border-left:4px solid #e94b13!important;
501 + border-radius:8px;
502 + text-align:left!important;
503 + word-spacing:normal!important;
504 +}
505 +
506 +[data-sn-master-equal-height],
507 +[data-sn-master-first-row]{
508 + box-sizing:border-box;
509 +}
435 435  </style>
436 -<script data-sn-horizontal-box-harmonizer="1">
511 +
512 +<script data-sn-service-navigator-master="1">
437 437  (function(){
438 438   "use strict";
439 439  
516 + var PAGE_KIND="detail";
517 + var PLACEHOLDER=false;
518 + var PLACEHOLDER_LABEL="COMING SOON";
519 +
440 440   var MOBILE_MAX=767;
441 - var ROW_TOLERANCE=4;
442 - var MIN_W=150;
443 - var MIN_H=36;
521 + var ROW_TOLERANCE=6;
522 + var RESIZE_DEBOUNCE=220;
444 444  
445 445   var root=
446 446   document.getElementById("xwikicontent")||
... ... @@ -450,212 +450,1044 @@
450 450  
451 451   if(!root)return;
452 452  
453 - var managed=new Set();
454 - var raf=0;
532 + var managedHeight=new Set();
533 + var managedMargin=new Set();
534 + var originalHeight=new WeakMap();
535 + var originalMargin=new WeakMap();
455 455  
456 - function num(v){
457 - var n=parseFloat(v);
537 + var resizeTimer=0;
538 + var running=false;
539 +
540 + var THEMES=[
541 + {
542 + name:"BLUE",
543 + accent:"#21b6d7",
544 + bg:"#eaf7fb",
545 + text:"#315d68",
546 + labels:[
547 + "HIER STARTEN",
548 + "ENTSCHEIDEN",
549 + "ÜBERPRÜFEN & ANPASSEN",
550 + "START HERE",
551 + "DECIDE",
552 + "REVIEW & ADAPT"
553 + ]
554 + },
555 + {
556 + name:"RED",
557 + accent:"#e94b13",
558 + bg:"#fff1ec",
559 + text:"#8a4d36",
560 + labels:[
561 + "PLANEN & ORGANISIEREN",
562 + "ORGANISIEREN & DOKUMENTIEREN",
563 + "PUBLIZIEREN & PRÄSENTIEREN",
564 + "PLAN & ORGANISE",
565 + "PLAN & ORGANIZE",
566 + "ORGANISE & DOCUMENT",
567 + "ORGANIZE & DOCUMENT",
568 + "PUBLISH & PRESENT"
569 + ]
570 + },
571 + {
572 + name:"YELLOW",
573 + accent:"#f0aa00",
574 + bg:"#fff8e7",
575 + text:"#785b17",
576 + labels:[
577 + "SCHÜTZEN & KLÄREN",
578 + "STANDARDISIEREN & IDENTIFIZIEREN",
579 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
580 + "PROTECT & CLARIFY",
581 + "STANDARDISE & IDENTIFY",
582 + "STANDARDIZE & IDENTIFY",
583 + "OPEN, REUSE & MAKE FINDABLE"
584 + ]
585 + },
586 + {
587 + name:"GREEN",
588 + accent:"#38b76a",
589 + bg:"#edf9f1",
590 + text:"#3f7451",
591 + labels:[
592 + "INFRASTRUKTUR EINRICHTEN",
593 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
594 + "SPEICHERN & ZUGRIFF STEUERN",
595 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
596 + "SET UP INFRASTRUCTURE",
597 + "SET UP INFRASTRUCTURE & COLLABORATION",
598 + "STORE & CONTROL ACCESS",
599 + "REPOSITORY, PRESERVE & HAND OVER"
600 + ]
601 + }
602 + ];
603 +
604 + function num(value){
605 + var n=parseFloat(value);
458 458   return Number.isFinite(n)?n:0;
459 459   }
460 460  
609 + function norm(value){
610 + return String(value||"")
611 + .replace(/\s+/g," ")
612 + .trim()
613 + .toUpperCase();
614 + }
615 +
461 461   function visible(el){
462 462   if(!el||el.nodeType!==1)return false;
463 - var s=getComputedStyle(el);
464 - if(s.display==="none"||s.visibility==="hidden"||Number(s.opacity)===0)return false;
465 - var r=el.getBoundingClientRect();
466 - return r.width>=MIN_W&&r.height>=MIN_H;
618 +
619 + var style=getComputedStyle(el);
620 + var rect=el.getBoundingClientRect();
621 +
622 + return (
623 + style.display!=="none"&&
624 + style.visibility!=="hidden"&&
625 + rect.width>20&&
626 + rect.height>4
627 + );
467 467   }
468 468  
469 - function excluded(el){
470 - return !el.matches||el.matches(
471 - "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]"
630 + function saveStyle(el,map,property){
631 + if(map.has(el))return;
632 +
633 + map.set(el,{
634 + value:el.style.getPropertyValue(property),
635 + priority:el.style.getPropertyPriority(property)
636 + });
637 + }
638 +
639 + function restoreStyle(el,map,property){
640 + var original=map.get(el);
641 +
642 + if(original&&original.value){
643 + el.style.setProperty(
644 + property,
645 + original.value,
646 + original.priority||""
647 + );
648 + }else{
649 + el.style.removeProperty(property);
650 + }
651 + }
652 +
653 + function resetRuntime(){
654 + managedHeight.forEach(function(el){
655 + restoreStyle(
656 + el,
657 + originalHeight,
658 + "min-height"
659 + );
660 + el.removeAttribute(
661 + "data-sn-master-equal-height"
662 + );
663 + });
664 +
665 + managedMargin.forEach(function(el){
666 + restoreStyle(
667 + el,
668 + originalMargin,
669 + "margin-top"
670 + );
671 + el.removeAttribute(
672 + "data-sn-master-first-row"
673 + );
674 + });
675 +
676 + managedHeight.clear();
677 + managedMargin.clear();
678 + }
679 +
680 + function themeFor(text){
681 + var value=norm(text);
682 +
683 + for(var i=0;i<THEMES.length;i++){
684 + for(var j=0;j<THEMES[i].labels.length;j++){
685 + var label=THEMES[i].labels[j];
686 +
687 + if(
688 + value===label||
689 + value.indexOf(label+" ")===0||
690 + value.indexOf(label+" -")===0||
691 + value.indexOf(label+" ·")===0
692 + ){
693 + return THEMES[i];
694 + }
695 + }
696 + }
697 +
698 + return null;
699 + }
700 +
701 + /* =======================================================
702 + PLACEHOLDER BADGE
703 + ======================================================= */
704 +
705 + function applyPlaceholderBadge(){
706 + if(!PLACEHOLDER)return;
707 +
708 + if(
709 + document.querySelector(
710 + ".sn-coming-soon-badge"
711 + )
712 + ){
713 + return;
714 + }
715 +
716 + var title=
717 + document.querySelector(
718 + "#document-title"
719 + )||
720 + document.querySelector(
721 + "h1"
722 + );
723 +
724 + if(!title)return;
725 +
726 + var badge=
727 + document.createElement(
728 + "span"
729 + );
730 +
731 + badge.className=
732 + "sn-coming-soon-badge";
733 +
734 + badge.textContent=
735 + PLACEHOLDER_LABEL;
736 +
737 + badge.setAttribute(
738 + "aria-label",
739 + PLACEHOLDER_LABEL
472 472   );
741 +
742 + title.appendChild(
743 + badge
744 + );
473 473   }
474 474  
475 - function namedLikeBox(el){
476 - var c=typeof el.className==="string"?el.className:"";
477 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
747 + /* =======================================================
748 + DETAIL PAGE OWN-ACCENT PROPAGATION
749 + ======================================================= */
750 +
751 + function parseRGB(value){
752 + var match=String(value||"").match(
753 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
754 + );
755 +
756 + if(!match)return null;
757 +
758 + return [
759 + Number(match[1]),
760 + Number(match[2]),
761 + Number(match[3])
762 + ];
478 478   }
479 479  
480 - function boxLike(el){
481 - if(!visible(el)||excluded(el))return false;
482 - var s=getComputedStyle(el);
483 - var r=el.getBoundingClientRect();
484 - var border=
485 - num(s.borderTopWidth)+num(s.borderRightWidth)+
486 - num(s.borderBottomWidth)+num(s.borderLeftWidth);
487 - var radius=Math.max(
488 - num(s.borderTopLeftRadius),num(s.borderTopRightRadius),
489 - num(s.borderBottomLeftRadius),num(s.borderBottomRightRadius)
765 + function distance(a,b){
766 + return Math.sqrt(
767 + Math.pow(a[0]-b[0],2)+
768 + Math.pow(a[1]-b[1],2)+
769 + Math.pow(a[2]-b[2],2)
490 490   );
491 - var bg=s.backgroundColor&&s.backgroundColor!=="rgba(0, 0, 0, 0)"&&s.backgroundColor!=="transparent";
492 - var shadow=s.boxShadow&&s.boxShadow!=="none";
493 - return namedLikeBox(el)||border>=1||(bg&&radius>=3)||(shadow&&r.width>=180);
494 494   }
495 495  
496 - function pickTarget(child){
497 - if(!visible(child))return null;
498 - if(boxLike(child))return child;
773 + function paletteMatch(cssColor){
774 + var rgb=parseRGB(cssColor);
499 499  
500 - var cr=child.getBoundingClientRect();
501 - var q=[];
502 - Array.from(child.children||[]).forEach(function(el){
503 - q.push({el:el,depth:1});
776 + if(!rgb)return null;
777 +
778 + var palette=[
779 + {hex:"#21b6d7",rgb:[33,182,215]},
780 + {hex:"#e94b13",rgb:[233,75,19]},
781 + {hex:"#f0aa00",rgb:[240,170,0]},
782 + {hex:"#38b76a",rgb:[56,183,106]}
783 + ];
784 +
785 + var best=null;
786 + var bestDistance=Infinity;
787 +
788 + palette.forEach(function(item){
789 + var d=distance(rgb,item.rgb);
790 +
791 + if(d<bestDistance){
792 + best=item;
793 + bestDistance=d;
794 + }
504 504   });
505 505  
506 - var best=null,bestScore=-1;
797 + return bestDistance<=30
798 + ?best
799 + :null;
800 + }
507 507  
508 - while(q.length){
509 - var item=q.shift();
510 - var el=item.el;
511 - if(!visible(el))continue;
802 + function propagateDetailAccents(){
803 + if(PAGE_KIND!=="detail")return;
512 512  
513 - var r=el.getBoundingClientRect();
805 + Array.from(
806 + root.querySelectorAll(
807 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
808 + ".arsn-source,.dmp-source,.ido-source,.pp-source"
809 + )
810 + ).forEach(function(el){
811 + if(!visible(el))return;
514 514  
515 - if(r.width>=cr.width*.72&&boxLike(el)){
516 - var widthFit=1-Math.min(1,Math.abs(cr.width-r.width)/Math.max(1,cr.width));
517 - var topFit=1-Math.min(1,Math.abs(cr.top-r.top)/80);
518 - var score=widthFit*5+topFit*2+Math.min(r.height,600)/600;
519 - if(score>bestScore){
520 - best=el;
521 - bestScore=score;
813 + var style=getComputedStyle(el);
814 +
815 + if(
816 + num(style.borderTopWidth)>=2
817 + ){
818 + var match=
819 + paletteMatch(
820 + style.borderTopColor
821 + );
822 +
823 + if(match){
824 + el.style.setProperty(
825 + "border-left",
826 + "4px solid "+match.hex,
827 + "important"
828 + );
522 522   }
523 523   }
831 + });
524 524  
525 - if(item.depth<3){
526 - Array.from(el.children||[]).forEach(function(next){
527 - q.push({el:next,depth:item.depth+1});
528 - });
833 + // Warning families: explicit safety override.
834 + Array.from(
835 + root.querySelectorAll(
836 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
837 + ".warn,.warning,.warningmessage,.errormessage"
838 + )
839 + ).forEach(function(el){
840 + if(!visible(el))return;
841 +
842 + el.style.setProperty(
843 + "border-left",
844 + "4px solid #e94b13",
845 + "important"
846 + );
847 + });
848 +
849 + // Info families: explicit orientation override.
850 + Array.from(
851 + root.querySelectorAll(
852 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
853 + )
854 + ).forEach(function(el){
855 + if(!visible(el))return;
856 +
857 + el.style.setProperty(
858 + "border-left",
859 + "4px solid #21b6d7",
860 + "important"
861 + );
862 + });
863 + }
864 +
865 + /* =======================================================
866 + OVERVIEW SEMANTIC THEME PALETTE
867 + ======================================================= */
868 +
869 + function smallestThemeHeaders(){
870 + return Array.from(
871 + root.querySelectorAll(
872 + "div,span,p,strong,h3,h4,h5,h6"
873 + )
874 + ).filter(function(el){
875 + if(!visible(el))return false;
876 + if(!themeFor(el.textContent))return false;
877 +
878 + return !Array.from(
879 + el.children||[]
880 + ).some(function(child){
881 + return !!themeFor(
882 + child.textContent
883 + );
884 + });
885 + });
886 + }
887 +
888 + function findOverviewCard(header){
889 + var node=header.parentElement;
890 + var candidates=[];
891 +
892 + while(node&&node!==root){
893 + var rect=node.getBoundingClientRect();
894 + var style=getComputedStyle(node);
895 +
896 + var border=
897 + num(style.borderTopWidth)+
898 + num(style.borderRightWidth)+
899 + num(style.borderBottomWidth)+
900 + num(style.borderLeftWidth);
901 +
902 + if(
903 + rect.width>=220&&
904 + rect.width<=800&&
905 + rect.height>=120&&
906 + border>=1
907 + ){
908 + candidates.push(node);
529 529   }
910 +
911 + node=node.parentElement;
530 530   }
531 531  
532 - return best;
914 + if(!candidates.length)return null;
915 +
916 + candidates.sort(function(a,b){
917 + return (
918 + b.getBoundingClientRect().height-
919 + a.getBoundingClientRect().height
920 + );
921 + });
922 +
923 + return candidates[0];
533 533   }
534 534  
535 - function reset(){
536 - managed.forEach(function(el){
537 - el.style.removeProperty("min-height");
538 - el.removeAttribute("data-sn-equal-height-managed");
926 + function rowCandidates(link,card){
927 + var result=[];
928 + var cardRect=
929 + card.getBoundingClientRect();
930 +
931 + var node=link;
932 +
933 + while(node&&node!==card){
934 + if(visible(node)){
935 + var rect=
936 + node.getBoundingClientRect();
937 +
938 + if(
939 + rect.height<=105&&
940 + rect.width>=
941 + cardRect.width*.50&&
942 + rect.width<=
943 + cardRect.width*1.03
944 + ){
945 + result.push(node);
946 + }
947 + }
948 +
949 + node=node.parentElement;
950 + }
951 +
952 + return result;
953 + }
954 +
955 + function chooseOuterRow(
956 + candidates,
957 + link
958 + ){
959 + if(!candidates.length){
960 + return link;
961 + }
962 +
963 + var bordered=
964 + candidates.filter(function(el){
965 + return (
966 + num(
967 + getComputedStyle(el)
968 + .borderLeftWidth
969 + )>=1
970 + );
971 + });
972 +
973 + var pool=
974 + bordered.length
975 + ?bordered
976 + :candidates;
977 +
978 + pool.sort(function(a,b){
979 + var ar=
980 + a.getBoundingClientRect();
981 +
982 + var br=
983 + b.getBoundingClientRect();
984 +
985 + return (
986 + ar.left-br.left||
987 + br.width-ar.width
988 + );
539 539   });
540 - managed.clear();
990 +
991 + return pool[0]||link;
541 541   }
542 542  
543 - function horizontalLayout(parent){
544 - if(!visible(parent))return false;
545 - var s=getComputedStyle(parent);
546 - if(s.display==="grid"||s.display==="inline-grid")return true;
547 - if(s.display==="flex"||s.display==="inline-flex"){
548 - return s.flexDirection==="row"||s.flexDirection==="row-reverse";
994 + function applyOverviewPalette(){
995 + if(PAGE_KIND!=="overview"){
996 + return [];
549 549   }
550 - return false;
998 +
999 + var headers=
1000 + smallestThemeHeaders()
1001 + .map(function(el){
1002 + return {
1003 + el:el,
1004 + theme:
1005 + themeFor(
1006 + el.textContent
1007 + ),
1008 + card:
1009 + findOverviewCard(
1010 + el
1011 + )
1012 + };
1013 + })
1014 + .filter(function(row){
1015 + return !!row.card;
1016 + });
1017 +
1018 + var unique=[];
1019 + var seenHeaders=new Set();
1020 +
1021 + headers.forEach(function(row){
1022 + var key=
1023 + row.theme.name+
1024 + "|"+
1025 + Math.round(
1026 + row.card
1027 + .getBoundingClientRect()
1028 + .left
1029 + )+
1030 + "|"+
1031 + Math.round(
1032 + row.el
1033 + .getBoundingClientRect()
1034 + .top
1035 + );
1036 +
1037 + if(!seenHeaders.has(key)){
1038 + seenHeaders.add(key);
1039 + unique.push(row);
1040 + }
1041 + });
1042 +
1043 + unique.forEach(function(row){
1044 + var headerRect=
1045 + row.el
1046 + .getBoundingClientRect();
1047 +
1048 + row.el.style.setProperty(
1049 + "background",
1050 + row.theme.bg,
1051 + "important"
1052 + );
1053 +
1054 + row.el.style.setProperty(
1055 + "color",
1056 + row.theme.text,
1057 + "important"
1058 + );
1059 +
1060 + row.el.style.setProperty(
1061 + "text-align",
1062 + "left",
1063 + "important"
1064 + );
1065 +
1066 + row.el.style.setProperty(
1067 + "word-spacing",
1068 + "normal",
1069 + "important"
1070 + );
1071 +
1072 + var later=
1073 + unique
1074 + .filter(function(other){
1075 + return (
1076 + other.card===row.card&&
1077 + other.el
1078 + .getBoundingClientRect()
1079 + .top>
1080 + headerRect.top+2
1081 + );
1082 + })
1083 + .sort(function(a,b){
1084 + return (
1085 + a.el
1086 + .getBoundingClientRect()
1087 + .top-
1088 + b.el
1089 + .getBoundingClientRect()
1090 + .top
1091 + );
1092 + });
1093 +
1094 + var stopTop=
1095 + later.length
1096 + ?later[0].el
1097 + .getBoundingClientRect()
1098 + .top
1099 + :Infinity;
1100 +
1101 + Array.from(
1102 + row.card.querySelectorAll("a")
1103 + ).forEach(function(link){
1104 + if(!visible(link))return;
1105 +
1106 + var rect=
1107 + link.getBoundingClientRect();
1108 +
1109 + if(
1110 + rect.top<=
1111 + headerRect.bottom-2||
1112 + rect.top>=
1113 + stopTop-2
1114 + ){
1115 + return;
1116 + }
1117 +
1118 + var candidates=
1119 + rowCandidates(
1120 + link,
1121 + row.card
1122 + );
1123 +
1124 + var target=
1125 + chooseOuterRow(
1126 + candidates,
1127 + link
1128 + );
1129 +
1130 + candidates.forEach(function(el){
1131 + el.style.setProperty(
1132 + "border-left",
1133 + "0 solid transparent",
1134 + "important"
1135 + );
1136 + });
1137 +
1138 + target.style.setProperty(
1139 + "border-left",
1140 + "3px solid "+
1141 + row.theme.accent,
1142 + "important"
1143 + );
1144 +
1145 + target.style.setProperty(
1146 + "box-sizing",
1147 + "border-box",
1148 + "important"
1149 + );
1150 + });
1151 + });
1152 +
1153 + return unique;
551 551   }
552 552  
553 - function rowGroups(entries){
1156 + /* =======================================================
1157 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1158 + ======================================================= */
1159 +
1160 + function alignOverviewCards(headers){
1161 + if(
1162 + PAGE_KIND!=="overview"||
1163 + window.innerWidth<=MOBILE_MAX
1164 + ){
1165 + return;
1166 + }
1167 +
1168 + var cards=[];
1169 + var seen=new Set();
1170 +
1171 + headers.forEach(function(row){
1172 + if(!seen.has(row.card)){
1173 + seen.add(row.card);
1174 + cards.push(row.card);
1175 + }
1176 + });
1177 +
1178 + if(cards.length<2){
1179 + return;
1180 + }
1181 +
1182 + // Group cards by actual top position.
554 554   var groups=[];
555 - entries.slice().sort(function(a,b){
556 - return a.rect.top-b.rect.top||a.rect.left-b.rect.left;
557 - }).forEach(function(entry){
1184 +
1185 + cards.forEach(function(card){
1186 + var top=
1187 + card.getBoundingClientRect().top;
1188 +
558 558   var group=null;
1190 +
559 559   for(var i=0;i<groups.length;i++){
560 - if(Math.abs(groups[i].top-entry.rect.top)<=ROW_TOLERANCE){
1192 + if(
1193 + Math.abs(
1194 + groups[i].top-top
1195 + )<=ROW_TOLERANCE
1196 + ){
561 561   group=groups[i];
562 562   break;
563 563   }
564 564   }
1201 +
565 565   if(!group){
566 - group={top:entry.rect.top,entries:[]};
1203 + group={
1204 + top:top,
1205 + cards:[]
1206 + };
567 567   groups.push(group);
568 568   }
569 - group.entries.push(entry);
1209 +
1210 + group.cards.push(card);
570 570   });
571 - return groups;
572 - }
573 573  
574 - function run(){
575 - reset();
1213 + groups.forEach(function(group){
1214 + if(group.cards.length<2){
1215 + return;
1216 + }
576 576  
577 - if(window.innerWidth<=MOBILE_MAX)return;
1218 + var firstHeaders=
1219 + group.cards.map(function(card){
1220 + var candidates=
1221 + headers
1222 + .filter(function(row){
1223 + return row.card===card;
1224 + })
1225 + .sort(function(a,b){
1226 + return (
1227 + a.el
1228 + .getBoundingClientRect()
1229 + .top-
1230 + b.el
1231 + .getBoundingClientRect()
1232 + .top
1233 + );
1234 + });
578 578  
579 - var parents=Array.from(root.querySelectorAll("*")).filter(function(el){
580 - return el.children&&el.children.length>=2&&horizontalLayout(el);
581 - });
1236 + return candidates.length
1237 + ?candidates[0]
1238 + :null;
1239 + });
582 582  
583 - parents.forEach(function(parent){
584 - var entries=[];
1241 + if(
1242 + !firstHeaders.some(function(row){
1243 + return !row;
1244 + })
1245 + ){
1246 + var targetTop=
1247 + Math.max.apply(
1248 + Math,
1249 + firstHeaders.map(function(row){
1250 + return (
1251 + row.el
1252 + .getBoundingClientRect()
1253 + .top-
1254 + row.card
1255 + .getBoundingClientRect()
1256 + .top
1257 + );
1258 + })
1259 + );
585 585  
586 - Array.from(parent.children).forEach(function(child){
587 - if(!visible(child))return;
588 - var target=pickTarget(child);
589 - if(!target)return;
590 - entries.push({
591 - target:target,
592 - rect:target.getBoundingClientRect()
1261 + firstHeaders.forEach(function(row){
1262 + var relativeTop=
1263 + row.el
1264 + .getBoundingClientRect()
1265 + .top-
1266 + row.card
1267 + .getBoundingClientRect()
1268 + .top;
1269 +
1270 + var delta=
1271 + targetTop-relativeTop;
1272 +
1273 + if(delta>1){
1274 + saveStyle(
1275 + row.el,
1276 + originalMargin,
1277 + "margin-top"
1278 + );
1279 +
1280 + var current=
1281 + num(
1282 + getComputedStyle(
1283 + row.el
1284 + ).marginTop
1285 + );
1286 +
1287 + row.el.style.setProperty(
1288 + "margin-top",
1289 + (
1290 + current+delta
1291 + )+"px"
1292 + );
1293 +
1294 + row.el.setAttribute(
1295 + "data-sn-master-first-row",
1296 + "1"
1297 + );
1298 +
1299 + managedMargin.add(
1300 + row.el
1301 + );
1302 + }
593 593   });
1304 + }
1305 +
1306 + var maxHeight=0;
1307 +
1308 + group.cards.forEach(function(card){
1309 + maxHeight=
1310 + Math.max(
1311 + maxHeight,
1312 + card
1313 + .getBoundingClientRect()
1314 + .height
1315 + );
594 594   });
595 595  
596 - if(entries.length<2)return;
1318 + maxHeight=
1319 + Math.ceil(maxHeight);
597 597  
598 - rowGroups(entries).forEach(function(group){
599 - if(group.entries.length<2)return;
1321 + group.cards.forEach(function(card){
1322 + saveStyle(
1323 + card,
1324 + originalHeight,
1325 + "min-height"
1326 + );
600 600  
601 - var lefts=group.entries.map(function(e){return e.rect.left;}).sort(function(a,b){return a-b;});
602 - if(lefts[lefts.length-1]-lefts[0]<80)return;
1328 + card.style.setProperty(
1329 + "min-height",
1330 + maxHeight+"px"
1331 + );
603 603  
604 - var targets=[];
605 - var seen=new Set();
1333 + card.setAttribute(
1334 + "data-sn-master-equal-height",
1335 + "1"
1336 + );
606 606  
607 - group.entries.forEach(function(e){
608 - if(!seen.has(e.target)){
609 - seen.add(e.target);
610 - targets.push(e.target);
1338 + managedHeight.add(
1339 + card
1340 + );
1341 + });
1342 + });
1343 + }
1344 +
1345 + /* =======================================================
1346 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1347 + ======================================================= */
1348 +
1349 + function equaliseDetailGrids(){
1350 + if(
1351 + PAGE_KIND!=="detail"||
1352 + window.innerWidth<=MOBILE_MAX
1353 + ){
1354 + return;
1355 + }
1356 +
1357 + var selectors=[
1358 + ".arsn-grid",
1359 + ".arsn-grid-2",
1360 + ".arsn-grid-3",
1361 + ".dmp-grid",
1362 + ".ido-grid",
1363 + ".pp-grid"
1364 + ];
1365 +
1366 + selectors.forEach(function(selector){
1367 + Array.from(
1368 + root.querySelectorAll(selector)
1369 + ).forEach(function(grid){
1370 + var children=
1371 + Array.from(
1372 + grid.children||[]
1373 + ).filter(visible);
1374 +
1375 + if(children.length<2){
1376 + return;
1377 + }
1378 +
1379 + var groups=[];
1380 +
1381 + children.forEach(function(child){
1382 + var top=
1383 + child
1384 + .getBoundingClientRect()
1385 + .top;
1386 +
1387 + var group=null;
1388 +
1389 + for(var i=0;i<groups.length;i++){
1390 + if(
1391 + Math.abs(
1392 + groups[i].top-top
1393 + )<=ROW_TOLERANCE
1394 + ){
1395 + group=groups[i];
1396 + break;
1397 + }
611 611   }
612 - });
613 613  
614 - if(targets.length<2)return;
1400 + if(!group){
1401 + group={
1402 + top:top,
1403 + items:[]
1404 + };
1405 + groups.push(group);
1406 + }
615 615  
616 - var max=0;
617 - targets.forEach(function(el){
618 - max=Math.max(max,el.getBoundingClientRect().height);
1408 + group.items.push(child);
619 619   });
620 620  
621 - max=Math.ceil(max);
622 - if(max<MIN_H)return;
1411 + groups.forEach(function(group){
1412 + if(group.items.length<2){
1413 + return;
1414 + }
623 623  
624 - targets.forEach(function(el){
625 - el.style.setProperty("min-height",max+"px");
626 - el.setAttribute("data-sn-equal-height-managed","1");
627 - managed.add(el);
1416 + var maxHeight=0;
1417 +
1418 + group.items.forEach(function(item){
1419 + maxHeight=
1420 + Math.max(
1421 + maxHeight,
1422 + item
1423 + .getBoundingClientRect()
1424 + .height
1425 + );
1426 + });
1427 +
1428 + maxHeight=
1429 + Math.ceil(maxHeight);
1430 +
1431 + group.items.forEach(function(item){
1432 + saveStyle(
1433 + item,
1434 + originalHeight,
1435 + "min-height"
1436 + );
1437 +
1438 + item.style.setProperty(
1439 + "min-height",
1440 + maxHeight+"px"
1441 + );
1442 +
1443 + item.setAttribute(
1444 + "data-sn-master-equal-height",
1445 + "1"
1446 + );
1447 +
1448 + managedHeight.add(item);
1449 + });
628 628   });
629 629   });
630 630   });
631 631   }
632 632  
633 - function schedule(){
634 - if(raf)cancelAnimationFrame(raf);
635 - raf=requestAnimationFrame(function(){
636 - raf=requestAnimationFrame(function(){
637 - raf=0;
638 - run();
639 - });
640 - });
1455 + /* =======================================================
1456 + RUN / RESPONSIVE SCHEDULING
1457 + ======================================================= */
1458 +
1459 + function run(){
1460 + if(running)return;
1461 +
1462 + running=true;
1463 +
1464 + try{
1465 + resetRuntime();
1466 + applyPlaceholderBadge();
1467 + propagateDetailAccents();
1468 +
1469 + var headers=
1470 + applyOverviewPalette();
1471 +
1472 + if(
1473 + window.innerWidth>
1474 + MOBILE_MAX
1475 + ){
1476 + alignOverviewCards(
1477 + headers
1478 + );
1479 +
1480 + equaliseDetailGrids();
1481 + }
1482 + }finally{
1483 + running=false;
1484 + }
641 641   }
642 642  
643 - addEventListener("resize",schedule,{passive:true});
644 - addEventListener("load",schedule,{once:true});
1487 + function onResize(){
1488 + if(resizeTimer){
1489 + clearTimeout(
1490 + resizeTimer
1491 + );
1492 + }
645 645  
646 - root.addEventListener("click",function(){
647 - setTimeout(schedule,0);
648 - },true);
1494 + resizeTimer=
1495 + setTimeout(
1496 + function(){
1497 + resizeTimer=0;
1498 + run();
1499 + },
1500 + RESIZE_DEBOUNCE
1501 + );
1502 + }
649 649  
650 - if(document.fonts&&document.fonts.ready){
651 - document.fonts.ready.then(schedule);
1504 + async function waitForReady(){
1505 + if(
1506 + document.readyState!=="complete"
1507 + ){
1508 + await new Promise(function(resolve){
1509 + window.addEventListener(
1510 + "load",
1511 + resolve,
1512 + {once:true}
1513 + );
1514 + });
1515 + }
1516 +
1517 + if(
1518 + document.fonts&&
1519 + document.fonts.ready
1520 + ){
1521 + try{
1522 + await document.fonts.ready;
1523 + }catch(error){}
1524 + }
1525 +
1526 + var images=
1527 + Array.from(
1528 + root.querySelectorAll("img")
1529 + );
1530 +
1531 + await Promise.all(
1532 + images.map(function(img){
1533 + if(img.complete){
1534 + return Promise.resolve();
1535 + }
1536 +
1537 + return new Promise(function(resolve){
1538 + var done=function(){
1539 + resolve();
1540 + };
1541 +
1542 + img.addEventListener(
1543 + "load",
1544 + done,
1545 + {once:true}
1546 + );
1547 +
1548 + img.addEventListener(
1549 + "error",
1550 + done,
1551 + {once:true}
1552 + );
1553 + });
1554 + })
1555 + );
1556 +
1557 + run();
652 652   }
653 653  
654 - schedule();
655 - setTimeout(schedule,250);
656 - setTimeout(schedule,900);
1560 + window.addEventListener(
1561 + "resize",
1562 + onResize,
1563 + {passive:true}
1564 + );
1565 +
1566 + waitForReady();
657 657  })();
658 658  </script>
659 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1569 +
1570 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
660 660  {{/html}}
661 661